@@ -144,7 +144,9 @@ |
||
144 | 144 | //$socid = $user->socid; |
145 | 145 | accessforbidden(); |
146 | 146 | } |
147 | -if (!$permissiontoread) accessforbidden(); |
|
147 | +if (!$permissiontoread) { |
|
148 | + accessforbidden(); |
|
149 | +} |
|
148 | 150 | |
149 | 151 | |
150 | 152 | /* |
@@ -57,7 +57,9 @@ |
||
57 | 57 | |
58 | 58 | // Category |
59 | 59 | $selected_cat = (int) GETPOST('search_categ', 'int'); |
60 | -if ($selected_cat == -1) $selected_cat = ''; |
|
60 | +if ($selected_cat == -1) { |
|
61 | + $selected_cat = ''; |
|
62 | +} |
|
61 | 63 | $subcat = false; |
62 | 64 | if (GETPOST('subcat', 'alpha') === 'yes') { |
63 | 65 | $subcat = true; |
@@ -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; |
@@ -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(); |
@@ -894,7 +894,10 @@ |
||
894 | 894 | if ($num_rows == 1) { |
895 | 895 | $res = $this->db->fetch_object($resql); |
896 | 896 | $lastinsertid = $res->rowid; |
897 | - if ($is_table_category_link) $lastinsertid = 'linktable'; // used to apply update on tables like llx_categorie_product and avoid being blocked for all file content if at least one entry already exists |
|
897 | + if ($is_table_category_link) { |
|
898 | + $lastinsertid = 'linktable'; |
|
899 | + } |
|
900 | + // used to apply update on tables like llx_categorie_product and avoid being blocked for all file content if at least one entry already exists |
|
898 | 901 | $last_insert_id_array[$tablename] = $lastinsertid; |
899 | 902 | } elseif ($num_rows > 1) { |
900 | 903 | $this->errors[$error]['lib'] = $langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters)); |