Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer 2020-12-01 01:41:19 +00:00
parent fc5dc0865d
commit 6df4954b20
78 changed files with 960 additions and 960 deletions

View File

@ -632,19 +632,19 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $obj
if (empty($reshook)) { if (empty($reshook)) {
// Button re-export // Button re-export
if (!empty($conf->global->ACCOUNTING_REEXPORT)) { if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
$newcardbutton = '<a class="valignmiddle" href="' . $_SERVER['PHP_SELF'] . '?action=setreexport&token=' . newToken() . '&value=0' . ($param ? '&' . $param : '') . '">' . img_picto($langs->trans("Activated"), 'switch_on') . '</a> '; $newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
} else { } else {
$newcardbutton = '<a class="valignmiddle" href="' . $_SERVER['PHP_SELF'] . '?action=setreexport&token=' . newToken() . '&value=1' . ($param ? '&' . $param : '') . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a> '; $newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
} }
$newcardbutton .= '<span class="valignmiddle marginrightonly">' . $langs->trans("IncludeDocsAlreadyExported") . '</span>'; $newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList") . ' (' . $listofformat[$formatexportset] . ')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"] . '?action=export_file' . ($param ? '&' . $param : ''), $user->rights->accounting->mouvements->export); $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly')); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
$url = './card.php?action=create'; $url = './card.php?action=create';
if (!empty($socid)) $url .= '&socid=' . $socid; if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer); $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
} }

View File

@ -379,12 +379,12 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param); $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); $newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= ' &nbsp; '; $newcardbutton .= ' &nbsp; ';
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create'); $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
} }
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);

View File

@ -380,8 +380,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); $newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create'); $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
} }
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);

View File

@ -621,18 +621,18 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ($arrayofvat[$key] as $k => $mt) { foreach ($arrayofvat[$key] as $k => $mt) {
if ($mt) { if ($mt) {
print '"' . $key . '"' . $sep; print '"'.$key.'"'.$sep;
print '"' . $date . '"' . $sep; print '"'.$date.'"'.$sep;
print '"' . $val["ref"] . '"' . $sep; print '"'.$val["ref"].'"'.$sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep; print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '""' . $sep; print '""'.$sep;
print '"' . $langs->trans("VAT") . ' - ' . join(', ', $def_tva[$key][$k]) . ' %"' . $sep; print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) . ' %' . ($numtax ? ' - Localtax ' . $numtax : '') . '"' . $sep; print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
print '"' . $journal . '"'; print '"'.$journal.'"';
print "\n"; print "\n";
} }
} }

View File

@ -524,7 +524,7 @@ class ActionComm extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->ref =$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id"); $this->ref = $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
// Now insert assigned users // Now insert assigned users
if (!$error) if (!$error)

View File

