25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
32 $langs->loadLangs(array(
"mrp",
"other"));
34 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
35 $massaction =
GETPOST(
'massaction',
'alpha');
36 $show_files =
GETPOST(
'show_files',
'int');
37 $confirm =
GETPOST(
'confirm',
'alpha');
38 $cancel =
GETPOST(
'cancel',
'alpha');
39 $toselect =
GETPOST(
'toselect',
'array');
40 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bomlist';
41 $backtopage =
GETPOST(
'backtopage',
'alpha');
42 $optioncss =
GETPOST(
'optioncss',
'aZ');
47 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
48 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
49 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
51 if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) { $page = 0; }
52 $offset = $limit * $page;
53 $pageprev = $page - 1;
54 $pagenext = $page + 1;
59 $object =
new BOM($db);
61 $diroutputmassaction = $conf->bom->dir_output.
'/temp/massgeneration/'.$user->id;
62 $hookmanager->initHooks(array(
'bomlist'));
65 $extrafields->fetch_name_optionals_label($object->table_element);
67 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
70 if (!$sortfield) $sortfield =
"t.".key($object->fields);
71 if (!$sortorder) $sortorder =
"ASC";
84 $search_all =
GETPOST(
"search_all",
'alpha');
86 foreach ($object->fields as $key => $val)
88 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
92 $fieldstosearchall = array();
93 foreach ($object->fields as $key => $val)
95 if ($val[
'searchall']) $fieldstosearchall[
't.'.$key] = $val[
'label'];
99 $arrayfields = array();
100 foreach ($object->fields as $key => $val)
103 if (!empty($val[
'visible'])) $arrayfields[
't.'.$key] = array(
'label'=>$val[
'label'],
'checked'=>(($val[
'visible'] < 0) ? 0 : 1),
'enabled'=>($val[
'enabled'] && ($val[
'visible'] != 3)),
'position'=>$val[
'position']);
106 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label']) > 0)
108 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val)
110 if (!empty($extrafields->attributes[$object->table_element][
'list'][$key])) {
111 $arrayfields[
"ef.".$key] = array(
112 'label'=>$extrafields->attributes[$object->table_element][
'label'][$key],
113 'checked'=>(($extrafields->attributes[$object->table_element][
'list'][$key] < 0) ? 0 : 1),
114 'position'=>$extrafields->attributes[$object->table_element][
'pos'][$key],
115 'enabled'=>(abs($extrafields->attributes[$object->table_element][
'list'][$key]) != 3 && $extrafields->attributes[$object->table_element][
'perms'][$key])
123 $permissiontoread = $user->rights->bom->read;
124 $permissiontoadd = $user->rights->bom->write;
125 $permissiontodelete = $user->rights->bom->delete;
132 if (
GETPOST(
'cancel',
'alpha')) { $action =
'list'; $massaction =
''; }
133 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') { $massaction =
''; }
135 $parameters = array();
136 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
137 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
142 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
145 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
147 foreach ($object->fields as $key => $val)
152 $search_array_options = array();
154 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
155 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha'))
161 $objectclass =
'BOM';
162 $objectlabel =
'BillOfMaterials';
163 $permissiontoread = $user->rights->bom->read;
164 $permissiontodelete = $user->rights->bom->delete;
165 $uploaddir = $conf->bom->dir_output;
166 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
170 if (!$error && $massaction ==
'disable' && $permissiontoadd)
172 $objecttmp =
new $objectclass($db);
179 foreach ($toselect as $toselectid)
181 $result = $objecttmp->fetch($toselectid);
184 if ($objecttmp->status != $objecttmp::STATUS_VALIDATED)
186 $langs->load(
"errors");
187 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusActiveToBeDisabled", $objecttmp->ref), null,
'errors');
193 $result = $objecttmp->cancel($user);
209 if ($nbok > 1)
setEventMessages($langs->trans(
"RecordsModified", $nbok), null,
'mesgs');
210 else setEventMessages($langs->trans(
"RecordsModified", $nbok), null,
'mesgs');
220 if (!$error && $massaction ==
'enable' && $permissiontoadd)
222 $objecttmp =
new $objectclass($db);
229 foreach ($toselect as $toselectid)
231 $result = $objecttmp->fetch($toselectid);
234 if ($objecttmp->status != $objecttmp::STATUS_DRAFT && $objecttmp->status != $objecttmp::STATUS_CANCELED)
236 $langs->load(
"errors");
237 setEventMessages($langs->trans(
"ErrorObjectMustHaveStatusDraftOrDisabledToBeActivated", $objecttmp->ref), null,
'errors');
243 $result = $objecttmp->validate($user);
259 if ($nbok > 1)
setEventMessages($langs->trans(
"RecordsModified", $nbok), null,
'mesgs');
260 else setEventMessages($langs->trans(
"RecordsModified", $nbok), null,
'mesgs');
275 $form =
new Form($db);
281 $title = $langs->trans(
'ListOfBOMs');
287 foreach ($object->fields as $key => $val)
289 $sql .=
't.'.$key.
', ';
292 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
293 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
"ef.".$key.
' as options_'.$key.
', ' :
'');
296 $parameters = array();
297 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
298 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
299 $sql = preg_replace(
'/,\s*$/',
'', $sql);
300 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
301 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (t.rowid = ef.fk_object)";
302 if ($object->ismultientitymanaged == 1) $sql .=
" WHERE t.entity IN (".getEntity($object->element).
")";
303 else $sql .=
" WHERE 1 = 1";
304 foreach ($search as $key => $val)
306 if ($key ==
'status' && $search[$key] == -1)
continue;
307 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
308 if (strpos($object->fields[$key][
'type'],
'integer:') === 0) {
309 if ($search[$key] ==
'-1') $search[$key] =
'';
312 if ($search[$key] !=
'') $sql .=
natural_search($key, $search[$key], (($key ==
'status') ? 2 : $mode_search));
315 if ($search_all) $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
317 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
319 $parameters = array();
320 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
321 $sql .= $hookmanager->resPrint;
340 $sql .= $db->order($sortfield, $sortorder);
343 $nbtotalofrecords =
'';
344 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
346 $resql = $db->query($sql);
347 $nbtotalofrecords = $db->num_rows(
$resql);
348 if (($page * $limit) > $nbtotalofrecords)
355 if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit)))
357 $num = $nbtotalofrecords;
359 if ($limit) $sql .= $db->plimit($limit + 1, $offset);
361 $resql = $db->query($sql);
368 $num = $db->num_rows(
$resql);
372 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page)
374 $obj = $db->fetch_object(
$resql);
376 header(
"Location: ".DOL_URL_ROOT.
'/bom/bom_card.php?id='.$id);
386 $arrayofselected = is_array($toselect) ? $toselect : array();
389 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.urlencode($contextpage);
390 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.urlencode($limit);
391 foreach ($search as $key => $val)
393 if (is_array($search[$key]) && count($search[$key]))
foreach ($search[$key] as $skey) $param .=
'&search_'.$key.
'[]='.urlencode($skey);
394 else $param .=
'&search_'.$key.
'='.urlencode($search[$key]);
396 if ($optioncss !=
'') $param .=
'&optioncss='.urlencode($optioncss);
398 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
401 $arrayofmassactions = array(
403 'enable'=>$langs->trans(
"Enable"),
404 'disable'=>$langs->trans(
"Disable"),
406 if ($permissiontodelete) $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
407 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) $arrayofmassactions = array();
408 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
410 print '<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
411 if ($optioncss !=
'')
print '<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
412 print '<input type="hidden" name="token" value="'.newToken().
'">';
413 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
414 print '<input type="hidden" name="action" value="list">';
415 print '<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
416 print '<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
417 print '<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
419 $newcardbutton =
dolGetButtonTitle($langs->trans(
'New'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/bom/bom_card.php?action=create&backtopage='.urlencode(
$_SERVER[
'PHP_SELF']),
'', $user->rights->bom->write);
421 print_barre_liste($title, $page,
$_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bom', 0, $newcardbutton,
'', $limit, 0, 0, 1);
424 $topicmail =
"SendBillOfMaterialsRef";
426 $objecttmp =
new BOM($db);
427 $trackid =
'bom'.$object->id;
428 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
432 foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
433 print '<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
441 $parameters = array();
442 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
443 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
444 else $moreforfilter = $hookmanager->resPrint;
446 if (!empty($moreforfilter))
448 print '<div class="liste_titre liste_titre_bydiv centpercent">';
449 print $moreforfilter;
453 $varpage = empty($contextpage) ?
$_SERVER[
"PHP_SELF"] : $contextpage;
454 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
455 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
457 print '<div class="div-table-responsive">';
458 print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
463 print '<tr class="liste_titre">';
464 foreach ($object->fields as $key => $val)
466 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
467 if ($key ==
'status') $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
468 elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
469 elseif (in_array($val['
type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
470 elseif (in_array($val['type'], array('
double(24,8)', '
double(6,3)', 'integer', 'real', '
price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right';
471 if (!empty($arrayfields['t.'.$key]['checked']))
473 print
'<td class="liste_titre'.($cssforfield ?
' '.$cssforfield :
'').
'">';
474 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) print $form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0,
'', 1, 0, 0,
'',
'maxwidth100', 1);
475 elseif (strpos($val[
'type'],
'integer:') === 0) {
476 print $object->showInputField($val, $key, $search[$key],
'',
'',
'search_',
'maxwidth150', 1);
477 } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) print '<input type="text" class="flat maxwidth75"
name="search_'.$key.'" value="'.
dol_escape_htmltag($search[$key]).'">';
482 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
485 $parameters = array('arrayfields'=>$arrayfields);
486 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object);
487 print $hookmanager->resPrint;
489 print '<td class="liste_titre maxwidthsearch">';
490 $searchpicto = $form->showFilterButtons();
498 print '<tr class="liste_titre">';
499 foreach ($object->
fields as $key => $val)
501 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
502 if ($key ==
'status') $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
503 elseif (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
504 elseif (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
505 elseif (in_array($val['type'], array('
double(24,8)', '
double(6,3)', 'integer', 'real', '
price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right';
506 if (!empty($arrayfields['t.'.$key]['checked']))
508 print
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0,
$_SERVER[
'PHP_SELF'],
't.'.$key,
'', $param, ($cssforfield ?
'class="'.$cssforfield.
'"' :
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' :
'')).
"\n";
512 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
514 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
515 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
516 print $hookmanager->resPrint;
518 print
getTitleFieldOfList($selectedfields, 0,
$_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
523 $needToFetchEachLine = 0;
524 if (is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0)
526 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val)
528 if (preg_match(
'/\$object/', $val)) $needToFetchEachLine++;
536 $totalarray = array();
537 while ($i < ($limit ? min($num, $limit) : $num))
539 $obj = $db->fetch_object(
$resql);
540 if (empty($obj))
break;
543 $object->setVarsFromFetchObj($obj);
546 print
'<tr class="oddeven">';
547 foreach ($object->fields as $key => $val)
549 $cssforfield = (empty($val[
'css']) ?
'' : $val[
'css']);
550 if (in_array($val[
'type'], array(
'date',
'datetime',
'timestamp'))) $cssforfield .= ($cssforfield ?
' ' :
'').
'center';
551 elseif ($key ==
'status') $cssforfield .= ($cssforfield ? ' ' : '').'center';
553 if (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
554 elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
556 if (in_array($val['type'], array('
double(24,8)', '
double(6,3)', 'integer', 'real', '
price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
557 if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
559 if (!empty($arrayfields['t.'.$key]['checked']))
561 print
'<td'.($cssforfield ?
' class="'.$cssforfield.
'"' :
'').
'>';
562 if ($key ==
'status') print $object->getLibStatut(5);
563 else print $object->showOutputField($val, $key, $object->$key,
'');
565 if (!$i) $totalarray[
'nbfield']++;
566 if (!empty($val[
'isameasure']))
568 if (!$i) $totalarray[
'pos'][$totalarray[
'nbfield']] =
't.'.$key;
569 $totalarray[
'val'][
't.'.$key] += $object->$key;
574 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
576 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
577 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
578 print $hookmanager->resPrint;
580 print
'<td class="nowrap center">';
581 if ($massactionbutton || $massaction)
584 if (in_array($object->id, $arrayofselected)) $selected = 1;
585 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
588 if (!$i) $totalarray[
'nbfield']++;
596 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
603 foreach ($arrayfields as $key => $val) {
if (!empty($val[
'checked'])) $colspan++; }
604 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
610 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
611 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
612 print $hookmanager->resPrint;
614 print
'</table>'.
"\n";
617 print
'</form>'.
"\n";
620 if (in_array(
'builddoc', $arrayofmassactions) && ($nbtotalofrecords ===
'' || $nbtotalofrecords))
622 $hidegeneratedfilelistifempty = 1;
623 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
625 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
629 $urlsource =
$_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
630 $urlsource .= str_replace(
'&',
'&', $param);
632 $filedir = $diroutputmassaction;
633 $genallowed = $permissiontoread;
634 $delallowed = $permissiontoadd;
636 print $formfile->showdocuments(
'massfilesarea_bom',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'', null, $hidegeneratedfilelistifempty);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
foreach($object->fields as $key=> $val) if(is_array($extrafields->attributes[$object->table_element]['label'])&&count($extrafields->attributes[$object->table_element]['label']) > 0) $object fields
dol_now($mode= 'auto')
Return date for now.
$conf db name
Only used if Module[ID]Name translation string is not found.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
print $_SERVER["PHP_SELF"] n
Edit parameters.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip= '', $forcenowrapcolumntitle=0)
Get title line of an array.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...