@@ -813,7 +813,9 @@ |
||
813 | 813 | |
814 | 814 | // Complete vat rate with code |
815 | 815 | $vatrate = $newinvoiceline->tva_tx; |
816 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; |
|
816 | + if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) { |
|
817 | + $vatrate.=' ('.$newinvoiceline->vat_src_code.')'; |
|
818 | + } |
|
817 | 819 | |
818 | 820 | $newinvoiceline->fk_parent_line = $fk_parent_line; |
819 | 821 |
@@ -96,8 +96,14 @@ |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | $daytoparsegmt = dol_now('gmt'); |
99 | -if ($yearofday && $monthofday && $dayofday) $daytoparsegmt = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday, 'gmt'); // xxxofday is value of day after submit action 'addtime' |
|
100 | -elseif ($year && $month && $day) $daytoparsegmt = dol_mktime(0, 0, 0, $month, $day, $year, 'gmt'); // this are value submited after submit of action 'submitdateselect' |
|
99 | +if ($yearofday && $monthofday && $dayofday) { |
|
100 | + $daytoparsegmt = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday, 'gmt'); |
|
101 | +} |
|
102 | +// xxxofday is value of day after submit action 'addtime' |
|
103 | +elseif ($year && $month && $day) { |
|
104 | + $daytoparsegmt = dol_mktime(0, 0, 0, $month, $day, $year, 'gmt'); |
|
105 | +} |
|
106 | +// this are value submited after submit of action 'submitdateselect' |
|
101 | 107 | |
102 | 108 | if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id) { |
103 | 109 | $usertoprocess = $user; |
@@ -191,7 +191,9 @@ |
||
191 | 191 | // Load translation files required by the page |
192 | 192 | $langs->loadLangs(array("agenda", "other", "propal")); |
193 | 193 | |
194 | - if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities("PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref)); |
|
194 | + if (empty($object->actionmsg2)) { |
|
195 | + $object->actionmsg2 = $langs->transnoentities("PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref)); |
|
196 | + } |
|
195 | 197 | $object->actionmsg = $langs->transnoentities("PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref)); |
196 | 198 | |
197 | 199 | $object->sendtoid = 0; |
@@ -49,7 +49,9 @@ |
||
49 | 49 | $socid = GETPOST('socid', 'int'); |
50 | 50 | |
51 | 51 | // Security check |
52 | -if ($user->socid) $socid = $user->socid; |
|
52 | +if ($user->socid) { |
|
53 | + $socid = $user->socid; |
|
54 | +} |
|
53 | 55 | |
54 | 56 | $search_ref = GETPOST('search_ref', 'alpha'); |
55 | 57 | $search_date_startday = GETPOST('search_date_startday', 'int'); |
@@ -129,7 +129,9 @@ |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $object->fields['fk_member']['visible'] = 0; |
132 | -if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1; |
|
132 | +if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) { |
|
133 | + $object->fields['reason_decline_or_cancel']['visible'] = 1; |
|
134 | +} |
|
133 | 135 | $object->fields['note_public']['visible'] = 1; |
134 | 136 | |
135 | 137 |
@@ -109,7 +109,9 @@ discard block |
||
109 | 109 | $filename = basename($filealias); |
110 | 110 | foreach (explode(',', $object->otherlang) as $sublang) { |
111 | 111 | // Avoid to erase main alias file if $sublang is empty string |
112 | - if (empty(trim($sublang))) continue; |
|
112 | + if (empty(trim($sublang))) { |
|
113 | + continue; |
|
114 | + } |
|
113 | 115 | $filealiassub = $dirname.'/'.$sublang.'/'.$filename; |
114 | 116 | |
115 | 117 | $aliascontent = '<?php'."\n"; |
@@ -332,7 +334,9 @@ discard block |
||
332 | 334 | $dirname = dirname($fileindex); |
333 | 335 | foreach (explode(',', $object->otherlang) as $sublang) { |
334 | 336 | // Avoid to erase main alias file if $sublang is empty string |
335 | - if (empty(trim($sublang))) continue; |
|
337 | + if (empty(trim($sublang))) { |
|
338 | + continue; |
|
339 | + } |
|
336 | 340 | $fileindexsub = $dirname.'/'.$sublang.'/index.php'; |
337 | 341 | |
338 | 342 | // Same indexcontent than previously but with ../ instead of ./ for master and tpl file include/require_once. |
@@ -717,8 +717,11 @@ |
||
717 | 717 | $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); |
718 | 718 | break; |
719 | 719 | case 'DOL_PRINT_CURR_DATE': |
720 | - if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
721 | - else $this->printer->text(date($vals[$tplline]['value'])."\n"); |
|
720 | + if (strlen($vals[$tplline]['value'])<2) { |
|
721 | + $this->printer->text(date('d/m/Y H:i:s')."\n"); |
|
722 | + } else { |
|
723 | + $this->printer->text(date($vals[$tplline]['value'])."\n"); |
|
724 | + } |
|
722 | 725 | break; |
723 | 726 | case 'DOL_LINE_FEED': |
724 | 727 | $this->printer->feed(); |
@@ -589,7 +589,9 @@ |
||
589 | 589 | print $object->getLibStatut(5); |
590 | 590 | } elseif ($key == 'fk_parent_line') { |
591 | 591 | $moparent = $object->getMoParent(); |
592 | - if (is_object($moparent)) print $moparent->getNomUrl(1); |
|
592 | + if (is_object($moparent)) { |
|
593 | + print $moparent->getNomUrl(1); |
|
594 | + } |
|
593 | 595 | } elseif ($key == 'rowid') { |
594 | 596 | print $object->showOutputField($val, $key, $object->id, ''); |
595 | 597 | } else { |
@@ -1283,7 +1283,9 @@ discard block |
||
1283 | 1283 | $objectline = new MoLine($this->db); |
1284 | 1284 | |
1285 | 1285 | $TFilters = array('customsql'=>'fk_mo = '.((int) $this->id)); |
1286 | - if (!empty($rolefilter)) $TFilters['role'] = $rolefilter; |
|
1286 | + if (!empty($rolefilter)) { |
|
1287 | + $TFilters['role'] = $rolefilter; |
|
1288 | + } |
|
1287 | 1289 | $result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters); |
1288 | 1290 | |
1289 | 1291 | if (is_numeric($result)) { |
@@ -1519,8 +1521,11 @@ discard block |
||
1519 | 1521 | while ($obj = $this->db->fetch_object($resql)) { |
1520 | 1522 | $MoChild = new Mo($this->db); |
1521 | 1523 | $res = $MoChild->fetch($obj->rowid); |
1522 | - if ($res > 0) $TMoChilds[$MoChild->id] = $MoChild; |
|
1523 | - else $error++; |
|
1524 | + if ($res > 0) { |
|
1525 | + $TMoChilds[$MoChild->id] = $MoChild; |
|
1526 | + } else { |
|
1527 | + $error++; |
|
1528 | + } |
|
1524 | 1529 | } |
1525 | 1530 | } |
1526 | 1531 | } else { |
@@ -1555,7 +1560,9 @@ discard block |
||
1555 | 1560 | if ($this->db->num_rows($resql) > 0) { |
1556 | 1561 | $obj = $this->db->fetch_object($resql); |
1557 | 1562 | $res = $MoParent->fetch($obj->id_moparent); |
1558 | - if ($res < 0) $error++; |
|
1563 | + if ($res < 0) { |
|
1564 | + $error++; |
|
1565 | + } |
|
1559 | 1566 | } else { |
1560 | 1567 | return 0; |
1561 | 1568 | } |