@ -2922,7 +2922,7 @@ class Propal extends CommonObject
$tabletodelete = $this->table_element_line; $tabletodelete = $this->table_element_line;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")"; $sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
if (! $this->db->query($sqlef) || ! $this->db->query($sql)) { if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
@ -2955,7 +2955,7 @@ class Propal extends CommonObject
if (!$error) { if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$res = $this->db->query($sql); $res = $this->db->query($sql);
if (! $res) { if (!$res) {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
@ -2966,7 +2966,7 @@ class Propal extends CommonObject
// Delete record into ECM index and physically // Delete record into ECM index and physically
if (!$error) { if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive $res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) { if (!$res) {
$error++; $error++;
} }
} }

View File

@ -188,7 +188,7 @@ $arrayfields = array(
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
); );
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
/* /*

View File

@ -3358,7 +3358,7 @@ class Commande extends CommonOrder
$tabletodelete = $this->table_element_line; $tabletodelete = $this->table_element_line;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")"; $sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
if (! $this->db->query($sqlef) || ! $this->db->query($sql)) { if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
@ -3391,7 +3391,7 @@ class Commande extends CommonOrder
if (!$error) { if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$res = $this->db->query($sql); $res = $this->db->query($sql);
if (! $res) { if (!$res) {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
@ -3402,7 +3402,7 @@ class Commande extends CommonOrder
// Delete record into ECM index and physically // Delete record into ECM index and physically
if (!$error) { if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive $res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) { if (!$res) {
$error++; $error++;
} }
} }

View File

@ -173,7 +173,7 @@ $arrayfields = array(
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155) 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
); );
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');
@ -448,10 +448,10 @@ if ($resql)
if ($search_status != '') $param .= '&search_status='.urlencode($search_status); if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start); if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end); if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
if ($search_dateorder_start) $param .= '&search_dateorder_start_day=' . dol_print_date($search_dateorder_start, '%d') . '&search_dateorder_start_month=' . dol_print_date($search_dateorder_start, '%m') . '&search_dateorder_start_year=' . dol_print_date($search_dateorder_start, '%Y'); if ($search_dateorder_start) $param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y');
if ($search_dateorder_end) $param .= '&search_dateorder_end_day=' . dol_print_date($search_dateorder_end, '%d') . '&search_dateorder_end_month=' . dol_print_date($search_dateorder_end, '%m') . '&search_dateorder_end_year=' . dol_print_date($search_dateorder_end, '%Y'); if ($search_dateorder_end) $param .= '&search_dateorder_end_day='.dol_print_date($search_dateorder_end, '%d').'&search_dateorder_end_month='.dol_print_date($search_dateorder_end, '%m').'&search_dateorder_end_year='.dol_print_date($search_dateorder_end, '%Y');
if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day=' . dol_print_date($search_datedelivery_start, '%d') . '&search_datedelivery_start_month=' . dol_print_date($search_datedelivery_start, '%m') . '&search_datedelivery_start_year=' . dol_print_date($search_datedelivery_start, '%Y'); if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day='.dol_print_date($search_datedelivery_start, '%d').'&search_datedelivery_start_month='.dol_print_date($search_datedelivery_start, '%m').'&search_datedelivery_start_year='.dol_print_date($search_datedelivery_start, '%Y');
if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day=' . dol_print_date($search_datedelivery_end, '%d') . '&search_datedelivery_end_month=' . dol_print_date($search_datedelivery_end, '%m') . '&search_datedelivery_end_year=' . dol_print_date($search_datedelivery_end, '%Y'); if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day='.dol_print_date($search_datedelivery_end, '%d').'&search_datedelivery_end_month='.dol_print_date($search_datedelivery_end, '%m').'&search_datedelivery_end_year='.dol_print_date($search_datedelivery_end, '%Y');
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_company) $param .= '&search_company='.urlencode($search_company); if ($search_company) $param .= '&search_company='.urlencode($search_company);
if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer); if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer);
@ -836,7 +836,7 @@ if ($resql)
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print '<td class="liste_titre maxwidthonsmartphone" align="center">';
//print $form->selectyesno('search_shippable', $search_shippable, 1, 0, 1, 1); //print $form->selectyesno('search_shippable', $search_shippable, 1, 0, 1, 1);
if (! empty($conf->global->ORDER_SHIPABLE_STATUS_DISABLED_BY_DEFAULT)) { if (!empty($conf->global->ORDER_SHIPABLE_STATUS_DISABLED_BY_DEFAULT)) {
print '<input type="checkbox" name="show_shippable_command" value="1"'.($show_shippable_command ? ' checked' : '').'>'; print '<input type="checkbox" name="show_shippable_command" value="1"'.($show_shippable_command ? ' checked' : '').'>';
print $langs->trans('ShowShippableStatus'); print $langs->trans('ShowShippableStatus');
} else { } else {
@ -1245,9 +1245,9 @@ if ($resql)
if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default should be this case. if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default should be this case.
{ {
$text_info .= $generic_commande->lines[$lig]->qty . ' X ' . $generic_commande->lines[$lig]->product_ref . '&nbsp;' . dol_trunc($generic_commande->lines[$lig]->product_label, 25); $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->product_ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_info .= ' - ' . $langs->trans("Stock") . ': <span class="' . ($generic_product->stock_reel > 0 ? 'ok' : 'error') . '">' . $generic_product->stock_reel . '</span>'; $text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';
$text_info .= ' - ' . $langs->trans("VirtualStock") . ': <span class="' . ($generic_product->stock_theorique > 0 ? 'ok' : 'error') . '">' . $generic_product->stock_theorique . '</span>'; $text_info .= ' - '.$langs->trans("VirtualStock").': <span class="'.($generic_product->stock_theorique > 0 ? 'ok' : 'error').'">'.$generic_product->stock_theorique.'</span>';
$text_info .= '<br>'; $text_info .= '<br>';
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel) { if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel) {
@ -1281,20 +1281,20 @@ if ($resql)
$stock_order_supplier = $generic_product->stats_commande_fournisseur['qty']; $stock_order_supplier = $generic_product->stats_commande_fournisseur['qty'];
} }
} }
$text_info .= $generic_commande->lines[$lig]->qty . ' X ' . $generic_commande->lines[$lig]->ref . '&nbsp;' . dol_trunc($generic_commande->lines[$lig]->product_label, 25); $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_stock_reel = $generic_product->stock_reel . '/' . $stock_order; $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) { if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
$warning++; $warning++;
$text_warning .= '<span class="warning">' . $langs->trans('Available') . '&nbsp;:&nbsp;' . $text_stock_reel . '</span>'; $text_warning .= '<span class="warning">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
} }
if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) { if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) {
$notshippable++; $notshippable++;
$text_info .= '<span class="warning">' . $langs->trans('Available') . '&nbsp;:&nbsp;' . $text_stock_reel . '</span>'; $text_info .= '<span class="warning">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
} else { } else {
$text_info .= '<span class="ok">' . $langs->trans('Available') . '&nbsp;:&nbsp;' . $text_stock_reel . '</span>'; $text_info .= '<span class="ok">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
} }
if (!empty($conf->fournisseur->enabled)) { if (!empty($conf->fournisseur->enabled)) {
$text_info .= '&nbsp;' . $langs->trans('SupplierOrder') . '&nbsp;:&nbsp;' . $stock_order_supplier . '<br>'; $text_info .= '&nbsp;'.$langs->trans('SupplierOrder').'&nbsp;:&nbsp;'.$stock_order_supplier.'<br>';
} else { } else {
$text_info .= '<br>'; $text_info .= '<br>';
} }
@ -1303,10 +1303,10 @@ if ($resql)
} }
if ($notshippable == 0) { if ($notshippable == 0) {
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft'); $text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft');
$text_info = $langs->trans('Shippable') . '<br>' . $text_info; $text_info = $langs->trans('Shippable').'<br>'.$text_info;
} else { } else {
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'error paddingleft'); $text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'error paddingleft');
$text_info = $langs->trans('NonShippable') . '<br>' . $text_info; $text_info = $langs->trans('NonShippable').'<br>'.$text_info;
} }
} }
@ -1314,7 +1314,7 @@ if ($resql)
print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2); print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2);
} }
if ($warning) { // Always false in default mode if ($warning) { // Always false in default mode
print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders') . '<br>' . $text_warning, 2, 1, img_picto('', 'error'), '', 2); print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'<br>'.$text_warning, 2, 1, img_picto('', 'error'), '', 2);
} }
} }
print '</td>'; print '</td>';

View File

@ -223,7 +223,7 @@ if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -632,10 +632,10 @@ if ($object->id > 0)
print "\n<div class=\"tabsAction\">\n"; print "\n<div class=\"tabsAction\">\n";
$buttonlabel = $langs->trans("MakeWithdrawRequest"); $buttonlabel = $langs->trans("MakeWithdrawRequest");
$user_perms=$user->rights->prelevement->bons->creer; $user_perms = $user->rights->prelevement->bons->creer;
if ($type == 'bank-transfer') { if ($type == 'bank-transfer') {
$buttonlabel = $langs->trans("MakeBankTransferOrder"); $buttonlabel = $langs->trans("MakeBankTransferOrder");
$user_perms=$user->rights->paymentbybanktransfer->create; $user_perms = $user->rights->paymentbybanktransfer->create;
} }
// Add a transfer request // Add a transfer request

View File

@ -164,12 +164,12 @@ class BonPrelevement extends CommonObject
$result = 0; $result = 0;
} else { } else {
$result = -1; $result = -1;
$this->errors[] = get_class($this)."::AddFacture " . $this->db->lasterror; $this->errors[] = get_class($this)."::AddFacture ".$this->db->lasterror;
dol_syslog(get_class($this)."::AddFacture Error $result"); dol_syslog(get_class($this)."::AddFacture Error $result");
} }
} else { } else {
$result = -2; $result = -2;
$this->errors[]=get_class($this)."::AddFacture linedid Empty"; $this->errors[] = get_class($this)."::AddFacture linedid Empty";
dol_syslog(get_class($this)."::AddFacture Error $result"); dol_syslog(get_class($this)."::AddFacture Error $result");
} }
} else { } else {
@ -247,7 +247,7 @@ class BonPrelevement extends CommonObject
$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes"); $line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes");
$result = 0; $result = 0;
} else { } else {
$this->errors[]=get_class($this)."::addline Error -2 " .$this->db->lasterror; $this->errors[] = get_class($this)."::addline Error -2 ".$this->db->lasterror;
dol_syslog(get_class($this)."::addline Error -2"); dol_syslog(get_class($this)."::addline Error -2");
$result = -2; $result = -2;
} }
@ -1124,7 +1124,7 @@ class BonPrelevement extends CommonObject
if (!$resql) if (!$resql)
{ {
$error++; $error++;
$this->errors[]=$this->db->lasterror(); $this->errors[] = $this->db->lasterror();
dol_syslog(__METHOD__."::Update Error=".$this->db->lasterror(), LOG_ERR); dol_syslog(__METHOD__."::Update Error=".$this->db->lasterror(), LOG_ERR);
} }
} }

View File

@ -203,7 +203,7 @@ if (!empty($conf->socialnetworks->enabled)) {
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -89,7 +89,7 @@ class box_birthdays extends ModeleBoxes
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth"; $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.entity IN (".getEntity('user').")"; $sql .= " WHERE u.entity IN (".getEntity('user').")";
$sql.= " AND u.statut = 1"; $sql .= " AND u.statut = 1";
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0); $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC"; $sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0); $sql .= $this->db->plimit($max, 0);

View File

@ -123,7 +123,7 @@ abstract class CommonDocGenerator
if ($member->photo) { if ($member->photo) {
$logotouse = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $member, 'user').'/photos/'.$member->photo; $logotouse = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $member, 'user').'/photos/'.$member->photo;
} else { } else {
$logotouse = DOL_DOCUMENT_ROOT . '/public/theme/common/nophoto.png'; $logotouse = DOL_DOCUMENT_ROOT.'/public/theme/common/nophoto.png';
} }
$array_member = array( $array_member = array(
@ -585,7 +585,7 @@ abstract class CommonDocGenerator
'line_product_ref'=>(empty($line->product_ref) ? '' : $line->product_ref), 'line_product_ref'=>(empty($line->product_ref) ? '' : $line->product_ref),
'line_product_ref_fourn'=>(empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines 'line_product_ref_fourn'=>(empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines
'line_product_label'=>(empty($line->product_label) ? '' :$line->product_label), 'line_product_label'=>(empty($line->product_label) ? '' : $line->product_label),
'line_product_type'=>(empty($line->product_type) ? '' : $line->product_type), 'line_product_type'=>(empty($line->product_type) ? '' : $line->product_type),
'line_product_barcode'=>(empty($line->product_barcode) ? '' : $line->product_barcode), 'line_product_barcode'=>(empty($line->product_barcode) ? '' : $line->product_barcode),
@ -1342,7 +1342,7 @@ abstract class CommonDocGenerator
if (!empty($fields)) if (!empty($fields))
{ {
// Sort extrafields by rank // Sort extrafields by rank
uasort($fields, function ($a, $b) { uasort($fields, function($a, $b) {
return ($a->rank > $b->rank) ? 1 : -1; return ($a->rank > $b->rank) ? 1 : -1;
}); });

View File

@ -8060,7 +8060,7 @@ abstract class CommonObject
// Delete llx_ecm_files // Delete llx_ecm_files
if (!$error) { if (!$error) {
$res = $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive $res = $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) { if (!$res) {
$error++; $error++;
} }
} }

View File

@ -141,7 +141,7 @@ class Events // extends CommonObject
// Clean parameters // Clean parameters
$this->description = trim($this->description); $this->description = trim($this->description);
if (empty($this->user_agent)) $this->user_agent = (empty($_SERVER['HTTP_USER_AGENT'])?'':$_SERVER['HTTP_USER_AGENT']); if (empty($this->user_agent)) $this->user_agent = (empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']);
// Check parameters // Check parameters
if (empty($this->description)) { $this->error = 'ErrorBadValueForParameterCreateEventDesc'; return -1; } if (empty($this->description)) { $this->error = 'ErrorBadValueForParameterCreateEventDesc'; return -1; }

View File

@ -1490,7 +1490,7 @@ class Form
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); $out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
} }
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'"'.($num?'':' disabled').' id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'"'.($num ? '' : ' disabled').' id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>'; if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
if ($showempty == 2) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; if ($showempty == 2) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
@ -1523,7 +1523,7 @@ class Form
if (!empty($contact_town)) $extendedInfos[] = $contact_town; if (!empty($contact_town)) $extendedInfos[] = $contact_town;
elseif (!empty($company_town)) $extendedInfos[] = $company_town; elseif (!empty($company_town)) $extendedInfos[] = $company_town;
$extendedInfos = implode(' - ', $extendedInfos); $extendedInfos = implode(' - ', $extendedInfos);
if (!empty($extendedInfos)) $extendedInfos = ' - ' . $extendedInfos; if (!empty($extendedInfos)) $extendedInfos = ' - '.$extendedInfos;
} }
$contactstatic->id = $obj->rowid; $contactstatic->id = $obj->rowid;
@ -1540,7 +1540,7 @@ class Form
$out .= '<option value="'.$obj->rowid.'"'; $out .= '<option value="'.$obj->rowid.'"';
if ($disabled) $out .= ' disabled'; if ($disabled) $out .= ' disabled';
$out .= ' selected>'; $out .= ' selected>';
$out .= $contactstatic->getFullName($langs) . $extendedInfos; $out .= $contactstatic->getFullName($langs).$extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')'; if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')'; if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
$out .= '</option>'; $out .= '</option>';
@ -1548,7 +1548,7 @@ class Form
$out .= '<option value="'.$obj->rowid.'"'; $out .= '<option value="'.$obj->rowid.'"';
if ($disabled) $out .= ' disabled'; if ($disabled) $out .= ' disabled';
$out .= '>'; $out .= '>';
$out .= $contactstatic->getFullName($langs) . $extendedInfos; $out .= $contactstatic->getFullName($langs).$extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')'; if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')'; if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
$out .= '</option>'; $out .= '</option>';
@ -1556,7 +1556,7 @@ class Form
} else { } else {
if (in_array($obj->rowid, $selected)) if (in_array($obj->rowid, $selected))
{ {
$out .= $contactstatic->getFullName($langs) . $extendedInfos; $out .= $contactstatic->getFullName($langs).$extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')'; if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')'; if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
} }

View File

@ -745,7 +745,7 @@ class Translate
*/ */
public function transcountrynoentities($str, $countrycode) public function transcountrynoentities($str, $countrycode)
{ {
if (! empty($this->tab_translate["$str$countrycode"])) return $this->transnoentities("$str$countrycode"); if (!empty($this->tab_translate["$str$countrycode"])) return $this->transnoentities("$str$countrycode");
else return $this->transnoentities($str); else return $this->transnoentities($str);
} }

View File

@ -5592,7 +5592,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
// In a future, we may distribut directories on several levels depending on setup and object. // In a future, we may distribut directories on several levels depending on setup and object.
// Here, $object->id, $object->ref and $modulepart are required. // Here, $object->id, $object->ref and $modulepart are required.
//var_dump($modulepart); //var_dump($modulepart);
if (! in_array($modulepart, array('product'))) { // Test to remove if (!in_array($modulepart, array('product'))) { // Test to remove
$path = dol_sanitizeFileName(empty($object->ref) ? $object->id : $object->ref); $path = dol_sanitizeFileName(empty($object->ref) ? $object->id : $object->ref);
} }
} }
@ -6294,7 +6294,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0) if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0)
{ {
$birthday = (empty($object->birth) ? '': dol_print_date($object->birth, 'day')); $birthday = (empty($object->birth) ? '' : dol_print_date($object->birth, 'day'));
$substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : ''); $substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : '');
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel(); if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
@ -6694,7 +6694,7 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object
// to list all tags in odt template // to list all tags in odt template
$tags = ''; $tags = '';
foreach ($substitutionarray as $key => $value) { foreach ($substitutionarray as $key => $value) {
$tags .= '{' . $key . '} => ' . $value ."\n"; $tags .= '{'.$key.'} => '.$value."\n";
} }
$substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags)); $substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags));
} }

