diff --git a/build/debian/control b/build/debian/control index 29c2469a4e6..970f192f094 100755 --- a/build/debian/control +++ b/build/debian/control @@ -10,12 +10,13 @@ Build-Depends: debhelper (>= 9), po-debconf Package: dolibarr Architecture: all -Depends: libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php, - php-cli, +# For debian 7 or 8 or 9 +Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5 | libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php, + php5-cli | php-cli, # Required PHP extensions - php-mysql | php-mysqli, php-curl, php-gd, php-ldap, + php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd, # Required PHP libraries - php-pear, php-mail-mime, php-xml, php-mbstring, + php-pear, php-mail-mime, # php-tcpdf, # libfpdf-tpl-php, php-fpdf, # libphp-adodb, @@ -30,7 +31,9 @@ Depends: libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php ${misc:Depends}, ${perl:Depends} Recommends: apache2 | lighttpd | httpd, - mariadb-server | virtual-mysql-server + mariadb-server | virtual-mysql-server, +# Required PHP extensions for debian 9 but we can't add them into a Depends, it does not exists on debian 7 and 8 + php-xml, php-mbstring Suggests: www-browser, php5-geoip Description: Web based software to manage a company or foundation Dolibarr ERP & CRM is an easy to use open source/free software package for diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index f566938d7e0..bb3430eb22c 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -300,6 +300,8 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0; // install.lang if (preg_match('/^KeepDefaultValues/', $value)) $qualifiedforclean=0; + // mail.lang + if (preg_match('/MailingModuleDesc/i', $value)) $qualifiedforclean=0; // main.lang if (preg_match('/^Duration/', $value)) $qualifiedforclean=0; if (preg_match('/^FormatDate/', $value)) $qualifiedforclean=0; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index e037549add8..d2b039a28e0 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -1200,7 +1200,7 @@ else $showemptyline=0; } - $var=!$var; + $value=$tabname[$i]; print ''; if (! empty($tabcond[$i])) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 8e265eb70f7..1169c379e59 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -128,12 +128,12 @@ print "\n"; $var=true; // Login/Pass required for members -$var=!$var; + print '
'; print ''; print ''; print ''; -print ''.$langs->trans("AdherentLoginRequired").''; +print ''.$langs->trans("AdherentLoginRequired").''; print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1); print ''; print ''; @@ -141,12 +141,12 @@ print "\n"; print '
'; // Mail required for members -$var=!$var; + print '
'; print ''; print ''; print ''; -print ''.$langs->trans("AdherentMailRequired").''; +print ''.$langs->trans("AdherentMailRequired").''; print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1); print ''; print ''; @@ -154,12 +154,12 @@ print "\n"; print '
'; // Send mail information is on by default -$var=!$var; + print '
'; print ''; print ''; print ''; -print ''.$langs->trans("MemberSendInformationByMailByDefault").''; +print ''.$langs->trans("MemberSendInformationByMailByDefault").''; print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1); print ''; print ''; @@ -167,12 +167,12 @@ print "\n"; print '
'; // Insert subscription into bank account -$var=!$var; + print '
'; print ''; print ''; print ''; -print ''.$langs->trans("MoreActionsOnSubscription").''; +print ''.$langs->trans("MoreActionsOnSubscription").''; $arraychoices=array('0'=>$langs->trans("None")); if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect"); if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly"); @@ -188,12 +188,12 @@ print '
'; // Use vat for invoice creation if ($conf->facture->enabled) { - $var=!$var; + print '
'; print ''; print ''; print ''; - print ''.$langs->trans("VATToUseForSubscriptions").''; + print ''.$langs->trans("VATToUseForSubscriptions").''; if (! empty($conf->banque->enabled)) { print ''; @@ -213,12 +213,12 @@ if ($conf->facture->enabled) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - $var=!$var; + print ''; print ''; print ''; print ''; - print ''.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").''; + print ''.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").''; print ''; $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'); print ''; diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 47ad7a00a97..74cd048de31 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -150,7 +150,7 @@ $var=true; // Allow public form $var=! $var; print ''; -print ''; +print ''; print $langs->trans("EnablePublicSubscriptionForm"); print ''; print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 020dbc58474..852b051e3dd 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -209,6 +209,23 @@ class Adherent extends CommonObject // Substitutions $substitutionarray=array( + '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, + '__ID__'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, + '__CIVILITY__'=>$this->getCivilityLabel(), + '__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, + '__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, + '__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), + '__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, + '__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address, + '__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, + '__TOWN_'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, + '__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, + '__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, + '__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, + '__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, + '__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, + '__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass, + // For backward compatibility '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, '%CIVILITY%'=>$this->getCivilityLabel(), @@ -225,7 +242,6 @@ class Adherent extends CommonObject '%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, '%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, '%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass, - // For backward compatibility '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, @@ -234,16 +250,10 @@ class Adherent extends CommonObject '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, ); - // Add extrafields as substitution key %EXTRA_XXX% - foreach($this->array_options as $key => $val) - { - $keyshort=preg_replace('/^(options|extra)_/','',$key); - $substitutionarray['%EXTRA_'.$keyshort.'%']=$val; - } - complete_substitutions_array($substitutionarray, $langs); + complete_substitutions_array($substitutionarray, $langs, $this); - return make_substitutions($text,$substitutionarray); + return make_substitutions($text, $substitutionarray, $langs); } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 9c1b0bb01e1..6440fb72cb8 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -246,8 +246,8 @@ $var=true; krsort($Total); foreach ($Total as $key=>$value) { - $var=!$var; - print ""; + + print ''; print "$key"; print "".$Number[$key].""; print "".price($value).""; @@ -298,9 +298,9 @@ if ($resql) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; $staticmember->id=$obj->rowid; $staticmember->lastname=$obj->lastname; $staticmember->firstname=$obj->firstname; @@ -361,9 +361,9 @@ if ($resql) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; $subscriptionstatic->id=$obj->cid; $subscriptionstatic->ref=$obj->cid; $staticmember->id=$obj->rowid; @@ -407,8 +407,8 @@ print "\n"; foreach ($AdherentType as $key => $adhtype) { - $var=!$var; - print ""; + + print ''; print ''.$adhtype->getNomUrl(1, dol_size(32)).''; print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''; print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''; diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index c717d20be84..bd731e771f3 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -131,8 +131,8 @@ $var=true; foreach ($data as $val) { $year = $val['year']; - $var=!$var; - print ''; + + print ''; print ''.$memberstatic->getmorphylib($val['label']).''; print ''.$val['nb'].''; print ''.dol_print_date($val['lastdate'],'dayhour').''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index ae128d940e8..d2254b4afd6 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -295,8 +295,8 @@ if ($mode) foreach ($data as $val) { $year = $val['year']; - $var=!$var; - print ''; + + print ''; print ''.$val['label'].''; if ($label2) print ''.$val['label2'].''; print ''.$val['nb'].''; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index aec8cd588f6..d1a8e707e43 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -183,7 +183,7 @@ foreach ($data as $val) while ($oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print ''; print ''; print ''; @@ -195,7 +195,7 @@ foreach ($data as $val) print '0'; print ''; } - $var=!$var; + print ''; print ''; //print ''; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 0c9c8467f1f..cc7fbef58f5 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -825,8 +825,8 @@ if ($rowid > 0) while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; $subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->id=$objp->crowid; print ''.$subscriptionstatic->getNomUrl(1).''; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index e5abe964d7f..750ad483461 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -285,7 +285,7 @@ if ($result) $adherent->login=$obj->login; $adherent->photo=$obj->photo; - $var=!$var; + print ''; @@ -337,7 +337,7 @@ if ($result) } // Total - $var=!$var; + print ''; print "".$langs->trans("Total")."\n"; print " \n"; diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index f593e72faa9..19324812beb 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -33,7 +33,7 @@ $var=true; $total=0; foreach($linkedObjectBlock as $key => $objectlink) { - $var=!$var; + ?> > trans("Subscription"); ?> diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 846b0dab7a9..164c921d766 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -210,8 +210,8 @@ if (! $rowid && $action != 'create' && $action != 'edit') while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; print ''.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.''; print ''.dol_escape_htmltag($objp->libelle).''; print ''.yn($objp->subscription).''; @@ -530,8 +530,8 @@ if ($rowid > 0) $adh->firstname=$objp->firstname; // Lastname - $var=!$var; - print ''; + + print ''; if ($objp->societe != '') { print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).''."\n"; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c11cbeff3a4..d076fcf7e26 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -173,8 +173,8 @@ if (! empty($triggers)) if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; if ($trigger['code'] == 'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; - $var=!$var; - print ''; + + print ''; print ''.$trigger['code'].''; print ''.$trigger['label'].''; print ''; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 79e6d3dbd6c..1e595b5088e 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -155,8 +155,8 @@ print ''.$langs->trans("Value").""; print ""; // Show external agenda -$var=!$var; -print ""; + +print ''; print "".$langs->trans("ExtSitesEnableThisTool").""; print ''; if ($conf->use_javascript_ajax) @@ -178,8 +178,8 @@ print ""; print ""; // Nb of agenda -$var=!$var; -print ""; + +print ''; print "".$langs->trans("ExtSitesNbOfAgenda").""; print ''; print ''; @@ -210,8 +210,8 @@ while ($i <= $MAXAGENDA) $color='AGENDA_EXT_COLOR'.$key; $enabled='AGENDA_EXT_ENABLED'.$key; - $var=!$var; - print ""; + + print ''; // Nb print ''.$langs->trans("AgendaExtNb",$key).""; // Name diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 9bf3a4ddc16..6e0a62610aa 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -265,7 +265,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) require_once $dir.'/'.$file; $module = new $classname($db, new ActionComm($db)); - $var=!$var; + print "\n"; print ""; print (empty($module->name)?$name:$module->name); @@ -351,8 +351,8 @@ print ''.$langs->trans("Value").''."\n"; print ''."\n"; // Manual or automatic -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''.$langs->trans("AGENDA_USE_EVENT_TYPE").''."\n"; print ' '."\n"; print ''."\n"; @@ -369,9 +369,9 @@ print ''."\n"; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $var=!$var; + print ''; - print ''."\n"; + print ''."\n"; print ''.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").''."\n"; print ' '."\n"; print ''."\n"; @@ -380,8 +380,8 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) } // AGENDA_DEFAULT_FILTER_TYPE -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").''."\n"; print ' '."\n"; print ''."\n"; @@ -389,8 +389,8 @@ $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AG print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").''."\n"; print ' '."\n"; print ''."\n"; @@ -398,8 +398,8 @@ $formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_ print ''."\n"; // AGENDA_DEFAULT_VIEW -$var=!$var; -print ''."\n"; + +print ''."\n"; print ''.$langs->trans("AGENDA_DEFAULT_VIEW").''."\n"; print ' '."\n"; print ''."\n"; @@ -410,8 +410,8 @@ print ''."\n"; // AGENDA NOTIFICATION if ($conf->global->MAIN_FEATURES_LEVEL > 0) { - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''.$langs->trans('AGENDA_NOTIFICATION').''."\n"; print ' '."\n"; print ''."\n"; @@ -422,8 +422,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) } else { print ''.img_picto($langs->trans('Enabled'),'switch_on').''; print ''."\n"; - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''.$langs->trans('AGENDA_NOTIFICATION_SOUND').''."\n"; print ' '."\n"; print ''."\n"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 58d97842017..98cecb2f44b 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -199,7 +199,7 @@ while ($i < $nbofbank) { $var = !$var; - print ''; + print ''; print ''.$bankorder[$i][0]."\n"; print $bankorder[$i][1]; print ''; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 29475d712df..db81c9a325f 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -215,7 +215,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - print ''; + print ''; print $obj->libelle; print "\n"; print $langs->trans('BarcodeDesc'.$obj->encoding); @@ -276,7 +276,7 @@ if ($resql) print ''; print $formbarcode->setBarcodeEncoder($obj->coder,$barcodelist,$obj->rowid,'form'.$i); print "\n"; - $var=!$var; + $i++; } } @@ -312,8 +312,8 @@ print ''; // Chemin du binaire genbarcode sous linux if (! isset($_SERVER['WINDIR'])) { - $var=!$var; - print ''; + + print ''; print ''.$langs->trans("GenbarcodeLocation").''; print ''; print ''; @@ -328,8 +328,8 @@ if (! isset($_SERVER['WINDIR'])) // Module products if (! empty($conf->product->enabled)) { - $var=!$var; - print ""; + + print ''; print ''.$langs->trans("SetDefaultBarcodeTypeProducts").''; print ''; $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1); @@ -339,8 +339,8 @@ if (! empty($conf->product->enabled)) // Module thirdparty if (! empty($conf->societe->enabled)) { - $var=!$var; - print ""; + + print ''; print ''.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; print ''; print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1); @@ -397,7 +397,7 @@ if ($conf->produit->enabled) $modBarCode = new $file(); $var = !$var; - print ''; + print ''; print ''.(isset($modBarCode->name)?$modBarCode->name:$modBarCode->nom)."\n"; print $modBarCode->info($langs); print ''; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 9785e945a6a..c76c35dfdeb 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -342,7 +342,7 @@ print "\n"; $var=true; foreach($boxtoadd as $box) { - $var=!$var; + if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) { @@ -354,7 +354,7 @@ foreach($boxtoadd as $box) } print "\n".''."\n"; - print ''."\n"; + print ''."\n"; print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; print ''."\n"; @@ -421,7 +421,7 @@ foreach($boxactivated as $key => $box) } print "\n".''."\n"; - print ''; + print ''; print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; print ''; @@ -468,7 +468,7 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print ''; -print ''; +print ''; print ''; print $langs->trans("MaxNbOfLinesForBoxes"); print ''."\n"; @@ -479,8 +479,8 @@ print ''; // Activate FileCache - Developement if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { - $var=!$var; - print ''.$langs->trans("EnableFileCache").''; + + print ''.$langs->trans("EnableFileCache").''; print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1); print ''; print ''; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index f319692f27d..3b205f49cd2 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -166,7 +166,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print ''; + print ''; print (empty($module->name)?$name:$module->name); print "\n"; @@ -257,7 +257,7 @@ $var=true; $var=! $var; -print ''; +print ''; print $langs->trans("FreeLegalTextOnChequeReceipts").' ('.$langs->trans("AddCRIfTooLong").')
'; $variablename='BANK_CHEQUERECEIPT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index a77fb706a71..060c910753a 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -80,16 +80,16 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Value").''; print "\n"; -$var=!$var; -print ''; + +print ''; print $langs->trans("ClickToDialUseTelLink").''; print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'
'; print '
'; print $langs->trans("ClickToDialUseTelLinkDesc"); print ''; -$var=!$var; -print ''; + +print ''; print $langs->trans("DefaultLink").''; print 'global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'">
'; print '
'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index a9041f5272b..3933f5d00ab 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -284,7 +284,7 @@ print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); $head = order_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Orders"), 0, 'order'); +dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order'); /* * Orders Numbering model @@ -330,8 +330,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print ''.$module->nom."\n"; + + print ''.$module->nom."\n"; print $module->info(); print ''; @@ -471,7 +471,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print ''; + print ''; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -569,7 +569,7 @@ $var=! $var; print ''; print ''; print ''; -print ''; +print ''; print $langs->trans("FreeLegalTextOnOrders").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='ORDER_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -588,13 +588,19 @@ print "\n"; print '
'; //Use draft Watermark -$var=!$var; + print "
"; print ''; print ""; -print ''; -print $langs->trans("WatermarkOnDraftOrders").''; -print ''; +print ''; +$substitutionarray=pdf_getSubstitutionArray($langs); +$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); +$htmltext = ''.$langs->trans("AvailableVariables").':
'; +foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; +$htmltext.='
'; +print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext); +print ''; +print ''; print ''; print ''; print "\n"; @@ -603,8 +609,8 @@ print '
'; // Shippable Icon in List /* Kept as hidden feature for the moment, result seems bugged. Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ? -$var=!$var; -print ""; + +print ''; print ''.$langs->trans("ShippableOrderIconInList").''; print ' '; print ''; @@ -623,8 +629,8 @@ print ''; // Ask for payment bank during order if ($conf->banque->enabled) { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { @@ -645,16 +651,16 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print ''; + + print ''; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '.$langs->trans('NotAvailable').''; } // Ask for warehouse during order if ($conf->stock->enabled) { - $var=!$var; - print ''; + + print ''; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { @@ -675,8 +681,8 @@ if ($conf->stock->enabled) } else { - $var=!$var; - print ''; + + print ''; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').''; } */ @@ -697,7 +703,7 @@ print ''; print ' '; print "\n"; -print ''; +print ''; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print ''; print "\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d73f23d0ef7..8c29fe67a1c 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -309,72 +309,72 @@ if ($action == 'edit' || $action == 'updateedit') print ''.$langs->trans("CompanyInfo").''.$langs->trans("Value").''."\n"; // Name - $var=!$var; - print ''; + + print ''; print ''."\n"; // Addresse - $var=!$var; - print ''; + + print ''; print ''."\n"; - $var=!$var; - print ''; + + print ''; print ''."\n"; - $var=!$var; - print ''; + + print ''; print ''."\n"; // Country - $var=!$var; - print ''; + + print ''; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''."\n"; - $var=!$var; - print ''; + + print ''; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); print ''."\n"; - $var=!$var; - print ''; + + print ''; print $form->selectCurrency($conf->currency,"currency"); print ''."\n"; - $var=!$var; - print ''; + + print ''; print ''; print ''."\n"; - $var=!$var; - print ''; + + print ''; print ''; print ''."\n"; - $var=!$var; - print ''; + + print ''; print ''; print ''."\n"; // Web - $var=!$var; - print ''; + + print ''; print ''; print ''."\n"; // Barcode if (! empty($conf->barcode->enabled)) { - $var=!$var; - print ''; + + print ''; print ''; print ''; } // Logo - $var=!$var; + print ''; print ''; // Note - $var=!$var; - print ''; print ''; @@ -409,18 +409,18 @@ if ($action == 'edit' || $action == 'updateedit') $langs->load("companies"); // Managing Director(s) - $var=!$var; - print ''; // Capital - $var=!$var; - print ''; // Juridical Status - $var=!$var; - print ''; // Object of the company - $var=!$var; - print ''; print ''; @@ -547,8 +547,8 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=true; - $var=!$var; - print ''; print "
'; print ''; @@ -392,8 +392,8 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; print '
'; + + print '
'; if ($mysoc->country_code) { print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code'); } else { @@ -431,8 +431,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfID1 if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -447,8 +447,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId2 if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -463,8 +463,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId3 if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -479,8 +479,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId4 if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -495,8 +495,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId5 if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -511,8 +511,8 @@ if ($action == 'edit' || $action == 'updateedit') // ProfId6 if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { - $var=!$var; - print '
'; + + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -525,14 +525,14 @@ if ($action == 'edit' || $action == 'updateedit') } // TVA Intra - $var=!$var; - print '
'; + + print '
'; print ''; print '
'; + + print '
'; print '
'; + + print '
'; print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '
"; @@ -563,7 +563,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=true; - $var=!$var; + print ""; print ''; print ""; @@ -572,7 +572,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
"; print "\n"; - $var=!$var; + print ""; print ''; print ""; @@ -596,7 +596,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print "\n"; $var=true; - $var=!$var; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option print ""; print '
 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; @@ -619,7 +619,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
"; print "\n"; - $var=!$var; + print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code).""; print ''; print ""; @@ -641,7 +641,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=true; - $var=!$var; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option print ""; print '
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; @@ -661,7 +661,7 @@ if ($action == 'edit' || $action == 'updateedit') print "
"; print "\n"; - $var=!$var; + print "global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code).""; print ''; print ""; @@ -698,23 +698,23 @@ else print ''; $var=true; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; + + print ''; // Web - $var=!$var; - print ''; + + print ''; // Barcode if (! empty($conf->barcode->enabled)) { - $var=!$var; - print ''; + + print ''; } // Logo - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; + + print '
'.$langs->trans("CompanyName").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyCountry").''; + + print '
'.$langs->trans("CompanyCountry").''; if ($mysoc->country_code) { $img=picto_from_langcode($mysoc->country_code); @@ -724,43 +724,43 @@ else else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; print '
'.$langs->trans("State").''; + + print '
'.$langs->trans("State").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE); else print ' '; print '
'.$langs->trans("CompanyCurrency").''; + + print '
'.$langs->trans("CompanyCurrency").''; print currency_name($conf->currency,1); print ' ('.$conf->currency; print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); print ')'; print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Logo").''; + + print '
'.$langs->trans("Logo").''; $tagtd='tagtd '; if ($conf->browser->layout == 'phone') $tagtd=''; @@ -785,8 +785,8 @@ else print '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'; @@ -802,26 +802,26 @@ else $var=true; // Managing Director(s) - $var=!$var; - print ''.$langs->trans("ManagingDirectors").''; + + print ''.$langs->trans("ManagingDirectors").''; print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . ''; // Capital - $var=!$var; - print ''.$langs->trans("Capital").''; + + print ''.$langs->trans("Capital").''; print $conf->global->MAIN_INFO_CAPITAL . ''; // Juridical Status - $var=!$var; - print ''.$langs->trans("JuridicalStatus").''; + + print ''.$langs->trans("JuridicalStatus").''; print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); print ''; // ProfId1 if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { - $var=!$var; - print ''.$langs->transcountry("ProfId1",$mysoc->country_code).''; + + print ''.$langs->transcountry("ProfId1",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; @@ -836,8 +836,8 @@ else // ProfId2 if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { - $var=!$var; - print ''.$langs->transcountry("ProfId2",$mysoc->country_code).''; + + print ''.$langs->transcountry("ProfId2",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; @@ -852,8 +852,8 @@ else // ProfId3 if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { - $var=!$var; - print ''.$langs->transcountry("ProfId3",$mysoc->country_code).''; + + print ''.$langs->transcountry("ProfId3",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; @@ -868,8 +868,8 @@ else // ProfId4 if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { - $var=!$var; - print ''.$langs->transcountry("ProfId4",$mysoc->country_code).''; + + print ''.$langs->transcountry("ProfId4",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; @@ -884,8 +884,8 @@ else // ProfId5 if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { - $var=!$var; - print ''.$langs->transcountry("ProfId5",$mysoc->country_code).''; + + print ''.$langs->transcountry("ProfId5",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; @@ -900,8 +900,8 @@ else // ProfId6 if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { - $var=!$var; - print ''.$langs->transcountry("ProfId6",$mysoc->country_code).''; + + print ''.$langs->transcountry("ProfId6",$mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; @@ -914,8 +914,8 @@ else } // VAT - $var=!$var; - print ''.$langs->trans("VATIntra").''; + + print ''.$langs->trans("VATIntra").''; print ''; if (! empty($conf->global->MAIN_INFO_TVAINTRA)) { @@ -951,8 +951,8 @@ else print ''; print ''; - $var=!$var; - print ''.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . ''; + + print ''.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . ''; print ''; print ''; @@ -967,8 +967,8 @@ else print "\n"; $var=true; - $var=!$var; - print ''.$langs->trans("FiscalMonthStart").''; + + print ''.$langs->trans("FiscalMonthStart").''; $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . ''; @@ -985,7 +985,7 @@ else print "\n"; $var=true; - $var=!$var; + print "global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed").""; print ''; print ""; @@ -994,7 +994,7 @@ else print "
"; print "\n"; - $var=!$var; + print "global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed").""; print ''; print ""; @@ -1020,7 +1020,7 @@ else print "\n"; $var=true; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print ''; + print ''; print ''; print ''; print ''; @@ -239,7 +239,7 @@ else print ''; $var=false; - print ''; + print ''; print ''; print '
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; @@ -1048,7 +1048,7 @@ else print "
"; print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; @@ -1071,7 +1071,7 @@ else print "\n"; $var=true; - $var=!$var; + print ""; print '\n"; - $var=!$var; + print ""; print ''; + print ''; print ''; print ''; @@ -192,7 +192,7 @@ if ($action == 'edit') print ''; $var=false; - print ''; + print ''; print ''; print '
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; @@ -1100,7 +1100,7 @@ else print "
"; print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index abe5663084b..c097b9f39b1 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -148,7 +148,7 @@ print "\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 7fa47724c3d..7d7b8a8510c 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -197,7 +197,7 @@ print "\n"; $var=false; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; + print ''."\n"; // Value print ''; @@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '\n"; $var=true; $var=! $var; -print ''."\n"; //Use draft Watermark -$var=!$var; -print ''."\n"; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 237f235f99c..0bc620c41bf 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -37,7 +37,7 @@ if (!$user->admin) accessforbidden(); $id=GETPOST('rowid','int'); $action=GETPOST('action','alpha'); -$mode = GETPOST('mode')?GETPOST('mode'):'createform'; +$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder' $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -47,13 +47,15 @@ if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield='lang,transkey'; +if (! $sortfield) $sortfield='page,param'; if (! $sortorder) $sortorder='ASC'; $defaulturl = GETPOST('defaulturl'); $defaultkey = GETPOST('defaultkey','alpha'); $defaultvalue = GETPOST('defaultvalue'); +$defaulturl=preg_replace('/^\//', '', $defaulturl); + /* * Actions @@ -69,7 +71,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers { $defaulturl=''; $defaultkey=''; @@ -95,13 +97,13 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) } if (! $error) { - //$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')"; - //$result = $db->query($sql); - - // TODO Insert var - + $db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."default_values(type, user_id, page, param, value, entity) VALUES ('".$db->escape($mode)."', 0, '".$db->escape($defaulturl)."','".$db->escape($defaultkey)."','".$db->escape($defaultvalue)."', ".$db->escape($conf->entity).")"; + $result = $db->query($sql); if ($result > 0) { + $db->commit(); setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=""; $defaulturl=''; @@ -110,7 +112,8 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) } else { - dol_print_error($db); + $db->rollback(); + setEventMessages($db->lasterror(), null, 'errors'); $action=''; } } @@ -119,7 +122,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) // Delete line from delete picto if ($action == 'delete') { - //$sql = "DELETE FROM ".MAIN_DB_PREFIX."overwrite_trans WHERE rowid = ".$db->escape($id); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."default_values WHERE rowid = ".$db->escape($id); // Delete const $result = $db->query($sql); if ($result >= 0) @@ -176,7 +179,7 @@ dol_fiche_head($head, $mode, '', -1, ''); print ''; print ''; -print ''; +print ''; print '
'; print ''; print ''; @@ -247,11 +247,11 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; + print "\n"; - print '
'.$obj->name.'
'.$obj->name.''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 487203c9f4d..bc3ea402704 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -266,8 +266,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -503,7 +503,7 @@ print "
'; +print '
'; print $langs->trans("FreeLegalTextOnContracts").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='CONTRACT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -519,8 +519,8 @@ else print '
'; + +print '
'; print $langs->trans("WatermarkOnDraftContractCards").''; print ''; print '
'; print ''; @@ -185,16 +188,29 @@ if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCrea else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php'); $texturl=$form->textwithpicto($langs->trans("Url"), $texthelp); print_liste_field_titre($texturl,$_SERVER["PHP_SELF"],'defaulturl','',$param,'',$sortfield,$sortorder); +$texthelp=$langs->trans("TheKeyIsTheNameOfHtmlField"); +if ($mode != 'sortorder') $textkey=$form->textwithpicto($langs->trans("Key"), $texthelp); +else $textkey=$form->textwithpicto($langs->trans("Key"), $texthelp); +print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'defaultkey','',$param,'',$sortfield,$sortorder); if ($mode != 'sortorder') { - $texthelp=$langs->trans("TheKeyIsTheNameOfHtmlField"); - $textkey=$form->textwithpicto($langs->trans("Key"), $texthelp); - print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'defaultkey','',$param,'',$sortfield,$sortorder); + $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
'; + // See list into GETPOST + $texthelp.='__USERID__
'; + $texthelp.='__MYCOUNTRYID__
'; + $texthelp.='__DAY__
'; + $texthelp.='__MONTH__
'; + $texthelp.='__YEAR__
'; + if (! empty($conf->multicompany->enabled)) $texthelp.='__ENTITYID__
'; + $textvalue=$form->textwithpicto($langs->trans("Value"), $texthelp); +} +else +{ + $texthelp='ASC or DESC'; + $textvalue=$form->textwithpicto($langs->trans("SortOrder"), $texthelp); } -$texthelp=$langs->trans("YouCanUseSubstitutionValue"); -$textvalue=$form->textwithpicto($langs->trans("Value"), $texthelp); print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'defaultvalue', '', $param, '', $sortfield, $sortorder); -//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); +if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder); print ''; print "\n"; @@ -206,17 +222,14 @@ print ''; print ''."\n"; -if ($mode != 'sortorder') -{ - print ''; -} +print ''; print ''; // Limit to superadmin -/*if (! empty($conf->multicompany->enabled) && !$user->entity) +if (! empty($conf->multicompany->enabled) && !$user->entity) { print ''; print '\n"; print ''; // Show constants -/*$sql = "SELECT"; -$sql.= " rowid"; -$sql.= ", lang"; -$sql.= ", transkey"; -$sql.= ", transvalue"; -$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; -$sql.= " WHERE 1 = 1";*/ -//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; -//if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug -//else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits -//if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name')); -//$sql.= " ORDER BY entity, name ASC"; +$sql = "SELECT rowid, entity, type, page, param, value"; +$sql.= " FROM ".MAIN_DB_PREFIX."default_values"; +$sql.= " WHERE type = '".$db->escape($mode)."'"; +$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; $sql.= $db->order($sortfield, $sortorder); dol_syslog("translation::select from table", LOG_DEBUG); @@ -254,22 +259,18 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $var=false; while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; + print "\n"; print ''; - print ''."\n"; - if ($mode != 'sortorder') - { - print ''."\n"; - } + print ''."\n"; + print ''."\n"; // Value print ''; print ''; print "\n"; @@ -290,6 +291,10 @@ if ($result) $i++; } } +else +{ + dol_print_error($db); +} print '
'; print ''; print ''; - print ''; - print ''; +print ''; +print ''; print ''; print ''; print ''; @@ -224,28 +237,20 @@ print ''; } else -{*/ +{ print ''; print ''; -//} +} print ''; print "
'.$obj->lang.''.$obj->transkey.''.$obj->page.''.$obj->param.''; @@ -278,11 +279,11 @@ if ($result) print ''; print ''; */ - print $obj->transvalue; + print $obj->value; print ''; - print ''.img_delete().''; + print ''.img_delete().''; print '
'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 597327c04ba..0280673906b 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -173,9 +173,9 @@ if ($action == 'edit') { foreach($delays as $delay) { - $var=!$var; + $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); - print '
'.img_object('',$delay['img']).''.$langs->trans('Delays_'.$delay['code']).''; print ' '.$langs->trans("days").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '
'; @@ -220,9 +220,9 @@ else { foreach($delays as $delay) { - $var=!$var; + $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); - print '
'.img_object('',$delay['img']).''.$langs->trans('Delays_'.$delay['code']).''.$value.' '.$langs->trans("days").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_METEO").'' . yn($conf->global->MAIN_DISABLE_METEO) . '
'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7392ca23905..95692672523 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -78,6 +78,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $search_country_id = GETPOST('search_country_id','int'); +$search_code = GETPOST('search_code','alpha'); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('admin')); @@ -569,6 +570,7 @@ if ($id == 10) if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) { $search_country_id = ''; + $search_code = ''; } // Actions add or modify an entry into a dictionary @@ -803,7 +805,7 @@ if ($action == $acts[0]) $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -823,7 +825,7 @@ if ($action == $acts[1]) $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -843,7 +845,7 @@ if ($action == 'activate_favorite') $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -863,7 +865,7 @@ if ($action == 'disable_favorite') $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'"; } elseif ($_GET["code"]) { - $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".$_GET["code"]."'"; + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($_GET["code"])."'"; } $result = $db->query($sql); @@ -915,7 +917,7 @@ print "
\n"; // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.urlencode($_GET["code"]).'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } //var_dump($elementList); @@ -927,12 +929,9 @@ if ($id) // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - if ($search_country_id > 0) - { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; - else $sql.=" WHERE "; - $sql.= " c.rowid = ".$search_country_id; - } + if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1"; + if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id; + if ($search_code != '') $sql.= natural_search("code", $search_code); if ($sortfield) { @@ -961,16 +960,15 @@ if ($id) print ''; print ''; - print ''; - // Form to add a new line if ($tabname[$id]) { $alabelisused=0; - $var=false; - + $fieldlist=explode(',',$tabfield[$id]); + print '
'; + // Line for title print ''; foreach ($fieldlist as $field => $value) @@ -979,38 +977,40 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class=''; if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } if ($fieldlist[$field]=='taux') { if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate"); else $valuetoshow=$langs->trans("Amount"); - $align='center'; + $class='center'; } - if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; } - if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $align="center"; } - if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; } - if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $align="center"; } + if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $class="center"; $sortable=0; } + if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $class="center"; } + if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $class="center"; $sortable=0; } + if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $class="center"; } if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); else $valuetoshow=$langs->trans("Type"); } - if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } + if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); $class='width100'; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { - $valuetoshow=$langs->trans("Label"); - if ($id != 25) $valuetoshow.="*"; + if ($id != 25) $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + else $valuetoshow=$langs->trans("Label"); + } + if ($fieldlist[$field]=='libelle_facture') { + $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); } - if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } if ($fieldlist[$field]=='country') { if (in_array('region_id',$fieldlist)) { print ''; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } - if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; } + if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $class="center"; } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } - if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; } + if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $class="center"; } if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); } if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); } if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); } @@ -1051,7 +1051,7 @@ if ($id) if ($valuetoshow != '') { - print ''; // Line to enter new values - print ""; + print ''; $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. @@ -1087,7 +1087,7 @@ if ($id) $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; - if ($id == 3) unset($fieldlist[2]); // Remove field ??? if ??? + if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionnary Regions if (empty($reshook)) { @@ -1106,15 +1106,22 @@ if ($id) $colspan=count($fieldlist)+3; if ($id == 4) $colspan++; - if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of * + print '
 '; + print ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); else print $valuetoshow; @@ -1069,7 +1069,7 @@ if ($id) print '
'; + + /*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of * { - print '* '.$langs->trans("LabelUsedByDefault").'.'; - } - print ' '; // Keep   to have a line with enough height + print '* '.$langs->trans("LabelUsedByDefault").'.
'; + }*/ } + print ''; - + print '
'; + + print '
'; + print ''; + print ''; + // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); $resql=$db->query($sql); @@ -1122,10 +1129,10 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param = '&id='.$id; if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; + if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id); $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; @@ -1134,13 +1141,56 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); - print ''; } + print ''; + + // Title line with search boxes + print ''; + $filterfound=0; + foreach ($fieldlist as $field => $value) + { + $showfield=1; // By defaut + + if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } + + if ($showfield) + { + if ($value == 'country') + { + print ''; + $filterfound++; + } + elseif ($value == 'code') + { + print ''; + $filterfound++; + } + else + { + print ''; + } + } + } + if ($id == 4) print ''; + print ''; + print ''; + print ''; + // Title of lines - print ''; + print ''; foreach ($fieldlist as $field => $value) { // Determine le nom du champ par rapport aux noms possibles @@ -1175,10 +1225,14 @@ if ($id) if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { - $valuetoshow=$langs->trans("Label"); - if ($id != 25) $valuetoshow.="*"; + //if ($id != 25) $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + //else $valuetoshow=$langs->trans("Label"); + $valuetoshow=$langs->trans("Label"); + } + if ($fieldlist[$field]=='libelle_facture') { + //$valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + $valuetoshow=$langs->trans("LabelOnDocuments"); } - if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; } if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; } if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); } @@ -1229,51 +1283,14 @@ if ($id) print getTitleFieldOfList(''); print ''; - // Title line with search boxes - print ''; - $filterfound=0; - foreach ($fieldlist as $field => $value) - { - $showfield=1; // By defaut - - if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } - - if ($showfield) - { - if ($value == 'country') - { - print ''; - $filterfound++; - } - else - { - print ''; - } - } - } - if ($id == 4) print ''; - print ''; - print ''; - print ''; - if ($num) { // Lines with values while ($i < $num) { - $var = ! $var; - $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { $tmpaction='edit'; @@ -1295,7 +1312,7 @@ if ($id) else { $tmpaction = 'view'; - $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -1304,7 +1321,6 @@ if ($id) { foreach ($fieldlist as $field => $value) { - $showfield=1; $align="left"; $valuetoshow=$obj->{$fieldlist[$field]}; @@ -1472,7 +1488,8 @@ if ($id) $class='tddict'; if ($fieldlist[$field] == 'tracking') $class.=' tdoverflowauto'; - // Show value for field + if ($fieldlist[$field] == 'code') $class.=' width100'; + // Show value for field if ($showfield) print ''; } } @@ -1491,8 +1508,11 @@ if ($id) $canbemodified=$iserasable; if ($obj->code == 'RECEP') $canbemodified=1; + // Url $rowidcol=$tabrowid[$id]; - $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->{$rowidcol})?$obj->{$rowidcol}:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); + // If rowidcol not defined + if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid'; + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if ($param) $url .= '&'.$param; $url.='&'; @@ -1537,12 +1557,13 @@ if ($id) $i++; } } + + print '
'; + print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); + print ''; + print ''; + print ''; + print ''; + if ($filterfound) + { + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; + } + print '
'; - print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); - print ''; - if ($filterfound) - { - $searchpitco=$form->showFilterAndCheckAddButtons(0); - print $searchpitco; - } - print '
'.$valuetoshow.'
'; } else { dol_print_error($db); } - print ''; print '
'; } @@ -1552,7 +1573,6 @@ else * Show list of dictionary to show */ - $var=true; $lastlineisempty=false; print ''; print ''; @@ -1570,14 +1590,14 @@ else { if ($showemptyline) { - $var=!$var; - print ''; + + print ''; $showemptyline=0; } - $var=!$var; + $value=$tabname[$i]; - print ''; } @@ -1725,13 +1745,29 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') print ''; } elseif (in_array($fieldlist[$field], array('libelle_facture'))) { - print ''; + print ''; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { - print ''; + print ''; } elseif ($fieldlist[$field]=='unit') { print ''; } } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 41824fea4c6..7b7357ee9eb 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -84,8 +84,8 @@ $var=true; $form = new Form($db); // Mail required for members -$var=!$var; -print ''; + +print ''; print ''; print ''; diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 892e0860cbd..161b1aac45d 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -99,8 +99,8 @@ foreach ($eventstolog as $key => $arr) { if ($arr['id']) { - $var=!$var; - print ''; + + print ''; print ''; print ''; @@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir) if (file_exists($dir.'/'.$file)) { - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -412,7 +412,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - print '\n"; $var=true; $var=! $var; -print ''."\n"; //Use draft Watermark -$var=!$var; -print ''."\n"; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 8e550f98c99..7f81a5d0fef 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -266,20 +266,20 @@ if ($resql) print ''; print ""; - $var=!$var; - print ""; + + print ''; print ""; print ""; print ""; - $var=!$var; - print ""; + + print ''; print ""; print ""; print ""; - $var=!$var; - print ""; + + print ''; print ""; print ""; + + print ''; print ""; print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ""; print ""; -$var=!$var; -print ''; + +print ''; print ""; print "\n"; print ''; -$var=!$var; + print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print "\n"; -print '\n"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 23ff67f92e7..9f1d3913630 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -159,8 +159,8 @@ else // Si condition non remplie, on ne propose pas l'option if (! $conditions[$const]) continue; - $var=!$var; - print ""; + + print ''; print ''; print ''; print ''; @@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir) { if (file_exists($dir.'/'.$file)) { - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -447,7 +447,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - print '\n"; print ''; //Use draft Watermark -$var=!$var; + print ""; print ''; print ""; -print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ''."\n"; // Background - $var=!$var; + print ''."\n"; // Background login - $var=!$var; + print ''; print "\n"; // Synchro utilisateurs/groupes active -$var=!$var; -print ''; // Synchro contact active if (! empty($conf->societe->enabled)) { - $var=!$var; - print ''; print "\n"; // Type -$var=!$var; -print ''; // Version -$var=!$var; -print ''; // Serveur primaire -$var=!$var; -print ''; // Serveur secondaire -$var=!$var; -print ''; // Port -$var=!$var; -print ''; // DNserver -$var=!$var; -print ''; // Utiliser TLS -$var=!$var; -print ''; print "\n"; // DNAdmin -$var=!$var; -print ''; // Pass -$var=!$var; -print '\n"; // DN Pour les contacts -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; @@ -152,112 +152,112 @@ print ''; print "\n"; // Common name -$var=!$var; -print ''; print '"; print ''; // Name -$var=!$var; -print ''; print '"; print ''; // Firstname -$var=!$var; -print ''; print '"; print ''; // Company -$var=!$var; -print ''; print '"; print ''; // Mail -$var=!$var; -print ''; print '"; print ''; // Phone pro -$var=!$var; -print ''; print '"; print ''; // Phone home -$var=!$var; -print ''; print '"; print ''; // Mobile -$var=!$var; -print ''; print '"; print ''; // Skype -$var=!$var; -print ''; print '"; print ''; // Fax -$var=!$var; -print ''; print '"; print ''; // Address -$var=!$var; -print ''; print '"; print ''; // ZIP -$var=!$var; -print ''; print '"; print ''; // TOWN -$var=!$var; -print ''; print '"; print ''; // COUNTRY -$var=!$var; -print ''; print '"; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 90946f5ea44..192b11bfd8d 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -116,16 +116,16 @@ print ''; print "\n"; // DN pour les groupes -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; @@ -145,16 +145,16 @@ print "\n"; // Filtre // Common name -$var=!$var; -print ''; print '"; print ''; // Name -/*$var=!$var; -print ''; print '"; @@ -162,16 +162,16 @@ print ''; */ // Description -$var=!$var; -print ''; print '"; print ''; // User group -$var=!$var; -print ''; print '"; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 52117961b54..8c7291c3dc4 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -142,24 +142,24 @@ print ''; print "\n"; // DN Pour les adherents -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; print ''; // Filter, used to filter search -$var=!$var; -print ''; print ''; @@ -179,208 +179,208 @@ print "\n"; // Filtre // Common name -$var=!$var; -print ''; print '"; print ''; // Name -$var=!$var; -print ''; print '"; print ''; // Firstname -$var=!$var; -print ''; print ''; print ''; // Login unix -$var=!$var; -print ''; print '"; print ''; // Login samba -$var=!$var; -print ''; print '"; print ''; // Password not crypted -$var=!$var; -print ''; print ''; print ''; // Password crypted -$var=!$var; -print ''; print ''; print ''; // Mail -$var=!$var; -print ''; print '"; print ''; // Phone pro -$var=!$var; -print ''; print ''; print ''; // Phone perso -$var=!$var; -print ''; print ''; print ''; // Mobile -$var=!$var; -print ''; print ''; print ''; // Skype -$var=!$var; -print ''; print ''; print ''; // Fax -$var=!$var; -print ''; print ''; print ''; // Address -$var=!$var; -print ''; print ''; print ''; // ZIP -$var=!$var; -print ''; print ''; print ''; // TOWN -$var=!$var; -print ''; print ''; print ''; // COUNTRY -$var=!$var; -print ''; print ''; print ''; // Description -$var=!$var; -print ''; print ''; print ''; // Public Note -$var=!$var; -print ''; print ''; print ''; // Birthday -$var=!$var; -print ''; print ''; print ''; // Status -$var=!$var; -print ''; print ''; print ''; // First subscription date -$var=!$var; -print ''; print ''; print ''; // First subscription amount -$var=!$var; -print ''; print ''; print ''; // Last subscription date -$var=!$var; -print ''; print ''; print ''; // Last subscription amount -$var=!$var; -print ''; print ''; print ''; // End last subscriptions -$var=!$var; -print ''; print ''; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 45043b8a52b..79f34001a63 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -129,24 +129,24 @@ print ''; print "\n"; // DN Pour les utilisateurs -$var=!$var; -print ''; print ''; print ''; // List of object class used to define attributes in structure -$var=!$var; -print ''; print ''; print ''; // Filter, used to filter search -$var=!$var; -print ''; print ''; @@ -164,120 +164,120 @@ print ''; print "\n"; // Common name -$var=!$var; -print ''; print '"; print ''; // Name -$var=!$var; -print ''; print '"; print ''; // Firstname -$var=!$var; -print ''; print '"; print ''; // Login unix -$var=!$var; -print ''; print '"; print ''; // Login samba -$var=!$var; -print ''; print '"; print ''; // Password not crypted -$var=!$var; -print ''; print '"; print ''; // Password crypted -$var=!$var; -print ''; print '"; print ''; // Mail -$var=!$var; -print ''; print '"; print ''; // Phone -$var=!$var; -print ''; print '"; print ''; // Mobile -$var=!$var; -print ''; print '"; print ''; // Skype -$var=!$var; -print ''; print '"; print ''; // Fax -$var=!$var; -print ''; print '"; print ''; // Title -$var=!$var; -print ''; print '"; print ''; // Note -$var=!$var; -print ''; print '"; print ''; // Sid -$var=!$var; -print ''; print '"; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 3806258d246..1d4b5cee8d4 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -106,21 +106,21 @@ if ($action == 'edit') print '
   
   
'; + print '
'; if (! empty($tabcond[$i])) { print ''.$langs->trans($tablib[$i]).''; @@ -1657,7 +1677,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0); - print ''; + print ''; print ''; print ''; + $transfound=0; + // Special case for labels + if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { + $langs->load("bills"); + $transkey="PaymentCondition".strtoupper($obj->code); + } + if ($langs->trans($transkey) != $transkey) + { + $transfound=1; + print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis")); + } + if (! $transfound) + { + print ''; + } + print ''; @@ -1769,16 +1805,36 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } else { - print ''; - $size=''; $class=''; - if ($fieldlist[$field]=='code') $class='maxwidth100'; + $classtd=''; $class=''; + if ($fieldlist[$field]=='code') $classtd='width100'; if ($fieldlist[$field]=='affect') $class='maxwidth50'; if ($fieldlist[$field]=='delay') $class='maxwidth50'; if ($fieldlist[$field]=='position') $class='maxwidth50'; if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent'; if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent'; - if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" '; - print ''; + if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $class='maxwidth50'; + print ''; + $transfound=0; + if (in_array($fieldlist[$field], array('label','libelle'))) + { + // Special case for labels + if ($tabname == MAIN_DB_PREFIX.'c_civility') { + $transkey="Civility".strtoupper($obj->code); + } + if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { + $langs->load("bills"); + $transkey="PaymentCondition".strtoupper($obj->code); + } + if ($langs->trans($transkey) != $transkey) + { + $transfound=1; + print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis")); + } + } + if (! $transfound) + { + print ''; + } print '
'.$langs->trans("ECMAutoTree").' 
'.$arr['id'].''; $key='MAIN_LOGEVENTS_'.$arr['id']; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index a26a21fbede..eda3c6bd6ae 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -275,8 +275,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -506,7 +506,7 @@ print "
'; +print '
'; print $langs->trans("FreeLegalTextOnExpenseReports").' ('.$langs->trans("AddCRIfTooLong").')
'; $variablename='EXPENSEREPORT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -522,8 +522,8 @@ else print '
'; + +print '
'; print $langs->trans("WatermarkOnDraftOrders").'
'; print ''; print '
".$langs->trans("Title")."
".$langs->trans("URL")."
".$langs->trans("Status").""; if ($result > 0 && empty($rss->error)) @@ -299,8 +299,8 @@ if ($resql) // Logo if ($result > 0 && empty($rss->error)) { - $var=!$var; - print "
".$langs->trans("Logo")."'; $imageurl=$rssparser->getImageUrl(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index c95d8297cf9..e7f74f85e5e 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -279,7 +279,7 @@ $linkback=''.$langs->trans("BackToM print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); $head = invoice_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Invoices"), 0, 'invoice'); +dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); /* * Numbering module @@ -339,7 +339,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print '
'; + print '
'; echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -530,7 +530,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -628,8 +628,8 @@ print ''; print $langs->trans("PaymentMode").'
".$langs->trans("SuggestPaymentByRIBOnAccount").""; if (! empty($conf->banque->enabled)) @@ -671,8 +671,8 @@ else print $langs->trans("BankModuleNotActive"); } print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; print ''; print ''; -print '
'; +print '
'; print $langs->trans("ForceInvoiceDate"); print ''; print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1); @@ -737,7 +737,7 @@ $var=! $var; print '
'; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnInvoices").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='INVOICE_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -755,12 +755,18 @@ print '
'; -print $langs->trans("WatermarkOnDraftBill").'
'; +$substitutionarray=pdf_getSubstitutionArray($langs); +$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); +$htmltext = ''.$langs->trans("AvailableVariables").':
'; +foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; +$htmltext.='
'; +print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext); +print '
'; print ''; print ''; @@ -800,7 +806,7 @@ print ' 
'; +print '
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'.img_object("",$picto[$const]).''.$langs->trans($desc).''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 8d31db0d3af..6c73afcf8f5 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -310,8 +310,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -538,7 +538,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnInterventions").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='FICHINTER_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -557,11 +557,11 @@ print "
'; +print '
'; print $langs->trans("WatermarkOnDraftInterventionCards").''; print ''; print ''; @@ -573,7 +573,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')global->FICHINTER_PRINT_PRODUCTS) diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index b4d379e15d1..5a69a356777 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -105,8 +105,8 @@ print ''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").'
'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").''; if ($geointernal) print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).'
'; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1036d1057a9..193ee35a80f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -421,7 +421,7 @@ if ($action == 'edit') // Edit print '
'; print '
'; print ''; @@ -603,7 +603,7 @@ else // Show print '
'.$langs->trans("BackgroundImageLogin").''; print '
'; print $conf->global->MAIN_LOGIN_BACKGROUND; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 5c1b0fcad11..770d91d1d11 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -110,8 +110,8 @@ print '
'.$langs->trans("LDAPSynchronization").'
'.$langs->trans("LDAPDnSynchroActive").''; + +print '
'.$langs->trans("LDAPDnSynchroActive").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr"); @@ -127,8 +127,8 @@ print '
'.$langs->trans("LDAPDnContactActive").''; + + print '
'.$langs->trans("LDAPDnContactActive").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); @@ -139,8 +139,8 @@ if (! empty($conf->societe->enabled)) // Synchro member active if (! empty($conf->adherent->enabled)) { - $var=!$var; - print '
'.$langs->trans("LDAPDnMemberActive").''; + + print '
'.$langs->trans("LDAPDnMemberActive").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); @@ -156,8 +156,8 @@ print ''.$langs->trans("Example").'
'.$langs->trans("Type").''; + +print '
'.$langs->trans("Type").''; $arraylist=array(); $arraylist['activedirectory']='Active Directory'; $arraylist['openldap']='OpenLdap'; @@ -166,8 +166,8 @@ print $form->selectarray('type',$arraylist,$conf->global->LDAP_SERVER_TYPE); print ' 
'.$langs->trans("Version").''; + +print '
'.$langs->trans("Version").''; $arraylist=array(); $arraylist['3']='Version 3'; $arraylist['2']='Version 2'; @@ -175,22 +175,22 @@ print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION',$arraylist,$conf->global- print ''.$langs->trans("LDAPServerProtocolVersion").'
'; + +print '
'; print $langs->trans("LDAPPrimaryServer").''; print ''; print ''.$langs->trans("LDAPServerExample").'
'; + +print '
'; print $langs->trans("LDAPSecondaryServer").''; print ''; print ''.$langs->trans("LDAPServerExample").'
'.$langs->trans("LDAPServerPort").''; + +print '
'.$langs->trans("LDAPServerPort").''; if (! empty($conf->global->LDAP_SERVER_PORT)) { print ''; @@ -202,14 +202,14 @@ else print ''.$langs->trans("LDAPServerPortExample").'
'.$langs->trans("LDAPServerDn").''; + +print '
'.$langs->trans("LDAPServerDn").''; print ''; print ''.$langs->trans("LDAPServerDnExample").'
'.$langs->trans("LDAPServerUseTLS").''; + +print '
'.$langs->trans("LDAPServerUseTLS").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("Yes"); @@ -221,14 +221,14 @@ print ''.$langs->trans("ForANonAnonymousAccess").'
'.$langs->trans("LDAPAdminDn").''; + +print '
'.$langs->trans("LDAPAdminDn").''; print ''; print ''.$langs->trans("LDAPAdminDnExample").'
'.$langs->trans("LDAPPassword").''; + +print '
'.$langs->trans("LDAPPassword").''; if (! empty($conf->global->LDAP_ADMIN_PASS)) { print '';// je le met en visible pour test diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 4901c127e8b..27e32f8cd7c 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -125,16 +125,16 @@ print "
'.$langs->trans("LDAPContactDn").''; + +print '
'.$langs->trans("LDAPContactDn").''; print ''; print ''.$langs->trans("LDAPContactDnExample").' 
'.$langs->trans("LDAPContactObjectClassList").''; + +print '
'.$langs->trans("LDAPContactObjectClassList").''; print ''; print ''.$langs->trans("LDAPContactObjectClassListExample").' '.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; + +print '
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FULLNAME?' checked':'').">
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_NAME?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; + +print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME?' checked':'').">
'.$langs->trans("LDAPFieldCompany").''; + +print '
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COMPANY?' checked':'').">
'.$langs->trans("LDAPFieldMail").''; + +print '
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MAIL?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; + +print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_PHONE?' checked':'').">
'.$langs->trans("LDAPFieldHomePhone").''; + +print '
'.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE?' checked':'').">
'.$langs->trans("LDAPFieldMobile").''; + +print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked':'').">
'.$langs->trans("LDAPFieldSkype").''; + +print '
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked':'').">
'.$langs->trans("LDAPFieldFax").''; + +print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FAX?' checked':'').">
'.$langs->trans("LDAPFieldAddress").''; + +print '
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked':'').">
'.$langs->trans("LDAPFieldZip").''; + +print '
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked':'').">
'.$langs->trans("LDAPFieldTown").''; + +print '
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked':'').">
'.$langs->trans("LDAPFieldCountry").''; + +print '
'.$langs->trans("LDAPFieldCountry").''; print ''; print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked':'').">'.$langs->trans("LDAPSynchronizeGroups").'
'.$langs->trans("LDAPGroupDn").''; + +print '
'.$langs->trans("LDAPGroupDn").''; print ''; print ''.$langs->trans("LDAPGroupDnExample").' 
'.$langs->trans("LDAPGroupObjectClassList").''; + +print '
'.$langs->trans("LDAPGroupObjectClassList").''; print ''; print ''.$langs->trans("LDAPGroupObjectClassListExample").' 
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; +/* +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_NAME?' checked':'').">
'.$langs->trans("LDAPFieldDescription").''; + +print '
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION)?' checked':'').">
'.$langs->trans("LDAPFieldGroupMembers").''; + +print '
'.$langs->trans("LDAPFieldGroupMembers").''; print ''; print ''.$langs->trans("LDAPFieldGroupMembersExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'').">'.$langs->trans("LDAPSynchronizeMembers").'
'.$langs->trans("LDAPMemberDn").''; + +print '
'.$langs->trans("LDAPMemberDn").''; print ''; print ''.$langs->trans("LDAPMemberDnExample").' 
'.$langs->trans("LDAPMemberObjectClassList").''; + +print '
'.$langs->trans("LDAPMemberObjectClassList").''; print ''; print ''.$langs->trans("LDAPMemberObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; + +print '
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").'
'.$langs->trans("LDAPFieldFullname").''; + +print '
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_NAME)?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; + +print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").' 
'.$langs->trans("LDAPFieldLoginUnix").''; + +print '
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN)?' checked':'').">
'.$langs->trans("LDAPFieldLoginSamba").''; + +print '
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldPasswordCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").' 
'.$langs->trans("LDAPFieldMail").''; + +print '
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_MAIL)?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; + +print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").' 
'.$langs->trans("LDAPFieldHomePhone").''; + +print '
'.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").' 
'.$langs->trans("LDAPFieldMobile").''; + +print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").' 
'.$langs->trans("LDAPFieldSkype").''; + +print '
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").' 
'.$langs->trans("LDAPFieldFax").''; + +print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").' 
'.$langs->trans("LDAPFieldAddress").''; + +print '
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").' 
'.$langs->trans("LDAPFieldZip").''; + +print '
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").' 
'.$langs->trans("LDAPFieldTown").''; + +print '
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").' 
'.$langs->trans("LDAPFieldCountry").''; + +print '
'.$langs->trans("LDAPFieldCountry").''; print ''; print '  
'.$langs->trans("LDAPFieldDescription").''; + +print '
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").' 
'.$langs->trans("LDAPFieldNotePublic").''; + +print '
'.$langs->trans("LDAPFieldNotePublic").''; print ''; print ''.$langs->trans("LDAPFieldNotePublicExample").' 
'.$langs->trans("LDAPFieldBirthdate").''; + +print '
'.$langs->trans("LDAPFieldBirthdate").''; print ''; print '  
'.$langs->trans("LDAPFieldStatus").''; + +print '
'.$langs->trans("LDAPFieldStatus").''; print ''; print '  
'.$langs->trans("LDAPFieldFirstSubscriptionDate").''; + +print '
'.$langs->trans("LDAPFieldFirstSubscriptionDate").''; print ''; print '  
'.$langs->trans("LDAPFieldFirstSubscriptionAmount").''; + +print '
'.$langs->trans("LDAPFieldFirstSubscriptionAmount").''; print ''; print '  
'.$langs->trans("LDAPFieldLastSubscriptionDate").''; + +print '
'.$langs->trans("LDAPFieldLastSubscriptionDate").''; print ''; print '  
'.$langs->trans("LDAPFieldLastSubscriptionAmount").''; + +print '
'.$langs->trans("LDAPFieldLastSubscriptionAmount").''; print ''; print '  
'.$langs->trans("LDAPFieldEndLastSubscription").''; + +print '
'.$langs->trans("LDAPFieldEndLastSubscription").''; print ''; print '  '.$langs->trans("LDAPSynchronizeUsers").'
'.$langs->trans("LDAPUserDn").''; + +print '
'.$langs->trans("LDAPUserDn").''; print ''; print ''.$langs->trans("LDAPUserDnExample").' 
'.$langs->trans("LDAPUserObjectClassList").''; + +print '
'.$langs->trans("LDAPUserObjectClassList").''; print ''; print ''.$langs->trans("LDAPUserObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; + +print '
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; + +print '
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; + +print '
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_NAME)?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; + +print '
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FIRSTNAME)?' checked':'').">
'.$langs->trans("LDAPFieldLoginUnix").''; + +print '
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN)?' checked':'').">
'.$langs->trans("LDAPFieldLoginSamba").''; + +print '
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN_SAMBA)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordCrypted").''; + +print '
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD_CRYPTED)?' checked':'').">
'.$langs->trans("LDAPFieldMail").''; + +print '
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MAIL)?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; + +print '
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PHONE)?' checked':'').">
'.$langs->trans("LDAPFieldMobile").''; + +print '
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked':'').">
'.$langs->trans("LDAPFieldSkype").''; + +print '
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked':'').">
'.$langs->trans("LDAPFieldFax").''; + +print '
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'').">
'.$langs->trans("LDAPFieldTitle").''; + +print '
'.$langs->trans("LDAPFieldTitle").''; print ''; print ''.$langs->trans("LDAPFieldTitleExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_TITLE)?' checked':'').">
'.$langs->trans("Note").''; + +print '
'.$langs->trans("Note").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_DESCRIPTION)?' checked':'').">
'.$langs->trans("LDAPFieldSid").''; + +print '
'.$langs->trans("LDAPFieldSid").''; print ''; print ''.$langs->trans("LDAPFieldSidExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'').">
'; print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; @@ -140,21 +140,21 @@ else print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print '
'; print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; + + print ''; - $var=!$var; - print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index e49f25d7ef8..281f1934296 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -258,8 +258,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print ''; @@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir) { if (file_exists($dir.'/'.$file)) { - $var=!$var; + $name = substr($file, 4, dol_strlen($file) -16); $classname = substr($file, 0, dol_strlen($file) -12); @@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { - print '\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 541c8aa1b2d..972b7ee73a6 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -113,30 +113,30 @@ print ''; print ''; print "\n"; -$var=!$var; -print ''; -$var=!$var; -print ''; -$var=!$var; -print ''; // Constant to add salt into the unsubscribe and check read tag. // It is also used as a security key parameter. -$var=!$var; -print ''; // Disable - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // Method - $var=!$var; - print ''; // Host server - $var=!$var; - print ''; // Port - $var=!$var; - print ''; // STARTTLS - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Default from type - $var=!$var; + $liste = array(); $liste['user'] = $langs->trans('UserEmail'); $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')'; @@ -424,18 +424,18 @@ if ($action == 'edit') print ''; // Separator - $var=!$var; - print ''; + + print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Autocopy to - $var=!$var; - print ''; + + print ''; print ''; @@ -465,60 +465,60 @@ else print ''; // Disable - $var=!$var; - print ''; + + print ''; // Separator - $var=!$var; - print ''; + + print ''; // Method - $var=!$var; - print ''; // Host server - $var=!$var; + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { - print ''; + print ''; } else { - print ''; + print ''; } // Port - $var=!$var; + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { - print ''; + print ''; } else { - print ''; + print ''; } // SMTPS ID - $var=!$var; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // SMTPS PW - $var=!$var; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS - $var=!$var; - print ''; // STARTTLS - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Default from type - $var=!$var; + print ''; print ''; // Separator - $var=!$var; - print ''; + + print ''; // Errors To - $var=!$var; - print ''; + + print ''; print ''; // Autocopy to - $var=!$var; - print ''; + + print ''; print ''; // Menu top - $var=!$var; - print ''; + + print ''; print ''; @@ -190,8 +190,8 @@ if ($action == 'edit') print ''; // Menu smartphone - $var=!$var; - print ''; + + print ''; print ''; @@ -217,8 +217,8 @@ else print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; // Hide unauthorized menu -$var=!$var; -print ""; + +print ''; print ''; print ''; print ''; - $var=!$var; + print "\n"; $url='https://www.dolistore.com'; print ''; @@ -789,7 +789,7 @@ if ($mode == 'marketplace') print ''; print ''; - $var=!$var; + print "\n"; $url='https://partners.dolibarr.org'; print ''; diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 5b86bcdc1c3..3aa6ad5dc26 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -183,8 +183,8 @@ print ''."\n"; print ''; print ''."\n"; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; /* TODO uncomment when the functionality will integrated -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; */ /* TODO uncomment when the functionality will integrated -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; print ''."\n"; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; @@ -323,8 +323,8 @@ print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; + + print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; -$var=!$var; -print ''; print '\n"; $notificationtrigger=new InterfaceNotification($db); $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); -print ''; +print ''; print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 2433575e553..06315222825 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -211,7 +211,7 @@ if ($mode == 'setup' && $user->admin) print ''; print "\n"; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("OAuthIDSecret").''; @@ -223,7 +223,7 @@ if ($mode == 'setup' && $user->admin) print ''."\n"; $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("IsTokenGenerated"); @@ -250,7 +250,7 @@ if ($mode == 'setup' && $user->admin) print ''; $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("Token").''; @@ -273,7 +273,7 @@ if ($mode == 'setup' && $user->admin) { // Token refresh $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("TOKEN_REFRESH").''; @@ -284,7 +284,7 @@ if ($mode == 'setup' && $user->admin) // Token expired $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("TOKEN_EXPIRED").''; @@ -295,7 +295,7 @@ if ($mode == 'setup' && $user->admin) // Token expired at $var = ! $var; - print ''; + print ''; print ''; //var_dump($key); print $langs->trans("TOKEN_EXPIRE_AT").''; @@ -368,8 +368,8 @@ if ($mode == 'userconf' && $user->admin) $sql = 'SELECT p.rowid, p.printer_name, p.printer_location, p.printer_id, p.copy, p.module, p.driver, p.userid, u.login FROM '.MAIN_DB_PREFIX.'printing as p, '.MAIN_DB_PREFIX.'user as u WHERE p.userid=u.rowid'; $resql = $db->query($sql); while ($row=$db->fetch_array($resql)) { - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 5d7358ae051..043d6bbadd9 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -75,7 +75,7 @@ print "
\n"; $head = order_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Orders"), 0, 'order'); +dol_fiche_head($head, 'attributes', $langs->trans("Orders"), -1, 'order'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index f966af78bf3..5120fd5c931 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -76,7 +76,7 @@ print "
\n"; $head = order_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("OrderLines"), 0, 'order'); +dol_fiche_head($head, 'attributeslines', $langs->trans("OrderLines"), -1, 'order'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 93f7c301519..a5166ec69f2 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -177,7 +177,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print '\n"; // Allow payments on different thirdparties bills but same parent company $var=! $var; -print '\n"; // Add js auto fill amount on paiement form /* always on now $var=! $var; -print ''; @@ -145,13 +145,13 @@ if ($action == 'edit') // Edit print ''; // Hide VAT Intra on address - $var=!$var; - print ''; // Show prof id 1 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); @@ -163,13 +163,13 @@ if ($action == 'edit') // Edit } if ($pid1) { - print ''; } // Show prof id 2 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); @@ -181,13 +181,13 @@ if ($action == 'edit') // Edit } if ($pid2) { - print ''; } // Show prof id 3 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); @@ -199,13 +199,13 @@ if ($action == 'edit') // Edit } if ($pid3) { - print ''; } // Show prof id 4 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); @@ -217,7 +217,7 @@ if ($action == 'edit') // Edit } if ($pid4) { - print ''; } @@ -233,37 +233,37 @@ if ($action == 'edit') // Edit print ''; // Hide any PDF informations - $var=!$var; - print ''; //Desc - $var=!$var; - print ''; //Ref - $var=!$var; - print ''; //Details - $var=!$var; - print ''; // Place customer adress to the ISO location - $var=!$var; - print ''; - $var=!$var; - print ''; @@ -287,8 +287,8 @@ else // Show print ''; // Show pdf format - $var=!$var; - print ''; // Hide Intra VAT on address - $var=!$var; - print ''; // Show prof id 1 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid1=$langs->transcountry("ProfId1",$mysoc->country_code); @@ -341,13 +341,13 @@ else // Show } if ($pid1) { - print ''; } // Show prof id 2 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid2=$langs->transcountry("ProfId2",$mysoc->country_code); @@ -359,13 +359,13 @@ else // Show } if ($pid2) { - print ''; } // Show prof id 3 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid3=$langs->transcountry("ProfId3",$mysoc->country_code); @@ -377,13 +377,13 @@ else // Show } if ($pid3) { - print ''; } // Show prof id 4 in address into pdf - $var=!$var; + if (! $noCountryCode) { $pid4=$langs->transcountry("ProfId4",$mysoc->country_code); @@ -395,7 +395,7 @@ else // Show } if ($pid4) { - print ''; } @@ -412,8 +412,8 @@ else // Show // Encrypt and protect PDF - $var=!$var; - print ""; + + print ''; print ''; // Hide any PDF informations - $var=!$var; - print ''; //Desc - $var=!$var; - print ''; //Ref - $var=!$var; - print ''; //Details - $var=!$var; - print ''; - $var=!$var; - print ''; - $var=!$var; - print ''; @@ -492,8 +492,8 @@ else // Show $var=false; if (! empty($dolibarr_pdf_force_fpdf)) { - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''."\n"; print ''; } - $var=!$var; - print ''."\n"; + + print ''."\n"; print ''."\n"; print '\n"; } - $var=!$var; + print ''; print '"; + print ''; print ''; $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index c6ccb4f639c..76179fac66c 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -248,16 +248,15 @@ else if ($action == 'setmod') /* - * Affiche page + * View */ +$form=new Form($db); + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); - llxHeader('',$langs->trans("PropalSetup")); -$form=new Form($db); - //if ($mesg) print $mesg; $linkback=''.$langs->trans("BackToModuleList").''; @@ -265,7 +264,7 @@ print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); $head = propal_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Proposals"), 0, 'propal'); +dol_fiche_head($head, 'general', $langs->trans("Proposals"), -1, 'propal'); /* * Module numerotation @@ -310,8 +309,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print ''; @@ -450,7 +449,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '"; + + print ''; if (strpos($newkey, 'separator') !== false) { print ''; @@ -468,9 +468,9 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ''; + print ''; print ''."\n"; print ''."\n"; if (empty($conf->multicompany->enabled) || !$user->entity) print ''."\n"; // If superadmin or multicompany disabled diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 00bf0635293..788d8604584 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -204,7 +204,7 @@ print "\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index 5a142f3e51e..68d56bd2ded 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -174,7 +174,7 @@ function create_script_table($list) foreach($list as $script) { $var = ! $var; - print ''; + print ''; print ''; print ''; print ''; @@ -207,7 +207,7 @@ function create_key_table($list) foreach($list as $key) { $var = !$var; - print ''; + print ''; print ''; print ''; print ''; @@ -239,37 +239,37 @@ print ''; print ''; print ''; $var = !$var; -print ''; +print ''; print ''; print ''; print ''; $var = !$var; -print ''; +print ''; print ''; print ''; print ''; $var = !$var; -print ''; +print ''; print ''; print ''; print ''; $var = ! $var; -print ''; +print ''; print ''; print ''; print ''; $var = ! $var; -print ''; +print ''; print ''; print ''; print ''; $var = ! $var; -print ''; +print ''; print ''; print ''; print ''; $var = ! $var; -print ''; +print ''; print ''; print ''; print ''; @@ -289,12 +289,12 @@ if (is_array($resCached) || is_array($resRemoved)) { if (is_array($resCached)) { $var = ! $var; - print ""; + print ''; print ""; print ''; print ""; $var = ! $var; - print ""; + print ''; print ""; print ''; print ""; @@ -302,17 +302,17 @@ if (is_array($resCached) || is_array($resRemoved)) { if (is_array($resRemoved)) { $var = ! $var; - print ""; + print ''; print ""; print ''; print ""; $var = ! $var; - print ""; + print ''; print ""; print ''; print ""; $var = ! $var; - print ""; + print ''; print ""; print ''; print "
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'
'; + + print '
'; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.'
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -483,7 +483,7 @@ $var=! $var; print ''; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnDeliveryReceipts").' ('.$langs->trans("AddCRIfTooLong").')
'; $variablename='DELIVERY_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 3213503835d..ee6b9ef74ee 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -96,7 +96,7 @@ print "
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + +print '
'; print $langs->trans("MailingEMailFrom").''; print ''; if (!empty($conf->global->MAILING_EMAIL_FROM) && ! isValidEmail($conf->global->MAILING_EMAIL_FROM)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; + +print '
'; print $langs->trans("MailingEMailError").''; print ''; if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail")); print '
'; + +print '
'; print $langs->trans("MailingDelay").''; print ''; print '
'; + +print '
'; print $langs->trans("ActivateCheckReadKey").''; print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 6c01935ec39..219cd85c2fe 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -241,18 +241,18 @@ if ($action == 'edit') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; + + print '
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1); print '
 
 
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + + print '
'.$langs->trans("MAIN_MAIL_SENDMODE").''; // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) @@ -270,8 +270,8 @@ if ($action == 'edit') print '
'; + + print '
'; if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); @@ -303,8 +303,8 @@ if ($action == 'edit') print '
'; + + print '
'; if (! $conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); @@ -338,7 +338,7 @@ if ($action == 'edit') // ID if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { - $var=!$var; + $mainstmpid=(! empty($conf->global->MAIN_MAIL_SMTPS_ID)?$conf->global->MAIN_MAIL_SMTPS_ID:''); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only @@ -358,7 +358,7 @@ if ($action == 'edit') // PW if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { - $var=!$var; + $mainsmtppw=(! empty($conf->global->MAIN_MAIL_SMTPS_PW)?$conf->global->MAIN_MAIL_SMTPS_PW:''); print '
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only @@ -376,8 +376,8 @@ if ($action == 'edit') } // TLS - $var=!$var; - print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) @@ -390,8 +390,8 @@ if ($action == 'edit') print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (! empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) @@ -404,17 +404,17 @@ if ($action == 'edit') print '
 
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
 
 
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'
 
 
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + + print '
'.$langs->trans("MAIN_MAIL_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text=$langs->trans("Undefined").img_warning(); print $text; print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) @@ -531,8 +531,8 @@ else print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + + print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) @@ -545,18 +545,18 @@ else print '
 
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; if($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user'){ @@ -567,19 +567,19 @@ else print '
 
 
'.$langs->trans("MAIN_MAIL_ERRORS_TO").'
'.$langs->trans("MAIN_MAIL_ERRORS_TO").''.$conf->global->MAIN_MAIL_ERRORS_TO; if (! empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) { diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 90949c7980d..f0bf5609adf 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -27,7 +27,7 @@ */ /** - * \file htdocs/admin/dict.php + * \file htdocs/admin/mails_templates.php * \ingroup setup * \brief Page to administer data tables */ @@ -119,12 +119,14 @@ $formmail=new FormMail($db); if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $tmp=$formmail->getAvailableSubstitKey('form'); + $tmp['__(AnyTransKey)__']='__(AnyTransKey)__'; $helpsubstit = $langs->trans("AvailableVariables").':
'.implode('
', $tmp); $helpsubstitforlines = $langs->trans("AvailableVariables").':
'.implode('
', $tmp); } else { $tmp=$formmail->getAvailableSubstitKey('formwithlines'); + $tmp['__(AnyTransKey)__']='__(AnyTransKey)__'; $helpsubstit = $langs->trans("AvailableVariables").':
'.implode('
', $tmp); $tmp=$formmail->getAvailableSubstitKey('formforlines'); $helpsubstitforlines = $langs->trans("AvailableVariables").':
'.implode('
', $tmp); diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 0d6ff4d34a0..ddfb4d0cd62 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -179,8 +179,8 @@ if ($action == 'edit') print '
'.$langs->trans("DefaultMenuManager").'
'.$langs->trans("DefaultMenuManager").''; $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled'); print '
'.$langs->trans("DefaultMenuSmartphoneManager").'
'.$langs->trans("DefaultMenuSmartphoneManager").''; $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); print '
'.$langs->trans("DefaultMenuManager").'
'.$langs->trans("DefaultMenuManager").''; $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED)); print $filelib; @@ -229,8 +229,8 @@ else print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 0a3cb6b99bc..82457a27bdf 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -90,8 +90,8 @@ print ''.$langs->trans("Status").'
'.$langs->trans("HideUnauthorizedMenu").''; if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 3fe6addea2d..94bfa8e05bb 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -285,7 +285,7 @@ if (isset($objMod->langfiles) && is_array($objMod->langfiles)) } } -$var=!$var; + // Version (with picto warning or not) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ddaf940492f..4eb82e6183c 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -584,7 +584,7 @@ if ($mode == 'common') $oldfamily=$familykey; } - $var=!$var; + // Version (with picto warning or not) @@ -781,7 +781,7 @@ if ($mode == 'marketplace') print ''.$langs->trans("URL").'
'.$url.'
'.$langs->trans("Parameters").' '.$langs->trans("Value").'
'.$langs->transnoentitiesnoconv("multicurrency_useRateOnDocumentDate").' '; @@ -197,8 +197,8 @@ print ''; print '
'.$langs->transnoentitiesnoconv("multicurrency_useOriginTx").' '; @@ -211,8 +211,8 @@ print ''; print '
'.$langs->transnoentitiesnoconv("multicurrency_buyPriceInCurrency").' '; @@ -226,8 +226,8 @@ print '
'.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").' '; @@ -260,8 +260,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print '
'.$langs->transnoentitiesnoconv("multicurrency_appId").' '; @@ -273,8 +273,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''; print '
'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").' '; @@ -286,8 +286,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''; print '
'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").' '; @@ -311,8 +311,8 @@ print ''.$form->textwithpicto($langs->trans("CurrenciesUsed"), $langs->trans print ' '.$langs->trans("Rate").'
'.$conf->currency.$form->textwithpicto(' ', $langs->trans("BaseCurrency")).' 1'; @@ -334,8 +334,8 @@ foreach ($TCurrency as &$currency) { if($currency->code == $conf->currency) continue; - $var=!$var; - print '
'.$currency->code.' - '.$currency->name.' '; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index a3b3eb50df6..c82e64d48ea 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -135,8 +135,8 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + +print '
'; print $langs->trans("NotificationEMailFrom").''; print ''; @@ -165,14 +165,14 @@ print "
'; $var=true; $i=0; foreach($listofnotifiedevents as $notifiedevent) { - $var=!$var; + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); @@ -213,7 +213,7 @@ $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); $var=true; foreach($listofnotifiedevents as $notifiedevent) { - $var=!$var; + $label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder'); @@ -222,7 +222,7 @@ foreach($listofnotifiedevents as $notifiedevent) elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order'); elseif ($notifiedevent['elementtype'] == 'ficheinter') $elementLabel = $langs->trans('Intervention'); - print '
'.$elementLabel.''.$notifiedevent['code'].''.$label.'
'.$row['login'].''.$row['module'].''.$row['driver'].'
'; + print '
'; echo preg_replace('/\-.*$/','',preg_replace('/mod_payment_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -263,7 +263,7 @@ print "
'; +print '
'; print $langs->trans("PaymentOnDifferentThirdBills"); print ''; print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1); @@ -273,7 +273,7 @@ print "
'; +print '
'; print $langs->trans("JSOnPaimentBill"); print ''; print $form->selectyesno("INVOICE_AUTO_FILLJS",$conf->global->INVOICE_AUTO_FILLJS,1); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 55bd83cbc19..b0c32a344ff 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -128,8 +128,8 @@ if ($action == 'edit') // Edit if (empty($selected)) $selected=dol_getDefaultFormat(); // Show pdf format - $var=!$var; - print '
'.$langs->trans("DictionaryPaperFormat").''; + + print '
'.$langs->trans("DictionaryPaperFormat").''; print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT'); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowVATIntaInAddress").''; + + print '
'.$langs->trans("ShowVATIntaInAddress").''; print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; + + print '
'.$langs->trans("HideAnyVATInformationOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print '
'.$langs->trans("HideDescOnPDF").''; + + print '
'.$langs->trans("HideDescOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1); print '
'.$langs->trans("HideRefOnPDF").''; + + print '
'.$langs->trans("HideRefOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1); print '
'.$langs->trans("HideDetailsOnPDF").''; + + print '
'.$langs->trans("HideDetailsOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1); print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; + + print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1); print '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; + + print '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DictionaryPaperFormat").''; + + print '
'.$langs->trans("DictionaryPaperFormat").''; $pdfformatlabel=''; if (empty($conf->global->MAIN_PDF_FORMAT)) @@ -323,13 +323,13 @@ else // Show print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowVATIntaInAddress").''; + + print '
'.$langs->trans("ShowVATIntaInAddress").''; print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.''; print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.''; print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.''; print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1); print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.''; print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1); print '
'; $text = $langs->trans("ProtectAndEncryptPdfFiles"); $desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); @@ -440,36 +440,36 @@ else // Show print '
'.$langs->trans("HideAnyVATInformationOnPDF").''; + + print '
'.$langs->trans("HideAnyVATInformationOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); print '
'.$langs->trans("HideDescOnPDF").''; + + print '
'.$langs->trans("HideDescOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); print '
'.$langs->trans("HideRefOnPDF").''; + + print '
'.$langs->trans("HideRefOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); print '
'.$langs->trans("HideDetailsOnPDF").''; + + print '
'.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; + + print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1); print '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; + + print '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS]; print '
dolibarr_pdf_force_fpdf'; print $dolibarr_pdf_force_fpdf; @@ -501,8 +501,8 @@ else // Show print '
'.$langs->trans("LibraryToBuildPDF").''; $i=0; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 84cb9ed8bf2..daafab71053 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -186,7 +186,7 @@ if ($result) print "
'.img_object('',$picto).' '.$objMod->getName(); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 6d5c915dae2..86108be0136 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -313,7 +313,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -422,7 +422,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + if (!$obj->fk_soc) { $username=dolGetFirstLastname($obj->firstname,$obj->lastname); @@ -495,9 +495,9 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + - print "
'.dolGetFirstLastname($obj->firstname,$obj->lastname).''.$label.'
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -534,11 +533,10 @@ print '
'; /* * Other options - * */ + print load_fiche_titre($langs->trans("OtherOptions"),'',''); -$var=true; print ""; print ""; print "\n"; @@ -546,11 +544,11 @@ print '\n"; print "\n"; print ""; -$var=!$var; + print ""; print ''; print ""; -print ""; +print ''; print ''; print '"; print ''; @@ -562,7 +560,7 @@ $var=! $var; print ''; print ''; print ''; -print '\n"; print ''; */ -$var=! $var; print ''; print ''; print ''; -print '\n"; print ''; -$var=!$var; + print ""; print ''; print ""; -print '\n"; @@ -609,8 +612,8 @@ print ''; /* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. if ($conf->banque->enabled) { - $var=!$var; - print ''; } */ @@ -668,7 +671,7 @@ print ''; print ''; print "\n"; -print '\n"; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 84836407499..224fac14ce7 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -133,8 +133,8 @@ print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; -$var=!$var; + print ''; print ''; @@ -171,7 +171,7 @@ print ''; @@ -180,7 +180,7 @@ print ''; @@ -189,7 +189,7 @@ print ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index b86023aa49a..1bac9d80bee 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -250,7 +250,7 @@ if ($mode == 'config' && $user->admin) } else { for ($line=0; $line < $nbofprinters; $line++) { $var = !$var; - print ''; + print ''; if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) { print ''; print ''; @@ -381,7 +381,7 @@ if ($mode == 'template' && $user->admin) $max = count($printer->listprinterstemplates); for ($line=0; $line < $max; $line++) { $var = !$var; - print ''; + print ''; if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) { print ''; print ''; @@ -427,7 +427,7 @@ if ($mode == 'template' && $user->admin) $max = count($printer->tags); for ($tag=0; $tag < $max; $tag++) { $var = !$var; - print ''; + print ''; print ''; print ''; } diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index d8fdddd2bb5..3f057bbdbb9 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -85,8 +85,8 @@ print ''; // Utilisation formulaire Ajax sur choix produit -$var=!$var; -print ''; + +print ''; print ''; if (empty($conf->use_javascript_ajax)) { @@ -111,8 +111,8 @@ else } print ''; -$var=!$var; -print ''; + +print ''; print ''; print ''; print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''; print '\n"; foreach ($list as $key) { - $var=!$var; + print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 3aa0bdf33bf..4d0415dbd01 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -250,7 +250,7 @@ foreach ($arrayhandler as $key => $module) if ($module->isEnabled()) { $var = !$var; - print ''; print ''; - $var=!$var; - print ""; + + print ''; print '"; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '"; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '"; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '"; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '"; print ''; print ''; - $var=!$var; - print ""; + + print ''; print '"; print ''; print ''; @@ -407,8 +407,8 @@ print ''; print ''; // Disable clear password in database -$var=!$var; -print ""; + +print ''; print ''; print '"; print ''; // Cryptage du mot de base de la base dans conf.php -$var=!$var; -print ""; + +print ''; print ''; print ''; // Disable link "Forget password" on logon -$var=!$var; -print ""; + +print ''; print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; @@ -158,8 +158,8 @@ print ''; print ''; // Use anti virus -$var=!$var; -print ""; + +print ''; print '"; print ''; // Use anti virus -$var=!$var; -print ""; + +print ''; print ''; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 9ce79359a7c..e5c66d9e24b 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -116,8 +116,8 @@ print ''; print ''; // Enable Captcha code -$var=!$var; -print ""; + +print ''; print ''; print ''; // Enable advanced perms -$var=!$var; -print ""; + +print ''; print ''; print ''; print ''; print "\n"; -$var=!$var; + $sessiontimeout=ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout; -print ''; +print ''; print ''; @@ -194,10 +194,10 @@ print ''; print ''; -$var=!$var; + $sessiontimeout=ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE=""; -print ''; +print ''; print ''; print ''; // Disable - $var=!$var; - print ''; // Separator - $var=!$var; - print ''; + + print ''; // Method - $var=!$var; - print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Autocopy to - /*$var=!$var; - print ''; + /* + print ''; print ''; */ @@ -224,31 +224,31 @@ else print ''; // Disable - $var=!$var; - print ''; + + print ''; // Separator - $var=!$var; - print ''; + + print ''; // Method - $var=!$var; - print ''; // From - $var=!$var; - print ''; + + print ''; print ''; // Autocopy to - /*$var=!$var; - print ''; + /* + print ''; print ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index f2a6d165bd5..1c5a92fb0e8 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -161,8 +161,8 @@ $var=true; $found=0; -$var=!$var; -print ""; + +print ''; print ''; print '\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''; print '"; + +print ''; print ''; print '\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''; print '"; + + print ''; print ''; print "\n"; }*/ @@ -265,8 +265,8 @@ $var=true; $found=0; -$var=!$var; -print ""; + +print ''; print ''; print '\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''; print '\n\n"; $found++; -$var=!$var; -print ""; + +print ''; print ''; print '"; + + print ''; print ''; print "\n"; }*/ @@ -343,8 +343,8 @@ print " \n"; print " \n"; print ''."\n"; -$var=!$var; -print ""; + +print ''; print ''; print '\n"; // Option to force stock to be enough before adding a line into document if($conf->invoice->enabled) { $var = !$var; - print ""; + print ''; print ''; print '"; + print ''; print ''; print '"; + print ''; print ''; print '\n"; print ''."\n"; $var = !$var; - print ""; + print ''; print ''; print '\n"; print ''."\n"; if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - $var=!$var; - print ""; + + print ''; print ''; print '\n\n"; } -$var=!$var; -print ""; + +print ''; print ''; print '\n"; print "\n"; -$var=!$var; -print ""; + +print ''; print ''; print '"; + print ''; print ''; print ''; @@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir) require_once $dir.'/'.$file; $module = new $classname($db, new FactureFournisseur($db)); - $var=!$var; + print "\n"; print "'; print ''; print "\n"; -print ''; print ''; print "\n"; -print '\n"; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 1ac6ae86989..d54f0e367aa 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -279,8 +279,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print ''; @@ -402,7 +402,7 @@ foreach ($dirmodels as $reldir) require_once $dir.'/'.$file; $module = new $classname($db, new CommandeFournisseur($db)); - $var=!$var; + print "\n"; print "\n"; $var=false; //if ($conf->global->MAIN_FEATURES_LEVEL > 0) //{ - print '\n"; - $var=!$var; + //} // Ask for payment bank during supplier order /* Kept as hidden for the moment if ($conf->banque->enabled) { - $var=!$var; - print ''; } */ -print ''; print ''; print "\n"; -print '\n"; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 933ee22a062..40caa94c8a8 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -279,7 +279,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { $var = !$var; - print '\n"; print "'; @@ -427,7 +427,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '\n"; print ''; -$var=!$var; + print ""; print ''; print ""; -print ''; } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index ae32c073349..71d06ae8e64 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -204,8 +204,8 @@ foreach ($syslogModules as $moduleName) //print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."
\n"; if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them) - $var=!$var; - print ''; + + print ''; print ''; print "\n"; $var=true; -$var=!$var; -print ''; + +print ''; print '"; + + print ''; if ($newkey == 'separator') { print ''; @@ -238,9 +238,9 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ''; + print ''; print ''."\n"; print ''."\n"; if (empty($conf->multicompany->enabled) || !$user->entity) print ''."\n"; // If superadmin or multicompany disabled diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 6e528c73094..1e70cbab6cc 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -108,8 +108,8 @@ else while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; print ''; print ''; @@ -163,8 +163,8 @@ else while ($i < $num) { $row = $db->fetch_row($resql); - $var=!$var; - print ""; + + print ''; print ''; print ''; print ''; @@ -205,7 +205,7 @@ else $count = '?'; } - print ""; + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index c50e6ca9e4c..39511e8a814 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -103,8 +103,8 @@ else $var=true; foreach($listtouse as $param => $paramval) { - $var=!$var; - print ''; + + print ''; print ''; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index 3fc10bb0f3f..624edc2f38e 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -111,8 +111,8 @@ else while ($i < $num) { $row = $db->fetch_row($resql); - $var=!$var; - print ""; + + print ''; print ""; print ""; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 6a5384da69a..c96a085456a 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -72,8 +72,8 @@ $var=true; print '
'; print '
".$langs->trans("Parameter")."'.$langs->trans("Value")." 
'.$langs->trans("DefaultProposalDurationValidity").''."global->PROPALE_VALIDITY_DURATION."\">
'; +print '
'; print $langs->trans("UseCustomerContactAsPropalRecipientIfExist"); print ''; print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1); @@ -572,11 +570,10 @@ print "
'; +print '
'; print $langs->trans("FreeLegalTextOnProposal").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='PROPOSAL_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -594,13 +591,19 @@ print '' print "
'; -print $langs->trans("WatermarkOnDraftProposal").''; -print ''; +print '
'; +$substitutionarray=pdf_getSubstitutionArray($langs); +$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); +$htmltext = ''.$langs->trans("AvailableVariables").':
'; +foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; +$htmltext.='
'; +print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext); +print '
'; +print ''; print ''; print ''; print "
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { @@ -631,8 +634,8 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print '
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '.$langs->trans('NotAvailable').'
 
'; +print '
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("ConnectionTimeout").''; print ''; @@ -143,8 +143,8 @@ print ' '.strtolower($langs->trans("Seconds")); print '
'.$langs->trans("ResponseTimeout").''; print ''; @@ -153,8 +153,8 @@ print ' '.strtolower($langs->trans("Seconds")); print '
'.$langs->trans("MAIN_PROXY_USE").''; print ''; @@ -162,7 +162,7 @@ print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1); print '
'.$langs->trans("MAIN_PROXY_HOST").''; print ''; print ''; print ''; print '
<'.$printer->tags[$tag].'>'.$langs->trans(strtoupper($printer->tags[$tag])).'
'.$langs->trans("UseSearchToSelectResource").'
'.$langs->trans('DisabledResourceLinkUser').''; echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER'); @@ -120,8 +120,8 @@ print '
'.$langs->trans('DisabledResourceLinkContact').''; echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY'); diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index b09f4820312..a04b23ce4fe 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -97,7 +97,7 @@ print "
'; + print '
'; print ucfirst($key); print "\n"; print $module->getDescription().'
'; @@ -283,7 +283,7 @@ print ''; //if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) // Patter for Password Perso if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ -$var=!$var; + $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN); /*$this->length2 = $tabConf[0]; @@ -299,38 +299,38 @@ $var=!$var; print '
'.$langs->trans("PasswordPatternDesc").'
' . $langs->trans("MinLength")."
' . $langs->trans("NbMajMin")."
' . $langs->trans("NbNumMin")."
' . $langs->trans("NbSpeMin")."
' . $langs->trans("NbIteConsecutive")."
' . $langs->trans("NoAmbiCaracAutoGeneration")." '.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'
'.$langs->trans("Action").'
'.$langs->trans("DoNotStoreClearPassword").''; if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) @@ -441,8 +441,8 @@ print "
'.$langs->trans("MainDbPasswordFileConfEncrypted").''; if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass)) @@ -476,8 +476,8 @@ print '
'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").''; if(! empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 0114bbb74b8..8c1b1fa5b07 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -136,7 +136,7 @@ print ''.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("MaxSizeForUploadedFiles").'.'; $max=@ini_get('upload_max_filesize'); if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.'; @@ -147,8 +147,8 @@ print ''; print ''.$langs->trans("UMask").''; print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print '
'.$langs->trans("AntiVirusCommand").'
'; print $langs->trans("AntiVirusCommandExample"); // Check command in inside safe_mode @@ -181,8 +181,8 @@ print "
'.$langs->trans("AntiVirusParam").'
'; print $langs->trans("AntiVirusParamExample"); print '
'.$langs->trans("Status").'
'.$langs->trans("UseCaptchaCode").''; if (function_exists("imagecreatefrompng")) @@ -146,8 +146,8 @@ else print '
'.$langs->trans("UseAdvancedPerms").''; if (! empty($conf->use_javascript_ajax)) @@ -182,10 +182,10 @@ print ''.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("SessionTimeOut").''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print '
'.$langs->trans("MAIN_APPLICATION_TITLE").''; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 05fe548daff..faf05b7fb0f 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -175,31 +175,31 @@ if ($action == 'edit') print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''; + + print '
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''; print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1); print '
 
 
'.$langs->trans("MAIN_SMS_SENDMODE").''; + + print '
'.$langs->trans("MAIN_SMS_SENDMODE").''; if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE',$listofmethods,$conf->global->MAIN_SMS_SENDMODE,1); else print ''.$langs->trans("None").''; print '
'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).'
 
 
'.$langs->trans("MAIN_SMS_SENDMODE").''; + + print '
'.$langs->trans("MAIN_SMS_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_SMS_SENDMODE]; if (empty($text)) $text=$langs->trans("Undefined").' '.img_warning(); print $text; print '
'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_SMS_FROM; if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && ! isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) print ' '.img_warning($langs->trans("ErrorBadPhone")); print '
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").'
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''.$conf->global->MAIN_MAIL_AUTOCOPY_TO; if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && ! isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans("DeStockOnBill").''; if (! empty($conf->facture->enabled)) @@ -181,8 +181,8 @@ else print "
'.$langs->trans("DeStockOnValidateOrder").''; if (! empty($conf->commande->enabled)) @@ -203,8 +203,8 @@ $found++; //if (! empty($conf->expedition->enabled)) //{ -$var=!$var; -print "
'.$langs->trans("DeStockOnShipment").''; if (! empty($conf->expedition->enabled)) @@ -223,8 +223,8 @@ else print "
'.$langs->trans("DeStockOnShipmentOnClosing").''; if (! empty($conf->expedition->enabled)) @@ -245,8 +245,8 @@ $found++; /*if (! $found) { - $var=!$var; - print "
'.$langs->trans("NoModuleToManageStockDecrease").'
'.$langs->trans("ReStockOnBill").''; if (! empty($conf->fournisseur->enabled)) @@ -286,8 +286,8 @@ print "
'.$langs->trans("ReStockOnValidateOrder").''; if (! empty($conf->fournisseur->enabled)) @@ -306,8 +306,8 @@ else print "
'.$langs->trans("ReStockOnDispatchOrder").''; if (! empty($conf->fournisseur->enabled)) @@ -328,8 +328,8 @@ $found++; /*if (! $found) { - $var=!$var; - print "
'.$langs->trans("NoModuleToManageStockIncrease").'
".$langs->trans("RuleForStockAvailability")." 
'.$langs->trans("WarehouseAllowNegativeTransfer").''; print "
"; @@ -359,7 +359,7 @@ print "
'.$langs->trans("StockMustBeEnoughForInvoice").''; print ""; @@ -374,7 +374,7 @@ if($conf->invoice->enabled) { if($conf->order->enabled) { $var = !$var; - print "
'.$langs->trans("StockMustBeEnoughForOrder").''; print ""; @@ -389,7 +389,7 @@ if($conf->order->enabled) { if($conf->expedition->enabled) { $var = !$var; - print "
'.$langs->trans("StockMustBeEnoughForShipment").''; print ""; @@ -417,7 +417,7 @@ if ($virtualdiffersfromphysical) print "  
'.$langs->trans("UseVirtualStockByDefault").''; print ""; @@ -441,8 +441,8 @@ print "  
'.$langs->trans("UseDispatchStatus").''; print ""; @@ -454,9 +454,9 @@ if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULAT print "
'.$langs->trans("UserWarehouseAutoCreate").''; print ""; @@ -468,9 +468,9 @@ print ''; print "
'.$langs->trans("AllowAddLimitStockByWarehouse").''; @@ -489,9 +489,9 @@ print '
'; If not used by a module, I still need to understand in which case user may need this now we can set rule on product page. if ($conf->global->PRODUIT_SOUSPRODUITS) { - $var=!$var; + - print "
'.$langs->trans("IndependantSubProductStock").''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 7510bfe37ef..2619951e1b5 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -250,8 +250,8 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
"; print (empty($module->name)?$name:$module->name); @@ -471,7 +471,7 @@ print ''.$langs->trans("Value").' 
'; +print '
'; print $langs->trans("FreeLegalTextOnInvoices").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='SUPPLIER_INVOICE_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -505,7 +505,7 @@ print '
 
