@@ -29,11 +29,11 @@ |
||
29 | 29 | // Load Dolibarr environment |
30 | 30 | require '../main.inc.php'; |
31 | 31 | |
32 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/skill.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_skill.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/skill.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_skill.lib.php'; |
|
37 | 37 | |
38 | 38 | |
39 | 39 | // Load translation files required by the page |
@@ -34,7 +34,7 @@ |
||
34 | 34 | require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
35 | 35 | require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
36 | 36 | require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
38 | 38 | |
39 | 39 | |
40 | 40 | // Load translation files required by the page |
@@ -29,11 +29,11 @@ |
||
29 | 29 | // Load Dolibarr environment |
30 | 30 | require '../main.inc.php'; |
31 | 31 | |
32 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
37 | 37 | |
38 | 38 | // Load translation files required by the page |
39 | 39 | $langs->loadLangs(array('hrm', 'other')); |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | // Paiement |
179 | 179 | public $user_paid_infos; |
180 | 180 | |
181 | - public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) |
|
182 | - public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) |
|
181 | + public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject) |
|
182 | + public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject) |
|
183 | 183 | |
184 | 184 | public $labelStatus = array(); |
185 | 185 | public $labelStatusShort = array(); |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | $this->total_tva = 0; |
290 | 290 | $this->total_localtax1 = 0; |
291 | 291 | $this->total_localtax2 = 0; |
292 | - $this->localtax1 = 0; // For backward compatibility |
|
293 | - $this->localtax2 = 0; // For backward compatibility |
|
292 | + $this->localtax1 = 0; // For backward compatibility |
|
293 | + $this->localtax2 = 0; // For backward compatibility |
|
294 | 294 | $this->modepaymentid = 0; |
295 | 295 | |
296 | 296 | // List of language codes for status |
@@ -649,8 +649,8 @@ discard block |
||
649 | 649 | $this->total_ht = $obj->total_ht; |
650 | 650 | $this->total_tva = $obj->total_tva; |
651 | 651 | $this->total_ttc = $obj->total_ttc; |
652 | - $this->localtax1 = $obj->total_localtax1; // For backward compatibility |
|
653 | - $this->localtax2 = $obj->total_localtax2; // For backward compatibility |
|
652 | + $this->localtax1 = $obj->total_localtax1; // For backward compatibility |
|
653 | + $this->localtax2 = $obj->total_localtax2; // For backward compatibility |
|
654 | 654 | $this->total_localtax1 = $obj->total_localtax1; |
655 | 655 | $this->total_localtax2 = $obj->total_localtax2; |
656 | 656 | |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | |
1118 | 1118 | $deplig->rule_warning_message = $objp->rule_warning_message; |
1119 | 1119 | |
1120 | - $deplig->rang = $objp->rang; |
|
1120 | + $deplig->rang = $objp->rang; |
|
1121 | 1121 | |
1122 | 1122 | $this->lines[$i] = $deplig; |
1123 | 1123 | |
@@ -1665,7 +1665,7 @@ discard block |
||
1665 | 1665 | if (getDolGlobalString('EXPENSEREPORT_ADDON')) { |
1666 | 1666 | $mybool = false; |
1667 | 1667 | |
1668 | - $file = getDolGlobalString('EXPENSEREPORT_ADDON') . ".php"; |
|
1668 | + $file = getDolGlobalString('EXPENSEREPORT_ADDON').".php"; |
|
1669 | 1669 | $classname = getDolGlobalString('EXPENSEREPORT_ADDON'); |
1670 | 1670 | |
1671 | 1671 | // Include file with class |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | $result .= $linkend; |
1821 | 1821 | |
1822 | 1822 | global $action; |
1823 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1823 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1824 | 1824 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
1825 | 1825 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1826 | 1826 | if ($reshook > 0) { |
@@ -1913,8 +1913,8 @@ discard block |
||
1913 | 1913 | $this->line = new ExpenseReportLine($this->db); |
1914 | 1914 | |
1915 | 1915 | // We don't know seller and buyer for expense reports |
1916 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
1917 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
1916 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
1917 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
1918 | 1918 | $buyer = new Societe($this->db); |
1919 | 1919 | |
1920 | 1920 | $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); |
@@ -1996,8 +1996,8 @@ discard block |
||
1996 | 1996 | |
1997 | 1997 | // We don't know seller and buyer for expense reports |
1998 | 1998 | if (!is_object($seller)) { |
1999 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2000 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
1999 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2000 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
2001 | 2001 | } |
2002 | 2002 | |
2003 | 2003 | $expensereportrule = new ExpenseReportRule($db); |
@@ -2081,8 +2081,8 @@ discard block |
||
2081 | 2081 | |
2082 | 2082 | // We don't know seller and buyer for expense reports |
2083 | 2083 | if (!is_object($seller)) { |
2084 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2085 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
2084 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2085 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
2086 | 2086 | } |
2087 | 2087 | |
2088 | 2088 | $expenseik = new ExpenseReportIk($this->db); |
@@ -2176,10 +2176,10 @@ discard block |
||
2176 | 2176 | $type = 0; // TODO What if type is service ? |
2177 | 2177 | |
2178 | 2178 | // We don't know seller and buyer for expense reports |
2179 | - $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2180 | - $seller->tva_assuj = 1; // Most seller uses vat |
|
2181 | - $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2182 | - $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2179 | + $seller = $mysoc; // We use same than current company (expense report are often done in same country) |
|
2180 | + $seller->tva_assuj = 1; // Most seller uses vat |
|
2181 | + $seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2182 | + $seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company |
|
2183 | 2183 | $buyer = new Societe($this->db); |
2184 | 2184 | |
2185 | 2185 | $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller); |
@@ -3116,7 +3116,7 @@ discard block |
||
3116 | 3116 | } elseif ($mode == 'mon' || $mode == 'EX_MON') { |
3117 | 3117 | $sql .= " AND DATE_FORMAT(d.date, '%Y-%m') = '".dol_print_date($this->date, '%Y-%m')."'"; // @todo DATE_FORMAT is forbidden |
3118 | 3118 | } elseif ($mode == 'year' || $mode == 'EX_YEA') { |
3119 | - $sql .= " AND DATE_FORMAT(d.date, '%Y') = '".dol_print_date($this->date, '%Y')."'"; // @todo DATE_FORMAT is forbidden |
|
3119 | + $sql .= " AND DATE_FORMAT(d.date, '%Y') = '".dol_print_date($this->date, '%Y')."'"; // @todo DATE_FORMAT is forbidden |
|
3120 | 3120 | } |
3121 | 3121 | |
3122 | 3122 | dol_syslog('ExpenseReportLine::getExpAmount'); |
@@ -299,9 +299,9 @@ discard block |
||
299 | 299 | // Create a line of payments |
300 | 300 | $paiement = new PaymentSalary($db); |
301 | 301 | $paiement->fk_salary = $object->id; |
302 | - $paiement->chid = $object->id; // deprecated |
|
302 | + $paiement->chid = $object->id; // deprecated |
|
303 | 303 | $paiement->datep = $datep; |
304 | - $paiement->datev = $datev; |
|
304 | + $paiement->datev = $datev; |
|
305 | 305 | $paiement->amounts = array($object->id => $amount); // Tableau de montant |
306 | 306 | $paiement->fk_typepayment = $type_payment; |
307 | 307 | $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); |
@@ -330,10 +330,10 @@ discard block |
||
330 | 330 | |
331 | 331 | if (GETPOST('saveandnew', 'alpha')) { |
332 | 332 | setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); |
333 | - header("Location: card.php?action=create&fk_project=" . urlencode((string) ($projectid)) . "&accountid=" . urlencode((string) ($accountid)) . '&paymenttype=' . urlencode((string) (GETPOSTINT('paymenttype'))) . '&datepday=' . GETPOSTINT("datepday") . '&datepmonth=' . GETPOSTINT("datepmonth") . '&datepyear=' . GETPOSTINT("datepyear")); |
|
333 | + header("Location: card.php?action=create&fk_project=".urlencode((string) ($projectid))."&accountid=".urlencode((string) ($accountid)).'&paymenttype='.urlencode((string) (GETPOSTINT('paymenttype'))).'&datepday='.GETPOSTINT("datepday").'&datepmonth='.GETPOSTINT("datepmonth").'&datepyear='.GETPOSTINT("datepyear")); |
|
334 | 334 | exit; |
335 | 335 | } else { |
336 | - header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); |
|
336 | + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$object->id); |
|
337 | 337 | exit; |
338 | 338 | } |
339 | 339 | } else { |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | |
620 | 620 | // Auto create payment |
621 | 621 | print '<tr><td><label for="auto_create_paiement">'.$langs->trans('AutomaticCreationPayment').'</label></td>'; |
622 | - print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" ' . (empty($auto_create_paiement) ? '' : 'checked="checked"') . ' value="1"></td></tr>'."\n"; // Date payment |
|
622 | + print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.(empty($auto_create_paiement) ? '' : 'checked="checked"').' value="1"></td></tr>'."\n"; // Date payment |
|
623 | 623 | |
624 | 624 | // Bank |
625 | 625 | if (isModEnabled("bank")) { |
@@ -825,10 +825,10 @@ discard block |
||
825 | 825 | $userstatic = new User($db); |
826 | 826 | $result = $userstatic->fetch($object->fk_user); |
827 | 827 | if ($result > 0) { |
828 | - $morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); |
|
828 | + $morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); |
|
829 | 829 | } |
830 | 830 | } else { |
831 | - $morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1); |
|
831 | + $morehtmlref .= '<br>'.$form->editfieldkey("Employee", 'fk_user', $object->label, $object, $permissiontoadd, 'string', '', 0, 1); |
|
832 | 832 | |
833 | 833 | if (!empty($object->fk_user)) { |
834 | 834 | $userstatic = new User($db); |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | print "</td></tr>"; |
896 | 896 | } else { |
897 | 897 | print "<tr>"; |
898 | - print '<td class="titlefield">' . $langs->trans("DateStartPeriod") . '</td><td>'; |
|
898 | + print '<td class="titlefield">'.$langs->trans("DateStartPeriod").'</td><td>'; |
|
899 | 899 | print dol_print_date($object->datesp, 'day'); |
900 | 900 | print '</td></tr>'; |
901 | 901 | } |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | print "</td></tr>"; |
907 | 907 | } else { |
908 | 908 | print "<tr>"; |
909 | - print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>'; |
|
909 | + print '<td>'.$langs->trans("DateEndPeriod").'</td><td>'; |
|
910 | 910 | print dol_print_date($object->dateep, 'day'); |
911 | 911 | print '</td></tr>'; |
912 | 912 | } |
@@ -921,9 +921,9 @@ discard block |
||
921 | 921 | print '</td></tr>';*/ |
922 | 922 | |
923 | 923 | if ($action == 'edit') { |
924 | - print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . price($object->amount) . '"></td></tr>'; |
|
924 | + print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.price($object->amount).'"></td></tr>'; |
|
925 | 925 | } else { |
926 | - print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>'; |
|
926 | + print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>'; |
|
927 | 927 | } |
928 | 928 | |
929 | 929 | // Default mode of payment |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | if (empty($user->socid)) { |
1110 | 1110 | $canSendMail = true; |
1111 | 1111 | |
1112 | - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail); |
|
1112 | + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', $canSendMail); |
|
1113 | 1113 | } |
1114 | 1114 | } |
1115 | 1115 | |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | |
1126 | 1126 | // Emit payment |
1127 | 1127 | if ($object->paye == 0 && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) { |
1128 | - print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='. $object->id, ''); |
|
1128 | + print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='.$object->id, ''); |
|
1129 | 1129 | } |
1130 | 1130 | |
1131 | 1131 | // Classify 'paid' |
@@ -24,24 +24,24 @@ discard block |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | // Put here all includes required by your class file |
27 | -include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php'; |
|
28 | - |
|
29 | -require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; |
|
30 | -require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; |
|
31 | - |
|
32 | -require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal |
|
33 | -require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Sale Order |
|
34 | -require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice |
|
35 | -require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address |
|
36 | -require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery |
|
37 | -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Purchase Order |
|
38 | -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice |
|
39 | -require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project |
|
40 | -require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception |
|
41 | -require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting |
|
42 | -require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party |
|
43 | -require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal |
|
44 | -require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket |
|
27 | +include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; |
|
28 | + |
|
29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
31 | + |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Customer Proposal |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // Sale Order |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Customer Invoice |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Contact / Address |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipping / Delivery |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Purchase Order |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Project |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // Reception |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Third-Party |
|
43 | +require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal |
|
44 | +require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; // Ticket |
|
45 | 45 | //require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report |
46 | 46 | //require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request) |
47 | 47 | |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | } elseif (empty($this->imap_encryption) || ($this->imap_encryption == 'ssl' && getDolGlobalString('IMAP_FORCE_NOSSL'))) { |
794 | 794 | $flags .= ''; |
795 | 795 | } else { |
796 | - $flags .= '/' . $this->imap_encryption; |
|
796 | + $flags .= '/'.$this->imap_encryption; |
|
797 | 797 | } |
798 | 798 | |
799 | 799 | $flags .= '/novalidate-cert'; |
@@ -823,8 +823,8 @@ discard block |
||
823 | 823 | { |
824 | 824 | if (function_exists('mb_convert_encoding')) { |
825 | 825 | // change spaces by entropy because mb_convert fail with spaces |
826 | - $str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
|
827 | - $str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
|
826 | + $str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
|
827 | + $str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
|
828 | 828 | // if mb_convert work |
829 | 829 | if ($str = mb_convert_encoding($str, "UTF-7")) { |
830 | 830 | // change characters |
@@ -1431,7 +1431,7 @@ discard block |
||
1431 | 1431 | } |
1432 | 1432 | |
1433 | 1433 | if ($rule['type'] == 'from') { |
1434 | - $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1434 | + $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1435 | 1435 | if (count($tmprulevaluearray) >= 2) { |
1436 | 1436 | foreach ($tmprulevaluearray as $tmprulevalue) { |
1437 | 1437 | $search .= ($search ? ' ' : '').$not.'FROM "'.str_replace('"', '', $tmprulevalue).'"'; |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | } |
1442 | 1442 | } |
1443 | 1443 | if ($rule['type'] == 'to') { |
1444 | - $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1444 | + $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1445 | 1445 | if (count($tmprulevaluearray) >= 2) { |
1446 | 1446 | foreach ($tmprulevaluearray as $tmprulevalue) { |
1447 | 1447 | $search .= ($search ? ' ' : '').$not.'TO "'.str_replace('"', '', $tmprulevalue).'"'; |
@@ -1604,7 +1604,7 @@ discard block |
||
1604 | 1604 | } |
1605 | 1605 | } |
1606 | 1606 | |
1607 | - $arrayofemailtodelete = array(); // Track email to delete to make the deletion at end. |
|
1607 | + $arrayofemailtodelete = array(); // Track email to delete to make the deletion at end. |
|
1608 | 1608 | |
1609 | 1609 | // Loop on each email found |
1610 | 1610 | if (!$error && !empty($arrayofemail) && count($arrayofemail) > 0) { |
@@ -1801,7 +1801,7 @@ discard block |
||
1801 | 1801 | $attachments = []; |
1802 | 1802 | } |
1803 | 1803 | } else { |
1804 | - $this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments |
|
1804 | + $this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments |
|
1805 | 1805 | } |
1806 | 1806 | //print $plainmsg; |
1807 | 1807 | //var_dump($plainmsg); exit; |
@@ -2242,7 +2242,7 @@ discard block |
||
2242 | 2242 | |
2243 | 2243 | // Make Operation |
2244 | 2244 | dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id); |
2245 | - dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object |
|
2245 | + dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object |
|
2246 | 2246 | |
2247 | 2247 | $actioncode = 'EMAIL_IN'; |
2248 | 2248 | // If we scan the Sent box, we use the code for out email |
@@ -2478,11 +2478,11 @@ discard block |
||
2478 | 2478 | $result = $contactstatic->fetch(0, null, '', $from); |
2479 | 2479 | if ($result < 0) { |
2480 | 2480 | $errorforactions++; |
2481 | - $this->error = 'Error when getting contact with email ' . $from; |
|
2481 | + $this->error = 'Error when getting contact with email '.$from; |
|
2482 | 2482 | $this->errors[] = $this->error; |
2483 | 2483 | break; |
2484 | 2484 | } elseif ($result == 0) { |
2485 | - dol_syslog("Contact with email " . $from . " was not found. We try to create it."); |
|
2485 | + dol_syslog("Contact with email ".$from." was not found. We try to create it."); |
|
2486 | 2486 | $contactstatic = new Contact($this->db); |
2487 | 2487 | |
2488 | 2488 | // Create contact |
@@ -2497,28 +2497,28 @@ discard block |
||
2497 | 2497 | } else { |
2498 | 2498 | // Search country by name or code |
2499 | 2499 | if (!empty($contactstatic->country)) { |
2500 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2500 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
2501 | 2501 | $result = getCountry('', 3, $this->db, '', 1, $contactstatic->country); |
2502 | 2502 | if ($result == 'NotDefined') { |
2503 | 2503 | $errorforactions++; |
2504 | - $this->error = "Error country not found by this name '" . $contactstatic->country . "'"; |
|
2504 | + $this->error = "Error country not found by this name '".$contactstatic->country."'"; |
|
2505 | 2505 | } elseif (!($result > 0)) { |
2506 | 2506 | $errorforactions++; |
2507 | - $this->error = "Error when search country by this name '" . $contactstatic->country . "'"; |
|
2507 | + $this->error = "Error when search country by this name '".$contactstatic->country."'"; |
|
2508 | 2508 | $this->errors[] = $this->db->lasterror(); |
2509 | 2509 | } else { |
2510 | 2510 | $contactstatic->country_id = $result; |
2511 | 2511 | $operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result); |
2512 | 2512 | } |
2513 | 2513 | } elseif (!empty($contactstatic->country_code)) { |
2514 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2514 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
2515 | 2515 | $result = getCountry($contactstatic->country_code, 3, $this->db); |
2516 | 2516 | if ($result == 'NotDefined') { |
2517 | 2517 | $errorforactions++; |
2518 | - $this->error = "Error country not found by this code '" . $contactstatic->country_code . "'"; |
|
2518 | + $this->error = "Error country not found by this code '".$contactstatic->country_code."'"; |
|
2519 | 2519 | } elseif (!($result > 0)) { |
2520 | 2520 | $errorforactions++; |
2521 | - $this->error = "Error when search country by this code '" . $contactstatic->country_code . "'"; |
|
2521 | + $this->error = "Error when search country by this code '".$contactstatic->country_code."'"; |
|
2522 | 2522 | $this->errors[] = $this->db->lasterror(); |
2523 | 2523 | } else { |
2524 | 2524 | $contactstatic->country_id = $result; |
@@ -2529,28 +2529,28 @@ discard block |
||
2529 | 2529 | if (!$errorforactions) { |
2530 | 2530 | // Search state by name or code (for country if defined) |
2531 | 2531 | if (!empty($contactstatic->state)) { |
2532 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
2532 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
|
2533 | 2533 | $result = dol_getIdFromCode($this->db, $contactstatic->state, 'c_departements', 'nom', 'rowid'); |
2534 | 2534 | if (empty($result)) { |
2535 | 2535 | $errorforactions++; |
2536 | - $this->error = "Error state not found by this name '" . $contactstatic->state . "'"; |
|
2536 | + $this->error = "Error state not found by this name '".$contactstatic->state."'"; |
|
2537 | 2537 | } elseif (!($result > 0)) { |
2538 | 2538 | $errorforactions++; |
2539 | - $this->error = "Error when search state by this name '" . $contactstatic->state . "'"; |
|
2539 | + $this->error = "Error when search state by this name '".$contactstatic->state."'"; |
|
2540 | 2540 | $this->errors[] = $this->db->lasterror(); |
2541 | 2541 | } else { |
2542 | 2542 | $contactstatic->state_id = $result; |
2543 | 2543 | $operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result); |
2544 | 2544 | } |
2545 | 2545 | } elseif (!empty($contactstatic->state_code)) { |
2546 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
2546 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
|
2547 | 2547 | $result = dol_getIdFromCode($this->db, $contactstatic->state_code, 'c_departements', 'code_departement', 'rowid'); |
2548 | 2548 | if (empty($result)) { |
2549 | 2549 | $errorforactions++; |
2550 | - $this->error = "Error state not found by this code '" . $contactstatic->state_code . "'"; |
|
2550 | + $this->error = "Error state not found by this code '".$contactstatic->state_code."'"; |
|
2551 | 2551 | } elseif (!($result > 0)) { |
2552 | 2552 | $errorforactions++; |
2553 | - $this->error = "Error when search state by this code '" . $contactstatic->state_code . "'"; |
|
2553 | + $this->error = "Error when search state by this code '".$contactstatic->state_code."'"; |
|
2554 | 2554 | $this->errors[] = $this->db->lasterror(); |
2555 | 2555 | } else { |
2556 | 2556 | $contactstatic->state_id = $result; |
@@ -2613,8 +2613,8 @@ discard block |
||
2613 | 2613 | $actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from; |
2614 | 2614 | $actioncomm->note_private = $descriptionfull; |
2615 | 2615 | $actioncomm->fk_project = $projectstatic->id; |
2616 | - $actioncomm->datep = $date; // date of email |
|
2617 | - $actioncomm->datef = $date; // date of email |
|
2616 | + $actioncomm->datep = $date; // date of email |
|
2617 | + $actioncomm->datef = $date; // date of email |
|
2618 | 2618 | $actioncomm->percentage = -1; // Not applicable |
2619 | 2619 | $actioncomm->socid = $thirdpartystatic->id; |
2620 | 2620 | $actioncomm->contact_id = $contactstatic->id; |
@@ -2821,7 +2821,7 @@ discard block |
||
2821 | 2821 | } |
2822 | 2822 | $hookmanager->initHooks(array('emailcolector')); |
2823 | 2823 | $parameters = array('arrayobject' => $arrayobject); |
2824 | - $reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks |
|
2824 | + $reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks |
|
2825 | 2825 | if ($reshook > 0) { |
2826 | 2826 | $arrayobject = $hookmanager->resArray; |
2827 | 2827 | } |
@@ -2830,10 +2830,10 @@ discard block |
||
2830 | 2830 | |
2831 | 2831 | foreach ($arrayobject as $key => $objectdesc) { |
2832 | 2832 | $sql = 'SELECT DISTINCT t.rowid '; |
2833 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $objectdesc['table'] . ' AS t'; |
|
2833 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$objectdesc['table'].' AS t'; |
|
2834 | 2834 | $sql .= ' WHERE '; |
2835 | 2835 | foreach ($objectdesc['fields'] as $field) { |
2836 | - $sql .= "'" .$this->db->escape($subject) . "' LIKE CONCAT('%', t." . $field . ", '%') OR "; |
|
2836 | + $sql .= "'".$this->db->escape($subject)."' LIKE CONCAT('%', t.".$field.", '%') OR "; |
|
2837 | 2837 | } |
2838 | 2838 | $sql = substr($sql, 0, -4); |
2839 | 2839 | |
@@ -2853,8 +2853,8 @@ discard block |
||
2853 | 2853 | foreach ($ids as $val) { |
2854 | 2854 | $res = $objectmanaged->fetch($val); |
2855 | 2855 | if ($res) { |
2856 | - $path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : ''); |
|
2857 | - $dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/'; |
|
2856 | + $path = ($objectmanaged->entity > 1 ? "/".$objectmanaged->entity : ''); |
|
2857 | + $dirs[] = DOL_DATA_ROOT.$path."/".$elementpath.'/'.dol_sanitizeFileName($objectmanaged->ref).'/'; |
|
2858 | 2858 | } else { |
2859 | 2859 | $this->errors[] = 'object not found'; |
2860 | 2860 | } |
@@ -2863,7 +2863,7 @@ discard block |
||
2863 | 2863 | foreach ($dirs as $target) { |
2864 | 2864 | $prefix = $this->actions[$this->id]['actionparam']; |
2865 | 2865 | foreach ($data as $filename => $content) { |
2866 | - $resr = saveAttachment($target, $prefix . '_' . $filename, $content); |
|
2866 | + $resr = saveAttachment($target, $prefix.'_'.$filename, $content); |
|
2867 | 2867 | if ($resr == -1) { |
2868 | 2868 | $this->errors[] = 'Doc not saved'; |
2869 | 2869 | } |
@@ -2910,7 +2910,7 @@ discard block |
||
2910 | 2910 | $percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent'); |
2911 | 2911 | |
2912 | 2912 | $projecttocreate->title = $subject; |
2913 | - $projecttocreate->date_start = $date; // date of email |
|
2913 | + $projecttocreate->date_start = $date; // date of email |
|
2914 | 2914 | $projecttocreate->date_end = 0; |
2915 | 2915 | $projecttocreate->opp_status = $id_opp_status; |
2916 | 2916 | $projecttocreate->opp_percent = $percent_opp_status; |
@@ -3177,7 +3177,7 @@ discard block |
||
3177 | 3177 | $candidaturetocreate->note_private = $descriptionfull; |
3178 | 3178 | $candidaturetocreate->entity = $conf->entity; |
3179 | 3179 | $candidaturetocreate->email_msgid = $msgid; |
3180 | - $candidaturetocreate->email_date = $date; // date of email |
|
3180 | + $candidaturetocreate->email_date = $date; // date of email |
|
3181 | 3181 | $candidaturetocreate->status = $candidaturetocreate::STATUS_DRAFT; |
3182 | 3182 | //$candidaturetocreate->fk_contact = $contactstatic->id; |
3183 | 3183 | |
@@ -3543,8 +3543,8 @@ discard block |
||
3543 | 3543 | * append increment number to the original filename |
3544 | 3544 | */ |
3545 | 3545 | while (file_exists($destdir.$file_name.".".$extension)) { |
3546 | - $file_name = $file_name_original . ' (' . $num . ')'; |
|
3547 | - $file_name_complete = $file_name . "." . $extension; |
|
3546 | + $file_name = $file_name_original.' ('.$num.')'; |
|
3547 | + $file_name_complete = $file_name.".".$extension; |
|
3548 | 3548 | $destination = $destdir.$file_name_complete; |
3549 | 3549 | $num++; |
3550 | 3550 | } |
@@ -3678,7 +3678,7 @@ discard block |
||
3678 | 3678 | */ |
3679 | 3679 | private function saveAttachment($destdir, $filename, $content) |
3680 | 3680 | { |
3681 | - require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; |
|
3681 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
3682 | 3682 | |
3683 | 3683 | $tmparraysize = getDefaultImageSizes(); |
3684 | 3684 | $maxwidthsmall = $tmparraysize['maxwidthsmall']; |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | $sql .= ", login = ".($this->login ? "'".$this->db->escape($this->login)."'" : "null"); |
788 | 788 | $sql .= ", societe = ".($this->company ? "'".$this->db->escape($this->company)."'" : ($this->societe ? "'".$this->db->escape($this->societe)."'" : "null")); |
789 | 789 | if ($this->socid) { |
790 | - $sql .= ", fk_soc = ".($this->socid > 0 ? (int) $this->socid : "null"); // Must be modified only when creating from a third-party |
|
790 | + $sql .= ", fk_soc = ".($this->socid > 0 ? (int) $this->socid : "null"); // Must be modified only when creating from a third-party |
|
791 | 791 | } |
792 | 792 | $sql .= ", address = ".($this->address ? "'".$this->db->escape($this->address)."'" : "null"); |
793 | 793 | $sql .= ", zip = ".($this->zip ? "'".$this->db->escape($this->zip)."'" : "null"); |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | $datas['divopen'] = '<div class="centpercent">'; |
2270 | 2270 | $datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Member").'</u> '.$this->getLibStatut(4); |
2271 | 2271 | if (!empty($this->morphy)) { |
2272 | - $datas['picto'] .= ' ' . $this->getmorphylib('', 1); |
|
2272 | + $datas['picto'] .= ' '.$this->getmorphylib('', 1); |
|
2273 | 2273 | } |
2274 | 2274 | if (!empty($this->ref)) { |
2275 | 2275 | $datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; |
@@ -2289,9 +2289,9 @@ discard block |
||
2289 | 2289 | $datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs); |
2290 | 2290 | // show categories for this record only in ajax to not overload lists |
2291 | 2291 | if (isModEnabled('category') && !$nofetch) { |
2292 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
2292 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
2293 | 2293 | $form = new Form($this->db); |
2294 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1); |
|
2294 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_MEMBER, 1); |
|
2295 | 2295 | } |
2296 | 2296 | $datas['divclose'] = '</div>'; |
2297 | 2297 | |
@@ -2421,7 +2421,7 @@ discard block |
||
2421 | 2421 | } |
2422 | 2422 | } |
2423 | 2423 | global $action; |
2424 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
2424 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
2425 | 2425 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
2426 | 2426 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
2427 | 2427 | if ($reshook > 0) { |
@@ -2730,13 +2730,13 @@ discard block |
||
2730 | 2730 | global $conf; |
2731 | 2731 | $dn = ''; |
2732 | 2732 | if ($mode == 0) { |
2733 | - $dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]."," . getDolGlobalString('LDAP_MEMBER_DN'); |
|
2733 | + $dn = getDolGlobalString('LDAP_KEY_MEMBERS')."=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')].",".getDolGlobalString('LDAP_MEMBER_DN'); |
|
2734 | 2734 | } |
2735 | 2735 | if ($mode == 1) { |
2736 | 2736 | $dn = getDolGlobalString('LDAP_MEMBER_DN'); |
2737 | 2737 | } |
2738 | 2738 | if ($mode == 2) { |
2739 | - $dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]; |
|
2739 | + $dn = getDolGlobalString('LDAP_KEY_MEMBERS')."=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]; |
|
2740 | 2740 | } |
2741 | 2741 | return $dn; |
2742 | 2742 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $action = GETPOST('action', 'aZ09'); |
46 | 46 | $massaction = GETPOST('massaction', 'alpha'); |
47 | 47 | $cancel = GETPOST('cancel', 'alpha'); |
48 | -$toselect = GETPOST('toselect', 'array'); |
|
48 | +$toselect = GETPOST('toselect', 'array'); |
|
49 | 49 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
50 | 50 | $backtopage = GETPOST('backtopage', 'alpha'); |
51 | 51 | $mode = GETPOST('mode', 'alpha'); |
@@ -70,10 +70,10 @@ |
||
70 | 70 | if (is_array($generatedContent) && $generatedContent['error']) { |
71 | 71 | // client errors |
72 | 72 | if ($generatedContent['code'] >= 400) { |
73 | - print "Error : " . $generatedContent['message']; |
|
73 | + print "Error : ".$generatedContent['message']; |
|
74 | 74 | print '<br><a href="'.DOL_MAIN_URL_ROOT.'/ai/admin/setup.php">'.$langs->trans('Check Config of Module').'</a>'; |
75 | 75 | } else { |
76 | - print "Error returned by API call: " . $generatedContent['message']; |
|
76 | + print "Error returned by API call: ".$generatedContent['message']; |
|
77 | 77 | } |
78 | 78 | } else { |
79 | 79 | print $generatedContent; |