From f3d213bab8f149b3a05aa0cbac5336beadcd83ba Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 30 Jun 2018 11:05:00 +0200 Subject: [PATCH] Fix: remove old code --- htdocs/product/list.php | 703 +--------------------------------------- 1 file changed, 5 insertions(+), 698 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 43dcb82b366..47135d22a15 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013-2016 Juanjo Menent * Copyright (C) 2013-2015 Raphaël Doursenaud @@ -114,9 +114,9 @@ if (! empty($canvas)) } // Security check -if ($search_type=='0') $result=restrictedArea($user,'produit'); -else if ($search_type=='1') $result=restrictedArea($user,'service'); -else $result=restrictedArea($user,'produit|service'); +if ($search_type=='0') $result=restrictedArea($user,'produit','','','','','',$objcanvas); +else if ($search_type=='1') $result=restrictedArea($user,'service','','','','','',$objcanvas); +else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); // Define virtualdiffersfromphysical $virtualdiffersfromphysical=0; @@ -453,7 +453,7 @@ if ($resql) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
'; } // Filter on categories @@ -913,693 +913,11 @@ if ($resql) // Status (to sell) if (! empty($arrayfields['p.tosell']['checked'])) { -<<<<<<< 8.0_canvas - print ''; - print $form->selectarray('search_tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$search_tosell,1); - print ''; - } - if (! empty($arrayfields['p.tobuy']['checked'])) - { - print ''; - print $form->selectarray('search_tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$search_tobuy,1); - print ''; - } - print ''; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; - print ''; - - print ''; - - print ''; - if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) print_liste_field_titre($arrayfields['pfp.ref_fourn']['label'], $_SERVER["PHP_SELF"],"pfp.ref_fourn","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.fk_product_type']['checked'])) print_liste_field_titre($arrayfields['p.fk_product_type']['label'], $_SERVER["PHP_SELF"],"p.fk_product_type","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.barcode']['checked'])) print_liste_field_titre($arrayfields['p.barcode']['label'], $_SERVER["PHP_SELF"],"p.barcode","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.numbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.pmp']['checked'])) print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['stock_virtual']['checked'])) print_liste_field_titre($arrayfields['stock_virtual']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_sell","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_buy","",$param,'',$sortfield,$sortorder); - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // Hook fields - $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tosell']['checked'])) print_liste_field_titre($arrayfields['p.tosell']['label'],$_SERVER["PHP_SELF"],"p.tosell","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($arrayfields['p.tobuy']['label'],$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - - $product_static=new Product($db); - $product_fourn =new ProductFournisseur($db); - - $i = 0; - $totalarray=array(); - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($resql); - - // Multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active - { - $sql = "SELECT label"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql.= " WHERE fk_product=".$obj->rowid; - $sql.= " AND lang='". $db->escape($langs->getDefaultLang()) ."'"; - $sql.= " LIMIT 1"; - -<<<<<<< 8.0_canvas - $result = $db->query($sql); - if ($result) - { - $objtp = $db->fetch_object($result); - if (! empty($objtp->label)) $obj->label = $objtp->label; - } - } - - $product_static->id = $obj->rowid; - $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; - $product_static->label = $obj->label; - $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; - - if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock -======= - llxHeader('',$title,$helpurl,''); - - // Displays product removal confirmation - if (GETPOST('delprod')) { - setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs'); - } - - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); - if ($sall) $param.="&sall=".urlencode($sall); - if ($search_categ > 0) $param.="&search_categ=".urlencode($search_categ); - if ($search_ref) $param="&search_ref=".urlencode($search_ref); - if ($search_ref_supplier) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_barcode) $param.=($search_barcode?"&search_barcode=".urlencode($search_barcode):""); - if ($search_label) $param.="&search_label=".urlencode($search_label); - if ($search_tosell != '') $param.="&search_tosell=".urlencode($search_tosell); - if ($search_tobuy != '') $param.="&search_tobuy=".urlencode($search_tobuy); - if ($fourn_id > 0) $param.=($fourn_id?"&fourn_id=".$fourn_id:""); - if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); - if ($type != '') $param.='&type='.urlencode($type); - if ($search_type != '') $param.='&search_type='.urlencode($search_type); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - if ($search_tobatch) $param="&search_ref_supplier=".urlencode($search_ref_supplier); - if ($search_accountancy_code_sell) $param="&search_accountancy_code_sell=".urlencode($search_accountancy_code_sell); - if ($search_accountancy_code_buy) $param="&search_accountancy_code_buy=".urlencode($search_accountancy_code_buy); - // Add $param from extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - - // List of mass actions available - $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), - ); - if ($user->rights->produit->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); - if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); - $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - - $newcardbutton=''; - $rightskey='produit'; - if($type == Product::TYPE_SERVICE) $rightskey='service'; - if($user->rights->{$rightskey}->creer) - { - $label='NewProduct'; - if($type == Product::TYPE_SERVICE) $label='NewService'; - $newcardbutton=''.$langs->trans($label).''; - $newcardbutton.= ''; - $newcardbutton.= ''; - } - - print '
'; - if ($optioncss != '') print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; - - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, $newcardbutton, '', $limit); - - $topicmail="Information"; - $modelmail="product"; - $objecttmp=new Product($db); - $trackid='prod'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; - - if (! empty($catid)) - { - print "
"; - $c = new Categorie($db); - $ways = $c->print_all_ways(' > ','product/list.php'); - print " > ".$ways[0]."
\n"; - print "

"; - } - - if ($sall) - { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); - } - - // Filter on categories - $moreforfilter=''; - if (! empty($conf->categorie->enabled)) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('Categories'). ': '; - $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1); - $moreforfilter.='
'; - } - - //Show/hide child products. Hidden by default - if (!empty($conf->variants->enabled) && $search_type === 0) { - $moreforfilter.='
'; - $moreforfilter.= ''; - $moreforfilter.= ' '; - $moreforfilter.='
'; - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $moreforfilter.=$hookmanager->resPrint; - else $moreforfilter=$hookmanager->resPrint; - - if ($moreforfilter) - { - print '
'; - print $moreforfilter; - print '
'; - } - - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - - print '
'; - print ''."\n"; - - // Lines with input filters - print ''; - if (! empty($arrayfields['p.ref']['checked'])) - { - print ''; - } - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) - { - print ''; - } - if (! empty($arrayfields['p.label']['checked'])) - { - print ''; - } - // Type - if (! empty($arrayfields['p.fk_product_type']['checked'])) - { - print ''; - } - // Barcode - if (! empty($arrayfields['p.barcode']['checked'])) - { - print ''; - } - // Duration - if (! empty($arrayfields['p.duration']['checked'])) - { - print ''; - } - // Sell price - if (! empty($arrayfields['p.sellprice']['checked'])) - { - print ''; - } - // Minimum buying Price - if (! empty($arrayfields['p.minbuyprice']['checked'])) - { - print ''; - } - // Number buying Price - if (! empty($arrayfields['p.numbuyprice']['checked'])) - { - print ''; - } - // WAP - if (! empty($arrayfields['p.pmp']['checked'])) - { - print ''; - } - // Limit for alert - if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) - { - print ''; - } - // Desired stock - if (! empty($arrayfields['p.desiredstock']['checked'])) - { - print ''; - } - // Stock - if (! empty($arrayfields['p.stock']['checked'])) print ''; - // Stock - if (! empty($arrayfields['stock_virtual']['checked'])) print ''; - // To batch - if (! empty($arrayfields['p.tobatch']['checked'])) print ''; - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print ''; - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print ''; - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['p.datec']['checked'])) - { - print ''; - } - // Date modification - if (! empty($arrayfields['p.tms']['checked'])) - { - print ''; - } - if (! empty($arrayfields['p.tosell']['checked'])) - { - print ''; - } - if (! empty($arrayfields['p.tobuy']['checked'])) - { - print ''; - } - print ''; - - print ''; - - print ''; - if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) print_liste_field_titre($arrayfields['pfp.ref_fourn']['label'], $_SERVER["PHP_SELF"],"pfp.ref_fourn","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.fk_product_type']['checked'])) print_liste_field_titre($arrayfields['p.fk_product_type']['label'], $_SERVER["PHP_SELF"],"p.fk_product_type","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.barcode']['checked'])) print_liste_field_titre($arrayfields['p.barcode']['label'], $_SERVER["PHP_SELF"],"p.barcode","",$param,"",$sortfield,$sortorder); - if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.numbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.pmp']['checked'])) print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['stock_virtual']['checked'])) print_liste_field_titre($arrayfields['stock_virtual']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_sell","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_buy","",$param,'',$sortfield,$sortorder); - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // Hook fields - $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tosell']['checked'])) print_liste_field_titre($arrayfields['p.tosell']['label'],$_SERVER["PHP_SELF"],"p.tosell","",$param,'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($arrayfields['p.tobuy']['label'],$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - - $product_static=new Product($db); - $product_fourn =new ProductFournisseur($db); - - $i = 0; - $totalarray=array(); - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($resql); - - // Multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active ->>>>>>> edae0b4 Fix: remove unused code - { -<<<<<<< 8.0_canvas - if ($obj->fk_product_type != 1 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Not a service - { - $product_static->load_stock('nobatch'); // Load stock_reel + stock_warehouse. This also call load_virtual_stock() -======= - $sql = "SELECT label"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql.= " WHERE fk_product=".$obj->rowid; - $sql.= " AND lang='". $db->escape($langs->getDefaultLang()) ."'"; - $sql.= " LIMIT 1"; - - $result = $db->query($sql); - if ($result) - { - $objtp = $db->fetch_object($result); - if (! empty($objtp->label)) $obj->label = $objtp->label; ->>>>>>> edae0b4 Fix: remove unused code - } - } - -<<<<<<< 8.0_canvas -======= - $product_static->id = $obj->rowid; - $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; - $product_static->label = $obj->label; - $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; - - if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock - { - if ($obj->fk_product_type != 1 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Not a service - { - $product_static->load_stock('nobatch'); // Load stock_reel + stock_warehouse. This also call load_virtual_stock() - } - } ->>>>>>> edae0b4 Fix: remove unused code - -<<<<<<< 8.0_canvas - print ''; -======= ->>>>>>> edae0b4 Fix: remove unused code - -<<<<<<< 8.0_canvas -======= - print ''; - ->>>>>>> edae0b4 Fix: remove unused code - // Ref - if (! empty($arrayfields['p.ref']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - } - // Ref supplier - if (! empty($arrayfields['pfp.ref_fourn']['checked'])) - { - print '\n"; - if (! $i) $totalarray['nbfield']++; - } - // Label - if (! empty($arrayfields['p.label']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Type - if (! empty($arrayfields['p.fk_product_type']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Barcode - if (! empty($arrayfields['p.barcode']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Duration - if (! empty($arrayfields['p.duration']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Sell price - if (! empty($arrayfields['p.sellprice']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Better buy price - if (! empty($arrayfields['p.minbuyprice']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Number of buy prices - if (! empty($arrayfields['p.numbuyprice']['checked'])) - { - print ''; - } - - // WAP - if (! empty($arrayfields['p.pmp']['checked'])) - { - print ''; - } - - // Limit alert - if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Desired stock - if (! empty($arrayfields['p.desiredstock']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Stock real - if (! empty($arrayfields['p.stock']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Stock virtual - if (! empty($arrayfields['stock_virtual']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Lot/Serial - if (! empty($arrayfields['p.tobatch']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Accountancy code sell - if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['p.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['p.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - - // Status (to sell) - if (! empty($arrayfields['p.tosell']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status (to buy) - if (! empty($arrayfields['p.tobuy']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Action - print ''; if (! $i) $totalarray['nbfield']++; @@ -1627,19 +945,8 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; -<<<<<<< 8.0_canvas - $db->free($resql); - - print "
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - $array=array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service')); - print $form->selectarray('search_type', $array, $search_type); - print ''; - print ''; - print ''; - print ' '; - print ''; - print ''; - print ' '; - print ''; - print ' '; - print ''; - print ' '; - print ''; - print ' '; - print ''; - print ' '; - print '  '.$form->selectyesno($search_tobatch, '', '', '', 1).''; - print ''; - print ''; - print $form->selectarray('search_tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$search_tosell,1); - print ''; - print $form->selectarray('search_tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$search_tobuy,1); - print ''; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; - print '
'; - print $product_static->getNomUrl(1); - print "'; - print $product_static->getNomUrl(1); - print "'.dol_trunc($obj->label,40).''.$obj->fk_product_type.''.$obj->barcode.''; - if (preg_match('/([^a-z]+)[a-z]/i',$obj->duration)) - { - if (preg_match('/([^a-z]+)y/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); - elseif (preg_match('/([^a-z]+)m/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); - elseif (preg_match('/([^a-z]+)w/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek"); - elseif (preg_match('/([^a-z]+)d/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); - //elseif (preg_match('/([^a-z]+)h/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationHour"); - else print $obj->duration; - } - print ''; - if ($obj->tosell) - { - if ($obj->price_base_type == 'TTC') print price($obj->price_ttc).' '.$langs->trans("TTC"); - else print price($obj->price).' '.$langs->trans("HT"); - } - print ''; - if ($obj->tobuy && $obj->minsellprice != '') - { - //print price($obj->minsellprice).' '.$langs->trans("HT"); - if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) - { - if ($product_fourn->product_fourn_price_id > 0) - { - if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->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 ($obj->tobuy) - { - 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 price($product_static->pmp, 1, $langs); - print ''; - if ($obj->fk_product_type != 1) - { - print $obj->seuil_stock_alerte; - } - print ''; - if ($obj->fk_product_type != 1) - { - print $obj->desiredstock; - } - print ''; - if ($obj->fk_product_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 $product_static->stock_reel; - } - print ''; - if ($obj->fk_product_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 $product_static->stock_theorique; - } - print ''; - print yn($obj->tobatch); - print ''.$obj->accountancy_code_sell.''.$obj->accountancy_code_buy.''; - print dol_print_date($obj->date_creation, 'dayhour', 'tzuser'); - print ''; - print dol_print_date($obj->date_update, 'dayhour', 'tzuser'); - print ''; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); - } else { - print $product_static->LibStatut($obj->tosell,5,0); - } - print ''; - if (! empty($conf->use_javascript_ajax) && $user->rights->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($obj->tobuy,5,1); - } - 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 (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $product_static->LibStatut($obj->tosell,5,0); ->>>>>>> 1d08002 Fix: remove old code of canvas } print '
"; - print "
"; -<<<<<<< 8.0_canvas -======= - print '
'; ->>>>>>> edae0b4 Fix: remove unused code -======= print "\n"; $i++; ->>>>>>> 1d08002 Fix: remove old code of canvas } $db->free($resql);