View File

@ -1319,7 +1319,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
global $daytoparse; global $daytoparse;
$tmparray = dol_getdate($daytoparse, true); // detail of current day $tmparray = dol_getdate($daytoparse, true); // detail of current day
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK)?0:1)); $idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1));
global $numstartworkingday, $numendworkingday; global $numstartworkingday, $numendworkingday;
$cssweekend = ''; $cssweekend = '';
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css.

View File

@ -420,7 +420,7 @@ class pdf_crabe extends ModelePDFFactures
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm // Incoterm
if (! empty($conf->incoterm->enabled)) if (!empty($conf->incoterm->enabled))
{ {
$desc_incoterms = $object->getIncotermsForPDF(); $desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms) if ($desc_incoterms)

View File

@ -9,10 +9,10 @@ if (empty($conf) || !is_object($conf))
exit; exit;
} }
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element; if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element;
// Loop to show all columns of extrafields from $obj, $extrafields and $db // Loop to show all columns of extrafields from $obj, $extrafields and $db
if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
{ {
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']) > 0) { if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']) > 0) {
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.'; if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';

View File

@ -174,7 +174,7 @@ class InterfaceLogevents extends DolibarrTriggers
$event->dateevent = $date; $event->dateevent = $date;
$event->label = $text; $event->label = $text;
$event->description = $desc; $event->description = $desc;
$event->user_agent = (empty($_SERVER["HTTP_USER_AGENT"])?'':$_SERVER["HTTP_USER_AGENT"]); $event->user_agent = (empty($_SERVER["HTTP_USER_AGENT"]) ? '' : $_SERVER["HTTP_USER_AGENT"]);
$result = $event->create($user); $result = $event->create($user);
if ($result > 0) { if ($result > 0) {

View File

@ -245,7 +245,7 @@ if (!file_exists($fullpath_original_file_osencoded))
// Hooks // Hooks
if (!is_object($hookmanager)) { if (!is_object($hookmanager)) {
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($this->db); $hookmanager = new HookManager($this->db);
} }
$hookmanager->initHooks(array('document')); $hookmanager->initHooks(array('document'));
@ -254,9 +254,9 @@ $parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'origina
'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded); 'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded);
$reshook = $hookmanager->executeHooks('downloadDocument', $parameters); // Note that $action and $object may have been $reshook = $hookmanager->executeHooks('downloadDocument', $parameters); // Note that $action and $object may have been
if ($reshook < 0) { if ($reshook < 0) {
$errors = $hookmanager->error . (is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '') . join($separator, $hookmanager->errors) : ''); $errors = $hookmanager->error.(is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '').join($separator, $hookmanager->errors) : '');
dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : " . $errors); dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : ".$errors);
print "ErrorDownloadDocumentHooks: " . $errors; print "ErrorDownloadDocumentHooks: ".$errors;
exit; exit;
} }

