Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
abb 2015-05-25 18:30:53 +01:00
commit f9aec93d73
17 changed files with 64 additions and 13 deletions

View File

@ -32,6 +32,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
/** /**

View File

@ -209,6 +209,7 @@ if ($resql)
$moreforfilter=''; $moreforfilter='';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1);
$moreforfilter.='       '; $moreforfilter.='       ';

View File

@ -299,6 +299,7 @@ if ($resql)
$moreforfilter=''; $moreforfilter='';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1);
$moreforfilter.='       '; $moreforfilter.='       ';

View File

@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$langs->load("products"); $langs->load("products");
$langs->load("categories"); $langs->load("categories");

View File

@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("categories"); $langs->load("categories");

View File

@ -275,6 +275,7 @@ if ($result)
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1);
$moreforfilter.='       '; $moreforfilter.='       ';

View File

@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT .'/core/db/DoliDB.class.php';
/** /**
* Class to manage Dolibarr database access for a MySQL database using the mysql extension * Class to manage Dolibarr database access for a MySQL database using the mysql extension
*
* @deprecated Use DoliDBMysqli
*/ */
class DoliDBMysql extends DoliDB class DoliDBMysql extends DoliDB
{ {

View File

@ -84,6 +84,7 @@ function societe_prepare_head(Societe $object)
//show categorie tab //show categorie tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_CUSTOMER; $type = Categorie::TYPE_CUSTOMER;
if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER; if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER;
$head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type; $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type;

View File

@ -89,6 +89,7 @@ function contact_prepare_head(Contact $object)
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_CONTACT; $type = Categorie::TYPE_CONTACT;
$head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type; $head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type;
$head[$tab][1] = $langs->trans('Categories'); $head[$tab][1] = $langs->trans('Categories');

View File

@ -789,14 +789,15 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
if ($displaytab > $limittoshow) if ($displaytab > $limittoshow)
{ {
$out.='<div id="moretabs" class="inline-block tabsElem">'; $tabsname=str_replace ("@", "", $picto);
$out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
$out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>'; $out.='<a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">'.$langs->trans("More").'...</a>';
$out.='<div id="moretabsList" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>'; $out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>';
$out.="</div>\n"; $out.="</div>\n";
$out.="<script>"; $out.="<script>";
$out.="$('#moretabs').mouseenter( function() { $('#moretabsList').css('left','auto');});"; $out.="$('#moretabs".$tabsname.").mouseenter( function() { $('#moretabsList".$tabsname.").css('left','auto');});";
$out.="$('#moretabs').mouseleave( function() { $('#moretabsList').css('left','-999em');});"; $out.="$('#moretabs".$tabsname.").mouseleave( function() { $('#moretabsList".$tabsname.").css('left','-999em');});";
$out.="</script>"; $out.="</script>";
} }

View File

@ -637,10 +637,21 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
//$date=dol_mktime(12, 0, 0, 1, 1, 1900); //$date=dol_mktime(12, 0, 0, 1, 1, 1900);
//$date=dol_stringtotime('20130101'); //$date=dol_stringtotime('20130101');
$hasglobalcounter=false;
// Extract value for mask counter, mask raz and mask offset // Extract value for mask counter, mask raz and mask offset
if (! preg_match('/\{(0+)([@\+][0-9\-\+\=]+)?([@\+][0-9\-\+\=]+)?\}/i',$mask,$reg)) return 'ErrorBadMask'; if (preg_match('/\{(0+)([@\+][0-9\-\+\=]+)?([@\+][0-9\-\+\=]+)?\}/i',$mask,$reg))
$masktri=$reg[1].(! empty($reg[2])?$reg[2]:'').(! empty($reg[3])?$reg[3]:''); {
$maskcounter=$reg[1]; $masktri=$reg[1].(! empty($reg[2])?$reg[2]:'').(! empty($reg[3])?$reg[3]:'');
$maskcounter=$reg[1];
$hasglobalcounter=true;
}
else
{
// setting some defaults so the rest of the code won't fail if there is a third party counter
$masktri='00000';
$maskcounter='00000';
}
$maskraz=-1; $maskraz=-1;
$maskoffset=0; $maskoffset=0;
$resetEveryMonth=false; $resetEveryMonth=false;
@ -660,6 +671,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
} }
else $maskrefclient=''; else $maskrefclient='';
// fail if there is neither a global nor a third party counter
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
{
return 'ErrorBadMask';
}
// Extract value for third party type // Extract value for third party type
if (preg_match('/\{(t+)\}/i',$mask,$regType)) if (preg_match('/\{(t+)\}/i',$mask,$regType))
{ {
@ -993,10 +1010,21 @@ function check_value($mask,$value)
{ {
$result=0; $result=0;
$hasglobalcounter=false;
// Extract value for mask counter, mask raz and mask offset // Extract value for mask counter, mask raz and mask offset
if (! preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg)) return 'ErrorBadMask'; if (preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg))
$masktri=$reg[1].(isset($reg[2])?$reg[2]:'').(isset($reg[3])?$reg[3]:''); {
$maskcounter=$reg[1]; $masktri=$reg[1].(isset($reg[2])?$reg[2]:'').(isset($reg[3])?$reg[3]:'');
$maskcounter=$reg[1];
$hasglobalcounter=true;
}
else
{
// setting some defaults so the rest of the code won't fail if there is a third party counter
$masktri='00000';
$maskcounter='00000';
}
$maskraz=-1; $maskraz=-1;
$maskoffset=0; $maskoffset=0;
if (dol_strlen($maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits'; if (dol_strlen($maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
@ -1015,6 +1043,12 @@ function check_value($mask,$value)
} }
else $maskrefclient=''; else $maskrefclient='';
// fail if there is neither a global nor a third party counter
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
{
return 'ErrorBadMask';
}
$maskwithonlyymcode=$mask; $maskwithonlyymcode=$mask;
$maskwithonlyymcode=preg_replace('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$maskcounter,$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$maskcounter,$maskwithonlyymcode);
$maskwithonlyymcode=preg_replace('/\{dd\}/i','dd',$maskwithonlyymcode); $maskwithonlyymcode=preg_replace('/\{dd\}/i','dd',$maskwithonlyymcode);

View File

@ -71,6 +71,7 @@ function member_prepare_head(Adherent $object)
// Show category tab // Show category tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_MEMBER; $type = Categorie::TYPE_MEMBER;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type; $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');

View File

@ -61,6 +61,7 @@ function product_prepare_head($object)
/* No more required. Replaced with new multiselect component /* No more required. Replaced with new multiselect component
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$type = Categorie::TYPE_PRODUCT; $type = Categorie::TYPE_PRODUCT;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type; $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories'); $head[$h][1] = $langs->trans('Categories');

View File

@ -168,6 +168,7 @@ if ($resql)
$moreforfilter=''; $moreforfilter='';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1); $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';

View File

@ -328,8 +328,9 @@ if (! empty($force_install_message))
$option.='>'; $option.='>';
$option.=$type.'&nbsp; &nbsp;'; $option.=$type.'&nbsp; &nbsp;';
if ($note) $option.=' '.$note; if ($note) $option.=' '.$note;
// Experimental // Deprecated and experimental
if ($type=='mssql') $option.=' '.$langs->trans("Experimental"); if ($type=='mysql') $option.=' ' . $langs->trans("Deprecated");
elseif ($type=='mssql') $option.=' '.$langs->trans("Experimental");
elseif ($type=='sqlite') $option.=' '.$langs->trans("Experimental"); elseif ($type=='sqlite') $option.=' '.$langs->trans("Experimental");
elseif ($type=='sqlite3') $option.=' '.$langs->trans("Experimental"); elseif ($type=='sqlite3') $option.=' '.$langs->trans("Experimental");
// No available // No available

View File

@ -64,6 +64,7 @@ DatabaseSuperUserAccess=Database server - Superuser access
CheckToCreateDatabase=Check box if database does not exist and must be created.<br>In this case, you must fill the login/password for superuser account at the bottom of this page. CheckToCreateDatabase=Check box if database does not exist and must be created.<br>In this case, you must fill the login/password for superuser account at the bottom of this page.
CheckToCreateUser=Check box if database owner does not exist and must be created.<br>In this case, you must choose its login and password and also fill the login/password for the superuser account at the bottom of this page. If this box is unchecked, owner database and its passwords must exists. CheckToCreateUser=Check box if database owner does not exist and must be created.<br>In this case, you must choose its login and password and also fill the login/password for the superuser account at the bottom of this page. If this box is unchecked, owner database and its passwords must exists.
Experimental=(experimental) Experimental=(experimental)
Deprecated=(deprecated)
DatabaseRootLoginDescription=Login of the user allowed to create new databases or new users, mandatory if your database or its owner does not already exists. DatabaseRootLoginDescription=Login of the user allowed to create new databases or new users, mandatory if your database or its owner does not already exists.
KeepEmptyIfNoPassword=Leave empty if user has no password (avoid this) KeepEmptyIfNoPassword=Leave empty if user has no password (avoid this)
SaveConfigurationFile=Save values SaveConfigurationFile=Save values

View File

@ -473,6 +473,7 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
print '<tr><td>'.$langs->trans("CategoryFilter").' &nbsp; </td>'; print '<tr><td>'.$langs->trans("CategoryFilter").' &nbsp; </td>';
print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'</td></tr>'; print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'</td></tr>';
} }