28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/salaries/class/paymentsalary.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
36 $langs->loadLangs(array(
"compta",
"salaries",
"bills",
"hrm"));
38 $action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
39 $massaction =
GETPOST(
'massaction',
'alpha');
40 $show_files =
GETPOST(
'show_files',
'int');
41 $confirm =
GETPOST(
'confirm',
'alpha');
42 $cancel =
GETPOST(
'cancel',
'alpha');
43 $toselect =
GETPOST(
'toselect',
'array');
44 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') : str_replace(
'_',
'', basename(dirname(__FILE__)).basename(__FILE__,
'.php'));
45 $backtopage =
GETPOST(
'backtopage',
'alpha');
46 $optioncss =
GETPOST(
'optioncss',
'aZ');
49 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
50 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
51 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
53 if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
56 $offset = $limit * $page;
57 $pageprev = $page - 1;
58 $pagenext = $page + 1;
60 $sortfield =
"s.datep,s.rowid";
63 $sortorder =
"DESC,DESC";
69 $diroutputmassaction = $conf->user->dir_output.
'/temp/massgeneration/'.$user->id;
70 $hookmanager->initHooks(array(
'salarieslist'));
73 $extrafields->fetch_name_optionals_label($object->table_element);
75 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
78 $sortfield =
"s.datep,s.rowid";
81 $sortorder =
"DESC,DESC";
84 $search_ref =
GETPOST(
'search_ref',
'int');
85 $search_user =
GETPOST(
'search_user',
'alpha');
86 $search_label =
GETPOST(
'search_label',
'alpha');
87 $search_date_start_from =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_start_frommonth',
'int'),
GETPOST(
'search_date_start_fromday',
'int'),
GETPOST(
'search_date_start_fromyear',
'int'));
88 $search_date_start_to =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_start_tomonth',
'int'),
GETPOST(
'search_date_start_today',
'int'),
GETPOST(
'search_date_start_toyear',
'int'));
89 $search_date_end_from =
dol_mktime(0, 0, 0,
GETPOST(
'search_date_end_frommonth',
'int'),
GETPOST(
'search_date_end_fromday',
'int'),
GETPOST(
'search_date_end_fromyear',
'int'));
90 $search_date_end_to =
dol_mktime(23, 59, 59,
GETPOST(
'search_date_end_tomonth',
'int'),
GETPOST(
'search_date_end_today',
'int'),
GETPOST(
'search_date_end_toyear',
'int'));
91 $search_amount =
GETPOST(
'search_amount',
'alpha');
92 $search_account =
GETPOST(
'search_account',
'int');
93 $search_status =
GETPOST(
'search_status',
'int');
94 $search_type_id =
GETPOST(
'search_type_id',
'int');
96 $filtre =
GETPOST(
"filtre",
'restricthtml');
98 $childids = $user->getAllChildIds(1);
101 $search_all =
GETPOST(
"search_all",
'alpha');
103 foreach ($object->fields as $key => $val) {
104 if (
GETPOST(
'search_'.$key,
'alpha') !==
'') {
105 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
107 if (preg_match(
'/^(date|timestamp|datetime)/', $val[
'type'])) {
108 $search[$key.
'_dtstart'] =
dol_mktime(0, 0, 0,
GETPOST(
'search_'.$key.
'_dtstartmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtstartday',
'int'),
GETPOST(
'search_'.$key.
'_dtstartyear',
'int'));
109 $search[$key.
'_dtend'] =
dol_mktime(23, 59, 59,
GETPOST(
'search_'.$key.
'_dtendmonth',
'int'),
GETPOST(
'search_'.$key.
'_dtendday',
'int'),
GETPOST(
'search_'.$key.
'_dtendyear',
'int'));
114 $fieldstosearchall = array();
115 foreach ($object->fields as $key => $val) {
116 if (!empty($val[
'searchall'])) {
117 $fieldstosearchall[
't.'.$key] = $val[
'label'];
122 $arrayfields = array();
123 foreach ($object->fields as $key => $val) {
125 if (!empty($val[
'visible'])) {
126 $visible = (int)
dol_eval($val[
'visible'], 1, 1,
'1');
127 $arrayfields[
't.'.$key] = array(
128 'label'=>$val[
'label'],
129 'checked'=>(($visible < 0) ? 0 : 1),
130 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
131 'position'=>$val[
'position'],
132 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
137 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
142 $permissiontoread = $user->rights->salaries->read;
143 $permissiontoadd = $user->rights->salaries->write;
144 $permissiontodelete = $user->rights->salaries->delete;
147 $socid =
GETPOST(
"socid",
"int");
149 $socid = $user->socid;
158 if (
GETPOST(
'cancel',
'alpha')) {
162 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
166 $parameters = array();
167 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
172 if (empty($reshook)) {
174 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
177 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
181 $search_date_start_from =
'';
182 $search_date_start_to =
'';
183 $search_date_end_from =
'';
184 $search_date_end_to =
'';
185 $search_date_end =
'';
187 $search_account =
'';
189 $search_type_id =
"";
191 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
192 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
197 $objectclass =
'PaymentSalary';
198 $objectlabel =
'SalariesPayments';
199 $uploaddir = $conf->salaries->dir_output;
200 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
203 if (!$error && $massaction ==
'buildsepa' && $permissiontoadd) {
204 $objecttmp =
new $objectclass($db);
215 $salstatic =
new Salary($db);
216 $userstatic =
new User($db);
217 $accountstatic =
new Account($db);
223 $title = $langs->trans(
'Salaries');
225 $sql =
"SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,";
226 $sql .=
" s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, s.fk_typepayment as paymenttype, ";
227 $sql .=
" ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
228 $sql .=
" pst.code as payment_code,";
229 $sql .=
" SUM(ps.amount) as alreadypayed";
230 $sql .=
" FROM ".MAIN_DB_PREFIX.
"salary as s";
231 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"payment_salary as ps ON (ps.fk_salary = s.rowid) ";
232 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as pst ON (s.fk_typepayment = pst.id) ";
233 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank_account ba ON (ba.rowid = s.fk_account), ";
235 $sql .=
" ".MAIN_DB_PREFIX.
"user as u";
236 $sql .=
" WHERE u.rowid = s.fk_user";
237 $sql .=
" AND s.entity IN (".getEntity(
'payment_salaries').
")";
238 if (empty($user->rights->salaries->readall)) {
239 $sql .=
" AND s.fk_user IN (".$db->sanitize(join(
',', $childids)).
")";
244 $sql .=
" AND s.rowid=".((int) $search_ref);
247 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname',
'u.email'), $search_user);
252 if (!empty($search_date_start_from)) {
253 $sql .=
" AND s.datesp >= '".$db->idate($search_date_start_from).
"'";
255 if (!empty($search_date_end_from)) {
256 $sql .=
" AND s.dateep >= '".$db->idate($search_date_end_from).
"'";
258 if (!empty($search_date_start_to)) {
259 $sql .=
" AND s.datesp <= '".$db->idate($search_date_start_to).
"'";
261 if (!empty($search_date_end_to)) {
262 $sql .=
" AND s.dateep <= '".$db->idate($search_date_end_to).
"'";
265 if ($search_amount) {
268 if ($search_account > 0) {
269 $sql .=
" AND s.fk_account=".((int) $search_account);
271 if ($search_status !=
'' && $search_status >= 0) {
272 $sql .=
" AND s.paye = ".((int) $search_status);
274 if ($search_type_id) {
275 $sql .=
" AND s.fk_typepayment=".((int) $search_type_id);
277 $sql .=
" GROUP BY u.rowid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary, u.fk_soc, u.statut,";
278 $sql .=
" s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, s.fk_typepayment, s.fk_bank,";
279 $sql .=
" ba.rowid, ba.ref, ba.number, ba.account_number, ba.fk_accountancy_journal, ba.label, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos,";
281 $sql .= $db->order($sortfield, $sortorder);
285 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
286 $resql = $db->query($sql);
298 $sql .= $db->plimit($limit + 1, $offset);
301 $resql = $db->query($sql);
307 $num = $db->num_rows(
$resql);
315 $arrayofselected = is_array($toselect) ? $toselect : array();
318 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
319 $param .=
'&contextpage='.urlencode($contextpage);
321 if ($limit > 0 && $limit != $conf->liste_limit) {
322 $param .=
'&limit='.urlencode($limit);
324 if ($search_type_id) {
325 $param .=
'&search_type_id='.urlencode($search_type_id);
327 if ($optioncss !=
'') {
328 $param .=
'&optioncss='.urlencode($optioncss);
331 $param .=
'&search_ref='.urlencode($search_ref);
333 if ($search_user > 0) {
334 $param .=
'&search_user='.urlencode($search_user);
337 $param .=
'&search_label='.urlencode($search_label);
339 if ($search_account) {
340 $param .=
'&search_account='.urlencode($search_account);
342 if ($search_status !=
'' && $search_status !=
'-1') {
343 $param .=
'&search_status='.urlencode($search_status);
345 if (!empty($search_date_start_from)) {
346 $param .=
'&search_date_start_fromday='.urlencode(
GETPOST(
'search_date_start_fromday')).
'&search_date_start_frommonth='.urlencode(
GETPOST(
'search_date_start_frommonth')).
'&search_date_start_fromyear='.urlencode(
GETPOST(
'search_date_start_fromyear'));
348 if (!empty($search_date_start_to)) {
349 $param .=
"&search_date_start_today=".urlencode(
GETPOST(
'search_date_start_today')).
"&search_date_start_tomonth=".urlencode(
GETPOST(
'search_date_start_tomonth')).
"&search_date_start_toyear=".urlencode(
GETPOST(
'search_date_start_toyear'));
351 if (!empty($search_date_end_from)) {
352 $param .=
'&search_date_end_fromday='.urlencode(
GETPOST(
'search_date_end_fromday')).
'&search_date_end_frommonth='.urlencode(
GETPOST(
'search_date_end_frommonth')).
'&search_date_end_fromyear='.urlencode(
GETPOST(
'search_date_end_fromyear'));
354 if (!empty($search_date_end_to)) {
355 $param .=
"&search_date_end_today=".urlencode(
GETPOST(
'search_date_end_today')).
"&search_date_end_tomonth=".urlencode(
GETPOST(
'search_date_end_tomonth')).
"&search_date_end_toyear=".urlencode(
GETPOST(
'search_date_end_toyear'));
359 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
362 $arrayofmassactions = array(
367 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
368 $arrayofmassactions = array();
370 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
372 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
373 if ($optioncss !=
'') {
374 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
376 print
'<input type="hidden" name="token" value="'.newToken().
'">';
377 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
378 print
'<input type="hidden" name="action" value="list">';
379 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
380 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
381 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
383 $url = DOL_URL_ROOT.
'/salaries/card.php?action=create';
384 if (!empty($socid)) {
385 $url .=
'&socid='.$socid;
387 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSalaryPayment'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->salaries->write);
389 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'salary', 0, $newcardbutton,
'', $limit, 0, 0, 1);
391 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
393 $selectedfields =
'';
394 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
398 print
'<div class="div-table-responsive">';
399 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
403 print
'<tr class="liste_titre_filter">';
405 print
'<td class="liste_titre left">';
406 print
'<input class="flat width50" type="text" name="search_ref" value="'.$db->escape($search_ref).
'">';
409 print
'<td class="liste_titre"><input type="text" class="flat width100" name="search_label" value="'.$db->escape($search_label).
'"></td>';
412 print
'<td class="liste_titre center">';
413 print
'<div class="nowrap">';
414 print
$form->selectDate($search_date_start_from ? $search_date_start_from : -1,
'search_date_start_from', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
416 print
'<div class="nowrap">';
417 print
$form->selectDate($search_date_start_to ? $search_date_start_to : -1,
'search_date_start_to', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
422 print
'<td class="liste_titre center">';
423 print
'<div class="nowrap">';
424 print
$form->selectDate($search_date_end_from ? $search_date_end_from : -1,
'search_date_end_from', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
426 print
'<div class="nowrap">';
427 print
$form->selectDate($search_date_end_to ? $search_date_end_to : -1,
'search_date_end_to', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
432 print
'<td class="liste_titre">';
433 print
'<input class="flat" type="text" size="6" name="search_user" value="'.$db->escape($search_user).
'">';
437 print
'<td class="liste_titre left">';
438 print
$form->select_types_paiements($search_type_id,
'search_type_id',
'', 0, 1, 1, 16, 1,
'maxwidth125', 1);
443 print
'<td class="liste_titre">';
444 print
$form->select_comptes($search_account,
'search_account', 0,
'', 1,
'', 0,
'maxwidth125', 1);
449 print
'<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).
'"></td>';
452 print
'<td class="liste_titre maxwidthonsmartphone right">';
453 $liststatus = array(
'0' => $langs->trans(
"Unpaid"),
'1' => $langs->trans(
"Paid"));
454 print
$form->selectarray(
'search_status', $liststatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage');
458 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
461 $parameters = array(
'arrayfields'=>$arrayfields);
462 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
463 print $hookmanager->resPrint;
465 print
'<td class="liste_titre maxwidthsearch">';
466 $searchpicto =
$form->showFilterButtons();
474 print
'<tr class="liste_titre">';
476 print_liste_field_titre(
"Label", $_SERVER[
"PHP_SELF"],
"s.label",
"", $param,
'class="left"', $sortfield, $sortorder);
477 print_liste_field_titre(
"DateStart", $_SERVER[
"PHP_SELF"],
"s.datesp,s.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
478 print_liste_field_titre(
"DateEnd", $_SERVER[
"PHP_SELF"],
"s.dateep,s.rowid",
"", $param,
'align="center"', $sortfield, $sortorder);
479 print_liste_field_titre(
"Employee", $_SERVER[
"PHP_SELF"],
"u.lastname",
"", $param,
"", $sortfield, $sortorder);
480 print_liste_field_titre(
"DefaultPaymentMode", $_SERVER[
"PHP_SELF"],
"type",
"", $param,
'class="left"', $sortfield, $sortorder);
482 print_liste_field_titre(
"DefaultBankAccount", $_SERVER[
"PHP_SELF"],
"ba.label",
"", $param,
"", $sortfield, $sortorder);
484 print_liste_field_titre(
"Amount", $_SERVER[
"PHP_SELF"],
"s.amount",
"", $param,
'class="right"', $sortfield, $sortorder);
485 print_liste_field_titre(
'Status', $_SERVER[
"PHP_SELF"],
"s.paye",
'', $param,
'class="right"', $sortfield, $sortorder);
487 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
489 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
490 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
491 print $hookmanager->resPrint;
493 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
498 $needToFetchEachLine = 0;
499 if (isset($extrafields->attributes[$object->table_element][
'computed']) && is_array($extrafields->attributes[$object->table_element][
'computed']) && count($extrafields->attributes[$object->table_element][
'computed']) > 0) {
500 foreach ($extrafields->attributes[$object->table_element][
'computed'] as $key => $val) {
501 if (preg_match(
'/\$object/', $val)) {
502 $needToFetchEachLine++;
511 $totalarray = array();
512 $totalarray[
'nbfield'] = 0;
513 $totalarray[
'val'] = array();
514 $totalarray[
'val'][
'totalttcfield'] = 0;
515 while ($i < ($limit ? min($num, $limit) : $num)) {
516 $obj = $db->fetch_object(
$resql);
522 $object->setVarsFromFetchObj($obj);
524 $userstatic->id = $obj->uid;
525 $userstatic->lastname = $obj->lastname;
526 $userstatic->firstname = $obj->firstname;
527 $userstatic->admin = $obj->admin;
528 $userstatic->login = $obj->login;
529 $userstatic->email = $obj->email;
530 $userstatic->socid = $obj->fk_soc;
531 $userstatic->statut = $obj->status;
533 $salstatic->id = $obj->rowid;
534 $salstatic->ref = $obj->rowid;
535 $salstatic->label = $obj->label;
536 $salstatic->paye = $obj->paye;
537 $salstatic->datesp = $db->jdate($obj->datesp);
538 $salstatic->dateep = $db->jdate($obj->dateep);
541 print
'<tr class="oddeven">';
544 print
"<td>".$salstatic->getNomUrl(1).
"</td>\n";
546 $totalarray[
'nbfield']++;
550 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->label).
'">'.
dol_escape_htmltag($obj->label).
"</td>\n";
552 $totalarray[
'nbfield']++;
556 print
'<td class="center">'.dol_print_date($db->jdate($obj->datesp),
'day').
"</td>\n";
558 $totalarray[
'nbfield']++;
562 print
'<td class="center">'.dol_print_date($db->jdate($obj->dateep),
'day').
"</td>\n";
564 $totalarray[
'nbfield']++;
568 print
'<td class="tdoverflowmax150">'.$userstatic->getNomUrl(1).
"</td>\n";
570 $totalarray[
'nbfield']++;
575 if (!empty($obj->payment_code)) print $langs->trans(
"PaymentTypeShort".$obj->payment_code);
578 $totalarray[
'nbfield']++;
584 if ($obj->fk_account > 0) {
586 $accountstatic->id = $obj->bid;
587 $accountstatic->ref = $obj->bref;
588 $accountstatic->label = $obj->blabel;
589 $accountstatic->number = $obj->bnumber;
590 $accountstatic->iban = $obj->iban;
591 $accountstatic->bic = $obj->bic;
592 $accountstatic->currency_code = $langs->trans(
"Currency".$obj->currency_code);
593 $accountstatic->account_number = $obj->account_number;
594 $accountstatic->clos = $obj->clos;
597 $accountstatic->account_number = $obj->account_number;
600 $accountingjournal->fetch($obj->fk_accountancy_journal);
602 $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
605 print $accountstatic->getNomUrl(1);
611 $totalarray[
'nbfield']++;
618 print
'<td class="nowrap right"><span class="amount">'.price($obj->amount).
'</span></td>';
620 $totalarray[
'nbfield']++;
623 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'totalttcfield';
625 $totalarray[
'val'][
'totalttcfield'] += $obj->amount;
627 print
'<td class="nowrap right">'.$salstatic->LibStatut($obj->paye, 5, $obj->alreadypayed).
'</td>';
628 if (!$i) $totalarray[
'nbfield']++;
631 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
633 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
634 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object);
635 print $hookmanager->resPrint;
637 print
'<td class="nowrap center">';
638 if ($massactionbutton || $massaction) {
640 if (in_array($object->id, $arrayofselected)) {
643 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
647 $totalarray[
'nbfield']++;
656 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
669 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
675 $parameters = array(
'arrayfields'=>$arrayfields,
'sql'=>$sql);
676 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object);
677 print $hookmanager->resPrint;
679 print
'</table>'.
"\n";
682 print
'</form>'.
"\n";
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.
Class to manage bank accounts.
Class to manage accounting accounts.
Class to manage payments of salaries.
Class to manage salary payments.
Class to manage Dolibarr users.
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.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
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.
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...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.