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_WAREHOUSE && $user->hasRight(
'stock',
'creer')) {
166 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
168 $result = $tmpobject->fetch($removeelem);
169 $elementtype =
'warehouse';
170 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
171 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
172 $tmpobject =
new Ticket($db);
173 $result = $tmpobject->fetch($removeelem);
174 $elementtype =
'ticket';
175 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
176 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
178 $result = $tmpobject->fetch($removeelem);
179 $elementtype =
'fichinter';
180 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
181 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
183 $result = $tmpobject->fetch($removeelem);
184 $elementtype =
'order';
185 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
186 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
188 $result = $tmpobject->fetch($removeelem);
189 $elementtype =
'invoice';
190 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
191 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
193 $result = $tmpobject->fetch($removeelem);
194 $elementtype =
'supplier_order';
195 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
196 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
198 $result = $tmpobject->fetch($removeelem);
199 $elementtype =
'supplier_invoice';
205 if ($tmpobject !==
null) {
207 $result =
$object->del_type($tmpobject, $elementtype);
214if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
215 if (
$object->delete($user) >= 0) {
217 header(
"Location: ".$backtopage);
220 header(
"Location: ".DOL_URL_ROOT.
'/categories/categorie_list.php?type='.$type);
228if ($elemid && $action ==
'addintocategory') {
231 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
232 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
234 $elementtype =
'product';
235 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
236 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
238 $elementtype =
'customer';
239 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
240 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
242 $elementtype =
'supplier';
243 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
244 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
245 $newobject =
new Ticket($db);
246 $elementtype =
'ticket';
247 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
248 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
250 $elementtype =
'fichinter';
251 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
252 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
254 $elementtype =
'project';
255 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
256 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
258 $elementtype =
'member';
259 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
260 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
262 $elementtype =
'contact';
263 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
264 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
265 $newobject =
new User($db);
266 $elementtype =
'user';
267 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
268 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
270 $elementtype =
'bank_account';
271 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
272 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
274 $elementtype =
'order';
275 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
276 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
278 $elementtype =
'invoice';
279 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
280 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
282 $elementtype =
'supplier_order';
283 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
284 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
286 $elementtype =
'supplier_invoice';
290 $object->error = $langs->trans(
"NotEnoughPermissions");
292 if ($newobject !==
null) {
293 $result = $newobject->fetch($elemid);
296 if ($result >= 0 && $newobject !==
null) {
298 $result =
$object->add_type($newobject, $elementtype);
301 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
303 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
304 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
316$form =
new Form($db);
320 '/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
321 '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
323$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
327llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
329$title = $langs->trans(
"Categories");
330$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
335$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
336$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
339$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
340$ways =
$object->print_all_ways(
" >> ",
'', 1);
341foreach ($ways as $way) {
342 $morehtmlref .= $way.
"<br>\n";
344$morehtmlref .=
'</div>';
346dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
350if ($action ==
'delete') {
352 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
354 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
360print
'<div class="fichecenter">';
361print
'<div class="underbanner clearboth"></div>';
362print
'<table class="border centpercent tableforfield">';
365print
'<tr><td class="titlefield notopnoleft tdtop">';
366print $langs->trans(
"Description").
'</td><td>';
371print
'<tr><td class="notopnoleft">';
372print $langs->trans(
"Color").
'</td><td>';
373print $formother->showColor(
$object->color);
377print
'<tr><td class="titlefield notopnoleft">';
378print $langs->trans(
"Position").
'</td><td>';
383include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
395print
"<div class='tabsAction'>\n";
396$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
400if (empty($reshook)) {
401 if ($user->hasRight(
'categorie',
'creer')) {
402 $socid = (
$object->socid ?
"&socid=".$object->socid :
"");
403 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.urlencode($type).
'">'.$langs->trans(
"Modify").
'</a>';
406 if ($user->hasRight(
'categorie',
'supprimer')) {
407 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>';
414if ($user->hasRight(
'categorie',
'creer')) {
415 $link = DOL_URL_ROOT.
'/categories/card.php';
416 $link .=
'?action=create';
417 $link .=
'&type='.urlencode($type);
418 $link .=
'&catorigin='.((int)
$object->id);
419 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
421 $newcardbutton =
'<div class="right">';
422 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
423 $newcardbutton .=
'</div>';
431print
'<div class="fichecenter">';
433print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
437print
'<table class="liste nohover noborder centpercent borderbottom">';
439print
'<tr class="liste_titre">';
440print
'<td>'.$langs->trans(
"SubCats").
'</td>';
442print
'<td class="right">';
444if (is_array($cats) && count($cats) > 1 && !empty(
$conf->use_javascript_ajax)) {
445 print
'<div id="iddivjstreecontrol">';
446 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
448 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
455if (is_numeric($cats) && $cats < 0) {
457} elseif (count($cats) < 1) {
458 print
'<tr class="oddeven nobottom nohover">';
459 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
464 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
468 if ($type == Categorie::TYPE_MEMBER) {
469 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
471 if ($type == Categorie::TYPE_ACCOUNT) {
472 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
474 if ($type == Categorie::TYPE_PROJECT) {
475 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
477 if ($type == Categorie::TYPE_USER) {
478 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
484 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
485 foreach ($fulltree as $key => $val) {
486 $categstatic->id = $val[
'id'];
487 $categstatic->ref = $val[
'label'];
488 $categstatic->color = $val[
'color'];
489 $categstatic->type = $type;
495 $elements = $categstatic->getObjectsInCateg($type, 1);
497 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
500 if ($categstatic->color) {
501 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
503 $stylecolor =
' style="background: #bbb;"';
505 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
507 $entry =
'<table class="nobordernopadding centpercent">';
511 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
516 $entry .=
'<td class="right" width="20px;">';
517 $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>';
519 $entry .=
'<td class="right" width="20px;">';
520 $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>';
522 $entry .=
'<td class="right" width="20px;">';
523 $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>';
527 $entry .=
'</table>';
529 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
532 $nbofentries = (count($data) - 1);
533 if ($nbofentries > 0) {
534 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
535 print
'<tr class="pair">';
536 print
'<td colspan="3">';
544 print
'<tr class="pair">';
545 print
'<td colspan="3">';
546 print
'<table class="nobordernopadding">';
548 print
'<tr class="nobordernopadding">';
549 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
550 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
551 print
'<td> </td>';
564$arrayofmassactions = array(
570$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
576if ($type == Categorie::TYPE_PRODUCT) {
577 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
578 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
579 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
581 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
586 '@phan-var-force Product[] $prods';
588 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
589 print
'<input type="hidden" name="token" value="'.newToken().
'">';
590 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
591 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
592 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
593 print
'<input type="hidden" name="page_y" value="">';
594 print
'<input type="hidden" name="action" value="list">';
597 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
598 $num = count($prods);
599 $nbtotalofrecords =
'';
600 $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'));
603 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
605 if ($showclassifyform) {
606 print
'<table class="noborder centpercent">';
607 print
'<tr class="liste_titre"><td>';
608 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
609 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
610 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
615 print
'<table class="noborder centpercent">'.
"\n";
616 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
618 if (count($prods) > 0) {
620 foreach ($prods as $prod) {
626 print
'<tr class="oddeven">'.
"\n";
627 print
'<td class="nowrap tdtop">';
628 print $prod->getNomUrl(1);
630 print
'<td class="tdtop">'.dolPrintHTML($prod->label).
"</td>\n";
632 print
'<td class="right">';
634 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 :
'').
'">';
636 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
643 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
647 print
'</form>'.
"\n";
650 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
656if ($type == Categorie::TYPE_CUSTOMER) {
657 if ($user->hasRight(
"societe",
"read")) {
658 $permission = $user->hasRight(
'societe',
'creer');
659 $showclassifyform = $user->hasRight(
'societe',
'creer');
661 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
666 '@phan-var-force Societe[] $socs';
668 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
669 print
'<input type="hidden" name="token" value="'.newToken().
'">';
670 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
671 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
672 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
673 print
'<input type="hidden" name="action" value="list">';
674 print
'<input type="hidden" name="page_y" value="">';
677 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
679 $nbtotalofrecords =
'';
680 $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'));
683 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
685 if ($showclassifyform) {
686 print
'<table class="noborder centpercent">';
687 print
'<tr class="liste_titre"><td>';
688 print $langs->trans(
"AddCustomerIntoCategory").
' ';
689 $filter =
'(s.client:IN:1,2,3)';
690 print $form->select_company(
'',
'elemid', $filter);
691 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
696 print
'<table class="noborder centpercent">'.
"\n";
697 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
699 if (count($socs) > 0) {
701 foreach ($socs as $key => $soc) {
707 print
"\t".
'<tr class="oddeven">'.
"\n";
708 print
'<td class="nowrap tdtop tdoverflowmax250">';
709 print $soc->getNomUrl(1);
712 print
'<td class="right">';
714 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 :
'').
"'>";
716 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
723 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
727 print
'</form>'.
"\n";
730 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
736if ($type == Categorie::TYPE_SUPPLIER) {
737 if ($user->hasRight(
"fournisseur",
"read")) {
738 $permission = $user->hasRight(
'societe',
'creer');
739 $showclassifyform = $user->hasRight(
'societe',
'creer');
741 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
747 '@phan-var-force Fournisseur[] $socs';
749 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
750 print
'<input type="hidden" name="token" value="'.newToken().
'">';
751 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
752 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
753 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
754 print
'<input type="hidden" name="page_y" value="">';
755 print
'<input type="hidden" name="action" value="list">';
758 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
760 $nbtotalofrecords =
'';
761 $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'));
764 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
766 if ($showclassifyform) {
767 print
'<table class="noborder centpercent">';
768 print
'<tr class="liste_titre"><td>';
769 print $langs->trans(
"AddSupplierIntoCategory").
' ';
770 $filter =
'(s.fournisseur:=:1)';
771 print $form->select_company(
'',
'elemid', $filter);
772 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
777 print
'<table class="noborder centpercent">'.
"\n";
778 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
780 if (count($socs) > 0) {
782 foreach ($socs as $soc) {
788 print
"\t".
'<tr class="oddeven">'.
"\n";
789 print
'<td class="nowrap tdtop">';
790 print $soc->getNomUrl(1);
793 print
'<td class="right">';
795 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 :
'').
'">';
797 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
805 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
809 print
'</form>'.
"\n";
812 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
818if ($type == Categorie::TYPE_MEMBER) {
819 if ($user->hasRight(
"adherent",
"read")) {
820 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
822 $permission = $user->hasRight(
'adherent',
'creer');
823 $showclassifyform = $user->hasRight(
'adherent',
'creer');
825 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
830 '@phan-var-force Adherent[] $members';
832 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
833 print
'<input type="hidden" name="token" value="'.newToken().
'">';
834 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
835 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
836 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
837 print
'<input type="hidden" name="page_y" value="">';
838 print
'<input type="hidden" name="action" value="list">';
841 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
842 $num = count($members);
843 $nbtotalofrecords =
'';
844 $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'));
847 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
849 if ($showclassifyform) {
850 print
'<table class="noborder centpercent">';
851 print
'<tr class="liste_titre"><td>';
852 print $langs->trans(
"AssignCategoryTo").
' ';
853 print $form->selectMembers(
'',
'elemid');
854 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
859 print
'<table class="noborder centpercent">'.
"\n";
860 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
862 if (count($members) > 0) {
864 foreach ($members as $key => $member) {
870 print
"\t".
'<tr class="oddeven">'.
"\n";
871 print
'<td class="nowrap tdtop">';
872 $member->ref = $member->login;
873 print $member->getNomUrl(1, 0);
875 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
876 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
878 print
'<td class="right">';
880 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 :
'').
"'>";
882 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
889 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
893 print
'</form>'.
"\n";
896 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
902if ($type == Categorie::TYPE_CONTACT) {
903 if ($user->hasRight(
"societe",
"read")) {
904 $permission = $user->hasRight(
'societe',
'creer');
905 $showclassifyform = $user->hasRight(
'societe',
'creer');
907 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
908 if (is_numeric($contacts) && $contacts < 0) {
912 '@phan-var-force Contact[] $contacts';
914 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
915 print
'<input type="hidden" name="token" value="'.newToken().
'">';
916 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
917 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
918 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
919 print
'<input type="hidden" name="page_y" value="">';
920 print
'<input type="hidden" name="action" value="list">';
923 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
924 $num = count($contacts);
925 $nbtotalofrecords =
'';
926 $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'));
931 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
933 if ($showclassifyform) {
934 print
'<table class="noborder centpercent">';
935 print
'<tr class="liste_titre"><td>';
936 print $langs->trans(
"AssignCategoryTo").
' ';
937 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
938 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
943 print
'<table class="noborder centpercent">'.
"\n";
944 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
946 if (is_array($contacts) && count($contacts) > 0) {
948 foreach ($contacts as $key => $contact) {
954 print
"\t".
'<tr class="oddeven">'.
"\n";
955 print
'<td class="nowrap tdtop">';
956 print $contact->getNomUrl(1,
'category');
957 if ($contact->socid > 0) {
958 $objsoc->fetch($contact->socid);
960 print $objsoc->getNomUrl(1,
'contact');
964 print
'<td class="right">';
966 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 :
'').
"'>";
968 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
975 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
979 print
'</form>'.
"\n";
982 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
988if ($type == Categorie::TYPE_ACCOUNT) {
989 if ($user->hasRight(
"banque",
"read")) {
990 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
992 $permission = $user->hasRight(
'banque',
'creer');
993 $showclassifyform = $user->hasRight(
'banque',
'creer');
995 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1000 '@phan-var-force Account[] $accounts';
1002 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1003 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1004 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1005 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1006 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1007 print
'<input type="hidden" name="page_y" value="">';
1008 print
'<input type="hidden" name="action" value="list">';
1011 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1012 $num = count($accounts);
1013 $nbtotalofrecords =
'';
1014 $newcardbutton =
'';
1017 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1019 if ($showclassifyform) {
1020 print
'<table class="noborder centpercent">';
1021 print
'<tr class="liste_titre"><td>';
1022 print $langs->trans(
"AddObjectIntoCategory").
' ';
1023 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1024 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1029 print
'<table class="noborder centpercent">'.
"\n";
1030 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1032 if (count($accounts) > 0) {
1034 foreach ($accounts as $key => $account) {
1040 print
"\t".
'<tr class="oddeven">'.
"\n";
1041 print
'<td class="nowrap tdtop">';
1042 print $account->getNomUrl(1,
'0');
1044 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1045 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1047 print
'<td class="right">';
1049 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 :
'').
"'>";
1051 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1058 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1062 print
'</form>'.
"\n";
1065 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1071if ($type == Categorie::TYPE_PROJECT) {
1072 if ($user->hasRight(
"project",
"read")) {
1073 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1075 $permission = $user->hasRight(
'projet',
'creer');
1076 $showclassifyform = $user->hasRight(
'projet',
'creer');
1078 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1083 '@phan-var-force Project $object';
1085 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1086 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1087 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1088 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1089 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1090 print
'<input type="hidden" name="page_y" value="">';
1091 print
'<input type="hidden" name="action" value="list">';
1094 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1095 $num = count($objects);
1096 $nbtotalofrecords =
'';
1097 $newcardbutton =
'';
1100 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1102 if ($showclassifyform) {
1103 print
'<table class="noborder centpercent">';
1104 print
'<tr class="liste_titre"><td>';
1105 print $langs->trans(
"AddObjectIntoCategory").
' ';
1106 $form->selectProjects(
'',
'elemid');
1107 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1112 print
'<table class="noborder centpercent">'.
"\n";
1113 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1115 if (count($objects) > 0) {
1117 foreach ($objects as $key => $project) {
1123 print
"\t".
'<tr class="oddeven">'.
"\n";
1124 print
'<td class="nowrap tdtop">';
1125 print $project->getNomUrl(1);
1127 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1129 print
'<td class="right">';
1131 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 :
'').
"'>";
1133 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1140 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1144 print
'</form>'.
"\n";
1147 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1153if ($type == Categorie::TYPE_USER) {
1154 if ($user->hasRight(
"user",
"user",
"read")) {
1155 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1156 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1158 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1163 '@phan-var-force User[] $users';
1165 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1166 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1167 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1168 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1169 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1170 print
'<input type="hidden" name="page_y" value="">';
1171 print
'<input type="hidden" name="action" value="list">';
1175 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1176 $num = count($users);
1177 $nbtotalofrecords =
'';
1178 $newcardbutton =
'';
1181 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1183 if ($showclassifyform) {
1184 print
'<table class="noborder centpercent">';
1185 print
'<tr class="liste_titre"><td>';
1187 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1188 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1189 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1194 print
'<table class="noborder centpercent">'.
"\n";
1195 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1197 if (count($users) > 0) {
1199 foreach ($users as $key => $userentry) {
1200 print
"\t".
'<tr class="oddeven">'.
"\n";
1201 print
'<td class="nowrap tdtop">';
1202 print $userentry->getNomUrl(-1);
1204 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1207 print
'<td class="right">';
1208 if ($user->hasRight(
'user',
'user',
'creer')) {
1209 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 :
'').
"'>";
1211 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1218 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1222 print
'</form>'.
"\n";
1225 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1231if ($type == Categorie::TYPE_WAREHOUSE) {
1232 if ($user->hasRight(
"stock",
"read")) {
1233 $permission = $user->hasRight(
'stock',
'creer');
1235 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1237 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1242 '@phan-var-force Entrepot[] $objects';
1243 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1244 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1245 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1246 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1247 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1248 print
'<input type="hidden" name="page_y" value="">';
1249 print
'<input type="hidden" name="action" value="list">';
1252 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1253 $num = count($objects);
1254 $nbtotalofrecords =
'';
1255 $newcardbutton =
'';
1258 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1260 print
'<table class="noborder centpercent">'.
"\n";
1261 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1263 if (count($objects) > 0) {
1265 foreach ($objects as $key => $warehouse) {
1271 print
"\t".
'<tr class="oddeven">'.
"\n";
1272 print
'<td class="nowrap tdtop">';
1273 print $warehouse->getNomUrl(1);
1275 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1276 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1278 print
'<td class="right">';
1280 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 :
'').
"'>";
1282 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1289 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1293 print
'</form>'.
"\n";
1296 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1302if ($type == Categorie::TYPE_TICKET) {
1303 if ($user->hasRight(
"ticket",
"read")) {
1304 $permission = $user->hasRight(
'categorie',
'creer');
1305 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1307 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1312 '@phan-var-force Ticket[] $tickets';
1314 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1315 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1316 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1317 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1318 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1319 print
'<input type="hidden" name="page_y" value="">';
1320 print
'<input type="hidden" name="action" value="list">';
1323 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1324 $num = count($tickets);
1325 $nbtotalofrecords =
'';
1326 $newcardbutton =
'';
1329 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1331 if ($showclassifyform) {
1332 print
'<table class="noborder centpercent">';
1333 print
'<tr class="liste_titre"><td>';
1334 print $langs->trans(
"AddTicketIntoCategory").
' ';
1335 $form->selectTickets(
'',
'elemid');
1336 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1341 print
'<table class="noborder centpercent">'.
"\n";
1342 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1344 if (count($tickets) > 0) {
1346 foreach ($tickets as $ticket) {
1352 print
"\t".
'<tr class="oddeven">'.
"\n";
1353 print
'<td class="nowrap tdtop">';
1354 print $ticket->getNomUrl(1);
1356 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1358 print
'<td class="right">';
1360 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 :
'').
"'>";
1362 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1369 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1373 print
'</form>'.
"\n";
1376 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1382if ($type == Categorie::TYPE_FICHINTER) {
1383 if ($user->hasRight(
"fichinter",
"lire")) {
1384 $permission = $user->hasRight(
'categorie',
'creer');
1385 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1387 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1388 if ($fichinters < 0) {
1392 if ($showclassifyform) {
1393 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formintervention.class.php';
1397 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1398 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1399 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1400 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1401 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1402 print
'<input type="hidden" name="action" value="addintocategory">';
1403 print
'<table class="noborder centpercent">';
1404 print
'<tr class="liste_titre"><td>';
1405 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1406 print $formfichinter->select_interventions(-1, 0,
'elemid');
1407 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1413 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1414 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1415 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1416 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1417 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1418 print
'<input type="hidden" name="action" value="list">';
1421 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1422 $num = count($fichinters);
1423 $nbtotalofrecords =
'';
1424 $newcardbutton =
'';
1426 $langs->load(
'interventions');
1428 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1429 print
'<table class="noborder centpercent">'.
"\n";
1430 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1432 if (count($fichinters) > 0) {
1434 foreach ($fichinters as $fichinter) {
1440 print
"\t".
'<tr class="oddeven">'.
"\n";
1441 print
'<td class="nowrap tdtop">';
1442 print $fichinter->getNomUrl(1);
1444 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1446 print
'<td class="right">';
1448 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 :
'').
"'>";
1449 print $langs->trans(
"DeleteFromCat");
1450 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1457 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1460 print
'</form>'.
"\n";
1463 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1470if ($type == Categorie::TYPE_ORDER && !$user->hasRight(
'commande',
'lire')) {
1473if ($type == Categorie::TYPE_ORDER) {
1474 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1476 $permission = $user->rights->commande->creer;
1478 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1483 $showclassifyform = $user->hasRight(
'order',
'write');
1484 if ($showclassifyform) {
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="addintocategory">';
1492 print
'<table class="noborder centpercent">';
1493 print
'<tr class="liste_titre"><td>';
1494 print $langs->trans(
"AddOrderIntoCategory").
' ';
1495 $form->selectOrder(
'',
'elemid');
1496 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1502 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1503 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1504 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1505 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1506 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1507 print
'<input type="hidden" name="action" value="list">';
1510 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1511 $num = count($objects);
1512 $nbtotalofrecords =
'';
1513 $newcardbutton =
'';
1516 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1518 print
"<table class='noborder centpercent'>\n";
1519 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1521 if (count($objects) > 0) {
1523 foreach ($objects as $key => $order) {
1529 print
"\t".
'<tr class="oddeven">'.
"\n";
1530 print
'<td class="nowrap tdtop">';
1531 print $order->getNomUrl(1);
1533 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1535 print
'<td class="right">';
1537 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$order->id.
"'>";
1538 print $langs->trans(
"DeleteFromCat");
1539 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1545 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1549 print
'</form>'.
"\n";
1554if ($type == Categorie::TYPE_INVOICE && !$user->hasRight(
'facture',
'lire')) {
1557if ($type == Categorie::TYPE_INVOICE) {
1558 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1560 $permission = $user->rights->facture->creer;
1562 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1567 $showclassifyform = $user->hasRight(
'facture',
'write');
1568 if ($showclassifyform) {
1570 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1571 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1572 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1573 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1574 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1575 print
'<input type="hidden" name="action" value="addintocategory">';
1576 print
'<table class="noborder centpercent">';
1577 print
'<tr class="liste_titre"><td>';
1578 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1579 $form->selectInvoice(-1,
'',
'elemid', 24, 0,
'1', 0, 0, 0,
'maxwidth500',
'',
'');
1580 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1586 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1587 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1588 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1589 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1590 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1591 print
'<input type="hidden" name="action" value="list">';
1594 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1595 $num = count($objects);
1596 $nbtotalofrecords =
'';
1597 $newcardbutton =
'';
1600 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1602 print
"<table class='noborder centpercent'>\n";
1603 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1605 if (count($objects) > 0) {
1607 foreach ($objects as $key => $invoice) {
1613 print
"\t".
'<tr class="oddeven">'.
"\n";
1614 print
'<td class="nowrap tdtop">';
1615 print $invoice->getNomUrl(1);
1617 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1619 print
'<td class="right">';
1621 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$invoice->id.
"'>";
1622 print $langs->trans(
"DeleteFromCat");
1623 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1629 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1633 print
'</form>'.
"\n";
1638if ($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')))) {
1641if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1642 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1644 $permission = $user->rights->fournisseur->commande->creer;
1646 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1651 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1653 if ($showclassifyform) {
1655 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1656 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1657 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1658 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1659 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1660 print
'<input type="hidden" name="action" value="addintocategory">';
1661 print
'<table class="noborder centpercent">';
1662 print
'<tr class="liste_titre"><td>';
1663 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1664 $form->selectSupplierOrder(
'',
'elemid');
1665 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1671 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1672 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1673 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1674 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1675 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1676 print
'<input type="hidden" name="action" value="list">';
1679 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1680 $num = count($objects);
1681 $nbtotalofrecords =
'';
1682 $newcardbutton =
'';
1685 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1687 print
"<table class='noborder centpercent'>\n";
1688 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1690 if (count($objects) > 0) {
1692 foreach ($objects as $key => $supplier_order) {
1698 print
"\t".
'<tr class="oddeven">'.
"\n";
1699 print
'<td class="nowrap tdtop">';
1700 print $supplier_order->getNomUrl(1);
1702 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1704 print
'<td class="right">';
1706 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$supplier_order->id.
"'>";
1707 print $langs->trans(
"DeleteFromCat");
1708 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1714 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1718 print
'</form>'.
"\n";
1723if ($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')))) {
1726if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1727 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1729 $permission = $user->rights->fournisseur->facture->creer;
1731 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1736 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1737 if ($showclassifyform) {
1739 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1740 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1741 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1742 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1743 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1744 print
'<input type="hidden" name="action" value="addintocategory">';
1745 print
'<table class="noborder centpercent">';
1746 print
'<tr class="liste_titre"><td>';
1747 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1748 $form->selectSupplierInvoice(
'',
'elemid');
1749 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1755 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1756 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1757 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1758 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1759 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1760 print
'<input type="hidden" name="action" value="list">';
1763 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1766 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1768 print
"<table class='noborder centpercent'>\n";
1769 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1771 if (count($objects) > 0) {
1773 foreach ($objects as $key => $supplier_invoice) {
1779 print
"\t".
'<tr class="oddeven">'.
"\n";
1780 print
'<td class="nowrap tdtop">';
1781 print $supplier_invoice->getNomUrl(1);
1783 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1785 print
'<td class="right">';
1787 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&removeelem=".$supplier_invoice->id.
"'>";
1788 print $langs->trans(
"DeleteFromCat");
1789 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1795 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1799 print
'</form>'.
"\n";
1804$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1805$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 warehouses.
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.