@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | "confirmation_method" => $mode, |
473 | 473 | "amount" => $stripeamount, |
474 | 474 | "currency" => $currency_code, |
475 | - "payment_method_types" => $paymentmethodtypes, // When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard |
|
475 | + "payment_method_types" => $paymentmethodtypes, // When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard |
|
476 | 476 | /* |
477 | 477 | 'return_url' => $dolibarr_main_url_root.'/public/payment/paymentok.php', |
478 | 478 | 'automatic_payment_methods' => array( |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | ); |
488 | 488 | if ($descriptor) { |
489 | 489 | $dataforintent["statement_descriptor_suffix"] = $descriptor; // For card payment, 22 chars that appears on bank receipt (prefix into stripe setup + this suffix) |
490 | - $dataforintent["statement_descriptor"] = $descriptor; // For SEPA, it will take only statement_descriptor, not statement_descriptor_suffix |
|
490 | + $dataforintent["statement_descriptor"] = $descriptor; // For SEPA, it will take only statement_descriptor, not statement_descriptor_suffix |
|
491 | 491 | } |
492 | 492 | if (!is_null($customer)) { |
493 | 493 | $dataforintent["customer"] = $customer; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | |
697 | 697 | $dataforintent = array( |
698 | 698 | "confirm" => $confirmnow, // Do not confirm immediatly during creation of intent |
699 | - "payment_method_types" => $paymentmethodtypes, // When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard |
|
699 | + "payment_method_types" => $paymentmethodtypes, // When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard |
|
700 | 700 | /* |
701 | 701 | 'return_url' => $dolibarr_main_url_root.'/public/payment/paymentok.php', |
702 | 702 | 'automatic_payment_methods' => array( |
@@ -1028,19 +1028,19 @@ discard block |
||
1028 | 1028 | ); |
1029 | 1029 | // Complete owner name |
1030 | 1030 | if (!empty($soc->town)) { |
1031 | - $dataforcard['billing_details']['address']['city']=$soc->town; |
|
1031 | + $dataforcard['billing_details']['address']['city'] = $soc->town; |
|
1032 | 1032 | } |
1033 | 1033 | if (!empty($soc->country_code)) { |
1034 | - $dataforcard['billing_details']['address']['country']=$soc->country_code; |
|
1034 | + $dataforcard['billing_details']['address']['country'] = $soc->country_code; |
|
1035 | 1035 | } |
1036 | 1036 | if (!empty($soc->address)) { |
1037 | - $dataforcard['billing_details']['address']['line1']=$soc->address; |
|
1037 | + $dataforcard['billing_details']['address']['line1'] = $soc->address; |
|
1038 | 1038 | } |
1039 | 1039 | if (!empty($soc->zip)) { |
1040 | - $dataforcard['billing_details']['address']['postal_code']=$soc->zip; |
|
1040 | + $dataforcard['billing_details']['address']['postal_code'] = $soc->zip; |
|
1041 | 1041 | } |
1042 | 1042 | if (!empty($soc->state)) { |
1043 | - $dataforcard['billing_details']['address']['state']=$soc->state; |
|
1043 | + $dataforcard['billing_details']['address']['state'] = $soc->state; |
|
1044 | 1044 | } |
1045 | 1045 | |
1046 | 1046 | //$a = \Stripe\Stripe::getApiKey(); |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib"; |
1089 | 1089 | $sql .= " SET stripe_card_ref = '".$this->db->escape($sepa->id)."',"; |
1090 | 1090 | $sql .= " card_type = 'sepa_debit',"; |
1091 | - $sql .= " stripe_account= '" . $this->db->escape($cu->id . "@" . $stripeacc) . "',"; |
|
1091 | + $sql .= " stripe_account= '".$this->db->escape($cu->id."@".$stripeacc)."',"; |
|
1092 | 1092 | $sql .= " ext_payment_site = '".$this->db->escape($service)."'"; |
1093 | 1093 | if (!empty($cs->mandate)) { |
1094 | 1094 | $mandateservice = new \Stripe\Mandate($stripeacc); |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | } catch (Exception $e) { |
1113 | 1113 | $sepa = null; |
1114 | 1114 | $this->error = 'Stripe error: '.$e->getMessage().'. Check the BAN information.'; |
1115 | - dol_syslog($this->error, LOG_WARNING); // Error from Stripe, so a warning on Dolibarr |
|
1115 | + dol_syslog($this->error, LOG_WARNING); // Error from Stripe, so a warning on Dolibarr |
|
1116 | 1116 | } |
1117 | 1117 | } |
1118 | 1118 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $pastmonth = $dates['pastmonth']; |
104 | 104 | } |
105 | 105 | if (getDolGlobalString('ACCOUNTANCY_JOURNAL_USE_CURRENT_MONTH')) { |
106 | - $pastmonth+=1; |
|
106 | + $pastmonth += 1; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd"; |
134 | 134 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; |
135 | 135 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
136 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
136 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
137 | 137 | } |
138 | 138 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; |
139 | 139 | $sql .= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture"; |
140 | 140 | $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
141 | 141 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
142 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
142 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
143 | 143 | } |
144 | 144 | $parameters = array(); |
145 | 145 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | //$compta_revenuestamp = getDolGlobalString('ACCOUNTING_REVENUESTAMP_SOLD_ACCOUNT', 'NotDefined'); |
216 | 216 | |
217 | - $tax_id = $obj->tva_tx . ($obj->vat_src_code ? ' (' . $obj->vat_src_code . ')' : ''); |
|
217 | + $tax_id = $obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''); |
|
218 | 218 | if (array_key_exists($tax_id, $vatdata_cache)) { |
219 | 219 | $vatdata = $vatdata_cache[$tax_id]; |
220 | 220 | } else { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | // Move a part of the retained warrenty into the account of warranty |
293 | 293 | if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY') && $obj->retained_warranty > 0) { |
294 | - $retained_warranty = (double) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value) |
|
294 | + $retained_warranty = (double) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value) |
|
295 | 295 | $tabwarranty[$obj->rowid][$compta_soc] += $retained_warranty; |
296 | 296 | $total_ttc -= $retained_warranty; |
297 | 297 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY'); |
483 | 483 | $bookkeeping->label_compte = $accountingaccountcustomerwarranty->label; |
484 | 484 | |
485 | - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Retainedwarranty"); |
|
485 | + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty"); |
|
486 | 486 | $bookkeeping->montant = $mt; |
487 | 487 | $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; |
488 | 488 | $bookkeeping->debit = ($mt >= 0) ? $mt : 0; |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | } else { |
562 | 562 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { |
563 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; |
|
563 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; |
|
564 | 564 | $lettering_static = new Lettering($db); |
565 | 565 | |
566 | 566 | $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | // Product / Service |
573 | 573 | if (!$errorforline) { |
574 | 574 | foreach ($tabht[$key] as $k => $mt) { |
575 | - $resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
575 | + $resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
576 | 576 | $label_account = $accountingaccount->label; |
577 | 577 | |
578 | 578 | // get compte id and label |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | |
649 | 649 | foreach ($arrayofvat[$key] as $k => $mt) { |
650 | 650 | if ($mt) { |
651 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
651 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
652 | 652 | $label_account = $accountingaccount->label; |
653 | 653 | |
654 | 654 | $bookkeeping = new BookKeeping($db); |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | if (is_iterable($tabrevenuestamp[$key])) { |
710 | 710 | foreach ($tabrevenuestamp[$key] as $k => $mt) { |
711 | 711 | if ($mt) { |
712 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
712 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
713 | 713 | $label_account = $accountingaccount->label; |
714 | 714 | |
715 | 715 | $bookkeeping = new BookKeeping($db); |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | $bookkeeping->numero_compte = $k; |
729 | 729 | $bookkeeping->label_compte = $label_account; |
730 | 730 | |
731 | - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("RevenueStamp"); |
|
731 | + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref.' - '.$langs->trans("RevenueStamp"); |
|
732 | 732 | $bookkeeping->montant = $mt; |
733 | 733 | $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; |
734 | 734 | $bookkeeping->debit = ($mt < 0) ? -$mt : 0; |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | foreach ($tabfac as $key => $val) { |
831 | 831 | $companystatic->id = $tabcompany[$key]['id']; |
832 | 832 | $companystatic->name = $tabcompany[$key]['name']; |
833 | - $companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated |
|
833 | + $companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated |
|
834 | 834 | $companystatic->code_compta_client = $tabcompany[$key]['code_compta']; |
835 | 835 | $companystatic->code_client = $tabcompany[$key]['code_client']; |
836 | 836 | $companystatic->client = 3; |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); |
996 | 996 | |
997 | 997 | // Button to write into Ledger |
998 | - $acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['','-1']); |
|
998 | + $acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['', '-1']); |
|
999 | 999 | if ($acctCustomerNotConfigured) { |
1000 | 1000 | print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
1001 | 1001 | $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
@@ -1129,13 +1129,13 @@ discard block |
||
1129 | 1129 | foreach ($tabwarranty[$key] as $k => $mt) { |
1130 | 1130 | print '<tr class="oddeven">'; |
1131 | 1131 | print "<!-- Thirdparty warranty -->"; |
1132 | - print "<td>" . $date . "</td>"; |
|
1133 | - print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; |
|
1132 | + print "<td>".$date."</td>"; |
|
1133 | + print "<td>".$invoicestatic->getNomUrl(1)."</td>"; |
|
1134 | 1134 | // Account |
1135 | 1135 | print "<td>"; |
1136 | 1136 | $accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY')); |
1137 | 1137 | if (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1138 | - print '<span class="error">' . $langs->trans("MainAccountForRetainedWarrantyNotDefined") . '</span>'; |
|
1138 | + print '<span class="error">'.$langs->trans("MainAccountForRetainedWarrantyNotDefined").'</span>'; |
|
1139 | 1139 | } else { |
1140 | 1140 | print $accountoshow; |
1141 | 1141 | } |
@@ -1144,14 +1144,14 @@ discard block |
||
1144 | 1144 | print "<td>"; |
1145 | 1145 | $accountoshow = length_accounta($k); |
1146 | 1146 | if (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1147 | - print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>'; |
|
1147 | + print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>'; |
|
1148 | 1148 | } else { |
1149 | 1149 | print $accountoshow; |
1150 | 1150 | } |
1151 | 1151 | print '</td>'; |
1152 | - print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Retainedwarranty") . "</td>"; |
|
1153 | - print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1154 | - print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1152 | + print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty")."</td>"; |
|
1153 | + print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1154 | + print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1155 | 1155 | print "</tr>"; |
1156 | 1156 | } |
1157 | 1157 | } |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | print length_accounta($tabcompany[$key]['code_compta']); |
1214 | 1214 | } |
1215 | 1215 | } elseif (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1216 | - print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>'; |
|
1216 | + print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>'; |
|
1217 | 1217 | } |
1218 | 1218 | print '</td>'; |
1219 | 1219 | $companystatic->id = $tabcompany[$key]['id']; |
@@ -1277,13 +1277,13 @@ discard block |
||
1277 | 1277 | foreach ($tabrevenuestamp[$key] as $k => $mt) { |
1278 | 1278 | print '<tr class="oddeven">'; |
1279 | 1279 | print "<!-- Thirdparty revenuestamp -->"; |
1280 | - print "<td>" . $date . "</td>"; |
|
1281 | - print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; |
|
1280 | + print "<td>".$date."</td>"; |
|
1281 | + print "<td>".$invoicestatic->getNomUrl(1)."</td>"; |
|
1282 | 1282 | // Account |
1283 | 1283 | print "<td>"; |
1284 | 1284 | $accountoshow = length_accountg($k); |
1285 | 1285 | if (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1286 | - print '<span class="error">' . $langs->trans("MainAccountForRevenueStampSaleNotDefined") . '</span>'; |
|
1286 | + print '<span class="error">'.$langs->trans("MainAccountForRevenueStampSaleNotDefined").'</span>'; |
|
1287 | 1287 | } else { |
1288 | 1288 | print $accountoshow; |
1289 | 1289 | } |
@@ -1291,9 +1291,9 @@ discard block |
||
1291 | 1291 | // Subledger account |
1292 | 1292 | print "<td>"; |
1293 | 1293 | print '</td>'; |
1294 | - print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("RevenueStamp") . "</td>"; |
|
1295 | - print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1296 | - print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1294 | + print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("RevenueStamp")."</td>"; |
|
1295 | + print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1296 | + print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1297 | 1297 | print "</tr>"; |
1298 | 1298 | } |
1299 | 1299 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | } |
323 | 323 | } |
324 | 324 | if ($emailtoadd && preg_match('/'.preg_quote($emailtoadd, '/').'/i', $to)) { |
325 | - $emailtoadd = ''; // Email already in the "To" |
|
325 | + $emailtoadd = ''; // Email already in the "To" |
|
326 | 326 | } |
327 | 327 | if ($emailtoadd) { |
328 | 328 | $listofemailstoadd[$key] = $emailtoadd; |
@@ -985,19 +985,19 @@ discard block |
||
985 | 985 | $res = true; |
986 | 986 | $from = $this->smtps->getFrom('org'); |
987 | 987 | if ($res && !$from) { |
988 | - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid"; |
|
988 | + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid"; |
|
989 | 989 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
990 | 990 | $res = false; |
991 | 991 | } |
992 | 992 | $dest = $this->smtps->getTo(); |
993 | 993 | if ($res && !$dest) { |
994 | - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid"; |
|
994 | + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid"; |
|
995 | 995 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
996 | 996 | $res = false; |
997 | 997 | } |
998 | 998 | |
999 | 999 | if ($res) { |
1000 | - dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1000 | + dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1001 | 1001 | |
1002 | 1002 | if (!empty($conf->global->MAIN_MAIL_DEBUG)) { |
1003 | 1003 | $this->smtps->setDebug(true); |
@@ -1010,8 +1010,8 @@ discard block |
||
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | $smtperrorcode = 0; |
1013 | - if (! $result) { |
|
1014 | - $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1013 | + if (!$result) { |
|
1014 | + $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1015 | 1015 | dol_syslog("CMailFile::sendfile: mail SMTP error code ".$smtperrorcode, LOG_WARNING); |
1016 | 1016 | |
1017 | 1017 | if ($smtperrorcode == '421') { // Try later |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | } |
1030 | 1030 | } |
1031 | 1031 | |
1032 | - $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1032 | + $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1033 | 1033 | if (empty($this->error) && empty($result)) { |
1034 | 1034 | dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG); |
1035 | 1035 | $res = true; |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | if (empty($this->error)) { |
1038 | 1038 | $this->error = $result; |
1039 | 1039 | } |
1040 | - dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR); |
|
1040 | + dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR); |
|
1041 | 1041 | $res = false; |
1042 | 1042 | |
1043 | 1043 | if (!empty($conf->global->MAIN_MAIL_DEBUG)) { |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; |
1092 | 1092 | |
1093 | 1093 | $OAUTH_SERVICENAME = 'Unknown'; |
1094 | - if ( array_key_exists($keyforsupportedoauth2array, $supportedoauth2array) |
|
1094 | + if (array_key_exists($keyforsupportedoauth2array, $supportedoauth2array) |
|
1095 | 1095 | && array_key_exists('name', $supportedoauth2array[$keyforsupportedoauth2array]) |
1096 | 1096 | && !empty($supportedoauth2array[$keyforsupportedoauth2array]['name'])) { |
1097 | 1097 | $OAUTH_SERVICENAME = $supportedoauth2array[$keyforsupportedoauth2array]['name'].(!empty($keyforprovider) ? '-'.$keyforprovider : ''); |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger)); |
1167 | 1167 | } |
1168 | 1168 | |
1169 | - dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1169 | + dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1170 | 1170 | |
1171 | 1171 | // send mail |
1172 | 1172 | $failedRecipients = array(); |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | $res = true; |
1183 | 1183 | if (!empty($this->error) || !empty($this->errors) || !$result) { |
1184 | 1184 | if (!empty($failedRecipients)) { |
1185 | - $this->errors[] = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".'; |
|
1185 | + $this->errors[] = 'Transport failed for the following addresses: "'.join('", "', $failedRecipients).'".'; |
|
1186 | 1186 | } |
1187 | 1187 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
1188 | 1188 | $res = false; |
@@ -1276,7 +1276,7 @@ discard block |
||
1276 | 1276 | |
1277 | 1277 | if (@is_writeable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir |
1278 | 1278 | $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; |
1279 | - $fp = fopen($outputfile, "w"); // overwrite |
|
1279 | + $fp = fopen($outputfile, "w"); // overwrite |
|
1280 | 1280 | |
1281 | 1281 | if ($this->sendmode == 'mail') { |
1282 | 1282 | fputs($fp, $this->headers); |
@@ -1535,7 +1535,7 @@ discard block |
||
1535 | 1535 | // Similar code to forge a text from html is also in smtps.class.php |
1536 | 1536 | $strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent); |
1537 | 1537 | // TODO We could replace <img ...> with [Filename.ext] like Gmail do. |
1538 | - $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1538 | + $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1539 | 1539 | $strContentAltText = trim(wordwrap($strContentAltText, 75, empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA) ? "\r\n" : "\n")); |
1540 | 1540 | |
1541 | 1541 | // Check if html header already in message, if not complete the message |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | // We save the image to send in disk |
1918 | 1918 | $filecontent = $matches[2][$key]; |
1919 | 1919 | |
1920 | - $cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
1920 | + $cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
1921 | 1921 | |
1922 | 1922 | $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; |
1923 | 1923 |
@@ -1027,9 +1027,9 @@ discard block |
||
1027 | 1027 | // search filter on a date extrafield shows two inputs to select a date range |
1028 | 1028 | $prefill = array( |
1029 | 1029 | 'start' => isset($value['start']) ? $value['start'] : '', |
1030 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
1030 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
1031 | 1031 | ); |
1032 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1032 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1033 | 1033 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
1034 | 1034 | $out .= '</div><div class="nowrap">'; |
1035 | 1035 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1052,9 +1052,9 @@ discard block |
||
1052 | 1052 | // search filter on a date extrafield shows two inputs to select a date range |
1053 | 1053 | $prefill = array( |
1054 | 1054 | 'start' => isset($value['start']) ? $value['start'] : '', |
1055 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
1055 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
1056 | 1056 | ); |
1057 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
1057 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
1058 | 1058 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
1059 | 1059 | $out .= '</div><div class="nowrap">'; |
1060 | 1060 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | // TODO Must also support $moreparam |
1064 | 1064 | $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel'); |
1065 | 1065 | } |
1066 | - } elseif (in_array($type, array('int', 'integer'))) { |
|
1066 | + } elseif (in_array($type, array('int', 'integer'))) { |
|
1067 | 1067 | $tmp = explode(',', $size); |
1068 | 1068 | $newsize = $tmp[0]; |
1069 | 1069 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>'; |
@@ -1077,24 +1077,24 @@ discard block |
||
1077 | 1077 | $out ='<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">'; |
1078 | 1078 | $out.='<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>'; |
1079 | 1079 | */ |
1080 | - $out.= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"'; |
|
1081 | - $out.= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
|
1080 | + $out .= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"'; |
|
1081 | + $out .= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; |
|
1082 | 1082 | if (getDolGlobalInt('MAIN_ADD_ICONPICKER_JS')) { |
1083 | - $out.='<script>'; |
|
1084 | - $options="{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {"; |
|
1085 | - $options.="iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',"; |
|
1086 | - $options.="iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',"; |
|
1083 | + $out .= '<script>'; |
|
1084 | + $options = "{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {"; |
|
1085 | + $options .= "iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',"; |
|
1086 | + $options .= "iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',"; |
|
1087 | 1087 | // $options.="buttons: '<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm\">".$langs->trans("Cancel")."</button>"; |
1088 | 1088 | // $options.="<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm\">".$langs->trans("Save")."</button>',"; |
1089 | - $options.="footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',"; |
|
1090 | - $options.="search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',"; |
|
1091 | - $options.="popover: '<div class=\"iconpicker-popover popover\">"; |
|
1092 | - $options.=" <div class=\"arrow\" ></div>"; |
|
1093 | - $options.=" <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>"; |
|
1094 | - $options.=" <div class=\"popover-content \" ></div>"; |
|
1095 | - $options.="</div>'}}"; |
|
1096 | - $out.="$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; |
|
1097 | - $out.='</script>'; |
|
1089 | + $options .= "footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',"; |
|
1090 | + $options .= "search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',"; |
|
1091 | + $options .= "popover: '<div class=\"iconpicker-popover popover\">"; |
|
1092 | + $options .= " <div class=\"arrow\" ></div>"; |
|
1093 | + $options .= " <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>"; |
|
1094 | + $options .= " <div class=\"popover-content \" ></div>"; |
|
1095 | + $options .= "</div>'}}"; |
|
1096 | + $out .= "$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");"; |
|
1097 | + $out .= '</script>'; |
|
1098 | 1098 | } |
1099 | 1099 | } elseif ($type == 'text') { |
1100 | 1100 | if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field |
@@ -1625,7 +1625,7 @@ discard block |
||
1625 | 1625 | |
1626 | 1626 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
1627 | 1627 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
1628 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1628 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
1629 | 1629 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
1630 | 1630 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
1631 | 1631 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | if ($type == 'date') { |
1648 | 1648 | $showsize = 10; |
1649 | 1649 | if ($value !== '') { |
1650 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1650 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
1651 | 1651 | } |
1652 | 1652 | } elseif ($type == 'datetime') { |
1653 | 1653 | $showsize = 19; |
@@ -1791,13 +1791,13 @@ discard block |
||
1791 | 1791 | $toprint = array(); |
1792 | 1792 | $obj = $this->db->fetch_object($resql); |
1793 | 1793 | if ($obj->rowid) { |
1794 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
1794 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
1795 | 1795 | $c = new Categorie($this->db); |
1796 | 1796 | $result = $c->fetch($obj->rowid); |
1797 | 1797 | if ($result > 0) { |
1798 | 1798 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
1799 | 1799 | foreach ($ways as $way) { |
1800 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
1800 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
1801 | 1801 | } |
1802 | 1802 | } |
1803 | 1803 | } |
@@ -2009,13 +2009,13 @@ discard block |
||
2009 | 2009 | { |
2010 | 2010 | global $conf, $langs; |
2011 | 2011 | |
2012 | - $tagtype='tr'; |
|
2013 | - $tagtype_dyn='td'; |
|
2012 | + $tagtype = 'tr'; |
|
2013 | + $tagtype_dyn = 'td'; |
|
2014 | 2014 | |
2015 | - if ($display_type=='line') { |
|
2016 | - $tagtype='div'; |
|
2017 | - $tagtype_dyn='span'; |
|
2018 | - $colspan=0; |
|
2015 | + if ($display_type == 'line') { |
|
2016 | + $tagtype = 'div'; |
|
2017 | + $tagtype_dyn = 'span'; |
|
2018 | + $colspan = 0; |
|
2019 | 2019 | } |
2020 | 2020 | |
2021 | 2021 | $extrafield_param = $this->attributes[$object->table_element]['param'][$key]; |
@@ -2035,12 +2035,12 @@ discard block |
||
2035 | 2035 | if ($mode == 'create') { |
2036 | 2036 | // On create mode, force separator group to not be collapsable |
2037 | 2037 | $extrafield_collapse_display_value = 1; |
2038 | - $expand_display = true; // We force group to be shown expanded |
|
2038 | + $expand_display = true; // We force group to be shown expanded |
|
2039 | 2039 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
2040 | 2040 | } |
2041 | 2041 | |
2042 | - $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">'; |
|
2043 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>'; |
|
2042 | + $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
|
2043 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
2044 | 2044 | // Some js code will be injected here to manage the collapsing of extrafields |
2045 | 2045 | // Output the picto |
2046 | 2046 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2071,14 +2071,14 @@ discard block |
||
2071 | 2071 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2072 | 2072 | } |
2073 | 2073 | } |
2074 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n"; |
|
2074 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n"; |
|
2075 | 2075 | $out .= ' console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n"; |
2076 | 2076 | $out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n"; |
2077 | 2077 | $out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n"; |
2078 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
2078 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
2079 | 2079 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2080 | 2080 | $out .= ' } else {'."\n"; |
2081 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
2081 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
2082 | 2082 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
2083 | 2083 | $out .= ' }'."\n"; |
2084 | 2084 | $out .= ' });'."\n"; |
@@ -2122,7 +2122,7 @@ discard block |
||
2122 | 2122 | continue; |
2123 | 2123 | } |
2124 | 2124 | |
2125 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
2125 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
2126 | 2126 | //when unticking boolean field, it's not set in POST |
2127 | 2127 | continue; |
2128 | 2128 | } |
@@ -2151,7 +2151,7 @@ discard block |
||
2151 | 2151 | $onlykey === '@GETPOSTISSET' |
2152 | 2152 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
2153 | 2153 | && in_array(abs($enabled), array(2, 5)) |
2154 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
2154 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
2155 | 2155 | ) |
2156 | 2156 | ) { |
2157 | 2157 | continue; |
@@ -2278,16 +2278,16 @@ discard block |
||
2278 | 2278 | } |
2279 | 2279 | |
2280 | 2280 | if (in_array($key_type, array('date'))) { |
2281 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
2282 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
2283 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
2281 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
2282 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
2283 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
2284 | 2284 | $value_key = array(); |
2285 | 2285 | // values provided as a component year, month, day, etc. |
2286 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2287 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); |
|
2286 | + if (GETPOST($dateparamname_start.'year')) { |
|
2287 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int')); |
|
2288 | 2288 | } |
2289 | - if (GETPOST($dateparamname_start . 'year')) { |
|
2290 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); |
|
2289 | + if (GETPOST($dateparamname_start.'year')) { |
|
2290 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int')); |
|
2291 | 2291 | } |
2292 | 2292 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
2293 | 2293 | // Clean parameters |
@@ -2296,22 +2296,22 @@ discard block |
||
2296 | 2296 | continue; // Value was not provided, we should not set it. |
2297 | 2297 | } |
2298 | 2298 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
2299 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
2300 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
2301 | - if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { |
|
2299 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
2300 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
2301 | + if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) { |
|
2302 | 2302 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
2303 | - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; |
|
2304 | - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; |
|
2305 | - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; |
|
2303 | + $dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23'; |
|
2304 | + $dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59'; |
|
2305 | + $dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59'; |
|
2306 | 2306 | if ($key_type == 'datetimegmt') { |
2307 | 2307 | $value_key = array( |
2308 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), |
|
2309 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt') |
|
2308 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'gmt'), |
|
2309 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'gmt') |
|
2310 | 2310 | ); |
2311 | 2311 | } else { |
2312 | 2312 | $value_key = array( |
2313 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'), |
|
2314 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel') |
|
2313 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'tzuserrel'), |
|
2314 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int'), 'tzuserrel') |
|
2315 | 2315 | ); |
2316 | 2316 | } |
2317 | 2317 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
@@ -1431,7 +1431,7 @@ discard block |
||
1431 | 1431 | $label = $langs->trans("ShowProject"); |
1432 | 1432 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
1433 | 1433 | } |
1434 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
1434 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
1435 | 1435 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
1436 | 1436 | } else { |
1437 | 1437 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1798,7 +1798,7 @@ discard block |
||
1798 | 1798 | |
1799 | 1799 | foreach (array('internal', 'external') as $source) { |
1800 | 1800 | $tab = $origin_project->liste_contact(-1, $source); |
1801 | - if (is_array($tab) && count($tab)>0) { |
|
1801 | + if (is_array($tab) && count($tab) > 0) { |
|
1802 | 1802 | foreach ($tab as $contacttoadd) { |
1803 | 1803 | $clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger); |
1804 | 1804 | if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { |
@@ -1983,7 +1983,7 @@ discard block |
||
1983 | 1983 | if ($tableName == "actioncomm") { |
1984 | 1984 | $sql .= " SET fk_project=".$this->id; |
1985 | 1985 | $sql .= " WHERE id=".((int) $elementSelectId); |
1986 | - } elseif (in_array($tableName, ["entrepot","mrp_mo","stocktransfer_stocktransfer"])) { |
|
1986 | + } elseif (in_array($tableName, ["entrepot", "mrp_mo", "stocktransfer_stocktransfer"])) { |
|
1987 | 1987 | $sql .= " SET fk_project=".$this->id; |
1988 | 1988 | $sql .= " WHERE rowid=".((int) $elementSelectId); |
1989 | 1989 | } else { |
@@ -2413,7 +2413,7 @@ discard block |
||
2413 | 2413 | require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
2414 | 2414 | $taskstatic = new Task($this->db); |
2415 | 2415 | |
2416 | - $this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0, '', '-1', '', 0, 0, array(), 0, array(), 0, $loadRoleMode); |
|
2416 | + $this->lines = $taskstatic->getTasksArray(0, $user, $this->id, 0, 0, '', '-1', '', 0, 0, array(), 0, array(), 0, $loadRoleMode); |
|
2417 | 2417 | return 1; |
2418 | 2418 | } |
2419 | 2419 | |
@@ -2486,7 +2486,7 @@ discard block |
||
2486 | 2486 | $return .= '<br><div class="info-box-ref tdoverflowmax150 inline-block valignmiddle">'.$this->thirdparty->getNomUrl(1); |
2487 | 2487 | $return .= '</div><div class="inline-block valignmiddle">'; |
2488 | 2488 | $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone'); |
2489 | - $return .='</div>'; |
|
2489 | + $return .= '</div>'; |
|
2490 | 2490 | } |
2491 | 2491 | if (!empty($arraydata['assignedusers'])) { |
2492 | 2492 | $return .= '<br>'; |
@@ -2504,7 +2504,7 @@ discard block |
||
2504 | 2504 | $return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Author").'</span>'; |
2505 | 2505 | $return .= '<span> : '.$user->getNomUrl(1).'</span>'; |
2506 | 2506 | }*/ |
2507 | - $return .= '<br><div>'; // start div line status |
|
2507 | + $return .= '<br><div>'; // start div line status |
|
2508 | 2508 | if ($this->usage_opportunity && $this->opp_status_code) { |
2509 | 2509 | //$return .= '<br><span class="info-bo-label opacitymedium">'.$langs->trans("OpportunityStatusShort").'</span>'; |
2510 | 2510 | //$return .= '<div class="small inline-block">'.dol_trunc($langs->trans("OppStatus".$this->opp_status_code), 5).'</div>'; |
@@ -2514,7 +2514,7 @@ discard block |
||
2514 | 2514 | if (method_exists($this, 'getLibStatut')) { |
2515 | 2515 | $return .= '<div class="info-box-status small inline-block">'.$this->getLibStatut(3).'</div>'; |
2516 | 2516 | } |
2517 | - $return .= '</div>'; // end div line status |
|
2517 | + $return .= '</div>'; // end div line status |
|
2518 | 2518 | |
2519 | 2519 | $return .= '</div>'; |
2520 | 2520 | $return .= '</div>'; |
@@ -182,12 +182,12 @@ discard block |
||
182 | 182 | if (!empty($user->email)) { |
183 | 183 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
184 | 184 | } else { |
185 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
185 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
186 | 186 | } |
187 | 187 | $replyto = $sendto; |
188 | 188 | $sendtocc = ''; |
189 | 189 | if (!empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { |
190 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
190 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." should arrive in your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | if (!empty($user->email)) { |
273 | 273 | $sendto = dolGetFirstLastname($user->firstname, $user->lastname)." <".$user->email.">"; |
274 | 274 | } else { |
275 | - $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL') . '" <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
275 | + $sendto = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'" <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
276 | 276 | } |
277 | 277 | $replyto = $sendto; |
278 | 278 | $sendtocc = ''; |
279 | 279 | if (!empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) { |
280 | - $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL') . '" <' . getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
280 | + $sendtocc = getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'" <'.getDolGlobalString('ONLINE_PAYMENT_SENDEMAIL').'>'; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | $message = "A bank transfer of ".price2num($event->data->object->amount / 100)." ".$event->data->object->currency." has been done to your account the ".dol_print_date($event->data->object->arrival_date, 'dayhour'); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $db->commit(); |
318 | 318 | } elseif ($event->type == 'payment_intent.succeeded') { // Called when making payment with PaymentIntent method ($conf->global->STRIPE_USE_NEW_CHECKOUT is on). |
319 | 319 | //dol_syslog("object = ".var_export($event->data, true)); |
320 | - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; |
|
320 | + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; |
|
321 | 321 | global $stripearrayofkeysbyenv; |
322 | 322 | $error = 0; |
323 | 323 | $object = $event->data->object; |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | $paymentmethodstripeid = $object->payment_method; |
329 | 329 | $customer_id = $object->customer; |
330 | 330 | $invoice_id = ""; |
331 | - $paymentTypeId = ""; // payment type according to Stripe |
|
332 | - $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
331 | + $paymentTypeId = ""; // payment type according to Stripe |
|
332 | + $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
333 | 333 | $payment_amount = 0; |
334 | 334 | $payment_amountInDolibarr = 0; |
335 | 335 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $s = new \Stripe\StripeClient($stripeacc); |
396 | 396 | |
397 | 397 | $paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid); |
398 | - $paymentTypeId = $paymentmethodstripe->type; |
|
398 | + $paymentTypeId = $paymentmethodstripe->type; |
|
399 | 399 | if ($paymentTypeId == "ban" || $paymentTypeId == "sepa_debit") { |
400 | 400 | $paymentTypeId = "PRE"; |
401 | 401 | } elseif ($paymentTypeId == "card") { |
@@ -419,9 +419,9 @@ discard block |
||
419 | 419 | $paiement->datepaye = $now; |
420 | 420 | $paiement->date = $now; |
421 | 421 | if ($currencyCodeType == $conf->currency) { |
422 | - $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
422 | + $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
423 | 423 | } else { |
424 | - $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
424 | + $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
425 | 425 | |
426 | 426 | $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; |
427 | 427 | $ispostactionok = -1; |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | $paiement->paiementid = $paymentTypeId; |
432 | 432 | $paiement->num_payment = ''; |
433 | 433 | $paiement->note_public = ''; |
434 | - $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; |
|
435 | - $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
434 | + $paiement->note_private = 'StripeSepa payment '.dol_print_date($now, 'standard').' using '.$servicestatus.($ipaddress ? ' from ip '.$ipaddress : '').' - Transaction ID = '.$TRANSACTIONID; |
|
435 | + $paiement->ext_payment_id = $TRANSACTIONID.':'.$customer_id.'@'.$stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
436 | 436 | $paiement->ext_payment_site = $service; |
437 | 437 | |
438 | 438 | $ispaymentdone = 0; |
@@ -450,20 +450,20 @@ discard block |
||
450 | 450 | $db->begin(); |
451 | 451 | |
452 | 452 | if (!$error && !$ispaymentdone) { |
453 | - dol_syslog('* Record payment for invoice id ' . $invoice_id . '. It includes closing of invoice and regenerating document'); |
|
453 | + dol_syslog('* Record payment for invoice id '.$invoice_id.'. It includes closing of invoice and regenerating document'); |
|
454 | 454 | |
455 | 455 | // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document |
456 | 456 | $paiement_id = $paiement->create($user, 1); |
457 | 457 | if ($paiement_id < 0) { |
458 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("<br>\n", $paiement->errors); |
|
458 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').join("<br>\n", $paiement->errors); |
|
459 | 459 | $ispostactionok = -1; |
460 | 460 | $error++; |
461 | 461 | |
462 | - dol_syslog("Failed to create the payment for invoice id " . $invoice_id); |
|
462 | + dol_syslog("Failed to create the payment for invoice id ".$invoice_id); |
|
463 | 463 | } else { |
464 | 464 | $postactionmessages[] = 'Payment created'; |
465 | 465 | |
466 | - dol_syslog("The payment has been created for invoice id " . $invoice_id); |
|
466 | + dol_syslog("The payment has been created for invoice id ".$invoice_id); |
|
467 | 467 | } |
468 | 468 | } |
469 | 469 | |
@@ -493,14 +493,14 @@ discard block |
||
493 | 493 | $label = '(CustomerInvoicePayment)'; |
494 | 494 | $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $customer_id, ''); |
495 | 495 | if ($result < 0) { |
496 | - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("<br>\n", $paiement->errors); |
|
496 | + $postactionmessages[] = $paiement->error.($paiement->error ? ' ' : '').join("<br>\n", $paiement->errors); |
|
497 | 497 | $ispostactionok = -1; |
498 | 498 | $error++; |
499 | 499 | } else { |
500 | 500 | $postactionmessages[] = 'Bank transaction of payment created (by ipn.php file)'; |
501 | 501 | } |
502 | 502 | } else { |
503 | - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; |
|
503 | + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; |
|
504 | 504 | $ispostactionok = -1; |
505 | 505 | $error++; |
506 | 506 | } |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | $error++; |
640 | 640 | } |
641 | 641 | |
642 | - if (! $error) { |
|
642 | + if (!$error) { |
|
643 | 643 | $db->commit(); |
644 | 644 | } else { |
645 | 645 | $db->rollback(); |