@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $result = $db->query($sql); |
79 | 79 | if ($result) { |
80 | 80 | $nbline = $db->num_rows($result); |
81 | - for ($i=0; $i < $nbline; $i++) { |
|
81 | + for ($i = 0; $i < $nbline; $i++) { |
|
82 | 82 | $object = $db->fetch_object($result); |
83 | 83 | if (($mode == "barcode" && $barcode == $object->barcode) || ($mode == "lotserial" && $barcode == $object->batch)) { |
84 | 84 | $warehouse->fetch(0, $product["Warehouse"]); |
@@ -88,22 +88,22 @@ discard block |
||
88 | 88 | $fk_product = $object->fk_product; |
89 | 89 | $reelqty = $object->reel; |
90 | 90 | |
91 | - $objectreturn = array('fk_warehouse'=>$warehouseid,'fk_product'=>$fk_product,'reelqty'=>$reelqty); |
|
91 | + $objectreturn = array('fk_warehouse'=>$warehouseid, 'fk_product'=>$fk_product, 'reelqty'=>$reelqty); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | 95 | if ($warehousefound < 1) { |
96 | - $response = array('status'=>'error','errorcode'=>'NotFound','message'=>'No warehouse found for barcode'.$barcode); |
|
96 | + $response = array('status'=>'error', 'errorcode'=>'NotFound', 'message'=>'No warehouse found for barcode'.$barcode); |
|
97 | 97 | } elseif ($warehousefound > 1) { |
98 | - $response = array('status'=>'error','errorcode'=>'TooManyWarehouse','message'=>'Too many warehouse found'); |
|
98 | + $response = array('status'=>'error', 'errorcode'=>'TooManyWarehouse', 'message'=>'Too many warehouse found'); |
|
99 | 99 | } else { |
100 | - $response = array('status'=>'success','message'=>'Warehouse found','object'=>$objectreturn); |
|
100 | + $response = array('status'=>'success', 'message'=>'Warehouse found', 'object'=>$objectreturn); |
|
101 | 101 | } |
102 | 102 | } else { |
103 | - $response = array('status'=>'error','errorcode'=>'NotFound','message'=>"No results found for barcode"); |
|
103 | + $response = array('status'=>'error', 'errorcode'=>'NotFound', 'message'=>"No results found for barcode"); |
|
104 | 104 | } |
105 | 105 | } else { |
106 | - $response = array('status'=>'error','errorcode'=>'ActionError','message'=>"Error on action"); |
|
106 | + $response = array('status'=>'error', 'errorcode'=>'ActionError', 'message'=>"Error on action"); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($action == "addnewlineproduct") { |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | |
123 | 123 | $result = $inventoryline->create($user); |
124 | 124 | if ($result > 0) { |
125 | - $response = array('status'=>'success','message'=>'Success on creating line','id_line'=>$result); |
|
125 | + $response = array('status'=>'success', 'message'=>'Success on creating line', 'id_line'=>$result); |
|
126 | 126 | } else { |
127 | - $response = array('status'=>'error','errorcode'=>'ErrorCreation','message'=>"Error on line creation"); |
|
127 | + $response = array('status'=>'error', 'errorcode'=>'ErrorCreation', 'message'=>"Error on line creation"); |
|
128 | 128 | } |
129 | 129 | } else { |
130 | - $response = array('status'=>'error','errorcode'=>'NoIdForInventory','message'=>"No id for inventory"); |
|
130 | + $response = array('status'=>'error', 'errorcode'=>'NoIdForInventory', 'message'=>"No id for inventory"); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $title = $langs->trans("Multicompanies"); |
82 | 82 | |
83 | 83 | // URL http://mydolibarr/core/multicompany_page?dol_use_jmobile=1 can be used for tests |
84 | -$head = '<!-- Multicompany selection -->'."\n"; // This is used by DoliDroid to know page is a multicompany selection page |
|
84 | +$head = '<!-- Multicompany selection -->'."\n"; // This is used by DoliDroid to know page is a multicompany selection page |
|
85 | 85 | $arrayofjs = array(); |
86 | 86 | $arrayofcss = array(); |
87 | 87 | top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $title = $langs->trans("Bookmarks"); |
59 | 59 | |
60 | 60 | // URL http://mydolibarr/core/bookmarks_page?dol_use_jmobile=1 can be used for tests |
61 | -$head = '<!-- Bookmarks -->'."\n"; // This is used by DoliDroid to know page is a bookmark selection page |
|
61 | +$head = '<!-- Bookmarks -->'."\n"; // This is used by DoliDroid to know page is a bookmark selection page |
|
62 | 62 | $arrayofjs = array(); |
63 | 63 | $arrayofcss = array(); |
64 | 64 | top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $title = $langs->trans("Menu"); |
85 | 85 | |
86 | 86 | // URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests |
87 | -$head = '<!-- Menu -->'."\n"; // This is used by DoliDroid to know page is a menu page |
|
87 | +$head = '<!-- Menu -->'."\n"; // This is used by DoliDroid to know page is a menu page |
|
88 | 88 | $arrayofjs = array(); |
89 | 89 | $arrayofcss = array(); |
90 | 90 | top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); |
@@ -149,7 +149,7 @@ |
||
149 | 149 | $sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED; |
150 | 150 | $sql .= " AND ("; |
151 | 151 | $sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')"; |
152 | -$sql .= " OR"; // For leave over several months |
|
152 | +$sql .= " OR"; // For leave over several months |
|
153 | 153 | $sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') "; |
154 | 154 | $sql .= " )"; |
155 | 155 | if (!empty($search_ref)) { |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $h = 0; |
38 | 38 | $head = array(); |
39 | 39 | |
40 | - $withProjectUrl=''; |
|
41 | - if ($with_project>0) { |
|
40 | + $withProjectUrl = ''; |
|
41 | + if ($with_project > 0) { |
|
42 | 42 | $withProjectUrl = "&withproject=1"; |
43 | 43 | } |
44 | 44 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $head[$h][2] = 'conferenceorbooth'; |
132 | 132 | // Enable caching of conf or booth count attendees |
133 | 133 | $nbAttendees = 0; |
134 | - $nbConferenceOrBooth= 0; |
|
134 | + $nbConferenceOrBooth = 0; |
|
135 | 135 | require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
136 | 136 | $cachekey = 'count_conferenceorbooth_project_'.$object->id; |
137 | 137 | $dataretrieved = dol_getcache($cachekey); |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | $nbAttendees = $dataretrieved; |
140 | 140 | } else { |
141 | 141 | require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; |
142 | - $conforbooth=new ConferenceOrBooth($db); |
|
142 | + $conforbooth = new ConferenceOrBooth($db); |
|
143 | 143 | $result = $conforbooth->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); |
144 | - if (!is_array($result) && $result<0) { |
|
144 | + if (!is_array($result) && $result < 0) { |
|
145 | 145 | setEventMessages($conforbooth->error, $conforbooth->errors, 'errors'); |
146 | 146 | } else { |
147 | 147 | $nbConferenceOrBooth = count($result); |
148 | 148 | } |
149 | - dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
149 | + dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
150 | 150 | } |
151 | 151 | if ($nbConferenceOrBooth > 0) { |
152 | 152 | $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbConferenceOrBooth.'</span>'; |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | $nbAttendees = $dataretrieved; |
166 | 166 | } else { |
167 | 167 | require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; |
168 | - $attendees=new ConferenceOrBoothAttendee($db); |
|
168 | + $attendees = new ConferenceOrBoothAttendee($db); |
|
169 | 169 | $result = $attendees->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); |
170 | - if (!is_array($result) && $result<0) { |
|
170 | + if (!is_array($result) && $result < 0) { |
|
171 | 171 | setEventMessages($attendees->error, $attendees->errors, 'errors'); |
172 | 172 | } else { |
173 | 173 | $nbAttendees = count($result); |
174 | 174 | } |
175 | - dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
175 | + dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
176 | 176 | } |
177 | 177 | if ($nbAttendees > 0) { |
178 | 178 | $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbAttendees.'</span>'; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getExample() |
78 | 78 | { |
79 | - return $this->prefix.'0-0501-0001'; // TC0-0501-0001 |
|
79 | + return $this->prefix.'0-0501-0001'; // TC0-0501-0001 |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | $pryymm = ''; |
93 | 93 | $max = ''; |
94 | 94 | |
95 | - $pos_source = 0; // POS source = Terminal ID |
|
95 | + $pos_source = 0; // POS source = Terminal ID |
|
96 | 96 | |
97 | 97 | // First, we get the max value |
98 | - $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
98 | + $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
99 | 99 | |
100 | 100 | $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; |
101 | 101 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | { |
136 | 136 | global $db; |
137 | 137 | |
138 | - $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; // POS source = Terminal ID |
|
138 | + $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; // POS source = Terminal ID |
|
139 | 139 | |
140 | 140 | // First, we get the max value |
141 | - $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
141 | + $posindice = strlen($this->prefix.$pos_source.'-____-') + 1; // So posindice is position after TCX-YYMM- |
|
142 | 142 | $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL |
143 | 143 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
144 | 144 | $sql .= " WHERE ref LIKE '".$db->escape($this->prefix.$pos_source."-____-%")."'"; |
@@ -373,7 +373,7 @@ |
||
373 | 373 | $caction = new CActionComm($this->db); |
374 | 374 | |
375 | 375 | // Suggest a list with manual events or all auto events |
376 | - $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by. |
|
376 | + $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by. |
|
377 | 377 | if (empty($multiselect)) { |
378 | 378 | // Add empty line at start only if no multiselect |
379 | 379 | array_unshift($arraylist, ' '); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | } else { |
81 | 81 | dol_print_error($db); |
82 | 82 | } |
83 | - dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
83 | + dol_setcache($cachekey, $nbProject, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
84 | 84 | } |
85 | 85 | $head[$tab][0] = DOL_URL_ROOT.'/contact/project.php?id='.$object->id; |
86 | 86 | $head[$tab][1] = $langs->trans("Projects"); |