Fixing style errors.

This commit is contained in:
stickler-ci 2022-12-22 10:15:21 +00:00
parent 5b78f515b6
commit 20cd834839

View File

@ -788,26 +788,26 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
if ($type === "") { if ($type === "") {
$perm = ($user->rights->produit->creer || $user->rights->service->creer); $perm = ($user->rights->produit->creer || $user->rights->service->creer);
} elseif ($type == Product::TYPE_SERVICE) { } elseif ($type == Product::TYPE_SERVICE) {
$perm = $user->rights->service->creer; $perm = $user->rights->service->creer;
} elseif ($type == Product::TYPE_PRODUCT) { } elseif ($type == Product::TYPE_PRODUCT) {
$perm = $user->rights->produit->creer; $perm = $user->rights->produit->creer;
} }
$oldtype = $type; $oldtype = $type;
$params = array(); $params = array();
if ($type === "") { if ($type === "") {
$params['forcenohideoftext'] = 1; $params['forcenohideoftext'] = 1;
} }
if ($type === "") { if ($type === "") {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params); $newcardbutton .= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params);
$type = Product::TYPE_SERVICE; $type = Product::TYPE_SERVICE;
} }
$label = 'NewProduct'; $label = 'NewProduct';
if ($type == Product::TYPE_SERVICE) { if ($type == Product::TYPE_SERVICE) {
$label = 'NewService'; $label = 'NewService';
} }
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type, '', $perm, $params); $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type, '', $perm, $params);
@ -1337,7 +1337,7 @@ print "</tr>\n";
$totalarray = array(); $totalarray = array();
$totalarray['nbfield'] = 0; $totalarray['nbfield'] = 0;
$imaxinloop = ($limit ? min($num, $limit) : $num); $imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) { while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
// Multilangs // Multilangs
@ -1354,15 +1354,14 @@ print "</tr>\n";
if (!empty($objtp->label)) { if (!empty($objtp->label)) {
$obj->label = $objtp->label; $obj->label = $objtp->label;
} }
}
} }
} }
}
$parameters = array('staticdata' => $obj); $parameters = array('staticdata' => $obj);
// Note that $action and $object may have been modified by hook // Note that $action and $object may have been modified by hook
// do product_static fetch in hook if wanted or anything else // do product_static fetch in hook if wanted or anything else
$reshook = $hookmanager->executeHooks('loadStaticObject', $parameters, $product_static, $action); $reshook = $hookmanager->executeHooks('loadStaticObject', $parameters, $product_static, $action);
if (empty($reshook)) { if (empty($reshook)) {
$product_static->id = $obj->rowid; $product_static->id = $obj->rowid;
$product_static->ref = $obj->ref; $product_static->ref = $obj->ref;
$product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated $product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated
@ -1407,14 +1406,14 @@ print "</tr>\n";
$product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock()
} }
} }
} }
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire'); $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire');
if ($product_static->isService()) { if ($product_static->isService()) {
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire'); $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
} }
if ($mode == 'Kanban') { if ($mode == 'Kanban') {
if ($i == 0) { if ($i == 0) {
print '<tr><td colspan="12">'; print '<tr><td colspan="12">';
print '<div class="box-flex-container">'; print '<div class="box-flex-container">';
@ -1426,7 +1425,7 @@ print "</tr>\n";
print '</div>'; print '</div>';
print '</td></tr>'; print '</td></tr>';
} }
} else { } else {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Action column // Action column
@ -1758,7 +1757,6 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
} }
print '</td>'; print '</td>';
@ -1766,12 +1764,11 @@ print "</tr>\n";
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
}
}
} }
// Better buy price // Better buy price
if (!empty($arrayfields['p.minbuyprice']['checked'])) { if (!empty($arrayfields['p.minbuyprice']['checked'])) {
print '<td class="right nowraponall">'; print '<td class="right nowraponall">';
if ($product_static->status_buy && $obj->bestpurchaseprice != '' && $usercancreadprice) { if ($product_static->status_buy && $obj->bestpurchaseprice != '' && $usercancreadprice) {
if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) { if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) {
@ -1781,7 +1778,6 @@ print "</tr>\n";
print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>'; print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>';
} else { } else {
print '<span class="amount">'.price($product_fourn->fourn_unitprice).' '.$langs->trans("HT").'</span>'; print '<span class="amount">'.price($product_fourn->fourn_unitprice).' '.$langs->trans("HT").'</span>';
} }
} }
print '</td>'; print '</td>';
@ -1789,16 +1785,15 @@ print "</tr>\n";
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
} }
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Number of buy prices // Number of buy prices
if (!empty($arrayfields['p.numbuyprice']['checked'])) { if (!empty($arrayfields['p.numbuyprice']['checked'])) {
print '<td class="right">'; print '<td class="right">';
if ($product_static->status_buy && $usercancreadprice) { if ($product_static->status_buy && $usercancreadprice) {
if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) { if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) {
@ -1807,38 +1802,38 @@ print "</tr>\n";
} }
} }
print '</td>'; print '</td>';
} }
// VAT or Sell Tax Rate // VAT or Sell Tax Rate
if (!empty($arrayfields['p.tva_tx']['checked'])) { if (!empty($arrayfields['p.tva_tx']['checked'])) {
print '<td class="right">'; print '<td class="right">';
print vatrate($obj->tva_tx, true); print vatrate($obj->tva_tx, true);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// WAP // WAP
if (!empty($arrayfields['p.pmp']['checked'])) { if (!empty($arrayfields['p.pmp']['checked'])) {
print '<td class="nowrap right">'; print '<td class="nowrap right">';
if ($usercancreadprice) { if ($usercancreadprice) {
print '<span class="amount">'.price($product_static->pmp, 1, $langs)."</span>"; print '<span class="amount">'.price($product_static->pmp, 1, $langs)."</span>";
} }
print '</td>'; print '</td>';
} }
// Cost price // Cost price
if (!empty($arrayfields['p.cost_price']['checked'])) { if (!empty($arrayfields['p.cost_price']['checked'])) {
print '<td class="nowrap right">'; print '<td class="nowrap right">';
//print $obj->cost_price; //print $obj->cost_price;
if ($usercancreadprice) { if ($usercancreadprice) {
print '<span class="amount">'.price($obj->cost_price).' '.$langs->trans("HT").'</span>'; print '<span class="amount">'.price($obj->cost_price).' '.$langs->trans("HT").'</span>';
} }
print '</td>'; print '</td>';
} }
// Limit alert // Limit alert
if (!empty($arrayfields['p.seuil_stock_alerte']['checked'])) { if (!empty($arrayfields['p.seuil_stock_alerte']['checked'])) {
print '<td class="right">'; print '<td class="right">';
if ($product_static->type != 1) { if ($product_static->type != 1) {
print $obj->seuil_stock_alerte; print $obj->seuil_stock_alerte;
@ -1847,9 +1842,9 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Desired stock // Desired stock
if (!empty($arrayfields['p.desiredstock']['checked'])) { if (!empty($arrayfields['p.desiredstock']['checked'])) {
print '<td class="right">'; print '<td class="right">';
if ($product_static->type != 1) { if ($product_static->type != 1) {
print $obj->desiredstock; print $obj->desiredstock;
@ -1858,9 +1853,9 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Stock real // Stock real
if (!empty($arrayfields['p.stock']['checked'])) { if (!empty($arrayfields['p.stock']['checked'])) {
print '<td class="right">'; print '<td class="right">';
if ($product_static->type != 1) { if ($product_static->type != 1) {
if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) {
@ -1874,9 +1869,9 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Stock virtual // Stock virtual
if (!empty($arrayfields['stock_virtual']['checked'])) { if (!empty($arrayfields['stock_virtual']['checked'])) {
print '<td class="right">'; print '<td class="right">';
if ($product_static->type != 1) { if ($product_static->type != 1) {
if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) {
@ -1890,25 +1885,25 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Lot/Serial // Lot/Serial
if (!empty($arrayfields['p.tobatch']['checked'])) { if (!empty($arrayfields['p.tobatch']['checked'])) {
print '<td class="center">'; print '<td class="center">';
print $product_static->getLibStatut(1, 2); print $product_static->getLibStatut(1, 2);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Country // Country
if (!empty($arrayfields['p.fk_country']['checked'])) { if (!empty($arrayfields['p.fk_country']['checked'])) {
print '<td>'.getCountry($obj->fk_country, 0, $db).'</td>'; print '<td>'.getCountry($obj->fk_country, 0, $db).'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// State // State
if (!empty($arrayfields['p.fk_state']['checked'])) { if (!empty($arrayfields['p.fk_state']['checked'])) {
print '<td>'; print '<td>';
if (!empty($obj->fk_state)) { if (!empty($obj->fk_state)) {
print getState($obj->fk_state, 0, $db); print getState($obj->fk_state, 0, $db);
@ -1917,45 +1912,45 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Accountancy code sell // Accountancy code sell
if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) {
print '<td>'.$product_static->accountancy_code_sell.'</td>'; print '<td>'.$product_static->accountancy_code_sell.'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) { if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) {
print '<td>'.$product_static->accountancy_code_sell_intra.'</td>'; print '<td>'.$product_static->accountancy_code_sell_intra.'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) { if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) {
print '<td>'.$product_static->accountancy_code_sell_export.'</td>'; print '<td>'.$product_static->accountancy_code_sell_export.'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Accountancy code buy // Accountancy code buy
if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) { if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) {
print '<td>'.$product_static->accountancy_code_buy.'</td>'; print '<td>'.$product_static->accountancy_code_buy.'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) { if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) {
print '<td>'.$product_static->accountancy_code_buy_intra.'</td>'; print '<td>'.$product_static->accountancy_code_buy_intra.'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) { if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) {
print '<td>'.$product_static->accountancy_code_buy_export.'</td>'; print '<td>'.$product_static->accountancy_code_buy_export.'</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook // Fields from hook
@ -1963,26 +1958,26 @@ print "</tr>\n";
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Date creation // Date creation
if (!empty($arrayfields['p.datec']['checked'])) { if (!empty($arrayfields['p.datec']['checked'])) {
print '<td class="center nowraponall">'; print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Date modification // Date modification
if (!empty($arrayfields['p.tms']['checked'])) { if (!empty($arrayfields['p.tms']['checked'])) {
print '<td class="center nowraponall">'; print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Status (to sell) // Status (to sell)
if (!empty($arrayfields['p.tosell']['checked'])) { if (!empty($arrayfields['p.tosell']['checked'])) {
print '<td class="center nowrap">'; print '<td class="center nowrap">';
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
@ -1993,9 +1988,9 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Status (to buy) // Status (to buy)
if (!empty($arrayfields['p.tobuy']['checked'])) { if (!empty($arrayfields['p.tobuy']['checked'])) {
print '<td class="center nowrap">'; print '<td class="center nowrap">';
if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { if (!empty($conf->use_javascript_ajax) && $user->hasRight("produit", "creer") && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
@ -2006,10 +2001,10 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Action column // Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap center">'; print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0; $selected = 0;
@ -2022,7 +2017,7 @@ print "</tr>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
print "</tr>\n"; print "</tr>\n";