'; +print '
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
"; print (empty($module->name)?$name:$module->name); @@ -493,7 +493,7 @@ print "
'; + print '
'; print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
'; print $langs->trans("IfSetToYesDontForgetPermission"); print '
'; @@ -501,15 +501,15 @@ $var=false; print ''; print ''; print "
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; if (! empty($conf->use_javascript_ajax)) { @@ -530,13 +530,13 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print '
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '.$langs->trans('NotAvailable').'
'; +print '
'; print $langs->trans("FreeLegalTextOnOrders").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='SUPPLIER_ORDER_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -571,7 +571,7 @@ print '
 
'; +print '
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'; + print '
'; echo preg_replace('/\-.*$/','',preg_replace('/mod_supplier_payment_/','',preg_replace('/\.php$/','',$file))); print "\n"; @@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir) require_once $dir.'/'.$file; $module = new $classname($db, new PaiementFourn($db)); - $var=!$var; + print "
"; print (empty($module->name)?$name:$module->name); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 7963aa7fabc..703fbc482e9 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -288,8 +288,8 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { - $var=!$var; - print '
'.$module->nom."\n"; + + print '
'.$module->nom."\n"; print $module->info(); print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); @@ -527,7 +527,7 @@ $var=! $var; print '
'; print ''; print ''; -print '
'; +print '
'; print $langs->trans("FreeLegalTextOnSupplierProposal").' '.img_info($langs->trans("AddCRIfTooLong")).'
'; $variablename='SUPPLIER_PROPOSAL_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) @@ -545,11 +545,11 @@ print '' print "
'; +print '
'; print $langs->trans("WatermarkOnDraftSupplierProposal").''; print ''; print ''; @@ -559,8 +559,8 @@ print ''; if ($conf->banque->enabled) { - $var=!$var; - print '
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { @@ -581,8 +581,8 @@ if ($conf->banque->enabled) } else { - $var=!$var; - print '
'; + + print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '.$langs->trans('NotAvailable').'
'; print ' '; print $module->getName(); @@ -257,8 +257,8 @@ print ''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("SyslogLevel").'
'.$langs->trans("SyslogLevel").''; print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print ''."\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("UserAgent").''.$_SERVER['HTTP_USER_AGENT'].'
'.$langs->trans("BrowserName").''.$tmp['browsername'].'
'.$langs->trans("BrowserOS").''.$tmp['browseros'].'
'.$langs->trans("Version").''.$tmp['browserversion'].'
'.$langs->trans("Layout").' (phone/tablet/classic)'.$tmp['layout'].'
'.$langs->trans("IPAddress").''.$_SERVER['REMOTE_ADDR'].'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("Screen").''; + +print '
'.$langs->trans("UserAgent").''.$_SERVER['HTTP_USER_AGENT'].'
'.$langs->trans("BrowserName").''.$tmp['browsername'].'
'.$langs->trans("BrowserOS").''.$tmp['browseros'].'
'.$langs->trans("Version").''.$tmp['browserversion'].'
'.$langs->trans("Layout").' (phone/tablet/classic)'.$tmp['layout'].'
'.$langs->trans("IPAddress").''.$_SERVER['REMOTE_ADDR'].'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("Screen").''; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print '
'; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 0fb3a6c9a7b..9590260f005 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -170,8 +170,8 @@ foreach($configfileparameters as $key) continue; } - $var=!$var; - print "
 
'.$obj->name.''.$obj->value.''.$obj->entity.'
'.$obj->Name.''.$obj->Engine.'
'.$row[0].''.$row[1].''.$row[2].'
'.$row[0].''.$count.'
'; print $param; print '
$row[0]$row[1]
'; print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; + +print ''."\n"; + +print ''."\n"; print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')'.DOL_VERSION; + +print '
'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')'.DOL_VERSION; // If current version differs from last upgrade if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) { @@ -123,10 +123,10 @@ if (function_exists('curl_init')) } print '
'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'; print ''; print '
'; @@ -136,29 +136,29 @@ $var=true; print '
'; print ''; print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; + +print ''."\n"; + +print ''."\n"; + +print '\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; + +print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''; + + print ''; print ''; print ''; print ''."\n"; @@ -206,40 +206,40 @@ $var=true; print '
'; print '
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("SessionSavePath").''.session_save_path().'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("CurrentSessionTimeOut").''.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); + +print '
'.$langs->trans("SessionSavePath").''.session_save_path().'
'.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("CurrentSessionTimeOut").''.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); print ''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print "
'.$langs->trans("CurrentTheme").''.$conf->theme.'
'.$langs->trans("CurrentMenuHandler").''; + +print '
'.$langs->trans("CurrentTheme").''.$conf->theme.'
'.$langs->trans("CurrentMenuHandler").''; print $conf->standard_menu; print '
'.$langs->trans("Screen").''; + +print '
'.$langs->trans("Screen").''; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print '
'.$langs->trans("Session").''; + +print '
'.$langs->trans("Session").''; $i=0; foreach($_SESSION as $key => $val) { @@ -188,8 +188,8 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S foreach($shmoparray as $key => $val) { - $var=!$var; - print '
'.$key.'
'.$key.''.count($val).''.dol_getshmopaddress($key).'
'; print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; -print ''."\n"; + +print ''."\n"; + +print ''."\n"; // Thousands -$var=!$var; + $thousand=$langs->transnoentitiesnoconv("SeparatorThousand"); if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method if ($thousand == 'None') $thousand=''; -print ''."\n"; +print ''."\n"; // Decimals -$var=!$var; + $dec=$langs->transnoentitiesnoconv("SeparatorDecimal"); -print ''."\n"; +print ''."\n"; // Show results of functions to see if everything works -$var=!$var; -print ''."\n"; -$var=!$var; + +print ''."\n"; + print "\n"; if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) { - $var=!$var; + print ""; print "\n"; } -$var=!$var; -print ''."\n"; + +print ''."\n"; // Timezone $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'
'."\n"; $txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."
\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php $txt.=$langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ)?$langs->trans("NotDefined"):$conf->global->MAIN_SERVER_TZ); //$txt.=$langs->trans("YouCanEditPHPTZ"); // deprecated -$var=!$var; -print ''."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php -$var=!$var; -print ''."\n"; -$var=!$var; -print ''; -$var=!$var; -print ''; -$var=!$var; -print ''; + +print ''."\n"; + +print ''; + +print ''; + +print ''; // Database timezone if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') { - $var=!$var; - print ''."\n"; } // Client -$var=!$var; + $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst']; -print ''."\n"; print ''."\n"; -$var=!$var; -print ''."\n"; -$var=!$var; +print ''."\n"; + + $filesystemencoding=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0 -print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php + -$var=!$var; $tmp=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0 if (empty($tmp) && ! empty($_SERVER["WINDIR"])) $tmp='iso-8859-1'; // By default for windows if (empty($tmp)) $tmp='utf-8'; // By default for other if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_FILESYSTEM_ENCODING; -print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php +print ''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php print '
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").''.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'
'.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().'
'.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").''.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'
'.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().'
'.$langs->trans("CurrentValueSeparatorThousand").''.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).'
'.$langs->trans("CurrentValueSeparatorThousand").''.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).'
'.$langs->trans("CurrentValueSeparatorDecimal").''.$dec.'
'.$langs->trans("CurrentValueSeparatorDecimal").''.$dec.'
  => price2num(1233.56+1)'.price2num(1233.56+1,'2').'
  => price2num(1233.56+1)'.price2num(1233.56+1,'2').'
  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2')."
  => price2num('."'1 234.56')".price2num("1 234.56",'2')."
  => price(1234.56)'.price(1234.56).'
  => price(1234.56)'.price(1234.56).'
'.$langs->trans("CurrentTimeZone").''; // Timezone server PHP + +print '
'.$langs->trans("CurrentTimeZone").''; // Timezone server PHP $a=getServerTimeZoneInt('now'); $b=getServerTimeZoneInt('winter'); $c=getServerTimeZoneInt('summer'); @@ -251,19 +251,19 @@ $val.='       '.getServerTimeZoneString(); $val.='       '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?'     ('.$langs->trans('YesInSummer').')':''))); print $form->textwithtooltip($val,$txt,2,1,img_info('')); print '
  => '.$langs->trans("CurrentHour").''.dol_print_date(dol_now(),'dayhour','tzserver').'
  => dol_print_date(0,"dayhourtext")'.dol_print_date(0,"dayhourtext").'
  => dol_get_first_day(1970,1,false)'.dol_get_first_day(1970,1,false).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')
  => dol_get_first_day(1970,1,true)'.dol_get_first_day(1970,1,true).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')
  => '.$langs->trans("CurrentHour").''.dol_print_date(dol_now(),'dayhour','tzserver').'
  => dol_print_date(0,"dayhourtext")'.dol_print_date(0,"dayhourtext").'
  => dol_get_first_day(1970,1,false)'.dol_get_first_day(1970,1,false).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')
  => dol_get_first_day(1970,1,true)'.dol_get_first_day(1970,1,true).'     (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')
'.$langs->trans("MySQLTimeZone").' (database)'; // Timezone server base + + print '
'.$langs->trans("MySQLTimeZone").' (database)'; // Timezone server base $sql="SHOW VARIABLES where variable_name = 'system_time_zone'"; $resql = $db->query($sql); if ($resql) @@ -274,9 +274,9 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') print '
'.$langs->trans("ClientTZ").''.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')'; +print '
'.$langs->trans("ClientTZ").''.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')'; print '       '.$_SESSION['dol_tz_string']; print '       '.$langs->trans("DaylingSavingTime").': '; if ($_SESSION['dol_dst']>0) print yn(1); @@ -284,19 +284,19 @@ else print yn(0); if (! empty($_SESSION['dol_dst_first'])) print '     ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']),'dayhour','gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']),'dayhour','gmt').')'; print '
  => '.$langs->trans("ClientHour").''.dol_print_date(dol_now(),'dayhour','tzuser').'
  => '.$langs->trans("ClientHour").''.dol_print_date(dol_now(),'dayhour','tzuser').'
