@@ -258,7 +258,9 @@ |
||
258 | 258 | if (empty($senderissupplier)) { |
259 | 259 | $statustoshow = 1; |
260 | 260 | $statuswarehouse = 'warehouseopen,warehouseinternal'; |
261 | - if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse = 'warehouseopen'; |
|
261 | + if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) { |
|
262 | + $statuswarehouse = 'warehouseopen'; |
|
263 | + } |
|
262 | 264 | if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { |
263 | 265 | // hide products in closed warehouse, but show products for internal transfer |
264 | 266 | $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, $statuswarehouse, GETPOST('combinations', 'array')); |
@@ -596,18 +596,18 @@ |
||
596 | 596 | |
597 | 597 | if (!$date_start) { |
598 | 598 | if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) { |
599 | - print 'jQuery("#date_starthour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");'; |
|
599 | + print 'jQuery("#date_starthour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_HOUR').'");'; |
|
600 | 600 | } |
601 | 601 | if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) { |
602 | - print 'jQuery("#date_startmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");'; |
|
602 | + print 'jQuery("#date_startmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_START_MIN').'");'; |
|
603 | 603 | } |
604 | 604 | } |
605 | 605 | if (!$date_end) { |
606 | 606 | if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) { |
607 | - print 'jQuery("#date_endhour").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");'; |
|
607 | + print 'jQuery("#date_endhour").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_HOUR').'");'; |
|
608 | 608 | } |
609 | 609 | if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) { |
610 | - print 'jQuery("#date_endmin").val("' . getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");'; |
|
610 | + print 'jQuery("#date_endmin").val("'.getDolGlobalString('MAIN_DEFAULT_DATE_END_MIN').'");'; |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | print '</script>'; |
@@ -150,9 +150,9 @@ |
||
150 | 150 | $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; |
151 | 151 | $productstatic->date_modification = $datem; |
152 | 152 | |
153 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'read'); |
|
153 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'read'); |
|
154 | 154 | if ($productstatic->isService()) { |
155 | - $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'read'); |
|
155 | + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'read'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $this->info_box_contents[$line][] = array( |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | $badgeStatus7 = '#baa32b'; |
84 | 84 | $badgeStatus8 = '#993013'; |
85 | 85 | $badgeStatus9 = '#e7f0f0'; |
86 | - if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { |
|
87 | - include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; |
|
86 | + if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php')) { |
|
87 | + include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; |
|
88 | 88 | } |
89 | 89 | $this->max = $max; |
90 | 90 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $colorseriesstat = array(); |
102 | 102 | if ($user->hasRight('ticket', 'read')) { |
103 | 103 | $sql = "SELECT cts.rowid, cts.label, cts.code"; |
104 | - $sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_severity as cts"; |
|
104 | + $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as cts"; |
|
105 | 105 | $sql .= " WHERE cts.active = 1"; |
106 | 106 | $sql .= $this->db->order('cts.rowid', 'ASC'); |
107 | 107 | $resql = $this->db->query($sql); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $dataseries = array(); |
139 | 139 | $data = array(); |
140 | 140 | $sql = "SELECT t.severity_code, COUNT(t.severity_code) as nb"; |
141 | - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t"; |
|
141 | + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t"; |
|
142 | 142 | $sql .= " WHERE t.fk_statut <> 8"; |
143 | 143 | $sql .= " GROUP BY t.severity_code"; |
144 | 144 | $resql = $this->db->query($sql); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | foreach ($listofoppcode as $rowid => $code) { |
154 | 154 | $dataseries[] = array( |
155 | - 'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_severity', 'code', 'label', $code), |
|
155 | + 'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$code, 'c_ticket_severity', 'code', 'label', $code), |
|
156 | 156 | 'data' => (empty($data[$code]) ? 0 : $data[$code]) |
157 | 157 | ); |
158 | 158 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $stringtoprint .= $px1->show($totalnb ? 0 : 1); |
191 | 191 | } |
192 | 192 | $stringtoprint .= '</div>'; |
193 | - $this->info_box_contents[][]=array( |
|
193 | + $this->info_box_contents[][] = array( |
|
194 | 194 | 'td' => 'class="center"', |
195 | 195 | 'text' => $stringtoprint |
196 | 196 | ); |
@@ -756,10 +756,10 @@ |
||
756 | 756 | public function regexpsql($subject, $pattern, $sqlstring = false) |
757 | 757 | { |
758 | 758 | if ($sqlstring) { |
759 | - return "(". $subject ." ~ '" . $pattern . "')"; |
|
759 | + return "(".$subject." ~ '".$pattern."')"; |
|
760 | 760 | } |
761 | 761 | |
762 | - return "('". $subject ."' ~ '" . $pattern . "')"; |
|
762 | + return "('".$subject."' ~ '".$pattern."')"; |
|
763 | 763 | } |
764 | 764 | |
765 | 765 |
@@ -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 |