@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | define('NOSTYLECHECK', 1); |
27 | 27 | define('USEDOLIBARREDITOR', 1); |
28 | 28 | define('FORCE_CKEDITOR', 1); // We need CKEditor, even if module is off. |
29 | -if (!defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1); |
|
29 | +if (!defined('DISABLE_JS_GRAHP')) { |
|
30 | + define('DISABLE_JS_GRAPH', 1); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | //header('X-XSS-Protection:0'); // Disable XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. |
32 | 34 | |
@@ -592,7 +594,9 @@ discard block |
||
592 | 594 | $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); |
593 | 595 | foreach ($arrayotherlang as $key => $val) { |
594 | 596 | // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' |
595 | - if (empty(trim($val))) continue; |
|
597 | + if (empty(trim($val))) { |
|
598 | + continue; |
|
599 | + } |
|
596 | 600 | $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only |
597 | 601 | } |
598 | 602 | |
@@ -1336,7 +1340,9 @@ discard block |
||
1336 | 1340 | $arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml')); |
1337 | 1341 | foreach ($arrayotherlang as $key => $val) { |
1338 | 1342 | // It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,' |
1339 | - if (empty(trim($val))) continue; |
|
1343 | + if (empty(trim($val))) { |
|
1344 | + continue; |
|
1345 | + } |
|
1340 | 1346 | $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only |
1341 | 1347 | } |
1342 | 1348 | |
@@ -1793,7 +1799,9 @@ discard block |
||
1793 | 1799 | // Under certain conditions $sublang can be an empty string |
1794 | 1800 | // ($object->otherlang with empty string or with string like this 'en,,sv') |
1795 | 1801 | // if is the case we try to re-delete the main alias file. Avoid it. |
1796 | - if (empty(trim($sublang))) continue; |
|
1802 | + if (empty(trim($sublang))) { |
|
1803 | + continue; |
|
1804 | + } |
|
1797 | 1805 | $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; |
1798 | 1806 | dol_delete_file($fileoldaliassub); |
1799 | 1807 | } |
@@ -1816,7 +1824,9 @@ discard block |
||
1816 | 1824 | // Under certain conditions $ sublang can be an empty string |
1817 | 1825 | // ($object->otherlang with empty string or with string like this 'en,,sv') |
1818 | 1826 | // if is the case we try to re-delete the main alias file. Avoid it. |
1819 | - if (empty(trim($sublang))) continue; |
|
1827 | + if (empty(trim($sublang))) { |
|
1828 | + continue; |
|
1829 | + } |
|
1820 | 1830 | $fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename; |
1821 | 1831 | dol_delete_file($fileoldaliassub); |
1822 | 1832 | } |
@@ -2903,7 +2913,9 @@ discard block |
||
2903 | 2913 | $onlylang[$website->lang] = $website->lang.' ('.$langs->trans("Default").')'; |
2904 | 2914 | } |
2905 | 2915 | foreach (explode(',', $website->otherlang) as $langkey) { |
2906 | - if (empty(trim($langkey))) continue; |
|
2916 | + if (empty(trim($langkey))) { |
|
2917 | + continue; |
|
2918 | + } |
|
2907 | 2919 | $onlylang[$langkey] = $langkey; |
2908 | 2920 | } |
2909 | 2921 | $textifempty = $langs->trans("Default"); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | |
344 | 344 | $usercanedit = $user->rights->website->write; |
345 | -$permissiontoadd = $user->rights->website->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
345 | +$permissiontoadd = $user->rights->website->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
346 | 346 | $permissiontodelete = $user->rights->website->delete; |
347 | 347 | |
348 | 348 | |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | if ($sortorder) { |
408 | 408 | $backtopage .= '&sortorder='.urlencode($sortorder); |
409 | 409 | } |
410 | -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit' action when submitting new file. |
|
410 | +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit' action when submitting new file. |
|
411 | 411 | |
412 | 412 | $backtopage = $savbacktopage; |
413 | 413 | //var_dump($backtopage); |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | $error++; |
1375 | 1375 | setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors'); |
1376 | 1376 | } |
1377 | - if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1377 | + if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) { |
|
1378 | 1378 | $error++; |
1379 | 1379 | setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors'); |
1380 | 1380 | } |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1387 | 1387 | $action = 'preview'; |
1388 | 1388 | if ($backtopage) { |
1389 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1389 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1390 | 1390 | header("Location: ".$backtopage); |
1391 | 1391 | exit; |
1392 | 1392 | } |
@@ -1419,7 +1419,7 @@ discard block |
||
1419 | 1419 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1420 | 1420 | |
1421 | 1421 | // Security analysis |
1422 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1422 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1423 | 1423 | |
1424 | 1424 | if (!$errorphpcheck) { |
1425 | 1425 | $htmlheadercontent = ''; |
@@ -1457,7 +1457,7 @@ discard block |
||
1457 | 1457 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1458 | 1458 | |
1459 | 1459 | // Security analysis |
1460 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1460 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1461 | 1461 | |
1462 | 1462 | if (!$errorphpcheck) { |
1463 | 1463 | $csscontent = ''; |
@@ -1500,7 +1500,7 @@ discard block |
||
1500 | 1500 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1501 | 1501 | |
1502 | 1502 | // Security analysis |
1503 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1503 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1504 | 1504 | |
1505 | 1505 | if (!$errorphpcheck) { |
1506 | 1506 | $jscontent = ''; |
@@ -1538,7 +1538,7 @@ discard block |
||
1538 | 1538 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1539 | 1539 | |
1540 | 1540 | // Security analysis |
1541 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1541 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1542 | 1542 | |
1543 | 1543 | if (!$errorphpcheck) { |
1544 | 1544 | $robotcontent = ''; |
@@ -1576,7 +1576,7 @@ discard block |
||
1576 | 1576 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1577 | 1577 | |
1578 | 1578 | // Security analysis |
1579 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1579 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1580 | 1580 | |
1581 | 1581 | if (!$errorphpcheck) { |
1582 | 1582 | $htaccesscontent = ''; |
@@ -1600,7 +1600,7 @@ discard block |
||
1600 | 1600 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1601 | 1601 | |
1602 | 1602 | // Security analysis |
1603 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1603 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1604 | 1604 | |
1605 | 1605 | if (!$errorphpcheck) { |
1606 | 1606 | $manifestjsoncontent = ''; |
@@ -1638,7 +1638,7 @@ discard block |
||
1638 | 1638 | $phpfullcodestring = dolKeepOnlyPhpCode($dataposted); |
1639 | 1639 | |
1640 | 1640 | // Security analysis |
1641 | - $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1641 | + $errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages |
|
1642 | 1642 | |
1643 | 1643 | if (!$errorphpcheck) { |
1644 | 1644 | $readmecontent = ''; |
@@ -1681,7 +1681,7 @@ discard block |
||
1681 | 1681 | if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect |
1682 | 1682 | $action = 'preview'; |
1683 | 1683 | if ($backtopage) { |
1684 | - $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1684 | + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url |
|
1685 | 1685 | header("Location: ".$backtopage); |
1686 | 1686 | exit; |
1687 | 1687 | } |
@@ -1700,7 +1700,7 @@ discard block |
||
1700 | 1700 | |
1701 | 1701 | $object->fk_default_home = $pageid; |
1702 | 1702 | $res = $object->update($user); |
1703 | - if (! ($res > 0)) { |
|
1703 | + if (!($res > 0)) { |
|
1704 | 1704 | $error++; |
1705 | 1705 | setEventMessages($object->error, $object->errors, 'errors'); |
1706 | 1706 | } |
@@ -2376,7 +2376,7 @@ discard block |
||
2376 | 2376 | if ($objp->virtualhost) { |
2377 | 2377 | $domainname = $objp->virtualhost; |
2378 | 2378 | } |
2379 | - if (! preg_match('/^http/i', $domainname)) { |
|
2379 | + if (!preg_match('/^http/i', $domainname)) { |
|
2380 | 2380 | $domainname = 'https://'.$domainname; |
2381 | 2381 | } |
2382 | 2382 | //$pathofpage = $dolibarr_main_url_root.'/'.$pageurl.'.php'; |
@@ -2384,7 +2384,7 @@ discard block |
||
2384 | 2384 | // URL of sitemaps must end with trailing slash if page is '' |
2385 | 2385 | $loc = $domtree->createElement('loc', $domainname.'/'.$pageurl); |
2386 | 2386 | $lastmod = $domtree->createElement('lastmod', dol_print_date($db->jdate($objp->tms), 'dayrfc', 'gmt')); |
2387 | - $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2387 | + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values |
|
2388 | 2388 | $priority = $domtree->createElement('priority', '1'); |
2389 | 2389 | |
2390 | 2390 | $url->appendChild($loc); |
@@ -2559,7 +2559,7 @@ discard block |
||
2559 | 2559 | |
2560 | 2560 | print "\n"; |
2561 | 2561 | print '<!-- Open form for all page -->'."\n"; |
2562 | -print '<form action="'.$_SERVER["PHP_SELF"].($action == 'file_manager' ? '?uploadform=1': '').'" method="POST" enctype="multipart/form-data" class="websiteformtoolbar">'; |
|
2562 | +print '<form action="'.$_SERVER["PHP_SELF"].($action == 'file_manager' ? '?uploadform=1' : '').'" method="POST" enctype="multipart/form-data" class="websiteformtoolbar">'; |
|
2563 | 2563 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
2564 | 2564 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
2565 | 2565 | print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">'; |
@@ -3009,7 +3009,7 @@ discard block |
||
3009 | 3009 | $formquestion[] = array('type' => 'checkbox', 'tdclass'=>'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss'=>'margintoponly'); |
3010 | 3010 | } |
3011 | 3011 | |
3012 | - $value= $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
3012 | + $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
3013 | 3013 | $formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value); |
3014 | 3014 | |
3015 | 3015 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550); |
@@ -3031,7 +3031,7 @@ discard block |
||
3031 | 3031 | print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; |
3032 | 3032 | print '<div class="websiteselectionsection inline-block">'; |
3033 | 3033 | |
3034 | - print '<div class="inline-block marginrightonly">'; // Button include dynamic contant |
|
3034 | + print '<div class="inline-block marginrightonly">'; // Button include dynamic contant |
|
3035 | 3035 | print $langs->trans("ShowSubcontainers"); |
3036 | 3036 | if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE)) { |
3037 | 3037 | print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>'; |
@@ -3040,7 +3040,7 @@ discard block |
||
3040 | 3040 | } |
3041 | 3041 | print '</div>'; |
3042 | 3042 | |
3043 | - print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3043 | + print '<div class="inline-block marginrightonly">'; // Button edit inline |
|
3044 | 3044 | |
3045 | 3045 | print '<span id="switchckeditorinline">'."\n"; |
3046 | 3046 | print '<!-- Code to enabled edit inline ckeditor -->'."\n"; |
@@ -4125,7 +4125,7 @@ discard block |
||
4125 | 4125 | |
4126 | 4126 | |
4127 | 4127 | $module = 'medias'; |
4128 | - $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php |
|
4128 | + $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php |
|
4129 | 4129 | if (empty($url)) { |
4130 | 4130 | $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param |
4131 | 4131 | } |
@@ -4349,7 +4349,7 @@ discard block |
||
4349 | 4349 | print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']); |
4350 | 4350 | print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; |
4351 | 4351 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
4352 | - print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
4352 | + print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif |
|
4353 | 4353 | print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); |
4354 | 4354 | print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; |
4355 | 4355 | print '</tr>'; |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | if ($action == 'confirmconvertimgwebp') { |
174 | 174 | $langs->load("ecm"); |
175 | 175 | |
176 | - $section_dir=GETPOST('section_dir', 'alpha'); |
|
177 | - $section=GETPOST('section', 'alpha'); |
|
176 | + $section_dir = GETPOST('section_dir', 'alpha'); |
|
177 | + $section = GETPOST('section', 'alpha'); |
|
178 | 178 | $form = new Form($db); |
179 | - $formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir'); |
|
180 | - $formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); |
|
179 | + $formquestion['section_dir'] = array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir'); |
|
180 | + $formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); |
|
181 | 181 | if ($module == 'medias') { |
182 | - $formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website'); |
|
182 | + $formquestion['website'] = array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website'); |
|
183 | 183 | } |
184 | 184 | print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('ConfirmImgWebpCreation'), $langs->trans('ConfirmGenerateImgWebp', $object->ref), 'convertimgwebp', $formquestion, "yes", 1); |
185 | 185 | $action = 'file_manager'; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if (image_format_supported($filepath) == 1) { |
208 | 208 | $filepathnoext = preg_replace("/\.[a-z0-9]+$/i", "", $filepath); |
209 | 209 | |
210 | - if (! dol_is_file($filepathnoext.'.webp')) { // If file does not exists yet |
|
210 | + if (!dol_is_file($filepathnoext.'.webp')) { // If file does not exists yet |
|
211 | 211 | $result = dol_imageResizeOrCrop($filepath, 0, 0, 0, 0, 0, $filepathnoext.'.webp', 90); |
212 | 212 | if (!dol_is_file($result)) { |
213 | 213 | $error++; |
@@ -306,8 +306,12 @@ discard block |
||
306 | 306 | if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { |
307 | 307 | $outputlangs = $langs; |
308 | 308 | $newlang = ''; |
309 | - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); |
|
310 | - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; |
|
309 | + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { |
|
310 | + $newlang = GETPOST('lang_id', 'aZ09'); |
|
311 | + } |
|
312 | + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { |
|
313 | + $newlang = $object->thirdparty->default_lang; |
|
314 | + } |
|
311 | 315 | if (!empty($newlang)) { |
312 | 316 | $outputlangs = new Translate("", $conf); |
313 | 317 | $outputlangs->setDefaultLang($newlang); |
@@ -2477,9 +2481,12 @@ discard block |
||
2477 | 2481 | |
2478 | 2482 | $parameters = array(); |
2479 | 2483 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
2480 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2481 | - if (empty($reshook)) |
|
2482 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
2484 | + if ($reshook < 0) { |
|
2485 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2486 | + } |
|
2487 | + if (empty($reshook)) { |
|
2488 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
2489 | + } |
|
2483 | 2490 | } else { |
2484 | 2491 | $parameters = array(); |
2485 | 2492 | $reshook = $hookmanager->executeHooks('formEditObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $object->deposit_percent = GETPOST('cond_reglement_id_deposit_percent', 'alpha'); |
406 | 406 | $object->mode_reglement_id = GETPOST('mode_reglement_id'); |
407 | 407 | $object->fk_account = GETPOST('fk_account', 'int'); |
408 | - $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); // deprecated |
|
408 | + $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); // deprecated |
|
409 | 409 | $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); |
410 | 410 | $object->socid = GETPOST('socid', 'int'); |
411 | 411 | $object->contact_id = GETPOST('contactid', 'int'); |
@@ -696,9 +696,9 @@ discard block |
||
696 | 696 | |
697 | 697 | if ( |
698 | 698 | !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' |
699 | - && ! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer) |
|
699 | + && !empty($deposit_percent_from_payment_terms) && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer) |
|
700 | 700 | ) { |
701 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
701 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
702 | 702 | |
703 | 703 | $date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int')); |
704 | 704 | $forceFields = array(); |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | |
712 | 712 | if ($deposit) { |
713 | 713 | setEventMessage('DepositGenerated'); |
714 | - $locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id; |
|
714 | + $locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id; |
|
715 | 715 | } else { |
716 | 716 | $error++; |
717 | 717 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | } |
740 | 740 | |
741 | 741 | if ($locationTarget) { |
742 | - header('Location: ' . $locationTarget); |
|
742 | + header('Location: '.$locationTarget); |
|
743 | 743 | exit; |
744 | 744 | } |
745 | 745 | } else { |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | if (count($prodcustprice->lines) > 0) { |
1014 | 1014 | $pu_ht = price($prodcustprice->lines[0]->price); |
1015 | 1015 | $pu_ttc = price($prodcustprice->lines[0]->price_ttc); |
1016 | - $price_min = price($prodcustprice->lines[0]->price_min); |
|
1016 | + $price_min = price($prodcustprice->lines[0]->price_min); |
|
1017 | 1017 | $price_base_type = $prodcustprice->lines[0]->price_base_type; |
1018 | 1018 | $tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); |
1019 | 1019 | if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) { |
@@ -1109,8 +1109,8 @@ discard block |
||
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | //If text set in desc is the same as product description (as now it's preloaded) whe add it only one time |
1112 | - if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { |
|
1113 | - $product_desc=''; |
|
1112 | + if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) { |
|
1113 | + $product_desc = ''; |
|
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) { |
@@ -1508,7 +1508,7 @@ discard block |
||
1508 | 1508 | } |
1509 | 1509 | |
1510 | 1510 | // Actions to build doc |
1511 | - $upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output; |
|
1511 | + $upload_dir = !empty($conf->propal->multidir_output[$object->entity]) ? $conf->propal->multidir_output[$object->entity] : $conf->propal->dir_output; |
|
1512 | 1512 | $permissiontoadd = $usercancreate; |
1513 | 1513 | include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
1514 | 1514 | } |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | |
1589 | 1589 | $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); // TODO maybe add default value option |
1590 | 1590 | $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); |
1591 | - $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); // deprecated |
|
1591 | + $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); // deprecated |
|
1592 | 1592 | $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); |
1593 | 1593 | $warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0)); |
1594 | 1594 | $dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice); |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | |
1645 | 1645 | // Ref customer |
1646 | 1646 | print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">'; |
1647 | - print '<input type="text" name="ref_client" value="'.(!empty($ref_client)?$ref_client:GETPOST('ref_client')).'"></td>'; |
|
1647 | + print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>'; |
|
1648 | 1648 | print '</tr>'; |
1649 | 1649 | |
1650 | 1650 | // Third party |
@@ -1845,7 +1845,7 @@ discard block |
||
1845 | 1845 | // TODO for compatibility |
1846 | 1846 | if ($origin == 'contrat') { |
1847 | 1847 | // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva |
1848 | - $objectsrc->remise_absolue = $remise_absolue; // deprecated |
|
1848 | + $objectsrc->remise_absolue = $remise_absolue; // deprecated |
|
1849 | 1849 | $objectsrc->remise_percent = $remise_percent; |
1850 | 1850 | $objectsrc->update_price(1, - 1, 1); |
1851 | 1851 | } |
@@ -2001,8 +2001,8 @@ discard block |
||
2001 | 2001 | |
2002 | 2002 | $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); |
2003 | 2003 | |
2004 | - if (! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer)) { |
|
2005 | - require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
2004 | + if (!empty($deposit_percent_from_payment_terms) && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer)) { |
|
2005 | + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
2006 | 2006 | |
2007 | 2007 | $object->fetchObjectLinked(); |
2008 | 2008 | |
@@ -2050,7 +2050,7 @@ discard block |
||
2050 | 2050 | 'datenow' => true |
2051 | 2051 | ); |
2052 | 2052 | |
2053 | - if (! empty($conf->global->INVOICE_POINTOFTAX_DATE)) { |
|
2053 | + if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { |
|
2054 | 2054 | $formquestion[] = array( |
2055 | 2055 | 'type' => 'date', |
2056 | 2056 | 'tdclass' => 'fieldrequired showonlyifgeneratedeposit', |
@@ -2084,7 +2084,7 @@ discard block |
||
2084 | 2084 | 'type' => 'onecolumn', |
2085 | 2085 | 'value' => ' |
2086 | 2086 | <script> |
2087 | - let signedValue = ' . $object::STATUS_SIGNED . '; |
|
2087 | + let signedValue = ' . $object::STATUS_SIGNED.'; |
|
2088 | 2088 | |
2089 | 2089 | $(document).ready(function() { |
2090 | 2090 | $("[name=generate_deposit]").change(function () { |
@@ -2168,8 +2168,8 @@ discard block |
||
2168 | 2168 | $nbMandated = 0; |
2169 | 2169 | foreach ($object->lines as $line) { |
2170 | 2170 | $res = $line->fetch_product(); |
2171 | - if ($res > 0 ) { |
|
2172 | - if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) { |
|
2171 | + if ($res > 0) { |
|
2172 | + if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
|
2173 | 2173 | $nbMandated++; |
2174 | 2174 | break; |
2175 | 2175 | } |
@@ -2750,7 +2750,7 @@ discard block |
||
2750 | 2750 | } |
2751 | 2751 | |
2752 | 2752 | // ReOpen |
2753 | - if ( (( ! empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { |
|
2753 | + if (((!empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { |
|
2754 | 2754 | print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; |
2755 | 2755 | print '>'.$langs->trans('ReOpen').'</a>'; |
2756 | 2756 | } |
@@ -1170,7 +1170,9 @@ |
||
1170 | 1170 | if (GETPOST('contactid', 'int')) { |
1171 | 1171 | $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); |
1172 | 1172 | } |
1173 | - if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); |
|
1173 | + if ($origin=='contact') { |
|
1174 | + $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); |
|
1175 | + } |
|
1174 | 1176 | print img_picto('', 'contact', 'class="paddingrightonly"'); |
1175 | 1177 | print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); |
1176 | 1178 | print '</td></tr>'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); |
71 | 71 | $remindertype = GETPOST('selectremindertype', 'aZ09'); |
72 | 72 | $modelmail = GETPOST('actioncommsendmodel_mail', 'int'); |
73 | -$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
73 | +$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed |
|
74 | 74 | if ($complete == 'na' || $complete == -2) { |
75 | 75 | $complete = -1; |
76 | 76 | } |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { |
776 | 776 | $error = 0; |
777 | 777 | |
778 | - $shour = dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
778 | + $shour = dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user. |
|
779 | 779 | $smin = dol_print_date($object->datep, "%M", 'tzuserrel'); |
780 | 780 | |
781 | 781 | $newdate = GETPOST('newdate', 'alpha'); |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>'; |
994 | 994 | $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); |
995 | 995 | print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); |
996 | - print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
996 | + print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot |
|
997 | 997 | print '</td></tr>'; |
998 | 998 | } |
999 | 999 | |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | // Status |
1109 | 1109 | print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>'; |
1110 | 1110 | print '<td>'; |
1111 | - $percent = $complete !=='' ? $complete : -1; |
|
1111 | + $percent = $complete !== '' ? $complete : -1; |
|
1112 | 1112 | if (GETPOSTISSET('status')) { |
1113 | 1113 | $percent = GETPOST('status'); |
1114 | 1114 | } elseif (GETPOSTISSET('percentage')) { |
@@ -1205,7 +1205,7 @@ discard block |
||
1205 | 1205 | if (GETPOST('contactid', 'int')) { |
1206 | 1206 | $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); |
1207 | 1207 | } |
1208 | - if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); |
|
1208 | + if ($origin == 'contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); |
|
1209 | 1209 | print img_picto('', 'contact', 'class="paddingrightonly"'); |
1210 | 1210 | print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid'); |
1211 | 1211 | print '</td></tr>'; |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | } |
1266 | 1266 | //var_dump('origin='.$origin.' originid='.$originid.' hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); |
1267 | 1267 | |
1268 | - if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
1268 | + if (!in_array($origin, array('societe', 'project', 'task', 'user'))) { |
|
1269 | 1269 | // We do not use link for object that already contains a hard coded field to make links with agenda events |
1270 | 1270 | print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>'; |
1271 | 1271 | print '<td colspan="3">'; |
@@ -1418,7 +1418,7 @@ discard block |
||
1418 | 1418 | $object->socpeopleassigned[$id] = array('id' => $tmpid); |
1419 | 1419 | } |
1420 | 1420 | $object->contact_id = GETPOST("contactid", 'int'); |
1421 | - $object->fk_project = GETPOST("projectid", 'int'); |
|
1421 | + $object->fk_project = GETPOST("projectid", 'int'); |
|
1422 | 1422 | |
1423 | 1423 | $object->note_private = GETPOST("note", 'restricthtml'); |
1424 | 1424 | } |
@@ -1850,7 +1850,7 @@ discard block |
||
1850 | 1850 | })'; |
1851 | 1851 | print '</script>'."\n"; |
1852 | 1852 | |
1853 | - print '</div>'; // End of div for reminderparameters |
|
1853 | + print '</div>'; // End of div for reminderparameters |
|
1854 | 1854 | } |
1855 | 1855 | |
1856 | 1856 | print dol_get_fiche_end(); |
@@ -1984,9 +1984,12 @@ |
||
1984 | 1984 | |
1985 | 1985 | $parameters = array(); |
1986 | 1986 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1987 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1988 | - if (empty($reshook)) |
|
1989 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
1987 | + if ($reshook < 0) { |
|
1988 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1989 | + } |
|
1990 | + if (empty($reshook)) { |
|
1991 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
1992 | + } |
|
1990 | 1993 | } |
1991 | 1994 | |
1992 | 1995 | print '</table>'; |
@@ -328,7 +328,7 @@ |
||
328 | 328 | |
329 | 329 | foreach ($arrayofvat[$key] as $k => $mt) { |
330 | 330 | if ($mt) { |
331 | - $accountingaccount->fetch($k, null, true); // TODO Use a cache for label |
|
331 | + $accountingaccount->fetch($k, null, true); // TODO Use a cache for label |
|
332 | 332 | $account_label = $accountingaccount->label; |
333 | 333 | |
334 | 334 | // get compte id and label |
@@ -118,7 +118,9 @@ |
||
118 | 118 | |
119 | 119 | if ($year) { |
120 | 120 | if (is_dir($dir.'/'.$year)) { |
121 | - if (!empty($year_dirs)) print '<br>'; |
|
121 | + if (!empty($year_dirs)) { |
|
122 | + print '<br>'; |
|
123 | + } |
|
122 | 124 | print '<br>'; |
123 | 125 | print '<table width="100%" class="noborder">'; |
124 | 126 | print '<tr class="liste_titre">'; |
@@ -1623,9 +1623,13 @@ |
||
1623 | 1623 | |
1624 | 1624 | $parameters = array(); |
1625 | 1625 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
1626 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1627 | - if (empty($reshook)) |
|
1628 | - $object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice |
|
1626 | + if ($reshook < 0) { |
|
1627 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
1628 | + } |
|
1629 | + if (empty($reshook)) { |
|
1630 | + $object->formAddObjectLine(0, $mysoc, $object->thirdparty); |
|
1631 | + } |
|
1632 | + // No date selector for template invoice |
|
1629 | 1633 | } |
1630 | 1634 | } |
1631 | 1635 |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | // Define special_code for special lines |
768 | 768 | $special_code = GETPOST('special_code', 'int'); |
769 | 769 | if ($special_code == 3) { |
770 | - $special_code = 0; // Options should not exists on invoices |
|
770 | + $special_code = 0; // Options should not exists on invoices |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | /*$line = new FactureLigne($db); |
@@ -1608,10 +1608,10 @@ discard block |
||
1608 | 1608 | |
1609 | 1609 | // Lines |
1610 | 1610 | print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">'; |
1611 | - print '<input type="hidden" name="token" value="' . newToken().'">'; |
|
1612 | - print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1611 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1612 | + print '<input type="hidden" name="action" value="'.(($action != 'editline') ? 'addline' : 'updateline').'">'; |
|
1613 | 1613 | print '<input type="hidden" name="mode" value="">'; |
1614 | - print '<input type="hidden" name="id" value="' . $object->id.'">'; |
|
1614 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
1615 | 1615 | print '<input type="hidden" name="page_y" value="">'; |
1616 | 1616 | |
1617 | 1617 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
@@ -421,8 +421,12 @@ discard block |
||
421 | 421 | while ($pagenb < $pageposafternote) { |
422 | 422 | $pdf->AddPage(); |
423 | 423 | $pagenb++; |
424 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
425 | - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
424 | + if (!empty($tplidx)) { |
|
425 | + $pdf->useTemplate($tplidx); |
|
426 | + } |
|
427 | + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { |
|
428 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
429 | + } |
|
426 | 430 | // $this->_pagefoot($pdf,$object,$outputlangs,1); |
427 | 431 | $pdf->setTopMargin($tab_top_newpage); |
428 | 432 | // The only function to edit the bottom margin of current page to set it. |
@@ -475,8 +479,12 @@ discard block |
||
475 | 479 | |
476 | 480 | // apply note frame to last page |
477 | 481 | $pdf->setPage($pageposafternote); |
478 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
479 | - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
482 | + if (!empty($tplidx)) { |
|
483 | + $pdf->useTemplate($tplidx); |
|
484 | + } |
|
485 | + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { |
|
486 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
487 | + } |
|
480 | 488 | $height_note = $posyafter - $tab_top_newpage; |
481 | 489 | $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); |
482 | 490 | } else // No pagebreak |
@@ -493,8 +501,12 @@ discard block |
||
493 | 501 | $pagenb++; |
494 | 502 | $pageposafternote++; |
495 | 503 | $pdf->setPage($pageposafternote); |
496 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
497 | - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
504 | + if (!empty($tplidx)) { |
|
505 | + $pdf->useTemplate($tplidx); |
|
506 | + } |
|
507 | + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { |
|
508 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
509 | + } |
|
498 | 510 | |
499 | 511 | $posyafter = $tab_top_newpage; |
500 | 512 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $pdf->SetTextColor(0, 0, 0); |
324 | 324 | |
325 | 325 | $tab_top = 90; |
326 | - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift: 10); |
|
326 | + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); |
|
327 | 327 | |
328 | 328 | $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; |
329 | 329 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | // Tracking number |
366 | 366 | if (!empty($object->tracking_number)) { |
367 | 367 | $pdf->SetFont('', 'B', $default_font_size - 2); |
368 | - $pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L'); |
|
368 | + $pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L'); |
|
369 | 369 | |
370 | 370 | $tab_top_alt = $pdf->GetY(); |
371 | 371 | $object->getUrlTrackingStatus($object->tracking_number); |