'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)'.$filesystemencoding.'
'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)'.$filesystemencoding.'
  => '.$langs->trans("File encoding").''.$tmp.'
  => '.$langs->trans("File encoding").''.$tmp.'
'; print '
'; @@ -384,8 +384,8 @@ foreach($configfileparameters as $key => $value) } if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue; - $var=!$var; - print "
 
'.$obj->name.''.$obj->value.''.$obj->entity.'
'.dol_trunc($script['file'],80,'left').''.dol_print_date($script['mtime'],'dayhour').''.number_format($script['size'] / 1024, 2).'KB
'.dol_trunc($key['name'],80,'left').''.dol_print_date($key['created'],'dayhour').''.number_format($key['size']/1024, 3).'KB
Information
Caching enabled'.($info['cache']?'yes':'no').'
Optimizer enabled'.$info['optimizer']?'yes':'no'.'
Memory usage'.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)
Free memory in reserved cache'.number_format($info['memoryAvailable']/(1024*1024), 2).'MB
Cached scripts'.$info['cachedScripts'].'
Removed scripts'.$info['removedScripts'].'
Cached keys'.(isset($info['cachedKeys'])?$info['cachedKeys']:'').'
Caching
Optimizer
Clear cache
Clean cache
Purge cache
"; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 4e0651597ee..f5e6afd36b1 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -261,9 +261,9 @@ if ($result) { $obj = $db->fetch_object($result); - $var=!$var; + - print ''; + print ''; // Date print ''.dol_print_date($db->jdate($obj->dateevent),'%Y-%m-%d %H:%M:%S').''; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index c313c91a7bd..56db6eb2ad7 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -141,9 +141,9 @@ if ($savehandler == 'files') foreach ($listofsessions as $key => $sessionentry) { - $var=!$var; + - print ""; + print ''; // Login print ''.$sessionentry['login'].''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index bb485c41999..6d3ee6ced8e 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -79,7 +79,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_array_options=array(); } - if ($action == 'add' || (GETPOST('add') && $action != 'update')) { $error=0; @@ -101,18 +100,22 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) } if (! $error) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."')"; + $db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".$db->escape($conf->entity).")"; $result = $db->query($sql); if ($result > 0) { - setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $db->commit(); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $action=""; $transkey=""; $transvalue=""; } else { - dol_print_error($db); + $db->rollback(); + setEventMessages($db->lasterror(), null, 'errors'); $action=''; } } @@ -206,10 +209,9 @@ if ($mode == 'overwrite') // Line to add new record - $var=false; print "\n"; - print ''; + print ''; print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, 0, 'maxwidthonsmartphone', 1); print ''."\n"; print ''; @@ -236,18 +238,10 @@ if ($mode == 'overwrite') // Show constants - $sql = "SELECT"; - $sql.= " rowid"; - $sql.= ", lang"; - $sql.= ", transkey"; - $sql.= ", transvalue"; + $sql = "SELECT rowid, entity, lang, transkey, transvalue"; $sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; $sql.= " WHERE 1 = 1"; //$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; - //if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug - //else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits - //if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name')); - //$sql.= " ORDER BY entity, name ASC"; $sql.= $db->order($sortfield, $sortorder); dol_syslog("translation::select from table", LOG_DEBUG); @@ -256,16 +250,14 @@ if ($mode == 'overwrite') { $num = $db->num_rows($result); $i = 0; - $var=false; while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; print "\n"; - print ''; + print ''; print ''.$obj->lang.''."\n"; print ''.$obj->transkey.''."\n"; @@ -332,8 +324,8 @@ if ($mode == 'searchkey') foreach($filearray as $file) { $tmpfile=preg_replace('/.lang/i', '', basename($file['name'])); - $newlang->load($tmpfile, 0, 0, '', 0); - $newlangfileonly->load($tmpfile, 0, 0, '', 1); + $newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite + $newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only //print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records
'."\n"; } } @@ -372,10 +364,9 @@ if ($mode == 'searchkey') print "\n"; // Line to search new record - $var=false; print "\n"; - print ''; + print ''; //print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1); print $formadmin->select_language($langcode,'langcode', 0, null, 0, 0, 0, 'maxwidthonsmartphone', 1); print ''."\n"; @@ -408,14 +399,12 @@ if ($mode == 'searchkey') // Show result $i=0; - $var=false; foreach($recordtoshow as $key => $val) { $i++; if ($i <= $offset) continue; if ($i > ($offset + $limit)) break; - $var=!$var; - print ''.$langcode.''.$key.''; + print ''.$langcode.''.$key.''; print dol_escape_htmltag($val); print ''; if ($val != $newlangfileonly->tab_translate[$key]) @@ -425,7 +414,7 @@ if ($mode == 'searchkey') } /*if (! empty($conf->multicompany->enabled) && !$user->entity) { - print $val; + print ''.$val.''; }*/ print ''."\n"; } diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index c1224bffe89..0aae9c6915e 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -64,8 +64,8 @@ print ' $var=True; foreach ($triggers as $trigger) { - $var=!$var; - print ''; + + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index d237ca3e727..42feea8f8ec 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -180,8 +180,8 @@ $var=true; $form = new Form($db); // Mail required for members -$var=!$var; -print ''; + +print ''; print ''; print ''; @@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print ''; print ''; print ''; print "\n"; -$var=!$var; -print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 4e1996cf658..40a316d881b 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -122,8 +122,8 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; // Id print ''; print ''; - $var=!$var; + } $i = 0; while ($i < $num && $i < $MAXLIST) @@ -916,13 +916,13 @@ if ($id > 0) $fichinter_static->id=$objp->id; $fichinter_static->statut=$objp->fk_statut; - print ""; + print ''; print ''."\n"; //print ''."\n"; print ''."\n"; print ''."\n"; print ''; - $var=!$var; + $i++; } $db->free($resql); @@ -978,8 +978,8 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; print '"; + print ''; print ''; print ""; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index f8f987f1222..4bd999b1d5a 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -160,15 +160,15 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print ''; print ''; + $var=true; if ($num > 0) { $i = 0; - $var=true; while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print '"; } } else { - $var=!$var; - print ''; + + print ''; } print "
'.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].'
'.$langs->trans("UserMailRequired").' 
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 72365726d25..db5ef3cbf59 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -231,7 +231,7 @@ foreach ($dirmodels as $reldir) if ($modulequalified) { $var = !$var; - print '
'; + print '
'; print (empty($module->name)?$name:$module->name); print "\n"; if (method_exists($module,'info')) print $module->info($langs); diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 1204fded0aa..7aef2671c8d 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -90,7 +90,6 @@ class DolibarrApi // Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses unset($object->linkedObjects); - unset($object->lignes); // should be ->lines unset($object->oldline); unset($object->error); diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index b622aa1d9dd..14b6dabf5e5 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -75,8 +75,8 @@ print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'; + +print '
'; print $langs->trans("NbOfBoomarkToShow").''; print ''; print '
'; diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index de60e8b80cf..0d1dbf2de53 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -100,27 +100,27 @@ print ''; print ''; print ''; print "\n"; -$var=!$var; -print ''; + +print ''; print ''; if (! empty($conf->banque->enabled)) { - $var=!$var; - print ''; + + print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; - $var=!$var; - print ''; + + print ''; print ''; @@ -128,8 +128,8 @@ if (! empty($conf->banque->enabled)) if (! empty($conf->stock->enabled)) { - $var=!$var; - print ''; // Force warehouse (this is not a default value) + + print ''; // Force warehouse (this is not a default value) print ''; // Force warehouse (this is not a default value) + + print ''; // Force warehouse (this is not a default value) print ''; + +print ''; print ''; print ''; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index e138107fd3f..ebd5fa9991c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -292,7 +292,7 @@ else $var=true; foreach ($cats as $cat) { - $var=!$var; + print "\t\n"; print "\t\t".'\n"; print '\n"; print '\n"; print '\n"; print '\n"; print '\n"; print '\n"; print '"; + print ''; // Action (type) print '"; + + print ''; print "\n"; print ''; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 784512d6d1e..8d2ecd88277 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -69,7 +69,7 @@ print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); $head = propal_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), 0, 'propal'); +dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), -1, 'propal'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 633c4fab581..80f5afdaeed 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -76,7 +76,7 @@ print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup'); $head = propal_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), 0, 'propal'); +dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), -1, 'propal'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 52fdaa6eceb..31def3d1b29 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -639,8 +639,8 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; print '"; + + print ''; print '"; + + print ''; print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("CashDeskThirdPartyForSell").'
'.$langs->trans("CashDeskThirdPartyForSell").''; print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0); print '
'.$langs->trans("CashDeskBankAccountForSell").'
'.$langs->trans("CashDeskBankAccountForSell").''; $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",1); print '
'.$langs->trans("CashDeskBankAccountForCheque").'
'.$langs->trans("CashDeskBankAccountForCheque").''; $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",1); print '
'.$langs->trans("CashDeskBankAccountForCB").'
'.$langs->trans("CashDeskBankAccountForCB").''; $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",1); print '
'.$langs->trans("CashDeskDoNotDecreaseStock").'
'.$langs->trans("CashDeskDoNotDecreaseStock").''; if (empty($conf->productbatch->enabled)) { print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1); @@ -145,8 +145,8 @@ if (! empty($conf->stock->enabled)) $disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK; - $var=!$var; - print '
'.$langs->trans("CashDeskIdWareHouse").'
'.$langs->trans("CashDeskIdWareHouse").''; if (! $disabled) { @@ -163,7 +163,7 @@ if (! empty($conf->stock->enabled)) if (! empty($conf->service->enabled)) { $var=! $var; - print '
'; + print '
'; print $langs->trans("CashdeskShowServices"); print ''; print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1); @@ -174,7 +174,7 @@ if (! empty($conf->service->enabled)) if (! empty($conf->receiptprinter->enabled)) { $var=! $var; - print '
'; + print '
'; print $langs->trans("DolibarrReceiptPrinter").' ('.$langs->trans("FeatureNotYetAvailable").')'; print ''; print $form->selectyesno("CASHDESK_DOLIBAR_RECEIPT_PRINTER",$conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER,1); diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index d1af6bdafb2..bc27be9bb12 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -96,8 +96,8 @@ $var=true; $form = new Form($db); // Mail required for members -$var=!$var; -print '
'.$langs->trans("CategorieRecursiv").''. $form->textwithpicto('',$langs->trans("CategorieRecursivHelp"),1,'help').'
'; print "".$cat->label.""; @@ -363,7 +363,7 @@ if ($object->type == Categorie::TYPE_PRODUCT) $var=true; foreach ($prods as $prod) { - $var=!$var; + print "\t
'; print $prod->getNomUrl(1); @@ -414,7 +414,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER) $var=true; foreach ($socs as $soc) { - $var=!$var; + print "\t
'; @@ -470,7 +470,7 @@ if($object->type == Categorie::TYPE_CUSTOMER) if ($user->societe_id > 0 && $soc->id != $user->societe_id) continue; // External user always see only themself $i++; - $var=!$var; + print "\t
'; print $soc->getNomUrl(1); @@ -523,7 +523,7 @@ if ($object->type == Categorie::TYPE_MEMBER) $var=true; foreach ($prods as $key => $member) { - $var=!$var; + print "\t
'; $member->ref=$member->login; @@ -578,7 +578,7 @@ if($object->type == Categorie::TYPE_CONTACT) foreach ($contacts as $key => $contact) { $i++; - $var=!$var; + print "\t
'; print $contact->getNomUrl(1,'category'); @@ -632,7 +632,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT) $var=true; foreach ($accounts as $key => $account) { - $var=!$var; + print "\t
'; print $account->getNomUrl(1,0); @@ -687,7 +687,7 @@ if ($object->type == Categorie::TYPE_PROJECT) $var=true; foreach ($projects as $key => $project) { - $var=!$var; + print "\t
'; print $project->getNomUrl(1,0); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index c5fe89593b6..fc4fc218971 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1324,7 +1324,7 @@ if ($id > 0) print '
'; print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '
'; - if (in_array($user->id,array_keys($listofuserid))) + if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid))) { print '
'; print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index ef260cb2197..8b1dc424239 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -400,7 +400,7 @@ if ($resql) continue; } - $var=!$var; + $actionstatic->id=$obj->id; $actionstatic->ref=$obj->id; @@ -409,7 +409,7 @@ if ($resql) $actionstatic->type_picto=$obj->type_picto; $actionstatic->label=$obj->label; - print "
'; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 97f255abe14..760d82f0246 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -135,8 +135,8 @@ if ($resql) if ($obj) { - $var=!$var; - print "
".$obj->df."'.$obj->cc.'
'; $propal_static->id = $objp->propalid; $propal_static->ref = $objp->ref; @@ -723,8 +723,8 @@ if ($id > 0) while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $var=!$var; - print "
'; $commande_static->id = $objp->cid; $commande_static->ref = $objp->ref; @@ -850,8 +850,8 @@ if ($id > 0) $contrat=new Contrat($db); $objp = $db->fetch_object($resql); - $var=!$var; - print "
'; $contrat->id=$objp->id; $contrat->ref=$objp->ref?$objp->ref:$objp->id; @@ -906,7 +906,7 @@ if ($id > 0) print ''.img_picto($langs->trans("Statistics"),'stats').'
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''.dol_print_date($db->jdate($objp->startdate)).''.convertSecondToTime($objp->duration).''.$fichinter_static->getLibStatut(5).'
'; $facturestatic->id = $objp->facid; $facturestatic->ref = $objp->facnumber; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 7b71e3ade9c..fe66e3ac243 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -150,9 +150,9 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; + - print "
'.img_object($langs->trans("ShowContact"),"contact"); print ' '.$obj->name.'$obj->firstname
'.$langs->trans("ProposalsDraft").($num?' '.$num.'':'').'
'; + + print '
'; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; $propalstatic->ref_client=$obj->ref_client; @@ -192,14 +192,14 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) } if ($total>0) { - $var=!$var; + print '
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("NoProposal").'
'.$langs->trans("NoProposal").'

"; @@ -241,15 +241,15 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos print ''; print ''.$langs->trans("SupplierProposalsDraft").($num?' '.$num.'':'').''; + $var=true; if ($num > 0) { $i = 0; - $var=true; while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $supplierproposalstatic->id=$obj->rowid; $supplierproposalstatic->ref=$obj->ref; $supplierproposalstatic->total_ht = $obj->total_ht; @@ -272,14 +272,14 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoProposal").''; + + print ''.$langs->trans("NoProposal").''; } print "
"; @@ -320,15 +320,15 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) print ''; print ''.$langs->trans("DraftOrders").($num?' '.$num.'':'').''; - if ($num) + $var = true; + if ($num > 0) { $i = 0; - $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ''; + print ''; $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; $orderstatic->ref_client=$obj->ref_client; @@ -352,14 +352,14 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoOrder").''; + + print ''.$langs->trans("NoOrder").''; } print "
"; @@ -401,15 +401,15 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande print ''; print ''.$langs->trans("DraftSuppliersOrders").($num?' '.$num.'':'').''; - if ($num) + $var = true; + if ($num > 0) { $i = 0; - $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ''; + print ''; $supplierorderstatic->id=$obj->rowid; $supplierorderstatic->ref=$obj->ref; $supplierorderstatic->ref_supplier=$obj->ref_suppliert; @@ -433,14 +433,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total").''.price($total).""; } } else { - $var=!$var; - print ''.$langs->trans("NoSupplierOrder").''; + + print ''.$langs->trans("NoSupplierOrder").''; } print "
"; @@ -503,7 +503,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; $companystatic->canvas=$objp->canvas; - print ''; + print ''; print ''.$companystatic->getNomUrl(1,'customer',48).''; print ''; print $companystatic->getLibCustProspStatut(); @@ -511,7 +511,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) print ''.dol_print_date($db->jdate($objp->tms),'day').""; print ''; $i++; - $var=!$var; + } @@ -519,7 +519,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; } @@ -562,18 +562,18 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; $companystatic->canvas=$objp->canvas; - print ''; + print ''; print ''.$companystatic->getNomUrl(1,'supplier',44).''; print ''.dol_print_date($db->jdate($objp->dm),'day').''; print ''; - $var=!$var; + $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -647,7 +647,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO print $companystatic->getNomUrl(1,'customer',44); print ''."\n"; print "".$staticcontrat->LibStatut($obj->statut,3)."\n"; - $var=!$var; + $i++; } print "
"; @@ -695,8 +695,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; // Ref print ''; @@ -794,8 +794,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; // Ref print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 13ea930dc5e..fe582d56656 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -57,6 +57,7 @@ $hookmanager->initHooks(array('mailingcard','globalcard')); // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions) $object->substitutionarray=FormMail::getAvailableSubstitKey('emailing'); +$object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); $object->substitutionarrayfortest=array( '__ID__' => 'TESTIdRecord', @@ -72,7 +73,7 @@ $object->substitutionarrayfortest=array( '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''), '__CHECK_READ__' => 'TagCheckMail', '__UNSUBSCRIBE__' => 'TagUnsubscribe' - //,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet + //,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet ); // List of sending methods @@ -237,7 +238,7 @@ if (empty($reshook)) if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); else $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'contractline' . $obj->source_id, 2); } - $substitutionisok=true; + //$substitutionisok=true; complete_substitutions_array($substitutionarray, $langs); $newsubject=make_substitutions($subject,$substitutionarray); $newmessage=make_substitutions($message,$substitutionarray); @@ -266,11 +267,11 @@ if (empty($reshook)) { $res=0; } - if (! $substitutionisok) + /*if (! $substitutionisok) { $mail->error='Some substitution failed'; $res=0; - } + }*/ // Send mail if ($res) @@ -754,8 +755,6 @@ else $head = emailing_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("Mailing"), 0, 'email'); - // Confirmation back to draft if ($action == 'settodraft') { @@ -780,14 +779,16 @@ else if ($action != 'edit') { + dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); + /* * Mailing en mode visu */ if ($action == 'sendall') { // Define message to recommand from command line - - $sendingmode=$conf->global->MAIN_MAIL_SENDMODE; + $sendingmode=$conf->global->EMAILING_MAIL_SENDMODE; + if (empty($sendingmode)) $sendingmode=$conf->global->MAIN_MAIL_SENDMODE; if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function // MAILING_NO_USING_PHPMAIL may be defined or not. @@ -842,7 +843,8 @@ else if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') '; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); - + + print '
'; print '
'; print ''; @@ -903,8 +905,10 @@ else print '
'; print "
"; + + dol_fiche_end(); - + // Clone confirmation if ($action == 'clone') { @@ -1106,7 +1110,9 @@ else /* * Mailing en mode edition */ - + + dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); + $linkback = ''.$langs->trans("BackToList").''; $morehtmlright=''; @@ -1114,6 +1120,7 @@ else dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); + print '
'; print '
'; print ''; @@ -1132,9 +1139,6 @@ else // To print ''; - // Status - print ''; - // Nb of distinct emails print '
'.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto,0,0,0,0,1).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -1160,6 +1164,7 @@ else } print '
'; + print '
'; dol_fiche_end(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 470ee2a4ec1..d3642c50393 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -177,7 +177,7 @@ if ($object->fetch($id) >= 0) { $head = emailing_prepare_head($object); - dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email'); + dol_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email'); $linkback = ''.$langs->trans("BackToList").''; @@ -186,16 +186,11 @@ if ($object->fetch($id) >= 0) dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright); - + print '
'; print '
'; print ''; -/* - print ''; - print ''; -*/ + print ''; print ''; @@ -204,11 +199,6 @@ if ($object->fetch($id) >= 0) print ''; - // Status -/* print ''; -*/ // Nb of distinct emails print ''; + //print ''; // print '
'; if ($allowaddtarget) { - print '
'; + print ''; print ''; } else @@ -514,7 +505,6 @@ if ($object->fetch($id) >= 0) print ''; print '
'; - $var = true; $i = 0; if ($num) @@ -523,9 +513,7 @@ if ($object->fetch($id) >= 0) { $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; + print ''; print ''; print ''; print ''; @@ -599,7 +587,7 @@ if ($object->fetch($id) >= 0) { if ($object->statut < 2) { - print ''; } diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 0ea109960e7..52eacf6c115 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -57,10 +57,10 @@ print '
'; print ''; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object,'id', $linkback); - print '
'.$langs->trans("MailTitle").''.$object->titre.'
'.$langs->trans("MailFrom").''.dol_print_email($object->email_from,0,0,0,0,1).'
'.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto,0,0,0,0,1); print '
'.$langs->trans("Status").''.$object->getLibStatut(4); - if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')'; - print '
'; print $langs->trans("TotalNbOfDistinctRecipients"); @@ -229,7 +219,8 @@ if ($object->fetch($id) >= 0) print ""; - $var=!$var; + dol_fiche_end(); + $allowaddtarget=($object->statut == 0); @@ -256,8 +247,8 @@ if ($object->fetch($id) >= 0) clearstatcache(); - $var=true; - + $var = true; + foreach ($modulesdir as $dir) { $modulenames=array(); @@ -311,12 +302,12 @@ if ($object->fetch($id) >= 0) if ($qualified) { $var = !$var; - //print '
'.$obj->email.''.$obj->lastname.''.$obj->firstname.'
'; + print '
'; print $langs->trans("NoTargetYet"); print '
'; print ''; - print ''; print ''; - print ''; print "
'.$langs->trans("SearchAMailing").'
'; + print '
'; print $langs->trans("Ref").':
'; + print '
'; print $langs->trans("Other").':

