@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | if ($reshook > 0) { |
| 133 | 133 | $perm = $hookmanager->resArray['perm']; |
| 134 | 134 | } |
| 135 | - if (! $perm) { |
|
| 135 | + if (!$perm) { |
|
| 136 | 136 | // We should not be here. If we are not allowed to reorder rows, feature should not be visible on script. |
| 137 | 137 | // If we are here, it is a hack attempt, so we report a warning. |
| 138 | 138 | print 'Bad permission to modify position of lines for object in table '.$table_element_line; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | // Reorder line to have position of children lines sharing same counter than parent lines |
| 156 | 156 | // This should be useless because there is no need to have children sharing same counter than parent, but well, it's cleaner into database. |
| 157 | - if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande','fk_contrat'))) { |
|
| 157 | + if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande', 'fk_contrat'))) { |
|
| 158 | 158 | $result = $row->line_order(true); |
| 159 | 159 | } |
| 160 | 160 | } else { |
@@ -1538,7 +1538,9 @@ discard block |
||
| 1538 | 1538 | // Fields from hook |
| 1539 | 1539 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
| 1540 | 1540 | $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
| 1541 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
| 1541 | + if (!empty($hookmanager->resPrint)) { |
|
| 1542 | + $sql.= $hookmanager->resPrint; |
|
| 1543 | + } |
|
| 1542 | 1544 | |
| 1543 | 1545 | $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; |
| 1544 | 1546 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; |
@@ -1554,7 +1556,9 @@ discard block |
||
| 1554 | 1556 | // Fields from hook |
| 1555 | 1557 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
| 1556 | 1558 | $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
| 1557 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
| 1559 | + if (!empty($hookmanager->resPrint)) { |
|
| 1560 | + $sql.= $hookmanager->resPrint; |
|
| 1561 | + } |
|
| 1558 | 1562 | |
| 1559 | 1563 | if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { |
| 1560 | 1564 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; |
@@ -1659,7 +1663,9 @@ discard block |
||
| 1659 | 1663 | // Fields from hook |
| 1660 | 1664 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module); |
| 1661 | 1665 | $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
| 1662 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
| 1666 | + if (!empty($hookmanager->resPrint)) { |
|
| 1667 | + $sql.= $hookmanager->resPrint; |
|
| 1668 | + } |
|
| 1663 | 1669 | |
| 1664 | 1670 | if (is_array($actioncode)) { |
| 1665 | 1671 | foreach ($actioncode as $code) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $nbContact = $obj->nb; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 84 | + dol_setcache($cachekey, $nbContact, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } else { |
| 160 | 160 | dol_print_error($db); |
| 161 | 161 | } |
| 162 | - dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 162 | + dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 163 | 163 | } |
| 164 | 164 | $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; |
| 165 | 165 | $head[$h][1] = $langs->trans("Projects"); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | } else { |
| 319 | 319 | dol_print_error($db); |
| 320 | 320 | } |
| 321 | - dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 321 | + dol_setcache($cachekey, $nbNotif, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.urlencode($object->id); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
| 362 | 362 | $nbLinks = Link::count($db, $object->element, $object->id); |
| 363 | 363 | $totalAttached = $nbFiles + $nbLinks; |
| 364 | - dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 364 | + dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | |
| 376 | 376 | $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; |
| 377 | 377 | $head[$h][1] = $langs->trans("Events"); |
| 378 | - if (isModEnabled('agenda')&& ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { |
|
| 378 | + if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { |
|
| 379 | 379 | $nbEvent = 0; |
| 380 | 380 | // Enable caching of thirdparty count actioncomm |
| 381 | 381 | require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | } else { |
| 395 | 395 | dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
| 396 | 396 | } |
| 397 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 397 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | $head[$h][1] .= '/'; |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | return false; |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | - $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
| 791 | + $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
| 792 | 792 | |
| 793 | 793 | //print "dd".$object->country_code; |
| 794 | 794 | return in_array($object->country_code, $country_code_in_EEC); |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | print '<td class="nowrap center">'; |
| 1355 | 1355 | |
| 1356 | 1356 | // Add to agenda |
| 1357 | - if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) { |
|
| 1357 | + if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) { |
|
| 1358 | 1358 | print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; |
| 1359 | 1359 | print img_object($langs->trans("Event"), "action"); |
| 1360 | 1360 | print '</a> '; |
@@ -1432,7 +1432,7 @@ discard block |
||
| 1432 | 1432 | |
| 1433 | 1433 | if ($showuserlogin) { |
| 1434 | 1434 | print '<td class="tdoverflowmax125">'; |
| 1435 | - $tmpuser= new User($db); |
|
| 1435 | + $tmpuser = new User($db); |
|
| 1436 | 1436 | $resfetch = $tmpuser->fetch(0, '', '', 0, -1, '', $contactstatic->id); |
| 1437 | 1437 | if ($resfetch > 0) { |
| 1438 | 1438 | print $tmpuser->getNomUrl(1, '', 0, 0, 24, 1); |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | print '<td class="nowrap center">'; |
| 1450 | 1450 | |
| 1451 | 1451 | // Add to agenda |
| 1452 | - if (isModEnabled('agenda')&& $user->hasRight('agenda', 'myactions', 'create')) { |
|
| 1452 | + if (isModEnabled('agenda') && $user->hasRight('agenda', 'myactions', 'create')) { |
|
| 1453 | 1453 | print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; |
| 1454 | 1454 | print img_object($langs->trans("Event"), "action"); |
| 1455 | 1455 | print '</a> '; |
@@ -1632,8 +1632,8 @@ discard block |
||
| 1632 | 1632 | |
| 1633 | 1633 | // Fields from hook |
| 1634 | 1634 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
| 1635 | - $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1636 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
| 1635 | + $reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1636 | + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; |
|
| 1637 | 1637 | |
| 1638 | 1638 | $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; |
| 1639 | 1639 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; |
@@ -1648,8 +1648,8 @@ discard block |
||
| 1648 | 1648 | |
| 1649 | 1649 | // Fields from hook |
| 1650 | 1650 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon); |
| 1651 | - $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1652 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
| 1651 | + $reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1652 | + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; |
|
| 1653 | 1653 | |
| 1654 | 1654 | if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { |
| 1655 | 1655 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; |
@@ -1771,8 +1771,8 @@ discard block |
||
| 1771 | 1771 | |
| 1772 | 1772 | // Fields from hook |
| 1773 | 1773 | $parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module); |
| 1774 | - $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1775 | - if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint; |
|
| 1774 | + $reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1775 | + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; |
|
| 1776 | 1776 | |
| 1777 | 1777 | if (is_array($actioncode)) { |
| 1778 | 1778 | foreach ($actioncode as $code) { |
@@ -1880,7 +1880,7 @@ discard block |
||
| 1880 | 1880 | } |
| 1881 | 1881 | } |
| 1882 | 1882 | |
| 1883 | - if (isModEnabled('agenda')|| (isModEnabled('mailing') && !empty($objcon->email))) { |
|
| 1883 | + if (isModEnabled('agenda') || (isModEnabled('mailing') && !empty($objcon->email))) { |
|
| 1884 | 1884 | $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; |
| 1885 | 1885 | |
| 1886 | 1886 | require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
@@ -38,11 +38,11 @@ discard block |
||
| 38 | 38 | $langs->load("products"); |
| 39 | 39 | |
| 40 | 40 | $label = $langs->trans('Product'); |
| 41 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'read'); |
|
| 41 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'read'); |
|
| 42 | 42 | |
| 43 | 43 | if ($object->isService()) { |
| 44 | 44 | $label = $langs->trans('Service'); |
| 45 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'read'); |
|
| 45 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'read'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $h = 0; |
@@ -276,10 +276,10 @@ discard block |
||
| 276 | 276 | if (!empty($object->note_public)) { |
| 277 | 277 | $nbNote++; |
| 278 | 278 | } |
| 279 | - $head[$h][0] = DOL_URL_ROOT .'/product/stock/productlot_note.php?id=' . $object->id; |
|
| 279 | + $head[$h][0] = DOL_URL_ROOT.'/product/stock/productlot_note.php?id='.$object->id; |
|
| 280 | 280 | $head[$h][1] = $langs->trans('Notes'); |
| 281 | 281 | if ($nbNote > 0) { |
| 282 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbNote . '</span>'; |
|
| 282 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>'; |
|
| 283 | 283 | } |
| 284 | 284 | $head[$h][2] = 'note'; |
| 285 | 285 | $h++; |
@@ -175,10 +175,10 @@ |
||
| 175 | 175 | $dispachedLines = $object->getDispachedLines(1); |
| 176 | 176 | $nbDispachedLines = count($dispachedLines); |
| 177 | 177 | |
| 178 | - for ($line = 0 ; $line < $nbDispachedLines; $line++) { |
|
| 178 | + for ($line = 0; $line < $nbDispachedLines; $line++) { |
|
| 179 | 179 | $sumQtyAllreadyDispatched = $sumQtyAllreadyDispatched + $dispachedLines[$line]['qty']; |
| 180 | 180 | } |
| 181 | - for ($line = 0 ; $line < $nbLinesOrdered; $line++) { |
|
| 181 | + for ($line = 0; $line < $nbLinesOrdered; $line++) { |
|
| 182 | 182 | //If line is a product of conf to manage stocks for services |
| 183 | 183 | if ($object->lines[$line]->product_type == 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { |
| 184 | 184 | $sumQtyOrdered = $sumQtyOrdered + $object->lines[$line]->qty; |
@@ -78,19 +78,19 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($keyforuploaddir)))); |
| 80 | 80 | foreach ($listofdir as $key => $tmpdir) { |
| 81 | - $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
| 81 | + $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
| 82 | 82 | if (!$tmpdir) { |
| 83 | 83 | unset($listofdir[$key]); |
| 84 | 84 | continue; |
| 85 | 85 | } |
| 86 | - $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
| 86 | + $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
| 87 | 87 | if (!is_dir($tmpdir)) { |
| 88 | 88 | if (empty($nomessageinsetmoduleoptions)) { |
| 89 | 89 | setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); |
| 90 | 90 | } |
| 91 | 91 | } else { |
| 92 | 92 | $upload_dir = $tmpdir; |
| 93 | - break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
| 93 | + break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -130,19 +130,19 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | foreach ($listofdir as $key => $tmpdir) { |
| 132 | 132 | $tmpdir = trim($tmpdir); |
| 133 | - $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
| 133 | + $tmpdir = preg_replace('/DOL_DATA_ROOT\/*/', '', $tmpdir); // Clean string if we found a hardcoded DOL_DATA_ROOT |
|
| 134 | 134 | if (!$tmpdir) { |
| 135 | 135 | unset($listofdir[$key]); |
| 136 | 136 | continue; |
| 137 | 137 | } |
| 138 | - $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
| 138 | + $tmpdir = DOL_DATA_ROOT.'/'.$tmpdir; // Complete with DOL_DATA_ROOT. Only files into DOL_DATA_ROOT can be reach/set |
|
| 139 | 139 | if (!is_dir($tmpdir)) { |
| 140 | 140 | if (empty($nomessageinsetmoduleoptions)) { |
| 141 | 141 | setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings'); |
| 142 | 142 | } |
| 143 | 143 | } else { |
| 144 | 144 | $upload_dir = $tmpdir; |
| 145 | - break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
| 145 | + break; // So we take the first directory found into setup $conf->global->$keyforuploaddir |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -429,7 +429,7 @@ |
||
| 429 | 429 | if ($mode == 'short_label') { |
| 430 | 430 | return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, " AND unit_type = '".$this->db->escape($unit_type)."'"); |
| 431 | 431 | } elseif ($mode == 'code') { |
| 432 | - return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, " AND unit_type = '". $this->db->escape($unit_type) ."'"); |
|
| 432 | + return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, " AND unit_type = '".$this->db->escape($unit_type)."'"); |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | return $code; |
@@ -427,8 +427,12 @@ discard block |
||
| 427 | 427 | while ($pagenb < $pageposafternote) { |
| 428 | 428 | $pdf->AddPage(); |
| 429 | 429 | $pagenb++; |
| 430 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 431 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
| 430 | + if (!empty($tplidx)) { |
|
| 431 | + $pdf->useTemplate($tplidx); |
|
| 432 | + } |
|
| 433 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
| 434 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
| 435 | + } |
|
| 432 | 436 | // $this->_pagefoot($pdf,$object,$outputlangs,1); |
| 433 | 437 | $pdf->setTopMargin($tab_top_newpage); |
| 434 | 438 | // The only function to edit the bottom margin of current page to set it. |
@@ -481,8 +485,12 @@ discard block |
||
| 481 | 485 | |
| 482 | 486 | // apply note frame to last page |
| 483 | 487 | $pdf->setPage($pageposafternote); |
| 484 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 485 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
| 488 | + if (!empty($tplidx)) { |
|
| 489 | + $pdf->useTemplate($tplidx); |
|
| 490 | + } |
|
| 491 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
| 492 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
| 493 | + } |
|
| 486 | 494 | $height_note = $posyafter - $tab_top_newpage; |
| 487 | 495 | $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); |
| 488 | 496 | } else // No pagebreak |
@@ -499,8 +507,12 @@ discard block |
||
| 499 | 507 | $pagenb++; |
| 500 | 508 | $pageposafternote++; |
| 501 | 509 | $pdf->setPage($pageposafternote); |
| 502 | - if (!empty($tplidx)) $pdf->useTemplate($tplidx); |
|
| 503 | - if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
| 510 | + if (!empty($tplidx)) { |
|
| 511 | + $pdf->useTemplate($tplidx); |
|
| 512 | + } |
|
| 513 | + if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { |
|
| 514 | + $this->_pagehead($pdf, $object, 0, $outputlangs); |
|
| 515 | + } |
|
| 504 | 516 | |
| 505 | 517 | $posyafter = $tab_top_newpage; |
| 506 | 518 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $pdf->SetFont(pdf_getPDFFont($outputlangs)); |
| 250 | 250 | // Set path to the background PDF File |
| 251 | 251 | if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { |
| 252 | - $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 252 | + $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 253 | 253 | $tplidx = $pdf->importPage(1); |
| 254 | 254 | } |
| 255 | 255 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | $pdf->SetTextColor(0, 0, 0); |
| 285 | 285 | |
| 286 | 286 | $tab_top = 90; |
| 287 | - $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift: 10); |
|
| 287 | + $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
|
| 288 | 288 | |
| 289 | 289 | $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; |
| 290 | 290 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $height_trackingnumber = 4; |
| 330 | 330 | |
| 331 | 331 | $pdf->SetFont('', 'B', $default_font_size - 2); |
| 332 | - $pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L'); |
|
| 332 | + $pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L'); |
|
| 333 | 333 | |
| 334 | 334 | $tab_top_alt = $pdf->GetY(); |
| 335 | 335 | $object->getUrlTrackingStatus($object->tracking_number); |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | if (empty($height_trackingnumber)) { |
| 435 | 435 | $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); |
| 436 | 436 | } else { |
| 437 | - $height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1; |
|
| 437 | + $height_note = $this->page_hauteur - ($tab_top + $heightforfooter) + $height_trackingnumber + 1; |
|
| 438 | 438 | $tab_top = $tab_topbeforetrackingnumber; |
| 439 | 439 | } |
| 440 | 440 | $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2); |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | if ($object->volume_units < 50) { |
| 821 | 821 | $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs); |
| 822 | 822 | } else { |
| 823 | - $totalVolumetoshow = price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units); |
|
| 823 | + $totalVolumetoshow = price($object->trueVolume, 0, $outputlangs, 0, 0).' '.measuringUnitString(0, "volume", $object->volume_units); |
|
| 824 | 824 | } |
| 825 | 825 | } |
| 826 | 826 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * \ingroup workstation |
| 24 | 24 | * \brief File of class to manage Workstation numbering rules standard |
| 25 | 25 | */ |
| 26 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php'; |
|
| 26 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/workstation/modules_workstation.php'; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Class to manage the Standard numbering rule for Workstation |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (!$mask) { |
|
| 157 | + if (!$mask) { |
|
| 158 | 158 | $this->error = 'NotConfigured'; |
| 159 | 159 | return 0; |
| 160 | 160 | } |