@@ -59,16 +59,23 @@ discard block |
||
59 | 59 | if ($type == 'proposal') |
60 | 60 | { |
61 | 61 | $out=DOL_MAIN_URL_ROOT.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode?'<font color="#666666">':''); |
62 | - if ($mode == 1) $out.='proposal_ref'; |
|
63 | - if ($mode == 0) $out.=urlencode($ref); |
|
62 | + if ($mode == 1) { |
|
63 | + $out.='proposal_ref'; |
|
64 | + } |
|
65 | + if ($mode == 0) { |
|
66 | + $out.=urlencode($ref); |
|
67 | + } |
|
64 | 68 | $out.=($mode?'</font>':''); |
65 | - if ($mode == 1) $out.='&hashp=<font color="#666666">hash_of_file</font>'; |
|
66 | - else |
|
69 | + if ($mode == 1) { |
|
70 | + $out.='&hashp=<font color="#666666">hash_of_file</font>'; |
|
71 | + } else |
|
67 | 72 | { |
68 | 73 | include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; |
69 | 74 | $propaltmp=new Propal($db); |
70 | 75 | $res = $propaltmp->fetch(0, $ref); |
71 | - if ($res <= 0) return 'FailedToGetProposal'; |
|
76 | + if ($res <= 0) { |
|
77 | + return 'FailedToGetProposal'; |
|
78 | + } |
|
72 | 79 | |
73 | 80 | include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
74 | 81 | $ecmfile=new EcmFiles($db); |
@@ -80,8 +87,7 @@ discard block |
||
80 | 87 | { |
81 | 88 | $out = $langs->trans("FeatureOnlineSignDisabled"); |
82 | 89 | return $out; |
83 | - } |
|
84 | - else |
|
90 | + } else |
|
85 | 91 | { |
86 | 92 | $out.='&hashp='.$hashp; |
87 | 93 | } |
@@ -89,7 +95,10 @@ discard block |
||
89 | 95 | } |
90 | 96 | |
91 | 97 | // For multicompany |
92 | - if (! empty($out)) $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities |
|
98 | + if (! empty($out)) { |
|
99 | + $out.="&entity=".$conf->entity; |
|
100 | + } |
|
101 | + // Check the entity because He may be the same reference in several entities |
|
93 | 102 | |
94 | 103 | return $out; |
95 | 104 | } |
@@ -78,13 +78,17 @@ discard block |
||
78 | 78 | if ($resql) |
79 | 79 | { |
80 | 80 | $obj = $db->fetch_object($resql); |
81 | - if ($obj) $nbReceipts = $obj->nb; |
|
81 | + if ($obj) { |
|
82 | + $nbReceipts = $obj->nb; |
|
83 | + } |
|
82 | 84 | $db->free($resql); |
83 | 85 | } |
84 | 86 | |
85 | 87 | $head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id; |
86 | 88 | $head[$h][1] = $langs->trans("AccountStatements"); |
87 | - if (($nbReceipts) > 0) $head[$h][1].= ' <span class="badge">'.($nbReceipts).'</span>'; |
|
89 | + if (($nbReceipts) > 0) { |
|
90 | + $head[$h][1].= ' <span class="badge">'.($nbReceipts).'</span>'; |
|
91 | + } |
|
88 | 92 | $head[$h][2] = 'statement'; |
89 | 93 | $h++; |
90 | 94 | } |
@@ -97,7 +101,9 @@ discard block |
||
97 | 101 | $nbLinks=Link::count($db, $object->element, $object->id); |
98 | 102 | $head[$h][0] = DOL_URL_ROOT . "/compta/bank/document.php?account=" . $object->id; |
99 | 103 | $head[$h][1] = $langs->trans("Documents"); |
100 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
104 | + if (($nbFiles+$nbLinks) > 0) { |
|
105 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
106 | + } |
|
101 | 107 | $head[$h][2] = 'document'; |
102 | 108 | $h++; |
103 | 109 | |
@@ -187,7 +193,9 @@ discard block |
||
187 | 193 | $nbLinks=Link::count($db, $object->element, $object->id); |
188 | 194 | $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/document.php?id='.$object->id; |
189 | 195 | $head[$h][1] = $langs->trans('Documents'); |
190 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
196 | + if (($nbFiles+$nbLinks) > 0) { |
|
197 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
198 | + } |
|
191 | 199 | $head[$h][2] = 'documents'; |
192 | 200 | $h++; |
193 | 201 | |
@@ -230,9 +238,12 @@ discard block |
||
230 | 238 | $iban = new IBAN($account->iban); |
231 | 239 | $check = $iban->Verify(); |
232 | 240 | |
233 | - if ($check) return true; |
|
234 | - else return false; |
|
235 | -} |
|
241 | + if ($check) { |
|
242 | + return true; |
|
243 | + } else { |
|
244 | + return false; |
|
245 | + } |
|
246 | + } |
|
236 | 247 | |
237 | 248 | /** |
238 | 249 | * Check account number informations for a bank account |
@@ -247,10 +258,12 @@ discard block |
||
247 | 258 | // For compatibility between |
248 | 259 | // account of type CompanyBankAccount class (we use number, cle_rib) |
249 | 260 | // account of type Account class (we use num_compte, cle) |
250 | - if (empty($account->number)) |
|
251 | - $account->number = $account->num_compte; |
|
252 | - if (empty($account->cle)) |
|
253 | - $account->cle = $account->cle_rib; |
|
261 | + if (empty($account->number)) { |
|
262 | + $account->number = $account->num_compte; |
|
263 | + } |
|
264 | + if (empty($account->cle)) { |
|
265 | + $account->cle = $account->cle_rib; |
|
266 | + } |
|
254 | 267 | |
255 | 268 | dol_syslog("bank.lib::checkBanForAccount account->code_banque=" . $account->code_banque . " account->code_guichet=" . $account->code_guichet . " account->number=" . $account->number . " account->cle=" . $account->cle . " account->iban=" . $account->iban . " country_code=" . $country_code, LOG_DEBUG); |
256 | 269 | |
@@ -290,12 +303,17 @@ discard block |
||
290 | 303 | return false; |
291 | 304 | } |
292 | 305 | if ($country_code == 'AU') { // Australian |
293 | - if (strlen($account->code_banque) > 7) |
|
294 | - return false; // Sould be 6 but can be 123-456 |
|
295 | - else if (strlen($account->code_banque) < 6) |
|
296 | - return false; // Sould be 6 |
|
297 | - else |
|
298 | - return true; |
|
306 | + if (strlen($account->code_banque) > 7) { |
|
307 | + return false; |
|
308 | + } |
|
309 | + // Sould be 6 but can be 123-456 |
|
310 | + else if (strlen($account->code_banque) < 6) { |
|
311 | + return false; |
|
312 | + } |
|
313 | + // Sould be 6 |
|
314 | + else { |
|
315 | + return true; |
|
316 | + } |
|
299 | 317 | } |
300 | 318 | |
301 | 319 | // No particular rule |
@@ -346,10 +364,12 @@ discard block |
||
346 | 364 | |
347 | 365 | $key = 11 - $sum % 11; |
348 | 366 | |
349 | - if ($key == 10) |
|
350 | - $key = 1; |
|
351 | - if ($key == 11) |
|
352 | - $key = 0; |
|
367 | + if ($key == 10) { |
|
368 | + $key = 1; |
|
369 | + } |
|
370 | + if ($key == 11) { |
|
371 | + $key = 0; |
|
372 | + } |
|
353 | 373 | |
354 | 374 | $keycontrol = $key; |
355 | 375 | |
@@ -361,10 +381,12 @@ discard block |
||
361 | 381 | |
362 | 382 | $key = 11 - $sum % 11; |
363 | 383 | |
364 | - if ($key == 10) |
|
365 | - $key = 1; |
|
366 | - if ($key == 11) |
|
367 | - $key = 0; |
|
384 | + if ($key == 10) { |
|
385 | + $key = 1; |
|
386 | + } |
|
387 | + if ($key == 11) { |
|
388 | + $key = 0; |
|
389 | + } |
|
368 | 390 | |
369 | 391 | $keycontrol .= $key; |
370 | 392 | return $keycontrol; |
@@ -47,7 +47,9 @@ |
||
47 | 47 | $nbLinks=Link::count($db, $object->element, $object->id); |
48 | 48 | $head[$h][0] = DOL_URL_ROOT.'/holiday/document.php?id='.$object->id; |
49 | 49 | $head[$h][1] = $langs->trans('Documents'); |
50 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
50 | + if (($nbFiles+$nbLinks) > 0) { |
|
51 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
52 | + } |
|
51 | 53 | $head[$h][2] = 'documents'; |
52 | 54 | $h++; |
53 | 55 |
@@ -56,12 +56,16 @@ discard block |
||
56 | 56 | |
57 | 57 | @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ($followlocation?true:false)); // We use @ here because this may return warning if safe mode is on or open_basedir is on |
58 | 58 | |
59 | - if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders); |
|
59 | + if (count($addheaders)) { |
|
60 | + curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders); |
|
61 | + } |
|
60 | 62 | curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it |
61 | 63 | |
62 | 64 | // By default use tls decied by PHP. |
63 | 65 | // You can force, if supported a version like TLSv1 or TLSv1.2 |
64 | - if (! empty($conf->global->MAIN_CURL_SSLVERSION)) curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION); |
|
66 | + if (! empty($conf->global->MAIN_CURL_SSLVERSION)) { |
|
67 | + curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION); |
|
68 | + } |
|
65 | 69 | //curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2 |
66 | 70 | |
67 | 71 | //turning off the server and peer verification(TrustManager Concept). |
@@ -77,33 +81,29 @@ discard block |
||
77 | 81 | { |
78 | 82 | curl_setopt($ch, CURLOPT_POST, 1); // POST |
79 | 83 | curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // Setting param x=a&y=z as POST fields |
80 | - } |
|
81 | - else if ($postorget == 'PUT') |
|
84 | + } else if ($postorget == 'PUT') |
|
82 | 85 | { |
83 | 86 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' |
84 | - if (! is_array($param)) parse_str($param, $array_param); |
|
85 | - else |
|
87 | + if (! is_array($param)) { |
|
88 | + parse_str($param, $array_param); |
|
89 | + } else |
|
86 | 90 | { |
87 | 91 | dol_syslog("parameter param must be a string", LOG_WARNING); |
88 | 92 | $array_param=$param; |
89 | 93 | } |
90 | 94 | curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); // Setting param x=a&y=z as PUT fields |
91 | - } |
|
92 | - else if ($postorget == 'PUTALREADYFORMATED') |
|
95 | + } else if ($postorget == 'PUTALREADYFORMATED') |
|
93 | 96 | { |
94 | 97 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' |
95 | 98 | curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // param = content of post, like a xml string |
96 | - } |
|
97 | - else if ($postorget == 'HEAD') |
|
99 | + } else if ($postorget == 'HEAD') |
|
98 | 100 | { |
99 | 101 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD' |
100 | 102 | curl_setopt($ch, CURLOPT_NOBODY, true); |
101 | - } |
|
102 | - else if ($postorget == 'DELETE') |
|
103 | + } else if ($postorget == 'DELETE') |
|
103 | 104 | { |
104 | 105 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); // POST |
105 | - } |
|
106 | - else |
|
106 | + } else |
|
107 | 107 | { |
108 | 108 | curl_setopt($ch, CURLOPT_POST, 0); // GET |
109 | 109 | } |
@@ -114,7 +114,9 @@ discard block |
||
114 | 114 | dol_syslog("getURLContent set proxy to ".$PROXY_HOST. ":" . $PROXY_PORT." - ".$PROXY_USER. ":" . $PROXY_PASS); |
115 | 115 | //curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); // Curl 7.10 |
116 | 116 | curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST. ":" . $PROXY_PORT); |
117 | - if ($PROXY_USER) curl_setopt($ch, CURLOPT_PROXYUSERPWD, $PROXY_USER. ":" . $PROXY_PASS); |
|
117 | + if ($PROXY_USER) { |
|
118 | + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $PROXY_USER. ":" . $PROXY_PASS); |
|
119 | + } |
|
118 | 120 | } |
119 | 121 | |
120 | 122 | //getting response from server |
@@ -137,8 +139,7 @@ discard block |
||
137 | 139 | $rep['curl_error_msg']=curl_error($ch); |
138 | 140 | |
139 | 141 | dol_syslog("getURLContent response array is ".join(',',$rep)); |
140 | - } |
|
141 | - else |
|
142 | + } else |
|
142 | 143 | { |
143 | 144 | $info = curl_getinfo($ch); |
144 | 145 | |
@@ -190,7 +191,9 @@ discard block |
||
190 | 191 | { |
191 | 192 | $prefix=''; |
192 | 193 | $tmpurl = $url; |
193 | - if (preg_match('/^(https?:\/\/)/i', $tmpurl, $reg)) $prefix = $reg[1]; |
|
194 | + if (preg_match('/^(https?:\/\/)/i', $tmpurl, $reg)) { |
|
195 | + $prefix = $reg[1]; |
|
196 | + } |
|
194 | 197 | $tmpurl = preg_replace('/^https?:\/\//i', '', $tmpurl); // Remove http(s):// |
195 | 198 | $tmpurl = preg_replace('/\/.*$/i', '', $tmpurl); // Remove part after domain |
196 | 199 |
@@ -41,8 +41,12 @@ discard block |
||
41 | 41 | { |
42 | 42 | global $db, $langs; |
43 | 43 | |
44 | - if (empty($objectname)) return -1; |
|
45 | - if (empty($readdir)) $readdir=$destdir; |
|
44 | + if (empty($objectname)) { |
|
45 | + return -1; |
|
46 | + } |
|
47 | + if (empty($readdir)) { |
|
48 | + $readdir=$destdir; |
|
49 | + } |
|
46 | 50 | |
47 | 51 | if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval'])) |
48 | 52 | { |
@@ -87,8 +91,11 @@ discard block |
||
87 | 91 | try |
88 | 92 | { |
89 | 93 | include_once $pathoffiletoeditsrc; |
90 | - if (class_exists($objectname)) $object=new $objectname($db); |
|
91 | - else return -4; |
|
94 | + if (class_exists($objectname)) { |
|
95 | + $object=new $objectname($db); |
|
96 | + } else { |
|
97 | + return -4; |
|
98 | + } |
|
92 | 99 | |
93 | 100 | // Backup old file |
94 | 101 | dol_copy($pathoffiletoedittarget, $pathoffiletoedittarget.'.back', $newmask, 1); |
@@ -133,21 +140,39 @@ discard block |
||
133 | 140 | $texttoinsert.= " 'visible'=>".($val['visible']!=''?$val['visible']:-1).","; |
134 | 141 | $texttoinsert.= " 'position'=>".($val['position']!=''?$val['position']:50).","; |
135 | 142 | $texttoinsert.= " 'notnull'=>".($val['notnull']!=''?$val['notnull']:-1).","; |
136 | - if ($val['default']) $texttoinsert.= " 'default'=>'".$val['default']."',"; |
|
137 | - if ($val['index']) $texttoinsert.= " 'index'=>".$val['index'].","; |
|
138 | - if ($val['searchall']) $texttoinsert.= " 'searchall'=>".$val['searchall'].","; |
|
139 | - if ($val['isameasure']) $texttoinsert.= " 'isameasure'=>'".$val['isameasure']."',"; |
|
140 | - if ($val['foreignkey']) $texttoinsert.= " 'foreignkey'=>'".$val['foreignkey']."',"; |
|
141 | - if ($val['help']) $texttoinsert.= " 'help'=>\"".preg_replace('/"/', '', $val['help'])."\","; |
|
142 | - if ($val['comment']) $texttoinsert.= " 'comment'=>\"".preg_replace('/"/', '', $val['comment'])."\","; |
|
143 | - if ($val['showoncombobox']) $texttoinsert.= " 'showoncombobox'=>'".$val['showoncombobox']."',"; |
|
143 | + if ($val['default']) { |
|
144 | + $texttoinsert.= " 'default'=>'".$val['default']."',"; |
|
145 | + } |
|
146 | + if ($val['index']) { |
|
147 | + $texttoinsert.= " 'index'=>".$val['index'].","; |
|
148 | + } |
|
149 | + if ($val['searchall']) { |
|
150 | + $texttoinsert.= " 'searchall'=>".$val['searchall'].","; |
|
151 | + } |
|
152 | + if ($val['isameasure']) { |
|
153 | + $texttoinsert.= " 'isameasure'=>'".$val['isameasure']."',"; |
|
154 | + } |
|
155 | + if ($val['foreignkey']) { |
|
156 | + $texttoinsert.= " 'foreignkey'=>'".$val['foreignkey']."',"; |
|
157 | + } |
|
158 | + if ($val['help']) { |
|
159 | + $texttoinsert.= " 'help'=>\"".preg_replace('/"/', '', $val['help'])."\","; |
|
160 | + } |
|
161 | + if ($val['comment']) { |
|
162 | + $texttoinsert.= " 'comment'=>\"".preg_replace('/"/', '', $val['comment'])."\","; |
|
163 | + } |
|
164 | + if ($val['showoncombobox']) { |
|
165 | + $texttoinsert.= " 'showoncombobox'=>'".$val['showoncombobox']."',"; |
|
166 | + } |
|
144 | 167 | if ($val['arrayofkeyval']) |
145 | 168 | { |
146 | 169 | $texttoinsert.= " 'arrayofkeyval'=>array("; |
147 | 170 | $i=0; |
148 | 171 | foreach($val['arrayofkeyval'] as $key2 => $val2) |
149 | 172 | { |
150 | - if ($i) $texttoinsert.=", "; |
|
173 | + if ($i) { |
|
174 | + $texttoinsert.=", "; |
|
175 | + } |
|
151 | 176 | $texttoinsert.="'".$key2."'=>'".$val2."'"; |
152 | 177 | $i++; |
153 | 178 | } |
@@ -190,8 +215,7 @@ discard block |
||
190 | 215 | @chmod($pathoffiletoedittarget, octdec($newmask)); |
191 | 216 | |
192 | 217 | return $object; |
193 | - } |
|
194 | - catch(Exception $e) |
|
218 | + } catch(Exception $e) |
|
195 | 219 | { |
196 | 220 | print $e->getMessage(); |
197 | 221 | return -5; |
@@ -216,8 +240,12 @@ discard block |
||
216 | 240 | |
217 | 241 | $error = 0; |
218 | 242 | |
219 | - if (empty($objectname)) return -1; |
|
220 | - if (empty($readdir)) $readdir=$destdir; |
|
243 | + if (empty($objectname)) { |
|
244 | + return -1; |
|
245 | + } |
|
246 | + if (empty($readdir)) { |
|
247 | + $readdir=$destdir; |
|
248 | + } |
|
221 | 249 | |
222 | 250 | $pathoffiletoclasssrc=$readdir.'/class/'.strtolower($objectname).'.class.php'; |
223 | 251 | |
@@ -237,11 +265,13 @@ discard block |
||
237 | 265 | if (! is_object($object)) |
238 | 266 | { |
239 | 267 | include_once $pathoffiletoclasssrc; |
240 | - if (class_exists($objectname)) $object=new $objectname($db); |
|
241 | - else return -1; |
|
268 | + if (class_exists($objectname)) { |
|
269 | + $object=new $objectname($db); |
|
270 | + } else { |
|
271 | + return -1; |
|
272 | + } |
|
242 | 273 | } |
243 | - } |
|
244 | - catch(Exception $e) |
|
274 | + } catch(Exception $e) |
|
245 | 275 | { |
246 | 276 | print $e->getMessage(); |
247 | 277 | } |
@@ -262,23 +292,40 @@ discard block |
||
262 | 292 | $type = $val['type']; |
263 | 293 | $type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php' |
264 | 294 | |
265 | - if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database |
|
266 | - else if ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database |
|
267 | - else if ($type == 'link' || $type == 'sellist') $type = 'integer'; |
|
295 | + if ($type == 'html') { |
|
296 | + $type = 'text'; |
|
297 | + } |
|
298 | + // html modulebuilder type is a text type in database |
|
299 | + else if ($type == 'price') { |
|
300 | + $type = 'double'; |
|
301 | + } |
|
302 | + // html modulebuilder type is a text type in database |
|
303 | + else if ($type == 'link' || $type == 'sellist') { |
|
304 | + $type = 'integer'; |
|
305 | + } |
|
268 | 306 | $texttoinsert.= "\t".$key." ".$type; |
269 | - if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY'; |
|
270 | - if ($key == 'entity') $texttoinsert.= ' DEFAULT 1'; |
|
271 | - else |
|
307 | + if ($key == 'rowid') { |
|
308 | + $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY'; |
|
309 | + } |
|
310 | + if ($key == 'entity') { |
|
311 | + $texttoinsert.= ' DEFAULT 1'; |
|
312 | + } else |
|
272 | 313 | { |
273 | 314 | if ($val['default'] != '') |
274 | 315 | { |
275 | - if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL"; |
|
276 | - else if (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'"; |
|
277 | - else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:''); |
|
316 | + if (preg_match('/^null$/i', $val['default'])) { |
|
317 | + $texttoinsert.= " DEFAULT NULL"; |
|
318 | + } else if (preg_match('/varchar/', $type )) { |
|
319 | + $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'"; |
|
320 | + } else { |
|
321 | + $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:''); |
|
322 | + } |
|
278 | 323 | } |
279 | 324 | } |
280 | 325 | $texttoinsert.= (($val['notnull'] > 0)?' NOT NULL':''); |
281 | - if ($i < count($object->fields)) $texttoinsert.=", "; |
|
326 | + if ($i < count($object->fields)) { |
|
327 | + $texttoinsert.=", "; |
|
328 | + } |
|
282 | 329 | $texttoinsert.= "\n"; |
283 | 330 | } |
284 | 331 | } |
@@ -290,8 +337,7 @@ discard block |
||
290 | 337 | if ($result) |
291 | 338 | { |
292 | 339 | @chmod($pathoffiletoedittarget, octdec($newmask)); |
293 | - } |
|
294 | - else |
|
340 | + } else |
|
295 | 341 | { |
296 | 342 | $error++; |
297 | 343 | } |
@@ -335,8 +381,7 @@ discard block |
||
335 | 381 | if ($result) |
336 | 382 | { |
337 | 383 | @chmod($pathoffiletoedittarget, octdec($newmask)); |
338 | - } |
|
339 | - else |
|
384 | + } else |
|
340 | 385 | { |
341 | 386 | $error++; |
342 | 387 | } |
@@ -59,7 +59,9 @@ discard block |
||
59 | 59 | $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$object->id; |
60 | 60 | $head[$h][1] = $langs->trans("Subscriptions"); |
61 | 61 | $head[$h][2] = 'subscription'; |
62 | - if ($nbSubscription > 0) $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>'; |
|
62 | + if ($nbSubscription > 0) { |
|
63 | + $head[$h][1].= ' <span class="badge">'.$nbSubscription.'</span>'; |
|
64 | + } |
|
63 | 65 | $h++; |
64 | 66 | } |
65 | 67 | |
@@ -70,13 +72,21 @@ discard block |
||
70 | 72 | complete_head_from_modules($conf,$langs,$object,$head,$h,'member'); |
71 | 73 | |
72 | 74 | $nbNote = 0; |
73 | - if(!empty($object->note)) $nbNote++; |
|
74 | - if(!empty($object->note_private)) $nbNote++; |
|
75 | - if(!empty($object->note_public)) $nbNote++; |
|
75 | + if(!empty($object->note)) { |
|
76 | + $nbNote++; |
|
77 | + } |
|
78 | + if(!empty($object->note_private)) { |
|
79 | + $nbNote++; |
|
80 | + } |
|
81 | + if(!empty($object->note_public)) { |
|
82 | + $nbNote++; |
|
83 | + } |
|
76 | 84 | $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id; |
77 | 85 | $head[$h][1] = $langs->trans("Note"); |
78 | 86 | $head[$h][2] = 'note'; |
79 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
87 | + if ($nbNote > 0) { |
|
88 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
89 | + } |
|
80 | 90 | $h++; |
81 | 91 | |
82 | 92 | // Attachments |
@@ -87,7 +97,9 @@ discard block |
||
87 | 97 | $nbLinks=Link::count($db, $object->element, $object->id); |
88 | 98 | $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id; |
89 | 99 | $head[$h][1] = $langs->trans('Documents'); |
90 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
100 | + if (($nbFiles+$nbLinks) > 0) { |
|
101 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
102 | + } |
|
91 | 103 | $head[$h][2] = 'document'; |
92 | 104 | $h++; |
93 | 105 |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); |
46 | 46 | $head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id; |
47 | 47 | $head[$h][1] = $langs->trans("ContactsAddresses"); |
48 | - if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
48 | + if ($nbContact > 0) { |
|
49 | + $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>'; |
|
50 | + } |
|
49 | 51 | $head[$h][2] = 'contact'; |
50 | 52 | $h++; |
51 | 53 | } |
@@ -59,11 +61,17 @@ discard block |
||
59 | 61 | if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) |
60 | 62 | { |
61 | 63 | $nbNote = 0; |
62 | - if(!empty($object->note_private)) $nbNote++; |
|
63 | - if(!empty($object->note_public)) $nbNote++; |
|
64 | + if(!empty($object->note_private)) { |
|
65 | + $nbNote++; |
|
66 | + } |
|
67 | + if(!empty($object->note_public)) { |
|
68 | + $nbNote++; |
|
69 | + } |
|
64 | 70 | $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id; |
65 | 71 | $head[$h][1] = $langs->trans("Notes"); |
66 | - if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
72 | + if ($nbNote > 0) { |
|
73 | + $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
74 | + } |
|
67 | 75 | $head[$h][2] = 'note'; |
68 | 76 | $h++; |
69 | 77 | } |
@@ -75,7 +83,9 @@ discard block |
||
75 | 83 | $nbLinks=Link::count($db, $object->element, $object->id); |
76 | 84 | $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id; |
77 | 85 | $head[$h][1] = $langs->trans("Documents"); |
78 | - if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
86 | + if (($nbFiles+$nbLinks) > 0) { |
|
87 | + $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
88 | + } |
|
79 | 89 | $head[$h][2] = 'documents'; |
80 | 90 | $h++; |
81 | 91 |
@@ -55,8 +55,7 @@ |
||
55 | 55 | $_Avery_Labels[$row['code']]['custom_x']=$row['custom_x']; |
56 | 56 | $_Avery_Labels[$row['code']]['custom_y']=$row['custom_y']; |
57 | 57 | } |
58 | -} |
|
59 | -else |
|
58 | +} else |
|
60 | 59 | { |
61 | 60 | dol_print_error($db); |
62 | 61 | } |
@@ -59,7 +59,9 @@ discard block |
||
59 | 59 | $nbLinks=Link::count($db, $object->element, $object->id); |
60 | 60 | $head[$tab][0] = DOL_URL_ROOT.'/loan/document.php?id='.$object->id; |
61 | 61 | $head[$tab][1] = $langs->trans("Documents"); |
62 | - if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
62 | + if (($nbFiles+$nbLinks) > 0) { |
|
63 | + $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>'; |
|
64 | + } |
|
63 | 65 | $head[$tab][2] = 'documents'; |
64 | 66 | $tab++; |
65 | 67 | |
@@ -68,7 +70,9 @@ discard block |
||
68 | 70 | $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); |
69 | 71 | $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; |
70 | 72 | $head[$tab][1] = $langs->trans("Notes"); |
71 | - if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
73 | + if($nbNote > 0) { |
|
74 | + $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>'; |
|
75 | + } |
|
72 | 76 | $head[$tab][2] = 'note'; |
73 | 77 | $tab++; |
74 | 78 | } |