\n"; @@ -110,7 +110,7 @@ if (is_resource($handle)) foreach ($mailmodule->getSqlArrayForStats() as $sql) { - print ''; + print ''; $result=$db->query($sql); if ($result) @@ -176,9 +176,9 @@ if ($result) while ($i < $num ) { $obj = $db->fetch_object($result); - $var=!$var; + - print ""; + print ''; print ''.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.''; print ''.dol_trunc($obj->titre,38).''; print ''.dol_print_date($db->jdate($obj->date_creat),'day').''; diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 5280fcfad59..ddb0d4a8fc6 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -27,6 +27,8 @@ require_once DOL_DOCUMENT_ROOT .'/comm/mailing/class/mailing.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; +$id=GETPOST('id'); + $langs->load("mails"); // Security check @@ -45,11 +47,11 @@ $form = new Form($db); $object = new Mailing($db); -if ($object->fetch($_REQUEST["id"]) >= 0) +if ($object->fetch($id) >= 0) { $head = emailing_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email'); + dol_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email'); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 622783d7ca5..99af5749963 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -158,7 +158,7 @@ if ($result) { $obj = $db->fetch_object($result); - $var=!$var; + print ""; print ''; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 82d57f721da..145d1891be3 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -66,7 +66,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print ''; print ''; - print ''; print "
'.$langs->trans("Search").'
'; + print '
'; print $langs->trans("Proposal").':

