31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38$langs->loadLangs(array(
"categories",
"compta"));
41$label =
GETPOST(
'label',
'alpha');
42$removeelem =
GETPOST(
'removeelem',
'int');
43$elemid =
GETPOST(
'elemid',
'int');
45$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
46$massaction =
GETPOST(
'massaction',
'alpha');
47$show_files =
GETPOST(
'show_files',
'int');
48$confirm =
GETPOST(
'confirm',
'alpha');
49$cancel =
GETPOST(
'cancel',
'alpha');
50$toselect =
GETPOST(
'toselect',
'array');
51$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'categorylist';
52$backtopage =
GETPOST(
'backtopage',
'alpha');
53$optioncss =
GETPOST(
'optioncss',
'aZ');
57$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
58$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
59$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
60$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
61if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
64$offset = $limit * $page;
68if ($id ==
"" && $label ==
"") {
77$result = $object->fetch($id, $label);
83if (is_numeric($type)) {
84 $type = Categorie::$MAP_ID_TO_CODE[$type];
88$extrafields->fetch_name_optionals_label($object->table_element);
91$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
97if ($confirm ==
'no') {
99 header(
"Location: ".$backtopage);
104$parameters = array();
105$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
107if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
108 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
109 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
111 $result = $tmpobject->fetch($removeelem);
112 $elementtype =
'product';
113 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
115 $result = $tmpobject->fetch($removeelem);
116 $elementtype =
'supplier';
117 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
119 $result = $tmpobject->fetch($removeelem);
120 $elementtype =
'customer';
121 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
122 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
124 $result = $tmpobject->fetch($removeelem);
125 $elementtype =
'member';
126 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
127 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
129 $result = $tmpobject->fetch($removeelem);
130 $elementtype =
'contact';
131 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer) {
132 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
134 $result = $tmpobject->fetch($removeelem);
135 $elementtype =
'account';
136 } elseif ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) {
137 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
139 $result = $tmpobject->fetch($removeelem);
140 $elementtype =
'project';
141 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
142 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
143 $tmpobject =
new User($db);
144 $result = $tmpobject->fetch($removeelem);
145 $elementtype =
'user';
146 } elseif ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) {
147 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
148 $tmpobject =
new Ticket($db);
149 $result = $tmpobject->fetch($removeelem);
150 $elementtype =
'ticket';
153 $result = $object->del_type($tmpobject, $elementtype);
159if ($user->rights->categorie->supprimer && $action ==
'confirm_delete' && $confirm ==
'yes') {
160 if ($object->delete($user) >= 0) {
162 header(
"Location: ".$backtopage);
165 header(
"Location: ".DOL_URL_ROOT.
'/categories/index.php?type='.$type);
173if ($elemid && $action ==
'addintocategory' &&
174 (($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) ||
175 ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) ||
176 ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) ||
177 ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) ||
178 ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) ||
179 ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) ||
180 ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) ||
181 ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) ||
182 ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
184 if ($type == Categorie::TYPE_PRODUCT) {
185 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
187 $elementtype =
'product';
188 } elseif ($type == Categorie::TYPE_CUSTOMER) {
189 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
191 $elementtype =
'customer';
192 } elseif ($type == Categorie::TYPE_SUPPLIER) {
193 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
195 $elementtype =
'supplier';
196 } elseif ($type == Categorie::TYPE_TICKET) {
197 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
198 $newobject =
new Ticket($db);
199 $elementtype =
'ticket';
200 } elseif ($type == Categorie::TYPE_PROJECT) {
201 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
203 $elementtype =
'project';
204 } elseif ($type == Categorie::TYPE_MEMBER) {
205 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
207 $elementtype =
'member';
208 } elseif ($type == Categorie::TYPE_CONTACT) {
209 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
211 $elementtype =
'contact';
212 } elseif ($type == Categorie::TYPE_USER) {
213 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
214 $newobject =
new User($db);
215 $elementtype =
'user';
216 } elseif ($type == Categorie::TYPE_ACCOUNT) {
217 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
219 $elementtype =
'bank_account';
223 $result = $newobject->fetch($elemid);
226 $result = $object->add_type($newobject, $elementtype);
228 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
230 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
231 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
243$form =
new Form($db);
246$arrayofjs = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
'/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
247$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
251llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
253$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
258$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type));
259$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
260$object->next_prev_filter =
'type = '.((int) $object->type);
261$object->ref = $object->label;
262$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
263$ways = $object->print_all_ways(
" >> ",
'', 1);
264foreach ($ways as $way) {
265 $morehtmlref .= $way.
"<br>\n";
267$morehtmlref .=
'</div>';
269dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
276if ($action ==
'delete') {
278 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&type='.$type.
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
280 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&type='.$type, $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
286print
'<div class="fichecenter">';
287print
'<div class="underbanner clearboth"></div>';
288print
'<table class="border centpercent tableforfield">';
291print
'<tr><td class="titlefield notopnoleft tdtop">';
292print $langs->trans(
"Description").
'</td><td>';
297print
'<tr><td class="notopnoleft">';
298print $langs->trans(
"Color").
'</td><td>';
299print $formother->showColor($object->color);
303include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
315print
"<div class='tabsAction'>\n";
316$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
320if (empty($reshook)) {
321 if ($user->rights->categorie->creer) {
322 $socid = ($object->socid ?
"&socid=".$object->socid :
"");
323 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.$type.
'">'.$langs->trans(
"Modify").
'</a>';
326 if ($user->rights->categorie->supprimer) {
327 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id.
'&type='.$type.
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
334if (!empty($user->rights->categorie->creer)) {
335 $link = DOL_URL_ROOT.
'/categories/card.php';
336 $link .=
'?action=create';
337 $link .=
'&type='.$type;
338 $link .=
'&catorigin='.$object->id;
339 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
341 $newcardbutton =
'<div class="right">';
342 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
343 $newcardbutton .=
'</div>';
351print
'<div class="fichecenter">';
353print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
356print
'<table class="liste nohover centpercent borderbottom">';
358print
'<tr class="liste_titre">';
359print
'<td>'.$langs->trans(
"SubCats").
'</td>';
361print
'<td class="right">';
363if (!empty($conf->use_javascript_ajax)) {
364 print
'<div id="iddivjstreecontrol">';
365 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
367 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
374$cats = $object->get_filles();
377} elseif (count($cats) < 1) {
378 print
'<tr class="oddeven nobottom">';
379 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
384 $fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
388 if ($type == Categorie::TYPE_MEMBER) {
389 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
391 if ($type == Categorie::TYPE_ACCOUNT) {
392 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
394 if ($type == Categorie::TYPE_PROJECT) {
395 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
397 if ($type == Categorie::TYPE_USER) {
398 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
404 $data[] = array(
'rowid'=>0,
'fk_menu'=>-1,
'title'=>
"racine",
'mainmenu'=>
'',
'leftmenu'=>
'',
'fk_mainmenu'=>
'',
'fk_leftmenu'=>
'');
405 foreach ($fulltree as $key => $val) {
406 $categstatic->id = $val[
'id'];
407 $categstatic->ref = $val[
'label'];
408 $categstatic->color = $val[
'color'];
409 $categstatic->type = $type;
415 $elements = $categstatic->getObjectsInCateg($type, 1);
417 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
420 $color = $categstatic->color ?
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"' :
' style="background: #bbb"';
421 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$id.
'&type='.$type));
423 $entry =
'<table class="nobordernopadding centpercent">';
427 $entry .=
'<span class="noborderoncategories" '.$color.
'>'.$li.
'</span>';
432 $entry .=
'<td class="right" width="20px;">';
433 $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>';
435 $entry .=
'<td class="right" width="20px;">';
436 $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>';
438 $entry .=
'<td class="right" width="20px;">';
439 $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>';
443 $entry .=
'</table>';
445 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
448 $nbofentries = (count($data) - 1);
449 if ($nbofentries > 0) {
450 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
451 print
'<tr class="pair">';
452 print
'<td colspan="3">';
460 print
'<tr class="pair">';
461 print
'<td colspan="3">';
462 print
'<table class="nobordernopadding">';
464 print
'<tr class="nobordernopadding">';
465 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
466 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
467 print
'<td> </td>';
480$arrayofmassactions = array(
486$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
492if ($type == Categorie::TYPE_PRODUCT) {
493 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
494 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
496 $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
501 $showclassifyform = 1;
502 if ($showclassifyform) {
504 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
505 print
'<input type="hidden" name="token" value="'.newToken().
'">';
506 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
507 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
508 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
509 print
'<input type="hidden" name="action" value="addintocategory">';
510 print
'<table class="noborder centpercent">';
511 print
'<tr class="liste_titre"><td>';
512 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
513 $form->select_produits(
'',
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
514 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
520 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
521 print
'<input type="hidden" name="token" value="'.newToken().
'">';
522 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
523 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
524 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
525 print
'<input type="hidden" name="action" value="list">';
528 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
529 $num = count($prods);
530 $nbtotalofrecords =
'';
531 $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->rights->societe->creer);
533 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
536 print
'<table class="noborder centpercent">'.
"\n";
537 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
539 if (count($prods) > 0) {
541 foreach ($prods as $prod) {
547 print
"\t".
'<tr class="oddeven">'.
"\n";
548 print
'<td class="nowrap" valign="top">';
549 print $prod->getNomUrl(1);
551 print
'<td class="tdtop">'.$prod->label.
"</td>\n";
553 print
'<td class="right">';
555 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$prod->id.
"'>";
556 print $langs->trans(
"DeleteFromCat");
557 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
564 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
568 print
'</form>'.
"\n";
571 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'products');
577if ($type == Categorie::TYPE_CUSTOMER) {
578 if ($user->hasRight(
"societe",
"read")) {
579 $permission = $user->hasRight(
'societe',
'creer');
581 $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
586 $showclassifyform = 1;
587 if ($showclassifyform) {
589 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
590 print
'<input type="hidden" name="token" value="'.newToken().
'">';
591 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
592 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
593 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
594 print
'<input type="hidden" name="action" value="addintocategory">';
595 print
'<table class="noborder centpercent">';
596 print
'<tr class="liste_titre"><td>';
597 print $langs->trans(
"AddCustomerIntoCategory").
' ';
598 $filter =
'(s.client:IN:1,3)';
599 print $form->select_company(
'',
'elemid', $filter);
600 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
606 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
607 print
'<input type="hidden" name="token" value="'.newToken().
'">';
608 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
609 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
610 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
611 print
'<input type="hidden" name="action" value="list">';
614 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
616 $nbtotalofrecords =
'';
617 $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->rights->societe->creer);
619 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
621 print
'<table class="noborder centpercent">'.
"\n";
622 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
624 if (count($socs) > 0) {
626 foreach ($socs as $key => $soc) {
632 print
"\t".
'<tr class="oddeven">'.
"\n";
633 print
'<td class="nowrap tdtop">';
634 print $soc->getNomUrl(1);
637 print
'<td class="right">';
639 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$soc->id.
"'>";
640 print $langs->trans(
"DeleteFromCat");
641 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
648 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
652 print
'</form>'.
"\n";
655 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
661if ($type == Categorie::TYPE_SUPPLIER) {
662 if ($user->hasRight(
"fournisseur",
"read")) {
663 $permission = $user->hasRight(
'societe',
'creer');
665 $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
670 $showclassifyform = 1;
671 if ($showclassifyform) {
673 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
674 print
'<input type="hidden" name="token" value="'.newToken().
'">';
675 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
676 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
677 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
678 print
'<input type="hidden" name="action" value="addintocategory">';
679 print
'<table class="noborder centpercent">';
680 print
'<tr class="liste_titre"><td>';
681 print $langs->trans(
"AddSupplierIntoCategory").
' ';
682 $filter =
'(s.fournisseur:=:1)';
683 print $form->select_company(
'',
'elemid', $filter);
684 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
690 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
691 print
'<input type="hidden" name="token" value="'.newToken().
'">';
692 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
693 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
694 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
695 print
'<input type="hidden" name="action" value="list">';
698 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
700 $nbtotalofrecords =
'';
701 $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->rights->societe->creer);
703 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
705 print
'<table class="noborder centpercent">'.
"\n";
706 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
708 if (count($socs) > 0) {
710 foreach ($socs as $soc) {
716 print
"\t".
'<tr class="oddeven">'.
"\n";
717 print
'<td class="nowrap tdtop">';
718 print $soc->getNomUrl(1);
721 print
'<td class="right">';
723 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$soc->id.
"'>";
724 print $langs->trans(
"DeleteFromCat");
725 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
733 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
737 print
'</form>'.
"\n";
740 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
746if ($type == Categorie::TYPE_MEMBER) {
747 if ($user->hasRight(
"adherent",
"read")) {
748 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
750 $permission = $user->hasRight(
'adherent',
'creer');
752 $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
757 $showclassifyform = 1;
758 if ($showclassifyform) {
760 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
761 print
'<input type="hidden" name="token" value="'.newToken().
'">';
762 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
763 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
764 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
765 print
'<input type="hidden" name="action" value="addintocategory">';
766 print
'<table class="noborder centpercent">';
767 print
'<tr class="liste_titre"><td>';
768 print $langs->trans(
"AssignCategoryTo").
' ';
769 print $form->selectMembers(
'',
'elemid');
770 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
776 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
777 print
'<input type="hidden" name="token" value="'.newToken().
'">';
778 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
779 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
780 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
781 print
'<input type="hidden" name="action" value="list">';
784 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
785 $num = count($prods);
786 $nbtotalofrecords =
'';
787 $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'));
789 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
791 print
'<table class="noborder centpecent">'.
"\n";
792 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
794 if (count($prods) > 0) {
796 foreach ($prods as $key => $member) {
802 print
"\t".
'<tr class="oddeven">'.
"\n";
803 print
'<td class="nowrap tdtop">';
804 $member->ref = $member->login;
805 print $member->getNomUrl(1, 0);
807 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
808 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
810 print
'<td class="right">';
812 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$member->id.
"'>";
813 print $langs->trans(
"DeleteFromCat");
814 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
821 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
825 print
'</form>'.
"\n";
828 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'members');
834if ($type == Categorie::TYPE_CONTACT) {
835 if ($user->hasRight(
"societe",
"read")) {
836 $permission = $user->hasRight(
'societe',
'creer');
838 $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
839 if (is_numeric($contacts) && $contacts < 0) {
843 $showclassifyform = 1;
844 if ($showclassifyform) {
846 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
847 print
'<input type="hidden" name="token" value="'.newToken().
'">';
848 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
849 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
850 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
851 print
'<input type="hidden" name="action" value="addintocategory">';
852 print
'<table class="noborder centpercent">';
853 print
'<tr class="liste_titre"><td>';
854 print $langs->trans(
"AssignCategoryTo").
' ';
855 print $form->selectContacts(
'',
'',
'elemid');
856 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
861 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
862 print
'<input type="hidden" name="token" value="'.newToken().
'">';
863 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
864 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
865 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
866 print
'<input type="hidden" name="action" value="list">';
869 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
870 $num = count($contacts);
871 $nbtotalofrecords =
'';
872 $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->rights->societe->creer);
874 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
878 print
'<table class="noborder centpercent">'.
"\n";
879 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
881 if (is_array($contacts) && count($contacts) > 0) {
883 foreach ($contacts as $key => $contact) {
889 print
"\t".
'<tr class="oddeven">'.
"\n";
890 print
'<td class="nowrap tdtop">';
891 print $contact->getNomUrl(1,
'category');
892 if ($contact->socid > 0) {
893 $objsoc->fetch($contact->socid);
895 print $objsoc->getNomUrl(1,
'contact');
899 print
'<td class="right">';
901 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$contact->id.
"'>";
902 print $langs->trans(
"DeleteFromCat");
903 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
910 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
914 print
'</form>'.
"\n";
917 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'contact');
923if ($type == Categorie::TYPE_ACCOUNT) {
924 if ($user->hasRight(
"banque",
"read")) {
925 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
927 $permission = $user->hasRight(
'banque',
'creer');
929 $accounts = $object->getObjectsInCateg($type, 0, $limit, $offset);
934 $showclassifyform = 1;
935 if ($showclassifyform) {
937 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
938 print
'<input type="hidden" name="token" value="'.newToken().
'">';
939 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
940 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
941 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
942 print
'<input type="hidden" name="action" value="addintocategory">';
943 print
'<table class="noborder centpercent">';
944 print
'<tr class="liste_titre"><td>';
945 print $langs->trans(
"AddObjectIntoCategory").
' ';
946 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
947 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
953 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
954 print
'<input type="hidden" name="token" value="'.newToken().
'">';
955 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
956 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
957 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
958 print
'<input type="hidden" name="action" value="list">';
961 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
962 $num = count($accounts);
963 $nbtotalofrecords =
'';
966 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
968 print
'<table class="noborder centpecent">'.
"\n";
969 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
971 if (count($accounts) > 0) {
973 foreach ($accounts as $key => $account) {
979 print
"\t".
'<tr class="oddeven">'.
"\n";
980 print
'<td class="nowrap tdtop">';
981 print $account->getNomUrl(1, 0);
983 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
984 print
'<td class="tdtop">'.$account->number.
"</td>\n";
986 print
'<td class="right">';
988 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$account->id.
"'>";
989 print $langs->trans(
"DeleteFromCat");
990 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
997 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1001 print
'</form>'.
"\n";
1004 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'bank');
1010if ($type == Categorie::TYPE_PROJECT) {
1011 if ($user->hasRight(
"project",
"read")) {
1012 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1014 $permission = $user->rights->projet->creer;
1016 $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
1021 $showclassifyform = 1;
1022 if ($showclassifyform) {
1024 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1025 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1026 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1027 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1028 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1029 print
'<input type="hidden" name="action" value="addintocategory">';
1030 print
'<table class="noborder centpercent">';
1031 print
'<tr class="liste_titre"><td>';
1032 print $langs->trans(
"AddObjectIntoCategory").
' ';
1033 $form->selectProjects(
'',
'elemid');
1034 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1040 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1041 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1042 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1043 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1044 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1045 print
'<input type="hidden" name="action" value="list">';
1048 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1049 $num = count($objects);
1050 $nbtotalofrecords =
'';
1051 $newcardbutton =
'';
1053 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1055 print
'<table class="noborder centpecent">'.
"\n";
1056 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1058 if (count($objects) > 0) {
1060 foreach ($objects as $key => $project) {
1066 print
"\t".
'<tr class="oddeven">'.
"\n";
1067 print
'<td class="nowrap tdtop">';
1068 print $project->getNomUrl(1);
1070 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1071 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1073 print
'<td class="right">';
1075 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$project->id.
"'>";
1076 print $langs->trans(
"DeleteFromCat");
1077 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1084 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1088 print
'</form>'.
"\n";
1091 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'project');
1097if ($type == Categorie::TYPE_USER) {
1098 if ($user->hasRight(
"user",
"user",
"read")) {
1099 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1101 $users = $object->getObjectsInCateg($type);
1106 $showclassifyform = 1;
1107 if ($showclassifyform) {
1109 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1110 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1111 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1112 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1113 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1114 print
'<input type="hidden" name="action" value="addintocategory">';
1115 print
'<table class="noborder centpercent">';
1116 print
'<tr class="liste_titre"><td>';
1117 $force_entity =
getEntity($object->element);
1118 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1119 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1120 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1125 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1126 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1127 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1128 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1129 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1130 print
'<input type="hidden" name="action" value="list">';
1134 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1135 $num = count($users);
1136 $nbtotalofrecords =
'';
1137 $newcardbutton =
'';
1139 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1141 print
'<table class="noborder centpecent">'.
"\n";
1142 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1144 if (count($users) > 0) {
1146 foreach ($users as $key => $userentry) {
1147 print
"\t".
'<tr class="oddeven">'.
"\n";
1148 print
'<td class="nowrap tdtop">';
1149 print $userentry->getNomUrl(-1);
1151 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1154 print
'<td class="right">';
1155 if ($user->hasRight(
'user',
'user',
'creer')) {
1156 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$userentry->id.
"'>";
1157 print $langs->trans(
"DeleteFromCat");
1158 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1165 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1169 print
'</form>'.
"\n";
1172 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'user');
1179if ($type == Categorie::TYPE_WAREHOUSE) {
1180 if ($user->hasRight(
"stock",
"read")) {
1181 $permission = $user->rights->stock->creer;
1183 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1185 $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
1189 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1190 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1191 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1192 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1193 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1194 print
'<input type="hidden" name="action" value="list">';
1197 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1198 $num = count($objects);
1199 $nbtotalofrecords =
'';
1200 $newcardbutton =
'';
1202 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1204 print
'<table class="noborder centpecent">'.
"\n";
1205 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1207 if (count($objects) > 0) {
1209 foreach ($objects as $key => $project) {
1215 print
"\t".
'<tr class="oddeven">'.
"\n";
1216 print
'<td class="nowrap tdtop">';
1217 print $project->getNomUrl(1);
1219 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1220 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1222 print
'<td class="right">';
1224 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$project->id.
"'>";
1225 print $langs->trans(
"DeleteFromCat");
1226 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1233 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1237 print
'</form>'.
"\n";
1240 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'stock');
1246if ($type == Categorie::TYPE_TICKET) {
1247 if ($user->hasRight(
"ticket",
"read")) {
1248 $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer);
1250 $tickets = $object->getObjectsInCateg($type, 0, $limit, $offset);
1255 $showclassifyform = 1;
1256 if ($showclassifyform) {
1258 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1259 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1260 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1261 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1262 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1263 print
'<input type="hidden" name="action" value="addintocategory">';
1264 print
'<table class="noborder centpercent">';
1265 print
'<tr class="liste_titre"><td>';
1266 print $langs->trans(
"AddTicketIntoCategory").
' ';
1267 $form->selectTickets(
'',
'elemid');
1268 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1274 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1275 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1276 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1277 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1278 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1279 print
'<input type="hidden" name="action" value="list">';
1282 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1283 $num = count($tickets);
1284 $nbtotalofrecords =
'';
1285 $newcardbutton =
'';
1287 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1290 print
'<table class="noborder centpercent">'.
"\n";
1291 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1293 if (count($tickets) > 0) {
1295 foreach ($tickets as $ticket) {
1297 if ($i > $limit)
break;
1299 print
"\t".
'<tr class="oddeven">'.
"\n";
1300 print
'<td class="nowrap tdtop">';
1301 print $ticket->getNomUrl(1);
1303 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1305 print
'<td class="right">';
1307 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$ticket->id.
"'>";
1308 print $langs->trans(
"DeleteFromCat");
1309 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1316 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1320 print
'</form>'.
"\n";
1323 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'ticket');
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
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.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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 dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.