27 require 
'../../../main.inc.php';
 
   28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
 
   29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
 
   30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
 
   31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
 
   32 require_once DOL_DOCUMENT_ROOT.
'/product/stock/stocktransfer/class/stocktransfer.class.php';
 
   35 $langs->loadLangs(array(
"stocks", 
"other"));
 
   37 $action     = 
GETPOST(
'action', 
'aZ09') ?
GETPOST(
'action', 
'aZ09') : 
'view'; 
 
   38 $massaction = 
GETPOST(
'massaction', 
'alpha'); 
 
   39 $show_files = 
GETPOST(
'show_files', 
'int'); 
 
   40 $confirm    = 
GETPOST(
'confirm', 
'alpha'); 
 
   41 $cancel     = 
GETPOST(
'cancel', 
'alpha'); 
 
   42 $toselect   = 
GETPOST(
'toselect', 
'array'); 
 
   43 $contextpage = 
GETPOST(
'contextpage', 
'aZ') ? 
GETPOST(
'contextpage', 
'aZ') : 
'stocktransferlist'; 
 
   44 $backtopage = 
GETPOST(
'backtopage', 
'alpha'); 
 
   45 $optioncss  = 
GETPOST(
'optioncss', 
'aZ'); 
 
   50 $limit = 
GETPOST(
'limit', 
'int') ? 
GETPOST(
'limit', 
'int') : $conf->liste_limit;
 
   51 $sortfield = 
GETPOST(
'sortfield', 
'alpha');
 
   52 $sortorder = 