\n"; } @@ -122,8 +122,8 @@ if ($resql) $dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0)); if (! $conf->use_javascript_ajax) { - $var=!$var; - print ""; + + print ''; print ''.$propalstatic->LibStatut($status,0).''; print '
'.(isset($vals[$status])?$vals[$status]:0).''; print "\n"; @@ -176,9 +176,9 @@ if (! empty($conf->propal->enabled)) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; @@ -236,10 +236,10 @@ if ($resql) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $propalstatic->id=$obj->rowid; @@ -317,8 +317,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $nbofloop) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; // Ref print ''; @@ -405,9 +405,9 @@ if (! empty($conf->propal->enabled)) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $propalstatic->id=$obj->rowid; @@ -477,9 +477,9 @@ if (! empty($conf->propal->enabled)) $var = True; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $propalstatic->id=$obj->rowid; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ba01033eee5..ce6d6e2bc72 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -747,7 +747,7 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; + $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 2ec1a3d660b..abb24b8ffa4 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -300,7 +300,7 @@ foreach ($data as $val) while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print ''; print '0?'&userid='.$userid:'').'">'.$oldyear.''; print '0'; diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index dd325da7297..f797025a5de 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -40,7 +40,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index b68bdb9135e..2364672ccf9 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -58,9 +58,9 @@ if (! empty($conf->propal->enabled)) print ''; print ''; print ''; - print ''; - print ''; + print ''; print ''; print "
'.$langs->trans("SearchAProposal").'
'; + print '
'; print $langs->trans("Ref").':
'.$langs->trans("Other").':
'.$langs->trans("Other").':

\n"; } @@ -96,8 +96,8 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; print img_action($langs->trans("Show"),$obj->id).' '; print $langs->trans("StatusProspect".$obj->id); @@ -140,8 +140,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''.img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.''; print ''; print price($obj->price); @@ -150,7 +150,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $total += $obj->price; } if ($total>0) { - $var=!$var; + print ''.$langs->trans("Total")."".price($total).""; } print "
"; @@ -205,8 +205,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; print img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.''; @@ -263,8 +263,8 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 5f9a5a570ff..b5672f276e7 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -155,9 +155,9 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ""; + print ''; print ''; $result=''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index f24202f7fff..9f7f36f78ca 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -70,7 +70,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print ''; print ''; - print ''; print "
'.$langs->trans("Search").'
'; + print '
'; print $langs->trans("CustomerOrder").':

\n"; } @@ -141,8 +141,8 @@ if ($resql) { if (! $conf->use_javascript_ajax) { - $var=!$var; - print ""; + + print ''; print ''.$commandestatic->LibStatut($status,$bool,0).''; print ''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print $commandestatic->LibStatut($status,$bool,3); @@ -196,7 +196,7 @@ if (! empty($conf->commande->enabled)) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); $commandestatic->id=$obj->rowid; @@ -208,7 +208,7 @@ if (! empty($conf->commande->enabled)) $companystatic->code_client=$obj->code_client; $companystatic->canvas=$obj->canvas; - print ""; + print ''; print ''; print $commandestatic->getNomUrl(1); print ""; @@ -220,8 +220,8 @@ if (! empty($conf->commande->enabled)) } else { - $var=!$var; - print ''.$langs->trans("NoOrder").''; + + print ''.$langs->trans("NoOrder").''; } print "
"; } @@ -268,10 +268,10 @@ if ($resql) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; @@ -349,9 +349,9 @@ if (! empty($conf->commande->enabled)) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; @@ -431,9 +431,9 @@ if (! empty($conf->commande->enabled)) $var = true; while ($i < $num) { - $var=!$var; + $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 17c73c82698..c6b93cb8f0f 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -653,8 +653,8 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) while ($i < $num) { $objp = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; $generic_commande->id=$objp->rowid; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 534011d73fe..dd79ee54ba1 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -323,7 +323,7 @@ foreach ($data as $val) while (! empty($year) && $oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print ''; print '
0?'&userid='.$userid:'').'">'.$oldyear.''; print '0'; @@ -335,7 +335,7 @@ foreach ($data as $val) print ''; } - $var=!$var; + print ''; print '0?'&userid='.$userid:'').'">'.$year.''; print ''.$val['nb'].''; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 38efbc91ca2..629cd3c0fb0 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -36,7 +36,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index a81a0072302..cb10fd8c3c7 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -203,8 +203,8 @@ print ''; $var=true; for ($mois = 1 ; $mois < 13 ; $mois++) { - $var=!$var; - print ''; + + print ''; print "".dol_print_date(dol_mktime(1,1,1,$mois,1,2000),"%B").""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index 485e6738faf..bddf1292214 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -899,9 +899,9 @@ if ($resql) $bankaccount = $cachebankaccount[$objp->bankid]; } - $var=!$var; + - print ""; + print ''; // Ref if (! empty($arrayfields['b.rowid']['checked'])) diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index c1d668df8d7..eb6aea4f2dc 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -66,22 +66,22 @@ print ""; echo ''.$langs->trans("Summary").''; print "\n"; -$var=!$var; + $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."paiement"; $paiem = valeur($sql); print "Somme des paiements (associes a une facture)".price($paiem).""; -$var=!$var; + $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank WHERE amount > 0"; $credits = valeur($sql); print "Somme des credits".price($credits).""; -$var=!$var; + $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank WHERE amount < 0"; $debits = valeur($sql); print "Somme des debits".price($debits).""; -$var=!$var; + $sql = "SELECT sum(amount) as amount FROM ".MAIN_DB_PREFIX."bank "; $solde = valeur($sql); print "".$langs->trans("BankBalance")."".price($solde).""; diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index cd6d2adb796..699edd31b7a 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -74,8 +74,8 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; print "rowid\">$objp->label"; print ''.$objp->nombre.''; print ''.price(abs($objp->somme)).""; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index ae35eee80fa..0cf88224e63 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -105,8 +105,8 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; print ''.$objp->rowid.''; if (GETPOST("action") == 'edit' && GETPOST("categid")== $objp->rowid) { @@ -136,8 +136,8 @@ if ($result) */ if ($action != 'edit') { - $var=!$var; - print ''; + + print ''; print ' '; print ''; print ''; diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 0f4e8b825b2..a92b23fc617 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -442,7 +442,7 @@ foreach ($accounts as $key=>$type) $lastcurrencycode=$acc->currency_code; } - print ''; + print ''; // Ref if (! empty($arrayfields['b.ref']['checked'])) @@ -576,7 +576,7 @@ foreach ($accounts as $key=>$type) $i++; } -if (! $found) print ''.$langs->trans("None").''; +if (! $found) print ''.$langs->trans("None").''; // Show total line if (isset($totalarray['totalbalancefield']) && $lastcurrencycode != 'various') // If there is several currency, $lastcurrencycode is set to 'various' before diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 9e26d532348..73e94a3d197 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -168,7 +168,7 @@ print ''.$langs->trans("TransferFrom").''.$langs->trans("TransferTo print ''; $var=false; -print ''; +print ''; $form->select_comptes($account_from,'account_from',0,'',1); print ""; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 5a42e516020..1dbe17d6a13 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -120,13 +120,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $var=true; // Current balance - $var=!$var; + print ''; print ''.$langs->trans("CurrentBalance").''; print ''.price($solde).''; print ''; - $var=!$var; + print ''; print ''.$langs->trans("RemainderToPay").''; print ' '; @@ -293,10 +293,10 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) // We discard lines with a remainder to pay to 0 if (price2num($total_ttc) != 0) { - $var=!$var; + // Show line - print ""; + print ''; print ''; if ($obj->dlr) print dol_print_date($db->jdate($obj->dlr),"day"); else print $langs->trans("NotDefined"); @@ -318,7 +318,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) } // Solde actuel - $var=!$var; + print ''; print ''.$langs->trans("FutureBalance").' ('.$object->currency_code.')'; print ''.price($solde, 0, $langs, 0, 0, -1, $object->currency_code).''; diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 7366c0cf2a5..6c4b41333f1 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -193,8 +193,8 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; $variousstatic->id=$obj->rowid; $variousstatic->ref=$obj->rowid; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 6215f2343e8..ee71290be2d 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -171,7 +171,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $obj = $db->fetch_object($resql); $var = !$var; - print ""; + print ''; // Date $date=$obj->periode; if (empty($date)) $date=$obj->date_ech; @@ -293,8 +293,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = $total + $obj->amount; - $var=!$var; - print ""; + + print ''; print ''.dol_print_date($db->jdate($obj->dm),'day').''."\n"; print "".$obj->label."\n"; @@ -423,8 +423,8 @@ while($j<$numlt) $total = $total + $obj->amount; - $var=!$var; - print ""; + + print ''; print ''.dol_print_date($db->jdate($obj->dm),'day').''."\n"; print "".$obj->label."\n"; @@ -507,8 +507,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $total = $total + $obj->amount; - $var=!$var; - print ""; + + print ''; print ''.dol_print_date($db->jdate($obj->dateep),'day').''."\n"; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 6a3052a938d..28eaa0a7c9b 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -178,9 +178,9 @@ if ($resql) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ""; + print ''; print ''; $thirdpartystatic->id=$obj->rowid; $thirdpartystatic->name=$obj->name; diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 63556eeaee6..bb6d58293b6 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -173,21 +173,21 @@ if ($result) $userstatic->id=$obj->uid; $userstatic->lastname=$obj->lastname; $userstatic->firstname=$obj->firstname; - print ''; + print ''; print ''.$deplacementstatic->getNomUrl(1).''; print ''.$userstatic->getNomUrl(1).''; print ''.$obj->km.''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; print ''.$deplacementstatic->LibStatut($obj->fk_statut,3).''; print ''; - $var=!$var; + $i++; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 66fab1b9279..95f4082e082 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -178,8 +178,8 @@ if ($resql) $soc = new Societe($db); if ($obj->socid) $soc->fetch($obj->socid); - $var=!$var; - print ''; + + print ''; // Id print ''.img_object($langs->trans("ShowTrip"),"trip").' '.$obj->rowid.''; // Type diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5838bb9bcf3..4b9ced1c4c0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -359,7 +359,6 @@ class Facture extends CommonInvoice '__INVOICE_NEXT_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'), ); - $substitutionisok=true; complete_substitutions_array($substitutionarray, $outputlangs); $this->note_public=make_substitutions($this->note_public,$substitutionarray); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 26c60436adf..706807c8f02 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -938,7 +938,8 @@ if ($action == 'create') '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')', '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')' ); - + $substitutionarray['__(TRANSKEY)__']=$langs->trans("TransKey"); + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; foreach($substitutionarray as $key => $val) { @@ -996,7 +997,7 @@ if ($action == 'create') // Bank account if ($object->fk_account > 0) { - print "".$langs->trans('BankAccount').""; + print "".$langs->trans('RIB').""; $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); print ""; } @@ -1241,7 +1242,8 @@ else '__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')', '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')' ); - + $substitutionarray['__(TRANSKEY)__']=$langs->trans("TransKey"); + $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; foreach($substitutionarray as $key => $val) { @@ -1266,9 +1268,11 @@ else print ''; // Bank Account + $langs->load('banks'); + print ''; print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a8cd12c1884..562455e9e5a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -7,10 +7,11 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015-2016 Ferran Marcet + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015-2016 Ferran Marcet + * Copyright (C) 2017 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -74,6 +75,8 @@ $search_type=GETPOST('search_type','int'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_vat=GETPOST('search_montant_vat','alpha'); +$search_montant_localtax1=GETPOST('search_montant_localtax1','alpha'); +$search_montant_localtax2=GETPOST('search_montant_localtax2','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); $search_status=GETPOST('search_status','int'); $search_paymentmode=GETPOST('search_paymentmode','int'); @@ -155,6 +158,8 @@ $arrayfields=array( 'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1), 'f.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), 'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), + 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj=="1"), + 'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax2_assuj=="1"), 'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), 'dynamount_payed'=>array('label'=>$langs->trans("Received"), 'checked'=>0), 'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0), @@ -198,6 +203,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS $search_societe=''; $search_montant_ht=''; $search_montant_vat=''; + $search_montant_localtax1=''; + $search_montant_localtax2=''; $search_montant_ttc=''; $search_status=''; $search_paymentmode=''; @@ -344,6 +351,7 @@ llxHeader('',$langs->trans('CustomersInvoices'),'EN:Customers_Invoices|FR:Factur $sql = 'SELECT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; $sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,'; +$sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.paye as paye, f.fk_statut,'; $sql.= ' f.datec as date_creation, f.tms as date_update,'; @@ -415,6 +423,8 @@ if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdp if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1); if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1); +if ($search_montant_localtax1 != '') $sql.= natural_search('f.localtax1', $search_montant_localtax1, 1); +if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $search_montant_localtax2, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); if ($search_status != '' && $search_status >= 0) { @@ -478,6 +488,7 @@ $sql.=$hookmanager->resPrint; if (! $sall) { $sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total, f.tva, f.total_ttc,'; + $sql.= ' f.localtax1, f.localtax2,'; $sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.paye, f.fk_statut,'; $sql.= ' f.datec, f.tms,'; @@ -506,7 +517,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $nbtotalofrecords = $db->num_rows($result); } -$sql.= $db->plimit($limit+1,$offset); +$sql.= $db->plimit($limit,$offset); //print $sql; $resql = $db->query($sql); @@ -541,6 +552,8 @@ if ($resql) if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category); if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat); + if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1); + if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2); if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc); if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode); @@ -843,6 +856,20 @@ if ($resql) print ''; print ''; } + if (! empty($arrayfields['f.total_localtax1']['checked'])) + { + // Amount + print ''; + } + if (! empty($arrayfields['f.total_localtax2']['checked'])) + { + // Amount + print ''; + } if (! empty($arrayfields['f.total_ttc']['checked'])) { // Amount @@ -929,6 +956,8 @@ if ($resql) if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'],$_SERVER["PHP_SELF"],"f.fk_mode_reglement","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'],$_SERVER['PHP_SELF'],'f.localtax1','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['f.total_localtax2']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax2']['label'],$_SERVER['PHP_SELF'],'f.localtax2','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); @@ -1120,6 +1149,22 @@ if ($resql) if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; $totalarray['totalvat'] += $obj->total_vat; } + // Amount LocalTax1 + if (! empty($arrayfields['f.total_localtax1']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totallocaltax1field']=$totalarray['nbfield']; + $totalarray['totallocaltax1'] += $obj->total_localtax1; + } + // Amount LocalTax2 + if (! empty($arrayfields['f.total_localtax2']['checked'])) + { + print '\n"; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totallocaltax2field']=$totalarray['nbfield']; + $totalarray['totallocaltax2'] += $obj->total_localtax2; + } // Amount TTC if (! empty($arrayfields['f.total_ttc']['checked'])) { @@ -1211,6 +1256,8 @@ if ($resql) // Show total line if (isset($totalarray['totalhtfield']) || isset($totalarray['totalvatfield']) + || isset($totalarray['totallocaltax1field']) + || isset($totalarray['totallocaltax2field']) || isset($totalarray['totalttcfield']) || isset($totalarray['totalamfield']) || isset($totalarray['totalrtpfield']) @@ -1228,9 +1275,11 @@ if ($resql) } elseif ($totalarray['totalhtfield'] == $i) print ''; elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totallocaltax1field'] == $i) print ''; + elseif ($totalarray['totallocaltax2field'] == $i) print ''; elseif ($totalarray['totalttcfield'] == $i) print ''; elseif ($totalarray['totalamfield'] == $i) print ''; - elseif ($totalarray['totalrtpfield'] == $i) print ''; + elseif ($totalarray['totalrtpfield'] == $i) print ''; else print ''; } print ''; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index ea886fbd65c..f3d83278885 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -612,9 +612,9 @@ if ($object->id > 0) while ($i < $num) { $obj = $db->fetch_object($result_sql); - $var=!$var; + - print ""; + print ''; print '\n"; print ''; print ''; @@ -663,9 +663,9 @@ if ($object->id > 0) while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; + - print ""; + print ''; print '\n"; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 767082997d8..77191136338 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -300,7 +300,7 @@ foreach ($data as $val) while ($year && $oldyear > $year+1) { // If we have empty year $oldyear--; - $var=!$var; + print ''; print ''; print ''; @@ -311,7 +311,7 @@ foreach ($data as $val) print ''; print ''; } - $var=!$var; + print ''; print ''; print ''; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 2fb2a7089ea..63c16afae15 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -36,7 +36,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index 781f5609915..2e7858fdb08 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -36,7 +36,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 736d5696c3e..321c2456ddd 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -172,7 +172,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; $tot_ttc+=$obj->total_ttc; $i++; - $var=!$var; + } print ''; @@ -202,7 +202,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } else { - print ''; + print ''; } print "
'; - print $langs->trans('BankAccount'); + print $langs->trans('RIB'); print ''; if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon)) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).''; + print ''; + print ''; + print ''; + print ''.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totallocaltax1']).''.price($totalarray['totallocaltax2']).''.price($totalarray['totalttc']).''.price($totalarray['totalam']).''.price($totalarray['totalrtp']).''.price($totalarray['totalrtp']).'
'.dol_print_date($db->jdate($obj->date_demande),'day')."'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''.price($obj->amount).'
'.dol_print_date($db->jdate($obj->date_demande),'day')."
0?'&userid='.$userid:'').'">'.$oldyear.'0
0?'&userid='.$userid:'').'">'.$year.''.$val['nb'].'
'; + print '
'; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; $facturestatic->total_ht=$obj->total_ht; @@ -193,7 +193,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'.$langs->trans("Total").'
'.$langs->trans("NoInvoice").'
'.$langs->trans("NoInvoice").'

"; $db->free($resql); @@ -335,7 +335,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $obj = $db->fetch_object($resql); - print ''; + print ''; print ''; print ''; @@ -380,7 +380,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $total_ttc += $obj->total_ttc; $total += $obj->total; $totalam += $obj->am; - $var=!$var; + $i++; } } @@ -388,7 +388,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $colspan=5; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; - print ''; + print ''; } print '
'.$langs->trans("NoInvoice").'
'.$langs->trans("NoInvoice").'

'; $db->free($resql); @@ -443,7 +443,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; + print ''; $facstatic->ref=$obj->ref; $facstatic->id = $obj->rowid; $facstatic->total_ht = $obj->total_ht; @@ -475,7 +475,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { $colspan=5; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; - print ''.$langs->trans("NoInvoice").''; + print ''.$langs->trans("NoInvoice").''; } print '
'; } @@ -525,8 +525,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) while ($i < $num && $i < $max) { $objp = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; $donationstatic->id=$objp->rowid; $donationstatic->lastname=$objp->lastname; $donationstatic->firstname=$objp->firstname; @@ -545,7 +545,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -592,7 +592,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - print ""; + print ''; $chargestatic->id=$obj->rowid; $chargestatic->ref=$obj->libelle; $chargestatic->lib=$obj->libelle; @@ -616,7 +616,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; $db->free($resql); @@ -677,7 +677,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us { $obj = $db->fetch_object($resql); - print ""; + print ''; print ''; $commandestatic->id=$obj->rowid; @@ -717,7 +717,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us //print "x".$tot_ttc."z".$obj->tot_fttc; $tot_tobill += ($obj->total_ttc-$obj->tot_fttc); $i++; - $var=!$var; + } print ''.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '; @@ -783,7 +783,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $obj = $db->fetch_object($resql); - print ''; + print ''; print ''; print ''; @@ -829,7 +829,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $total_ttc += $obj->total_ttc; $total += $obj->total_ht; $totalam += $obj->am; - $var=!$var; + $i++; } @@ -845,7 +845,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $colspan=6; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; - print ''; + print ''; } print '
'.$langs->trans("NoInvoice").'
'.$langs->trans("NoInvoice").'

