@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $id_rate_selected = GETPOST('id_rate', 'int'); |
48 | 48 | $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); |
49 | 49 | $search_date_sync = dol_mktime(0, 0, 0, GETPOST('search_date_syncmonth', 'int'), GETPOST('search_date_syncday', 'int'), GETPOST('search_date_syncyear', 'int')); |
50 | -$search_date_sync_end = dol_mktime(0, 0, 0, GETPOST('search_date_sync_endmonth', 'int'), GETPOST('search_date_sync_endday', 'int'), GETPOST('search_date_sync_endyear', 'int')); |
|
50 | +$search_date_sync_end = dol_mktime(0, 0, 0, GETPOST('search_date_sync_endmonth', 'int'), GETPOST('search_date_sync_endday', 'int'), GETPOST('search_date_sync_endyear', 'int')); |
|
51 | 51 | $search_rate = GETPOST('search_rate', 'alpha'); |
52 | 52 | $search_code = GETPOST('search_code', 'alpha'); |
53 | 53 | $multicurrency_code = GETPOST('multicurrency_code', 'alpha'); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
223 | 223 | $sall = ""; |
224 | 224 | $search_date_sync = ""; |
225 | - $search_date_sync_end=""; |
|
225 | + $search_date_sync_end = ""; |
|
226 | 226 | $search_rate = ""; |
227 | 227 | $search_code = ""; |
228 | 228 | $search_array_options = array(); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $sql .= ' FROM '.MAIN_DB_PREFIX.'multicurrency_rate as cr '; |
301 | 301 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."multicurrency AS m ON cr.fk_multicurrency = m.rowid"; |
302 | 302 | if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); |
303 | -if ($search_date_sync && $search_date_sync_end ) { |
|
303 | +if ($search_date_sync && $search_date_sync_end) { |
|
304 | 304 | $sql .= " AND (cr.date_sync BETWEEN '".$db->idate($search_date_sync)."' AND '".$db->idate($search_date_sync_end)."')"; |
305 | 305 | } elseif ($search_date_sync && !$search_date_sync_end) { |
306 | 306 | $sql .= natural_search('cr.date_sync', $db->idate($search_date_sync)); |
@@ -357,9 +357,9 @@ discard block |
||
357 | 357 | } |
358 | 358 | |
359 | 359 | if ($search_date_sync) $param = "&search_date_sync=".$search_date_sync; |
360 | - if ($search_date_sync_end) $param="&search_date_sync_end=".$search_date_sync_end; |
|
360 | + if ($search_date_sync_end) $param = "&search_date_sync_end=".$search_date_sync_end; |
|
361 | 361 | if ($search_rate) $param = "&search_rate=".urlencode($search_rate); |
362 | - if ($search_code != '') $param.="&search_code=".urlencode($search_code); |
|
362 | + if ($search_code != '') $param .= "&search_code=".urlencode($search_code); |
|
363 | 363 | |
364 | 364 | // Add $param from extra fields |
365 | 365 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
@@ -486,9 +486,9 @@ discard block |
||
486 | 486 | // USER REQUEST UPDATE FOR THIS LINE |
487 | 487 | if ($action == "updateRate" && $obj->rowid == $id_rate_selected) { |
488 | 488 | // var_dump($obj); |
489 | - print ' <td><input class="minwidth200" name="dateinput" value="'. date('Y-m-d', dol_stringtotime($obj->date_sync)) .'" type="date"></td>'; |
|
490 | - print '<td>' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . '</td>'; |
|
491 | - print ' <td><input type="text" min ="0" step="any" class="minwidth200" name="rateinput" value="' . dol_escape_htmltag($obj->rate) . '"></td>'; |
|
489 | + print ' <td><input class="minwidth200" name="dateinput" value="'.date('Y-m-d', dol_stringtotime($obj->date_sync)).'" type="date"></td>'; |
|
490 | + print '<td>'.$form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true).'</td>'; |
|
491 | + print ' <td><input type="text" min ="0" step="any" class="minwidth200" name="rateinput" value="'.dol_escape_htmltag($obj->rate).'"></td>'; |
|
492 | 492 | |
493 | 493 | print '<td class="center nowrap ">'; |
494 | 494 | print '<input type="hidden" name="page" value="'.dol_escape_htmltag($page).'">'; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | print ' - <span class="opacitymedium">'.$obj->name.'</span>'; |
513 | 513 | print "</td>\n"; |
514 | 514 | |
515 | - if (! $i) $totalarray['nbfield']++; |
|
515 | + if (!$i) $totalarray['nbfield']++; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | // rate |
@@ -520,13 +520,13 @@ discard block |
||
520 | 520 | print '<td class="tdoverflowmax200">'; |
521 | 521 | print $obj->rate; |
522 | 522 | print "</td>\n"; |
523 | - if (! $i) $totalarray['nbfield']++; |
|
523 | + if (!$i) $totalarray['nbfield']++; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | |
527 | 527 | // Fields from hook |
528 | 528 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj); |
529 | - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook |
|
529 | + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook |
|
530 | 530 | print $hookmanager->resPrint; |
531 | 531 | |
532 | 532 | // Action |
@@ -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 |
@@ -493,7 +493,7 @@ |
||
493 | 493 | |
494 | 494 | dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); |
495 | 495 | |
496 | - $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect |
|
496 | + $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect |
|
497 | 497 | $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); |
498 | 498 | $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); |
499 | 499 | $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $this->rights[$r][0] = 130; |
203 | 203 | $this->rights[$r][1] = 'Modify thirdparty information payment'; |
204 | 204 | $this->rights[$r][3] = 0; |
205 | - $this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on |
|
205 | + $this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on |
|
206 | 206 | $this->rights[$r][5] = 'write'; |
207 | 207 | |
208 | 208 | // 262 : Restrict access to sales representative |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | } |
705 | 705 | // Add profids as criteria to search duplicates |
706 | 706 | $langs->load("companies"); |
707 | - $i=1; |
|
707 | + $i = 1; |
|
708 | 708 | while ($i <= 6) { |
709 | 709 | if ($i == 1) { |
710 | 710 | $this->import_updatekeys_array[$r]['s.siren'] = 'ProfId1'.(empty($mysoc->country_code) ? '' : $mysoc->country_code); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $form = new Form($db); |
29 | 29 | } |
30 | 30 | |
31 | -$qtytoconsumeforline = $this->tpl['qty'] / ( !empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); |
|
31 | +$qtytoconsumeforline = $this->tpl['qty'] / (!empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1); |
|
32 | 32 | /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { |
33 | 33 | $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; |
34 | 34 | }*/ |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | if ($res) { |
50 | 50 | print $tmpproduct->getNomUrl(1); |
51 | 51 | if ($tmpbom->id) { |
52 | - print ' ' . $langs->trans("or") . ' '; |
|
52 | + print ' '.$langs->trans("or").' '; |
|
53 | 53 | print $tmpbom->getNomUrl(1); |
54 | - print ' <a class="collapse_bom" id="collapse-' . $line->id . '" href="#">'; |
|
54 | + print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">'; |
|
55 | 55 | print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); |
56 | 56 | } |
57 | 57 | print '</a>'; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | if ($tmpbom->id > 0) { |
84 | 84 | print '<td class="center">'; |
85 | - print '<input type="checkbox" name="bomlineid[]" value="' . $line->id . '">'; |
|
85 | + print '<input type="checkbox" name="bomlineid[]" value="'.$line->id.'">'; |
|
86 | 86 | print '</td>'; |
87 | 87 | } else { |
88 | 88 | print '<td class="center"></td>'; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | // Select of all the sub-BOM lines |
98 | 98 | $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; |
99 | -$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; |
|
99 | +$sql .= ' WHERE fk_bom ='.(int) $tmpbom->id; |
|
100 | 100 | $resql = $db->query($sql); |
101 | 101 | |
102 | 102 | if ($resql) { |
@@ -177,7 +177,7 @@ |
||
177 | 177 | $facavoir->fetch($facid); |
178 | 178 | $invoicecredits[] = $facavoir->getNomUrl(1); |
179 | 179 | } |
180 | - print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; |
|
180 | + print ' ('.$langs->transnoentities("InvoiceHasAvoir").implode(',', $invoicecredits).')'; |
|
181 | 181 | } |
182 | 182 | /* |
183 | 183 | if ($facidnext > 0) { |
@@ -29,9 +29,9 @@ |
||
29 | 29 | |
30 | 30 | // Load Dolibarr environment |
31 | 31 | require '../../main.inc.php'; |
32 | -require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.class.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; |
|
35 | 35 | |
36 | 36 | |
37 | 37 | // Load translation files required by the page |
@@ -65,7 +65,7 @@ |
||
65 | 65 | |
66 | 66 | $startdate = $enddate = ''; |
67 | 67 | if (GETPOST('startdatemonth')) { |
68 | - $startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int')); |
|
68 | + $startdate = dol_mktime(0, 0, 0, GETPOST('startdatemonth', 'int'), GETPOST('startdateday', 'int'), GETPOST('startdateyear', 'int')); |
|
69 | 69 | } |
70 | 70 | if (GETPOST('enddatemonth')) { |
71 | 71 | $enddate = dol_mktime(23, 59, 59, GETPOST('enddatemonth', 'int'), GETPOST('enddateday', 'int'), GETPOST('enddateyear')); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler |
41 | 41 | //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
42 | 42 | //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification |
43 | -if (!defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions |
|
43 | +if (!defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions |
|
44 | 44 | |
45 | 45 | |
46 | 46 | $sapi_type = php_sapi_name(); |
@@ -40,7 +40,10 @@ |
||
40 | 40 | //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler |
41 | 41 | //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
42 | 42 | //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification |
43 | -if (!defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions |
|
43 | +if (!defined('NOSESSION')) { |
|
44 | + define('NOSESSION', '1'); |
|
45 | +} |
|
46 | +// On CLI mode, no need to use web sessions |
|
44 | 47 | |
45 | 48 | |
46 | 49 | $sapi_type = php_sapi_name(); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $maxfilesizearray = getMaxFileSizeArray(); |
188 | 188 | $maxmin = $maxfilesizearray['maxmin']; |
189 | 189 | if ($maxmin > 0) { |
190 | - $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
190 | + $texte .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
191 | 191 | } |
192 | 192 | $texte .= ' <input type="file" name="uploadfile">'; |
193 | 193 | $texte .= '<input type="hidden" value="MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH" name="keyforuploaddir">'; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); |
283 | 283 | $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); |
284 | 284 | |
285 | - $newfiletmp = $objectref . '_' . $newfiletmp; |
|
285 | + $newfiletmp = $objectref.'_'.$newfiletmp; |
|
286 | 286 | //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; |
287 | 287 | |
288 | 288 | // Get extension (ods or odt) |
@@ -292,11 +292,11 @@ discard block |
||
292 | 292 | if ($format == '1') { |
293 | 293 | $format = '%Y%m%d%H%M%S'; |
294 | 294 | } |
295 | - $filename = $newfiletmp . '-' . dol_print_date(dol_now(), $format) . '.' . $newfileformat; |
|
295 | + $filename = $newfiletmp.'-'.dol_print_date(dol_now(), $format).'.'.$newfileformat; |
|
296 | 296 | } else { |
297 | - $filename = $newfiletmp . '.' . $newfileformat; |
|
297 | + $filename = $newfiletmp.'.'.$newfileformat; |
|
298 | 298 | } |
299 | - $file = $dir . '/' . $filename; |
|
299 | + $file = $dir.'/'.$filename; |
|
300 | 300 | //print "newdir=".$dir; |
301 | 301 | //print "newfile=".$newfile; |
302 | 302 | //print "file=".$file; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | dol_mkdir($conf->mymodule->dir_temp); |
306 | 306 | if (!is_writable($conf->mymodule->dir_temp)) { |
307 | 307 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->mymodule->dir_temp); |
308 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
308 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
309 | 309 | return -1; |
310 | 310 | } |
311 | 311 |