@@ -465,9 +465,15 @@ discard block |
||
465 | 465 | $group_error++; |
466 | 466 | break; |
467 | 467 | } |
468 | - if (!isset($lettering_code)) $lettering_code = (string) $line_infos['lettering_code']; |
|
469 | - if (!empty($line_infos['lettering_code'])) $do_it = true; |
|
470 | - } elseif (!empty($line_infos['lettering_code'])) $do_it = false; |
|
468 | + if (!isset($lettering_code)) { |
|
469 | + $lettering_code = (string) $line_infos['lettering_code']; |
|
470 | + } |
|
471 | + if (!empty($line_infos['lettering_code'])) { |
|
472 | + $do_it = true; |
|
473 | + } |
|
474 | + } elseif (!empty($line_infos['lettering_code'])) { |
|
475 | + $do_it = false; |
|
476 | + } |
|
471 | 477 | } |
472 | 478 | |
473 | 479 | // Check balance amount |
@@ -478,8 +484,11 @@ discard block |
||
478 | 484 | |
479 | 485 | // Lettering/Unlettering the group of bookkeeping lines |
480 | 486 | if (!$group_error && $do_it) { |
481 | - if ($unlettering) $result = $this->deleteLettering($bookkeeping_lines); |
|
482 | - else $result = $this->updateLettering($bookkeeping_lines); |
|
487 | + if ($unlettering) { |
|
488 | + $result = $this->deleteLettering($bookkeeping_lines); |
|
489 | + } else { |
|
490 | + $result = $this->updateLettering($bookkeeping_lines); |
|
491 | + } |
|
483 | 492 | if ($result < 0) { |
484 | 493 | $group_error++; |
485 | 494 | } else { |
@@ -530,7 +539,9 @@ discard block |
||
530 | 539 | $sql .= " AND pn.piece_num = ab.piece_num"; |
531 | 540 | $sql .= " )"; |
532 | 541 | } |
533 | - if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''"; |
|
542 | + if ($only_has_subledger_account) { |
|
543 | + $sql .= " AND ab.subledger_account != ''"; |
|
544 | + } |
|
534 | 545 | |
535 | 546 | dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG); |
536 | 547 | $resql = $this->db->query($sql); |
@@ -604,7 +615,9 @@ discard block |
||
604 | 615 | $sql .= " AND dpn.piece_num = ab.piece_num"; |
605 | 616 | $sql .= " )"; |
606 | 617 | $sql .= ")"; |
607 | - if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''"; |
|
618 | + if ($only_has_subledger_account) { |
|
619 | + $sql .= " AND ab.subledger_account != ''"; |
|
620 | + } |
|
608 | 621 | |
609 | 622 | dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG); |
610 | 623 | $resql = $this->db->query($sql); |
@@ -625,7 +638,9 @@ discard block |
||
625 | 638 | } |
626 | 639 | $this->db->free($resql); |
627 | 640 | |
628 | - if (!empty($group)) $grouped_lines[] = $group; |
|
641 | + if (!empty($group)) { |
|
642 | + $grouped_lines[] = $group; |
|
643 | + } |
|
629 | 644 | } |
630 | 645 | } |
631 | 646 | |
@@ -821,7 +836,9 @@ discard block |
||
821 | 836 | |
822 | 837 | foreach ($element_ids as $element_id) { |
823 | 838 | // Continue if element id in not found |
824 | - if (!isset($link_by_element[$element_id])) continue; |
|
839 | + if (!isset($link_by_element[$element_id])) { |
|
840 | + continue; |
|
841 | + } |
|
825 | 842 | |
826 | 843 | // Set the element in the current group |
827 | 844 | $current_group[$element_id] = $element_id; |
@@ -385,8 +385,12 @@ discard block |
||
385 | 385 | global $hookmanager; |
386 | 386 | |
387 | 387 | // Clean parameters |
388 | - if (empty($type)) $type = 'view'; |
|
389 | - if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet'; |
|
388 | + if (empty($type)) { |
|
389 | + $type = 'view'; |
|
390 | + } |
|
391 | + if (empty($in_bookkeeping)) { |
|
392 | + $in_bookkeeping = 'notyet'; |
|
393 | + } |
|
390 | 394 | |
391 | 395 | // Hook |
392 | 396 | if (!is_object($hookmanager)) { |
@@ -686,7 +690,9 @@ discard block |
||
686 | 690 | |
687 | 691 | $disposal_amount_vat = $disposal_subject_to_vat ? (double) price2num($disposal_amount * $disposal_vat / 100, 'MT') : 0; |
688 | 692 | $lines[1][$accountancy_code_receivable_on_assignment] = -($disposal_amount + $disposal_amount_vat); |
689 | - if ($disposal_subject_to_vat) $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat; |
|
693 | + if ($disposal_subject_to_vat) { |
|
694 | + $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat; |
|
695 | + } |
|
690 | 696 | $lines[1][$accountancy_code_proceeds_from_sales] = $disposal_amount; |
691 | 697 | |
692 | 698 | foreach ($lines as $lines_block) { |
@@ -956,7 +962,9 @@ discard block |
||
956 | 962 | { |
957 | 963 | global $conf, $langs, $hookmanager; |
958 | 964 | |
959 | - if (empty($sep)) $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; |
|
965 | + if (empty($sep)) { |
|
966 | + $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; |
|
967 | + } |
|
960 | 968 | $out = ''; |
961 | 969 | |
962 | 970 | // Hook |
@@ -1012,7 +1020,9 @@ discard block |
||
1012 | 1020 | ); |
1013 | 1021 | } |
1014 | 1022 | |
1015 | - if (!empty($header)) $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n"; |
|
1023 | + if (!empty($header)) { |
|
1024 | + $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n"; |
|
1025 | + } |
|
1016 | 1026 | foreach ($journal_data as $element_id => $element) { |
1017 | 1027 | foreach ($element['blocks'] as $lines) { |
1018 | 1028 | foreach ($lines as $line) { |
@@ -3640,9 +3640,12 @@ |
||
3640 | 3640 | |
3641 | 3641 | $parameters = array(); |
3642 | 3642 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
3643 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
3644 | - if (empty($reshook)) |
|
3645 | - $object->formAddObjectLine(1, $societe, $mysoc); |
|
3643 | + if ($reshook < 0) { |
|
3644 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
3645 | + } |
|
3646 | + if (empty($reshook)) { |
|
3647 | + $object->formAddObjectLine(1, $societe, $mysoc); |
|
3648 | + } |
|
3646 | 3649 | } |
3647 | 3650 | } |
3648 | 3651 |
@@ -687,8 +687,9 @@ discard block |
||
687 | 687 | $newlang = ''; |
688 | 688 | if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) { |
689 | 689 | $newlang = $object->thirdparty->default_lang; |
690 | - if (GETPOST('lang_id', 'aZ09')) |
|
691 | - $newlang = GETPOST('lang_id', 'aZ09'); |
|
690 | + if (GETPOST('lang_id', 'aZ09')) { |
|
691 | + $newlang = GETPOST('lang_id', 'aZ09'); |
|
692 | + } |
|
692 | 693 | } |
693 | 694 | if (!empty($newlang)) { |
694 | 695 | $outputlangs = new Translate("", $conf); |
@@ -2427,9 +2428,12 @@ discard block |
||
2427 | 2428 | |
2428 | 2429 | $parameters = array(); |
2429 | 2430 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
2430 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2431 | - if (empty($reshook)) |
|
2432 | - $object->formAddObjectLine(1, $societe, $mysoc); |
|
2431 | + if ($reshook < 0) { |
|
2432 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
2433 | + } |
|
2434 | + if (empty($reshook)) { |
|
2435 | + $object->formAddObjectLine(1, $societe, $mysoc); |
|
2436 | + } |
|
2433 | 2437 | } |
2434 | 2438 | } |
2435 | 2439 | print '</table>'; |
@@ -68,8 +68,12 @@ discard block |
||
68 | 68 | $offset = $limit * $page; |
69 | 69 | $pageprev = $page - 1; |
70 | 70 | $pagenext = $page + 1; |
71 | -if (!$sortfield) $sortfield = "cr.date_sync"; |
|
72 | -if (!$sortorder) $sortorder = "DESC"; |
|
71 | +if (!$sortfield) { |
|
72 | + $sortfield = "cr.date_sync"; |
|
73 | +} |
|
74 | +if (!$sortorder) { |
|
75 | + $sortorder = "DESC"; |
|
76 | +} |
|
73 | 77 | |
74 | 78 | |
75 | 79 | // Initialize technical objects |
@@ -217,7 +221,9 @@ discard block |
||
217 | 221 | |
218 | 222 | $parameters = array(); |
219 | 223 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
220 | -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
224 | +if ($reshook < 0) { |
|
225 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
226 | +} |
|
221 | 227 | if (empty($reshook)) { |
222 | 228 | // Selection of new fields |
223 | 229 | include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
@@ -303,14 +309,20 @@ discard block |
||
303 | 309 | $sql .= $hookmanager->resPrint; |
304 | 310 | $sql .= ' FROM '.MAIN_DB_PREFIX.'multicurrency_rate as cr '; |
305 | 311 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."multicurrency AS m ON cr.fk_multicurrency = m.rowid"; |
306 | -if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); |
|
312 | +if ($sall) { |
|
313 | + $sql .= natural_search(array_keys($fieldstosearchall), $sall); |
|
314 | +} |
|
307 | 315 | if ($search_date_sync && $search_date_sync_end ) { |
308 | 316 | $sql .= " AND (cr.date_sync BETWEEN '".$db->idate($search_date_sync)."' AND '".$db->idate($search_date_sync_end)."')"; |
309 | 317 | } elseif ($search_date_sync && !$search_date_sync_end) { |
310 | 318 | $sql .= natural_search('cr.date_sync', $db->idate($search_date_sync)); |
311 | 319 | } |
312 | -if ($search_rate) $sql .= natural_search('cr.rate', $search_rate); |
|
313 | -if ($search_code) $sql .= natural_search('m.code', $search_code); |
|
320 | +if ($search_rate) { |
|
321 | + $sql .= natural_search('cr.rate', $search_rate); |
|
322 | +} |
|
323 | +if ($search_code) { |
|
324 | + $sql .= natural_search('m.code', $search_code); |
|
325 | +} |
|
314 | 326 | $sql .= " WHERE m.code <> '".$db->escape($conf->currency)."'"; |
315 | 327 | |
316 | 328 | // Add where from hooks |
@@ -360,10 +372,18 @@ discard block |
||
360 | 372 | $param .= "&sall=".urlencode($sall); |
361 | 373 | } |
362 | 374 | |
363 | - if ($search_date_sync) $param = "&search_date_sync=".$search_date_sync; |
|
364 | - if ($search_date_sync_end) $param="&search_date_sync_end=".$search_date_sync_end; |
|
365 | - if ($search_rate) $param = "&search_rate=".urlencode($search_rate); |
|
366 | - if ($search_code != '') $param.="&search_code=".urlencode($search_code); |
|
375 | + if ($search_date_sync) { |
|
376 | + $param = "&search_date_sync=".$search_date_sync; |
|
377 | + } |
|
378 | + if ($search_date_sync_end) { |
|
379 | + $param="&search_date_sync_end=".$search_date_sync_end; |
|
380 | + } |
|
381 | + if ($search_rate) { |
|
382 | + $param = "&search_rate=".urlencode($search_rate); |
|
383 | + } |
|
384 | + if ($search_code != '') { |
|
385 | + $param.="&search_code=".urlencode($search_code); |
|
386 | + } |
|
367 | 387 | |
368 | 388 | // Add $param from extra fields |
369 | 389 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
@@ -506,7 +526,9 @@ discard block |
||
506 | 526 | print '<td class="tdoverflowmax200">'; |
507 | 527 | print $obj->date_sync; |
508 | 528 | print "</td>\n"; |
509 | - if (!$i) $totalarray['nbfield']++; |
|
529 | + if (!$i) { |
|
530 | + $totalarray['nbfield']++; |
|
531 | + } |
|
510 | 532 | } |
511 | 533 | |
512 | 534 | // code |
@@ -516,7 +538,9 @@ discard block |
||
516 | 538 | print ' - <span class="opacitymedium">'.$obj->name.'</span>'; |
517 | 539 | print "</td>\n"; |
518 | 540 | |
519 | - if (! $i) $totalarray['nbfield']++; |
|
541 | + if (! $i) { |
|
542 | + $totalarray['nbfield']++; |
|
543 | + } |
|
520 | 544 | } |
521 | 545 | |
522 | 546 | // rate |
@@ -524,7 +548,9 @@ discard block |
||
524 | 548 | print '<td class="tdoverflowmax200">'; |
525 | 549 | print $obj->rate; |
526 | 550 | print "</td>\n"; |
527 | - if (! $i) $totalarray['nbfield']++; |
|
551 | + if (! $i) { |
|
552 | + $totalarray['nbfield']++; |
|
553 | + } |
|
528 | 554 | } |
529 | 555 | |
530 | 556 |
@@ -23,7 +23,9 @@ |
||
23 | 23 | * \brief Main page for ECM section area |
24 | 24 | */ |
25 | 25 | |
26 | -if (! defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1); |
|
26 | +if (! defined('DISABLE_JS_GRAHP')) { |
|
27 | + define('DISABLE_JS_GRAPH', 1); |
|
28 | +} |
|
27 | 29 | |
28 | 30 | // Load Dolibarr environment |
29 | 31 | require '../main.inc.php'; |
@@ -37,7 +37,9 @@ discard block |
||
37 | 37 | $langs->loadLangs(array("admin", "stocks")); |
38 | 38 | |
39 | 39 | // Access control |
40 | -if (!$user->admin) accessforbidden(); |
|
40 | +if (!$user->admin) { |
|
41 | + accessforbidden(); |
|
42 | +} |
|
41 | 43 | |
42 | 44 | // Parameters |
43 | 45 | $action = GETPOST('action', 'alpha'); |
@@ -69,7 +71,9 @@ discard block |
||
69 | 71 | |
70 | 72 | if ($maskconststocktransfer) { |
71 | 73 | $res = dolibarr_set_const($db, $maskconststocktransfer, $maskstocktransfer, 'chaine', 0, '', $conf->entity); |
72 | - if ($res <= 0) $error++; |
|
74 | + if ($res <= 0) { |
|
75 | + $error++; |
|
76 | + } |
|
73 | 77 | } |
74 | 78 | |
75 | 79 | if (!$error) { |
@@ -230,7 +234,9 @@ discard block |
||
230 | 234 | $myTmpObjects[$moduledir]=array('includerefgeneration'=>1, 'includedocgeneration'=>1); |
231 | 235 | |
232 | 236 | foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { |
233 | - if ($myTmpObjectKey == 'MyObject') continue; |
|
237 | + if ($myTmpObjectKey == 'MyObject') { |
|
238 | + continue; |
|
239 | + } |
|
234 | 240 | if ($myTmpObjectArray['includerefgeneration']) { |
235 | 241 | /* |
236 | 242 | * Orders Numbering model |
@@ -265,8 +271,12 @@ discard block |
||
265 | 271 | $module = new $file($db); |
266 | 272 | |
267 | 273 | // Show modules according to features level |
268 | - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; |
|
269 | - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; |
|
274 | + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { |
|
275 | + continue; |
|
276 | + } |
|
277 | + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { |
|
278 | + continue; |
|
279 | + } |
|
270 | 280 | |
271 | 281 | if ($module->isEnabled()) { |
272 | 282 | dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); |
@@ -278,9 +288,13 @@ discard block |
||
278 | 288 | // Show example of numbering model |
279 | 289 | print '<td class="nowrap">'; |
280 | 290 | $tmp = $module->getExample(); |
281 | - if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
282 | - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); |
|
283 | - else print $tmp; |
|
291 | + if (preg_match('/^Error/', $tmp)) { |
|
292 | + print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
293 | + } elseif ($tmp == 'NotConfigured') { |
|
294 | + print $langs->trans($tmp); |
|
295 | + } else { |
|
296 | + print $tmp; |
|
297 | + } |
|
284 | 298 | print '</td>'."\n"; |
285 | 299 | |
286 | 300 | print '<td class="center">'; |
@@ -305,8 +319,9 @@ discard block |
||
305 | 319 | if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval |
306 | 320 | $htmltooltip .= ''.$langs->trans("NextValue").': '; |
307 | 321 | if ($nextval) { |
308 | - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') |
|
309 | - $nextval = $langs->trans($nextval); |
|
322 | + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { |
|
323 | + $nextval = $langs->trans($nextval); |
|
324 | + } |
|
310 | 325 | $htmltooltip .= $nextval.'<br>'; |
311 | 326 | } else { |
312 | 327 | $htmltooltip .= $langs->trans($module->error).'<br>'; |
@@ -392,15 +407,22 @@ discard block |
||
392 | 407 | $module = new $classname($db); |
393 | 408 | |
394 | 409 | $modulequalified = 1; |
395 | - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; |
|
396 | - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; |
|
410 | + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { |
|
411 | + $modulequalified = 0; |
|
412 | + } |
|
413 | + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { |
|
414 | + $modulequalified = 0; |
|
415 | + } |
|
397 | 416 | |
398 | 417 | if ($modulequalified) { |
399 | 418 | print '<tr class="oddeven"><td width="100">'; |
400 | 419 | print (empty($module->name) ? $name : $module->name); |
401 | 420 | print "</td><td>\n"; |
402 | - if (method_exists($module, 'info')) print $module->info($langs); |
|
403 | - else print $module->description; |
|
421 | + if (method_exists($module, 'info')) { |
|
422 | + print $module->info($langs); |
|
423 | + } else { |
|
424 | + print $module->description; |
|
425 | + } |
|
404 | 426 | print '</td>'; |
405 | 427 | |
406 | 428 | // Active |
@@ -258,7 +258,9 @@ |
||
258 | 258 | if (empty($senderissupplier)) { |
259 | 259 | $statustoshow = 1; |
260 | 260 | $statuswarehouse = 'warehouseopen,warehouseinternal'; |
261 | - if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse = 'warehouseopen'; |
|
261 | + if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) { |
|
262 | + $statuswarehouse = 'warehouseopen'; |
|
263 | + } |
|
262 | 264 | if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { |
263 | 265 | // hide products in closed warehouse, but show products for internal transfer |
264 | 266 | $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, $statuswarehouse, GETPOST('combinations', 'array')); |
@@ -23,11 +23,22 @@ discard block |
||
23 | 23 | * \brief File to return Ajax response on third parties request |
24 | 24 | */ |
25 | 25 | |
26 | -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal |
|
27 | -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); |
|
28 | -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); |
|
29 | -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); |
|
30 | -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); |
|
26 | +if (!defined('NOTOKENRENEWAL')) { |
|
27 | + define('NOTOKENRENEWAL', 1); |
|
28 | +} |
|
29 | +// Disables token renewal |
|
30 | +if (!defined('NOREQUIREMENU')) { |
|
31 | + define('NOREQUIREMENU', '1'); |
|
32 | +} |
|
33 | +if (!defined('NOREQUIREHTML')) { |
|
34 | + define('NOREQUIREHTML', '1'); |
|
35 | +} |
|
36 | +if (!defined('NOREQUIREAJAX')) { |
|
37 | + define('NOREQUIREAJAX', '1'); |
|
38 | +} |
|
39 | +if (!defined('NOREQUIRESOC')) { |
|
40 | + define('NOREQUIRESOC', '1'); |
|
41 | +} |
|
31 | 42 | |
32 | 43 | // Load Dolibarr environment |
33 | 44 | require '../../main.inc.php'; |
@@ -55,8 +66,12 @@ discard block |
||
55 | 66 | |
56 | 67 | // Define filter on text typed |
57 | 68 | $socid = $_GET['newcompany'] ? $_GET['newcompany'] : ''; |
58 | - if (!$socid) $socid = $_GET['socid'] ? $_GET['socid'] : ''; |
|
59 | - if (!$socid) $socid = $_GET['id_fourn'] ? $_GET['id_fourn'] : ''; |
|
69 | + if (!$socid) { |
|
70 | + $socid = $_GET['socid'] ? $_GET['socid'] : ''; |
|
71 | + } |
|
72 | + if (!$socid) { |
|
73 | + $socid = $_GET['id_fourn'] ? $_GET['id_fourn'] : ''; |
|
74 | + } |
|
60 | 75 | |
61 | 76 | $sql = "SELECT s.rowid, s.nom, s.name_alias, s.code_client, s.code_fournisseur, s.address, s.zip, s.town, s.email, s.siren, s.siret, s.ape, s.idprof4, s.client, s.fournisseur, s.datec, s.logo"; |
62 | 77 | $sql .= " , c.label as country, d.nom as departement"; |
@@ -76,7 +91,9 @@ discard block |
||
76 | 91 | $sql .= " OR s.code_client LIKE '%".$db->escape($socid)."%'"; |
77 | 92 | $sql .= " OR s.code_fournisseur LIKE '%".$db->escape($socid)."%'"; |
78 | 93 | } |
79 | - if (!empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) $sql .= " OR s.rowid = '".$db->escape($socid)."'"; |
|
94 | + if (!empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) { |
|
95 | + $sql .= " OR s.rowid = '".$db->escape($socid)."'"; |
|
96 | + } |
|
80 | 97 | $sql .= ")"; |
81 | 98 | } |
82 | 99 | //if (GETPOST("filter")) $sql.= " AND (".GETPOST("filter", "alpha").")"; // Add other filters |
@@ -88,7 +105,9 @@ discard block |
||
88 | 105 | if ($resql) { |
89 | 106 | while ($row = $db->fetch_array($resql)) { |
90 | 107 | $label = $row['nom']; |
91 | - if ($socid) $label = $label; |
|
108 | + if ($socid) { |
|
109 | + $label = $label; |
|
110 | + } |
|
92 | 111 | $row_array['label'] = $label; |
93 | 112 | $row_array['value'] = $row['nom']; |
94 | 113 | $row_array['key'] = $row['rowid']; |