'; $db->free($resql); @@ -907,7 +907,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { $obj = $db->fetch_object($resql); - print ''; + print ''; $facstatic->ref=$obj->ref; $facstatic->id = $obj->rowid; $facstatic->total_ht = $obj->total_ht; @@ -946,7 +946,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { $colspan=6; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; - print ''.$langs->trans("NoInvoice").''; + print ''.$langs->trans("NoInvoice").''; } print '
'; } @@ -970,7 +970,7 @@ if ($resql) while ($i < $db->num_rows($resql)) { $obj = $db->fetch_object($resql); - $var=!$var; + print "".dol_print_date($db->jdate($obj->da),"day").""; print ''.$obj->libelle.' '.$obj->label.''; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 5c21b67a891..40a5805f2b3 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -183,7 +183,7 @@ if($calc ==0 || $calc == 2) { if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) !=0) { - $var=!$var; + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { @@ -196,7 +196,7 @@ if($calc ==0 || $calc == 2) $intra = ''; } } - print ""; + print ''; print ''.$i.""; $company_static->id=$coll->socid; $company_static->name=$coll->name; @@ -258,7 +258,7 @@ if($calc ==0 || $calc == 1){ { if(($min == 0 or ($min > 0 && $coll->amount > $min)) && ($local==1?$coll->localtax1:$coll->localtax2) != 0) { - $var=!$var; + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { @@ -271,7 +271,7 @@ if($calc ==0 || $calc == 1){ $intra = ''; } } - print ""; + print ''; print ''.$i.""; $company_static->id=$coll->socid; $company_static->name=$coll->name; diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 642c37b9d65..5d17688fc68 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -81,8 +81,8 @@ function pt ($db, $sql, $date) $var=True; while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; print ''.$obj->dm."\n"; $total = $total + $obj->mm; @@ -190,8 +190,8 @@ for ($m = 1 ; $m < 13 ; $m++ ) { break; } - $var=!$var; - print ''; + + print ''; print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''; if($CalcLT==0) { $x_coll = 0; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 175ff6cf98f..13c753db464 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -338,8 +338,8 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - $var=!$var; - print ''; + + print ''; // Ref print ''.$fields['link'].''; @@ -501,8 +501,8 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - $var=!$var; - print ''; + + print ''; // Ref print ''.$fields['link'].''; diff --git a/htdocs/compta/localtax/reglement.php b/htdocs/compta/localtax/reglement.php index df96d0b7d67..54183ef72b9 100644 --- a/htdocs/compta/localtax/reglement.php +++ b/htdocs/compta/localtax/reglement.php @@ -66,8 +66,8 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; $localtax_static->id=$obj->rowid; $localtax_static->ref=$obj->rowid; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 6a3e0e1a433..96f77e85758 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -599,7 +599,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie while ($i < $num) { $objp = $db->fetch_object($resql); - $var=!$var; + $soc = new Societe($db); $soc->fetch($objp->socid); @@ -622,7 +622,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $multicurrency_remaintopay=price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,'MT'); } - print ''; + print ''; print ''; print $invoice->getNomUrl(1,''); @@ -859,8 +859,8 @@ if (! GETPOST('action')) while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''.$objp->facnumber."\n"; print ''.dol_print_date($db->jdate($objp->dp))."\n"; print ''.$objp->paiement_type.' '.$objp->num_paiement."\n"; diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php index a244a1feb60..1f00da90a8c 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/avalider.php @@ -111,8 +111,8 @@ if ($resql) while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; print "$objp->paiement_type $objp->num_paiement\n"; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 3c651ec7eb3..523d5256816 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -327,8 +327,8 @@ if ($resql) while ($i < $num) { $objp = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; $invoice=new Facture($db); $invoice->fetch($objp->facid); @@ -372,7 +372,7 @@ if ($resql) $i++; } } - $var=!$var; + print "\n"; print ''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 58a6cc3e747..625b2be518e 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -494,14 +494,14 @@ if ($action == 'new') foreach ($lines[$bid] as $lid => $value) { - $var=!$var; + $account_id = $bid; if (! isset($accounts[$bid])) $accounts[$bid]=0; $accounts[$bid] += 1; - print ""; + print ''; print ''.dol_print_date($value["date"],'day').''; print ''.$value["numero"]."\n"; print ''.$value["emetteur"]."\n"; @@ -694,7 +694,7 @@ else $accounts[$objp->bid]=0; $accounts[$objp->bid] += 1; - print ""; + print ''; print ''.$i.''; print ''.dol_print_date($db->jdate($objp->date),'day').''; // Date operation print ''.($objp->num_chq?$objp->num_chq:' ').''; @@ -742,7 +742,7 @@ else } print ''; print ''; - $var=!$var; + $i++; } print ""; diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index bba49827104..2d77cb71061 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -77,7 +77,7 @@ if ($resql) { $num = $row[0]; } - print ""; + print ''; print ''.$langs->trans("BankChecksToReceipt").''; print ''; print ''.$num.''; @@ -129,7 +129,7 @@ if ($resql) $accountstatic->id=$objp->bid; $accountstatic->label=$objp->label; - $var=!$var; + print "\n"; print ''.$checkdepositstatic->getNomUrl(1).''; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index ae9bc315877..f1a9a839792 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -186,8 +186,8 @@ if ($resql) while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); - $var=!$var; - print ""; + + print ''; // Num ref cheque print ''; @@ -225,7 +225,7 @@ if ($resql) } else { - print ""; + print ''; print ''.$langs->trans("None").""; print ''; } diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 27f34bef269..e9a90667e69 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -152,7 +152,7 @@ if ($year) { if (preg_match('/^payment/i',$file)) { - $var=!$var; + $tfile = $dir . '/'.$year.'/'.$file; $relativepath = $year.'/'.$file; print "".''.img_pdf().' '.$file.''; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 342294dfc12..bd262eaa675 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -266,9 +266,9 @@ if ($action == 'create') { $objp = $charge; - $var=!$var; + - print ""; + print ''; if ($objp->date_ech > 0) { diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index b64d92d873f..2d653f2ba05 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -239,8 +239,8 @@ if ($resql) { $objp = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; // Ref print ''; $socialcontrib->fetch($objp->scid); @@ -268,7 +268,7 @@ if ($resql) $i++; } } - $var=!$var; + print "\n"; $db->free($resql); diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 8f90183f0f7..dbbf9d09ac7 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -134,7 +134,7 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var=!$var; + print ""; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index bd16ec0e23b..62e57813886 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -322,7 +322,7 @@ if ($id > 0) { $obj = $db->fetch_object($result); - print ""; + print ''; // Status of line print ""; @@ -354,7 +354,7 @@ if ($id > 0) print ''; $total += $obj->amount; - $var=!$var; + $i++; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index b45a49dbe69..5d77a9b9771 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -194,8 +194,8 @@ if ($resql) while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; $invoicestatic->id=$obj->rowid; $invoicestatic->ref=$obj->facnumber; @@ -268,9 +268,9 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var=!$var; + - print ""; + print ''; print ""; $bprev->id=$obj->rowid; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index e104ba75a1a..c1c8bd7e929 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -136,8 +136,8 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; // Ref facture print ''; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 33a7a4486a0..72d775a49c3 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -197,7 +197,7 @@ if ($result) $thirdpartytmp->id = $obj->socid; $thirdpartytmp->name = $obj->name; - print ""; + print ''; print ""; print $invoicetmp->getNomUrl(1); @@ -233,7 +233,7 @@ if ($result) print "\n"; $total += $obj->total_ttc; - $var=!$var; + $i++; } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index d013f605504..064f41e41e8 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -164,7 +164,7 @@ if ($resql) print "\n"; $total += $obj->amount; - $var=!$var; + $i++; } } diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index a86280e66bd..c5d441e3260 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -146,7 +146,7 @@ if ($prev_id) print "\n"; - $var=!$var; + $i++; } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 440af1cdbaf..32257a71a0f 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -75,15 +75,15 @@ $var=true; print ''; print ''; -$var=!$var; -print ''; + +print ''; print ''; -$var=!$var; -print ''; + +print ''; print '
'.$langs->trans("Statistics").'
'.$langs->trans("NbOfInvoiceToWithdraw").'
'.$langs->trans("NbOfInvoiceToWithdraw").''; print ''; print $bprev->NbFactureAPrelever(); print ''; print '
'.$langs->trans("AmountToWithdraw").'
'.$langs->trans("AmountToWithdraw").''; print price($bprev->SommeAPrelever(),'','',1,-1,-1,'auto'); print '

