@@ -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)); |
@@ -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)); |
@@ -46,18 +46,26 @@ discard block |
||
| 46 | 46 | $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); |
| 47 | 47 | $head[$h][0] = dol_buildpath('/product/stock/stocktransfer/stocktransfer_contact.php', 1).'?id='.$object->id; |
| 48 | 48 | $head[$h][1] = $langs->trans('ContactsAddresses'); |
| 49 | - if ($nbContact > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>'; |
|
| 49 | + if ($nbContact > 0) { |
|
| 50 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>'; |
|
| 51 | + } |
|
| 50 | 52 | $head[$h][2] = 'contact'; |
| 51 | 53 | $h++; |
| 52 | 54 | } |
| 53 | 55 | |
| 54 | 56 | if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { |
| 55 | 57 | $nbNote = 0; |
| 56 | - if (!empty($object->note_private)) $nbNote++; |
|
| 57 | - if (!empty($object->note_public)) $nbNote++; |
|
| 58 | + if (!empty($object->note_private)) { |
|
| 59 | + $nbNote++; |
|
| 60 | + } |
|
| 61 | + if (!empty($object->note_public)) { |
|
| 62 | + $nbNote++; |
|
| 63 | + } |
|
| 58 | 64 | $head[$h][0] = dol_buildpath('/product/stock/stocktransfer/stocktransfer_note.php', 1).'?id='.$object->id; |
| 59 | 65 | $head[$h][1] = $langs->trans('Notes'); |
| 60 | - if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); |
|
| 66 | + if ($nbNote > 0) { |
|
| 67 | + $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); |
|
| 68 | + } |
|
| 61 | 69 | $head[$h][2] = 'note'; |
| 62 | 70 | $h++; |
| 63 | 71 | } |
@@ -69,7 +77,9 @@ discard block |
||
| 69 | 77 | $nbLinks = Link::count($db, $object->element, $object->id); |
| 70 | 78 | $head[$h][0] = dol_buildpath("/product/stock/stocktransfer/stocktransfer_document.php", 1).'?id='.$object->id; |
| 71 | 79 | $head[$h][1] = $langs->trans('Documents'); |
| 72 | - if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
| 80 | + if (($nbFiles + $nbLinks) > 0) { |
|
| 81 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
| 82 | + } |
|
| 73 | 83 | $head[$h][2] = 'document'; |
| 74 | 84 | $h++; |
| 75 | 85 | |
@@ -134,8 +134,11 @@ discard block |
||
| 134 | 134 | $resql = $db->query($sql); |
| 135 | 135 | if ($resql) { |
| 136 | 136 | $obj = $db->fetch_object($resql); |
| 137 | - if ($obj) $max = intval($obj->max); |
|
| 138 | - else $max = 0; |
|
| 137 | + if ($obj) { |
|
| 138 | + $max = intval($obj->max); |
|
| 139 | + } else { |
|
| 140 | + $max = 0; |
|
| 141 | + } |
|
| 139 | 142 | } else { |
| 140 | 143 | dol_syslog("mod_stocktransfer_standard::getNextValue", LOG_DEBUG); |
| 141 | 144 | return -1; |
@@ -145,8 +148,13 @@ discard block |
||
| 145 | 148 | $date = $object->date_creation; |
| 146 | 149 | $yymm = strftime("%y%m", $date); |
| 147 | 150 | |
| 148 | - 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 |
|
| 149 | - else $num = sprintf("%04s", $max + 1); |
|
| 151 | + if ($max >= (pow(10, 4) - 1)) { |
|
| 152 | + $num = $max + 1; |
|
| 153 | + } |
|
| 154 | + // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
| 155 | + else { |
|
| 156 | + $num = sprintf("%04s", $max + 1); |
|
| 157 | + } |
|
| 150 | 158 | |
| 151 | 159 | dol_syslog("mod_stocktransfer_standard::getNextValue return ".$this->prefix.$yymm."-".$num); |
| 152 | 160 | return $this->prefix.$yymm."-".$num; |