36require
'../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
51$langs->loadLangs(array(
"categories",
"compta"));
53$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
54$massaction =
GETPOST(
'massaction',
'alpha');
56$confirm =
GETPOST(
'confirm',
'alpha');
57$cancel =
GETPOST(
'cancel',
'alpha');
58$toselect =
GETPOST(
'toselect',
'array');
59$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'categorylist';
60$backtopage =
GETPOST(
'backtopage',
'alpha');
61$optioncss =
GETPOST(
'optioncss',
'aZ');
64$label =
GETPOST(
'label',
'alpha');
68if (
GETPOST(
'addintocategory')) {
69 $action =
'addintocategory';
75$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
76$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
78if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
81$offset = $limit * $page;
85if ($id ==
"" && $label ==
"") {
91$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
94$result =
$object->fetch($id, $label);
104if (is_numeric($type)) {
105 $type = array_search($type,
$object->MAP_ID);
109$extrafields->fetch_name_optionals_label(
$object->table_element);
115if ($confirm ==
'no') {
117 header(
"Location: ".$backtopage);
121$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
122$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
124if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
127 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
128 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
130 $result = $tmpobject->fetch($removeelem);
131 $elementtype =
'product';
132 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
134 $result = $tmpobject->fetch($removeelem);
135 $elementtype =
'supplier';
136 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
138 $result = $tmpobject->fetch($removeelem);
139 $elementtype =
'customer';
140 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
141 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
143 $result = $tmpobject->fetch($removeelem);
144 $elementtype =
'member';
145 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
146 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
148 $result = $tmpobject->fetch($removeelem);
149 $elementtype =
'contact';
150 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
151 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
153 $result = $tmpobject->fetch($removeelem);
154 $elementtype =
'account';
155 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
156 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
158 $result = $tmpobject->fetch($removeelem);
159 $elementtype =
'project';
160 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
161 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
162 $tmpobject =
new User($db);
163 $result = $tmpobject->fetch($removeelem);
164 $elementtype =
'user';
165 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
166 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
167 $tmpobject =
new Ticket($db);
168 $result = $tmpobject->fetch($removeelem);
169 $elementtype =
'ticket';
170 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
171 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
173 $result = $tmpobject->fetch($removeelem);
174 $elementtype =
'fichinter';
175 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
176 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
178 $result = $tmpobject->fetch($removeelem);
179 $elementtype =
'order';
180 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
181 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
183 $result = $tmpobject->fetch($removeelem);
184 $elementtype =
'invoice';
185 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
186 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
188 $result = $tmpobject->fetch($removeelem);
189 $elementtype =
'supplier_order';
195 if ($tmpobject !==
null) {
197 $result =
$object->del_type($tmpobject, $elementtype);
204if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
205 if (
$object->delete($user) >= 0) {
207 header(
"Location: ".$backtopage);
210 header(
"Location: ".DOL_URL_ROOT.
'/categories/categorie_list.php?type='.$type);
218if ($elemid && $action ==
'addintocategory') {
221 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
222 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
224 $elementtype =
'product';
225 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
226 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
228 $elementtype =
'customer';
229 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
230 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
232 $elementtype =
'supplier';
233 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
234 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
235 $newobject =
new Ticket($db);
236 $elementtype =
'ticket';
237 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
238 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
240 $elementtype =
'fichinter';
241 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
242 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
244 $elementtype =
'project';
245 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
246 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
248 $elementtype =
'member';
249 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
250 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
252 $elementtype =
'contact';
253 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
254 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
255 $newobject =
new User($db);
256 $elementtype =
'user';
257 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
258 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
260 $elementtype =
'bank_account';
261 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
262 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
264 $elementtype =
'order';
265 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
266 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
268 $elementtype =
'invoice';
269 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
270 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
272 $elementtype =
'supplier_order';
273 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
274 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
276 $elementtype =
'supplier_invoice';
280 if ($newobject !==
null) {
281 $result = $newobject->fetch($elemid);
284 if ($result >= 0 && $newobject !==
null) {
286 $result =
$object->add_type($newobject, $elementtype);
289 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
291 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
292 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
304$form =
new Form($db);
308 '/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
309 '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
311$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
315llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
317$title = $langs->trans(
"Categories");
318$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
323$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
324$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
327$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
328$ways =
$object->print_all_ways(
" >> ",
'', 1);
329foreach ($ways as $way) {
330 $morehtmlref .= $way.
"<br>\n";
332$morehtmlref .=
'</div>';
334dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
338if ($action ==
'delete') {
340 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
342 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
348print
'<div class="fichecenter">';
349print
'<div class="underbanner clearboth"></div>';
350print
'<table class="border centpercent tableforfield">';
353print
'<tr><td class="titlefield notopnoleft tdtop">';
354print $langs->trans(
"Description").
'</td><td>';
359print
'<tr><td class="notopnoleft">';
360print $langs->trans(
"Color").
'</td><td>';
361print $formother->showColor(
$object->color);
365print
'<tr><td class="titlefield notopnoleft">';
366print $langs->trans(
"Position").
'</td><td>';
371include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
383print
"<div class='tabsAction'>\n";
384$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
388if (empty($reshook)) {
389 if ($user->hasRight(
'categorie',
'creer')) {
390 $socid = (
$object->socid ?
"&socid=".$object->socid :
"");
391 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.urlencode($type).
'">'.$langs->trans(
"Modify").
'</a>';
394 if ($user->hasRight(
'categorie',
'supprimer')) {
395 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'&type='.urlencode($type).
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
402if ($user->hasRight(
'categorie',
'creer')) {
403 $link = DOL_URL_ROOT.
'/categories/card.php';
404 $link .=
'?action=create';
405 $link .=
'&type='.urlencode($type);
406 $link .=
'&catorigin='.((int)
$object->id);
407 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
409 $newcardbutton =
'<div class="right">';
410 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
411 $newcardbutton .=
'</div>';
419print
'<div class="fichecenter">';
421print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
425print
'<table class="liste nohover noborder centpercent borderbottom">';
427print
'<tr class="liste_titre">';
428print
'<td>'.$langs->trans(
"SubCats").
'</td>';
430print
'<td class="right">';
432if (is_array($cats) && count($cats) > 1 && !empty(
$conf->use_javascript_ajax)) {
433 print
'<div id="iddivjstreecontrol">';
434 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
436 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
443if (is_numeric($cats) && $cats < 0) {
445} elseif (count($cats) < 1) {
446 print
'<tr class="oddeven nobottom nohover">';
447 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
452 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
456 if ($type == Categorie::TYPE_MEMBER) {
457 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
459 if ($type == Categorie::TYPE_ACCOUNT) {
460 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
462 if ($type == Categorie::TYPE_PROJECT) {
463 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
465 if ($type == Categorie::TYPE_USER) {
466 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
472 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
473 foreach ($fulltree as $key => $val) {
474 $categstatic->id = $val[
'id'];
475 $categstatic->ref = $val[
'label'];
476 $categstatic->color = $val[
'color'];
477 $categstatic->type = $type;
483 $elements = $categstatic->getObjectsInCateg($type, 1);
485 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
488 if ($categstatic->color) {
489 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
491 $stylecolor =
' style="background: #bbb;"';
493 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
495 $entry =
'<table class="nobordernopadding centpercent">';
499 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
504 $entry .=
'<td class="right" width="20px;">';
505 $entry .=
'<a href="'.DOL_URL_ROOT.
'/categories/viewcat.php?id='.$val[
'id'].
'&type='.urlencode($type).
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'">'.
img_view().
'</a>';
507 $entry .=
'<td class="right" width="20px;">';
508 $entry .=
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/categories/edit.php?id='.$val[
'id'].
'&type='.urlencode($type).
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'">'.
img_edit().
'</a>';
510 $entry .=
'<td class="right" width="20px;">';
511 $entry .=
'<a class="deletefilelink" href="'.DOL_URL_ROOT.
'/categories/viewcat.php?action=delete&token='.
newToken().
'&id='.$val[
'id'].
'&type='.urlencode($type).
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'">'.
img_delete().
'</a>';
515 $entry .=
'</table>';
517 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
520 $nbofentries = (count($data) - 1);
521 if ($nbofentries > 0) {
522 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
523 print
'<tr class="pair">';
524 print
'<td colspan="3">';
532 print
'<tr class="pair">';
533 print
'<td colspan="3">';
534 print
'<table class="nobordernopadding">';
536 print
'<tr class="nobordernopadding">';
537 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
538 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
539 print
'<td> </td>';
552$arrayofmassactions = array(
558$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
564if ($type == Categorie::TYPE_PRODUCT) {
565 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
566 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
567 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
569 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
574 '@phan-var-force Product[] $prods';
576 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
577 print
'<input type="hidden" name="token" value="'.newToken().
'">';
578 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
579 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
580 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
581 print
'<input type="hidden" name="page_y" value="">';
582 print
'<input type="hidden" name="action" value="list">';
585 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
586 $num = count($prods);
587 $nbtotalofrecords =
'';
588 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddProduct"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/product/card.php?action=create&categories[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
591 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
593 if ($showclassifyform) {
594 print
'<table class="noborder centpercent">';
595 print
'<tr class="liste_titre"><td>';
596 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
597 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
598 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
603 print
'<table class="noborder centpercent">'.
"\n";
604 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
606 if (count($prods) > 0) {
608 foreach ($prods as $prod) {
614 print
'<tr class="oddeven">'.
"\n";
615 print
'<td class="nowrap tdtop">';
616 print $prod->getNomUrl(1);
618 print
'<td class="tdtop">'.dolPrintHTML($prod->label).
"</td>\n";
620 print
'<td class="right">';
622 print
'<a class="reposition" href= "'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".((
int)
$object->id).
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $prod->id).($limit ?
'&limit='.$limit :
'').
'">';
624 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
631 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
635 print
'</form>'.
"\n";
638 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
644if ($type == Categorie::TYPE_CUSTOMER) {
645 if ($user->hasRight(
"societe",
"read")) {
646 $permission = $user->hasRight(
'societe',
'creer');
647 $showclassifyform = $user->hasRight(
'societe',
'creer');
649 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
654 '@phan-var-force Societe[] $socs';
656 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
657 print
'<input type="hidden" name="token" value="'.newToken().
'">';
658 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
659 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
660 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
661 print
'<input type="hidden" name="action" value="list">';
662 print
'<input type="hidden" name="page_y" value="">';
665 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
667 $nbtotalofrecords =
'';
668 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddThirdParty"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/societe/card.php?action=create&customer=3&custcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
671 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
673 if ($showclassifyform) {
674 print
'<table class="noborder centpercent">';
675 print
'<tr class="liste_titre"><td>';
676 print $langs->trans(
"AddCustomerIntoCategory").
' ';
677 $filter =
'(s.client:IN:1,2,3)';
678 print $form->select_company(
'',
'elemid', $filter);
679 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
684 print
'<table class="noborder centpercent">'.
"\n";
685 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
687 if (count($socs) > 0) {
689 foreach ($socs as $key => $soc) {
695 print
"\t".
'<tr class="oddeven">'.
"\n";
696 print
'<td class="nowrap tdtop tdoverflowmax250">';
697 print $soc->getNomUrl(1);
700 print
'<td class="right">';
702 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $soc->id).($limit ?
'&limit='.$limit :
'').
"'>";
704 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
711 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
715 print
'</form>'.
"\n";
718 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
724if ($type == Categorie::TYPE_SUPPLIER) {
725 if ($user->hasRight(
"fournisseur",
"read")) {
726 $permission = $user->hasRight(
'societe',
'creer');
727 $showclassifyform = $user->hasRight(
'societe',
'creer');
729 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
735 '@phan-var-force Fournisseur[] $socs';
737 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
738 print
'<input type="hidden" name="token" value="'.newToken().
'">';
739 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
740 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
741 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
742 print
'<input type="hidden" name="page_y" value="">';
743 print
'<input type="hidden" name="action" value="list">';
746 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
748 $nbtotalofrecords =
'';
749 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddSupplier"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/societe/card.php?action=create&fournisseur=1&suppcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
752 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
754 if ($showclassifyform) {
755 print
'<table class="noborder centpercent">';
756 print
'<tr class="liste_titre"><td>';
757 print $langs->trans(
"AddSupplierIntoCategory").
' ';
758 $filter =
'(s.fournisseur:=:1)';
759 print $form->select_company(
'',
'elemid', $filter);
760 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
765 print
'<table class="noborder centpercent">'.
"\n";
766 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
768 if (count($socs) > 0) {
770 foreach ($socs as $soc) {
776 print
"\t".
'<tr class="oddeven">'.
"\n";
777 print
'<td class="nowrap tdtop">';
778 print $soc->getNomUrl(1);
781 print
'<td class="right">';
783 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $soc->id).($limit ?
'&limit='.$limit :
'').
'">';
785 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
793 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
797 print
'</form>'.
"\n";
800 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
806if ($type == Categorie::TYPE_MEMBER) {
807 if ($user->hasRight(
"adherent",
"read")) {
808 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
810 $permission = $user->hasRight(
'adherent',
'creer');
811 $showclassifyform = $user->hasRight(
'adherent',
'creer');
813 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
818 '@phan-var-force Adherent[] $members';
820 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
821 print
'<input type="hidden" name="token" value="'.newToken().
'">';
822 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
823 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
824 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
825 print
'<input type="hidden" name="page_y" value="">';
826 print
'<input type="hidden" name="action" value="list">';
829 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
830 $num = count($members);
831 $nbtotalofrecords =
'';
832 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddMember"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/adherents/card.php?action=create&memcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'adherent',
'creer'));
835 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
837 if ($showclassifyform) {
838 print
'<table class="noborder centpercent">';
839 print
'<tr class="liste_titre"><td>';
840 print $langs->trans(
"AssignCategoryTo").
' ';
841 print $form->selectMembers(
'',
'elemid');
842 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
847 print
'<table class="noborder centpercent">'.
"\n";
848 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
850 if (count($members) > 0) {
852 foreach ($members as $key => $member) {
858 print
"\t".
'<tr class="oddeven">'.
"\n";
859 print
'<td class="nowrap tdtop">';
860 $member->ref = $member->login;
861 print $member->getNomUrl(1, 0);
863 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
864 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
866 print
'<td class="right">';
868 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $member->id).($limit ?
'&limit='.$limit :
'').
"'>";
870 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
877 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
881 print
'</form>'.
"\n";
884 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
890if ($type == Categorie::TYPE_CONTACT) {
891 if ($user->hasRight(
"societe",
"read")) {
892 $permission = $user->hasRight(
'societe',
'creer');
893 $showclassifyform = $user->hasRight(
'societe',
'creer');
895 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
896 if (is_numeric($contacts) && $contacts < 0) {
900 '@phan-var-force Contact[] $contacts';
902 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
903 print
'<input type="hidden" name="token" value="'.newToken().
'">';
904 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
905 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
906 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
907 print
'<input type="hidden" name="page_y" value="">';
908 print
'<input type="hidden" name="action" value="list">';
911 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
912 $num = count($contacts);
913 $nbtotalofrecords =
'';
914 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddContact"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create&contcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
919 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
921 if ($showclassifyform) {
922 print
'<table class="noborder centpercent">';
923 print
'<tr class="liste_titre"><td>';
924 print $langs->trans(
"AssignCategoryTo").
' ';
925 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
926 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
931 print
'<table class="noborder centpercent">'.
"\n";
932 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
934 if (is_array($contacts) && count($contacts) > 0) {
936 foreach ($contacts as $key => $contact) {
942 print
"\t".
'<tr class="oddeven">'.
"\n";
943 print
'<td class="nowrap tdtop">';
944 print $contact->getNomUrl(1,
'category');
945 if ($contact->socid > 0) {
946 $objsoc->fetch($contact->socid);
948 print $objsoc->getNomUrl(1,
'contact');
952 print
'<td class="right">';
954 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $contact->id).($limit ?
'&limit='.$limit :
'').
"'>";
956 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
963 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
967 print
'</form>'.
"\n";
970 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
976if ($type == Categorie::TYPE_ACCOUNT) {
977 if ($user->hasRight(
"banque",
"read")) {
978 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
980 $permission = $user->hasRight(
'banque',
'creer');
981 $showclassifyform = $user->hasRight(
'banque',
'creer');
983 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
988 '@phan-var-force Account[] $accounts';
990 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
991 print
'<input type="hidden" name="token" value="'.newToken().
'">';
992 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
993 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
994 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
995 print
'<input type="hidden" name="page_y" value="">';
996 print
'<input type="hidden" name="action" value="list">';
999 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1000 $num = count($accounts);
1001 $nbtotalofrecords =
'';
1002 $newcardbutton =
'';
1005 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1007 if ($showclassifyform) {
1008 print
'<table class="noborder centpercent">';
1009 print
'<tr class="liste_titre"><td>';
1010 print $langs->trans(
"AddObjectIntoCategory").
' ';
1011 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1012 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1017 print
'<table class="noborder centpercent">'.
"\n";
1018 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1020 if (count($accounts) > 0) {
1022 foreach ($accounts as $key => $account) {
1028 print
"\t".
'<tr class="oddeven">'.
"\n";
1029 print
'<td class="nowrap tdtop">';
1030 print $account->getNomUrl(1,
'0');
1032 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1033 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1035 print
'<td class="right">';
1037 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $account->id).($limit ?
'&limit='.$limit :
'').
"'>";
1039 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1046 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1050 print
'</form>'.
"\n";
1053 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1059if ($type == Categorie::TYPE_PROJECT) {
1060 if ($user->hasRight(
"project",
"read")) {
1061 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1063 $permission = $user->hasRight(
'projet',
'creer');
1064 $showclassifyform = $user->hasRight(
'projet',
'creer');
1066 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1071 '@phan-var-force Project $object';
1073 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1074 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1075 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1076 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1077 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1078 print
'<input type="hidden" name="page_y" value="">';
1079 print
'<input type="hidden" name="action" value="list">';
1082 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1083 $num = count($objects);
1084 $nbtotalofrecords =
'';
1085 $newcardbutton =
'';
1088 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1090 if ($showclassifyform) {
1091 print
'<table class="noborder centpercent">';
1092 print
'<tr class="liste_titre"><td>';
1093 print $langs->trans(
"AddObjectIntoCategory").
' ';
1094 $form->selectProjects(
'',
'elemid');
1095 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1100 print
'<table class="noborder centpercent">'.
"\n";
1101 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1103 if (count($objects) > 0) {
1105 foreach ($objects as $key => $project) {
1111 print
"\t".
'<tr class="oddeven">'.
"\n";
1112 print
'<td class="nowrap tdtop">';
1113 print $project->getNomUrl(1);
1115 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1117 print
'<td class="right">';
1119 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $project->id).($limit ?
'&limit='.$limit :
'').
"'>";
1121 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1128 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1132 print
'</form>'.
"\n";
1135 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1141if ($type == Categorie::TYPE_USER) {
1142 if ($user->hasRight(
"user",
"user",
"read")) {
1143 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1144 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1146 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1151 '@phan-var-force User[] $users';
1153 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1154 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1155 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1156 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1157 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1158 print
'<input type="hidden" name="page_y" value="">';
1159 print
'<input type="hidden" name="action" value="list">';
1163 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1164 $num = count($users);
1165 $nbtotalofrecords =
'';
1166 $newcardbutton =
'';
1169 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1171 if ($showclassifyform) {
1172 print
'<table class="noborder centpercent">';
1173 print
'<tr class="liste_titre"><td>';
1175 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1176 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1177 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1182 print
'<table class="noborder centpercent">'.
"\n";
1183 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1185 if (count($users) > 0) {
1187 foreach ($users as $key => $userentry) {
1188 print
"\t".
'<tr class="oddeven">'.
"\n";
1189 print
'<td class="nowrap tdtop">';
1190 print $userentry->getNomUrl(-1);
1192 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1195 print
'<td class="right">';
1196 if ($user->hasRight(
'user',
'user',
'creer')) {
1197 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $userentry->id).($limit ?
'&limit='.$limit :
'').
"'>";
1199 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1206 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1210 print
'</form>'.
"\n";
1213 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1219if ($type == Categorie::TYPE_WAREHOUSE) {
1220 if ($user->hasRight(
"stock",
"read")) {
1221 $permission = $user->hasRight(
'stock',
'creer');
1223 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1225 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1230 '@phan-var-force Entrepot[] $objects';
1231 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1232 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1233 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1234 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1235 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1236 print
'<input type="hidden" name="page_y" value="">';
1237 print
'<input type="hidden" name="action" value="list">';
1240 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1241 $num = count($objects);
1242 $nbtotalofrecords =
'';
1243 $newcardbutton =
'';
1246 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1248 print
'<table class="noborder centpercent">'.
"\n";
1249 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1251 if (count($objects) > 0) {
1253 foreach ($objects as $key => $warehouse) {
1259 print
"\t".
'<tr class="oddeven">'.
"\n";
1260 print
'<td class="nowrap tdtop">';
1261 print $warehouse->getNomUrl(1);
1263 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1264 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1266 print
'<td class="right">';
1268 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $warehouse->id).($limit ?
'&limit='.$limit :
'').
"'>";
1270 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1277 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1281 print
'</form>'.
"\n";
1284 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1290if ($type == Categorie::TYPE_TICKET) {
1291 if ($user->hasRight(
"ticket",
"read")) {
1292 $permission = $user->hasRight(
'categorie',
'creer');
1293 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1295 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1300 '@phan-var-force Ticket[] $tickets';
1302 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1303 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1304 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1305 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1306 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1307 print
'<input type="hidden" name="page_y" value="">';
1308 print
'<input type="hidden" name="action" value="list">';
1311 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1312 $num = count($tickets);
1313 $nbtotalofrecords =
'';
1314 $newcardbutton =
'';
1317 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1319 if ($showclassifyform) {
1320 print
'<table class="noborder centpercent">';
1321 print
'<tr class="liste_titre"><td>';
1322 print $langs->trans(
"AddTicketIntoCategory").
' ';
1323 $form->selectTickets(
'',
'elemid');
1324 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1329 print
'<table class="noborder centpercent">'.
"\n";
1330 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1332 if (count($tickets) > 0) {
1334 foreach ($tickets as $ticket) {
1340 print
"\t".
'<tr class="oddeven">'.
"\n";
1341 print
'<td class="nowrap tdtop">';
1342 print $ticket->getNomUrl(1);
1344 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1346 print
'<td class="right">';
1348 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $ticket->id).($limit ?
'&limit='.$limit :
'').
"'>";
1350 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1357 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1361 print
'</form>'.
"\n";
1364 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1370if ($type == Categorie::TYPE_FICHINTER) {
1371 if ($user->hasRight(
"fichinter",
"lire")) {
1372 $permission = $user->hasRight(
'categorie',
'creer');
1373 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1375 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1376 if ($fichinters < 0) {
1380 if ($showclassifyform) {
1381 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formintervention.class.php';
1385 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1386 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1387 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1388 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1389 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1390 print
'<input type="hidden" name="action" value="addintocategory">';
1391 print
'<table class="noborder centpercent">';
1392 print
'<tr class="liste_titre"><td>';
1393 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1394 print $formfichinter->select_interventions(-1, 0,
'elemid');
1395 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1401 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1402 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1403 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1404 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1405 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1406 print
'<input type="hidden" name="action" value="list">';
1409 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1410 $num = count($fichinters);
1411 $nbtotalofrecords =
'';
1412 $newcardbutton =
'';
1414 $langs->load(
'interventions');
1416 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1417 print
'<table class="noborder centpercent">'.
"\n";
1418 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1420 if (count($fichinters) > 0) {
1422 foreach ($fichinters as $fichinter) {
1428 print
"\t".
'<tr class="oddeven">'.
"\n";
1429 print
'<td class="nowrap tdtop">';
1430 print $fichinter->getNomUrl(1);
1432 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1434 print
'<td class="right">';
1436 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".((
int)
$object->id).
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $fichinter->id).($limit ?
'&limit='.$limit :
'').
"'>";
1437 print $langs->trans(
"DeleteFromCat");
1438 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1445 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1448 print
'</form>'.
"\n";
1451 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1457if ($type == Categorie::TYPE_ORDER) {
1458 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1460 $permission = $user->rights->commande->creer;
1462 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1467 $showclassifyform = $user->hasRight(
'order',
'write');
1468 if ($showclassifyform) {
1470 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1471 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1472 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1473 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1474 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1475 print
'<input type="hidden" name="action" value="addintocategory">';
1476 print
'<table class="noborder centpercent">';
1477 print
'<tr class="liste_titre"><td>';
1478 print $langs->trans(
"AddOrderIntoCategory").
' ';
1479 $form->selectOrder(
'',
'elemid');
1480 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1486 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1487 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1488 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1489 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1490 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1491 print
'<input type="hidden" name="action" value="list">';
1494 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1495 $num = count($objects);
1496 $nbtotalofrecords =
'';
1497 $newcardbutton =
'';
1500 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1502 print
"<table class='noborder centpercent'>\n";
1503 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1505 if (count($objects) > 0) {
1507 foreach ($objects as $key => $order) {
1513 print
"\t".
'<tr class="oddeven">'.
"\n";
1514 print
'<td class="nowrap tdtop">';
1515 print $order->getNomUrl(1);
1517 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1519 print
'<td class="right">';
1521 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$order->id.
"'>";
1522 print $langs->trans(
"DeleteFromCat");
1523 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1529 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1533 print
'</form>'.
"\n";
1538if ($type == Categorie::TYPE_INVOICE) {
1539 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1541 $permission = $user->rights->facture->creer;
1543 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1548 $showclassifyform = $user->hasRight(
'facture',
'write');
1549 if ($showclassifyform) {
1551 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1552 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1553 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1554 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1555 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1556 print
'<input type="hidden" name="action" value="addintocategory">';
1557 print
'<table class="noborder centpercent">';
1558 print
'<tr class="liste_titre"><td>';
1559 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1560 $form->selectInvoice(-1,
'',
'elemid', 24, 0,
'1', 0, 0, 0,
'maxwidth500',
'',
'');
1561 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1567 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1568 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1569 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1570 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1571 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1572 print
'<input type="hidden" name="action" value="list">';
1575 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1576 $num = count($objects);
1577 $nbtotalofrecords =
'';
1578 $newcardbutton =
'';
1581 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1583 print
"<table class='noborder centpercent'>\n";
1584 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1586 if (count($objects) > 0) {
1588 foreach ($objects as $key => $invoice) {
1594 print
"\t".
'<tr class="oddeven">'.
"\n";
1595 print
'<td class="nowrap tdtop">';
1596 print $invoice->getNomUrl(1);
1598 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1600 print
'<td class="right">';
1602 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$invoice->id.
"'>";
1603 print $langs->trans(
"DeleteFromCat");
1604 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1610 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1614 print
'</form>'.
"\n";
1619if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1620 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1622 $permission = $user->rights->fournisseur->commande->creer;
1624 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1629 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1631 if ($showclassifyform) {
1633 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1634 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1635 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1636 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1637 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1638 print
'<input type="hidden" name="action" value="addintocategory">';
1639 print
'<table class="noborder centpercent">';
1640 print
'<tr class="liste_titre"><td>';
1641 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1642 $form->selectSupplierOrder(
'',
'elemid');
1643 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1649 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1650 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1651 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1652 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1653 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1654 print
'<input type="hidden" name="action" value="list">';
1657 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1658 $num = count($objects);
1659 $nbtotalofrecords =
'';
1660 $newcardbutton =
'';
1663 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1665 print
"<table class='noborder centpercent'>\n";
1666 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1668 if (count($objects) > 0) {
1670 foreach ($objects as $key => $supplier_order) {
1676 print
"\t".
'<tr class="oddeven">'.
"\n";
1677 print
'<td class="nowrap tdtop">';
1678 print $supplier_order->getNomUrl(1);
1680 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1682 print
'<td class="right">';
1684 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$supplier_order->id.
"'>";
1685 print $langs->trans(
"DeleteFromCat");
1686 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1692 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1696 print
'</form>'.
"\n";
1701if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1702 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1704 $permission = $user->rights->fournisseur->facture->creer;
1706 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1711 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1712 if ($showclassifyform) {
1714 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1715 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1716 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1717 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1718 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1719 print
'<input type="hidden" name="action" value="addintocategory">';
1720 print
'<table class="noborder centpercent">';
1721 print
'<tr class="liste_titre"><td>';
1722 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1723 $form->selectSupplierInvoice(
'',
'elemid');
1724 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1730 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1731 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1732 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1733 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1734 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1735 print
'<input type="hidden" name="action" value="list">';
1738 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1741 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1743 print
"<table class='noborder centpercent'>\n";
1744 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1746 if (count($objects) > 0) {
1748 foreach ($objects as $key => $supplier_invoice) {
1754 print
"\t".
'<tr class="oddeven">'.
"\n";
1755 print
'<td class="nowrap tdtop">';
1756 print $supplier_invoice->getNomUrl(1);
1758 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1760 print
'<td class="right">';
1762 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$supplier_invoice->id.
"'>";
1763 print $langs->trans(
"DeleteFromCat");
1764 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1770 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1774 print
'</form>'.
"\n";
1779$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1780$reshook = $hookmanager->executeHooks(
'addMoreCategoriesList', $parameters, $object, $action);
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
categories_prepare_head(Categorie $object, $type)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage members of a foundation.
Class to manage categories.
Class to manage predefined suppliers products.
Class to manage customers orders.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage products or services.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Class to generate the form for creating a new ticket.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetalreadyloaded=0, $showfk=0, $moreparam='')
Recursive function to output a tree.