View File

@ -133,7 +133,7 @@ $arrayfields = array(
); );
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -1101,7 +1101,7 @@ class ExpenseReport extends CommonObject
$tabletodelete = $this->table_element_line; $tabletodelete = $this->table_element_line;
//$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")"; //$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
if (! $this->db->query($sql)) { if (!$this->db->query($sql)) {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
@ -1134,7 +1134,7 @@ class ExpenseReport extends CommonObject
if (!$error) { if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$res = $this->db->query($sql); $res = $this->db->query($sql);
if (! $res) { if (!$res) {
$error++; $error++;
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errors[] = $this->error; $this->errors[] = $this->error;
@ -1145,7 +1145,7 @@ class ExpenseReport extends CommonObject
// Delete record into ECM index and physically // Delete record into ECM index and physically
if (!$error) { if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive $res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) { if (!$res) {
$error++; $error++;
} }
} }

View File

@ -995,7 +995,7 @@ if (!defined('NOLOGIN'))
$user->getrights(); $user->getrights();
} }
dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL')?constant('NOTOKENRENEWAL'):'')); dol_syslog("--- Access to ".$_SERVER["REQUEST_METHOD"].' '.$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').' NOTOKENRENEWAL='.(defined('NOTOKENRENEWAL') ?constant('NOTOKENRENEWAL') : ''));
//Another call for easy debugg //Another call for easy debugg
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST)); //dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));
@ -1702,8 +1702,8 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage').'...'; $title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage').'...';
if ($mode == 'wiki') { if ($mode == 'wiki') {
$title .= '<br>'.$langs->trans("PageWiki").' '.dol_escape_htmltag('"'.strtr($helppage, '_', ' ').'"'); $title .= '<br>'.$langs->trans("PageWiki").' '.dol_escape_htmltag('"'.strtr($helppage, '_', ' ').'"');
if ($helppresent) $title.= ' <span class="opacitymedium">('.$langs->trans("DedicatedPageAvailable").')</span>'; if ($helppresent) $title .= ' <span class="opacitymedium">('.$langs->trans("DedicatedPageAvailable").')</span>';
else $title.= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>'; else $title .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
} }
$text .= '<a class="help" target="_blank" rel="noopener" href="'; $text .= '<a class="help" target="_blank" rel="noopener" href="';
if ($mode == 'wiki') $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage))); if ($mode == 'wiki') $text .= sprintf($helpbaseurl, urlencode(html_entity_decode($helppage)));

