35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
50$langs->loadLangs(array(
"categories",
"compta"));
52$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'categorylist';
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
63$label =
GETPOST(
'label',
'alpha');
67if (
GETPOST(
'addintocategory')) {
68 $action =
'addintocategory';
74$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
75$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
77if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
80$offset = $limit * $page;
84if ($id ==
"" && $label ==
"") {
90$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
96$result =
$object->fetch($id, $label);
103if (is_numeric($type)) {
104 $type = Categorie::$MAP_ID_TO_CODE[(int) $type];
108$extrafields->fetch_name_optionals_label(
$object->table_element);
114if ($confirm ==
'no') {
116 header(
"Location: ".$backtopage);
120$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
121$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
123if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
126 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
127 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
129 $result = $tmpobject->fetch($removeelem);
130 $elementtype =
'product';
131 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
133 $result = $tmpobject->fetch($removeelem);
134 $elementtype =
'supplier';
135 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
137 $result = $tmpobject->fetch($removeelem);
138 $elementtype =
'customer';
139 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
140 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
142 $result = $tmpobject->fetch($removeelem);
143 $elementtype =
'member';
144 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
145 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
147 $result = $tmpobject->fetch($removeelem);
148 $elementtype =
'contact';
149 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
150 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
152 $result = $tmpobject->fetch($removeelem);
153 $elementtype =
'account';
154 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
155 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
157 $result = $tmpobject->fetch($removeelem);
158 $elementtype =
'project';
159 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
160 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
161 $tmpobject =
new User($db);
162 $result = $tmpobject->fetch($removeelem);
163 $elementtype =
'user';
164 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
165 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
166 $tmpobject =
new Ticket($db);
167 $result = $tmpobject->fetch($removeelem);
168 $elementtype =
'ticket';
169 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
170 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
172 $result = $tmpobject->fetch($removeelem);
173 $elementtype =
'fichinter';
178 $result =
$object->del_type($tmpobject, $elementtype);
184if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
185 if (
$object->delete($user) >= 0) {
187 header(
"Location: ".$backtopage);
190 header(
"Location: ".DOL_URL_ROOT.
'/categories/index.php?type='.$type);
198if ($elemid && $action ==
'addintocategory') {
201 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
202 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
204 $elementtype =
'product';
205 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
206 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
208 $elementtype =
'customer';
209 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
210 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
212 $elementtype =
'supplier';
213 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
214 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
215 $newobject =
new Ticket($db);
216 $elementtype =
'ticket';
217 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
218 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
220 $elementtype =
'fichinter';
221 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
222 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
224 $elementtype =
'project';
225 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
226 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
228 $elementtype =
'member';
229 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
230 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
232 $elementtype =
'contact';
233 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
234 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
235 $newobject =
new User($db);
236 $elementtype =
'user';
237 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
238 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
240 $elementtype =
'bank_account';
244 if ($newobject !==
null) {
245 $result = $newobject->fetch($elemid);
249 $result =
$object->add_type($newobject, $elementtype);
251 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
253 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
254 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
266$form =
new Form($db);
270 '/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
271 '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
273$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
277llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
279$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
284$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type));
285$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
288$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
289$ways =
$object->print_all_ways(
" >> ",
'', 1);
290foreach ($ways as $way) {
291 $morehtmlref .= $way.
"<br>\n";
293$morehtmlref .=
'</div>';
295dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
299if ($action ==
'delete') {
301 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.$type.
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
303 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.$type, $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
309print
'<div class="fichecenter">';
310print
'<div class="underbanner clearboth"></div>';
311print
'<table class="border centpercent tableforfield">';
314print
'<tr><td class="titlefield notopnoleft tdtop">';
315print $langs->trans(
"Description").
'</td><td>';
320print
'<tr><td class="notopnoleft">';
321print $langs->trans(
"Color").
'</td><td>';
322print $formother->showColor(
$object->color);
326print
'<tr><td class="titlefield notopnoleft">';
327print $langs->trans(
"Position").
'</td><td>';
332include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
344print
"<div class='tabsAction'>\n";
345$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
349if (empty($reshook)) {
350 if ($user->hasRight(
'categorie',
'creer')) {
351 $socid = (
$object->socid ?
"&socid=".$object->socid :
"");
352 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.$type.
'">'.$langs->trans(
"Modify").
'</a>';
355 if ($user->hasRight(
'categorie',
'supprimer')) {
356 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'&type='.$type.
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
363if ($user->hasRight(
'categorie',
'creer')) {
364 $link = DOL_URL_ROOT.
'/categories/card.php';
365 $link .=
'?action=create';
366 $link .=
'&type='.$type;
367 $link .=
'&catorigin='.$object->id;
368 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
370 $newcardbutton =
'<div class="right">';
371 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
372 $newcardbutton .=
'</div>';
380print
'<div class="fichecenter">';
382print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
384print
'<table class="liste nohover noborder centpercent borderbottom">';
386print
'<tr class="liste_titre">';
387print
'<td>'.$langs->trans(
"SubCats").
'</td>';
389print
'<td class="right">';
391if (!empty(
$conf->use_javascript_ajax)) {
392 print
'<div id="iddivjstreecontrol">';
393 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
395 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
405} elseif (count($cats) < 1) {
406 print
'<tr class="oddeven nobottom">';
407 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
412 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
416 if ($type == Categorie::TYPE_MEMBER) {
417 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
419 if ($type == Categorie::TYPE_ACCOUNT) {
420 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
422 if ($type == Categorie::TYPE_PROJECT) {
423 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
425 if ($type == Categorie::TYPE_USER) {
426 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
432 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
433 foreach ($fulltree as $key => $val) {
434 $categstatic->id = $val[
'id'];
435 $categstatic->ref = $val[
'label'];
436 $categstatic->color = $val[
'color'];
437 $categstatic->type = $type;
443 $elements = $categstatic->getObjectsInCateg($type, 1);
445 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
448 if ($categstatic->color) {
449 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
451 $stylecolor =
' style="background: #bbb;"';
453 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
455 $entry =
'<table class="nobordernopadding centpercent">';
459 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
464 $entry .=
'<td class="right" width="20px;">';
465 $entry .=
'<a href="'.DOL_URL_ROOT.
'/categories/viewcat.php?id='.$val[
'id'].
'&type='.$type.
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.$type).
'">'.
img_view().
'</a>';
467 $entry .=
'<td class="right" width="20px;">';
468 $entry .=
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/categories/edit.php?id='.$val[
'id'].
'&type='.$type.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.$type).
'">'.
img_edit().
'</a>';
470 $entry .=
'<td class="right" width="20px;">';
471 $entry .=
'<a class="deletefilelink" href="'.DOL_URL_ROOT.
'/categories/viewcat.php?action=delete&token='.
newToken().
'&id='.$val[
'id'].
'&type='.$type.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.$type).
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.$type).
'">'.
img_delete().
'</a>';
475 $entry .=
'</table>';
477 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
480 $nbofentries = (count($data) - 1);
481 if ($nbofentries > 0) {
482 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
483 print
'<tr class="pair">';
484 print
'<td colspan="3">';
492 print
'<tr class="pair">';
493 print
'<td colspan="3">';
494 print
'<table class="nobordernopadding">';
496 print
'<tr class="nobordernopadding">';
497 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
498 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
499 print
'<td> </td>';
512$arrayofmassactions = array(
518$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
524if ($type == Categorie::TYPE_PRODUCT) {
525 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
526 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
527 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
529 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset);
534 '@phan-var-force Product[] $prods';
536 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
537 print
'<input type="hidden" name="token" value="'.newToken().
'">';
538 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
539 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
540 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
541 print
'<input type="hidden" name="page_y" value="">';
542 print
'<input type="hidden" name="action" value="list">';
545 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
546 $num = count($prods);
547 $nbtotalofrecords =
'';
548 $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'));
551 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
553 if ($showclassifyform) {
554 print
'<table class="noborder centpercent">';
555 print
'<tr class="liste_titre"><td>';
556 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
557 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
558 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
563 print
'<table class="noborder centpercent">'.
"\n";
564 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
566 if (count($prods) > 0) {
568 foreach ($prods as $prod) {
574 print
"\t".
'<tr class="oddeven">'.
"\n";
575 print
'<td class="nowrap" valign="top">';
576 print $prod->getNomUrl(1);
578 print
'<td class="tdtop">'.$prod->label.
"</td>\n";
580 print
'<td class="right">';
582 print
'<a class="reposition" href= "'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".((
int)
$object->id).
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".$prod->id.
'">';
584 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
591 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
595 print
'</form>'.
"\n";
598 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
604if ($type == Categorie::TYPE_CUSTOMER) {
605 if ($user->hasRight(
"societe",
"read")) {
606 $permission = $user->hasRight(
'societe',
'creer');
607 $showclassifyform = $user->hasRight(
'societe',
'creer');
609 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset);
614 '@phan-var-force Societe[] $socs';
616 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
617 print
'<input type="hidden" name="token" value="'.newToken().
'">';
618 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
619 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
620 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
621 print
'<input type="hidden" name="action" value="list">';
622 print
'<input type="hidden" name="page_y" value="">';
625 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
627 $nbtotalofrecords =
'';
628 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddThirdParty"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/societe/card.php?action=create&client=3&custcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
631 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
633 if ($showclassifyform) {
634 print
'<table class="noborder centpercent">';
635 print
'<tr class="liste_titre"><td>';
636 print $langs->trans(
"AddCustomerIntoCategory").
' ';
637 $filter =
'(s.client:IN:1,2,3)';
638 print $form->select_company(
'',
'elemid', $filter);
639 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
644 print
'<table class="noborder centpercent">'.
"\n";
645 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
647 if (count($socs) > 0) {
649 foreach ($socs as $key => $soc) {
655 print
"\t".
'<tr class="oddeven">'.
"\n";
656 print
'<td class="nowrap tdtop tdoverflowmax250">';
657 print $soc->getNomUrl(1);
660 print
'<td class="right">';
662 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.
"'>";
664 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
671 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
675 print
'</form>'.
"\n";
678 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
684if ($type == Categorie::TYPE_SUPPLIER) {
685 if ($user->hasRight(
"fournisseur",
"read")) {
686 $permission = $user->hasRight(
'societe',
'creer');
687 $showclassifyform = $user->hasRight(
'societe',
'creer');
689 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset);
695 '@phan-var-force Fournisseur[] $socs';
697 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
698 print
'<input type="hidden" name="token" value="'.newToken().
'">';
699 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
700 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
701 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
702 print
'<input type="hidden" name="page_y" value="">';
703 print
'<input type="hidden" name="action" value="list">';
706 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
708 $nbtotalofrecords =
'';
709 $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'));
712 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
714 if ($showclassifyform) {
715 print
'<table class="noborder centpercent">';
716 print
'<tr class="liste_titre"><td>';
717 print $langs->trans(
"AddSupplierIntoCategory").
' ';
718 $filter =
'(s.fournisseur:=:1)';
719 print $form->select_company(
'',
'elemid', $filter);
720 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
725 print
'<table class="noborder centpercent">'.
"\n";
726 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
728 if (count($socs) > 0) {
730 foreach ($socs as $soc) {
736 print
"\t".
'<tr class="oddeven">'.
"\n";
737 print
'<td class="nowrap tdtop">';
738 print $soc->getNomUrl(1);
741 print
'<td class="right">';
743 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.($limit ?
'&limit='.$limit :
'').
'">';
745 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
753 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
757 print
'</form>'.
"\n";
760 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
766if ($type == Categorie::TYPE_MEMBER) {
767 if ($user->hasRight(
"adherent",
"read")) {
768 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
770 $permission = $user->hasRight(
'adherent',
'creer');
771 $showclassifyform = $user->hasRight(
'adherent',
'creer');
773 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset);
778 '@phan-var-force Adherent[] $members';
780 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
781 print
'<input type="hidden" name="token" value="'.newToken().
'">';
782 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
783 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
784 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
785 print
'<input type="hidden" name="page_y" value="">';
786 print
'<input type="hidden" name="action" value="list">';
789 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
790 $num = count($members);
791 $nbtotalofrecords =
'';
792 $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'));
795 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
797 if ($showclassifyform) {
798 print
'<table class="noborder centpercent">';
799 print
'<tr class="liste_titre"><td>';
800 print $langs->trans(
"AssignCategoryTo").
' ';
801 print $form->selectMembers(
'',
'elemid');
802 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
807 print
'<table class="noborder centpercent">'.
"\n";
808 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
810 if (count($members) > 0) {
812 foreach ($members as $key => $member) {
818 print
"\t".
'<tr class="oddeven">'.
"\n";
819 print
'<td class="nowrap tdtop">';
820 $member->ref = $member->login;
821 print $member->getNomUrl(1, 0);
823 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
824 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
826 print
'<td class="right">';
828 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$member->id.
"'>";
830 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
837 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
841 print
'</form>'.
"\n";
844 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
850if ($type == Categorie::TYPE_CONTACT) {
851 if ($user->hasRight(
"societe",
"read")) {
852 $permission = $user->hasRight(
'societe',
'creer');
853 $showclassifyform = $user->hasRight(
'societe',
'creer');
855 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
856 if (is_numeric($contacts) && $contacts < 0) {
860 '@phan-var-force Contact[] $contacts';
862 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
863 print
'<input type="hidden" name="token" value="'.newToken().
'">';
864 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
865 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
866 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
867 print
'<input type="hidden" name="page_y" value="">';
868 print
'<input type="hidden" name="action" value="list">';
871 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
872 $num = count($contacts);
873 $nbtotalofrecords =
'';
874 $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'));
879 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
881 if ($showclassifyform) {
882 print
'<table class="noborder centpercent">';
883 print
'<tr class="liste_titre"><td>';
884 print $langs->trans(
"AssignCategoryTo").
' ';
885 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
886 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
891 print
'<table class="noborder centpercent">'.
"\n";
892 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
894 if (is_array($contacts) && count($contacts) > 0) {
896 foreach ($contacts as $key => $contact) {
902 print
"\t".
'<tr class="oddeven">'.
"\n";
903 print
'<td class="nowrap tdtop">';
904 print $contact->getNomUrl(1,
'category');
905 if ($contact->socid > 0) {
906 $objsoc->fetch($contact->socid);
908 print $objsoc->getNomUrl(1,
'contact');
912 print
'<td class="right">';
914 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$contact->id.
"'>";
916 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
923 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
927 print
'</form>'.
"\n";
930 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
936if ($type == Categorie::TYPE_ACCOUNT) {
937 if ($user->hasRight(
"banque",
"read")) {
938 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
940 $permission = $user->hasRight(
'banque',
'creer');
941 $showclassifyform = $user->hasRight(
'banque',
'creer');
943 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
948 '@phan-var-force Account[] $accounts';
950 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
951 print
'<input type="hidden" name="token" value="'.newToken().
'">';
952 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
953 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
954 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
955 print
'<input type="hidden" name="page_y" value="">';
956 print
'<input type="hidden" name="action" value="list">';
959 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
960 $num = count($accounts);
961 $nbtotalofrecords =
'';
965 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
967 if ($showclassifyform) {
968 print
'<table class="noborder centpercent">';
969 print
'<tr class="liste_titre"><td>';
970 print $langs->trans(
"AddObjectIntoCategory").
' ';
971 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
972 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
977 print
'<table class="noborder centpercent">'.
"\n";
978 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
980 if (count($accounts) > 0) {
982 foreach ($accounts as $key => $account) {
988 print
"\t".
'<tr class="oddeven">'.
"\n";
989 print
'<td class="nowrap tdtop">';
990 print $account->getNomUrl(1, 0);
992 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
993 print
'<td class="tdtop">'.$account->number.
"</td>\n";
995 print
'<td class="right">';
997 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$account->id.
"'>";
999 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1006 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1010 print
'</form>'.
"\n";
1013 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1019if ($type == Categorie::TYPE_PROJECT) {
1020 if ($user->hasRight(
"project",
"read")) {
1021 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1023 $permission = $user->hasRight(
'projet',
'creer');
1024 $showclassifyform = $user->hasRight(
'projet',
'creer');
1026 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1031 '@phan-var-force Project $object';
1033 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1034 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1035 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1036 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1037 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1038 print
'<input type="hidden" name="page_y" value="">';
1039 print
'<input type="hidden" name="action" value="list">';
1042 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1043 $num = count($objects);
1044 $nbtotalofrecords =
'';
1045 $newcardbutton =
'';
1048 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1050 if ($showclassifyform) {
1051 print
'<table class="noborder centpercent">';
1052 print
'<tr class="liste_titre"><td>';
1053 print $langs->trans(
"AddObjectIntoCategory").
' ';
1054 $form->selectProjects(
'',
'elemid');
1055 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1060 print
'<table class="noborder centpercent">'.
"\n";
1061 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1063 if (count($objects) > 0) {
1065 foreach ($objects as $key => $project) {
1071 print
"\t".
'<tr class="oddeven">'.
"\n";
1072 print
'<td class="nowrap tdtop">';
1073 print $project->getNomUrl(1);
1075 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1077 print
'<td class="right">';
1079 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$project->id.
"'>";
1081 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1088 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1092 print
'</form>'.
"\n";
1095 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1101if ($type == Categorie::TYPE_USER) {
1102 if ($user->hasRight(
"user",
"user",
"read")) {
1103 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1104 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1106 $users =
$object->getObjectsInCateg($type);
1111 '@phan-var-force User[] $users';
1113 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1114 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1115 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1116 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1117 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1118 print
'<input type="hidden" name="page_y" value="">';
1119 print
'<input type="hidden" name="action" value="list">';
1123 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1124 $num = count($users);
1125 $nbtotalofrecords =
'';
1126 $newcardbutton =
'';
1129 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1131 if ($showclassifyform) {
1132 print
'<table class="noborder centpercent">';
1133 print
'<tr class="liste_titre"><td>';
1135 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1136 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1137 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1142 print
'<table class="noborder centpercent">'.
"\n";
1143 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1145 if (count($users) > 0) {
1147 foreach ($users as $key => $userentry) {
1148 print
"\t".
'<tr class="oddeven">'.
"\n";
1149 print
'<td class="nowrap tdtop">';
1150 print $userentry->getNomUrl(-1);
1152 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1155 print
'<td class="right">';
1156 if ($user->hasRight(
'user',
'user',
'creer')) {
1157 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$userentry->id.
"'>";
1159 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1166 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1170 print
'</form>'.
"\n";
1173 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1179if ($type == Categorie::TYPE_WAREHOUSE) {
1180 if ($user->hasRight(
"stock",
"read")) {
1181 $permission = $user->hasRight(
'stock',
'creer');
1183 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1185 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1190 '@phan-var-force Entrepot[] $objects';
1191 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1192 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1193 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1194 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1195 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1196 print
'<input type="hidden" name="page_y" value="">';
1197 print
'<input type="hidden" name="action" value="list">';
1200 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1201 $num = count($objects);
1202 $nbtotalofrecords =
'';
1203 $newcardbutton =
'';
1206 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1208 print
'<table class="noborder centpercent">'.
"\n";
1209 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1211 if (count($objects) > 0) {
1213 foreach ($objects as $key => $warehouse) {
1219 print
"\t".
'<tr class="oddeven">'.
"\n";
1220 print
'<td class="nowrap tdtop">';
1221 print $warehouse->getNomUrl(1);
1223 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1224 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1226 print
'<td class="right">';
1228 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$warehouse->id.
"'>";
1230 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1237 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1241 print
'</form>'.
"\n";
1244 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1250if ($type == Categorie::TYPE_TICKET) {
1251 if ($user->hasRight(
"ticket",
"read")) {
1252 $permission = $user->hasRight(
'categorie',
'creer');
1253 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1255 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1260 '@phan-var-force Ticket[] $tickets';
1262 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1263 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1264 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1265 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1266 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1267 print
'<input type="hidden" name="page_y" value="">';
1268 print
'<input type="hidden" name="action" value="list">';
1271 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1272 $num = count($tickets);
1273 $nbtotalofrecords =
'';
1274 $newcardbutton =
'';
1277 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1279 if ($showclassifyform) {
1280 print
'<table class="noborder centpercent">';
1281 print
'<tr class="liste_titre"><td>';
1282 print $langs->trans(
"AddTicketIntoCategory").
' ';
1283 $form->selectTickets(
'',
'elemid');
1284 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1289 print
'<table class="noborder centpercent">'.
"\n";
1290 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1292 if (count($tickets) > 0) {
1294 foreach ($tickets as $ticket) {
1300 print
"\t".
'<tr class="oddeven">'.
"\n";
1301 print
'<td class="nowrap tdtop">';
1302 print $ticket->getNomUrl(1);
1304 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1306 print
'<td class="right">';
1308 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$ticket->id.
"'>";
1310 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1317 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1321 print
'</form>'.
"\n";
1324 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1330if ($type == Categorie::TYPE_FICHINTER) {
1331 if ($user->hasRight(
"fichinter",
"lire")) {
1332 $permission = $user->hasRight(
'categorie',
'creer');
1333 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1335 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1336 if ($fichinters < 0) {
1340 if ($showclassifyform) {
1341 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formintervention.class.php';
1345 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1346 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1347 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1348 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1349 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1350 print
'<input type="hidden" name="action" value="addintocategory">';
1351 print
'<table class="noborder centpercent">';
1352 print
'<tr class="liste_titre"><td>';
1353 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1354 print $formfichinter->select_interventions(-1, 0,
'elemid');
1355 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1361 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1362 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1363 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1364 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1365 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1366 print
'<input type="hidden" name="action" value="list">';
1369 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1370 $num = count($fichinters);
1371 $nbtotalofrecords =
'';
1372 $newcardbutton =
'';
1374 $langs->load(
'interventions');
1376 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1377 print
'<table class="noborder centpercent">'.
"\n";
1378 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1380 if (count($fichinters) > 0) {
1382 foreach ($fichinters as $fichinter) {
1384 if ($i > $limit)
break;
1386 print
"\t".
'<tr class="oddeven">'.
"\n";
1387 print
'<td class="nowrap tdtop">';
1388 print $fichinter->getNomUrl(1);
1390 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1392 print
'<td class="right">';
1394 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$fichinter->id.
"'>";
1395 print $langs->trans(
"DeleteFromCat");
1396 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1403 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1406 print
'</form>'.
"\n";
1409 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1415$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1416$reshook = $hookmanager->executeHooks(
'addMoreCategoriesList', $parameters, $object, $action);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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 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_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
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.