'; @@ -129,8 +129,8 @@ if ($resql) $invoicestatic->type=$obj->type; $alreadypayed=$invoicestatic->getSommePaiement(); - $var=!$var; - print ''; + + print ''; print $invoicestatic->getNomUrl(1,'withdraw'); print ''; @@ -197,9 +197,9 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var=!$var; + - print ""; + print ''; print ""; $bprev->id=$obj->rowid; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index d5ae2514034..f7fe4b77e7d 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -165,7 +165,7 @@ if ($result) { $obj = $db->fetch_object($result); - $var=!$var; + print ""; diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 78a11e898df..ef72ca8f6e5 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -112,7 +112,7 @@ if ($result) print ''.$rej->motifs[$obj->motif].''; print "\n"; - $var=!$var; + $i++; } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index ceeef191aee..b666b355e24 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -120,7 +120,7 @@ if ($resql) print round($row[0]/$total*100,2)." %"; print ''; - $var=!$var; + $i++; } @@ -218,7 +218,7 @@ if ($resql) print ''; - $var=!$var; + $i++; } diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index aec371ac0b3..2a1234fccc1 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -198,8 +198,8 @@ if ($id > 0) // Display array foreach($TData as $data) { - $var=!$var; - print ""; + + print ''; print "".dol_print_date($data['date'],'day')."\n"; print ''.$data['link']."\n"; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 6f780de554b..5c77bbba21d 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -235,7 +235,7 @@ if ($result) { while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; + print " "; print "".$langs->trans("Bills").' '.$objp->name."\n"; @@ -280,7 +280,7 @@ if ($modecompta != 'CREANCES-DETTES') while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; + print " "; print "".$langs->trans("Bills")." ".$langs->trans("Other")." (".$langs->trans("PaymentsNotLinkedToInvoice").")\n"; @@ -304,7 +304,7 @@ if ($modecompta != 'CREANCES-DETTES') if ($total_ttc == 0) { - $var=!$var; + print " "; print ''.$langs->trans("None").''; print ''; @@ -367,7 +367,7 @@ if ($result) { while ($i < $num) { $objp = $db->fetch_object($result); - $var=!$var; + print " "; print "".$langs->trans("Bills")." socid."\">".$objp->name."\n"; @@ -387,7 +387,7 @@ if ($result) { } else { - $var=!$var; + print " "; print ''.$langs->trans("None").''; print ''; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 5b2c6b70a13..fe64bb7b999 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -671,8 +671,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) { $mois_modulo = $mois; if($mois>12) {$mois_modulo = $mois-12;} - $var=!$var; - print ''; + + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,$annee),"%B").""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { @@ -704,7 +704,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) } // Total -$var=!$var; + $nbcols=0; print ''.$langs->trans("TotalTTC").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -721,7 +721,7 @@ print ' '; print "\n"; // Balance -$var=!$var; + print ''.$langs->trans("AccountingResult").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index a6d99cbdaad..597b8aabad0 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -203,8 +203,8 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - $var=!$var; - print ""; + + print ''; $userstatic->id=$obj->uid; $userstatic->lastname=$obj->lastname; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 76456aee99b..aa479ec4369 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -602,7 +602,7 @@ if ($id > 0) while ($i < $num) { $objp = $db->fetch_object($resql); - $var=!$var; + print ""; print ''.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; @@ -616,8 +616,8 @@ if ($id > 0) } else { - $var=!$var; - print ''.$langs->trans("None").''; + + print ''.$langs->trans("None").''; } //if ($object->status == ChargeSociales::STATUS_DRAFT) diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 017bcb7686e..eda1633480a 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -163,7 +163,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $obj = $db->fetch_object($resql); $var = !$var; - print ""; + print ''; // Ref payment $payment_sc_static->id=$obj->pid; $payment_sc_static->ref=$obj->pid; @@ -259,8 +259,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = $total + $obj->amount; - $var=!$var; - print ""; + + print ''; print ''.dol_print_date($db->jdate($obj->dm),'day').''."\n"; print "".$obj->label."\n"; @@ -361,8 +361,8 @@ while($j<$numlt) $total = $total + $obj->amount; - $var=!$var; - print ""; + + print ''; print ''.dol_print_date($db->jdate($obj->dm),'day').''."\n"; print "".$obj->label."\n"; @@ -443,8 +443,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $total = $total + $obj->amount; - $var=!$var; - print ""; + + print ''; print ''.dol_print_date($db->jdate($obj->dateep),'day').''."\n"; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 236e22ba981..ee6e7f1be27 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -357,8 +357,8 @@ if ($modecompta == 'CREANCES-DETTES') if (count($name)) { foreach($name as $key=>$value) { - $var=!$var; - print ""; + + print ''; // Product $fullname=$name[$key]; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index d72b06a1bb0..fff94c898c2 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -352,8 +352,8 @@ if (count($amount)) { $i = 0; foreach($arrayforsort as $key => $value) { - $var=!$var; - print ""; + + print ''; // Third party $fullname=$name[$key]; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 636c4e29d17..548809f4317 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -517,8 +517,8 @@ if (count($amount)) { } foreach($arrayforsort as $key=>$value) { - $var=!$var; - print ""; + + print ''; // Third party $fullname=$name[$key]; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 9d942caf57a..2bb9a7d50a0 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -222,8 +222,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) { $mois_modulo = $mois;// ajout if($mois>12){$mois_modulo = $mois-12;} // ajout - $var=!$var; - print ""; + + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B").""; for ($annee = $year_start -1 ; $annee <= $year_end ; $annee++) // We start one year before to have data to be able to make delta @@ -312,8 +312,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) /* for ($mois = 1 ; $mois < 13 ; $mois++) { - $var=!$var; - print ""; + + print ''; print "".dol_print_date(dol_mktime(12,0,0,$mois,1,2000),"%B").""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -480,7 +480,7 @@ print ''; $totalam_Rac += $obj->am; $i++; } - $var=!$var; + print "Facture a encaisser : ".price($total_ttc_Rac)."<-- bug ici car n'exclut pas le deja r�gl� des factures partiellement r�gl�es"; } $db->free($resql); @@ -530,7 +530,7 @@ print ''; $total_pr += $obj->total_ttc-$obj->tot_fttc; $i++; } - $var=!$var; + print "Signe et non facture:".price($total_pr)."<-- bug ici, ca devrait exclure le deja facture"; } $db->free($resql); diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 84940bae414..0ede7fa091e 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -260,7 +260,7 @@ if (is_array($coll_list)) { $i = 1; foreach ($coll_list as $coll) { if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - $var=!$var; + $intra = str_replace($find,$replace,$coll->tva_intra); if(empty($intra)) { if($coll->assuj == '1') { @@ -270,7 +270,7 @@ if (is_array($coll_list)) { $intra = ''; } } - print ""; + print ''; print ''.$i.""; $company_static->id=$coll->socid; $company_static->name=$coll->name; @@ -340,7 +340,7 @@ if (is_array($coll_list)) { $i = 1; foreach ($coll_list as $coll) { if ($min == 0 or ($min > 0 && $coll->amount > $min)) { - $var=!$var; + $intra = str_replace($find,$replace,$coll->tva_intra); if (empty($intra)) { if ($coll->assuj == '1') { @@ -350,7 +350,7 @@ if (is_array($coll_list)) { $intra = ''; } } - print ""; + print ''; print ''.$i.""; $company_static->id=$coll->socid; $company_static->name=$coll->name; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index c9a65ac2f03..105bfcb2bf6 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -83,8 +83,8 @@ function pt ($db, $sql, $date) while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; - print ''; + + print ''; print ''.$obj->dm."\n"; $total = $total + $obj->mm; @@ -171,8 +171,8 @@ for ($m = 1 ; $m < 13 ; $m++ ) break; } - $var=!$var; - print ""; + + print ''; print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''; $x_coll = 0; diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php index 57ce32b72fe..6d33c358af2 100644 --- a/htdocs/compta/tva/quadri.php +++ b/htdocs/compta/tva/quadri.php @@ -259,8 +259,8 @@ if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES") $x_paye_sum = 0; $x_paye_ht = 0; foreach($x_both as $rate => $both){ - $var=!$var; - print ""; + + print ''; print "$rate%"; print "".price($both['coll']['totalht']).""; print "".price($both['coll']['vat']).""; @@ -282,8 +282,8 @@ if ($conf->global->ACCOUNTING_MODE == "CREANCES-DETTES") $total = $total + $diff; $subtotal = $subtotal + $diff; - $var=!$var; - print ""; + + print ''; print ''; print "".price($diff)."\n"; print "\n"; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index e0a19d7a0f3..513eb25ff7e 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -396,8 +396,8 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - $var=!$var; - print ''; + + print ''; // Ref print ''.$fields['link'].''; @@ -553,8 +553,8 @@ else if (! empty($fields['ddate_start'])) $type=1; if (! empty($fields['ddate_end'])) $type=1; - $var=!$var; - print ''; + + print ''; // Ref print ''.$fields['link'].''; diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php index 626a0fd6c34..a3d902ed3f3 100644 --- a/htdocs/compta/tva/quarter_report.php +++ b/htdocs/compta/tva/quarter_report.php @@ -408,8 +408,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $type=1; } - $var=!$var; - print ''; + + print ''; // Ref print ''.$fields['link'].''; @@ -576,8 +576,8 @@ if (!is_array($x_coll) || !is_array($x_paye)) { $type=1; } - $var=!$var; - print ''; + + print ''; // Ref print ''.$fields['link'].''; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index dc3ea846eee..0e5f3fca093 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1507,7 +1507,7 @@ else $objp = $db->fetch_object($result); - //$var=!$var; + // if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 9ec924254a9..ea9c06d0b2f 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -82,7 +82,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print "
'.$langs->trans("Search").'
'.$langs->trans("Contract").':
\n"; @@ -188,8 +188,8 @@ foreach($listofstatus as $status) $dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0)); if (empty($conf->use_javascript_ajax)) { - $var=!$var; - print ''; + + print ''; print ''.$staticcontratligne->LibStatut($status,0,($bool?1:0)).''; print ''.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).''; print "\n"; @@ -210,8 +210,8 @@ foreach($listofstatus as $status) { if (empty($conf->use_javascript_ajax)) { - $var=!$var; - print ''; + + print ''; print ''.$staticcontratligne->LibStatut($status,0,($bool?1:0)).''; print ''.($nb[$status.$bool]?$nb[$status.$bool]:0).' '.$staticcontratligne->LibStatut($status,3,($bool?1:0)).''; if ($status==4 && ! $bool) $bool=true; @@ -258,7 +258,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; + print ''; $staticcontrat->ref=$obj->ref; $staticcontrat->id=$obj->rowid; print $staticcontrat->getNomUrl(1,''); @@ -272,7 +272,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) print ''; //$tot_ttc+=$obj->total_ttc; $i++; - $var=!$var; + } } else @@ -334,9 +334,9 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); - $var=!$var; + - print ''; + print ''; print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid); $staticcontrat->id=$obj->cid; @@ -401,8 +401,8 @@ if ($resql) while ($i < min($num,$max)) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->id=$obj->fk_contrat; @@ -482,8 +482,8 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); @@ -563,8 +563,8 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; - print ''; + + print ''; print ''; $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 1e2820f10e0..d92bcd16679 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -519,9 +519,9 @@ while ($i < min($num,$limit)) $contractstatic->id=$obj->cid; $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; - $var=!$var; + - print ""; + print ''; // Ref if (! empty($arrayfields['c.ref']['checked'])) diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 1257e3503a9..a2da6cef24e 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -33,7 +33,7 @@ $var=true; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - $var=!$var; + $trclass=($var?'pair':'impair'); if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index b6d38d17b53..e856d52c2b6 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -191,7 +191,7 @@ class box_actions extends ModeleBoxes // on affiche que les évènement du jours ou passé // qui ne sont pas à 100% $actioncejour=true; - $var=!$var; + // TR $logo=$contents[$line][0]['logo']; $label=$contents[$line][1]['text']; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index a709a7aef3a..2b3c69a9e15 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -249,6 +249,8 @@ class box_graph_product_distribution extends ModeleBoxes if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire)) { + $langs->load("orders"); + // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showordernb) { diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 39f39524b41..f5fa32e590d 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -278,7 +278,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" { if (isset($contents[$i])) { - $var=!$var; + // TR if (isset($contents[$i][0]['tr'])) $out.= ''; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 3acdc342284..3da7f3abcf3 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -31,16 +31,20 @@ /** * Class to send emails (with attachments or not) - * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid); + * Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext); * $mailfile->sendfile(); */ class CMailFile { + public $sendcontext; + public $sendmode; + public $sendsetup; + var $subject; // Topic: Subject of email var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '' or 'John Doe ' or ''). Note that with gmail smtps, value here is forced by google to account (but not the reply-to). - // Sender: Who send the email ("Sender" has sent emails on behalf of "From"). - // Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain. - // Return-Path: Email where to send bounds. + // Sender: Who send the email ("Sender" has sent emails on behalf of "From"). + // Use it when the "From" is an email of a domain that is a SPF protected domain, and sending smtp server is not this domain. In such case, add Sender field with an email of the protected domain. + // Return-Path: Email where to send bounds. var $reply_to; // Reply-To: Email where to send replies from mailer software (mailer use From if reply-to not defined, Gmail use gmail account if reply-to not defined) var $errors_to; // Errors-To: Email where to send errors. var $addr_to; @@ -77,13 +81,13 @@ class CMailFile var $html_images=array(); var $images_encoded=array(); var $image_types = array('gif' => 'image/gif', - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'bmp' => 'image/bmp', - 'png' => 'image/png', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff'); + 'jpg' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'bmp' => 'image/bmp', + 'png' => 'image/png', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff'); /** @@ -104,14 +108,22 @@ class CMailFile * @param string $css Css option * @param string $trackid Tracking string (contains type and id of related element) * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'phpmail' and 'smtps' for the moment) - * @param string $sendingcontext 'standard', 'emailing', ... + * @param string $sendcontext 'standard', 'emailing', ... */ - function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='',$trackid='',$moreinheader='',$sendingcontext='standard') + function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='',$trackid='',$moreinheader='',$sendcontext='standard') { global $conf, $dolibarr_main_data_root; - $this->sendingcontext = $sendingcontext; + $this->sendcontext = $sendcontext; + $this->sendmode = ''; + if ($this->sendcontext == 'emailing') $this->sendmode = $conf->global->EMAILING_MAIL_SENDMODE; + if (empty($this->sendmode)) $this->sendmode=$conf->global->MAIN_MAIL_SENDMODE; + if (empty($this->sendmode)) $this->sendmode='mail'; + + $this->sendsetup = array(); + + // We define end of line (RFC 821). $this->eol="\r\n"; // We define end of line for header fields (RFC 822bis section 2.3 says header must contains \r\n). @@ -132,17 +144,14 @@ class CMailFile // On defini alternative_boundary $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars) - // If ending method not defined - if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail'; - - dol_syslog("CMailFile::CMailfile: MAIN_MAIL_SENDMODE=".$conf->global->MAIN_MAIL_SENDMODE." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendingcontext=$sendingcontext", LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." charset=".$conf->file->character_set_client." from=$from, to=$to, addr_cc=$addr_cc, addr_bcc=$addr_bcc, errors_to=$errors_to, trackid=$trackid sendcontext=$sendcontext", LOG_DEBUG); dol_syslog("CMailFile::CMailfile: subject=$subject, deliveryreceipt=$deliveryreceipt, msgishtml=$msgishtml", LOG_DEBUG); if (empty($subject)) { - dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject"); - $this->error='ErrorSubjectIsRequired'; - return; + dol_syslog("CMailFile::CMailfile: Try to send an email with empty subject"); + $this->error='ErrorSubjectIsRequired'; + return; } // Detect if message is HTML (use fast method) @@ -163,11 +172,11 @@ class CMailFile { $this->html = $msg; - if (! empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS)) - { - $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias'); - } - + if (! empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS)) + { + $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias'); + } + // Define if there is at least one file if ($findimg) { @@ -196,7 +205,7 @@ class CMailFile if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO; // Action according to choosed sending method - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') + if ($this->sendmode == 'mail') { // Use mail php function (default PHP method) // ------------------------------------------ @@ -216,9 +225,9 @@ class CMailFile $this->addr_bcc = $addr_bcc; $this->deliveryreceipt = $deliveryreceipt; $this->trackid = $trackid; - + $smtp_headers = $this->write_smtpheaders(); - if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n + if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n // Define mime_headers $mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list); @@ -254,7 +263,7 @@ class CMailFile $this->message.= $text_body . $files_encoded; $this->message.= "--" . $this->mixed_boundary . "--" . $this->eol; } - else if ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') + else if ($this->sendmode == 'smtps') { // Use SMTPS library // ------------------------------------------ @@ -310,7 +319,7 @@ class CMailFile $this->smtps=$smtps; } // TODO not stable, in progress - else if ($conf->global->MAIN_MAIL_SENDMODE == 'phpmailer') + else if ($this->sendmode == 'phpmailer') { // Use PHPMailer library // ------------------------------------------ @@ -325,7 +334,7 @@ class CMailFile $this->phpmailer->SetReplyTo($this->getValidAddress($from,0,1)); // Set property with this->phpmailer->setReplyTo after constructor if you want to use another value than the From // TODO Add trackid into smtp header // TODO if (! empty($moreinheader)) ... - + if (! empty($this->html)) { if (!empty($css)) @@ -362,94 +371,94 @@ class CMailFile $this->phpmailer->setErrorsTo($errors_to); $this->phpmailer->setDeliveryReceipt($deliveryreceipt); } - else if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') - { - // Use Swift Mailer library - // ------------------------------------------ - - $host = dol_getprefix('email'); - - require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; - // Create the message - $this->message = Swift_Message::newInstance(); + else if ($this->sendmode == 'swiftmailer') + { + // Use Swift Mailer library + // ------------------------------------------ - // Adding a trackid header to a message - $headers = $this->message->getHeaders(); - $headers->addTextHeader('X-Dolibarr-TRACKID', $trackid); - $headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host; - $msgid = $headers->get('Message-ID'); - $msgid->setId($headerID); - $headers->addIdHeader('References', $headerID); - // TODO if (! empty($moreinheader)) ... - - // Give the message a subject - $this->message->setSubject($this->encodetorfc2822($subject)); + $host = dol_getprefix('email'); - // Set the From address with an associative array - //$this->message->setFrom(array('john@doe.com' => 'John Doe')); - if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from)); + require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; + // Create the message + $this->message = Swift_Message::newInstance(); - // Set the To addresses with an associative array - if (! empty($to)) $this->message->setTo($this->getArrayAddress($to)); + // Adding a trackid header to a message + $headers = $this->message->getHeaders(); + $headers->addTextHeader('X-Dolibarr-TRACKID', $trackid); + $headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host; + $msgid = $headers->get('Message-ID'); + $msgid->setId($headerID); + $headers->addIdHeader('References', $headerID); + // TODO if (! empty($moreinheader)) ... - if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from)); + // Give the message a subject + $this->message->setSubject($this->encodetorfc2822($subject)); - $this->message->setCharSet($conf->file->character_set_client); + // Set the From address with an associative array + //$this->message->setFrom(array('john@doe.com' => 'John Doe')); + if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from)); - if (! empty($this->html)) - { - if (!empty($css)) - { - $this->css = $css; - $this->buildCSS(); - } - $msg = $this->html; - $msg = $this->checkIfHTML($msg); - } + // Set the To addresses with an associative array + if (! empty($to)) $this->message->setTo($this->getArrayAddress($to)); - if ($this->atleastoneimage) - { - foreach ($this->images_encoded as $img) - { - //$img['fullpath'],$img['image_encoded'],$img['name'],$img['content_type'],$img['cid'] - $attachment = Swift_Image::fromPath($img['fullpath'], $img['content_type']); - // embed image - $imgcid = $this->message->embed($attachment); - // replace cid by the one created by swiftmail in html message - $msg = str_replace("cid:".$img['cid'], $imgcid, $msg); - } - } + if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from)); - if ($this->msgishtml) { - $this->message->setBody($msg,'text/html'); - // And optionally an alternative body - //$this->message->addPart('Here is the message itself', 'text/plain'); - } else { - $this->message->setBody($msg,'text/plain'); - // And optionally an alternative body - //$this->message->addPart('Here is the message itself', 'text/html'); - } + $this->message->setCharSet($conf->file->character_set_client); - if ($this->atleastonefile) - { - foreach ($filename_list as $i => $val) - { - //$this->message->attach(Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i])); - $attachment = Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i]); - $this->message->attach($attachment); - } - } + if (! empty($this->html)) + { + if (!empty($css)) + { + $this->css = $css; + $this->buildCSS(); + } + $msg = $this->html; + $msg = $this->checkIfHTML($msg); + } - if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc)); - if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc)); - //if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to); - if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from)); - } + if ($this->atleastoneimage) + { + foreach ($this->images_encoded as $img) + { + //$img['fullpath'],$img['image_encoded'],$img['name'],$img['content_type'],$img['cid'] + $attachment = Swift_Image::fromPath($img['fullpath'], $img['content_type']); + // embed image + $imgcid = $this->message->embed($attachment); + // replace cid by the one created by swiftmail in html message + $msg = str_replace("cid:".$img['cid'], $imgcid, $msg); + } + } + + if ($this->msgishtml) { + $this->message->setBody($msg,'text/html'); + // And optionally an alternative body + //$this->message->addPart('Here is the message itself', 'text/plain'); + } else { + $this->message->setBody($msg,'text/plain'); + // And optionally an alternative body + //$this->message->addPart('Here is the message itself', 'text/html'); + } + + if ($this->atleastonefile) + { + foreach ($filename_list as $i => $val) + { + //$this->message->attach(Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i])); + $attachment = Swift_Attachment::fromPath($filename_list[$i],$mimetype_list[$i]); + $this->message->attach($attachment); + } + } + + if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc)); + if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc)); + //if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to); + if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from)); + } else { // Send mail method not correctly defined // -------------------------------------- - $this->error = 'Bad value for MAIN_MAIL_SENDMODE constant'; + $this->error = 'Bad value for sendmode'; } } @@ -471,55 +480,55 @@ class CMailFile if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { - require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($db); - $hookmanager->initHooks(array( - 'maildao' - )); - $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if (! empty($reshook)) - { - $this->error = "Error in hook maildao doactions " . $reshook; - dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR); + require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($db); + $hookmanager->initHooks(array( + 'maildao' + )); + $reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if (! empty($reshook)) + { + $this->error = "Error in hook maildao doactions " . $reshook; + dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR); - return $reshook; - } + return $reshook; + } - // Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL - if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10; - $tmparray1 = explode(',', $this->addr_to); - if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL) - { - $this->error = 'Too much recipients in to:'; - dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); - return false; - } - if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL=10; - $tmparray2 = explode(',', $this->addr_cc); - if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL) - { - $this->error = 'Too much recipients in cc:'; - dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); - return false; - } - if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL=10; - $tmparray3 = explode(',', $this->addr_bcc); - if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL) - { - $this->error = 'Too much recipients in bcc:'; - dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); - return false; - } - if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10; - if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL) - { - $this->error = 'Too much recipients in to:, cc:, bcc:'; - dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); - return false; - } + // Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL + if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10; + $tmparray1 = explode(',', $this->addr_to); + if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL) + { + $this->error = 'Too much recipients in to:'; + dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); + return false; + } + if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL=10; + $tmparray2 = explode(',', $this->addr_cc); + if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL) + { + $this->error = 'Too much recipients in cc:'; + dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); + return false; + } + if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL=10; + $tmparray3 = explode(',', $this->addr_bcc); + if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL) + { + $this->error = 'Too much recipients in bcc:'; + dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); + return false; + } + if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10; + if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL) + { + $this->error = 'Too much recipients in to:, cc:, bcc:'; + dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING); + return false; + } // Action according to choosed sending method - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') + if ($this->sendmode == 'mail') { // Use mail php function (default PHP method) // ------------------------------------------ @@ -555,15 +564,15 @@ class CMailFile // Having this variable not defined may create problems with some other sendmail (option -f required) $additionnalparam .= ($additionnalparam?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') ); } - if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender - { - $additionnalparam .= ($additionnalparam?' ':'').'-ba'; - } + if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender + { + $additionnalparam .= ($additionnalparam?' ':'').'-ba'; + } + + if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params + + dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG); - if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params - - dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG); - $this->message=stripslashes($this->message); if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); @@ -600,7 +609,7 @@ class CMailFile if (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)) ini_restore('SMTP'); if (! empty($conf->global->MAIN_MAIL_SMTP_PORT)) ini_restore('smtp_port'); } - else if ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') + else if ($this->sendmode == 'smtps') { // Use SMTPS library @@ -612,25 +621,25 @@ class CMailFile if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); // TODO Manage alternative parameters - + // If we use SSL/TLS $server=$conf->global->MAIN_MAIL_SMTP_SERVER; if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server; - $port=$conf->global->MAIN_MAIL_SMTP_PORT; - + $port=$conf->global->MAIN_MAIL_SMTP_PORT; + $this->smtps->setHost($server); $this->smtps->setPort($port); // 25, 465...; $loginid=''; $loginpass=''; - if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) + if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) { - $loginid = $conf->global->MAIN_MAIL_SMTPS_ID; - $this->smtps->setID($loginid); + $loginid = $conf->global->MAIN_MAIL_SMTPS_ID; + $this->smtps->setID($loginid); } - if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) + if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) { - $loginpass = $conf->global->MAIN_MAIL_SMTPS_PW; - $this->smtps->setPW($loginpass); + $loginpass = $conf->global->MAIN_MAIL_SMTPS_PW; + $this->smtps->setPW($loginpass); } $res=true; @@ -652,7 +661,7 @@ class CMailFile if ($res) { if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->smtps->setDebug(true); - + $result=$this->smtps->sendMsg(); //print $result; @@ -668,63 +677,63 @@ class CMailFile } } } - else if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') - { + else if ($this->sendmode == 'swiftmailer') + { - // Use Swift Mailer library - // ------------------------------------------ - require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; + // Use Swift Mailer library + // ------------------------------------------ + require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; - // Forcage parametres - if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP'); - if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); + // Forcage parametres + if (empty($conf->global->MAIN_MAIL_SMTP_SERVER)) $conf->global->MAIN_MAIL_SMTP_SERVER=ini_get('SMTP'); + if (empty($conf->global->MAIN_MAIL_SMTP_PORT)) $conf->global->MAIN_MAIL_SMTP_PORT=ini_get('smtp_port'); - // If we use SSL/TLS - $server=$conf->global->MAIN_MAIL_SMTP_SERVER; - $secure=''; - //var_dump(stream_get_transports()); - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl'; - if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls'; + // If we use SSL/TLS + $server=$conf->global->MAIN_MAIL_SMTP_SERVER; + $secure=''; + //var_dump(stream_get_transports()); + if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $secure='ssl'; + if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $secure='tls'; - $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure); + $this->transport = Swift_SmtpTransport::newInstance($server, $conf->global->MAIN_MAIL_SMTP_PORT, $secure); - if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID); - if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW); - //$smtps->_msgReplyTo = 'reply@web.com'; + if (! empty($conf->global->MAIN_MAIL_SMTPS_ID)) $this->transport->setUsername($conf->global->MAIN_MAIL_SMTPS_ID); + if (! empty($conf->global->MAIN_MAIL_SMTPS_PW)) $this->transport->setPassword($conf->global->MAIN_MAIL_SMTPS_PW); + //$smtps->_msgReplyTo = 'reply@web.com'; - // Create the Mailer using your created Transport - $this->mailer = Swift_Mailer::newInstance($this->transport); + // Create the Mailer using your created Transport + $this->mailer = Swift_Mailer::newInstance($this->transport); - if (! empty($conf->global->MAIN_MAIL_DEBUG)) { - // To use the ArrayLogger - $this->logger = new Swift_Plugins_Loggers_ArrayLogger(); - // Or to use the Echo Logger - //$this->logger = new Swift_Plugins_Loggers_EchoLogger(); - $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger)); - } - // send mail - try { - $result = $this->mailer->send($this->message); - } catch (Exception $e) { - $this->error = $e->getMessage(); - } - if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); + if (! empty($conf->global->MAIN_MAIL_DEBUG)) { + // To use the ArrayLogger + $this->logger = new Swift_Plugins_Loggers_ArrayLogger(); + // Or to use the Echo Logger + //$this->logger = new Swift_Plugins_Loggers_EchoLogger(); + $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger)); + } + // send mail + try { + $result = $this->mailer->send($this->message); + } catch (Exception $e) { + $this->error = $e->getMessage(); + } + if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); - $res = true; - if (! empty($this->error) && ! $result) { - dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); - $res=false; - } else { - $this->error = sprintf ("Sent %d messages\n", $result); - } - } + $res = true; + if (! empty($this->error) && ! $result) { + dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); + $res=false; + } else { + $this->error = sprintf ("Sent %d messages\n", $result); + } + } else { // Send mail method not correctly defined // -------------------------------------- - return 'Bad value for MAIN_MAIL_SENDMODE constant'; + return 'Bad value for sendmode'; } } @@ -792,81 +801,81 @@ class CMailFile $outputfile=$dolibarr_main_data_root."/dolibarr_mail.log"; $fp = fopen($outputfile,"w"); - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') + if ($this->sendmode == 'mail') { fputs($fp, $this->headers); fputs($fp, $this->eol); // This eol is added by the mail function, so we add it in log fputs($fp, $this->message); } - elseif ($conf->global->MAIN_MAIL_SENDMODE == 'smtps') + elseif ($this->sendmode == 'smtps') { fputs($fp, $this->smtps->log); // this->smtps->log is filled only if MAIN_MAIL_DEBUG was set to on } - elseif ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') - { - fputs($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on - } + elseif ($this->sendmode == 'swiftmailer') + { + fputs($fp, $this->logger->dump()); // this->logger is filled only if MAIN_MAIL_DEBUG was set to on + } fclose($fp); if (! empty($conf->global->MAIN_UMASK)) - @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); + @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } } - /** - * Correct an uncomplete html string - * - * @param string $msg String - * @return string Completed string - */ - function checkIfHTML($msg) - { - if (!preg_match('/^[\s\t]*styleCSS)) $out.= $this->styleCSS; - $out.= "bodyCSS)) $out.= $this->bodyCSS; - $out.= ">"; - $out.= $msg; - $out.= ""; - } - else - { - $out = $msg; - } + /** + * Correct an uncomplete html string + * + * @param string $msg String + * @return string Completed string + */ + function checkIfHTML($msg) + { + if (!preg_match('/^[\s\t]*styleCSS)) $out.= $this->styleCSS; + $out.= "bodyCSS)) $out.= $this->bodyCSS; + $out.= ">"; + $out.= $msg; + $out.= ""; + } + else + { + $out = $msg; + } - return $out; - } + return $out; + } - /** - * Build a css style (mode = all) into this->styleCSS and this->bodyCSS - * - * @return css - */ - function buildCSS() - { - if (! empty($this->css)) - { - // Style CSS - $this->styleCSS = ''; - } - } + if ($this->css['bgcolor']) + { + $this->styleCSS.= ' background-color: '.$this->css['bgcolor'].';'; + $this->bodyCSS.= ' bgcolor="'.$this->css['bgcolor'].'"'; + } + if ($this->css['bgimage']) + { + // TODO recuperer cid + $this->styleCSS.= ' background-image: url("cid:'.$this->css['bgimage_cid'].'");'; + } + $this->styleCSS.= '}'; + $this->styleCSS.= ''; + } + } /** @@ -924,7 +933,7 @@ class CMailFile $out.= "Content-Type: multipart/mixed; boundary=\"".$this->mixed_boundary."\"".$this->eol2; $out.= "Content-Transfer-Encoding: 8bit".$this->eol2; - + dol_syslog("CMailFile::write_smtpheaders smtp_header=\n".$out); return $out; } @@ -992,14 +1001,14 @@ class CMailFile { $strContentAltText = html_entity_decode(strip_tags($strContent)); $strContentAltText = rtrim(wordwrap($strContentAltText, 75, "\r\n")); - - // Check if html header already in message, if not complete the message + + // Check if html header already in message, if not complete the message $strContent = $this->checkIfHTML($strContent); } // Make RFC2045 Compliant, split lines - //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content - $strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content. + //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content + $strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content. if ($this->msgishtml) { @@ -1012,23 +1021,23 @@ class CMailFile $out.= $this->eol; $out.= "--" . $this->related_boundary . $this->eol; } - + if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part before html part { $out.= "Content-Type: multipart/alternative; boundary=\"".$this->alternative_boundary."\"".$this->eol; $out.= $this->eol; $out.= "--" . $this->alternative_boundary . $this->eol; $out.= "Content-Type: text/plain; charset=".$conf->file->character_set_client.$this->eol; - $out.= $this->eol.$strContentAltText.$this->eol; - $out.= "--" . $this->alternative_boundary . $this->eol; + $out.= $this->eol.$strContentAltText.$this->eol; + $out.= "--" . $this->alternative_boundary . $this->eol; } - + $out.= "Content-Type: text/html; charset=".$conf->file->character_set_client.$this->eol; $out.= $this->eol.$strContent.$this->eol; - + if (! $this->atleastoneimage && $strContentAltText && ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part after html part { - $out.= "--" . $this->alternative_boundary . "--". $this->eol; + $out.= "--" . $this->alternative_boundary . "--". $this->eol; } } else @@ -1042,13 +1051,13 @@ class CMailFile // Encode images if ($this->atleastoneimage) { - $out .= $this->write_images($this->images_encoded); - // always end related and end alternative after inline images - $out .= "--" . $this->related_boundary . "--" . $this->eol; - $out .= $this->eol . "--" . $this->alternative_boundary . "--" . $this->eol; - $out .= $this->eol; + $out .= $this->write_images($this->images_encoded); + // always end related and end alternative after inline images + $out .= "--" . $this->related_boundary . "--" . $this->eol; + $out .= $this->eol . "--" . $this->alternative_boundary . "--" . $this->eol; + $out .= $this->eol; } - + return $out; } @@ -1074,10 +1083,12 @@ class CMailFile if ($encoded >= 0) { if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i]; - if (! $mimetype_list[$i]) { $mimetype_list[$i] = "application/octet-stream"; } + if (! $mimetype_list[$i]) { + $mimetype_list[$i] = "application/octet-stream"; + } $out.= "--" . $this->mixed_boundary . $this->eol; - $out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol; + $out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol; $out.= "Content-Type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\"".$this->eol; $out.= "Content-Transfer-Encoding: base64".$this->eol; $out.= "Content-Description: File Attachment".$this->eol; @@ -1137,25 +1148,25 @@ class CMailFile */ function check_server_port($host,$port) { - global $conf; + global $conf; $_retVal=0; $timeout=5; // Timeout in seconds if (function_exists('fsockopen')) { - // If we use SSL/TLS - if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host; - // tls smtp start with no encryption - //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; + // If we use SSL/TLS + if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $host='ssl://'.$host; + // tls smtp start with no encryption + //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; dol_syslog("Try socket connection to host=".$host." port=".$port); //See if we can connect to the SMTP server if ($socket = @fsockopen( - $host, // Host to test, IP or domain. Add ssl:// for SSL/TLS. - $port, // which Port number to use - $errno, // actual system level error - $errstr, // and any text that goes with the error - $timeout + $host, // Host to test, IP or domain. Add ssl:// for SSL/TLS. + $port, // which Port number to use + $errno, // actual system level error + $errstr, // and any text that goes with the error + $timeout )) // timeout for reading/writing data over the socket { // Windows still does not have support for this timeout function @@ -1225,7 +1236,7 @@ class CMailFile foreach ($matches[1] as $full) { - if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i',$full,$regs)) // If xxx is 'file=aaa' + if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i',$full,$regs)) // If xxx is 'file=aaa' { $img = $regs[1]; @@ -1306,7 +1317,7 @@ class CMailFile * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com' * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between " * @param int $encode 0=No encode name, 1=Encode name to RFC2822 - * @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more. + * @param int $maxnumberofemail 0=No limit. Otherwise, maximum number of emails returned ($address may contains several email separated with ','). Add '...' if there is more. * @return string If format 0: '' or 'John Doe ' or '=?UTF-8?B?Sm9obiBEb2U=?= ' * If format 1: '' * If format 2: 'john@doe.com' @@ -1338,12 +1349,12 @@ class CMailFile if ($email) { - $i++; - + $i++; + $newemail=''; if ($format == 4) { - $newemail = $name?$name:$email; + $newemail = $name?$name:$email; } if ($format == 2) { @@ -1361,12 +1372,12 @@ class CMailFile } $ret=($ret ? $ret.',' : '').$newemail; - + // Stop if we have too much records if ($maxnumberofemail && $i >= $maxnumberofemail) { - if (count($arrayaddress) > $maxnumberofemail) $ret.='...'; - break; + if (count($arrayaddress) > $maxnumberofemail) $ret.='...'; + break; } } } @@ -1374,38 +1385,38 @@ class CMailFile return $ret; } - /** - * Return a formatted array of address string for SMTP protocol - * - * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com' - * @return array array of email => name - */ - function getArrayAddress($address) - { - global $conf; + /** + * Return a formatted array of address string for SMTP protocol + * + * @param string $address Example: 'John Doe , Alan Smith ' or 'john@doe.com, alan@smith.com' + * @return array array of email => name + */ + function getArrayAddress($address) + { + global $conf; - $ret=array(); + $ret=array(); - $arrayaddress=explode(',',$address); + $arrayaddress=explode(',',$address); - // Boucle sur chaque composant de l'adresse - foreach($arrayaddress as $val) - { - if (preg_match('/^(.*)<(.*)>$/i',trim($val),$regs)) - { - $name = trim($regs[1]); - $email = trim($regs[2]); - } - else - { - $name = null; - $email = trim($val); - } + // Boucle sur chaque composant de l'adresse + foreach($arrayaddress as $val) + { + if (preg_match('/^(.*)<(.*)>$/i',trim($val),$regs)) + { + $name = trim($regs[1]); + $email = trim($regs[2]); + } + else + { + $name = null; + $email = trim($val); + } - $ret[$email]=empty($conf->global->MAIN_MAIL_NO_FULL_EMAIL)?$name:null; - } + $ret[$email]=empty($conf->global->MAIN_MAIL_NO_FULL_EMAIL)?$name:null; + } - return $ret; - } + return $ret; + } } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index ac7bb3175fb..3e9d56f8f8c 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -307,7 +307,7 @@ abstract class CommonInvoice extends CommonObject * * @param int $paye Status field paye * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @param int $type Type invoice * @return string Libelle du statut @@ -408,9 +408,10 @@ abstract class CommonInvoice extends CommonObject else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('BillStatusPaid'); } } - if ($mode == 5) + if ($mode == 5 || $mode == 6) { - $prefix='Short'; + $prefix=''; + if ($mode == 5) $prefix='Short'; if (! $paye) { if ($status == 0) return ''.$langs->trans('Bill'.$prefix.'StatusDraft').' '.img_picto($langs->trans('BillStatusDraft'),'statut0'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 634f27b1985..e03db1b4773 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -42,50 +42,59 @@ abstract class CommonObject * @var DoliDb Database handler (result of a new DoliDB) */ public $db; - /** * @var int The object identifier */ public $id; - /** * @var string Error string * @deprecated Use instead the array of error strings * @see errors */ public $error; - /** * @var string[] Array of error strings */ public $errors=array(); - + /** + * @var string + */ + public $element; + /** + * @var string + */ + public $table_element; + /** + * @var + */ + public $table_element_line; /** * @var string Key value used to track if data is coming from import wizard */ public $import_key; - /** * @var mixed Contains data to manage extrafields */ public $array_options=array(); - /** * @var int[] Array of linked objects ids. Loaded by ->fetchObjectLinked */ public $linkedObjectsIds; - /** * @var mixed Array of linked objects. Loaded by ->fetchObjectLinked */ public $linkedObjects; - + /** + * @var Object To store a cloned copy of object before to edit it and keep track of old properties + */ + public $oldcopy; + /** * @var string Column name of the ref field. */ protected $table_ref_field = ''; - + // Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them. @@ -166,19 +175,6 @@ abstract class CommonObject */ public $ref_ext; - /** - * @var string - */ - public $element; - /** - * @var string - */ - public $table_element; - /** - * @var - */ - public $table_element_line; - /** * @var int The object's status * @see setStatut() @@ -332,8 +328,10 @@ abstract class CommonObject public $firstname; public $civility_id; + // No constructor as it is an abstract class + /** * Check an object id/ref exists * If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch @@ -3164,8 +3162,16 @@ abstract class CommonObject $resql = $this->db->query($sql); if ($resql) { - $res = $this->db->fetch_object($resql); - return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; + $num = $this->db->num_rows($resql); + if ($num > 0) + { + $res = $this->db->fetch_object($resql); + return 'Incoterm : '.$res->code.' - '.$this->location_incoterms; + } + else + { + return ''; + } } else { @@ -3422,7 +3428,7 @@ abstract class CommonObject //Line extrafield $line->fetch_optionals($line->id,$extralabelslines); - $var=!$var; + //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) if (is_object($hookmanager)) // Old code is commented on preceding line. @@ -3603,7 +3609,7 @@ abstract class CommonObject foreach ($this->lines as $line) { - $var=!$var; + if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 08763cc346b..9446020e3ff 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -128,11 +128,7 @@ class Conf dol_syslog(get_class($this)."::setValues"); - /* - * Definition de toutes les constantes globales d'environnement - * - En constante php (TODO a virer) - * - En $this->global->key=value - */ + //Define all global constants into $this->global->key=value $sql = "SELECT ".$db->decrypt('name')." as name,"; $sql.= " ".$db->decrypt('value')." as value, entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; @@ -158,7 +154,7 @@ class Conf $value=$objp->value; if ($key) { - if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install) + //if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install) $this->global->$key=$value; if ($value && preg_match('/^MAIN_MODULE_/',$key)) @@ -207,7 +203,7 @@ class Conf $db->free($resql); } - // Include other local consts.php files and fetch their values to the corresponding database constants + // Include other local consts.php files and fetch their values to the corresponding database constants. if (! empty($this->global->LOCAL_CONSTS_FILES)) { $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); foreach ($filesList as $file) { @@ -333,13 +329,12 @@ class Conf $this->propal->dir_output=$rootfordata."/propale"; $this->propal->dir_temp=$rootfordata."/propale/temp"; - // Exception: Some dir are not the name of module. So we keep exception here - // for backward compatibility. + // Exception: Some dir are not the name of module. So we keep exception here for backward compatibility. // Sous module bons d'expedition - $this->expedition_bon->enabled= defined("MAIN_SUBMODULE_EXPEDITION")?MAIN_SUBMODULE_EXPEDITION:0; + $this->expedition_bon->enabled=$this->global->MAIN_SUBMODULE_EXPEDITION?$this->global->MAIN_SUBMODULE_EXPEDITION:0; // Sous module bons de livraison - $this->livraison_bon->enabled=defined("MAIN_SUBMODULE_LIVRAISON")?MAIN_SUBMODULE_LIVRAISON:0; + $this->livraison_bon->enabled=$this->global->MAIN_SUBMODULE_LIVRAISON?$this->global->MAIN_SUBMODULE_LIVRAISON:0; // Module fournisseur if (! empty($this->fournisseur)) @@ -599,8 +594,8 @@ class Conf } // We init log handlers - if (defined('SYSLOG_HANDLERS')) { - $handlers = json_decode(constant('SYSLOG_HANDLERS')); + if (! empty($this->global->SYSLOG_HANDLERS)) { + $handlers = json_decode($this->global->SYSLOG_HANDLERS); } else { $handlers = array(); } @@ -632,6 +627,7 @@ class Conf $this->loghandlers[$handler] = $loghandlerinstance; } } + } } diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index 869b26e2f75..99f3c14f15c 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -116,8 +116,8 @@ class dolprintIPP { foreach ($jobs as $value) { - $var=!$var; - print ""; + + print ''; print ''.$value->job_id->_value0.''; print ''.$value->job_originating_user_name->_value0.''; print ''.$value->printer_uri->_value0.''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index acdf648362e..a2ce21a8971 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -641,7 +641,6 @@ class ExtraFields if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; $sql.= " ORDER BY pos"; - dol_syslog(get_class($this)."::fetch_name_optionals_label", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 939d8300661..b839e46dc8b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -951,36 +951,40 @@ class Form /** * Output html form to select a third party * - * @param string $selected Preselected type - * @param string $htmlname Name of field in form - * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)') - * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty') - * @param int $showtype Show third party type in combolist (customer, prospect or supplier) - * @param int $forcecombo Force to use combo box - * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) - * @param int $limit Maximum number of elements - * @param string $morecss Add more css styles to the SELECT component - * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container - * @return string HTML string with select box for thirdparty. + * @param string $selected Preselected type + * @param string $htmlname Name of field in form + * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)') + * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty') + * @param int $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int $forcecombo Force to use combo box + * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param int $limit Maximum number of elements + * @param string $morecss Add more css styles to the SELECT component + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @return string HTML string with select box for thirdparty. */ - function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='') + function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array()) { + global $conf,$user,$langs; + $out=''; - /* TODO Use ajax_autocompleter like for products (not finished) if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) { $placeholder=''; - if ($selected && empty($selected_input_value)) { - require_once DOL_DOCUMENT_ROOT.'/societe/ajaxcompanies.php'; - $societe = new Societe($this->db); - $societe->fetch($selected); - $selected_input_value=$societe->ref; + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $societetmp = new Societe($this->db); + $societetmp->fetch($selected); + $selected_input_value=$societetmp->name; + unset($societetmp); } - // mode=1 means customers products - $urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished; + // mode 1 + $urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter; print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; else if ($hidelabel > 1) { @@ -990,15 +994,15 @@ class Form print img_picto($langs->trans("Search"), 'search'); } } - print ''; + print 'global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; if ($hidelabel == 3) { print img_picto($langs->trans("Search"), 'search'); } } else - {*/ + { $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam); - //} + } return $out; } @@ -1024,7 +1028,8 @@ class Form { global $conf,$user,$langs; - $out=''; $num=0; + $out=''; + $num=0; $outarray=array(); // On recherche les societes @@ -1040,19 +1045,18 @@ class Form if ($filterkey && $filterkey != '') { $sql.=" AND ("; - if (! empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) // Can use index - { - $sql.="(s.name LIKE '".$this->db->escape($filterkey)."%')"; + $prefix=empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)?'%':''; // Can use index if COMPANY_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i=0; + if (count($scrit) > 1) $sql.="("; + foreach ($scrit as $crit) { + if ($i > 0) $sql.=" AND "; + $sql.="(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; + $i++; } - else - { - // For natural search - $scrit = explode(' ', $filterkey); - foreach ($scrit as $crit) { - $sql.=" AND (s.name LIKE '%".$this->db->escape($crit)."%')"; - } - } - if (! empty($conf->barcode->enabled)) + if (count($scrit) > 1) $sql.=")"; + if (! empty($conf->barcode->enabled)) { $sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'"; } @@ -1061,10 +1065,13 @@ class Form $sql.=$this->db->order("nom","ASC"); if ($limit > 0) $sql.=$this->db->plimit($limit); + // Build output string dol_syslog(get_class($this)."::select_thirdparty_list", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { + $events = null; + if ($conf->use_javascript_ajax && ! $forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; @@ -1085,7 +1092,7 @@ class Form } if ($showempty) $out.= ''."\n"; - $num = $this->db->num_rows($resql); + $num = $this->db->num_rows($resql); $i = 0; if ($num) { @@ -1128,7 +1135,7 @@ class Form $out.= ''; } - array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->rowid, 'label'=>$label)); + array_push($outarray, array('key'=>$obj->rowid, 'value'=>$label, 'label'=>$label)); $i++; if (($i % 10) == 0) $out.="\n"; @@ -3370,11 +3377,14 @@ class Form print ''; print ''; } else { + + $langs->load('banks'); + if ($selected) { require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; $bankstatic=new Account($this->db); $bankstatic->fetch($selected); - print $this->textwithpicto($bankstatic->label,$langs->trans("AccountCurrency").' '.$bankstatic->currency_code); + print $this->textwithpicto($bankstatic->getNomUrl(1),$langs->trans("AccountCurrency").' '.$bankstatic->currency_code); } else { print " "; } @@ -5576,19 +5586,19 @@ class Form $possiblelinks=array(); if (is_object($object->thirdparty) && ! empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $listofidcompanytoscan=$object->thirdparty->id; - if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent; - - $possiblelinks=array( - 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')'), - 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.')') - ); + $listofidcompanytoscan=$object->thirdparty->id; + if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent; + + $possiblelinks=array( + 'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'), + 'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande',1).')'), + 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture',1).')'), + 'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract',1).')'), + 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention',1).')'), + 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal',1).')'), + 'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur',1).')'), + 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn',1).')') + ); } global $action; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 6050679631f..b799e0e2359 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -207,8 +207,8 @@ class FormActions $ref=$action->getNomUrl(1,-1); $label=$action->getNomUrl(0,38); - $var=!$var; - print ''; + + print ''; print ''.$ref.''; print ''.$label.''; print ''.$action->type.''; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2af32bf9be6..8d90892cfb6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -869,7 +869,7 @@ class FormFile else $this->infofiles['extensions'][$ext]++; // Preview - if (! empty($conf->use_javascript_ajax) && ! empty($conf->browser->layout != 'phone')) + if (! empty($conf->use_javascript_ajax) && ($conf->browser->layout != 'phone')) { $tmparray = getAdvancedPreviewUrl($modulepart, $relativepath, 1); if ($tmparray && $tmparray['url']) $tmpout.= '
  • '.img_picto('','detail').' '.$langs->trans("Preview").' '.$ext.'
  • '; @@ -999,6 +999,7 @@ class FormFile print ''; print ''; } + print '
    '; print ''."\n"; print ''; @@ -1102,7 +1103,7 @@ class FormFile && $file['name'] != '..' && ! preg_match('/\.meta$/i',$file['name'])) { - $var=!$var; + if ($filearray[$key]['rowid'] > 0) $lastrowid = $filearray[$key]['rowid']; @@ -1182,7 +1183,7 @@ class FormFile if (in_array($modulepart, array('product','produit','service'))) $newmodulepart='produit|service'; $disablecrop=1; - if (in_array($modulepart, array('product','produit','service','holiday','project'))) $disablecrop=0; + if (in_array($modulepart, array('product','produit','service','expensereport','holiday','project','user'))) $disablecrop=0; if (! $disablecrop && image_format_supported($file['name']) > 0) { @@ -1256,7 +1257,7 @@ class FormFile print ''; } print "
    "; - + print '
    '; if (! $editline && $nboflines > 1) { if (! empty($conf->use_javascript_ajax) && $permtoeditline) { @@ -1446,9 +1447,9 @@ class FormFile if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files - $var=!$var; + print ''."\n"; - print ''; + print ''; print ''; if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document'); else print $langs->trans("ObjectDeleted",($id?$id:$ref)); diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 66d438d3ffe..30cedf57d51 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -39,7 +39,7 @@ class Translate public $cache_labels=array(); // Cache for labels return by getLabelFromKey method public $cache_currencies=array(); // Cache to store currency symbols - + private $cache_currencies_all_loaded=false; /** @@ -175,18 +175,20 @@ class Translate { global $conf,$db; - // Load $this->tab_translate[] from database - if (empty($loadfromfileonly) && count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database. - + //dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang); + // Check parameters if (empty($domain)) { - dol_print_error('',get_class($this)."::Load ErrorWrongParameters"); - return -1; + dol_print_error('',get_class($this)."::Load ErrorWrongParameters"); + return -1; } if ($this->defaultlang == 'none_NONE') return 0; // Special language code to not translate keys + + + // Load $this->tab_translate[] from database + if (empty($loadfromfileonly) && count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database. - //dol_syslog("Translate::Load Start domain=".$domain." alt=".$alt." forcelangdir=".$forcelangdir." this->defaultlang=".$this->defaultlang); $newdomain = $domain; $modulename = ''; @@ -275,12 +277,15 @@ class Translate * and split the rest until a line feed. * This is more efficient than fgets + explode + trim by a factor of ~2. */ - while ($line = fscanf($fp, "%[^= ]%*[ =]%[^\n]")) { - if (isset($line[1])) { + while ($line = fscanf($fp, "%[^= ]%*[ =]%[^\n]")) + { + if (isset($line[1])) + { list($key, $value) = $line; //if ($domain == 'orders') print "Domain=$domain, found a string for $tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."
    "; //if ($key == 'Order') print "Domain=$domain, found a string for key=$key=$tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."
    "; - if (empty($this->tab_translate[$key])) { // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) + if (empty($this->tab_translate[$key])) + { // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries) $value = preg_replace('/\\n/', "\n", $value); // Parse and render carriage returns if ($key == 'DIRECTION') { // This is to declare direction of language if ($alt < 2 || empty($this->tab_translate[$key])) { // We load direction only for primary files or if not yet loaded @@ -391,8 +396,6 @@ class Translate $domain='database'; - if ($this->defaultlang == 'none_NONE') return 0; // Special language code to not translate keys - // Check parameters if (empty($db)) return 0; // Database handler can't be used @@ -450,7 +453,7 @@ class Translate $this->tab_translate+=$tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a valuer already exists into tab_translate, value into tmparaay is not added. //print $newdomain."\n"; //var_dump($this->tab_translate); - if ($alt == 2) $fileread=1; + $fileread=1; $found=true; // Found in dolibarr PHP cache } } @@ -509,16 +512,9 @@ class Translate } } - if ($alt == 2) - { - if ($fileread) $this->_tab_loaded[$newdomain]=1; // Set domain file as loaded + if ($fileread) $this->_tab_loaded[$newdomain]=1; // Set domain file as loaded - if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain]=2; // Marque ce cas comme non trouve (no lines found for language) - } - - // Check to be sure that SeparatorDecimal differs from SeparatorThousand - if (! empty($this->tab_translate["SeparatorDecimal"]) && ! empty($this->tab_translate["SeparatorThousand"]) - && $this->tab_translate["SeparatorDecimal"] == $this->tab_translate["SeparatorThousand"]) $this->tab_translate["SeparatorThousand"]=''; + if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain]=2; // Marque ce cas comme non trouve (no lines found for language) return 1; } @@ -965,7 +961,8 @@ class Translate { global $db; - if (! empty($currency_code) && isset($this->cache_currencies[$currency_code])) return 0; // Value already into cache + if ($this->cache_currencies_all_loaded) return 0; // Cache already loaded for all + if (! empty($currency_code) && isset($this->cache_currencies[$currency_code])) return 0; // Cache already loaded for the currency $sql = "SELECT code_iso, label, unicode"; $sql.= " FROM ".MAIN_DB_PREFIX."c_currencies"; @@ -979,7 +976,7 @@ class Translate { $this->load("dict"); $label=array(); - foreach($this->cache_currencies as $key => $val) $label[$key]=$val['label']; + if (! empty($currency_code)) foreach($this->cache_currencies as $key => $val) $label[$key]=$val['label']; // Label in already loaded cache $num = $db->num_rows($resql); $i = 0; @@ -993,7 +990,10 @@ class Translate $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label']; $i++; } + if (empty($currency_code)) $this->cache_currencies_all_loaded=true; //print count($label).' '.count($this->cache_currencies); + + // Resort cache array_multisort($label, SORT_ASC, $this->cache_currencies); //var_dump($this->cache_currencies); $this->cache_currencies is now sorted onto label return $num; diff --git a/htdocs/core/js/lib_photosresize.js b/htdocs/core/js/lib_photosresize.js index 3463b82931f..9c4c6671b1e 100644 --- a/htdocs/core/js/lib_photosresize.js +++ b/htdocs/core/js/lib_photosresize.js @@ -33,6 +33,7 @@ function updateCoords(c) //alert(parseInt(jQuery("#ratioforcrop").val())); ratio=1; if (parseInt(jQuery("#ratioforcrop").val()) > 0) ratio = parseInt(jQuery("#ratioforcrop").val()); + //console.log(ratio); jQuery('#x').val(Math.ceil(c.x * ratio)); jQuery('#y').val(Math.ceil(c.y * ratio)); jQuery('#x2').val(Math.ceil(c.x2 * ratio)); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 63b06dbd737..2a734b5f161 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1212,7 +1212,7 @@ function form_constantes($tableau,$strictw3c=0) if ($result) { $obj = $db->fetch_object($result); // Take first result of select - $var=!$var; + // For avoid warning in strict mode if (empty($obj)) { @@ -1221,7 +1221,7 @@ function form_constantes($tableau,$strictw3c=0) if (empty($strictw3c)) print "\n".'
    '; - print ""; + print ''; // Show constant print ''; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 408e671dfef..1f83690b096 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -118,7 +118,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print $langs->trans("ThirdParty").'   '; print ''; - print $form->select_company($socid, 'socid', '', 1); + print $form->select_company($socid, 'socid', '', 'SelectThirdParty', 0, 0, null, 0); print ''; } @@ -251,9 +251,9 @@ function show_array_actions_to_do($max=5) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ''; + print ''; $staticaction->type_code=$obj->code; $staticaction->label=($obj->label?$obj->label:$obj->type_label); @@ -347,9 +347,9 @@ function show_array_last_actions_done($max=5) while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; + - print ''; + print ''; $staticaction->type_code=$obj->code; $staticaction->libelle=$obj->label; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 8ee372d1178..809a045bacf 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -576,7 +576,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin if ($user->rights->projet->lire && $userAccess > 0) { $var = !$var; - print ""; + print ''; // Ref print ''.img_object($langs->trans("ShowProject"),($obj->public?'projectpub':'project'))." ".$obj->ref.''; @@ -612,7 +612,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin else { $var = false; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } $db->free($result); } @@ -893,7 +893,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') { $var = !$var; - print ""; + print ''; print ''; $addressstatic->id = $address->id; @@ -929,7 +929,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') } else { - //print ""; + //print ''; //print ''.$langs->trans("NoAddressYetDefined").''; //print "\n"; } @@ -1245,7 +1245,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= foreach ($histo as $key=>$value) { - $var=!$var; + $actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo $out.=""; @@ -1454,7 +1454,7 @@ function show_subsidiaries($conf,$langs,$db,$object) $obj = $db->fetch_object($result); $var = !$var; - print ""; + print ''; print ''; $socstatic->id = $obj->rowid; diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index 5ba8570ab57..1981ae63d09 100644 --- a/htdocs/core/lib/doleditor.lib.php +++ b/htdocs/core/lib/doleditor.lib.php @@ -71,7 +71,7 @@ function show_skin($fuser,$edit=0) print '';*/ print ''; - print ''; + print ''; print ''.$langs->trans("ThemeDir").''; print ''; foreach($dirskins as $dirskin) @@ -81,8 +81,8 @@ function show_skin($fuser,$edit=0) print ''; print ''; - //$var=!$var; - print ''; + // + print ''; print ''; print '"; + + print ''; print '"; + print ''; // Sending id print ''; print ''; print '"; $html.= ''; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index ec0ed850df2..5dca2b8378e 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -561,8 +561,6 @@ class pdf_standard extends ModelePDFProduct $this->error=$langs->trans("ErrorConstantNotDefined","PRODUCT_OUTPUTDIR"); return 0; } - - return -1; } diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index cc47c9570a6..11ee8a32d7d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -199,7 +199,7 @@ class pdf_paiement while ($i < $num) { $objp = $this->db->fetch_object($result); - $var=!$var; + $lines[$i][0] = $objp->facnumber; $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true); diff --git a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php index 1d9f2333300..f20e912e1ed 100644 --- a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php @@ -197,7 +197,7 @@ class pdf_paiement_fourn while ($i < $num) { $objp = $this->db->fetch_object($result); - $var=!$var; + $lines[$i][0] = $objp->ref; $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true); diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index 1e8d2b3a91c..91af81ef178 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -103,8 +103,10 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface */ private function getFilename($suffixinfilename='') { - $tmp=str_replace('DOL_DATA_ROOT', DOL_DATA_ROOT, SYSLOG_FILE); - return $suffixinfilename?preg_replace('/\.log$/i', $suffixinfilename.'.log', $tmp):$tmp; + global $conf; + if (! empty($conf->global->SYSLOG_FILE)) $tmp=str_replace('DOL_DATA_ROOT', DOL_DATA_ROOT, $conf->global->SYSLOG_FILE); + else $tmp='dolibarr.log'; + return $suffixinfilename?preg_replace('/\.log$/i', $suffixinfilename.'.log', $tmp):$tmp; } /** @@ -122,12 +124,12 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface $logfile = $this->getFilename($suffixinfilename); - if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+'); + if (! empty($conf->global->SYSLOG_FILE_NO_ERROR)) $filefd = @fopen($logfile, 'a+'); else $filefd = fopen($logfile, 'a+'); if (! $filefd) { - if (! defined("SYSLOG_FILE_NO_ERROR")) + if (empty($conf->global->SYSLOG_FILE_NO_ERROR)) { // Do not break dolibarr usage if log fails //throw new Exception('Failed to open log file '.basename($logfile)); diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 0f0848f3afd..c2885f1c89a 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -111,13 +111,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface if (! empty($conf->global->MAIN_SYSLOG_DISABLE_SYSLOG)) return; // Global option to disable output of this handler - if (defined("SYSLOG_FACILITY") && constant("SYSLOG_FACILITY")) + if (! empty($conf->global->SYSLOG_FACILITY)) { - if (constant(constant('SYSLOG_FACILITY'))) - { - $facility = constant(constant("SYSLOG_FACILITY")); - } - else $facility = LOG_USER; + $facility = constant($conf->global->SYSLOG_FACILITY); } else $facility = LOG_USER; diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 8fcd0d2b930..5b29d25202e 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -59,6 +59,18 @@ elseif ($modulepart == 'holiday') if (! $user->rights->holiday->read) accessforbidden(); $accessallowed=1; } +elseif ($modulepart == 'expensereport') +{ + $result=restrictedArea($user,'expensereport',$id,'expensereport'); + if (! $user->rights->expensereport->lire) accessforbidden(); + $accessallowed=1; +} +elseif ($modulepart == 'user') +{ + $result=restrictedArea($user,'user',$id,'user'); + if (! $user->rights->user->user->lire) accessforbidden(); + $accessallowed=1; +} // Security: // Limit access if permissions are wrong @@ -103,12 +115,36 @@ elseif ($modulepart == 'holiday') $dir=$conf->holiday->dir_output; // By default } } +elseif ($modulepart == 'user') +{ + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $object = new User($db); + if ($id > 0) + { + $result = $object->fetch($id); + if ($result <= 0) dol_print_error($db,'Failed to load object'); + $dir=$conf->user->dir_output; // By default + } +} +elseif ($modulepart == 'expensereport') +{ + require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; + $object = new ExpenseReport($db); + if ($id > 0) + { + $result = $object->fetch($id); + if ($result <= 0) dol_print_error($db,'Failed to load object'); + $dir=$conf->expensereport->dir_output; // By default + } +} if (empty($backtourl)) { if (in_array($modulepart, array('product','produit','service','produit|service'))) $backtourl=DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($_POST["file"]); + else if (in_array($modulepart, array('expensereport'))) $backtourl=DOL_URL_ROOT."/expensereport/document.php?id=".$id.'&file='.urldecode($_POST["file"]); else if (in_array($modulepart, array('holiday'))) $backtourl=DOL_URL_ROOT."/holiday/document.php?id=".$id.'&file='.urldecode($_POST["file"]); else if (in_array($modulepart, array('project'))) $backtourl=DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]); + else if (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]); } @@ -185,7 +221,7 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS } else { - dol_print_error('', 'Cancel on photo_resize with a not supported value of modulepart='.$modulepart); + dol_print_error('', 'confirm_resize on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } @@ -253,7 +289,7 @@ if ($action == 'confirm_crop') } else { - dol_print_error('', 'Cancel on photo_resize with a not supported value of modulepart='.$modulepart); + dol_print_error('', 'confirm_crop on photo_resize without backtourl defined for modulepart='.$modulepart); exit; } } @@ -294,8 +330,8 @@ print ''; print ''.$langs->trans("Resize").''; print $langs->trans("ResizeDesc").'
    '; -print $langs->trans("NewLength").': px   '.$langs->trans("or").'   '; -print $langs->trans("NewHeight").': px  
    '; +print $langs->trans("NewLength").': px   '.$langs->trans("or").'   '; +print $langs->trans("NewHeight").': px  
    '; print ''; print ''; @@ -323,11 +359,12 @@ if (! empty($conf->use_javascript_ajax)) $height=$infoarray['height']; $width=$infoarray['width']; $widthforcrop=$width; $refsizeforcrop='orig'; $ratioforcrop=1; + // If image is too large, we use another scale. if (! empty($_SESSION['dol_screenwidth']) && ($widthforcrop > round($_SESSION['dol_screenwidth']/2))) { - $widthforcrop=min(round($_SESSION['dol_screenwidth']/2),$widthforcrop); + $widthforcrop=round($_SESSION['dol_screenwidth']/2); $refsizeforcrop='screenwidth'; - $ratioforcrop=2; + $ratioforcrop=1; } print ''."\n"; @@ -342,12 +379,12 @@ if (! empty($conf->use_javascript_ajax)) print '
    '.$langs->trans("NewSizeAfterCropping").': - - - - - - + + + + + +
    @@ -370,6 +407,7 @@ if (! empty($conf->use_javascript_ajax)) print '
    '; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 41cec2f06a3..6d90a1afed3 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1975,7 +1975,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } $original_file=$conf->expedition->dir_output."/sending/".$original_file; } - // Wrapping pour les bons de livraison else if ($modulepart == 'livraison' && !empty($conf->expedition->dir_output)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4cec1ce7de2..d430a8ea53b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -129,7 +129,7 @@ function getEntity($element=false, $shared=0) else { $out=''; - $addzero = array('user', 'usergroup'); + $addzero = array('user', 'usergroup', 'email_template', 'default_values'); if (in_array($element, $addzero)) $out.= '0,'; $out.= $conf->entity; return $out; @@ -862,7 +862,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD); $displaytab=0; $nbintab=0; - $popuptab=0; + $popuptab=0; $outmore=''; for ($i = 0 ; $i <= $maxkey ; $i++) { if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) @@ -1012,6 +1012,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { global $conf, $form, $user, $langs; + $error = 0; + $maxvisiblephotos=1; $showimage=1; $showbarcode=empty($conf->barcode->enabled)?0:($object->barcode?1:0); @@ -1023,11 +1025,15 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'member') $modulepart='memberphoto'; if ($object->element == 'user') $modulepart='userphoto'; if ($object->element == 'product') $modulepart='product'; - if ($object->element == 'propal') $modulepart='propal'; - if ($object->element == 'commande') $modulepart='commande'; - if ($object->element == 'facture') $modulepart='facture'; - if ($object->element == 'fichinter') $modulepart='ficheinter'; - + if (class_exists("Imagick")) + { + if ($object->element == 'propal') $modulepart='propal'; + if ($object->element == 'commande') $modulepart='commande'; + if ($object->element == 'facture') $modulepart='facture'; + if ($object->element == 'fichinter') $modulepart='ficheinter'; + if ($object->element == 'contrat') $modulepart='contract'; + } + if ($object->element == 'product') { $width=80; $cssclass='photoref'; @@ -1043,18 +1049,20 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } elseif ($conf->browser->layout != 'phone') { // Show no photo link $nophoto='/public/theme/common/nophoto.png'; - $morehtmlleft.='
    No photo
    '; + $morehtmlleft.='
    No photo
    '; } } } else { - if ($showimage) + if ($showimage) { - if ($modulepart != 'unknown') + if ($modulepart != 'unknown') { + $phototoshow=''; + // Check if a preview file is available - if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter')) && class_exists("Imagick")) + if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract')) && class_exists("Imagick")) { $objectref = dol_sanitizeFileName($object->ref); $dir_output = $conf->$modulepart->dir_output . "/"; @@ -1079,7 +1087,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $ret = dol_convert_file($file, 'png', $fileimage); if ($ret < 0) $error++; } - + // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { @@ -1115,9 +1123,10 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $morehtmlleft.='
    '; if ($object->element == 'action') { + $width=80; $cssclass='photorefcenter'; $nophoto=img_picto('', 'title_agenda', '', false, 1); - $morehtmlleft.='
    No photo
    '; + $morehtmlleft.='
    No photo
    '; } else { @@ -1125,7 +1134,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $picto = $object->picto; if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub $nophoto=img_picto('', 'object_'.$picto, '', false, 1); - $morehtmlleft.='
    No photo
    '; + $morehtmlleft.='
    No photo
    '; } $morehtmlleft.='
    '; } @@ -1157,24 +1166,12 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $morehtmlstatus.=$object->getLibStatut(5,1); } } - elseif ($object->element == 'facture' || $object->element == 'invoice' || $object->element == 'invoice_supplier') + elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan'))) { $tmptxt=$object->getLibStatut(6, $object->totalpaye); if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); $morehtmlstatus.=$tmptxt; } - elseif ($object->element == 'chargesociales') - { - $tmptxt=$object->getLibStatut(6, $object->totalpaye); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); - $morehtmlstatus.=$tmptxt; - } - elseif ($object->element == 'loan') - { - $tmptxt=$object->getLibStatut(6, $object->totalpaye); - if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye); - $morehtmlstatus.=$tmptxt; - } elseif ($object->element == 'contrat' || $object->element == 'contract') { if ($object->statut==0) $morehtmlstatus.=$object->getLibStatut(2); @@ -1639,6 +1636,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) */ function dol_now($mode='gmt') { + $ret=''; // Note that gmmktime and mktime return same value (GMT) when used without parameters //if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead if ($mode == 'gmt') $ret=time(); // Time for now at greenwich. @@ -2446,7 +2444,6 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if (preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB $title=$tmparray[0]; $alt=empty($tmparray[1])?'':$tmparray[1]; - if ($picto == 'refresh') var_dump($moreatt); return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } @@ -3876,7 +3873,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'"; $sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'"; // If we have the code, we use it in priority - else $sql.= " AND t.recuperableonly ='".$npr."'"; + else $sql.= " AND t.recuperableonly ='".$vatnpr."'"; dol_syslog("get_localtax", LOG_DEBUG); $resql=$db->query($sql); @@ -3995,6 +3992,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local); $vatratecleaned = $vatrate; + $vatratecode = ''; if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)" { $vatratecleaned = $reg[1]; @@ -4393,7 +4391,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id function yn($yesno, $case=1, $color=0) { global $langs; - $result='unknown'; + $result='unknown'; $classname=''; if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') // A mettre avant test sur no a cause du == 0 { $result=$langs->trans('yes'); @@ -4871,45 +4869,77 @@ function dol_concatdesc($text1,$text2,$forxml=false) /** * Make substition into a string replacing key with vals from $substitutionarray (oldval=>newval) * - * @param string $chaine Source string in which we must do substitution - * @param array $substitutionarray Array with key->val to substitute - * @return string Output string after subsitutions + * @param string $text Source string in which we must do substitution + * @param array $substitutionarray Array with key->val to substitute + * @param Translate $outputlangs Output language + * @return string Output string after substitutions * @see complete_substitutions_array */ -function make_substitutions($chaine,$substitutionarray) +function make_substitutions($text, $substitutionarray, $outputlangs=null) { - global $conf; + global $conf, $langs; if (! is_array($substitutionarray)) return 'ErrorBadParameterSubstitutionArrayWhenCalling_make_substitutions'; - - // Make substitition + + if (empty($outputlangs)) $outputlangs=$langs; + + // Make substitution for language keys + if (is_object($outputlangs)) + { + while (preg_match('/__\((.*)\)__/', $text, $reg)) + { + $msgishtml = 0; + if (dol_textishtml($text,1)) $msgishtml = 1; + $text = preg_replace('/__\('.preg_quote($reg[1]).'\)__/', $msgishtml?dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])):$outputlangs->transnoentitiesnoconv($reg[1]), $text); + } + } + + // Make substitition for array $substitutionarray foreach ($substitutionarray as $key => $value) { if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; - $chaine=str_replace("$key","$value",$chaine); // We must keep the " to work when value is 123.5 for example + $text=str_replace("$key","$value",$text); // We must keep the " to work when value is 123.5 for example } - return $chaine; + return $text; } /** * Complete the $substitutionarray with more entries * * @param array $substitutionarray Array substitution old value => new value value - * @param Translate $outputlangs If we want substitution from special constants, we provide a language - * @param object $object If we want substitution from special constants, we provide data in a source object - * @param Mixed $parameters Add more parameters (useful to pass product lines) + * @param Translate $outputlangs Output language + * @param Object $object Source object + * @param mixed $parameters Add more parameters (useful to pass product lines) * @param string $callfunc What is the name of the custom function that will be called? (default: completesubstitutionarray) * @return void * @see make_substitutions */ -function complete_substitutions_array(&$substitutionarray,$outputlangs,$object='',$parameters=null,$callfunc="completesubstitutionarray") +function complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray") { global $conf,$user; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - // Check if there is external substitution to do asked by plugins + // Add a substitution key for each object property + if (is_object($object)) + { + // TODO + } + + // Add a substitution key for each extrafields, using key __EXTRA_XXX__ + if (is_object($object) && is_array($object->array_options)) + { + foreach($object->array_options as $key => $val) + { + $keyshort=preg_replace('/^(options|extra)_/','',$key); + $substitutionarray['__EXTRA_'.$keyshort.'__']=$val; + // For backward compatibiliy + $substitutionarray['%EXTRA_'.$keyshort.'%']=$val; + } + } + + // Check if there is external substitution to do, requested by plugins $dirsubstitutions=array_merge(array(),(array) $conf->modules_parts['substitutions']); foreach($dirsubstitutions as $reldir) @@ -5114,7 +5144,7 @@ function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb { global $conf, $langs; - $ret=''; + $ret=0; $return=''; $out=''; $divstart=$divend=''; @@ -5284,7 +5314,8 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensiti $sizearray=count($array); if (is_array($array) && $sizearray>0) { - foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index]; + $temp = array(); + foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index]; if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp); else @@ -5744,6 +5775,7 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=') { if ($a = explode($delimiter, $string)) { + $ka = array(); foreach ($a as $s) { // each part if ($s) { if ($pos = strpos($s, $kv)) { // key/value delimiter diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 3314aa94631..f4319b7d11a 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -96,7 +96,8 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false) $max_length = $levels * 3; $num = substr('00' . $num, -$max_length); $num_levels = str_split($num, 3); - for ($i = 0; $i < count($num_levels); $i++) { + $nboflevels = count($num_levels); + for ($i = 0; $i < $nboflevels; $i++) { $levels--; $hundreds = (int) ($num_levels[$i] / 100); $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' '.$langs->transnoentities('hundred') . ( $hundreds == 1 ? '' : 's' ) . ' ': ''); diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index d5a362663b7..d4ef7a2ed7a 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -147,7 +147,7 @@ function show_ldap_content($result,$level,$count,$var,$hide=0,$subcount=0) $hide=0; if (! is_numeric($key)) { - $var=!$var; + print '
    '; print $key; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 6855cef5f1a..282bdec690e 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -586,6 +586,29 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height) } } + +/** + * Return array of possible substitutions + * + * @param Translate $outputlangs Output language + * @return array Array of substitutions + */ +function pdf_getSubstitutionArray($outputlangs) +{ + global $conf, $mysoc, $user; + $substitutionarray=array( + '__MYCOMPANY_NAME__' => $mysoc->name, + '__MYCOMPANY_EMAIL__' => $mysoc->email, + '__USER_ID__' => $user->id, + '__USER_LOGIN__' => $user->login, + '__USER_LASTNAME__' => $user->lastname, + '__USER_FIRSTNAME__' => $user->firstname, + '__USER_FULLNAME__' => $user->getFullName($outputlangs) + ); + return $substitutionarray; +} + + /** * Add a draft watermark on PDF files * @@ -599,12 +622,20 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height) */ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) { + global $langs, $mysoc, $user; + // Print Draft Watermark if ($unit=='pt') $k=1; elseif ($unit=='mm') $k=72/25.4; elseif ($unit=='cm') $k=72/2.54; elseif ($unit=='in') $k=72; + // Make substitution + $substitutionarray=pdf_getSubstitutionArray($outputlangs); + complete_substitutions_array($substitutionarray,$outputlangs,$object); + $text=make_substitutions($text,$substitutionarray,$outputlangs); + $text=$outputlangs->convToOutputCharset($text); + $savx=$pdf->getX(); $savy=$pdf->getY(); $watermark_angle=atan($h/$w)/2; @@ -819,7 +850,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default */ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0,$hidefreetext=0) { - global $conf,$user; + global $conf,$user,$mysoc; $outputlangs->load("dict"); $line=''; @@ -829,16 +860,15 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // Line of free text if (empty($hidefreetext) && ! empty($conf->global->$paramfreetext)) { - // Make substitution - $substitutionarray=array( - '__FROM_NAME__' => $fromcompany->name, - '__FROM_EMAIL__' => $fromcompany->email, - '__TOTAL_TTC__' => $object->total_ttc, - '__TOTAL_HT__' => $object->total_ht, - '__TOTAL_VAT__' => $object->total_vat - ); + $substitutionarray=pdf_getSubstitutionArray($outputlangs); + // More substitution keys + $substitutionarray['__FROM_NAME__']=$fromcompany->name; + $substitutionarray['__FROM_EMAIL__']=$fromcompany->email; + $substitutionarray['__TOTAL_TTC__']=$object->total_ttc; + $substitutionarray['__TOTAL_HT__']=$object->total_ht; + $substitutionarray['__TOTAL_VAT__']=$object->total_vat; complete_substitutions_array($substitutionarray,$outputlangs,$object); - $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray); + $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray,$outputlangs); $line.=$outputlangs->convToOutputCharset($newfreetext); } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 29cdad35bc3..96bcbaa00c4 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1149,8 +1149,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $projectstatic->datee = $db->jdate($objp->datee); $projectstatic->dateo = $db->jdate($objp->dateo); - $var=!$var; - print "
    '; print $projectstatic->getNomUrl(1); if (! in_array('projectlabel', $hiddenfields)) print '
    '.dol_trunc($objp->title,24); diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 488a74b76a3..3455979afbe 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -233,9 +233,9 @@ function show_list_sending_receive($origin,$origin_id,$filter='') $var=True; while ($i < $num) { - $var=!$var; + $objp = $db->fetch_object($resql); - print "
    '; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index c5f14090a92..4350edc3797 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -499,7 +499,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { $default='5a6482'; if ($conf->theme == 'md') $default='5a3278'; - $var=!$var; + print '
    '.$langs->trans("TopMenuBackgroundColor").''; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index bd48e33a11d..e4ad7b7db36 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -186,8 +186,6 @@ class pdf_standard extends ModeleExpenseReport } } - if (isset($object->lignes) && ! isset($object->lines)) $object->lines=$object->lignes; - if (file_exists($dir)) { // Add pdfgeneration hook diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9ee00df696e..693dd2e412f 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1499,7 +1499,7 @@ class pdf_crabe extends ModelePDFFactures pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); // Show Draft Watermark - if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) + if($object->statut==Facture::STATUS_DRAFT && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK); } @@ -1553,7 +1553,13 @@ class pdf_crabe extends ModelePDFFactures $posy+=5; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell($w, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); + $textref=$outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref); + if ($object->statut == Facture::STATUS_DRAFT) + { + $pdf->SetTextColor(128,0,0); + $textref.=' - '.$outputlangs->trans("NotValidated"); + } + $pdf->MultiCell($w, 4, $textref, '', 'R'); $posy+=1; $pdf->SetFont('','', $default_font_size - 2); diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php new file mode 100644 index 00000000000..490caeccea2 --- /dev/null +++ b/htdocs/core/modules/modCollab.class.php @@ -0,0 +1,126 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup collab Module collab + * \brief Collab module descriptor. + * \file htdocs/core/modules/modCollab.class.php + * \ingroup collab + * \brief Description and activation file for module Collab + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + + +/** + * Class to describe Websites module + */ +class modCollab extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $langs,$conf; + + $this->db = $db; + $this->numero = 30000; + + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page + $this->family = "portal"; + $this->module_position = 50; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->description = "Enable the public collaboration features, like shared pad, shared online sheets, etc..."; + $this->version = 'development'; // 'experimental' or 'dolibarr' or version + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->special = 0; + // Name of image file used for this module. + $this->picto='globe'; + + // Data directories to create when module is enabled + $this->dirs = array("/collab/temp"); + + // Config pages + //------------- + $this->config_page_url = array('collab.php'); + + // Dependancies + //------------- + $this->hidden = ! empty($conf->global->MODULE_COLLAB_DISABLED); // A condition to disable module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with + $this->langfiles = array("collab"); + + // Constants + //----------- + $this->const = array(); + + // New pages on tabs + // ----------------- + $this->tabs = array(); + + // Boxes + //------ + $this->boxes = array(); + + // Permissions + $this->rights = array(); // Permission array used by this module + $this->rights_class = 'websites'; + $r=0; + + /*$this->rights[$r][0] = 30001; + $this->rights[$r][1] = 'Read website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'read'; + $r++; + + $this->rights[$r][0] = 30002; + $this->rights[$r][1] = 'Create/modify website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'write'; + $r++; + + $this->rights[$r][0] = 30003; + $this->rights[$r][1] = 'Delete website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'delete'; + $r++;*/ + + // Main menu entries + $r=0; + $this->menu[$r]=array( 'fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'top', // This is a Left menu entry + 'titre'=>'Collab', + 'mainmenu'=>'collab', + 'url'=>'/collab/index.php', + 'langs'=>'collab', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>100, + 'enabled'=>'$conf->collab->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $r++; + } +} diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 810bc7f3364..f9c10eef6de 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -98,6 +98,13 @@ class modCommande extends DolibarrModules $this->const[$r][3] = ""; $this->const[$r][4] = 0; + /*$r++; + $this->const[$r][0] = "COMMANDE_DRAFT_WATERMARK"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "__(Draft)__"; + $this->const[$r][3] = 'Watermark to show on draft orders'; + $this->const[$r][4] = 0;*/ + // Boxes $this->boxes = array( 0=>array('file'=>'box_commandes.php','enabledbydefaulton'=>'Home'), diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 8022b21279f..148dd965abb 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -100,6 +100,13 @@ class modFacture extends DolibarrModules $this->const[$r][4] = 0; $r++; + /*$this->const[$r][0] = "FACTURE_DRAFT_WATERMARK"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "__(Draft)__"; + $this->const[$r][3] = 'Watermark to show on draft invoices'; + $this->const[$r][4] = 0; + $r++;*/ + // Boxes //$this->boxes = array(0=>array(1=>'box_factures_imp.php'),1=>array(1=>'box_factures.php')); diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index fe520e00925..ce23e996e0a 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -100,7 +100,14 @@ class modPropale extends DolibarrModules $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/proposals"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; - + $r++; + + /*$this->const[$r][0] = "PROPALE_DRAFT_WATERMARK"; + $this->const[$r][2] = "__(Draft)__"; + $this->const[$r][3] = 'Watermark to show on draft proposals'; + $this->const[$r][4] = 0; + $r++;*/ + // Boxes $this->boxes = array( 0=>array('file'=>'box_graph_propales_permonth.php','enabledbydefaulton'=>'Home'), diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index f4e9b0d7356..55d4d45d28e 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -68,7 +68,7 @@ class modUser extends DolibarrModules // Dependancies $this->depends = array(); $this->requiredby = array(); - $this->langfiles = array("main","users","companies","members"); + $this->langfiles = array("main","users","companies","members",'salaries'); // Constants $this->const = array(); @@ -230,6 +230,43 @@ class modUser extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u'; $this->export_sql_end[$r] .=' WHERE u.entity IN ('.getEntity('user',1).')'; + + // Imports + //-------- + $r=0; + + // Import list of users attributes + $r++; + $this->import_code[$r]=$this->rights_class.'_'.$r; + $this->import_label[$r]='ImportDataset_user_1'; + $this->import_icon[$r]='user'; + $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r]=array('u'=>MAIN_DB_PREFIX.'user','extra'=>MAIN_DB_PREFIX.'user_extrafields'); // List of tables to insert into (insert done in same order) + $this->import_fields_array[$r]=array('u.lastname'=>"Name*",'u.firstname'=>"Firstname",'u.employee'=>"Employee*",'u.job'=>"Job",'u.gender'=>"Gender",'u.login'=>"Login*",'u.pass_crypted'=>"Password",'u.admin'=>"Administrator",'u.fk_soc'=>"Company*",'u.address'=>"Address",'u.zip'=>"Zip",'u.town'=>"Town",'u.fk_state'=>"StateId",'u.fk_country'=>"CountryCode",'u.office_phone'=>"Phone",'u.user_mobile'=>"Mobile",'u.office_fax'=>"Fax",'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature','u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey','u.datec'=>"DateCreation"); + // Add extra fields + $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity = ".$conf->entity; + $resql=$this->db->query($sql); + if ($resql) // This can fail when class is used on old database (during migration for example) + { + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $this->import_fields_array[$r][$fieldname]=$fieldlabel.($obj->fieldrequired?'*':''); + } + } + // End add extra fields + $this->import_fieldshidden_array[$r]=array('u.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'user'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) + $this->import_convertvalue_array[$r]=array( + 'u.fk_state'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cstate.class.php','class'=>'Cstate','method'=>'fetch','dict'=>'DictionaryState'), + 'u.fk_country'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), + 'u.salary'=>array('rule'=>'numeric') + ); + //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); + $this->import_regex_array[$r]=array('u.employee'=>'^[0|1]','u.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$'); + $this->import_examplevalues_array[$r]=array('u.lastname'=>"Doe",'u.firstname'=>'John','u.login'=>'jdoe','u.employee'=>'0 or 1','u.status'=>"0 (closed) or 1 (active)",'u.fk_soc'=>'0 (internal user) or company name (external user)','u.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'u.address'=>"61 jump street",'u.zip'=>"123456",'u.town'=>"Big town",'u.fk_country'=>'US, FR, DE...','u.office_phone'=>"0101010101",'u.office_fax'=>"0101010102",'u.email'=>"test@mycompany.com",'u.salary'=>"10000",'u.note'=>"This is an example of note for record",'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00"); + $this->import_updatekeys_array[$r]=array('u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>'Login'); + } diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index eaf655d7edf..5c5ea2a8ecd 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -163,7 +163,7 @@ class printing_printipp extends PrintingDriver $var = true; foreach ($list as $value) { - $var=!$var; + $printer_det = $this->get_printer_detail($value); $html.= "
    '.$value.'