View File

@ -141,7 +141,7 @@ foreach ($object->fields as $key => $val)
} }
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -148,15 +148,15 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
*/ */
public function testMyObjectCreate() public function testMyObjectCreate()
{ {
global $conf,$user,$langs,$db; global $conf, $user, $langs, $db;
$conf=$this->savconf; $conf = $this->savconf;
$user=$this->savuser; $user = $this->savuser;
$langs=$this->savlangs; $langs = $this->savlangs;
$db=$this->savdb; $db = $this->savdb;
$localobject=new MyObject($this->savdb); $localobject = new MyObject($this->savdb);
$localobject->initAsSpecimen(); $localobject->initAsSpecimen();
$result=$localobject->create($user); $result = $localobject->create($user);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);
@ -175,15 +175,15 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
*/ */
public function testMyObjectDelete($id) public function testMyObjectDelete($id)
{ {
global $conf,$user,$langs,$db; global $conf, $user, $langs, $db;
$conf=$this->savconf; $conf = $this->savconf;
$user=$this->savuser; $user = $this->savuser;
$langs=$this->savlangs; $langs = $this->savlangs;
$db=$this->savdb; $db = $this->savdb;
$localobject=new MyObject($this->savdb); $localobject = new MyObject($this->savdb);
$result=$localobject->fetch($id); $result = $localobject->fetch($id);
$result=$localobject->delete($user); $result = $localobject->delete($user);
print __METHOD__." id=".$id." result=".$result."\n"; print __METHOD__." id=".$id." result=".$result."\n";
$this->assertLessThan($result, 0); $this->assertLessThan($result, 0);

View File

@ -243,7 +243,7 @@ if ($conf->global->PRODUIT_MULTIPRICES) {
//var_dump($arraypricelevel); //var_dump($arraypricelevel);
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');
@ -1328,7 +1328,7 @@ if ($resql)
if (!empty($arrayfields['p.sellprice'.$key]['checked'])) if (!empty($arrayfields['p.sellprice'.$key]['checked']))
{ {
print '<td class="right nowraponall">'; print '<td class="right nowraponall">';
if (! empty($productpricescache[$obj->rowid])) if (!empty($productpricescache[$obj->rowid]))
{ {
if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') { if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') {
print price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC"); print price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC");

View File

@ -620,7 +620,7 @@ if ($test) $isavailable[$daytoparse] = array('morning'=>false, 'afternoon'=>fals
$tmparray = dol_getdate($daytoparse, true); // detail of current day $tmparray = dol_getdate($daytoparse, true); // detail of current day
// For monday, must be 0 for monday if MAIN_START_WEEK = 1, must be 1 for monday if MAIN_START_WEEK = 0 // For monday, must be 0 for monday if MAIN_START_WEEK = 1, must be 1 for monday if MAIN_START_WEEK = 0
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK)?0:1)); $idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1));
// numstartworkingday and numendworkingday are default start and end date of working days (1 means sunday if MAIN_START_WEEK is 0, 1 means monday if MAIN_START_WEEK is 1) // numstartworkingday and numendworkingday are default start and end date of working days (1 means sunday if MAIN_START_WEEK is 0, 1 means monday if MAIN_START_WEEK is 1)
$cssweekend = ''; $cssweekend = '';
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css.

View File

@ -269,20 +269,20 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec
$sql .= $hookmanager->resPrint; $sql .= $hookmanager->resPrint;
/* If a group by is required */ /* If a group by is required */
$sql.= " GROUP BY "; $sql .= " GROUP BY ";
foreach ($object->fields as $key => $val) foreach ($object->fields as $key => $val)
{ {
$sql.='t.'.$key.', '; $sql .= 't.'.$key.', ';
} }
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) { if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
} }
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters = array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql .= $hookmanager->resPrint;
$sql=preg_replace('/,\s*$/', '', $sql); $sql = preg_replace('/,\s*$/', '', $sql);
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);