GETPOST(
'sortorder', 
'alpha');
 
   54 if (empty($page) || $page < 0 || 
GETPOST(
'button_search', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')) { $page = 0; }     
 
   55 $offset = $limit * $page;
 
   56 $pageprev = $page - 1;
 
   57 $pagenext = $page + 1;
 
   62 $diroutputmassaction = $conf->stocktransfer->dir_output.
'/temp/massgeneration/'.$user->id;
 
   63 $hookmanager->initHooks(array(
'stocktransferlist')); 
 
   66 $extrafields->fetch_name_optionals_label($object->table_element);
 
   69 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, 
'', 
'search_');
 
   72 if (!$sortfield) $sortfield = 
"t.".key($object->fields); 
 
   73 if (!$sortorder) $sortorder = 
"ASC";
 
   76 $search_all = 
GETPOST(
'search_all', 
'alphanohtml') ? trim(
GETPOST(
'search_all', 
'alphanohtml')) : trim(
GETPOST(
'sall', 
'alphanohtml'));
 
   78 foreach ($object->fields as $key => $val) {
 
   79   if (
GETPOST(
'search_'.$key, 
'alpha') !== 
'') $search[$key] = 
GETPOST(
'search_'.$key, 
'alpha');
 
   83 $fieldstosearchall = array();
 
   84 foreach ($object->fields as $key => $val) {
 
   85   if ($val[
'searchall']) $fieldstosearchall[
't.'.$key] = $val[
'label'];
 
   89 $arrayfields = array();
 
   90 foreach ($object->fields as $key => $val) {
 
   92   if (!empty($val[
'visible'])) $arrayfields[
't.'.$key] = array(
'label'=>$val[
'label'], 
'checked'=>(($val[
'visible'] < 0) ? 0 : 1), 
'enabled'=>(
verifCond($val[
'enabled']) && ($val[
'visible'] != 3)), 
'position'=>$val[
'position']);
 
   96 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label']) > 0) {
 
   97   foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
 
   98     if (!empty($extrafields->attributes[$object->table_element][
'list'][$key])) {
 
   99       $arrayfields[
"ef.".$key] = array(
 
  100         'label'=>$extrafields->attributes[$object->table_element][
'label'][$key],
 
  101         'checked'=>(($extrafields->attributes[$object->table_element][
'list'][$key] < 0) ? 0 : 1),
 
  102         'position'=>$extrafields->attributes[$object->table_element][
'pos'][$key],
 
  103         'enabled'=>(abs($extrafields->attributes[$object->table_element][
'list'][$key]) != 3 && $extrafields->attributes[$object->table_element][
'perms'][$key]),
 
  104         'langfile'=>$extrafields->attributes[$object->table_element][
'langfile'][$key]
 
  112 $permissiontoread = $user->rights->stocktransfer->stocktransfer->read;
 
  113 $permissiontoadd = $user->rights->stocktransfer->stocktransfer->write;
 
  114 $permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete;
 
  117 if (empty($conf->stocktransfer->enabled)) 
accessforbidden(
'Module not enabled');
 
  119 if ($user->socid > 0) { 
 
  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');
 
  139 if (empty($reshook)) {
 
  141   include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
 
  144   if (
GETPOST(
'button_removefilter_x', 
'alpha') || 
GETPOST(
'button_removefilter.x', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')) { 
 
  145     foreach ($object->fields as $key => $val) {
 
  149     $search_array_options = array();
 
  151   if (
GETPOST(
'button_removefilter_x', 
'alpha') || 
GETPOST(
'button_removefilter.x', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')
 
  152     || 
GETPOST(
'button_search_x', 
'alpha') || 
GETPOST(
'button_search.x', 
'alpha') || 
GETPOST(
'button_search', 
'alpha')) {
 
  157   $objectclass = 
'StockTransfer';
 
  158   $objectlabel = 
'StockTransfer';
 
  159   $uploaddir = $conf->stocktransfer->dir_output;
 
  160   include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
 
  175 $title = $langs->trans(
'StockTransferList');
 
  181 foreach ($object->fields as $key => $val) {
 
  182   $sql .= 
"t.".$key.
", ";
 
  185 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
 
  186   foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] != 
'separate' ? 
"ef.".$key.
" as options_".$key.
', ' : 
'');
 
  189 $parameters = array();
 
  190 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object); 
 
  191 $sql .= preg_replace(
'/^,/', 
'', $hookmanager->resPrint);
 
  192 $sql = preg_replace(
'/,\s*$/', 
'', $sql);
 
  193 $sql .= 
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as t";
 
  194 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)";
 
  195 if ($object->ismultientitymanaged == 1) $sql .= 
" WHERE t.entity IN (".getEntity($object->element).
")";
 
  196 else $sql .= 
" WHERE 1 = 1";
 
  197 foreach ($search as $key => $val) {
 
  198   if ($key == 
'status' && $search[$key] == -1) 
continue;
 
  199   $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
 
  200   if (strpos($object->fields[$key][
'type'], 
'integer:') === 0) {
 
  201     if ($search[$key] == 
'-1') $search[$key] = 
'';
 
  204   if ($search[$key] != 
'') $sql .= 
natural_search($key, $search[$key], (($key == 
'status') ? 2 : $mode_search));
 
  206 if ($search_all) $sql .= 
natural_search(array_keys($fieldstosearchall), $search_all);
 
  209 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
 
  211 $parameters = array();
 
  212 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object); 
 
  213 $sql .= $hookmanager->resPrint;
 
  232 $sql .= $db->order($sortfield, $sortorder);
 
  236 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
 
  237   $resql = $db->query($sql);
 
  248   if ($limit) $sql .= $db->plimit($limit + 1, $offset);
 
  250   $resql = $db->query($sql);
 
  256   $num = $db->num_rows(
$resql);
 
  260 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
 
  261   $obj = $db->fetch_object(
$resql);
 
  263   header(
"Location: ".
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_card.php', 1).
'?id='.$id);
 
  274 print 
'<script type="text/javascript" language="javascript"> 
  275 jQuery(document).ready(function() { 
  276   function init_myfunc() 
  278     jQuery("#myid").removeAttr(\'disabled\'); 
  279     jQuery("#myid").attr(\'disabled\',\'disabled\'); 
  282   jQuery("#mybutton").click(function() { 
  288 $arrayofselected = is_array($toselect) ? $toselect : array();
 
  291 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) $param .= 
'&contextpage='.urlencode($contextpage);
 
  292 if ($limit > 0 && $limit != $conf->liste_limit) $param .= 
'&limit='.urlencode($limit);
 
  293 foreach ($search as $key => $val) {
 
  294   if (is_array($search[$key]) && count($search[$key])) 
foreach ($search[$key] as $skey) $param .= 
'&search_'.$key.
'[]='.urlencode($skey);
 
  295   else $param .= 
'&search_'.$key.
'='.urlencode($search[$key]);
 
  297 if ($optioncss != 
'')     $param .= 
'&optioncss='.urlencode($optioncss);
 
  299 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
 
  302 $arrayofmassactions = array(
 
  308 if ($permissiontodelete) $arrayofmassactions[
'predelete'] = 
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
 
  309 if (
GETPOST(
'nomassaction', 
'int') || in_array($massaction, array(
'presend', 
'predelete'))) $arrayofmassactions = array();
 
  310 $massactionbutton = 
$form->selectMassAction(
'', $arrayofmassactions);
 
  312 print 
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
 
  313 if ($optioncss != 
'') print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  314 print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  315 print 
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
 
  316 print 
'<input type="hidden" name="action" value="list">';
 
  317 print 
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
 
  318 print 
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
 
  320 print 
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
 
  322 $newcardbutton = 
dolGetButtonTitle($langs->trans(
'New'), 
'', 
'fa fa-plus-circle', 
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_card.php', 1).
'?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF']), 
'', $permissiontoadd);
 
  324 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, 
$nbtotalofrecords, 
'object_'.$object->picto, 0, $newcardbutton, 
'', $limit, 0, 0, 1);
 
  327 $topicmail = 
"SendStockTransferRef";
 
  328 $modelmail = 
"stocktransfer";
 
  330 $trackid = 
'xxxx'.$object->id;
 
  331 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
 
  334   foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
 
  335   print 
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
 
  343 $parameters = array();
 
  344 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object); 
 
  345 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
 
  346 else $moreforfilter = $hookmanager->resPrint;
 
  348 if (!empty($moreforfilter)) {
 
  349   print 
'<div class="liste_titre liste_titre_bydiv centpercent">';
 
  350   print $moreforfilter;
 
  354 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
 
  355 $selectedfields = 
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage); 
 
  356 $selectedfields .= (count($arrayofmassactions) ? 
$form->showCheckAddButtons(
'checkforselect', 1) : 
'');
 
  358 print 
'<div class="div-table-responsive">'; 
 
  359 print 
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ? 
" listwithfilterbefore" : 
"").
'">'.
"\n";
 
  364 print 
'<tr class="liste_titre">';
 
  365 foreach ($object->fields as $key => $val) {
 
  366   $cssforfield = (empty($val[
'css']) ? 
'' : $val[
'css']);
 
  367   if ($key == 
'status') $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  368   elseif (in_array($val[
'type'], array(
'date', 
'datetime', 
'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
 
  369   elseif (in_array($val['
type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
 
  370   elseif (in_array($val['
type'], array('
double(24,8)', '
double(6,3)', 'integer', 'real', '
price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right';
 
  371   if (!empty($arrayfields['t.'.$key]['checked'])) {
 
  372     print 
'<td class="liste_titre'.($cssforfield ? 
' '.$cssforfield : 
'').
'">';
 
  373     if (is_array($val[
'arrayofkeyval'])) print 
$form->selectarray(
'search_'.$key, $val[
'arrayofkeyval'], $search[$key], $val[
'notnull'], 0, 0, 
'', 1, 0, 0, 
'', 
'maxwidth75');
 
  374     elseif (strpos($val[
'type'], 
'integer:') === 0) {
 
  375       print $object->showInputField($val, $key, $search[$key], 
'', 
'', 
'search_', 
'maxwidth150', 1);
 
  376     } elseif (!preg_match(
'/^(date|timestamp)/', $val[
'type'])) print 
'<input type="text" class="flat maxwidth75" name="search_'.$key.
'" value="'.
dol_escape_htmltag($search[$key]).
'">';
 
  381 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
 
  384 $parameters = array(
'arrayfields'=>$arrayfields);
 
  385 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object); 
 
  386 print $hookmanager->resPrint;
 
  388 print 
'<td class="liste_titre maxwidthsearch">';
 
  389 $searchpicto = 
$form->showFilterButtons();
 
  397 print 
'<tr class="liste_titre">';
 
  398 foreach ($object->fields as $key => $val) {
 
  399   $cssforfield = (empty($val[
'css']) ? 
'' : $val[
'css']);
 
  400   if ($key == 
'status') $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  401   elseif (in_array($val[
'type'], array(
'date', 
'datetime', 
'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center';
 
  402   elseif (in_array($val['
type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
 
  403   elseif (in_array($val['
type'], array('
double(24,8)', '
double(6,3)', 'integer', 'real', '
price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right';
 
  404   if (!empty($arrayfields['t.'.$key]['checked'])) {
 
  405     print 
getTitleFieldOfList($arrayfields[
't.'.$key][
'label'], 0, $_SERVER[
'PHP_SELF'], 
't.'.$key, 
'', $param, ($cssforfield ? 
'class="'.$cssforfield.
'"' : 
''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.
' ' : 
'')).
"\n";
 
  409 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
 
  411 $parameters = array(
'arrayfields'=>$arrayfields, 
'param'=>$param, 
'sortfield'=>$sortfield, 
'sortorder'=>$sortorder);
 
  412 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object); 
 
  413 print $hookmanager->resPrint;
 
  415 print 
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"], 
'', 
'', 
'', 
'', $sortfield, $sortorder, 
'center maxwidthsearch ').
"\n";
 
  420 $needToFetchEachLine = 0;
 
  421 if (is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
 
  422   foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
 
  423     if (preg_match(
'/\$object/', $val)) $needToFetchEachLine++; 
 
  431 $totalarray = array();
 
  432 while ($i < ($limit ? min($num, $limit) : $num)) {
 
  433   $obj = $db->fetch_object(
$resql);
 
  434   if (empty($obj)) 
break; 
 
  437   $object->setVarsFromFetchObj($obj);
 
  440   print 
'<tr class="oddeven">';
 
  441   foreach ($object->fields as $key => $val) {
 
  442     $cssforfield = (empty($val[
'css']) ? 
'' : $val[
'css']);
 
  443     if (in_array($val[
'type'], array(
'date', 
'datetime', 
'timestamp'))) $cssforfield .= ($cssforfield ? 
' ' : 
'').
'center';
 
  444     elseif ($key == 
'status') $cssforfield .= ($cssforfield ? ' ' : '').'center';
 
  446     if (in_array($val['
type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
 
  447     elseif ($key == '
ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
 
  449     if (in_array($val['
type'], array('
double(24,8)', '
double(6,3)', 'integer', 'real', '
price')) && $key != 'status') $cssforfield .= ($cssforfield ? ' ' : '').'right';
 
  452     if (!empty($arrayfields['t.'.$key]['checked'])) {
 
  453       print 
'<td'.($cssforfield ? 
' class="'.$cssforfield.
'"' : 
'').
'>';
 
  454       if ($key == 
'status') print $object->getLibStatut(5);
 
  456         print $object->showOutputField($val, $key, $object->$key, 
'');
 
  457         if ($key === 
'date_prevue_depart' && $object->lead_time_for_warning > 0 && $object->$key > 0) {
 
  458           $date_prevue_depart = $object->$key;
 
  459           $date_prevue_depart_plus_delai = $date_prevue_depart;
 
  460           if ($object->lead_time_for_warning > 0) $date_prevue_depart_plus_delai = strtotime(date(
'Y-m-d', $date_prevue_depart) . 
' + '.$object->lead_time_for_warning.
' day');
 
  461           if ($date_prevue_depart_plus_delai < strtotime(date(
'Y-m-d'))) print 
img_warning($langs->trans(
'Alert').
' - '.$langs->trans(
'Late'));
 
  465       if (!$i) $totalarray[
'nbfield']++;
 
  466       if (!empty($val[
'isameasure'])) {
 
  467         if (!$i) $totalarray[
'pos'][$totalarray[
'nbfield']] = 
't.'.$key;
 
  468         $totalarray[
'val'][
't.'.$key] += $object->$key;
 
  473   include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
 
  475   $parameters = array(
'arrayfields'=>$arrayfields, 
'object'=>$object, 
'obj'=>$obj, 
'i'=>$i, 
'totalarray'=>&$totalarray);
 
  476   $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object); 
 
  477   print $hookmanager->resPrint;
 
  479   print 
'<td class="nowrap center">';
 
  480   if ($massactionbutton || $massaction) {   
 
  482     if (in_array($object->id, $arrayofselected)) $selected = 1;
 
  483     print 
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ? 
' checked="checked"' : 
'').
'>';
 
  486   if (!$i) $totalarray[
'nbfield']++;
 
  494 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
 
  499   foreach ($arrayfields as $key => $val) { 
if (!empty($val[
'checked'])) $colspan++; }
 
  500   print 
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
 
  506 $parameters = array(
'arrayfields'=>$arrayfields, 
'sql'=>$sql);
 
  507 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object); 
 
  508 print $hookmanager->resPrint;
 
  510 print 
'</table>'.
"\n";
 
  513 print 
'</form>'.
"\n";
 
  516   $hidegeneratedfilelistifempty = 1;
 
  517   if ($massaction == 
'builddoc' || $action == 
'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
 
  519   require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
 
  523   $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
 
  524   $urlsource .= str_replace(
'&', 
'&', $param);
 
  526   $filedir = $diroutputmassaction;
 
  527   $genallowed = $permissiontoread;
 
  528   $delallowed = $permissiontoadd;
 
  530   print $formfile->showdocuments(
'massfilesarea_stocktransfer', 
'', $filedir, $urlsource, 0, $delallowed, 
'', 1, 1, 0, 48, 1, $param, $title, 
'', 
'', 
'', 
null, $hidegeneratedfilelistifempty);
 
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("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->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
dol_now($mode='auto')
Return date for now.
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...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
verifCond($strToEvaluate)
Verify if condition in string is ok or not.
if(!defined( 'CSRFCHECK_WITH_TOKEN'))
$nbtotalofrecords
Count total nb of records.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.