@@ -1615,7 +1615,9 @@ |
||
1615 | 1615 | global $conf, $langs; |
1616 | 1616 | |
1617 | 1617 | $ltrdirection = 'L'; |
1618 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1618 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1619 | + $ltrdirection = 'R'; |
|
1620 | + } |
|
1619 | 1621 | |
1620 | 1622 | // Load traductions files required by page |
1621 | 1623 | $outputlangs->loadLangs(array("main", "bills", "propal", "companies")); |
@@ -1120,7 +1120,9 @@ |
||
1120 | 1120 | global $langs, $conf, $mysoc; |
1121 | 1121 | |
1122 | 1122 | $ltrdirection = 'L'; |
1123 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1123 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1124 | + $ltrdirection = 'R'; |
|
1125 | + } |
|
1124 | 1126 | |
1125 | 1127 | // Load translation files required by the page |
1126 | 1128 | $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); |
@@ -829,7 +829,10 @@ |
||
829 | 829 | break; // Should not happen |
830 | 830 | } |
831 | 831 | |
832 | - if (empty($obj->country_code)) $obj->country_code = ''; // TODO Add join in select with country table to get country_code |
|
832 | + if (empty($obj->country_code)) { |
|
833 | + $obj->country_code = ''; |
|
834 | + } |
|
835 | + // TODO Add join in select with country table to get country_code |
|
833 | 836 | |
834 | 837 | // Store properties in $object |
835 | 838 | $object->setVarsFromFetchObj($obj); |
@@ -436,8 +436,12 @@ discard block |
||
436 | 436 | $tmpuser->fetch($object->user_author_id); |
437 | 437 | |
438 | 438 | $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); |
439 | - if ($tmpuser->email) $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; |
|
440 | - if ($tmpuser->office_phone) $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; |
|
439 | + if ($tmpuser->email) { |
|
440 | + $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; |
|
441 | + } |
|
442 | + if ($tmpuser->office_phone) { |
|
443 | + $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; |
|
444 | + } |
|
441 | 445 | |
442 | 446 | $notetoshow = dol_concatdesc($notetoshow, $creator_info); |
443 | 447 | } |
@@ -1519,7 +1523,9 @@ discard block |
||
1519 | 1523 | global $conf, $langs; |
1520 | 1524 | |
1521 | 1525 | $ltrdirection = 'L'; |
1522 | - if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; |
|
1526 | + if ($outputlangs->trans("DIRECTION") == 'rtl') { |
|
1527 | + $ltrdirection = 'R'; |
|
1528 | + } |
|
1523 | 1529 | |
1524 | 1530 | // Load traductions files required by page |
1525 | 1531 | $outputlangs->loadLangs(array("main", "propal", "companies", "bills")); |
@@ -197,12 +197,18 @@ discard block |
||
197 | 197 | |
198 | 198 | // Clean parameters |
199 | 199 | $price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value. |
200 | - if (empty($price)) $price = 0; |
|
200 | + if (empty($price)) { |
|
201 | + $price = 0; |
|
202 | + } |
|
201 | 203 | $now = (!empty($datem) ? $datem : dol_now()); |
202 | 204 | |
203 | 205 | // Check parameters |
204 | - if (!($fk_product > 0)) return 0; |
|
205 | - if (!($entrepot_id > 0)) return 0; |
|
206 | + if (!($fk_product > 0)) { |
|
207 | + return 0; |
|
208 | + } |
|
209 | + if (!($entrepot_id > 0)) { |
|
210 | + return 0; |
|
211 | + } |
|
206 | 212 | |
207 | 213 | if (is_numeric($eatby) && $eatby < 0) { |
208 | 214 | dol_syslog(get_class($this)."::_create start ErrorBadValueForParameterEatBy eatby = ".$eatby); |
@@ -245,7 +251,9 @@ discard block |
||
245 | 251 | // Define if we must make the stock change (If product type is a service or if stock is used also for services) |
246 | 252 | // Only record into stock tables wil be disabled by this (the rest like writing into lot table or movement of subproucts are done) |
247 | 253 | $movestock = 0; |
248 | - if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock = 1; |
|
254 | + if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { |
|
255 | + $movestock = 1; |
|
256 | + } |
|
249 | 257 | |
250 | 258 | $this->db->begin(); |
251 | 259 | |
@@ -377,7 +385,9 @@ discard block |
||
377 | 385 | } |
378 | 386 | |
379 | 387 | $foundforbatch = 1; |
380 | - if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; |
|
388 | + if ($prodbatch->qty < abs($qty)) { |
|
389 | + $qtyisnotenough = $prodbatch->qty; |
|
390 | + } |
|
381 | 391 | break; |
382 | 392 | } |
383 | 393 | if (!$foundforbatch || $qtyisnotenough) { |
@@ -578,7 +588,9 @@ discard block |
||
578 | 588 | if ($movestock && !$error) { |
579 | 589 | // Call trigger |
580 | 590 | $result = $this->call_trigger('STOCK_MOVEMENT', $user); |
581 | - if ($result < 0) $error++; |
|
591 | + if ($result < 0) { |
|
592 | + $error++; |
|
593 | + } |
|
582 | 594 | // End call triggers |
583 | 595 | |
584 | 596 | // Check unicity for serial numbered equipments once all movement were done. |
@@ -845,7 +857,9 @@ discard block |
||
845 | 857 | $resql = $this->db->query($sql); |
846 | 858 | if ($resql) { |
847 | 859 | $obj = $this->db->fetch_object($resql); |
848 | - if ($obj) $nb = $obj->nb; |
|
860 | + if ($obj) { |
|
861 | + $nb = $obj->nb; |
|
862 | + } |
|
849 | 863 | return (empty($nb) ? 0 : $nb); |
850 | 864 | } else { |
851 | 865 | dol_print_error($this->db); |
@@ -113,8 +113,10 @@ |
||
113 | 113 | $search_all = GETPOST("search_all", 'alpha'); |
114 | 114 | $search = array(); |
115 | 115 | foreach ($object->fields as $key => $val) { |
116 | - if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
117 | -} |
|
116 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
117 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
118 | + } |
|
119 | + } |
|
118 | 120 | |
119 | 121 | // List of fields to search into when doing a "search in all" |
120 | 122 | $fieldstosearchall = array(); |
@@ -1336,7 +1336,9 @@ discard block |
||
1336 | 1336 | $deliverableQty = min($quantityToBeDelivered, $stock); |
1337 | 1337 | } |
1338 | 1338 | |
1339 | - if ($deliverableQty < 0) $deliverableQty = 0; |
|
1339 | + if ($deliverableQty < 0) { |
|
1340 | + $deliverableQty = 0; |
|
1341 | + } |
|
1340 | 1342 | |
1341 | 1343 | $tooltip = ''; |
1342 | 1344 | if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { |
@@ -1435,7 +1437,9 @@ discard block |
||
1435 | 1437 | $deliverableQty = min($quantityToBeDelivered, $batchStock); |
1436 | 1438 | } |
1437 | 1439 | |
1438 | - if ($deliverableQty < 0) $deliverableQty = 0; |
|
1440 | + if ($deliverableQty < 0) { |
|
1441 | + $deliverableQty = 0; |
|
1442 | + } |
|
1439 | 1443 | |
1440 | 1444 | $inputName = 'qtyl'.$indiceAsked.'_'.$subj; |
1441 | 1445 | if (GETPOSTISSET($inputName)) { |
@@ -81,7 +81,9 @@ discard block |
||
81 | 81 | $sql .= " AND f.fk_soc = ".((int) $socid); |
82 | 82 | } |
83 | 83 | } |
84 | - if ($draftonly) $sql .= " AND f.fk_statut = 0"; |
|
84 | + if ($draftonly) { |
|
85 | + $sql .= " AND f.fk_statut = 0"; |
|
86 | + } |
|
85 | 87 | |
86 | 88 | dol_syslog(get_class($this)."::select_intervention", LOG_DEBUG); |
87 | 89 | $resql = $this->db->query($sql); |
@@ -89,8 +91,11 @@ discard block |
||
89 | 91 | $out .= '<select id="interventionid" class="flat" name="'.dol_escape_htmltag($htmlname).'">'; |
90 | 92 | if ($showempty) { |
91 | 93 | $out .= '<option value="0">'; |
92 | - if (!is_numeric($showempty)) $out .= $showempty; |
|
93 | - else $out .= ' '; |
|
94 | + if (!is_numeric($showempty)) { |
|
95 | + $out .= $showempty; |
|
96 | + } else { |
|
97 | + $out .= ' '; |
|
98 | + } |
|
94 | 99 | $out .= '</option>'; |
95 | 100 | } |
96 | 101 | $num = $this->db->num_rows($resql); |
@@ -143,8 +143,13 @@ |
||
143 | 143 | $date = dol_now(); |
144 | 144 | $yymm = strftime("%y%m", $date); |
145 | 145 | |
146 | - if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
147 | - else $num = sprintf("%04s", $max + 1); |
|
146 | + if ($max >= (pow(10, 4) - 1)) { |
|
147 | + $num = $max + 1; |
|
148 | + } |
|
149 | + // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
150 | + else { |
|
151 | + $num = sprintf("%04s", $max + 1); |
|
152 | + } |
|
148 | 153 | |
149 | 154 | dol_syslog("mod_sn_standard::getNextValue return ".$this->prefix.$yymm."-".$num); |
150 | 155 | return $this->prefix.$yymm."-".$num; |