@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | print(empty($module->name) ? $name : $module->name); |
388 | 388 | print "</td><td>\n"; |
389 | 389 | if (method_exists($module, 'info')) { |
390 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
390 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
391 | 391 | } else { |
392 | 392 | print $module->description; |
393 | 393 | } |
@@ -469,22 +469,22 @@ discard block |
||
469 | 469 | if ($val['enabled'] == 1) { |
470 | 470 | $setupnotempty++; |
471 | 471 | print '<tr class="oddeven"><td>'; |
472 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
472 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
473 | 473 | print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>'; |
474 | 474 | print '</td><td>'; |
475 | 475 | |
476 | 476 | if ($val['type'] == 'textarea') { |
477 | - print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n"; |
|
477 | + print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">'."\n"; |
|
478 | 478 | print getDolGlobalString($constname); |
479 | 479 | print "</textarea>\n"; |
480 | 480 | } elseif ($val['type'] == 'html') { |
481 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
481 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
482 | 482 | $doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%'); |
483 | 483 | $doleditor->Create(); |
484 | 484 | } elseif ($val['type'] == 'yesno') { |
485 | 485 | print $form->selectyesno($constname, getDolGlobalString($constname), 1); |
486 | 486 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
487 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
487 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
488 | 488 | $formmail = new FormMail($db); |
489 | 489 | |
490 | 490 | $tmp = explode(':', $val['type']); |
@@ -496,10 +496,10 @@ discard block |
||
496 | 496 | //var_dump($modelmail); |
497 | 497 | $moreonlabel = ''; |
498 | 498 | if (!empty($arrayofmessagename[$modelmail->label])) { |
499 | - $moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>'; |
|
499 | + $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>'; |
|
500 | 500 | } |
501 | 501 | // The 'label' is the key that is unique if we exclude the language |
502 | - $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; |
|
502 | + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; |
|
503 | 503 | } |
504 | 504 | } |
505 | 505 | print $form->selectarray($constname, $arrayofmessagename, getDolGlobalString($constname), 'None', 0, 0, '', 0, 0, 0, '', '', 1); |
@@ -532,34 +532,34 @@ discard block |
||
532 | 532 | } elseif ($val['type'] == 'accountancy_code') { |
533 | 533 | $selected = getDolGlobalString($constname); |
534 | 534 | if (isModEnabled('accounting')) { |
535 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; |
|
535 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; |
|
536 | 536 | $formaccounting = new FormAccounting($db); |
537 | 537 | print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1); |
538 | 538 | } else { |
539 | - print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">'; |
|
539 | + print '<input name="'.$constname.'" class="maxwidth200" value="'.dol_escape_htmltag($selected).'">'; |
|
540 | 540 | } |
541 | 541 | } elseif ($val['type'] == 'accountancy_category') { |
542 | 542 | $selected = getDolGlobalString($constname); |
543 | 543 | if (isModEnabled('accounting')) { |
544 | - print '<input type="text" name="' . $constname . '" list="pcg_type_datalist" value="' . $selected . '">'; |
|
544 | + print '<input type="text" name="'.$constname.'" list="pcg_type_datalist" value="'.$selected.'">'; |
|
545 | 545 | // autosuggest from existing account types if found |
546 | 546 | print '<datalist id="pcg_type_datalist">'; |
547 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php'; |
|
547 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php'; |
|
548 | 548 | $accountsystem = new AccountancySystem($db); |
549 | 549 | $accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); |
550 | - $sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account'; |
|
551 | - $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; |
|
552 | - $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. |
|
550 | + $sql = 'SELECT DISTINCT pcg_type FROM '.MAIN_DB_PREFIX.'accounting_account'; |
|
551 | + $sql .= " WHERE fk_pcg_version = '".$db->escape($accountsystem->ref)."'"; |
|
552 | + $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. |
|
553 | 553 | $sql .= ' LIMIT 50000'; // just as a sanity check |
554 | 554 | $resql = $db->query($sql); |
555 | 555 | if ($resql) { |
556 | 556 | while ($obj = $db->fetch_object($resql)) { |
557 | - print '<option value="' . dol_escape_htmltag($obj->pcg_type) . '">'; |
|
557 | + print '<option value="'.dol_escape_htmltag($obj->pcg_type).'">'; |
|
558 | 558 | } |
559 | 559 | } |
560 | 560 | print '</datalist>'; |
561 | 561 | } else { |
562 | - print '<input name="' . $constname . '" class="maxwidth200" value="' . dol_escape_htmltag($selected) . '">'; |
|
562 | + print '<input name="'.$constname.'" class="maxwidth200" value="'.dol_escape_htmltag($selected).'">'; |
|
563 | 563 | } |
564 | 564 | } else { |
565 | 565 | print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($constname).'">'; |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if ($val['enabled'] == 1) { |
585 | 585 | $setupnotempty++; |
586 | 586 | print '<tr class="oddeven"><td>'; |
587 | - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); |
|
587 | + $tooltiphelp = (($langs->trans($constname.'Tooltip') != $constname.'Tooltip') ? $langs->trans($constname.'Tooltip') : ''); |
|
588 | 588 | print $form->textwithpicto($langs->trans($constname), $tooltiphelp); |
589 | 589 | print '</td><td>'; |
590 | 590 | |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | } elseif ($val['type'] == 'yesno') { |
596 | 596 | print ajax_constantonoff($constname); |
597 | 597 | } elseif (preg_match('/emailtemplate:/', $val['type'])) { |
598 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
598 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
599 | 599 | $formmail = new FormMail($db); |
600 | 600 | |
601 | 601 | $tmp = explode(':', $val['type']); |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
615 | 615 | $toprint = array(); |
616 | 616 | foreach ($ways as $way) { |
617 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
617 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
618 | 618 | } |
619 | - print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
619 | + print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
620 | 620 | } |
621 | 621 | } elseif (preg_match('/thirdparty_type/', $val['type'])) { |
622 | 622 | if (getDolGlobalInt($constname) == 2) { |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | } |
639 | 639 | } elseif ($val['type'] == 'accountancy_code') { |
640 | 640 | if (isModEnabled('accounting')) { |
641 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
641 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; |
|
642 | 642 | $accountingaccount = new AccountingAccount($db); |
643 | 643 | $accountingaccount->fetch(0, getDolGlobalString($constname), 1); |
644 | 644 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // Parameters |
46 | 46 | $value = GETPOST('value', 'alpha'); |
47 | 47 | $action = GETPOST('action', 'aZ09'); |
48 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
48 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
49 | 49 | |
50 | 50 | $label = GETPOST('label', 'alpha'); |
51 | 51 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | print(empty($module->name) ? $name : $module->name); |
463 | 463 | print "</td><td>\n"; |
464 | 464 | if (method_exists($module, 'info')) { |
465 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
465 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
466 | 466 | } else { |
467 | 467 | print $module->description; |
468 | 468 | } |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | // Email to send notifications |
713 | 713 | print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationFrom").'</td>'; |
714 | 714 | print '<td class="left">'; |
715 | -print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_FROM" value="' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'"></td>'; |
|
715 | +print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_FROM" value="'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'"></td>'; |
|
716 | 716 | print '<td class="center">'; |
717 | 717 | print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help'); |
718 | 718 | print '</td>'; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $action = GETPOST('action', 'aZ09'); |
44 | 44 | $backtopage = GETPOST('backtopage', 'alpha'); |
45 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
45 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
46 | 46 | |
47 | 47 | $value = GETPOST('value', 'alpha'); |
48 | 48 | $label = GETPOST('label', 'alpha'); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | print(empty($module->name) ? $name : $module->name); |
265 | 265 | print "</td><td>\n"; |
266 | 266 | if (method_exists($module, 'info')) { |
267 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
267 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
268 | 268 | } else { |
269 | 269 | print $module->description; |
270 | 270 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $action = GETPOST('action', 'aZ09'); |
47 | 47 | $value = GETPOST('value', 'alpha'); |
48 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
48 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
49 | 49 | |
50 | 50 | $type = 'group'; |
51 | 51 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | print(empty($module->name) ? $name : $module->name); |
189 | 189 | print "</td><td>\n"; |
190 | 190 | if (method_exists($module, 'info')) { |
191 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
191 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
192 | 192 | } else { |
193 | 193 | print $module->description; |
194 | 194 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $action = GETPOST('action', 'aZ09'); |
44 | 44 | $value = GETPOST('value', 'alpha'); |
45 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
45 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
46 | 46 | $label = GETPOST('label', 'alpha'); |
47 | 47 | $scandir = GETPOST('scan_dir', 'alpha'); |
48 | 48 | $type = 'stock'; |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | print(empty($module->name) ? $name : $module->name); |
605 | 605 | print "</td><td>\n"; |
606 | 606 | if (method_exists($module, 'info')) { |
607 | - print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
607 | + print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod |
|
608 | 608 | } else { |
609 | 609 | print $module->description; |
610 | 610 | } |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
269 | 269 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
270 | 270 | } |
271 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
271 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
272 | 272 | $tplidx = $pdf->importPage(1); |
273 | 273 | } |
274 | 274 | |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | // Pagefoot |
610 | 610 | $this->_pagefoot($pdf, $object, $outputlangs); |
611 | 611 | if (method_exists($pdf, 'AliasNbPages')) { |
612 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
612 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | $pdf->Close(); |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | return array(); |
101 | 101 | } |
102 | 102 | |
103 | - $data = array(); // This is the return value |
|
104 | - $datay = array(); // This is a work value |
|
103 | + $data = array(); // This is the return value |
|
104 | + $datay = array(); // This is a work value |
|
105 | 105 | |
106 | 106 | // Search into cache |
107 | 107 | if (!empty($cachedelay)) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | $datay = array(); |
205 | - $data = array(); // Return value |
|
205 | + $data = array(); // Return value |
|
206 | 206 | |
207 | 207 | // Search into cache |
208 | 208 | if (!empty($cachedelay)) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | if ($foundintocache) { // Cache file found and is not too old |
355 | 355 | dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate."."); |
356 | 356 | $data = json_decode(file_get_contents($newpathofdestfile), true); |
357 | - '@phan-var-force array<int<0,11>,array{0:int<1,12>,1:int|float}> $data'; // Phan can't decode json_decode's return value |
|
357 | + '@phan-var-force array<int<0,11>,array{0:int<1,12>,1:int|float}> $data'; // Phan can't decode json_decode's return value |
|
358 | 358 | } else { |
359 | 359 | $data = $this->getAllByProduct($year, $limit); |
360 | 360 | } |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | // Needs to be implemented in child class when used |
721 | 721 | $msg = get_class($this)."::".__FUNCTION__." not implemented"; |
722 | 722 | dol_syslog($msg, LOG_ERR); |
723 | - $l = array(1,0); // Dummy result |
|
724 | - return array($l,$l,$l,$l,$l,$l,$l,$l,$l,$l,$l,$l); |
|
723 | + $l = array(1, 0); // Dummy result |
|
724 | + return array($l, $l, $l, $l, $l, $l, $l, $l, $l, $l, $l, $l); |
|
725 | 725 | } |
726 | 726 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | } |
401 | 401 | } |
402 | 402 | if ($emailtoadd && preg_match('/'.preg_quote($emailtoadd, '/').'/i', $to)) { |
403 | - $emailtoadd = ''; // Email already in the "To" |
|
403 | + $emailtoadd = ''; // Email already in the "To" |
|
404 | 404 | } |
405 | 405 | if ($emailtoadd) { |
406 | 406 | $listofemailstoadd[$key] = $emailtoadd; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $this->buildCSS(); |
595 | 595 | } |
596 | 596 | $msg = $this->html; |
597 | - $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
597 | + $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | // Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $this->buildCSS(); |
744 | 744 | } |
745 | 745 | $msg = $this->html; |
746 | - $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
746 | + $msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content |
|
747 | 747 | } |
748 | 748 | |
749 | 749 | if ($this->atleastoneimage) { |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | if ($apiService instanceof OAuth\OAuth2\Service\AbstractService || $apiService instanceof OAuth\OAuth1\Service\AbstractService) { |
1148 | 1148 | // ServiceInterface does not provide refreshAccessToken, AbstractService does |
1149 | 1149 | $tokenobj = $apiService->refreshAccessToken($tokenobj); |
1150 | - $tokenobj->setRefreshToken($refreshtoken); // Restore the refresh token |
|
1150 | + $tokenobj->setRefreshToken($refreshtoken); // Restore the refresh token |
|
1151 | 1151 | $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); |
1152 | 1152 | } |
1153 | 1153 | |
@@ -1169,19 +1169,19 @@ discard block |
||
1169 | 1169 | $res = true; |
1170 | 1170 | $from = $this->smtps->getFrom('org'); |
1171 | 1171 | if ($res && !$from) { |
1172 | - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid"; |
|
1172 | + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Sender address '$from' invalid"; |
|
1173 | 1173 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
1174 | 1174 | $res = false; |
1175 | 1175 | } |
1176 | 1176 | $dest = $this->smtps->getTo(); |
1177 | 1177 | if ($res && !$dest) { |
1178 | - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid"; |
|
1178 | + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - Recipient address '$dest' invalid"; |
|
1179 | 1179 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
1180 | 1180 | $res = false; |
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | if ($res) { |
1184 | - dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1184 | + dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1185 | 1185 | |
1186 | 1186 | if (getDolGlobalString('MAIN_MAIL_DEBUG')) { |
1187 | 1187 | $this->smtps->setDebug(true); |
@@ -1194,8 +1194,8 @@ discard block |
||
1194 | 1194 | } |
1195 | 1195 | |
1196 | 1196 | $smtperrorcode = 0; |
1197 | - if (! $result) { |
|
1198 | - $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1197 | + if (!$result) { |
|
1198 | + $smtperrorcode = $this->smtps->lastretval; // SMTP error code |
|
1199 | 1199 | dol_syslog("CMailFile::sendfile: mail SMTP error code ".$smtperrorcode, LOG_WARNING); |
1200 | 1200 | |
1201 | 1201 | if ($smtperrorcode == '421') { // Try later |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | } |
1214 | 1214 | } |
1215 | 1215 | |
1216 | - $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1216 | + $result = $this->smtps->getErrors(); // applicative error code (not SMTP error code) |
|
1217 | 1217 | if (empty($this->error) && empty($result)) { |
1218 | 1218 | dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG); |
1219 | 1219 | $res = true; |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | if (empty($this->error)) { |
1222 | 1222 | $this->error = $result; |
1223 | 1223 | } |
1224 | - dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR); |
|
1224 | + dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport)." - ".$this->error, LOG_ERR); |
|
1225 | 1225 | $res = false; |
1226 | 1226 | |
1227 | 1227 | if (getDolGlobalString('MAIN_MAIL_DEBUG')) { |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | $this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger)); |
1359 | 1359 | } |
1360 | 1360 | |
1361 | - dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=" . getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1361 | + dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=".getDolGlobalString($keyforsmtpport), LOG_DEBUG); |
|
1362 | 1362 | |
1363 | 1363 | // send mail |
1364 | 1364 | $failedRecipients = array(); |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | $res = true; |
1375 | 1375 | if (!empty($this->error) || !empty($this->errors) || !$result) { |
1376 | 1376 | if (!empty($failedRecipients)) { |
1377 | - $this->errors[] = 'Transport failed for the following addresses: "' . implode('", "', $failedRecipients) . '".'; |
|
1377 | + $this->errors[] = 'Transport failed for the following addresses: "'.implode('", "', $failedRecipients).'".'; |
|
1378 | 1378 | } |
1379 | 1379 | dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); |
1380 | 1380 | $res = false; |
@@ -1471,7 +1471,7 @@ discard block |
||
1471 | 1471 | |
1472 | 1472 | if (@is_writable($dolibarr_main_data_root)) { // Avoid fatal error on fopen with open_basedir |
1473 | 1473 | $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; |
1474 | - $fp = fopen($outputfile, "w"); // overwrite |
|
1474 | + $fp = fopen($outputfile, "w"); // overwrite |
|
1475 | 1475 | |
1476 | 1476 | if ($this->sendmode == 'mail') { |
1477 | 1477 | fwrite($fp, $this->headers); |
@@ -1734,11 +1734,11 @@ discard block |
||
1734 | 1734 | // Similar code to forge a text from html is also in smtps.class.php |
1735 | 1735 | $strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent); |
1736 | 1736 | // TODO We could replace <img ...> with [Filename.ext] like Gmail do. |
1737 | - $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1737 | + $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags |
|
1738 | 1738 | $strContentAltText = trim(wordwrap($strContentAltText, 75, !getDolGlobalString('MAIN_FIX_FOR_BUGGED_MTA') ? "\r\n" : "\n")); |
1739 | 1739 | |
1740 | 1740 | // Check if html header already in message, if not complete the message |
1741 | - $strContent = $this->checkIfHTML($strContent); // This add a header and a body including custom CSS to the HTML content |
|
1741 | + $strContent = $this->checkIfHTML($strContent); // This add a header and a body including custom CSS to the HTML content |
|
1742 | 1742 | } |
1743 | 1743 | |
1744 | 1744 | // Make RFC2045 Compliant, split lines |
@@ -2123,7 +2123,7 @@ discard block |
||
2123 | 2123 | // We save the image to send in disk |
2124 | 2124 | $filecontent = $matches[2][$key]; |
2125 | 2125 | |
2126 | - $cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
2126 | + $cid = 'cid000'.dol_hash($filecontent, 'md5'); // The id must not change if image is same |
|
2127 | 2127 | |
2128 | 2128 | $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; |
2129 | 2129 |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
211 | 211 | // Set path to the background PDF File |
212 | 212 | if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { |
213 | - $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
213 | + $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
214 | 214 | $tplidx = $pdf->importPage(1); |
215 | 215 | } |
216 | 216 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $pdf->SetDrawColor(128, 128, 128); |
220 | 220 | |
221 | 221 | if (method_exists($pdf, 'AliasNbPages')) { |
222 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
222 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | // Pagefoot |
367 | 367 | $this->_pagefoot($pdf, $object, $outputlangs); |
368 | 368 | if (method_exists($pdf, 'AliasNbPages')) { |
369 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
369 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | $pdf->Close(); |