27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
34 $langs->loadLangs(array(
'accountancy',
'admin',
'bills',
'compta',
'salaries'));
37 $action =
GETPOST(
'action',
'aZ09');
38 $cancel =
GETPOST(
'cancel',
'alpha');
40 $rowid =
GETPOST(
'rowid',
'int');
41 $massaction =
GETPOST(
'massaction',
'aZ09');
42 $optioncss =
GETPOST(
'optioncss',
'alpha');
43 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'accountingaccountlist';
45 $search_account =
GETPOST(
'search_account',
'alpha');
46 $search_label =
GETPOST(
'search_label',
'alpha');
47 $search_labelshort =
GETPOST(
'search_labelshort',
'alpha');
48 $search_accountparent =
GETPOST(
'search_accountparent',
'alpha');
49 $search_pcgtype =
GETPOST(
'search_pcgtype',
'alpha');
50 $search_import_key =
GETPOST(
'search_import_key',
'alpha');
51 $toselect =
GETPOST(
'toselect',
'array');
52 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
53 $confirm =
GETPOST(
'confirm',
'alpha');
55 $chartofaccounts =
GETPOST(
'chartofaccounts',
'int');
57 $permissiontoadd = $user->hasRight(
'accounting',
'chartofaccount');
58 $permissiontodelete = $user->hasRight(
'accounting',
'chartofaccount');
61 if ($user->socid > 0) {
64 if (!$user->hasRight(
'accounting',
'chartofaccount')) {
69 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
70 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
71 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
73 if (empty($page) || $page == -1) {
76 $offset = $limit * $page;
77 $pageprev = $page - 1;
78 $pagenext = $page + 1;
80 $sortfield =
"aa.account_number";
87 'aa.account_number'=>array(
'label'=>
"AccountNumber",
'checked'=>1),
88 'aa.label'=>array(
'label'=>
"Label",
'checked'=>1),
89 'aa.labelshort'=>array(
'label'=>
"LabelToShow",
'checked'=>1),
90 'aa.account_parent'=>array(
'label'=>
"Accountparent",
'checked'=>1),
91 'aa.pcg_type'=>array(
'label'=>
"Pcgtype",
'checked'=>1,
'help'=>
'PcgtypeDesc'),
92 'categories'=>array(
'label'=>
"AccountingCategories",
'checked'=>-1,
'help'=>
'AccountingCategoriesDesc'),
93 'aa.reconcilable'=>array(
'label'=>
"Reconcilable",
'checked'=>1),
94 'aa.active'=>array(
'label'=>
"Activated",
'checked'=>1),
95 'aa.import_key'=>array(
'label'=>
"ImportId",
'checked'=>-1)
98 if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
99 unset($arrayfields[
'categories']);
100 unset($arrayfields[
'aa.reconcilable']);
106 $hookmanager->initHooks(array(
'accountancyadminaccount'));
113 if (
GETPOST(
'cancel',
'alpha')) {
114 $action =
'list'; $massaction =
'';
116 if (!
GETPOST(
'confirmmassaction',
'alpha')) {
120 $parameters = array(
'chartofaccounts' => $chartofaccounts,
'permissiontoadd' => $permissiontoadd,
'permissiontodelete' => $permissiontodelete);
121 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $accounting, $action);
126 if (empty($reshook)) {
127 if (!empty($cancel)) {
131 $objectclass =
'AccountingAccount';
132 $uploaddir = $conf->accounting->multidir_output[$conf->entity];
133 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
135 if ($action ==
"delete") {
138 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
140 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
141 $search_account =
"";
143 $search_labelshort =
"";
144 $search_accountparent =
"";
145 $search_pcgtype =
"";
146 $search_array_options = array();
148 if ((
GETPOST(
'valid_change_chart',
'alpha') &&
GETPOST(
'chartofaccounts',
'int') > 0)
149 || (
GETPOST(
'chartofaccounts',
'int') > 0 &&
GETPOST(
'chartofaccounts',
'int') != $conf->global->CHARTOFACCOUNTS)) {
150 if ($chartofaccounts > 0 && $permissiontoadd) {
152 $sql =
'SELECT code FROM '.MAIN_DB_PREFIX.
'c_country as c, '.MAIN_DB_PREFIX.
'accounting_system as a';
153 $sql .=
' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
154 $resql = $db->query($sql);
156 $obj = $db->fetch_object(
$resql);
157 $country_code = $obj->code;
164 $sqlfile = DOL_DOCUMENT_ROOT.
'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).
'.sql';
166 $offsetforchartofaccount = 0;
170 $tmp = file_get_contents($sqlfile);
172 if (preg_match(
'/-- ADD (\d+) to rowid/ims', $tmp, $reg)) {
173 $offsetforchartofaccount += $reg[1];
175 $offsetforchartofaccount += ($conf->entity * 100000000);
177 $result =
run_sql($sqlfile, 1, $conf->entity, 1,
'',
'default', 32768, 0, $offsetforchartofaccount);
186 if (!
dolibarr_set_const($db,
'CHARTOFACCOUNTS', $chartofaccounts,
'chaine', 0,
'', $conf->entity)) {
194 if ($action ==
'disable' && $permissiontoadd) {
195 if ($accounting->fetch($id)) {
196 $mode =
GETPOST(
'mode',
'int');
197 $result = $accounting->accountDeactivate($id, $mode);
204 } elseif ($action ==
'enable' && $permissiontoadd) {
205 if ($accounting->fetch($id)) {
206 $mode =
GETPOST(
'mode',
'int');
207 $result = $accounting->accountActivate($id, $mode);
224 llxHeader(
'', $langs->trans(
"ListAccounts"));
226 if ($action ==
'delete') {
227 $formconfirm = $html->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$id, $langs->trans(
'DeleteAccount'), $langs->trans(
'ConfirmDeleteAccount'),
'confirm_delete',
'', 0, 1);
231 $pcgver = $conf->global->CHARTOFACCOUNTS;
233 $sql =
"SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent, aa.label, aa.labelshort, aa.fk_accounting_category,";
234 $sql .=
" aa.reconcilable, aa.active, aa.import_key,";
235 $sql .=
" a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
236 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_account as aa";
237 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".((int) $conf->entity);
238 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".((int) $conf->entity);
239 $sql .=
" WHERE asy.rowid = ".((int) $pcgver);
241 if (strlen(trim($search_account))) {
242 $lengthpaddingaccount = 0;
243 if ($conf->global->ACCOUNTING_LENGTH_GACCOUNT || $conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
244 $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_GACCOUNT, $conf->global->ACCOUNTING_LENGTH_AACCOUNT);
246 $search_account_tmp = $search_account;
247 $weremovedsomezero = 0;
248 if (strlen($search_account_tmp) <= $lengthpaddingaccount) {
249 for ($i = 0; $i < $lengthpaddingaccount; $i++) {
250 if (preg_match(
'/0$/', $search_account_tmp)) {
251 $weremovedsomezero++;
252 $search_account_tmp = preg_replace(
'/0$/',
'', $search_account_tmp);
258 if ($search_account_tmp) {
259 if ($weremovedsomezero) {
260 $search_account_tmp_clean = $search_account_tmp;
261 $search_account_clean = $search_account;
263 if (strpos($search_account_tmp,
'^') === 0) {
265 $search_account_tmp_clean = preg_replace(
'/^\^/',
'', $search_account_tmp);
266 $search_account_clean = preg_replace(
'/^\^/',
'', $search_account);
268 $sql .=
" AND (aa.account_number LIKE '".$db->escape($startchar.$search_account_tmp_clean).
"'";
269 $sql .=
" OR aa.account_number LIKE '".$db->escape($startchar.$search_account_clean).
"%')";
275 if (strlen(trim($search_label))) {
278 if (strlen(trim($search_labelshort))) {
281 if (strlen(trim($search_accountparent)) && $search_accountparent !=
'-1') {
282 $sql .=
natural_search(
"aa.account_parent", $search_accountparent, 2);
284 if (strlen(trim($search_pcgtype))) {
287 $sql .= $db->order($sortfield, $sortorder);
292 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
293 $resql = $db->query($sql);
302 if ($user->hasRight(
'accounting',
'chartofaccount')) {
303 $arrayofmassactions[
'predelete'] =
'<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans(
"Delete");
305 if (in_array($massaction, array(
'presend',
'predelete',
'closed'))) {
306 $arrayofmassactions = array();
309 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
310 $arrayofselected = is_array($toselect) ? $toselect : array();
311 $sql .= $db->plimit($limit + 1, $offset);
313 dol_syslog(
'accountancy/admin/account.php:: $sql='.$sql);
314 $resql = $db->query($sql);
317 $num = $db->num_rows(
$resql);
320 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
321 $param .=
'&contextpage='.urlencode($contextpage);
323 if ($limit > 0 && $limit != $conf->liste_limit) {
324 $param .=
'&limit='.urlencode($limit);
326 if ($search_account) {
327 $param .=
'&search_account='.urlencode($search_account);
330 $param .=
'&search_label='.urlencode($search_label);
332 if ($search_labelshort) {
333 $param .=
'&search_labelshort='.urlencode($search_labelshort);
335 if ($search_accountparent > 0 || $search_accountparent ==
'0') {
336 $param .=
'&search_accountparent='.urlencode($search_accountparent);
338 if ($search_pcgtype) {
339 $param .=
'&search_pcgtype='.urlencode($search_pcgtype);
341 if ($optioncss !=
'') {
342 $param .=
'&search_import_key='.urlencode($search_import_key);
344 if ($optioncss !=
'') {
345 $param .=
'&optioncss='.urlencode($optioncss);
348 if (!empty($conf->use_javascript_ajax)) {
349 print
'<!-- Add javascript to reload page when we click "Change plan" -->
350 <script type="text/javascript">
351 $(document).ready(function () {
352 $("#change_chart").on("click", function (e) {
353 console.log("chartofaccounts seleted = "+$("#chartofaccounts").val());
355 window.location.href = "'.$_SERVER[
"PHP_SELF"].
'?valid_change_chart=1&chartofaccounts="+$("#chartofaccounts").val();
363 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
364 if ($optioncss !=
'') {
365 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
367 print
'<input type="hidden" name="token" value="'.newToken().
'">';
368 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
369 print
'<input type="hidden" name="action" value="list">';
370 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
371 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
372 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
374 $newcardbutton .=
dolGetButtonTitle($langs->trans(
"New"), $langs->trans(
"Addanaccount"),
'fa fa-plus-circle',
'./card.php?action=create');
375 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
376 print_barre_liste($langs->trans(
'ListAccounts'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'accounting_account', 0, $newcardbutton,
'', $limit, 0, 0, 1);
379 print $langs->trans(
"Selectchartofaccounts").
" : ";
380 print
'<select class="flat minwidth200" name="chartofaccounts" id="chartofaccounts">';
381 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code";
382 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
383 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON a.fk_country = c.rowid AND c.active = 1";
384 $sql .=
" WHERE a.active = 1";
385 dol_syslog(
'accountancy/admin/account.php $sql='.$sql);
387 $resqlchart = $db->query($sql);
389 $numbis = $db->num_rows($resqlchart);
391 print
'<option value="-1"> </option>';
392 while ($i < $numbis) {
393 $obj = $db->fetch_object($resqlchart);
395 print
'<option value="'.$obj->rowid.
'"';
396 print ($pcgver == $obj->rowid) ?
' selected' :
'';
397 print
'>'.$obj->pcg_version.
' - '.$obj->label.
' - ('.$obj->country_code.
')</option>';
406 print
'<input type="'.(empty($conf->use_javascript_ajax) ?
'submit' :
'button').
'" class="button button-edit small" name="change_chart" id="change_chart" value="'.
dol_escape_htmltag($langs->trans(
"ChangeAndLoad")).
'">';
410 $parameters = array(
'chartofaccounts' => $chartofaccounts,
'permissiontoadd' => $permissiontoadd,
'permissiontodelete' => $permissiontodelete);
411 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $accounting, $action);
412 print $hookmanager->resPrint;
416 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
417 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
418 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
424 $totalarray = array();
425 $totalarray[
'nbfield'] = 0;
427 print
'<div class="div-table-responsive">';
428 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
431 print
'<tr class="liste_titre_filter">';
432 if (!empty($arrayfields[
'aa.account_number'][
'checked'])) {
433 print
'<td class="liste_titre"><input type="text" class="flat width100" name="search_account" value="'.$search_account.
'"></td>';
435 if (!empty($arrayfields[
'aa.label'][
'checked'])) {
436 print
'<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$search_label.
'"></td>';
438 if (!empty($arrayfields[
'aa.labelshort'][
'checked'])) {
439 print
'<td class="liste_titre"><input type="text" class="flat width100" name="search_labelshort" value="'.$search_labelshort.
'"></td>';
441 if (!empty($arrayfields[
'aa.account_parent'][
'checked'])) {
442 print
'<td class="liste_titre">';
443 print $formaccounting->select_account($search_accountparent,
'search_accountparent', 2, array(), 0, 0,
'maxwidth150');
447 if (!empty($arrayfields[
'aa.pcg_type'][
'checked'])) {
448 print
'<td class="liste_titre"><input type="text" class="flat width75" name="search_pcgtype" value="'.$search_pcgtype.
'"></td>';
451 if (!empty($arrayfields[
'categories'][
'checked'])) {
452 print
'<td class="liste_titre"></td>';
455 if (!empty($arrayfields[
'aa.import_key'][
'checked'])) {
456 print
'<td class="liste_titre"><input type="text" class="flat width75" name="search_import_key" value="'.$search_import_key.
'"></td>';
458 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
459 if (!empty($arrayfields[
'aa.reconcilable'][
'checked'])) {
460 print
'<td class="liste_titre"> </td>';
463 if (!empty($arrayfields[
'aa.active'][
'checked'])) {
464 print
'<td class="liste_titre"> </td>';
466 print
'<td class="liste_titre maxwidthsearch">';
467 $searchpicto =
$form->showFilterButtons();
471 print
'<tr class="liste_titre">';
472 if (!empty($arrayfields[
'aa.account_number'][
'checked'])) {
473 print_liste_field_titre($arrayfields[
'aa.account_number'][
'label'], $_SERVER[
"PHP_SELF"],
"aa.account_number",
"", $param,
'', $sortfield, $sortorder);
475 if (!empty($arrayfields[
'aa.label'][
'checked'])) {
476 print_liste_field_titre($arrayfields[
'aa.label'][
'label'], $_SERVER[
"PHP_SELF"],
"aa.label",
"", $param,
'', $sortfield, $sortorder);
478 if (!empty($arrayfields[
'aa.labelshort'][
'checked'])) {
479 print_liste_field_titre($arrayfields[
'aa.labelshort'][
'label'], $_SERVER[
"PHP_SELF"],
"aa.labelshort",
"", $param,
'', $sortfield, $sortorder);
481 if (!empty($arrayfields[
'aa.account_parent'][
'checked'])) {
482 print_liste_field_titre($arrayfields[
'aa.account_parent'][
'label'], $_SERVER[
"PHP_SELF"],
"aa.account_parent",
"", $param,
'', $sortfield, $sortorder,
'left ');
484 if (!empty($arrayfields[
'aa.pcg_type'][
'checked'])) {
485 print_liste_field_titre($arrayfields[
'aa.pcg_type'][
'label'], $_SERVER[
"PHP_SELF"],
'aa.pcg_type,aa.account_number',
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'aa.pcg_type'][
'help'], 1);
487 if (!empty($arrayfields[
'categories'][
'checked'])) {
488 print_liste_field_titre($arrayfields[
'categories'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'categories'][
'help'], 1);
490 if (!empty($arrayfields[
'aa.import_key'][
'checked'])) {
491 print_liste_field_titre($arrayfields[
'aa.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
'aa.import_key',
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'aa.import_key'][
'help'], 1);
493 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
494 if (!empty($arrayfields[
'aa.reconcilable'][
'checked'])) {
495 print_liste_field_titre($arrayfields[
'aa.reconcilable'][
'label'], $_SERVER[
"PHP_SELF"],
'aa.reconcilable',
'', $param,
'', $sortfield, $sortorder);
498 if (!empty($arrayfields[
'aa.active'][
'checked'])) {
499 print_liste_field_titre($arrayfields[
'aa.active'][
'label'], $_SERVER[
"PHP_SELF"],
'aa.active',
'', $param,
'', $sortfield, $sortorder);
501 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
505 while ($i < min($num, $limit)) {
506 $obj = $db->fetch_object(
$resql);
508 $accountstatic->id = $obj->rowid;
509 $accountstatic->label = $obj->label;
510 $accountstatic->account_number = $obj->account_number;
512 print
'<tr class="oddeven">';
515 if (!empty($arrayfields[
'aa.account_number'][
'checked'])) {
517 print $accountstatic->getNomUrl(1, 0, 0,
'', 0, 1, 0,
'accountcard');
520 $totalarray[
'nbfield']++;
525 if (!empty($arrayfields[
'aa.label'][
'checked'])) {
530 $totalarray[
'nbfield']++;
535 if (!empty($arrayfields[
'aa.labelshort'][
'checked'])) {
540 $totalarray[
'nbfield']++;
545 if (!empty($arrayfields[
'aa.account_parent'][
'checked'])) {
548 if (!empty($obj->account_parent) && !empty($obj->rowid2)) {
550 print
'<!-- obj->account_parent = '.$obj->account_parent.
' obj->rowid2 = '.$obj->rowid2.
' -->';
551 $accountparent->id = $obj->rowid2;
552 $accountparent->label = $obj->label2;
553 $accountparent->account_number = $obj->account_number2;
554 print $accountparent->getNomUrl(1);
557 $totalarray[
'nbfield']++;
561 if (!empty($obj->account_parent)) {
562 print
'<!-- Bad value for obj->account_parent = '.$obj->account_parent.
': is a rowid that does not exists -->';
566 $totalarray[
'nbfield']++;
572 if (!empty($arrayfields[
'aa.pcg_type'][
'checked'])) {
577 $totalarray[
'nbfield']++;
581 if (!empty($arrayfields[
'categories'][
'checked'])) {
587 $totalarray[
'nbfield']++;
592 if (!empty($arrayfields[
'aa.import_key'][
'checked'])) {
597 $totalarray[
'nbfield']++;
601 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
603 if (!empty($arrayfields[
'aa.reconcilable'][
'checked'])) {
604 print
'<td class="center">';
605 if (empty($obj->reconcilable)) {
606 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=enable&mode=1&token='.
newToken().
'">';
607 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
610 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=disable&mode=1&token='.
newToken().
'">';
611 print
img_picto($langs->trans(
"Activated"),
'switch_on');
616 $totalarray[
'nbfield']++;
622 if (!empty($arrayfields[
'aa.active'][
'checked'])) {
623 print
'<td class="center">';
624 if (empty($obj->active)) {
625 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=enable&mode=0&token='.
newToken().
'">';
626 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
629 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=disable&mode=0&token='.
newToken().
'">';
630 print
img_picto($langs->trans(
"Activated"),
'switch_on');
635 $totalarray[
'nbfield']++;
640 print
'<td class="center nowraponall">';
641 if ($user->hasRight(
'accounting',
'chartofaccount')) {
642 print
'<a class="editfielda" href="./card.php?action=update&token='.newToken().
'&id='.$obj->rowid.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?'.$param).
'">';
646 print
'<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().
'&id='.$obj->rowid.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?'.$param).
'">';
650 if ($massactionbutton || $massaction) {
652 if (in_array($obj->rowid, $arrayofselected)) {
655 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
660 $totalarray[
'nbfield']++;
669 foreach ($arrayfields as $key => $val) {
670 if (!empty($val[
'checked'])) {
674 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0, $colspan=0, $onlysqltoimportwebsite=0)
Launch a sql file.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage accounting accounts.
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_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete 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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show 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.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$formconfirm
if ($action == 'delbookkeepingyear') {
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.