View File

@ -813,14 +813,14 @@ print '</a></td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="80%">' . $langs->trans("AddEmailPhoneTownInContactList") . '</td>'; print '<td width="80%">'.$langs->trans("AddEmailPhoneTownInContactList").'</td>';
print '<td>&nbsp</td>'; print '<td>&nbsp</td>';
print '<td class="center">'; print '<td class="center">';
if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) {
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setaddemailphonetownincontactlist&token='.newToken().'&value=0">'; print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&token='.newToken().'&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} else { } else {
print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setaddemailphonetownincontactlist&token='.newToken().'&value=1">'; print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setaddemailphonetownincontactlist&token='.newToken().'&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off'); print img_picto($langs->trans("Disabled"), 'switch_off');
} }
print '</a></td>'; print '</a></td>';

View File

@ -214,7 +214,7 @@ $arrayfields = array(
's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100), 's.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
); );
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -64,8 +64,8 @@ if ($action == "getTables")
$rows = array(); $rows = array();
while ($row = $db->fetch_array($resql)) { while ($row = $db->fetch_array($resql)) {
$invoice = new Facture($db); $invoice = new Facture($db);
$result=$invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$row['rowid'].')'); $result = $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$row['rowid'].')');
if ($result>0) $row['occupied']="red"; if ($result > 0) $row['occupied'] = "red";
$rows[] = $row; $rows[] = $row;
} }
echo json_encode($rows); echo json_encode($rows);

