diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 0ec4fb07a12..116e071e42f 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -369,8 +369,7 @@ if ($action == 'create') { print "\n"; foreach ($book->linesmvt as $line) { - $var = ! $var; - print ''; + print ''; $total_debit += $line->debit; $total_credit += $line->credit; @@ -420,8 +419,7 @@ if ($action == 'create') { } if ($action == "" || $action == 'add') { - $var = ! $var; - print ''; + print ''; print ''; print $formventilation->select_account($account_number, 'account_number', 0, array (), 1, 1, ''); print ''; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 61753d1c39d..cbb83ba269e 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -265,7 +265,6 @@ $sous_total_credit = 0; $displayed_account_number = null; // Start with undefined to be able to distinguish with empty foreach ( $object->lines as $line ) { - $var = ! $var; $total_debit += $line->debit; $total_credit += $line->credit; @@ -298,7 +297,7 @@ foreach ( $object->lines as $line ) { $sous_total_credit = 0; } - print ''; + print ''; print ' '; print ''.$line->piece_num.''; print '' . dol_print_date($line->doc_date, 'day') . ''; diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php index f716339bdc8..263f293043a 100644 --- a/htdocs/accountancy/bookkeeping/listbyyear.php +++ b/htdocs/accountancy/bookkeeping/listbyyear.php @@ -267,9 +267,8 @@ print "\n"; $var = True; foreach ( $object->lines as $line ) { - $var = ! $var; - print ''; + print ''; print '' . $line->piece_num . '' . "\n"; print '' . $line->doc_type . '' . "\n"; print '' . dol_print_date($line->doc_date) . ''; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index dddc7c896c0..82a406d4a0b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -244,8 +244,7 @@ if ($resql) { while ( $row = $db->fetch_row($resql)) { - $var = ! $var; - print '' . length_accountg($row[0]) . ''; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; for($i = 2; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; @@ -301,8 +300,7 @@ if ($resql) { while ( $row = $db->fetch_row($resql)) { - $var = ! $var; - print '' . length_accountg($row[0]) . ''; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; for($i = 2; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index e8e10b4a0be..845e0a62540 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -313,7 +313,6 @@ if ($result) { $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); - $var = ! $var; $objp->code_sell_l = ''; $objp->code_sell_p = ''; @@ -354,7 +353,7 @@ if ($result) { // $objp->code_sell_p is now code of product/service // $objp->code_sell_l is now default code of product/service - print ''; + print ''; // Line id print '' . $objp->rowid . ''; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index b4d7c0bbb7a..4bfeb630b02 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -217,8 +217,7 @@ if ($resql) { while ( $row = $db->fetch_row($resql)) { - $var = ! $var; - print '' . length_accountg($row[0]) . ''; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; for($i = 2; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; @@ -271,8 +270,7 @@ if ($resql) { while ( $row = $db->fetch_row($resql)) { - $var = ! $var; - print '' . length_accountg($row[0]) . ''; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; for($i = 2; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 20994d76a93..4205a497c1a 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -268,13 +268,12 @@ if ($result) { $var = True; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); - $var = ! $var; $codeCompta = length_accountg($objp->account_number) . ' - ' . $objp->label; $expensereport_static->ref = $objp->ref; $expensereport_static->id = $objp->erid; - print ''; + print ''; print '' . $objp->rowid . ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 49a63a15698..114fd2c99ea 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -299,7 +299,6 @@ if ($result) { $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); - $var = ! $var; $objp->aarowid_suggest = ''; $objp->aarowid_suggest = $objp->aarowid; @@ -307,7 +306,7 @@ if ($result) { $expensereport_static->ref = $objp->ref; $expensereport_static->id = $objp->erid; - print ''; + print ''; // Line id print '' . $objp->rowid . ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index dc18a3417e8..b9567cd50a7 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -749,7 +749,6 @@ if (empty($action) || $action == 'view') { print "" . $langs->trans("Credit") . ""; print "\n"; - $var = true; $r = ''; foreach ( $tabpay as $key => $val ) { // $key is rowid in llx_bank @@ -826,7 +825,7 @@ if (empty($action) || $action == 'view') { // Bank foreach ( $tabbq[$key] as $k => $mt ) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $ref . ""; @@ -853,7 +852,7 @@ if (empty($action) || $action == 'view') { if (is_array($tabtp[$key])) { foreach ( $tabtp[$key] as $k => $mt ) { if ($k != 'type') { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $ref . ""; @@ -874,7 +873,7 @@ if (empty($action) || $action == 'view') { } } else { foreach ( $tabbq[$key] as $k => $mt ) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $ref . ""; @@ -892,7 +891,6 @@ if (empty($action) || $action == 'view') { print ""; } } - $var = ! $var; } print ""; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 8d657ee6d11..a281b7fef8d 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -449,7 +449,6 @@ if (empty($action) || $action == 'view') { print "" . $langs->trans("Credit") . ""; print "\n"; - $var = true; $r = ''; $expensereportstatic = new ExpenseReport($db); @@ -468,7 +467,7 @@ if (empty($action) || $action == 'view') { $accountingaccount->fetch(null, $k, true); if ($mt) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $expensereportstatic->getNomUrl(1) . ""; @@ -494,7 +493,7 @@ if (empty($action) || $action == 'view') { // VAT foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $expensereportstatic->getNomUrl(1) . ""; @@ -512,7 +511,7 @@ if (empty($action) || $action == 'view') { print ""; } } - print ""; + print ''; // Third party foreach ( $tabttc[$key] as $k => $mt ) { @@ -534,8 +533,6 @@ if (empty($action) || $action == 'view') { print '' . ($mt >= 0 ? price($mt) : '') . ""; } print ""; - - $var = ! $var; } print ""; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 9790d124d56..a00fc9a70d8 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -498,7 +498,6 @@ if (empty($action) || $action == 'view') { print "" . $langs->trans("Type") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . ""; print "\n"; - $var = true; $r = ''; $invoicestatic = new FactureFournisseur($db); @@ -521,7 +520,7 @@ if (empty($action) || $action == 'view') { $accountingaccount->fetch(null, $k, true); if ($mt) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $invoicestatic->getNomUrl(1) . ""; @@ -545,7 +544,7 @@ if (empty($action) || $action == 'view') { // VAT foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $invoicestatic->getNomUrl(1) . ""; @@ -563,7 +562,7 @@ if (empty($action) || $action == 'view') { print ""; } } - print ""; + print ''; // Third party foreach ( $tabttc[$key] as $k => $mt ) { @@ -588,8 +587,6 @@ if (empty($action) || $action == 'view') { print '' . ($mt >= 0 ? price($mt) : '') . ""; } print ""; - - $var = ! $var; } print ""; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index fc3a511d670..235af8eeb41 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -517,7 +517,6 @@ if (empty($action) || $action == 'view') { print "" . $langs->trans("Credit") . ""; print "\n"; - $var = true; $r = ''; $invoicestatic = new Facture($db); @@ -532,7 +531,7 @@ if (empty($action) || $action == 'view') { // Third party foreach ( $tabttc[$key] as $k => $mt ) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $invoicestatic->getNomUrl(1) . ""; @@ -562,7 +561,7 @@ if (empty($action) || $action == 'view') { $accountingaccount->fetch(null, $k, true); if ($mt) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $invoicestatic->getNomUrl(1) . ""; @@ -585,7 +584,7 @@ if (empty($action) || $action == 'view') { // VAT foreach ( $tabtva[$key] as $k => $mt ) { if ($mt) { - print ""; + print ''; print ""; print "" . $date . ""; print "" . $invoicestatic->getNomUrl(1) . ""; @@ -604,8 +603,6 @@ if (empty($action) || $action == 'view') { print ""; } } - - $var = ! $var; } print ""; diff --git a/htdocs/accountancy/report/result.php b/htdocs/accountancy/report/result.php index 317b7193ff3..a487cb641ff 100644 --- a/htdocs/accountancy/report/result.php +++ b/htdocs/accountancy/report/result.php @@ -127,7 +127,6 @@ if (!empty($cats)) $position = -1; $code = -1; foreach($cpts as $i => $cpt){ - $var = ! $var; $position = $cpt['position']; $code = $cpt['code']; @@ -149,7 +148,7 @@ if (!empty($cats)) } $sommes[$code]['NP'] += $resultNP; $sommes[$code]['N'] += $resultN; - print ''; + print ''; print '' . $cpt['account_number'] . ''; print '' . $cpt['name_cpt'] . ''; print '' . price($resultNP) . ''; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a747342a508..2d36399c9b5 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -215,8 +215,7 @@ if ($resql) { while ( $row = $db->fetch_row($resql)) { - $var = ! $var; - print '' . length_accountg($row[0]) . ''; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; for($i = 2; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; @@ -270,8 +269,7 @@ if ($resql) { while ( $row = $db->fetch_row($resql)) { - $var = ! $var; - print '' . length_accountg($row[0]) . ''; + print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; for($i = 2; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 9b42337852c..beae148c01b 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -313,7 +313,6 @@ if ($result) { $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); - $var = ! $var; // product_type: 0 = service ? 1 = product // if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service @@ -355,7 +354,7 @@ if ($result) { // $objp->code_buy_p is now code of product/service // $objp->code_buy_l is now default code of product/service - print ''; + print ''; // Line id print '' . $objp->rowid . ''; diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 1169c379e59..2754c2d3690 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -125,10 +125,8 @@ print ''.$langs->trans("Description").''; print ''.$langs->trans("Value").''; print ''.$langs->trans("Action").''; print "\n"; -$var=true; // Login/Pass required for members - print '
'; print ''; print ''; @@ -141,7 +139,6 @@ print "\n"; print '
'; // Mail required for members - print '
'; print ''; print ''; @@ -154,7 +151,6 @@ print "\n"; print '
'; // Send mail information is on by default - print '
'; print ''; print ''; @@ -167,7 +163,6 @@ print "\n"; print '
'; // Insert subscription into bank account - print '
'; print ''; print ''; @@ -188,7 +183,6 @@ print '
'; // Use vat for invoice creation if ($conf->facture->enabled) { - print '
'; print ''; print ''; @@ -213,7 +207,6 @@ if ($conf->facture->enabled) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - print ''; print ''; print ''; diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 8a13097ffeb..e2a3bde72cb 100644 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -145,10 +145,8 @@ print ''; print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print "\n"; -$var=true; // Allow public form -$var=! $var; print ''; print ''; print $langs->trans("EnablePublicSubscriptionForm"); @@ -157,10 +155,9 @@ print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_E print "\n"; // Force Type -$var=! $var; $adht = new AdherentType($db); print ''; -print ''; +print ''; print $langs->trans("ForceMemberType"); print ''; $listofval = array(-1 => $langs->trans("Undefined")); @@ -170,18 +167,16 @@ print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, cou print "\n"; // Amount -$var=! $var; print ''; -print ''; +print ''; print $langs->trans("DefaultAmount"); print ''; print ''; print "\n"; // Can edit -$var=! $var; print ''; -print ''; +print ''; print $langs->trans("CanEditAmount"); print ''; print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1); @@ -190,8 +185,7 @@ print "\n"; if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled)) { // Jump to an online payment page - $var=! $var; - print ''; + print ''; print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); print ''; $listofval=array(); @@ -205,8 +199,7 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empt if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled)) { // Jump to an online payment page - $var=! $var; - print ''; + print ''; print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL"); print ''; print ''; 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 6440fb72cb8..76368fc5673 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -246,7 +246,6 @@ $var=true; krsort($Total); foreach ($Total as $key=>$value) { - print ''; print "$key"; print "".$Number[$key].""; @@ -267,9 +266,6 @@ print "
\n"; print '
'; - -$var=true; - /* * Last modified members */ @@ -295,10 +291,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; $staticmember->id=$obj->rowid; @@ -358,10 +352,8 @@ if ($resql) if ($num) { $i = 0; - $var = True; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; $subscriptionstatic->id=$obj->cid; @@ -407,7 +399,6 @@ print "\n"; foreach ($AdherentType as $key => $adhtype) { - print ''; print ''.$adhtype->getNomUrl(1, dol_size(32)).''; print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''; diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index bd731e771f3..6f896e186bb 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -127,11 +127,9 @@ if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>''); if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>''); $oldyear=0; -$var=true; foreach ($data as $val) { $year = $val['year']; - print ''; print ''.$memberstatic->getmorphylib($val['label']).''; print ''.$val['nb'].''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index d2254b4afd6..8e3d0862490 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -291,11 +291,9 @@ if ($mode) print ''; $oldyear=0; - $var=true; foreach ($data as $val) { $year = $val['year']; - print ''; print ''.$val['label'].''; if ($label2) print ''.$val['label2'].''; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index d1a8e707e43..4126fc6e68c 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -176,15 +176,13 @@ print ''.$langs->trans("AmountAverage").''; print ''; $oldyear=0; -$var=true; foreach ($data as $val) { $year = $val['year']; while ($oldyear > $year+1) { // If we have empty year $oldyear--; - - print ''; + print ''; print ''; print ''; print $oldyear; @@ -195,8 +193,7 @@ foreach ($data as $val) print '0'; print ''; } - - print ''; + print ''; print ''; //print ''; print $year; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 85374f6785e..199cc6b275e 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -821,11 +821,9 @@ if ($rowid > 0) } print "\n"; - $var=True; while ($i < $num) { $objp = $db->fetch_object($result); - print ''; $subscriptionstatic->ref=$objp->crowid; $subscriptionstatic->id=$objp->crowid; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 164c921d766..ab6bfcc0704 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -206,11 +206,9 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ' '; print "\n"; - $var=True; while ($i < $num) { $objp = $db->fetch_object($result); - print ''; print ''.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.''; print ''.dol_escape_htmltag($objp->libelle).''; @@ -518,7 +516,6 @@ if ($rowid > 0) print "\n"; - $var=True; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($resql); @@ -530,7 +527,6 @@ if ($rowid > 0) $adh->firstname=$objp->firstname; // Lastname - print ''; if ($objp->societe != '') { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index a6ca7871ae4..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 @@ -593,8 +593,14 @@ print ""; print ''; print ""; print ''; -print $langs->trans("WatermarkOnDraftOrders").''; -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"; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 4e9b007ee14..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 @@ -760,7 +760,13 @@ print ''; print ''; print ''; 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 ''; print ''; 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/other.php b/htdocs/admin/menus/other.php index 82457a27bdf..7789c3fb21c 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -81,7 +81,6 @@ dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1); // Other Options -$var=true; print ''; print ''; @@ -90,7 +89,6 @@ print ''; print ''; // Hide unauthorized menu - print ''; print ''; print ''; $out.=''; $out.=''."\n"; - $var = true; $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename'); if (is_array($tmpfilelist2) && count($tmpfilelist2)) { @@ -284,8 +275,7 @@ if ($xml) foreach ($tmpfilelist2 as $file) { $i++; - $var = !$var; - $out.=''; + $out.=''; $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; @@ -307,7 +297,7 @@ if ($xml) } else { - $out.=''; + $out.=''; } $out.='
'.$langs->trans("Status").'
'.$langs->trans("HideUnauthorizedMenu").''; 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/propal.php b/htdocs/admin/propal.php index bff56b4f776..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 @@ -534,11 +533,10 @@ print '
'; /* * Other options - * */ + print load_fiche_titre($langs->trans("OtherOptions"),'',''); -$var=true; print ""; print ""; print "\n"; @@ -572,7 +570,6 @@ print "\n"; print ''; */ -$var=! $var; print ''; print ''; print ''; @@ -599,8 +596,14 @@ print ""; print ''; print ""; print '\n"; diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php index 4051392c82c..4f2a53de88d 100644 --- a/htdocs/admin/system/browser.php +++ b/htdocs/admin/system/browser.php @@ -47,25 +47,16 @@ print load_fiche_titre($langs->trans("InfoBrowser"),'','title_setup'); $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); // Browser -$var=true; print '
'; print '
".$langs->trans("Parameter")."
'; -print $langs->trans("WatermarkOnDraftProposal").''; -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 ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; print ''; if ($newkey == 'separator') { @@ -233,12 +232,10 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; print ''."\n"; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 1e70cbab6cc..556961cb565 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -103,12 +103,10 @@ else if ($resql) { $num = $db->num_rows($resql); - $var=True; $i=0; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; print ''; @@ -158,12 +156,10 @@ else if ($resql) { $num = $db->num_rows($resql); - $var=True; $i=0; while ($i < $num) { $row = $db->fetch_row($resql); - print ''; print ''; print ''; @@ -182,8 +178,8 @@ else if ($base == 4) { // Sqlite by PDO or by Sqlite3 - print '
'; - 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").''; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 9590260f005..c7c7542ccaa 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -170,7 +170,6 @@ foreach($configfileparameters as $key) continue; } - print '
'.$obj->name.'
'.$obj->Name.'
'.$row[0].''.$row[1].'
'; + print '
'; + print '
'; print ''; print ''; print ''; @@ -194,7 +190,6 @@ else if ($resql) { - $var=True; while ($row = $db->fetch_row($resql)) { $rescount = $db->query("SELECT COUNT(*) FROM " . $row[0]); diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 39511e8a814..45ce3c087e6 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -100,10 +100,8 @@ else if ($listname == 'listofvars') $listtouse=$listofvars; if ($listname == 'listofstatus') $listtouse=$listofstatus; - $var=true; foreach($listtouse as $param => $paramval) { - print ''; print ''; - print ""; print ""; print ""; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index c96a085456a..36260c0a228 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -68,11 +68,9 @@ llxHeader('', $title); print load_fiche_titre($title,'','title_setup'); // Version -$var=true; print '
'; print '
'.$langs->trans("TableName").''.$langs->trans("NbOfRecord").'
'; print $param; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index 624edc2f38e..19fa3fc1abd 100644 --- a/htdocs/admin/system/dbtable.php +++ b/htdocs/admin/system/dbtable.php @@ -106,14 +106,11 @@ else if ($resql) { $num = $db->num_rows($resql); - $var=True; $i=0; while ($i < $num) { $row = $db->fetch_row($resql); - print '
$row[0]$row[1]$row[3]
'; print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; print '
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')'.DOL_VERSION; // If current version differs from last upgrade if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) @@ -123,41 +121,30 @@ 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.'
'; print ''; print '
'; // Session -$var=true; print '
'; print ''; print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print '\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''; $out.=''; $out.=''."\n"; - $var = true; $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); if (is_array($tmpfilelist) && count($tmpfilelist)) { @@ -247,8 +240,7 @@ if ($xml) foreach ($tmpfilelist as $file) { $i++; - $var = !$var; - $out.=''; + $out.=''; $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; @@ -257,7 +249,7 @@ if ($xml) } else { - $out.=''; + $out.=''; } $out.='
'.$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 ''; 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 $conf->standard_menu; print '
'.$langs->trans("Screen").''; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print '
'.$langs->trans("Session").''; $i=0; foreach($_SESSION as $key => $val) @@ -177,7 +164,6 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S { $shmoparray=dol_listshmop(); - $var=true; print '
'; print ''; print ''; @@ -188,7 +174,6 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S foreach($shmoparray as $key => $val) { - print ''; print ''; print ''; @@ -202,43 +187,33 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S // Localisation -$var=true; print '
'; print '
'.$key.''.count($val).''.dol_getshmopaddress($key).'
'; print ''."\n"; - print ''."\n"; - print ''."\n"; // Thousands - $thousand=$langs->transnoentitiesnoconv("SeparatorThousand"); if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method if ($thousand == 'None') $thousand=''; print ''."\n"; // Decimals - $dec=$langs->transnoentitiesnoconv("SeparatorDecimal"); print ''."\n"; // Show results of functions to see if everything works - print ''."\n"; - -print "\n"; +print '\n"; if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) { - - print ""; + print '"; 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 - print ''."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php - print ''."\n"; - print ''; - print ''; - print ''; // Database timezone if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') { - print ''."\n"; } // Client - $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst']; print ''."\n"; print ''."\n"; - 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 - $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 @@ -384,7 +350,6 @@ foreach($configfileparameters as $key => $value) } if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue; - print ''; if (strpos($newkey, 'separator') !== false) { @@ -463,12 +428,10 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; print ''."\n"; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index c64379a96f1..4d32e10b174 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -46,14 +46,10 @@ print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup'); print $langs->trans("FileCheckDesc").'

'; // Version -$var = true; print '
'.$langs->trans("LocalisationDolibarrParameters").''.$langs->trans("Value").'
'.$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("CurrentValueSeparatorDecimal").''.$dec.'
  => price2num(1233.56+1)'.price2num(1233.56+1,'2').'
  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2')."
  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2')."
  => price2num('."'1 234.56')".price2num("1 234.56",'2')."
  => price2num('."'1 234.56')".price2num("1 234.56",'2')."
  => price(1234.56)'.price(1234.56).'
'.$langs->trans("CurrentTimeZone").''; // Timezone server PHP $a=getServerTimeZoneInt('now'); $b=getServerTimeZoneInt('winter'); @@ -251,18 +226,13 @@ $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("MySQLTimeZone").' (database)'; // Timezone server base $sql="SHOW VARIABLES where variable_name = 'system_time_zone'"; $resql = $db->query($sql); @@ -274,7 +244,6 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') print '
'.$langs->trans("ClientTZ").''.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')'; print '       '.$_SESSION['dol_tz_string']; @@ -284,14 +253,11 @@ 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("File encoding").' (php.ini unicode.filesystem_encoding)'.$filesystemencoding.'
'.$obj->name.'
'; print ''."\n"; -$var = ! $var; print ''."\n"; -$var = ! $var; print ''."\n"; -$var = ! $var; print ''; $out.=''; $out.=''."\n"; - $var = true; $i = 0; foreach ($xml->dolibarr_constants[0]->constant as $constant) // $constant is a simpleXMLElement @@ -188,8 +183,7 @@ if ($xml) $checksumconcat[]=$valueforchecksum; $i++; - $var = !$var; - $out.=''; + $out.=''; $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; @@ -199,7 +193,7 @@ if ($xml) if ($i==0) { - $out.=''; + $out.=''; } $out.='
'.$langs->trans("Version").''.$langs->trans("Value").'
'.$langs->trans("VersionLastInstall").''.$conf->global->MAIN_VERSION_LAST_INSTALL.'
'.$langs->trans("VersionLastUpgrade").''.$conf->global->MAIN_VERSION_LAST_UPGRADE.'
'.$langs->trans("VersionProgram").''.DOL_VERSION; // If current version differs from last upgrade if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) { @@ -172,7 +168,6 @@ if ($xml) $out.='' . $langs->trans("ExpectedValue") . '' . $langs->trans("Value") . '
'.$i.''.$constname.''.$constvalue.'
'.$langs->trans("None").'
'.$langs->trans("None").'
'; @@ -239,7 +233,6 @@ if ($xml) $out.='
' . $langs->trans("Filename") . '' . $langs->trans("ExpectedChecksum") . '
'.$i.''.$file['filename'].''.$file['expectedmd5'].'
'.$langs->trans("None").'
'.$langs->trans("None").'
'; @@ -276,7 +268,6 @@ if ($xml) $out.='
' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '
'.$i.''.$file['filename'].''.$file['expectedmd5'].'
'.$langs->trans("None").'
'.$langs->trans("None").'
'; @@ -326,7 +316,6 @@ if ($xml) $out.='' . $langs->trans("Size") . ''; $out.='' . $langs->trans("DateModification") . ''; $out.=''."\n"; - $var = true; $tmpfilelist3 = dol_sort_array($file_list['added'], 'filename'); if (is_array($tmpfilelist3) && count($tmpfilelist3)) { @@ -334,8 +323,7 @@ if ($xml) foreach ($tmpfilelist3 as $file) { $i++; - $var = !$var; - $out.=''; + $out.=''; $out.=''.$i.'' . "\n"; $out.=''.$file['filename'].'' . "\n"; $out.=''.$file['expectedmd5'].'' . "\n"; @@ -357,7 +345,7 @@ if ($xml) } else { - $out.=''.$langs->trans("None").''; + $out.=''.$langs->trans("None").''; } $out.=''; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 68a01340303..4a6967089e2 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -118,9 +118,8 @@ $rights_ids = array(); foreach($sortorder as $numero=>$name) { $idperms=""; - // Module - print "'; + print ''; $alt=$name.' - '.$modules_files[$numero]; if (! empty($picto[$numero])) { diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 6bb431bfdfb..8664a28b28a 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -57,7 +57,7 @@ $var=false; // Recupere la version de PHP $phpversion=version_php(); -print "'.$langs->trans("Version")."".$phpversion."\n"; +print ''.$langs->trans("Version")."".$phpversion."\n"; print ''; print '
'; @@ -76,13 +76,11 @@ foreach($phparray as $key => $value) print ''.$langs->trans("Value").''; print "\n"; - $var=true; //var_dump($value); foreach($value as $keyparam => $keyvalue) { if (! is_array($keyvalue)) { - print ''; print ''.$keyparam.''; $valtoshow=$keyvalue; @@ -97,7 +95,6 @@ foreach($phparray as $key => $value) } else { - print ''; print ''.$keyparam.''; $i=0; 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/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 16f3f4db561..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 ''; - $var = true; $i = 0; if ($num) @@ -523,8 +513,6 @@ if ($object->fetch($id) >= 0) { $obj = $db->fetch_object($resql); - - print ''; print ''; print ''; @@ -599,7 +587,7 @@ if ($object->fetch($id) >= 0) { if ($object->statut < 2) { - print ''; } 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/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 3489860e1dd..46c6a55cf2f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2010-2016 Philippe Grand + * Copyright (C) 2010-2017 Philippe Grand * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry @@ -3113,21 +3113,21 @@ class Propal extends CommonObject $line->qty=1; $line->subprice=100; $line->price=100; - $line->tva_tx=19.6; + $line->tva_tx=20; $line->localtax1_tx=0; $line->localtax2_tx=0; if ($xnbp == 2) { $line->total_ht=50; - $line->total_ttc=59.8; - $line->total_tva=9.8; + $line->total_ttc=60; + $line->total_tva=10; $line->remise_percent=50; } else { $line->total_ht=100; - $line->total_ttc=119.6; - $line->total_tva=19.6; + $line->total_ttc=120; + $line->total_tva=20; $line->remise_percent=00; } @@ -3135,6 +3135,7 @@ class Propal extends CommonObject { $prodid = mt_rand(1, $num_prods); $line->fk_product=$prodids[$prodid]; + $line->product_ref='SPECIMEN'; } $this->lines[$xnbp]=$line; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e87923beb8c..bf1f993bcdc 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3541,25 +3541,26 @@ class Commande extends CommonOrder $line->qty=1; $line->subprice=100; $line->price=100; - $line->tva_tx=19.6; + $line->tva_tx=20; if ($xnbp == 2) { $line->total_ht=50; - $line->total_ttc=59.8; - $line->total_tva=9.8; + $line->total_ttc=60; + $line->total_tva=10; $line->remise_percent=50; } else { $line->total_ht=100; - $line->total_ttc=119.6; - $line->total_tva=19.6; + $line->total_ttc=120; + $line->total_tva=20; $line->remise_percent=0; } if ($num_prods > 0) { $prodid = mt_rand(1, $num_prods); $line->fk_product=$prodids[$prodid]; + $line->product_ref='SPECIMEN'; } $this->lines[$xnbp]=$line; 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 392ba507036..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) { @@ -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) { 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/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 87039a3d454..d430a8ea53b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1025,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'; @@ -1051,14 +1055,14 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } 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 . "/"; @@ -1083,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)) { @@ -4865,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) 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/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/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/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index a23d14a979d..1245041d98a 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -77,18 +77,27 @@ $(document).ready(function () { + + + + + +
'.$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,6 +219,7 @@ if ($object->fetch($id) >= 0) print ""; + 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(); @@ -316,7 +307,7 @@ if ($object->fetch($id) >= 0) if ($allowaddtarget) { - print ''; + print ''; print ''; } else @@ -514,7 +505,6 @@ if ($object->fetch($id) >= 0) print '
'.$obj->email.''.$obj->lastname.'
'; + print '
'; print $langs->trans("NoTargetYet"); print '
"> @@ -146,10 +155,10 @@ if (! empty($hookmanager->resArray['options'])) {
-
+
+
-
@@ -209,19 +218,9 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file ?> -
+ - - - - - + diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 8a403d675d7..bdc38b08873 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -52,18 +52,25 @@ $(document).ready(function () { + + + + - - -
@@ -143,15 +148,6 @@ if (! empty($hookmanager->resArray['options'])) {
- - - diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c7893aefd2f..cbe602f7313 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -726,7 +726,9 @@ if ($action == 'create') print ''; print $langs->trans("Weight"); print ' '; - print $formproduct->select_measuring_units("weight_units","weight",GETPOST('weight_units','int')); + $text=$formproduct->select_measuring_units("weight_units","weight",GETPOST('weight_units','int')); + $htmltext=$langs->trans("KeepEmptyForAutoCalculation"); + print $form->textwithpicto($text, $htmltext); print ''; // Dim print ''; @@ -735,7 +737,9 @@ if ($action == 'create') print ' x '; print ' x '; print ' '; - print $formproduct->select_measuring_units("size_units","size"); + $text=$formproduct->select_measuring_units("size_units","size"); + $htmltext=$langs->trans("KeepEmptyForAutoCalculation"); + print $form->textwithpicto($text, $htmltext); print ''; // Delivery method @@ -865,7 +869,7 @@ if ($action == 'create') if (! empty($line->date_start)) $type=1; if (! empty($line->date_end)) $type=1; - print "\n"; + print ''."\n"; // Product label if ($line->fk_product > 0) // If predefined product @@ -1096,10 +1100,10 @@ if ($action == 'create') $nbofsuggested++; } } + $tmpwarehouseObject=new Entrepot($db); foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock { - $warehouseObject=new Entrepot($db); - $warehouseObject->fetch($warehouse_id); + $tmpwarehouseObject->fetch($warehouse_id); if ($stock_warehouse->real > 0) { $stock = + $stock_warehouse->real; // Convert it to number @@ -1122,7 +1126,7 @@ if ($action == 'create') print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print $warehouseObject->getNomUrl(0).' '; + print $tmpwarehouseObject->getNomUrl(0).' '; print ''; print '('.$stock.')'; @@ -1158,7 +1162,7 @@ if ($action == 'create') { $img=img_warning($langs->trans("StockTooLow")); } - print ""; + print ''; print "      -> ".$value['fullpath']." (".$value['nb'].") ".$value['nb_total']."   @@ -1175,7 +1179,7 @@ if ($action == 'create') $subj=0; print ''; - $warehouseObject=new Entrepot($db); + $tmpwarehouseObject=new Entrepot($db); $productlotObject=new Productlot($db); // Define nb of lines suggested for this order line $nbofsuggested=0; @@ -1190,7 +1194,7 @@ if ($action == 'create') } foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) { - $warehouseObject->fetch($warehouse_id); + $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { @@ -1203,7 +1207,7 @@ if ($action == 'create') print ''; - print $warehouseObject->getNomUrl(0).' / '; + print $tmpwarehouseObject->getNomUrl(0).' / '; print ''; print ''; @@ -1223,6 +1227,7 @@ if ($action == 'create') } } } + } if ($subj == 0) // Line not shown yet, we show it { @@ -1246,8 +1251,11 @@ if ($action == 'create') print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if ($warehouseObject) + $warehouse_selected_id = GETPOST('entrepot_id','int'); + if ($warehouse_selected_id > 0) { + $warehouseObject=new Entrepot($db); + $warehouseObject->fetch($warehouse_selected_id); print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle); } else diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 3916770de8a..82ecad62417 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -340,7 +340,7 @@ if ($step == 1 || ! $datatoimport) $head = import_prepare_head($param, 1); - dol_fiche_head($head, 'step1', $langs->trans("NewImport")); + dol_fiche_head($head, 'step1', $langs->trans("NewImport"), -1); print $langs->trans("SelectImportDataSet").'
'; @@ -403,8 +403,10 @@ if ($step == 2 && $datatoimport) $head = import_prepare_head($param,2); - dol_fiche_head($head, 'step2', $langs->trans("NewImport")); + dol_fiche_head($head, 'step2', $langs->trans("NewImport"), -1); + print '
'; + print '
'; print ''; @@ -426,6 +428,8 @@ if ($step == 2 && $datatoimport) print '
'; + print '

'; + dol_fiche_end(); @@ -478,7 +482,7 @@ if ($step == 3 && $datatoimport) $head = import_prepare_head($param, 3); - dol_fiche_head($head, 'step3', $langs->trans("NewImport")); + dol_fiche_head($head, 'step3', $langs->trans("NewImport"), -1); /* * Confirm delete file @@ -489,6 +493,9 @@ if ($step == 3 && $datatoimport) } + print '
'; + print '
'; + print ''; // Module @@ -508,10 +515,14 @@ if ($step == 3 && $datatoimport) print ''; print '
'; + print '
'; print '
'; - print ''.$langs->trans("InformationOnSourceFile").'
'; + print ''.$langs->trans("InformationOnSourceFile").''; + + print '
'; + print '
'; print ''; //print ''; @@ -525,6 +536,7 @@ if ($step == 3 && $datatoimport) print ''; print '
'.$langs->trans("InformationOnSourceFile").'
'; + print '
'; dol_fiche_end(); @@ -735,7 +747,10 @@ if ($step == 4 && $datatoimport) $head = import_prepare_head($param,4); - dol_fiche_head($head, 'step4', $langs->trans("NewImport")); + dol_fiche_head($head, 'step4', $langs->trans("NewImport"), -1); + + print '
'; + print '
'; print ''; @@ -756,10 +771,13 @@ if ($step == 4 && $datatoimport) print ''; print '
'; - + print '
'; + print '
'; - print ''.$langs->trans("InformationOnSourceFile").'
'; + print ''.$langs->trans("InformationOnSourceFile").''; + print '
'; + print '
'; print ''; //print ''; @@ -801,6 +819,7 @@ if ($step == 4 && $datatoimport) print ''; print '
'.$langs->trans("InformationOnSourceFile").'
'; + print '
'; dol_fiche_end(); @@ -1204,8 +1223,10 @@ if ($step == 5 && $datatoimport) print ''; // step 5 print ''; // step 5 - dol_fiche_head($head, 'step5', $langs->trans("NewImport")); + dol_fiche_head($head, 'step5', $langs->trans("NewImport"), -1); + print '
'; + print '
'; print ''; @@ -1226,10 +1247,13 @@ if ($step == 5 && $datatoimport) print ''; print '
'; - + print '
'; + print '
'; - print ''.$langs->trans("InformationOnSourceFile").'
'; + print ''.$langs->trans("InformationOnSourceFile").''; + print '
'; + print '
'; print ''; //print ''; @@ -1276,7 +1300,6 @@ if ($step == 5 && $datatoimport) { print ''; print ''; - print '   '.$langs->trans("Modify").''; } else { @@ -1288,20 +1311,27 @@ if ($step == 5 && $datatoimport) { print ''; print ''; - print '   '.$langs->trans("Modify").''; } else { print ''; print $form->textwithpicto("", $langs->trans("KeepEmptyToGoToEndOfFile")); } + if ($action == 'launchsimu') print '   '.$langs->trans("Modify").''; print ''; print ''; print '
'.$langs->trans("InformationOnSourceFile").'
'; print $langs->trans("KeysToUseForUpdates"); print ''; if($action=='launchsimu') { - print $form->multiselectarray('updatekeysbis', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '', 'disabled'); + if (count($updatekeys)) + { + print $form->multiselectarray('updatekeysbis', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '', 'disabled'); + } + else + { + print ''.$langs->trans("NoUpdateAttempt").'   -'; + } foreach($updatekeys as $val) { print ''; } @@ -1323,15 +1353,19 @@ if ($step == 5 && $datatoimport) print '
'; - + print '
'; + print '
'; - print ''.$langs->trans("InformationOnTargetTables").'
'; + print ''.$langs->trans("InformationOnTargetTables").''; + print '
'; + print '
'; + print ''; //print ''; // Tables imported - print ''; print '
'.$langs->trans("InformationOnTargetTables").'
'; + print '
'; print $langs->trans("TablesTarget"); print ''; $listtables=array(); @@ -1391,7 +1425,8 @@ if ($step == 5 && $datatoimport) print '
'; - + print '
'; + dol_fiche_end(); diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 91a0c36aaeb..e73c0df2add 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -59,8 +59,9 @@ ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_creat integer; ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_modif integer; ALTER TABLE llx_product_price_by_qty DROP COLUMN date_price; ALTER TABLE llx_product_price_by_qty ADD COLUMN tms timestamp; -ALTER TABLE llx_product_price_by_qty ADD COLUMN import_key integer; +ALTER TABLE llx_product_price_by_qty ADD COLUMN import_key varchar(14); +ALTER TABLE llx_user ADD COLUMN import_key varchar(14); CREATE TABLE llx_product_attribute diff --git a/htdocs/install/mysql/tables/llx_product_price_by_qty.sql b/htdocs/install/mysql/tables/llx_product_price_by_qty.sql index 8543f1720b2..2b91647b80a 100644 --- a/htdocs/install/mysql/tables/llx_product_price_by_qty.sql +++ b/htdocs/install/mysql/tables/llx_product_price_by_qty.sql @@ -31,5 +31,5 @@ create table llx_product_price_by_qty fk_user_creat integer, fk_user_modif integer, tms timestamp, - import_key integer + import_key varchar(14) )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index e711c1e9ad9..d033ba5eca4 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -83,5 +83,7 @@ create table llx_user salary double(24,8), -- denormalized value coming from llx_user_employment salaryextra double(24,8), -- denormalized value coming from llx_user_employment dateemployment date, -- denormalized value coming from llx_user_employment - weeklyhours double(16,8) -- denormalized value coming from llx_user_employment + weeklyhours double(16,8), -- denormalized value coming from llx_user_employment + + import_key varchar(14) -- import key )ENGINE=innodb; diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 139b3e463b8..a2e208673bd 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -117,7 +117,9 @@ ImportFromToLine=Import line numbers (from - to) SetThisValueTo2ToExcludeFirstLine=For example, set this value to 3 to exclude the 2 first lines KeepEmptyToGoToEndOfFile=Keep this field empty to go up to the end of file SelectPrimaryColumnsForUpdateAttempt=Select column(s) to use as primary key for update attempt -UpdateNotYetSupportedForThisImport=Update is not supported for this type of import (only insert) +UpdateNotYetSupportedForThisImport=Update is not supported for this type of import (only insert) +NoUpdateAttempt=No update attempt was performed, only insert +ImportDataset_user_1=Users (employees or not) and properties ## filters SelectFilterFields=If you want to filter on some values, just input values here. FilteredFields=Filtered fields diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 73c34f7101e..71788071a2d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -153,6 +153,7 @@ Edit=Edit Validate=Validate ValidateAndApprove=Validate and Approve ToValidate=To validate +NotValidated=Not validated Save=Save SaveAs=Save As TestConnection=Test connection diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 48ced509c47..0ab21cae322 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -198,6 +198,7 @@ MultipriceRules=Price segment rules UseMultipriceRules=Use price segment rules (defined into product module setup) to autocalculate prices of all other segment according to first segment PercentVariationOver=%% variation over %s PercentDiscountOver=%% discount over %s +KeepEmptyForAutoCalculation=Keep empty to have this calculated automatically from weight or volume of products ### composition fabrication Build=Produce ProductsMultiPrice=Products and prices for each price segment diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f5acdeac02b..72a5f39e02c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -849,7 +849,7 @@ if (! defined('NOREQUIRETRAN')) $bc=array(0=>'class="impair"',1=>'class="pair"'); $bcdd=array(0=>'class="drag drop oddeven"',1=>'class="drag drop oddeven"'); $bcnd=array(0=>'class="nodrag nodrop nohover"',1=>'class="nodrag nodrop nohoverpair"'); // Used for tr to add new lines -$bctag=array(0=>'class="tagtr"',1=>'class="pair tagtr"'); +$bctag=array(0=>'class="impair tagtr"',1=>'class="pair tagtr"'); // Define messages variables $mesg=''; $warning=''; $error=0; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1799fadf9bd..ef162beb750 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -118,7 +118,9 @@ $fieldstosearchall = array( 's.nom'=>"ThirdPartyName", 's.name_alias'=>"AliasNameShort", 's.code_client'=>"CustomerCode", - "s.code_fournisseur"=>"SupplierCode", + 's.code_fournisseur'=>"SupplierCode", + 's.code_compta'=>"CustomerAccountancyCodeShort", + 's.code_compta_fournisseur'=>"SupplierAccountancyCodeShort", 's.email'=>"EMail", 's.url'=>"URL", 's.tva_intra'=>"VATIntra", diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 47d549e3986..4e72843eae3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1526,6 +1526,7 @@ foreach($mainmenuusedarray as $val) } .login_vertical_align { padding: 10px; + padding-bottom: 80px; } form#login { padding-bottom: 30px; @@ -1535,7 +1536,7 @@ form#login { .login_table_title { max-width: 530px; color: #aaa !important; - padding-top: 30px; + padding-bottom: 20px; /* text-shadow: 1px 1px 1px #FFF; */ } .login_table label { @@ -2500,21 +2501,20 @@ div.pagination li.paginationafterarrows { /* Set the color for hover lines */ -.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, -table.dataTable tr.even:hover, table.dataTable tr.odd:hover +.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover { background: rgb() !important; /* Must be background to be stronger than background of odd or even */ } -.oddeven, .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover +.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover { font-family: ; margin-bottom: 1px; color: #202020; } -.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover +.impair, .nohover .impair:hover, tr.impair td.nohover { background: #; } @@ -2522,16 +2522,16 @@ table.dataTable tr.even:hover, table.dataTable tr.odd:hover background-color: #; } -.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { +.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover { font-family: ; margin-bottom: 1px; color: #202020; } -.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { +.pair, .nohover .pair:hover, tr.pair td.nohover { background-color: #; } -table.dataTable tr.odd, table.dataTable tr.oddeven { +table.dataTable tr.oddeven { background-color: # !important; } @@ -2540,7 +2540,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp background-color: # !important; background: # !important; } -tr.nohoverpair td { +td.evenodd, tr.nohoverpair td { background-color: # !important; background: # !important; } @@ -2549,17 +2549,17 @@ tr.nohoverpair td { table.dataTable td { padding: 5px 2px 5px 3px !important; } -tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { +tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { padding: 7px 2px 7px 3px; border-bottom: 1px solid #ddd; } form.pair, form.impair { font-weight: normal; } -form.tagtr:last-of-type div.tagtd, tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td { +form.tagtr:last-of-type div.tagtd, tr.pair:last-of-type td, tr.impair:last-of-type td { border-bottom: 0px !important; } -tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td { +tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td { border-bottom: 0px !important; } td.nobottom, td.nobottom { @@ -2619,6 +2619,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste font-family: ; font-weight: ; vertical-align: middle; + height: 24px; } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a1b63b9c49b..64e73c144ba 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1562,6 +1562,7 @@ foreach($mainmenuusedarray as $val) } .login_vertical_align { padding: 10px; + padding-bottom: 80px; } form#login { padding-bottom: 30px; @@ -1571,7 +1572,7 @@ form#login { .login_table_title { max-width: 530px; color: #aaa !important; - padding-top: 30px; + padding-bottom: 20px; /* text-shadow: 1px 1px 1px #FFF; */ } .login_table label { @@ -2595,21 +2596,21 @@ div.pagination li.paginationafterarrows { */ /* Set the color for hover lines */ -.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover +.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover { background: rgb() !important; } -.oddeven, .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover +.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover { font-family: ; border: 0px; margin-bottom: 1px; color: #202020; } -.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover +.impair, .nohover .impair:hover, tr.impair td.nohover { background: #; } @@ -2617,15 +2618,15 @@ div.pagination li.paginationafterarrows { background: #; } -.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { +.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover { font-family: ; margin-bottom: 1px; color: #202020; } -.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover { +.pair, .nohover .pair:hover, tr.pair td.nohover { background-color: #; } -table.dataTable tr.odd, table.dataTable tr.oddeven { +table.dataTable tr.oddeven { background-color: # !important; } @@ -2634,7 +2635,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp background-color: # !important; background: # !important; } -tr.nohoverpair td { +td.evenodd, tr.nohoverpair td { background-color: # !important; background: # !important; } @@ -2642,17 +2643,17 @@ tr.nohoverpair td { table.dataTable td { padding: 5px 2px 5px 3px !important; } -tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { +tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { padding: 5px 2px 5px 3px; border-bottom: 1px solid #eee; } form.pair, form.impair { font-weight: normal; } -tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td { +tr.pair:last-of-type td, tr.impair:last-of-type td { border-bottom: 0px !important; } -tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td { +tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td { border-bottom: 0px !important; } td.nobottom, td.nobottom { @@ -2725,6 +2726,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste font-family: ; font-weight: ; vertical-align: middle; + height: 24px; } tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important;