@@ -1336,7 +1336,7 @@ |
||
1336 | 1336 | if (!empty($this->poste)) $label .= '<br><b>'.$langs->trans("Poste").':</b> '.$this->poste; |
1337 | 1337 | $label .= '<br><b>'.$langs->trans("EMail").':</b> '.$this->email; |
1338 | 1338 | $phonelist = array(); |
1339 | - $country_code = empty($this->country_code) ? '': $this->country_code; |
|
1339 | + $country_code = empty($this->country_code) ? '' : $this->country_code; |
|
1340 | 1340 | if ($this->phone_pro) $phonelist[] = dol_print_phone($this->phone_pro, $country_code, $this->id, 0, '', ' ', 'phone'); |
1341 | 1341 | if ($this->phone_mobile) $phonelist[] = dol_print_phone($this->phone_mobile, $country_code, $this->id, 0, '', ' ', 'mobile'); |
1342 | 1342 | if ($this->phone_perso) $phonelist[] = dol_print_phone($this->phone_perso, $country_code, $this->id, 0, '', ' ', 'phone'); |
@@ -540,7 +540,7 @@ |
||
540 | 540 | |
541 | 541 | $this->fk_product = $obj->fk_product; |
542 | 542 | $this->product_id = $obj->fk_product; |
543 | - $this->product_ref = $obj->product_ref; |
|
543 | + $this->product_ref = $obj->product_ref; |
|
544 | 544 | |
545 | 545 | $this->fourn_id = $obj->fk_soc; |
546 | 546 | $this->fourn_ref = $obj->ref_fourn; // deprecated |
@@ -2650,7 +2650,7 @@ |
||
2650 | 2650 | $formquestion[] = array('type' => 'checkbox', 'tdclass'=>'maxwidth200', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0, 'morecss'=>'margintoponly'); |
2651 | 2651 | } |
2652 | 2652 | |
2653 | - $value= $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
2653 | + $value = $formadmin->select_language($preselectedlanguage, 'newlang', 0, null, $textifempty, 0, 0, 'minwidth200', 1, 0, 0, $onlylang, 1); |
|
2654 | 2654 | $formquestion[] = array('type' => 'other', 'name' => 'newlang', 'label' => $form->textwithpicto($langs->trans("Language"), $langs->trans("DefineListOfAltLanguagesInWebsiteProperties")), 'value' => $value); |
2655 | 2655 | |
2656 | 2656 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550); |
@@ -1285,7 +1285,7 @@ |
||
1285 | 1285 | |
1286 | 1286 | $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def"; |
1287 | 1287 | $sql .= " WHERE file = '".$this->db->escape($file)."'"; |
1288 | - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1288 | + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company |
|
1289 | 1289 | |
1290 | 1290 | dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); |
1291 | 1291 | $resql = $this->db->query($sql); |
@@ -607,7 +607,7 @@ |
||
607 | 607 | function getGMTEasterDatetime($year) |
608 | 608 | { |
609 | 609 | $base = new DateTime("$year-03-21"); |
610 | - $days = easter_days($year); // Return number of days between 21 march and easter day. |
|
610 | + $days = easter_days($year); // Return number of days between 21 march and easter day. |
|
611 | 611 | $tmp = $base->add(new DateInterval("P{$days}D")); |
612 | 612 | return $tmp->getTimestamp(); |
613 | 613 | } |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | $obj = $db->fetch_object($resql); |
150 | 150 | if ($obj) |
151 | 151 | { |
152 | - $localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z |
|
153 | - $localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9 |
|
152 | + $localtax1_rate = (float) $obj->localtax1; // Use float to force to get first numeric value when value is x:y:z |
|
153 | + $localtax2_rate = (float) $obj->localtax2; // Use float to force to get first numeric value when value is -19:-15:-9 |
|
154 | 154 | $localtax1_type = $obj->localtax1_type; |
155 | 155 | $localtax2_type = $obj->localtax2_type; |
156 | 156 | //var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | // initialize result array |
418 | 418 | //for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i]; |
419 | 419 | |
420 | - dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT)?'':$conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); |
|
420 | + dol_syslog('Price.lib::calcul_price_total MAIN_ROUNDING_RULE_TOT='.(empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? '' : $conf->global->MAIN_ROUNDING_RULE_TOT).' pu='.$pu.' qty='.$qty.' price_base_type='.$price_base_type.' total_ht='.$result[0].'-total_vat='.$result[1].'-total_ttc='.$result[2]); |
|
421 | 421 | |
422 | 422 | return $result; |
423 | 423 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | use PhpOffice\PhpSpreadsheet\Spreadsheet; |
30 | 30 | use PhpOffice\PhpSpreadsheet\Style\Alignment; |
31 | 31 | |
32 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/import/modules_import.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/import/modules_import.php'; |
|
33 | 33 | |
34 | 34 | |
35 | 35 | /** |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | $this->picto = 'mime/xls'; // Picto (This is not used by the example file code as Mime type, too bad ...) |
113 | 113 | $this->version = '1.0'; // Driver version |
114 | 114 | // If driver use an external library, put its name here |
115 | - require_once DOL_DOCUMENT_ROOT . '/includes/phpoffice/autoloader.php'; |
|
116 | - require_once DOL_DOCUMENT_ROOT . '/includes/Psr/autoloader.php'; |
|
117 | - require_once PHPEXCELNEW_PATH . 'Spreadsheet.php'; |
|
115 | + require_once DOL_DOCUMENT_ROOT.'/includes/phpoffice/autoloader.php'; |
|
116 | + require_once DOL_DOCUMENT_ROOT.'/includes/Psr/autoloader.php'; |
|
117 | + require_once PHPEXCELNEW_PATH.'Spreadsheet.php'; |
|
118 | 118 | $this->workbook = new Spreadsheet(); |
119 | 119 | |
120 | 120 | //if ($this->id == 'excel2007new') |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | // phpcs:enable |
147 | 147 | global $user, $conf, $langs, $file; |
148 | 148 | // create a temporary object, the final output will be generated in footer |
149 | - $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs) . ' - Dolibarr ' . DOL_VERSION); |
|
150 | - $this->workbook->getProperties()->setTitle($outputlangs->trans("Import") . ' - ' . $file); |
|
151 | - $this->workbook->getProperties()->setSubject($outputlangs->trans("Import") . ' - ' . $file); |
|
152 | - $this->workbook->getProperties()->setDescription($outputlangs->trans("Import") . ' - ' . $file); |
|
149 | + $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION); |
|
150 | + $this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file); |
|
151 | + $this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file); |
|
152 | + $this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file); |
|
153 | 153 | |
154 | 154 | $this->workbook->setActiveSheetIndex(0); |
155 | 155 | $this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet")); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | global $langs; |
243 | 243 | $ret = 1; |
244 | 244 | |
245 | - dol_syslog(get_class($this) . "::open_file file=" . $file); |
|
245 | + dol_syslog(get_class($this)."::open_file file=".$file); |
|
246 | 246 | |
247 | 247 | $reader = new Xlsx(); |
248 | 248 | $this->workbook = $reader->load($file); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | // Define $tablewithentity_cache[$tablename] if not already defined |
394 | 394 | if (!isset($tablewithentity_cache[$tablename])) // keep this test with "isset" |
395 | 395 | { |
396 | - dol_syslog("Check if table " . $tablename . " has an entity field"); |
|
396 | + dol_syslog("Check if table ".$tablename." has an entity field"); |
|
397 | 397 | $resql = $this->db->DDLDescTable($tablename, 'entity'); |
398 | 398 | if ($resql) { |
399 | 399 | $obj = $this->db->fetch_object($resql); |
@@ -451,12 +451,12 @@ discard block |
||
451 | 451 | $file = (empty($objimport->array_import_convertvalue[0][$val]['classfile']) ? $objimport->array_import_convertvalue[0][$val]['file'] : $objimport->array_import_convertvalue[0][$val]['classfile']); |
452 | 452 | $class = $objimport->array_import_convertvalue[0][$val]['class']; |
453 | 453 | $method = $objimport->array_import_convertvalue[0][$val]['method']; |
454 | - if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] != '') { |
|
455 | - $newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval]; |
|
454 | + if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '') { |
|
455 | + $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]; |
|
456 | 456 | } else { |
457 | 457 | $resultload = dol_include_once($file); |
458 | 458 | if (empty($resultload)) { |
459 | - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); |
|
459 | + dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method); |
|
460 | 460 | break; |
461 | 461 | } |
462 | 462 | $classinstance = new $class($this->db); |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $param_array = array('', '', $newval); |
484 | 484 | call_user_func_array(array($classinstance, $method), $param_array); |
485 | 485 | } |
486 | - $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id; |
|
486 | + $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id; |
|
487 | 487 | //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; |
488 | 488 | if ($classinstance->id != '') // id may be 0, it is a found value |
489 | 489 | { |
@@ -509,19 +509,19 @@ discard block |
||
509 | 509 | $method = $objimport->array_import_convertvalue[0][$val]['method']; |
510 | 510 | $codefromfield = $objimport->array_import_convertvalue[0][$val]['codefromfield']; |
511 | 511 | $code = $arrayrecord[$arrayfield[$codefromfield]]['val']; |
512 | - if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval] != '') { |
|
513 | - $newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval]; |
|
512 | + if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval] != '') { |
|
513 | + $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval]; |
|
514 | 514 | } else { |
515 | 515 | $resultload = dol_include_once($file); |
516 | 516 | if (empty($resultload)) { |
517 | - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', code=' . $code); |
|
517 | + dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method.', code='.$code); |
|
518 | 518 | break; |
519 | 519 | } |
520 | 520 | $classinstance = new $class($this->db); |
521 | 521 | // Try the fetch from code and ref |
522 | 522 | $param_array = array('', $newval, $code); |
523 | 523 | call_user_func_array(array($classinstance, $method), $param_array); |
524 | - $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $code][$newval] = $classinstance->id; |
|
524 | + $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$code][$newval] = $classinstance->id; |
|
525 | 525 | if ($classinstance->id > 0) // we found record |
526 | 526 | { |
527 | 527 | $newval = $classinstance->id; |
@@ -541,19 +541,19 @@ discard block |
||
541 | 541 | $class = $objimport->array_import_convertvalue[0][$val]['class']; |
542 | 542 | $method = $objimport->array_import_convertvalue[0][$val]['method']; |
543 | 543 | $units = $objimport->array_import_convertvalue[0][$val]['units']; |
544 | - if ($this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval] != '') { |
|
545 | - $newval = $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval]; |
|
544 | + if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] != '') { |
|
545 | + $newval = $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval]; |
|
546 | 546 | } else { |
547 | 547 | $resultload = dol_include_once($file); |
548 | 548 | if (empty($resultload)) { |
549 | - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method . ', units=' . $units); |
|
549 | + dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method.', units='.$units); |
|
550 | 550 | break; |
551 | 551 | } |
552 | 552 | $classinstance = new $class($this->db); |
553 | 553 | // Try the fetch from code or ref |
554 | 554 | call_user_func_array(array($classinstance, $method), array('', '', $newval, $units)); |
555 | 555 | $scaleorid = (($objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeunits') ? $classinstance->id : $classinstance->scale); |
556 | - $this->cacheconvert[$file . '_' . $class . '_' . $method . '_' . $units][$newval] = $scaleorid; |
|
556 | + $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] = $scaleorid; |
|
557 | 557 | //print 'We have made a '.$class.'->'.$method." to get a value from key '".$newval."' and we got '".$scaleorid."'.";exit; |
558 | 558 | if ($classinstance->id > 0) // we found record |
559 | 559 | { |
@@ -599,8 +599,8 @@ discard block |
||
599 | 599 | $defaultref = ''; |
600 | 600 | // TODO provide the $modTask (module of generation of ref) as parameter of import_insert function |
601 | 601 | $obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; |
602 | - if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . ".php")) { |
|
603 | - require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . '.php'; |
|
602 | + if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) { |
|
603 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php'; |
|
604 | 604 | $modTask = new $obj; |
605 | 605 | $defaultref = $modTask->getNextValue(null, null); |
606 | 606 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $method = $objimport->array_import_convertvalue[0][$val]['method']; |
613 | 613 | $resultload = dol_include_once($file); |
614 | 614 | if (empty($resultload)) { |
615 | - dol_print_error('', 'Error trying to call file=' . $file . ', class=' . $class . ', method=' . $method); |
|
615 | + dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method); |
|
616 | 616 | break; |
617 | 617 | } |
618 | 618 | $classinstance = new $class($this->db); |
@@ -641,15 +641,15 @@ discard block |
||
641 | 641 | $table = $reg[2]; |
642 | 642 | $filter = !empty($reg[3]) ? substr($reg[3], 1) : ''; |
643 | 643 | |
644 | - $cachekey = $field . '@' . $table; |
|
645 | - if (!empty($filter)) $cachekey .= ':' . $filter; |
|
644 | + $cachekey = $field.'@'.$table; |
|
645 | + if (!empty($filter)) $cachekey .= ':'.$filter; |
|
646 | 646 | |
647 | 647 | // Load content of field@table into cache array |
648 | 648 | if (!is_array($this->cachefieldtable[$cachekey])) // If content of field@table not already loaded into cache |
649 | 649 | { |
650 | - $sql = "SELECT " . $field . " as aliasfield FROM " . $table; |
|
650 | + $sql = "SELECT ".$field." as aliasfield FROM ".$table; |
|
651 | 651 | if (!empty($filter)) { |
652 | - $sql .= ' WHERE ' . $filter; |
|
652 | + $sql .= ' WHERE '.$filter; |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | $resql = $this->db->query($sql); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | // Now we check cache is not empty (should not) and key is into cache |
670 | 670 | if (!is_array($this->cachefieldtable[$cachekey]) || !in_array($newval, $this->cachefieldtable[$cachekey])) { |
671 | 671 | $tableforerror = $table; |
672 | - if (!empty($filter)) $tableforerror .= ':' . $filter; |
|
672 | + if (!empty($filter)) $tableforerror .= ':'.$filter; |
|
673 | 673 | $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror); |
674 | 674 | $this->errors[$error]['type'] = 'FOREIGNKEY'; |
675 | 675 | $errorforthistable++; |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | } |
678 | 678 | } |
679 | 679 | // If test is just a static regex |
680 | - elseif (!preg_match('/' . $objimport->array_import_regex[0][$val] . '/i', $newval)) { |
|
680 | + elseif (!preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) { |
|
681 | 681 | //if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]."<br>"; |
682 | 682 | $this->errors[$error]['lib'] = $langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]); |
683 | 683 | $this->errors[$error]['type'] = 'REGEX'; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert |
697 | 697 | if (empty($newval) && $arrayrecord[($key - 1)]['type'] < 0) $listvalues[] = ($newval == '0' ? $newval : "null"); |
698 | 698 | elseif (empty($newval) && $arrayrecord[($key - 1)]['type'] == 0) $listvalues[] = "''"; |
699 | - else $listvalues[] = "'" . $this->db->escape($newval) . "'"; |
|
699 | + else $listvalues[] = "'".$this->db->escape($newval)."'"; |
|
700 | 700 | } |
701 | 701 | $i++; |
702 | 702 | } |
@@ -705,23 +705,23 @@ discard block |
||
705 | 705 | if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) { |
706 | 706 | // Loop on each hidden fields to add them into listfields/listvalues |
707 | 707 | foreach ($objimport->array_import_fieldshidden[0] as $key => $val) { |
708 | - if (!preg_match('/^' . preg_quote($alias, '/') . '\./', $key)) continue; // Not a field of current table |
|
708 | + if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) continue; // Not a field of current table |
|
709 | 709 | if ($val == 'user->id') { |
710 | - $listfields[] = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key); |
|
710 | + $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); |
|
711 | 711 | $listvalues[] = $user->id; |
712 | 712 | } elseif (preg_match('/^lastrowid-/', $val)) { |
713 | 713 | $tmp = explode('-', $val); |
714 | 714 | $lastinsertid = (isset($last_insert_id_array[$tmp[1]])) ? $last_insert_id_array[$tmp[1]] : 0; |
715 | - $keyfield = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key); |
|
715 | + $keyfield = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); |
|
716 | 716 | $listfields[] = $keyfield; |
717 | 717 | $listvalues[] = $lastinsertid; |
718 | 718 | //print $key."-".$val."-".$listfields."-".$listvalues."<br>";exit; |
719 | 719 | } elseif (preg_match('/^const-/', $val)) { |
720 | 720 | $tmp = explode('-', $val, 2); |
721 | - $listfields[] = preg_replace('/^' . preg_quote($alias, '/') . '\./', '', $key); |
|
722 | - $listvalues[] = "'" . $tmp[1] . "'"; |
|
721 | + $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\./', '', $key); |
|
722 | + $listvalues[] = "'".$tmp[1]."'"; |
|
723 | 723 | } else { |
724 | - $this->errors[$error]['lib'] = 'Bad value of profile setup ' . $val . ' for array_import_fieldshidden'; |
|
724 | + $this->errors[$error]['lib'] = 'Bad value of profile setup '.$val.' for array_import_fieldshidden'; |
|
725 | 725 | $this->errors[$error]['type'] = 'Import profile setup'; |
726 | 726 | $error++; |
727 | 727 | } |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) |
741 | 741 | |
742 | 742 | if (empty($lastinsertid)) { // No insert done yet for a parent table |
743 | - $sqlSelect = 'SELECT rowid FROM ' . $tablename; |
|
743 | + $sqlSelect = 'SELECT rowid FROM '.$tablename; |
|
744 | 744 | |
745 | 745 | $data = array_combine($listfields, $listvalues); |
746 | 746 | $where = array(); |
@@ -748,10 +748,10 @@ discard block |
||
748 | 748 | foreach ($updatekeys as $key) { |
749 | 749 | $col = $objimport->array_import_updatekeys[0][$key]; |
750 | 750 | $key = preg_replace('/^.*\./i', '', $key); |
751 | - $where[] = $key . ' = ' . $data[$key]; |
|
752 | - $filters[] = $col . ' = ' . $data[$key]; |
|
751 | + $where[] = $key.' = '.$data[$key]; |
|
752 | + $filters[] = $col.' = '.$data[$key]; |
|
753 | 753 | } |
754 | - $sqlSelect .= ' WHERE ' . implode(' AND ', $where); |
|
754 | + $sqlSelect .= ' WHERE '.implode(' AND ', $where); |
|
755 | 755 | |
756 | 756 | $resql = $this->db->query($sqlSelect); |
757 | 757 | if ($resql) { |
@@ -778,10 +778,10 @@ discard block |
||
778 | 778 | // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record |
779 | 779 | // may already exists. So we rescan the extrafield table to know if record exists or not for the rowid. |
780 | 780 | // Note: For extrafield tablename, we have in importfieldshidden_array an enty 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object' |
781 | - $sqlSelect = 'SELECT rowid FROM ' . $tablename; |
|
781 | + $sqlSelect = 'SELECT rowid FROM '.$tablename; |
|
782 | 782 | |
783 | 783 | if (empty($keyfield)) $keyfield = 'rowid'; |
784 | - $sqlSelect .= ' WHERE ' . $keyfield . ' = ' . $lastinsertid; |
|
784 | + $sqlSelect .= ' WHERE '.$keyfield.' = '.$lastinsertid; |
|
785 | 785 | |
786 | 786 | $resql = $this->db->query($sqlSelect); |
787 | 787 | if ($resql) { |
@@ -803,19 +803,19 @@ discard block |
||
803 | 803 | |
804 | 804 | if (!empty($lastinsertid)) { |
805 | 805 | // Build SQL UPDATE request |
806 | - $sqlstart = 'UPDATE ' . $tablename; |
|
806 | + $sqlstart = 'UPDATE '.$tablename; |
|
807 | 807 | |
808 | 808 | $data = array_combine($listfields, $listvalues); |
809 | 809 | $set = array(); |
810 | 810 | foreach ($data as $key => $val) { |
811 | - $set[] = $key . ' = ' . $val; |
|
811 | + $set[] = $key.' = '.$val; |
|
812 | 812 | } |
813 | - $sqlstart .= ' SET ' . implode(', ', $set); |
|
813 | + $sqlstart .= ' SET '.implode(', ', $set); |
|
814 | 814 | |
815 | 815 | if (empty($keyfield)) $keyfield = 'rowid'; |
816 | - $sqlend = ' WHERE ' . $keyfield . ' = ' . $lastinsertid; |
|
816 | + $sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid; |
|
817 | 817 | |
818 | - $sql = $sqlstart . $sqlend; |
|
818 | + $sql = $sqlstart.$sqlend; |
|
819 | 819 | |
820 | 820 | // Run update request |
821 | 821 | $resql = $this->db->query($sql); |
@@ -834,17 +834,17 @@ discard block |
||
834 | 834 | // Update not done, we do insert |
835 | 835 | if (!$error && !$updatedone) { |
836 | 836 | // Build SQL INSERT request |
837 | - $sqlstart = 'INSERT INTO ' . $tablename . '(' . implode(', ', $listfields) . ', import_key'; |
|
838 | - $sqlend = ') VALUES(' . implode(', ', $listvalues) . ", '" . $this->db->escape($importid) . "'"; |
|
837 | + $sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key'; |
|
838 | + $sqlend = ') VALUES('.implode(', ', $listvalues).", '".$this->db->escape($importid)."'"; |
|
839 | 839 | if (!empty($tablewithentity_cache[$tablename])) { |
840 | 840 | $sqlstart .= ', entity'; |
841 | - $sqlend .= ', ' . $conf->entity; |
|
841 | + $sqlend .= ', '.$conf->entity; |
|
842 | 842 | } |
843 | 843 | if (!empty($objimport->array_import_tables_creator[0][$alias])) { |
844 | - $sqlstart .= ', ' . $objimport->array_import_tables_creator[0][$alias]; |
|
845 | - $sqlend .= ', ' . $user->id; |
|
844 | + $sqlstart .= ', '.$objimport->array_import_tables_creator[0][$alias]; |
|
845 | + $sqlend .= ', '.$user->id; |
|
846 | 846 | } |
847 | - $sql = $sqlstart . $sqlend . ')'; |
|
847 | + $sql = $sqlstart.$sqlend.')'; |
|
848 | 848 | dol_syslog("import_xlsx.modules", LOG_DEBUG); |
849 | 849 | |
850 | 850 | // Run insert request |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | $id = GETPOST('id', 'int'); |
37 | 37 | $ref = GETPOST('ref', 'alphanohtml'); |
38 | -$type = GETPOST('type', 'aZ09'); // Can be int or string |
|
38 | +$type = GETPOST('type', 'aZ09'); // Can be int or string |
|
39 | 39 | $action = (GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'edit'); |
40 | 40 | $confirm = GETPOST('confirm'); |
41 | 41 | $cancel = GETPOST('cancel', 'alpha'); |
@@ -864,12 +864,12 @@ |
||
864 | 864 | $obj = $db->fetch_object($result); |
865 | 865 | |
866 | 866 | if ($obj->pcg_type == 'INCOME') { |
867 | - if (!isset($encaiss[$obj->dm])) $encaiss[$obj->dm] = 0; // To avoid warning of var not defined |
|
867 | + if (!isset($encaiss[$obj->dm])) $encaiss[$obj->dm] = 0; // To avoid warning of var not defined |
|
868 | 868 | $encaiss[$obj->dm] += $obj->credit; |
869 | 869 | $encaiss[$obj->dm] -= $obj->credit; |
870 | 870 | } |
871 | 871 | if ($obj->pcg_type == 'INCOME') { |
872 | - if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0; // To avoid warning of var not defined |
|
872 | + if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0; // To avoid warning of var not defined |
|
873 | 873 | $decaiss[$obj->dm] += $obj->debit; |
874 | 874 | $decaiss[$obj->dm] -= $obj->credit; |
875 | 875 | } |