Go to the documentation of this file.
24 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
43 if (empty($preSelected) || !is_array($preSelected)) {
44 $preSelected = array();
47 $htmlName =
"search_category_".$type.
"_list";
50 $categoryArray[-2] =
"- ".$langs->trans(
'NotCategorized').
" -";
52 $tmptitle = $langs->transnoentitiesnoconv(
"Category");
55 $filter .=
'<div class="divsearchfield">';
56 $filter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
58 $filter .=
Form::multiselectarray($htmlName, $categoryArray, $preSelected, 0, 0,
"minwidth300 widthcentpercentminusx", 0, 0,
'',
'', $tmptitle);
75 $sql =
"SELECT cp.fk_categorie as cat_index, cat.label";
76 $sql .=
" FROM ".MAIN_DB_PREFIX.
"categorie_product as cp";
77 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"categorie as cat ON cat.rowid = cp.fk_categorie";
78 $sql .=
" GROUP BY cp.fk_categorie, cat.label";
80 dol_syslog(get_class($this).
"::selectProductCategory", LOG_DEBUG);
83 print
'<select class="flat" id="select_'.$htmlname.
'" name="'.$htmlname.
'">';
85 print
'<option value="0"> </option>';
89 $num_rows = $this->
db->num_rows(
$resql);
90 while ($i < $num_rows) {
91 $category = $this->
db->fetch_object(
$resql);
92 if ($selected && $selected == $category->cat_index) {
93 print
'<option value="'.$category->cat_index.
'" selected>'.$category->label.
'</option>';
95 print
'<option value="'.$category->cat_index.
'">'.$category->label.
'</option>';
$conf db
API class for accounts.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.