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';
190 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
191 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
193 $result = $tmpobject->fetch($removeelem);
194 $elementtype =
'supplier_invoice';
200 if ($tmpobject !==
null) {
202 $result =
$object->del_type($tmpobject, $elementtype);
209if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
210 if (
$object->delete($user) >= 0) {
212 header(
"Location: ".$backtopage);
215 header(
"Location: ".DOL_URL_ROOT.
'/categories/categorie_list.php?type='.$type);
223if ($elemid && $action ==
'addintocategory') {
226 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
227 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
229 $elementtype =
'product';
230 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
231 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
233 $elementtype =
'customer';
234 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
235 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
237 $elementtype =
'supplier';
238 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
239 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
240 $newobject =
new Ticket($db);
241 $elementtype =
'ticket';
242 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
243 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
245 $elementtype =
'fichinter';
246 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
247 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
249 $elementtype =
'project';
250 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
251 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
253 $elementtype =
'member';
254 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
255 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
257 $elementtype =
'contact';
258 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
259 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
260 $newobject =
new User($db);
261 $elementtype =
'user';
262 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
263 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
265 $elementtype =
'bank_account';
266 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
267 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
269 $elementtype =
'order';
270 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
271 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
273 $elementtype =
'invoice';
274 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
275 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
277 $elementtype =
'supplier_order';
278 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
279 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
281 $elementtype =
'supplier_invoice';
285 $object->error = $langs->trans(
"NotEnoughPermissions");
287 if ($newobject !==
null) {
288 $result = $newobject->fetch($elemid);
291 if ($result >= 0 && $newobject !==
null) {
293 $result =
$object->add_type($newobject, $elementtype);
296 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
298 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
299 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
311$form =
new Form($db);
315 '/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
316 '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
318$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
322llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
324$title = $langs->trans(
"Categories");
325$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
330$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
331$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
334$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
335$ways =
$object->print_all_ways(
" >> ",
'', 1);
336foreach ($ways as $way) {
337 $morehtmlref .= $way.
"<br>\n";
339$morehtmlref .=
'</div>';
341dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
345if ($action ==
'delete') {
347 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
349 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
355print
'<div class="fichecenter">';
356print
'<div class="underbanner clearboth"></div>';
357print
'<table class="border centpercent tableforfield">';
360print
'<tr><td class="titlefield notopnoleft tdtop">';
361print $langs->trans(
"Description").
'</td><td>';
366print
'<tr><td class="notopnoleft">';
367print $langs->trans(
"Color").
'</td><td>';
368print $formother->showColor(
$object->color);
372print
'<tr><td class="titlefield notopnoleft">';
373print $langs->trans(
"Position").
'</td><td>';
378include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
390print
"<div class='tabsAction'>\n";
391$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
395if (empty($reshook)) {
396 if ($user->hasRight(
'categorie',
'creer')) {
397 $socid = (
$object->socid ?
"&socid=".$object->socid :
"");
398 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.urlencode($type).
'">'.$langs->trans(
"Modify").
'</a>';
401 if ($user->hasRight(
'categorie',
'supprimer')) {
402 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>';
409if ($user->hasRight(
'categorie',
'creer')) {
410 $link = DOL_URL_ROOT.
'/categories/card.php';
411 $link .=
'?action=create';
412 $link .=
'&type='.urlencode($type);
413 $link .=
'&catorigin='.((int)
$object->id);
414 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
416 $newcardbutton =
'<div class="right">';
417 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
418 $newcardbutton .=
'</div>';
426print
'<div class="fichecenter">';
428print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
432print
'<table class="liste nohover noborder centpercent borderbottom">';
434print
'<tr class="liste_titre">';
435print
'<td>'.$langs->trans(
"SubCats").
'</td>';
437print
'<td class="right">';
439if (is_array($cats) && count($cats) > 1 && !empty(
$conf->use_javascript_ajax)) {
440 print
'<div id="iddivjstreecontrol">';
441 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
443 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
450if (is_numeric($cats) && $cats < 0) {
452} elseif (count($cats) < 1) {
453 print
'<tr class="oddeven nobottom nohover">';
454 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
459 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
463 if ($type == Categorie::TYPE_MEMBER) {
464 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
466 if ($type == Categorie::TYPE_ACCOUNT) {
467 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
469 if ($type == Categorie::TYPE_PROJECT) {
470 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
472 if ($type == Categorie::TYPE_USER) {
473 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
479 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
480 foreach ($fulltree as $key => $val) {
481 $categstatic->id = $val[
'id'];
482 $categstatic->ref = $val[
'label'];
483 $categstatic->color = $val[
'color'];
484 $categstatic->type = $type;
490 $elements = $categstatic->getObjectsInCateg($type, 1);
492 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
495 if ($categstatic->color) {
496 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
498 $stylecolor =
' style="background: #bbb;"';
500 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
502 $entry =
'<table class="nobordernopadding centpercent">';
506 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
511 $entry .=
'<td class="right" width="20px;">';
512 $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>';
514 $entry .=
'<td class="right" width="20px;">';
515 $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>';
517 $entry .=
'<td class="right" width="20px;">';
518 $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>';
522 $entry .=
'</table>';
524 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
527 $nbofentries = (count($data) - 1);
528 if ($nbofentries > 0) {
529 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
530 print
'<tr class="pair">';
531 print
'<td colspan="3">';
539 print
'<tr class="pair">';
540 print
'<td colspan="3">';
541 print
'<table class="nobordernopadding">';
543 print
'<tr class="nobordernopadding">';
544 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
545 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
546 print
'<td> </td>';
559$arrayofmassactions = array(
565$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
571if ($type == Categorie::TYPE_PRODUCT) {
572 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
573 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
574 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
576 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
581 '@phan-var-force Product[] $prods';
583 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
584 print
'<input type="hidden" name="token" value="'.newToken().
'">';
585 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
586 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
587 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
588 print
'<input type="hidden" name="page_y" value="">';
589 print
'<input type="hidden" name="action" value="list">';
592 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
593 $num = count($prods);
594 $nbtotalofrecords =
'';
595 $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'));
598 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
600 if ($showclassifyform) {
601 print
'<table class="noborder centpercent">';
602 print
'<tr class="liste_titre"><td>';
603 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
604 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
605 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
610 print
'<table class="noborder centpercent">'.
"\n";
611 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
613 if (count($prods) > 0) {
615 foreach ($prods as $prod) {
621 print
'<tr class="oddeven">'.
"\n";
622 print
'<td class="nowrap tdtop">';
623 print $prod->getNomUrl(1);
625 print
'<td class="tdtop">'.dolPrintHTML($prod->label).
"</td>\n";
627 print
'<td class="right">';
629 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 :
'').
'">';
631 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
638 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
642 print
'</form>'.
"\n";
645 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
651if ($type == Categorie::TYPE_CUSTOMER) {
652 if ($user->hasRight(
"societe",
"read")) {
653 $permission = $user->hasRight(
'societe',
'creer');
654 $showclassifyform = $user->hasRight(
'societe',
'creer');
656 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
661 '@phan-var-force Societe[] $socs';
663 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
664 print
'<input type="hidden" name="token" value="'.newToken().
'">';
665 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
666 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
667 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
668 print
'<input type="hidden" name="action" value="list">';
669 print
'<input type="hidden" name="page_y" value="">';
672 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
674 $nbtotalofrecords =
'';
675 $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'));
678 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
680 if ($showclassifyform) {
681 print
'<table class="noborder centpercent">';
682 print
'<tr class="liste_titre"><td>';
683 print $langs->trans(
"AddCustomerIntoCategory").
' ';
684 $filter =
'(s.client:IN:1,2,3)';
685 print $form->select_company(
'',
'elemid', $filter);
686 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
691 print
'<table class="noborder centpercent">'.
"\n";
692 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
694 if (count($socs) > 0) {
696 foreach ($socs as $key => $soc) {
702 print
"\t".
'<tr class="oddeven">'.
"\n";
703 print
'<td class="nowrap tdtop tdoverflowmax250">';
704 print $soc->getNomUrl(1);
707 print
'<td class="right">';
709 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 :
'').
"'>";
711 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
718 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
722 print
'</form>'.
"\n";
725 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
731if ($type == Categorie::TYPE_SUPPLIER) {
732 if ($user->hasRight(
"fournisseur",
"read")) {
733 $permission = $user->hasRight(
'societe',
'creer');
734 $showclassifyform = $user->hasRight(
'societe',
'creer');
736 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
742 '@phan-var-force Fournisseur[] $socs';
744 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
745 print
'<input type="hidden" name="token" value="'.newToken().
'">';
746 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
747 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
748 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
749 print
'<input type="hidden" name="page_y" value="">';
750 print
'<input type="hidden" name="action" value="list">';
753 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
755 $nbtotalofrecords =
'';
756 $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'));
759 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
761 if ($showclassifyform) {
762 print
'<table class="noborder centpercent">';
763 print
'<tr class="liste_titre"><td>';
764 print $langs->trans(
"AddSupplierIntoCategory").
' ';
765 $filter =
'(s.fournisseur:=:1)';
766 print $form->select_company(
'',
'elemid', $filter);
767 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
772 print
'<table class="noborder centpercent">'.
"\n";
773 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
775 if (count($socs) > 0) {
777 foreach ($socs as $soc) {
783 print
"\t".
'<tr class="oddeven">'.
"\n";
784 print
'<td class="nowrap tdtop">';
785 print $soc->getNomUrl(1);
788 print
'<td class="right">';
790 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 :
'').
'">';
792 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
800 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
804 print
'</form>'.
"\n";
807 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
813if ($type == Categorie::TYPE_MEMBER) {
814 if ($user->hasRight(
"adherent",
"read")) {
815 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
817 $permission = $user->hasRight(
'adherent',
'creer');
818 $showclassifyform = $user->hasRight(
'adherent',
'creer');
820 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
825 '@phan-var-force Adherent[] $members';
827 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
828 print
'<input type="hidden" name="token" value="'.newToken().
'">';
829 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
830 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
831 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
832 print
'<input type="hidden" name="page_y" value="">';
833 print
'<input type="hidden" name="action" value="list">';
836 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
837 $num = count($members);
838 $nbtotalofrecords =
'';
839 $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'));
842 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
844 if ($showclassifyform) {
845 print
'<table class="noborder centpercent">';
846 print
'<tr class="liste_titre"><td>';
847 print $langs->trans(
"AssignCategoryTo").
' ';
848 print $form->selectMembers(
'',
'elemid');
849 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
854 print
'<table class="noborder centpercent">'.
"\n";
855 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
857 if (count($members) > 0) {
859 foreach ($members as $key => $member) {
865 print
"\t".
'<tr class="oddeven">'.
"\n";
866 print
'<td class="nowrap tdtop">';
867 $member->ref = $member->login;
868 print $member->getNomUrl(1, 0);
870 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
871 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
873 print
'<td class="right">';
875 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 :
'').
"'>";
877 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
884 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
888 print
'</form>'.
"\n";
891 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
897if ($type == Categorie::TYPE_CONTACT) {
898 if ($user->hasRight(
"societe",
"read")) {
899 $permission = $user->hasRight(
'societe',
'creer');
900 $showclassifyform = $user->hasRight(
'societe',
'creer');
902 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
903 if (is_numeric($contacts) && $contacts < 0) {
907 '@phan-var-force Contact[] $contacts';
909 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
910 print
'<input type="hidden" name="token" value="'.newToken().
'">';
911 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
912 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
913 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
914 print
'<input type="hidden" name="page_y" value="">';
915 print
'<input type="hidden" name="action" value="list">';
918 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
919 $num = count($contacts);
920 $nbtotalofrecords =
'';
921 $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'));
926 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
928 if ($showclassifyform) {
929 print
'<table class="noborder centpercent">';
930 print
'<tr class="liste_titre"><td>';
931 print $langs->trans(
"AssignCategoryTo").
' ';
932 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
933 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
938 print
'<table class="noborder centpercent">'.
"\n";
939 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
941 if (is_array($contacts) && count($contacts) > 0) {
943 foreach ($contacts as $key => $contact) {
949 print
"\t".
'<tr class="oddeven">'.
"\n";
950 print
'<td class="nowrap tdtop">';
951 print $contact->getNomUrl(1,
'category');
952 if ($contact->socid > 0) {
953 $objsoc->fetch($contact->socid);
955 print $objsoc->getNomUrl(1,
'contact');
959 print
'<td class="right">';
961 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 :
'').
"'>";
963 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
970 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
974 print
'</form>'.
"\n";
977 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
983if ($type == Categorie::TYPE_ACCOUNT) {
984 if ($user->hasRight(
"banque",
"read")) {
985 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
987 $permission = $user->hasRight(
'banque',
'creer');
988 $showclassifyform = $user->hasRight(
'banque',
'creer');
990 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
995 '@phan-var-force Account[] $accounts';
997 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
998 print
'<input type="hidden" name="token" value="'.newToken().
'">';
999 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1000 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1001 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1002 print
'<input type="hidden" name="page_y" value="">';
1003 print
'<input type="hidden" name="action" value="list">';
1006 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1007 $num = count($accounts);
1008 $nbtotalofrecords =
'';
1009 $newcardbutton =
'';
1012 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1014 if ($showclassifyform) {
1015 print
'<table class="noborder centpercent">';
1016 print
'<tr class="liste_titre"><td>';
1017 print $langs->trans(
"AddObjectIntoCategory").
' ';
1018 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1019 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1024 print
'<table class="noborder centpercent">'.
"\n";
1025 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1027 if (count($accounts) > 0) {
1029 foreach ($accounts as $key => $account) {
1035 print
"\t".
'<tr class="oddeven">'.
"\n";
1036 print
'<td class="nowrap tdtop">';
1037 print $account->getNomUrl(1,
'0');
1039 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1040 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1042 print
'<td class="right">';
1044 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 :
'').
"'>";
1046 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1053 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1057 print
'</form>'.
"\n";
1060 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1066if ($type == Categorie::TYPE_PROJECT) {
1067 if ($user->hasRight(
"project",
"read")) {
1068 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1070 $permission = $user->hasRight(
'projet',
'creer');
1071 $showclassifyform = $user->hasRight(
'projet',
'creer');
1073 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1078 '@phan-var-force Project $object';
1080 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1081 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1082 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1083 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1084 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1085 print
'<input type="hidden" name="page_y" value="">';
1086 print
'<input type="hidden" name="action" value="list">';
1089 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1090 $num = count($objects);
1091 $nbtotalofrecords =
'';
1092 $newcardbutton =
'';
1095 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1097 if ($showclassifyform) {
1098 print
'<table class="noborder centpercent">';
1099 print
'<tr class="liste_titre"><td>';
1100 print $langs->trans(
"AddObjectIntoCategory").
' ';
1101 $form->selectProjects(
'',
'elemid');
1102 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1107 print
'<table class="noborder centpercent">'.
"\n";
1108 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1110 if (count($objects) > 0) {
1112 foreach ($objects as $key => $project) {
1118 print
"\t".
'<tr class="oddeven">'.
"\n";
1119 print
'<td class="nowrap tdtop">';
1120 print $project->getNomUrl(1);
1122 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1124 print
'<td class="right">';
1126 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 :
'').
"'>";
1128 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1135 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1139 print
'</form>'.
"\n";
1142 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1148if ($type == Categorie::TYPE_USER) {
1149 if ($user->hasRight(
"user",
"user",
"read")) {
1150 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1151 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1153 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1158 '@phan-var-force User[] $users';
1160 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1161 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1162 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1163 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1164 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1165 print
'<input type="hidden" name="page_y" value="">';
1166 print
'<input type="hidden" name="action" value="list">';
1170 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1171 $num = count($users);
1172 $nbtotalofrecords =
'';
1173 $newcardbutton =
'';
1176 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1178 if ($showclassifyform) {
1179 print
'<table class="noborder centpercent">';
1180 print
'<tr class="liste_titre"><td>';
1182 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1183 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1184 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1189 print
'<table class="noborder centpercent">'.
"\n";
1190 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1192 if (count($users) > 0) {
1194 foreach ($users as $key => $userentry) {
1195 print
"\t".
'<tr class="oddeven">'.
"\n";
1196 print
'<td class="nowrap tdtop">';
1197 print $userentry->getNomUrl(-1);
1199 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1202 print
'<td class="right">';
1203 if ($user->hasRight(
'user',
'user',
'creer')) {
1204 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 :
'').
"'>";
1206 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1213 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1217 print
'</form>'.
"\n";
1220 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1226if ($type == Categorie::TYPE_WAREHOUSE) {
1227 if ($user->hasRight(
"stock",
"read")) {
1228 $permission = $user->hasRight(
'stock',
'creer');
1230 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1232 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1237 '@phan-var-force Entrepot[] $objects';
1238 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1239 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1240 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1241 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1242 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1243 print
'<input type="hidden" name="page_y" value="">';
1244 print
'<input type="hidden" name="action" value="list">';
1247 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1248 $num = count($objects);
1249 $nbtotalofrecords =
'';
1250 $newcardbutton =
'';
1253 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1255 print
'<table class="noborder centpercent">'.
"\n";
1256 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1258 if (count($objects) > 0) {
1260 foreach ($objects as $key => $warehouse) {
1266 print
"\t".
'<tr class="oddeven">'.
"\n";
1267 print
'<td class="nowrap tdtop">';
1268 print $warehouse->getNomUrl(1);
1270 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1271 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1273 print
'<td class="right">';
1275 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 :
'').
"'>";
1277 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1284 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1288 print
'</form>'.
"\n";
1291 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1297if ($type == Categorie::TYPE_TICKET) {
1298 if ($user->hasRight(
"ticket",
"read")) {
1299 $permission = $user->hasRight(
'categorie',
'creer');
1300 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1302 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1307 '@phan-var-force Ticket[] $tickets';
1309 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1310 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1311 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1312 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1313 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1314 print
'<input type="hidden" name="page_y" value="">';
1315 print
'<input type="hidden" name="action" value="list">';
1318 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1319 $num = count($tickets);
1320 $nbtotalofrecords =
'';
1321 $newcardbutton =
'';
1324 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1326 if ($showclassifyform) {
1327 print
'<table class="noborder centpercent">';
1328 print
'<tr class="liste_titre"><td>';
1329 print $langs->trans(
"AddTicketIntoCategory").
' ';
1330 $form->selectTickets(
'',
'elemid');
1331 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1336 print
'<table class="noborder centpercent">'.
"\n";
1337 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1339 if (count($tickets) > 0) {
1341 foreach ($tickets as $ticket) {
1347 print
"\t".
'<tr class="oddeven">'.
"\n";
1348 print
'<td class="nowrap tdtop">';
1349 print $ticket->getNomUrl(1);
1351 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1353 print
'<td class="right">';
1355 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 :
'').
"'>";
1357 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1364 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1368 print
'</form>'.
"\n";
1371 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1377if ($type == Categorie::TYPE_FICHINTER) {
1378 if ($user->hasRight(
"fichinter",
"lire")) {
1379 $permission = $user->hasRight(
'categorie',
'creer');
1380 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1382 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1383 if ($fichinters < 0) {
1387 if ($showclassifyform) {
1388 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formintervention.class.php';
1392 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1393 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1394 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1395 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1396 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1397 print
'<input type="hidden" name="action" value="addintocategory">';
1398 print
'<table class="noborder centpercent">';
1399 print
'<tr class="liste_titre"><td>';
1400 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1401 print $formfichinter->select_interventions(-1, 0,
'elemid');
1402 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1408 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1409 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1410 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1411 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1412 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1413 print
'<input type="hidden" name="action" value="list">';
1416 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1417 $num = count($fichinters);
1418 $nbtotalofrecords =
'';
1419 $newcardbutton =
'';
1421 $langs->load(
'interventions');
1423 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1424 print
'<table class="noborder centpercent">'.
"\n";
1425 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1427 if (count($fichinters) > 0) {
1429 foreach ($fichinters as $fichinter) {
1435 print
"\t".
'<tr class="oddeven">'.
"\n";
1436 print
'<td class="nowrap tdtop">';
1437 print $fichinter->getNomUrl(1);
1439 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1441 print
'<td class="right">';
1443 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 :
'').
"'>";
1444 print $langs->trans(
"DeleteFromCat");
1445 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1452 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1455 print
'</form>'.
"\n";
1458 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1465if ($type == Categorie::TYPE_ORDER && !$user->hasRight(
'commande',
'lire')) {
1468if ($type == Categorie::TYPE_ORDER) {
1469 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1471 $permission = $user->rights->commande->creer;
1473 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1478 $showclassifyform = $user->hasRight(
'order',
'write');
1479 if ($showclassifyform) {
1481 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1482 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1483 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1484 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1485 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1486 print
'<input type="hidden" name="action" value="addintocategory">';
1487 print
'<table class="noborder centpercent">';
1488 print
'<tr class="liste_titre"><td>';
1489 print $langs->trans(
"AddOrderIntoCategory").
' ';
1490 $form->selectOrder(
'',
'elemid');
1491 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1497 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1498 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1499 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1500 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1501 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1502 print
'<input type="hidden" name="action" value="list">';
1505 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1506 $num = count($objects);
1507 $nbtotalofrecords =
'';
1508 $newcardbutton =
'';
1511 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1513 print
"<table class='noborder centpercent'>\n";
1514 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1516 if (count($objects) > 0) {
1518 foreach ($objects as $key => $order) {
1524 print
"\t".
'<tr class="oddeven">'.
"\n";
1525 print
'<td class="nowrap tdtop">';
1526 print $order->getNomUrl(1);
1528 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1530 print
'<td class="right">';
1532 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$order->id.
"'>";
1533 print $langs->trans(
"DeleteFromCat");
1534 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1540 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1544 print
'</form>'.
"\n";
1549if ($type == Categorie::TYPE_INVOICE && !$user->hasRight(
'facture',
'lire')) {
1552if ($type == Categorie::TYPE_INVOICE) {
1553 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1555 $permission = $user->rights->facture->creer;
1557 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1562 $showclassifyform = $user->hasRight(
'facture',
'write');
1563 if ($showclassifyform) {
1565 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1566 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1567 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1568 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1569 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1570 print
'<input type="hidden" name="action" value="addintocategory">';
1571 print
'<table class="noborder centpercent">';
1572 print
'<tr class="liste_titre"><td>';
1573 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1574 $form->selectInvoice(-1,
'',
'elemid', 24, 0,
'1', 0, 0, 0,
'maxwidth500',
'',
'');
1575 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1581 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1582 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1583 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1584 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1585 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1586 print
'<input type="hidden" name="action" value="list">';
1589 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1590 $num = count($objects);
1591 $nbtotalofrecords =
'';
1592 $newcardbutton =
'';
1595 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1597 print
"<table class='noborder centpercent'>\n";
1598 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1600 if (count($objects) > 0) {
1602 foreach ($objects as $key => $invoice) {
1608 print
"\t".
'<tr class="oddeven">'.
"\n";
1609 print
'<td class="nowrap tdtop">';
1610 print $invoice->getNomUrl(1);
1612 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1614 print
'<td class="right">';
1616 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$invoice->id.
"'>";
1617 print $langs->trans(
"DeleteFromCat");
1618 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1624 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1628 print
'</form>'.
"\n";
1633if ($type == Categorie::TYPE_SUPPLIER_ORDER && !((isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
'fournisseur',
'commande',
'lire')) || (isModEnabled(
'supplier_order') && $user->hasRight(
'supplier_order',
'lire')))) {
1636if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1637 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1639 $permission = $user->rights->fournisseur->commande->creer;
1641 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1646 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1648 if ($showclassifyform) {
1650 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1651 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1652 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1653 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1654 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1655 print
'<input type="hidden" name="action" value="addintocategory">';
1656 print
'<table class="noborder centpercent">';
1657 print
'<tr class="liste_titre"><td>';
1658 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1659 $form->selectSupplierOrder(
'',
'elemid');
1660 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1666 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1667 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1668 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1669 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1670 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1671 print
'<input type="hidden" name="action" value="list">';
1674 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1675 $num = count($objects);
1676 $nbtotalofrecords =
'';
1677 $newcardbutton =
'';
1680 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1682 print
"<table class='noborder centpercent'>\n";
1683 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1685 if (count($objects) > 0) {
1687 foreach ($objects as $key => $supplier_order) {
1693 print
"\t".
'<tr class="oddeven">'.
"\n";
1694 print
'<td class="nowrap tdtop">';
1695 print $supplier_order->getNomUrl(1);
1697 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1699 print
'<td class="right">';
1701 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$supplier_order->id.
"'>";
1702 print $langs->trans(
"DeleteFromCat");
1703 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1709 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1713 print
'</form>'.
"\n";
1718if ($type == Categorie::TYPE_SUPPLIER_INVOICE && !((isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
'fournisseur',
'facture',
'lire')) || (isModEnabled(
'supplier_invoice') && $user->hasRight(
'supplier_invoice',
'lire')))) {
1721if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1722 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1724 $permission = $user->rights->fournisseur->facture->creer;
1726 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1731 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1732 if ($showclassifyform) {
1734 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1735 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1736 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1737 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1738 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1739 print
'<input type="hidden" name="action" value="addintocategory">';
1740 print
'<table class="noborder centpercent">';
1741 print
'<tr class="liste_titre"><td>';
1742 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1743 $form->selectSupplierInvoice(
'',
'elemid');
1744 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1750 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1751 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1752 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1753 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1754 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1755 print
'<input type="hidden" name="action" value="list">';
1758 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1761 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1763 print
"<table class='noborder centpercent'>\n";
1764 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1766 if (count($objects) > 0) {
1768 foreach ($objects as $key => $supplier_invoice) {
1774 print
"\t".
'<tr class="oddeven">'.
"\n";
1775 print
'<td class="nowrap tdtop">';
1776 print $supplier_invoice->getNomUrl(1);
1778 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1780 print
'<td class="right">';
1782 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$supplier_invoice->id.
"'>";
1783 print $langs->trans(
"DeleteFromCat");
1784 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1790 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1794 print
'</form>'.
"\n";
1799$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1800$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.