diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 82e3f096e5d..d464871941a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -6303,6 +6303,59 @@ class Product extends CommonObject return $prodDurationHours; } + + + /** + * Return clicable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '') + { + global $langs,$conf; + + $return = '
'; + $return .= '
'; + $return .= '
'; + $label = ''; + if ($this->is_photo_available($conf->product->multidir_output[$this->entity])) { + $label .= $this->show_photos('product', $conf->product->multidir_output[$this->entity]); + $return .= $label; + } else { + if ($this->type == Product::TYPE_PRODUCT) { + $label .= img_picto('', 'product'); + } elseif ($this->type == Product::TYPE_SERVICE) { + $label .= img_picto('', 'service'); + } + $return .= $label; + } + $return .= '
'; + $return .= '
'; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; + if (property_exists($this, 'label')) { + $return .= '
'.$this->label.''; + } + if (property_exists($this, 'price') && property_exists($this, 'price_ttc')) { + if ($this->price_base_type == 'TTC') { + $return .= '
'.price($this->price_ttc).' '.$langs->trans("TTC").''; + } else { + if ($this->status) { + $return .= '
'.price($this->price).' '.$langs->trans("HT").''; + } + } + } + if (property_exists($this, 'stock_reel')) { + $return .= '
'.$langs->trans('PhysicalStock').' : '.$this->stock_reel.''; + } + if (method_exists($this, 'getLibStatut')) { + $return .='
'.$this->getLibStatut(5, 1).' '.$this->getLibStatut(5, 0).''; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + return $return; + } } /** diff --git a/htdocs/product/list.php b/htdocs/product/list.php index f98f4da1ad5..6ddb8909fb4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -97,6 +97,8 @@ $search_accountancy_code_buy_export = GETPOST("search_accountancy_code_buy_expor $search_finished = GETPOST("search_finished", 'int'); $optioncss = GETPOST('optioncss', 'alpha'); $type = GETPOST("type", "int"); +$mode = GETPOST('mode', 'alpha'); + //Show/hide child products if (isModEnabled('variants') && !empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) { @@ -672,6 +674,9 @@ if (GETPOST('delprod')) { } $param = ''; +if (!empty($mode)) { + $param = "&mode=".urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -780,7 +785,9 @@ if (in_array($massaction, array('presend', 'predelete','preaffecttag', 'edit_ext } $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('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); if ($type === "") { $perm = ($user->rights->produit->creer || $user->rights->service->creer); } elseif ($type == Product::TYPE_SERVICE) { @@ -788,8 +795,8 @@ if ($type === "") { } elseif ($type == Product::TYPE_PRODUCT) { $perm = $user->rights->produit->creer; } -$oldtype = $type; -$params = array(); + $oldtype = $type; + $params = array(); if ($type === "") { $params['forcenohideoftext'] = 1; } @@ -797,13 +804,12 @@ if ($type === "") { $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; } -$label = 'NewProduct'; + $label = 'NewProduct'; if ($type == Product::TYPE_SERVICE) { $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); -$type = $oldtype; print '
'; if ($optioncss != '') { @@ -816,6 +822,8 @@ print ''; print ''; //print ''; print ''; +print ''; + if (empty($arrayfields['p.fk_product_type']['checked'])) { print ''; } @@ -1321,13 +1329,15 @@ if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { print "\n"; -$product_static = new Product($db); -$product_fourn = new ProductFournisseur($db); -$i = 0; -$totalarray = array(); -$totalarray['nbfield'] = 0; -while ($i < min($num, $limit)) { + $product_static = new Product($db); + $product_fourn = new ProductFournisseur($db); + + $i = 0; + $totalarray = array(); + $totalarray['nbfield'] = 0; + $imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); // Multilangs @@ -1346,62 +1356,76 @@ while ($i < min($num, $limit)) { } } } +} $parameters = array('staticdata' => $obj); // Note that $action and $object may have been modified by hook // do product_static fetch in hook if wanted or anything else $reshook = $hookmanager->executeHooks('loadStaticObject', $parameters, $product_static, $action); - if (empty($reshook)) { - $product_static->id = $obj->rowid; - $product_static->ref = $obj->ref; - $product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated - $product_static->ref_supplier = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; - $product_static->label = $obj->label; - $product_static->finished = $obj->finished; - $product_static->type = $obj->fk_product_type; - $product_static->status_buy = $obj->tobuy; - $product_static->status = $obj->tosell; - $product_static->status_batch = $obj->tobatch; - $product_static->entity = $obj->entity; - $product_static->pmp = $obj->pmp; - $product_static->accountancy_code_sell = $obj->accountancy_code_sell; - $product_static->accountancy_code_sell_export = $obj->accountancy_code_sell_export; - $product_static->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra; - $product_static->accountancy_code_buy = $obj->accountancy_code_buy; - $product_static->accountancy_code_buy_intra = $obj->accountancy_code_buy_intra; - $product_static->accountancy_code_buy_export = $obj->accountancy_code_buy_export; - $product_static->length = $obj->length; - $product_static->length_units = $obj->length_units; - $product_static->width = $obj->width; - $product_static->width_units = $obj->width_units; - $product_static->height = $obj->height; - $product_static->height_units = $obj->height_units; - $product_static->weight = $obj->weight; - $product_static->weight_units = $obj->weight_units; - $product_static->volume = $obj->volume; - $product_static->volume_units = $obj->volume_units; - $product_static->surface = $obj->surface; - $product_static->surface_units = $obj->surface_units; - if (!empty($conf->global->PRODUCT_USE_UNITS)) { - $product_static->fk_unit = $obj->fk_unit; - } +if (empty($reshook)) { + $product_static->id = $obj->rowid; + $product_static->ref = $obj->ref; + $product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated + $product_static->ref_supplier = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; + $product_static->label = $obj->label; + $product_static->finished = $obj->finished; + $product_static->type = $obj->fk_product_type; + $product_static->status_buy = $obj->tobuy; + $product_static->status = $obj->tosell; + $product_static->status_batch = $obj->tobatch; + $product_static->entity = $obj->entity; + $product_static->pmp = $obj->pmp; + $product_static->accountancy_code_sell = $obj->accountancy_code_sell; + $product_static->accountancy_code_sell_export = $obj->accountancy_code_sell_export; + $product_static->accountancy_code_sell_intra = $obj->accountancy_code_sell_intra; + $product_static->accountancy_code_buy = $obj->accountancy_code_buy; + $product_static->accountancy_code_buy_intra = $obj->accountancy_code_buy_intra; + $product_static->accountancy_code_buy_export = $obj->accountancy_code_buy_export; + $product_static->length = $obj->length; + $product_static->length_units = $obj->length_units; + $product_static->width = $obj->width; + $product_static->width_units = $obj->width_units; + $product_static->height = $obj->height; + $product_static->height_units = $obj->height_units; + $product_static->weight = $obj->weight; + $product_static->weight_units = $obj->weight_units; + $product_static->volume = $obj->volume; + $product_static->volume_units = $obj->volume_units; + $product_static->surface = $obj->surface; + $product_static->surface_units = $obj->surface_units; + if (!empty($conf->global->PRODUCT_USE_UNITS)) { + $product_static->fk_unit = $obj->fk_unit; + } - // STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock. - if ((isModEnabled('stock') && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock - if ($product_static->type != 1 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Not a service - $option = 'nobatch'; - if (empty($arrayfields['stock_virtual']['checked'])) { - $option .= ',novirtual'; - } - $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() + // STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock. + if ((isModEnabled('stock') && $user->rights->stock->lire && $search_type != 1) || !empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) { // To optimize call of load_stock + if ($product_static->type != 1 || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { // Not a service + $option = 'nobatch'; + if (empty($arrayfields['stock_virtual']['checked'])) { + $option .= ',novirtual'; } + $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'); - 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('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire'); +if ($product_static->isService()) { + $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire'); +} +if ($mode == 'Kanban') { + if ($i == 0) { + print ''; + print '
'; } - + $product_static->price = $obj->price; + // Output Kanban + print $product_static->getKanbanView(''); + if ($i == ($imaxinloop - 1)) { + print '
'; + print ''; + } +} else { print ''; // Action column @@ -1467,7 +1491,7 @@ while ($i < min($num, $limit)) { // Label if (!empty($arrayfields['p.label']['checked'])) { - print ''.$product_static->label.''; + print ''.$obj->label.''; if (!$i) { $totalarray['nbfield']++; } @@ -1477,7 +1501,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['p.fk_product_type']['checked'])) { print ''; $s = ''; - if ($product_static->type == 0) { + if ($obj->fk_product_type == 0) { $s .= img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"'); } else { $s .= img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"'); @@ -1491,7 +1515,7 @@ while ($i < min($num, $limit)) { // Barcode if (!empty($arrayfields['p.barcode']['checked'])) { - print ''.$product_static->barcode.''; + print ''.$obj->barcode.''; if (!$i) { $totalarray['nbfield']++; } @@ -1535,7 +1559,7 @@ while ($i < min($num, $limit)) { // Weight if (!empty($arrayfields['p.weight']['checked'])) { print ''; - print $product_static->weight; + print $obj->weight; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1555,7 +1579,7 @@ while ($i < min($num, $limit)) { // Length if (!empty($arrayfields['p.length']['checked'])) { print ''; - print $product_static->length; + print $obj->length; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1575,7 +1599,7 @@ while ($i < min($num, $limit)) { // Width if (!empty($arrayfields['p.width']['checked'])) { print ''; - print $product_static->width; + print $obj->width; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1595,7 +1619,7 @@ while ($i < min($num, $limit)) { // Height if (!empty($arrayfields['p.height']['checked'])) { print ''; - print $product_static->height; + print $obj->height; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1615,7 +1639,7 @@ while ($i < min($num, $limit)) { // Surface if (!empty($arrayfields['p.surface']['checked'])) { print ''; - print $product_static->surface; + print $obj->surface; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1635,7 +1659,7 @@ while ($i < min($num, $limit)) { // Volume if (!empty($arrayfields['p.volume']['checked'])) { print ''; - print $product_static->volume; + print $obj->volume; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1667,7 +1691,7 @@ while ($i < min($num, $limit)) { // Sell price if (!empty($arrayfields['p.sellprice']['checked'])) { print ''; - if ($product_static->status && $usercancreadprice) { + if ($obj->tosell && $usercancreadprice) { if ($obj->price_base_type == 'TTC') { print ''.price($obj->price_ttc).' '.$langs->trans("TTC").''; } else { @@ -1690,7 +1714,7 @@ while ($i < min($num, $limit)) { $productpricescache[$obj->rowid] = array(); } - if ($product_static->status && $usercancreadprice) { + if ($obj->tosell && $usercancreadprice) { // Make 1 request for all price levels (without filter on price_level) and saved result into an cache array // then reuse the cache array if we need prices for other price levels $sqlp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price, p.price_base_type"; @@ -1735,188 +1759,198 @@ while ($i < min($num, $limit)) { } } } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } +} } // Better buy price - if (!empty($arrayfields['p.minbuyprice']['checked'])) { - print ''; - if ($product_static->status_buy && $obj->bestpurchaseprice != '' && $usercancreadprice) { - if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) { - if ($product_fourn->product_fourn_price_id > 0) { - if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { - $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1); - print ''.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).''; - } else { - print ''.price($product_fourn->fourn_unitprice).' '.$langs->trans("HT").''; - } +if (!empty($arrayfields['p.minbuyprice']['checked'])) { + print ''; + if ($product_static->status_buy && $obj->bestpurchaseprice != '' && $usercancreadprice) { + if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) { + if ($product_fourn->product_fourn_price_id > 0) { + if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { + $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1); + print ''.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).''; + } else { + print ''.price($product_fourn->fourn_unitprice).' '.$langs->trans("HT").''; } } - } - print ''; - if (!$i) { - $totalarray['nbfield']++; + print ''; + if (!$i) { + $totalarray['nbfield']++; + } } } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Number of buy prices - if (!empty($arrayfields['p.numbuyprice']['checked'])) { - print ''; - if ($product_static->status_buy && $usercancreadprice) { - if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) { - $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); - print $form->textwithpicto(count($productFournList), $htmltext); - } +if (!empty($arrayfields['p.numbuyprice']['checked'])) { + print ''; + if ($product_static->status_buy && $usercancreadprice) { + if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) { + $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList); + print $form->textwithpicto(count($productFournList), $htmltext); } - print ''; } + print ''; +} // VAT or Sell Tax Rate - if (!empty($arrayfields['p.tva_tx']['checked'])) { - print ''; - print vatrate($obj->tva_tx, true); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.tva_tx']['checked'])) { + print ''; + print vatrate($obj->tva_tx, true); + print ''; + if (!$i) { + $totalarray['nbfield']++; } +} // WAP - if (!empty($arrayfields['p.pmp']['checked'])) { - print ''; - if ($usercancreadprice) { - print ''.price($product_static->pmp, 1, $langs).""; - } - print ''; +if (!empty($arrayfields['p.pmp']['checked'])) { + print ''; + if ($usercancreadprice) { + print ''.price($product_static->pmp, 1, $langs).""; } + print ''; +} // Cost price - if (!empty($arrayfields['p.cost_price']['checked'])) { - print ''; - //print $obj->cost_price; - if ($usercancreadprice) { - print ''.price($obj->cost_price).' '.$langs->trans("HT").''; - } - print ''; +if (!empty($arrayfields['p.cost_price']['checked'])) { + print ''; + //print $obj->cost_price; + if ($usercancreadprice) { + print ''.price($obj->cost_price).' '.$langs->trans("HT").''; } + print ''; +} // Limit alert - if (!empty($arrayfields['p.seuil_stock_alerte']['checked'])) { - print ''; - if ($product_static->type != 1) { - print $obj->seuil_stock_alerte; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.seuil_stock_alerte']['checked'])) { + print ''; + if ($product_static->type != 1) { + print $obj->seuil_stock_alerte; } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Desired stock - if (!empty($arrayfields['p.desiredstock']['checked'])) { - print ''; - if ($product_static->type != 1) { - print $obj->desiredstock; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.desiredstock']['checked'])) { + print ''; + if ($product_static->type != 1) { + print $obj->desiredstock; } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Stock real - if (!empty($arrayfields['p.stock']['checked'])) { - print ''; - if ($product_static->type != 1) { - if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { - print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; - } - if ($usercancreadprice) { - print price(price2num($product_static->stock_reel, 'MS')); - } +if (!empty($arrayfields['p.stock']['checked'])) { + print ''; + if ($product_static->type != 1) { + if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) { + print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print ''; - if (!$i) { - $totalarray['nbfield']++; + if ($usercancreadprice) { + print price(price2num($product_static->stock_reel, 'MS')); } } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Stock virtual - if (!empty($arrayfields['stock_virtual']['checked'])) { - print ''; - if ($product_static->type != 1) { - if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { - print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; - } - if ($usercancreadprice) { - print price(price2num($product_static->stock_theorique, 'MS')); - } +if (!empty($arrayfields['stock_virtual']['checked'])) { + print ''; + if ($product_static->type != 1) { + if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) { + print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' '; } - print ''; - if (!$i) { - $totalarray['nbfield']++; + if ($usercancreadprice) { + print price(price2num($product_static->stock_theorique, 'MS')); } } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Lot/Serial - if (!empty($arrayfields['p.tobatch']['checked'])) { - print ''; - print $product_static->getLibStatut(1, 2); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.tobatch']['checked'])) { + print ''; + print $product_static->getLibStatut(1, 2); + print ''; + if (!$i) { + $totalarray['nbfield']++; } +} // Country - if (!empty($arrayfields['p.fk_country']['checked'])) { - print ''.getCountry($obj->fk_country, 0, $db).''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.fk_country']['checked'])) { + print ''.getCountry($obj->fk_country, 0, $db).''; + if (!$i) { + $totalarray['nbfield']++; } +} // State - if (!empty($arrayfields['p.fk_state']['checked'])) { - print ''; - if (!empty($obj->fk_state)) { - print getState($obj->fk_state, 0, $db); - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.fk_state']['checked'])) { + print ''; + if (!empty($obj->fk_state)) { + print getState($obj->fk_state, 0, $db); } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Accountancy code sell - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { - print ''.$product_static->accountancy_code_sell.''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { + print ''.$product_static->accountancy_code_sell.''; + if (!$i) { + $totalarray['nbfield']++; } - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) { - print ''.$product_static->accountancy_code_sell_intra.''; - if (!$i) { - $totalarray['nbfield']++; - } +} +if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) { + print ''.$product_static->accountancy_code_sell_intra.''; + if (!$i) { + $totalarray['nbfield']++; } - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) { - print ''.$product_static->accountancy_code_sell_export.''; - if (!$i) { - $totalarray['nbfield']++; - } +} +if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) { + print ''.$product_static->accountancy_code_sell_export.''; + if (!$i) { + $totalarray['nbfield']++; } +} // Accountancy code buy - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) { - print ''.$product_static->accountancy_code_buy.''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) { + print ''.$product_static->accountancy_code_buy.''; + if (!$i) { + $totalarray['nbfield']++; } - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) { - print ''.$product_static->accountancy_code_buy_intra.''; - if (!$i) { - $totalarray['nbfield']++; - } +} +if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) { + print ''.$product_static->accountancy_code_buy_intra.''; + if (!$i) { + $totalarray['nbfield']++; } - if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) { - print ''.$product_static->accountancy_code_buy_export.''; - if (!$i) { - $totalarray['nbfield']++; - } +} +if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) { + print ''.$product_static->accountancy_code_buy_export.''; + if (!$i) { + $totalarray['nbfield']++; } +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook @@ -1924,68 +1958,70 @@ while ($i < min($num, $limit)) { $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation - if (!empty($arrayfields['p.datec']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.datec']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + if (!$i) { + $totalarray['nbfield']++; } +} // Date modification - if (!empty($arrayfields['p.tms']['checked'])) { - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.tms']['checked'])) { + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + if (!$i) { + $totalarray['nbfield']++; } +} // Status (to sell) - if (!empty($arrayfields['p.tosell']['checked'])) { - print ''; - 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'); - } else { - print $product_static->LibStatut($product_static->status, 5, 0); - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.tosell']['checked'])) { + print ''; + 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'); + } else { + print $product_static->LibStatut($product_static->status, 5, 0); } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Status (to buy) - if (!empty($arrayfields['p.tobuy']['checked'])) { - print ''; - 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'); - } else { - print $product_static->LibStatut($product_static->status_buy, 5, 1); - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } +if (!empty($arrayfields['p.tobuy']['checked'])) { + print ''; + 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'); + } else { + print $product_static->LibStatut($product_static->status_buy, 5, 1); } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} // Action column - if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { - print ''; - 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; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + 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; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; } + print ''; } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } +} print "\n"; + +} $i++; } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 5c010e21e26..dd6c21368db 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -189,6 +189,31 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { bottom: 0; } +/* customize section img box on list of products */ +.info-box-img { + height: 105px !important; + width: 88px; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; + display: block; + overflow: hidden; + float: left; + text-align: center; + font-size: 2.8em; + line-height: 90px; + margin-right: 5px; + background: var(--colorbacktitle1) !important; +} +.info-box-img > img { + width: 90%; + position: relative; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?> .info-box-icon-text{ opacity: 1;