View File

@ -420,9 +420,9 @@ if ($action == 'creditnote')
} }
} }
if ($action == 'history' || $action=='creditnote') if ($action == 'history' || $action == 'creditnote')
{ {
if ($action=='creditnote') $placeid = $creditnote->id; if ($action == 'creditnote') $placeid = $creditnote->id;
else $placeid = (int) GETPOST('placeid', 'int'); else $placeid = (int) GETPOST('placeid', 'int');
$invoice = new Facture($db); $invoice = new Facture($db);
$invoice->fetch($placeid); $invoice->fetch($placeid);
@ -858,7 +858,7 @@ $(document).ready(function() {
<?php <?php
if ($action == "order" and $order_receipt_printer1 != "") { if ($action == "order" and $order_receipt_printer1 != "") {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true){ if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
?> ?>
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -880,7 +880,7 @@ if ($action == "order" and $order_receipt_printer1 != "") {
} }
if ($action == "order" and $order_receipt_printer2 != "") { if ($action == "order" and $order_receipt_printer2 != "") {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true){ if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
?> ?>
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -902,7 +902,7 @@ if ($action == "order" and $order_receipt_printer2 != "") {
} }
if ($action == "order" and $order_receipt_printer3 != "") { if ($action == "order" and $order_receipt_printer3 != "") {
if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true){ if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
?> ?>
$.ajax({ $.ajax({
type: "POST", type: "POST",

View File

@ -112,7 +112,7 @@ foreach ($object->fields as $key => $val)
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -882,7 +882,7 @@ class Website extends CommonObject
global $user; global $user;
$this->id = 0; $this->id = 0;
$this->specimen =1; $this->specimen = 1;
$this->entity = 1; $this->entity = 1;
$this->ref = 'myspecimenwebsite'; $this->ref = 'myspecimenwebsite';
$this->description = 'A specimen website'; $this->description = 'A specimen website';

View File

@ -244,7 +244,7 @@ class ZapierApi extends DolibarrApi
$fields = array( $fields = array(
'url', 'url',
); );
dol_syslog("API Zapier create hook receive : " . print_r($request_data, true), LOG_DEBUG); dol_syslog("API Zapier create hook receive : ".print_r($request_data, true), LOG_DEBUG);
$result = $this->validate($request_data, $fields); $result = $this->validate($request_data, $fields);
foreach ($request_data as $field => $value) { foreach ($request_data as $field => $value) {

View File

@ -77,12 +77,12 @@ if (!$myfile)
} }
$tmp = 1; $tmp = 1;
while ($tmp!=null) while ($tmp != null)
{ {
$groupofemails=array(); $groupofemails = array();
for ($i=0; $i < MAXEMAILS; $i++) for ($i = 0; $i < MAXEMAILS; $i++)
{ {
$tmp =fgets($myfile); $tmp = fgets($myfile);
if ($tmp == null) if ($tmp == null)
{ {
break; break;
@ -99,7 +99,7 @@ while ($tmp!=null)
{ {
// Loop on each record and update the email to null if email into $groupofemails // Loop on each record and update the email to null if email into $groupofemails
$sql=$sql_base."societe as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';"; $sql = $sql_base."societe as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';";
$db->query($sql); $db->query($sql);
} }
@ -107,7 +107,7 @@ while ($tmp!=null)
{ {
// Loop on each record and update the email to null if email into $groupofemails // Loop on each record and update the email to null if email into $groupofemails
$sql=$sql_base."socpeople as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';"; $sql = $sql_base."socpeople as s SET s.email = NULL WHERE s.email = '".$db->escape($email)."';";
$db->query($sql); $db->query($sql);
} }
@ -115,7 +115,7 @@ while ($tmp!=null)
{ {
// Loop on each record and update the email to null if email into $groupofemails // Loop on each record and update the email to null if email into $groupofemails
$sql=$sql_base."user as u SET u.email = NULL WHERE u.email = '".$db->escape($email)."';"; $sql = $sql_base."user as u SET u.email = NULL WHERE u.email = '".$db->escape($email)."';";
$db->query($sql); $db->query($sql);
} }
@ -123,8 +123,8 @@ while ($tmp!=null)
{ {
// Loop on each record and update the email to null if email into $groupofemails // Loop on each record and update the email to null if email into $groupofemails
$sql=$sql_base."adherent as a SET a.email = NULL WHERE a.email = '".$db->escape($email)."';"; $sql = $sql_base."adherent as a SET a.email = NULL WHERE a.email = '".$db->escape($email)."';";
$resql=$db->query($sql); $resql = $db->query($sql);
} }
echo $email; echo $email;
} }