31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
35 require_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');
61 if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
64 $offset = $limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
68 if ($id ==
"" && $label ==
"") {
77 $result = $object->fetch($id, $label);
82 $type = $object->type;
83 if (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'));
97 if ($confirm ==
'no') {
99 header(
"Location: ".$backtopage);
104 $parameters = array();
105 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
107 if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
108 if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->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->rights->societe->creer) {
115 $result = $tmpobject->fetch($removeelem);
116 $elementtype =
'supplier';
117 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->rights->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->rights->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->rights->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);
159 if ($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);
173 if ($elemid && $action ==
'addintocategory' &&
174 (($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) ||
175 ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) ||
176 ($type == Categorie::TYPE_SUPPLIER && $user->rights->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->rights->projet->creer) ||
180 ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) ||
181 ($type == Categorie::TYPE_USER && $user->rights->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';
218 $newobject =
new User($db);
219 $elementtype =
'bank_account';
221 $result = $newobject->fetch($elemid);
224 $result = $object->add_type($newobject, $elementtype);
226 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
228 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
229 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
244 $arrayofjs = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
'/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
245 $arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
249 llxHeader(
"", $langs->trans(
"Categories"),
$help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
251 $title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
256 $backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type));
257 $linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
258 $object->next_prev_filter =
' type = '.$object->type;
259 $object->ref = $object->label;
260 $morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
261 $ways = $object->print_all_ways(
" >> ",
'', 1);
262 foreach ($ways as $way) {
263 $morehtmlref .= $way.
"<br>\n";
265 $morehtmlref .=
'</div>';
267 dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
274 if ($action ==
'delete') {
276 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&type='.$type.
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
278 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&type='.$type, $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
284 print
'<div class="fichecenter">';
285 print
'<div class="underbanner clearboth"></div>';
286 print
'<table class="border centpercent tableforfield">';
289 print
'<tr><td class="titlefield notopnoleft tdtop">';
290 print $langs->trans(
"Description").
'</td><td>';
295 print
'<tr><td class="notopnoleft">';
296 print $langs->trans(
"Color").
'</td><td>';
297 print $formother->showColor($object->color);
301 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
313 print
"<div class='tabsAction'>\n";
314 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
318 if (empty($reshook)) {
319 if ($user->rights->categorie->creer) {
320 $socid = ($object->socid ?
"&socid=".$object->socid :
"");
321 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.$type.
'">'.$langs->trans(
"Modify").
'</a>';
324 if ($user->rights->categorie->supprimer) {
325 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.$object->id.
'&type='.$type.
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
332 if (!empty($user->rights->categorie->creer)) {
333 $link = DOL_URL_ROOT.
'/categories/card.php';
334 $link .=
'?action=create';
335 $link .=
'&type='.$type;
336 $link .=
'&catorigin='.$object->id;
337 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
339 $newcardbutton =
'<div class="right">';
340 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
341 $newcardbutton .=
'</div>';
349 print
'<div class="fichecenter">';
351 print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
354 print
'<table class="liste nohover" width="100%">';
356 print
'<tr class="liste_titre">';
357 print
'<td>'.$langs->trans(
"SubCats").
'</td>';
359 print
'<td class="right">';
361 if (!empty($conf->use_javascript_ajax)) {
362 print
'<div id="iddivjstreecontrol">';
363 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
365 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
372 $cats = $object->get_filles();
375 } elseif (count($cats) < 1) {
376 print
'<tr class="oddeven">';
377 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
382 $fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
386 if ($type == Categorie::TYPE_MEMBER) {
387 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
389 if ($type == Categorie::TYPE_ACCOUNT) {
390 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
392 if ($type == Categorie::TYPE_PROJECT) {
393 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
395 if ($type == Categorie::TYPE_USER) {
396 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
402 $data[] = array(
'rowid'=>0,
'fk_menu'=>-1,
'title'=>
"racine",
'mainmenu'=>
'',
'leftmenu'=>
'',
'fk_mainmenu'=>
'',
'fk_leftmenu'=>
'');
403 foreach ($fulltree as $key => $val) {
404 $categstatic->id = $val[
'id'];
405 $categstatic->ref = $val[
'label'];
406 $categstatic->color = $val[
'color'];
407 $categstatic->type = $type;
413 $elements = $categstatic->getObjectsInCateg($type, 1);
415 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
418 $color = $categstatic->color ?
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"' :
' style="background: #bbb"';
419 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$id.
'&type='.$type));
421 $entry =
'<table class="nobordernopadding centpercent">';
425 $entry .=
'<span class="noborderoncategories" '.$color.
'>'.$li.
'</span>';
430 $entry .=
'<td class="right" width="20px;">';
431 $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>';
433 $entry .=
'<td class="right" width="20px;">';
434 $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>';
436 $entry .=
'<td class="right" width="20px;">';
437 $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>';
441 $entry .=
'</table>';
443 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
446 $nbofentries = (count($data) - 1);
447 if ($nbofentries > 0) {
448 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
449 print
'<tr class="pair">';
450 print
'<td colspan="3">';
458 print
'<tr class="pair">';
459 print
'<td colspan="3">';
460 print
'<table class="nobordernopadding">';
462 print
'<tr class="nobordernopadding">';
463 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
464 print
'<td class="valignmiddle">'.$langs->trans(
"NoCategoryYet").
'</td>';
465 print
'<td> </td>';
478 $arrayofmassactions = array(
484 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
490 if ($type == Categorie::TYPE_PRODUCT) {
491 if ($user->hasRight(
"product",
"read")) {
492 $permission = ($user->rights->produit->creer || $user->rights->service->creer);
494 $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
499 $showclassifyform = 1;
500 if ($showclassifyform) {
502 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
503 print
'<input type="hidden" name="token" value="'.newToken().
'">';
504 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
505 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
506 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
507 print
'<input type="hidden" name="action" value="addintocategory">';
508 print
'<table class="noborder centpercent">';
509 print
'<tr class="liste_titre"><td>';
510 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
511 $form->select_produits(
'',
'elemid',
'', 0, 0, -1, 2,
'', 1);
512 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
518 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
519 print
'<input type="hidden" name="token" value="'.newToken().
'">';
520 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
521 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
522 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
523 print
'<input type="hidden" name="action" value="list">';
526 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($prods);
$nbtotalofrecords =
'';
527 $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);
528 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
531 print
'<table class="noborder centpercent">'.
"\n";
532 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
534 if (count($prods) > 0) {
536 foreach ($prods as $prod) {
542 print
"\t".
'<tr class="oddeven">'.
"\n";
543 print
'<td class="nowrap" valign="top">';
544 print $prod->getNomUrl(1);
546 print
'<td class="tdtop">'.$prod->label.
"</td>\n";
548 print
'<td class="right">';
550 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$prod->id.
"'>";
551 print $langs->trans(
"DeleteFromCat");
552 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
559 print
'<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
563 print
'</form>'.
"\n";
566 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'products');
572 if ($type == Categorie::TYPE_CUSTOMER) {
573 if ($user->hasRight(
"societe",
"read")) {
574 $permission = $user->rights->societe->creer;
576 $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
581 $showclassifyform = 1;
582 if ($showclassifyform) {
584 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
585 print
'<input type="hidden" name="token" value="'.newToken().
'">';
586 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
587 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
588 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
589 print
'<input type="hidden" name="action" value="addintocategory">';
590 print
'<table class="noborder centpercent">';
591 print
'<tr class="liste_titre"><td>';
592 print $langs->trans(
"AddCustomerIntoCategory").
' ';
593 print
$form->select_company(
'',
'elemid',
's.client IN (1,3)');
594 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
600 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
601 print
'<input type="hidden" name="token" value="'.newToken().
'">';
602 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
603 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
604 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
605 print
'<input type="hidden" name="action" value="list">';
608 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($socs);
$nbtotalofrecords =
'';
609 $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);
610 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
612 print
'<table class="noborder centpercent">'.
"\n";
613 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
615 if (count($socs) > 0) {
617 foreach ($socs as $key => $soc) {
623 print
"\t".
'<tr class="oddeven">'.
"\n";
624 print
'<td class="nowrap" valign="top">';
625 print $soc->getNomUrl(1);
628 print
'<td class="right">';
630 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.
"'>";
631 print $langs->trans(
"DeleteFromCat");
632 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
639 print
'<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
643 print
'</form>'.
"\n";
646 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
652 if ($type == Categorie::TYPE_SUPPLIER) {
653 if ($user->hasRight(
"fournisseur",
"read")) {
654 $permission = $user->rights->societe->creer;
656 $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
661 $showclassifyform = 1;
662 if ($showclassifyform) {
664 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
665 print
'<input type="hidden" name="token" value="'.newToken().
'">';
666 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
667 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
668 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
669 print
'<input type="hidden" name="action" value="addintocategory">';
670 print
'<table class="noborder centpercent">';
671 print
'<tr class="liste_titre"><td>';
672 print $langs->trans(
"AddSupplierIntoCategory").
' ';
673 print
$form->select_company(
'',
'elemid',
's.fournisseur = 1');
674 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
680 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
681 print
'<input type="hidden" name="token" value="'.newToken().
'">';
682 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
683 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
684 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
685 print
'<input type="hidden" name="action" value="list">';
688 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($socs);
$nbtotalofrecords =
'';
689 $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);
690 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
692 print
'<table class="noborder centpercent">'.
"\n";
693 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
695 if (count($socs) > 0) {
697 foreach ($socs as $soc) {
703 print
"\t".
'<tr class="oddeven">'.
"\n";
704 print
'<td class="nowrap" valign="top">';
705 print $soc->getNomUrl(1);
708 print
'<td class="right">';
710 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.
"'>";
711 print $langs->trans(
"DeleteFromCat");
712 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
720 print
'<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
724 print
'</form>'.
"\n";
727 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
733 if ($type == Categorie::TYPE_MEMBER) {
734 if ($user->hasRight(
"adherent",
"read")) {
735 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
737 $permission = $user->hasRight(
'adherent',
'creer');
739 $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
744 $showclassifyform = 1;
745 if ($showclassifyform) {
747 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
748 print
'<input type="hidden" name="token" value="'.newToken().
'">';
749 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
750 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
751 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
752 print
'<input type="hidden" name="action" value="addintocategory">';
753 print
'<table class="noborder centpercent">';
754 print
'<tr class="liste_titre"><td>';
755 print $langs->trans(
"AssignCategoryTo").
' ';
756 print
$form->selectMembers(
'',
'elemid');
757 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
763 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
764 print
'<input type="hidden" name="token" value="'.newToken().
'">';
765 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
766 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
767 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
768 print
'<input type="hidden" name="action" value="list">';
771 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($prods);
$nbtotalofrecords =
'';
772 $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'));
773 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
775 print
"<table class='noborder' width='100%'>\n";
776 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
778 if (count($prods) > 0) {
780 foreach ($prods as $key => $member) {
786 print
"\t".
'<tr class="oddeven">'.
"\n";
787 print
'<td class="nowrap" valign="top">';
788 $member->ref = $member->login;
789 print $member->getNomUrl(1, 0);
791 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
792 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
794 print
'<td class="right">';
796 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$member->id.
"'>";
797 print $langs->trans(
"DeleteFromCat");
798 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
804 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
808 print
'</form>'.
"\n";
811 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'members');
817 if ($type == Categorie::TYPE_CONTACT) {
818 if ($user->hasRight(
"societe",
"read")) {
819 $permission = $user->rights->societe->creer;
821 $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
822 if (is_numeric($contacts) && $contacts < 0) {
826 $showclassifyform = 1;
827 if ($showclassifyform) {
829 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
830 print
'<input type="hidden" name="token" value="'.newToken().
'">';
831 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
832 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
833 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
834 print
'<input type="hidden" name="action" value="addintocategory">';
835 print
'<table class="noborder centpercent">';
836 print
'<tr class="liste_titre"><td>';
837 print $langs->trans(
"AssignCategoryTo").
' ';
838 print
$form->selectContacts(
'',
'',
'elemid');
839 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
844 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
845 print
'<input type="hidden" name="token" value="'.newToken().
'">';
846 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
847 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
848 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
849 print
'<input type="hidden" name="action" value="list">';
852 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
853 $num = count($contacts);
855 $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);
857 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
859 print
'<table class="noborder centpercent">'.
"\n";
860 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
862 if (is_array($contacts) && count($contacts) > 0) {
864 foreach ($contacts as $key => $contact) {
870 print
"\t".
'<tr class="oddeven">'.
"\n";
871 print
'<td class="nowrap" valign="top">';
872 print $contact->getNomUrl(1,
'category');
873 if ($contact->socid > 0) {
874 $objsoc->fetch($contact->socid);
876 print $objsoc->getNomUrl(1,
'contact');
880 print
'<td class="right">';
882 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$contact->id.
"'>";
883 print $langs->trans(
"DeleteFromCat");
884 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
891 print
'<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
895 print
'</form>'.
"\n";
898 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'contact');
904 if ($type == Categorie::TYPE_ACCOUNT) {
905 if ($user->hasRight(
"banque",
"read")) {
906 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
908 $permission = $user->rights->banque->creer;
910 $accounts = $object->getObjectsInCateg($type, 0, $limit, $offset);
915 $showclassifyform = 1;
916 if ($showclassifyform) {
918 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
919 print
'<input type="hidden" name="token" value="'.newToken().
'">';
920 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
921 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
922 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
923 print
'<input type="hidden" name="action" value="addintocategory">';
924 print
'<table class="noborder centpercent">';
925 print
'<tr class="liste_titre"><td>';
926 print $langs->trans(
"AddAccountIntoCategory").
' ';
927 $form->select_comptes(
'',
'elemid');
928 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
934 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
935 print
'<input type="hidden" name="token" value="'.newToken().
'">';
936 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
937 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
938 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
939 print
'<input type="hidden" name="action" value="list">';
942 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($accounts);
$nbtotalofrecords =
''; $newcardbutton =
'';
943 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
945 print
"<table class='noborder' width='100%'>\n";
946 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
948 if (count($accounts) > 0) {
950 foreach ($accounts as $key => $account) {
956 print
"\t".
'<tr class="oddeven">'.
"\n";
957 print
'<td class="nowrap" valign="top">';
958 print $account->getNomUrl(1, 0);
960 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
961 print
'<td class="tdtop">'.$account->number.
"</td>\n";
963 print
'<td class="right">';
965 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$account->id.
"'>";
966 print $langs->trans(
"DeleteFromCat");
967 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
973 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
977 print
'</form>'.
"\n";
980 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'bank');
986 if ($type == Categorie::TYPE_PROJECT) {
987 if ($user->hasRight(
"project",
"read")) {
988 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
990 $permission = $user->rights->projet->creer;
992 $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
997 $showclassifyform = 1;
998 if ($showclassifyform) {
1000 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1001 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1002 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1003 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1004 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1005 print
'<input type="hidden" name="action" value="addintocategory">';
1006 print
'<table class="noborder centpercent">';
1007 print
'<tr class="liste_titre"><td>';
1008 print $langs->trans(
"AddProjectIntoCategory").
' ';
1009 $form->selectProjects(
'',
'elemid');
1010 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1016 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1017 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1018 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1019 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1020 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1021 print
'<input type="hidden" name="action" value="list">';
1024 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($objects);
$nbtotalofrecords =
''; $newcardbutton =
'';
1026 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1028 print
"<table class='noborder' width='100%'>\n";
1029 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1031 if (count($objects) > 0) {
1033 foreach ($objects as $key => $project) {
1039 print
"\t".
'<tr class="oddeven">'.
"\n";
1040 print
'<td class="nowrap" valign="top">';
1041 print $project->getNomUrl(1);
1043 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1044 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1046 print
'<td class="right">';
1048 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$project->id.
"'>";
1049 print $langs->trans(
"DeleteFromCat");
1050 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1056 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1060 print
'</form>'.
"\n";
1063 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'project');
1069 if ($type == Categorie::TYPE_USER) {
1070 if ($user->hasRight(
"user",
"user",
"read")) {
1071 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1073 $users = $object->getObjectsInCateg($type);
1078 $showclassifyform = 1;
1079 if ($showclassifyform) {
1081 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1082 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1083 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1084 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1085 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1086 print
'<input type="hidden" name="action" value="addintocategory">';
1087 print
'<table class="noborder centpercent">';
1088 print
'<tr class="liste_titre"><td>';
1089 print $langs->trans(
"AddObjectIntoCategory").
' ';
1090 print
$form->select_dolusers(
'',
'elemid');
1091 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1096 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1097 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1098 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1099 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1100 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1101 print
'<input type="hidden" name="action" value="list">';
1105 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1106 $num = count($users);
1108 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
'',
'user', 0,
'',
'', $limit);
1110 print
"<table class='noborder' width='100%'>\n";
1111 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1113 if (count($users) > 0) {
1115 foreach ($users as $key => $userentry) {
1116 print
"\t".
'<tr class="oddeven">'.
"\n";
1117 print
'<td class="nowrap" valign="top">';
1118 print $userentry->getNomUrl(1);
1120 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1123 print
'<td class="right">';
1124 if ($user->rights->user->user->creer) {
1125 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$type.
"&action=unlink&token=".
newToken().
"&removeelem=".$userentry->id.
"'>";
1126 print $langs->trans(
"DeleteFromCat");
1127 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1133 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1137 print
'</form>'.
"\n";
1140 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'user');
1147 if ($type == Categorie::TYPE_WAREHOUSE) {
1148 if ($user->hasRight(
"stock",
"read")) {
1149 $permission = $user->rights->stock->creer;
1151 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1153 $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
1157 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1158 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1159 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1160 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1161 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1162 print
'<input type="hidden" name="action" value="list">';
1165 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($objects);
$nbtotalofrecords =
''; $newcardbutton =
'';
1167 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1169 print
"<table class='noborder' width='100%'>\n";
1170 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1172 if (count($objects) > 0) {
1174 foreach ($objects as $key => $project) {
1180 print
"\t".
'<tr class="oddeven">'.
"\n";
1181 print
'<td class="nowrap" valign="top">';
1182 print $project->getNomUrl(1);
1184 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1185 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1187 print
'<td class="right">';
1189 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$project->id.
"'>";
1190 print $langs->trans(
"DeleteFromCat");
1191 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1197 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1201 print
'</form>'.
"\n";
1204 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'stock');
1210 if ($type == Categorie::TYPE_TICKET) {
1211 if ($user->hasRight(
"ticket",
"read")) {
1212 $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer);
1214 $tickets = $object->getObjectsInCateg($type, 0, $limit, $offset);
1219 $showclassifyform = 1;
1220 if ($showclassifyform) {
1222 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1223 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1224 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1225 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1226 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1227 print
'<input type="hidden" name="action" value="addintocategory">';
1228 print
'<table class="noborder centpercent">';
1229 print
'<tr class="liste_titre"><td>';
1230 print $langs->trans(
"AddTicketIntoCategory").
' ';
1231 $form->selectTickets(
'',
'elemid');
1232 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1238 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1239 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1240 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1241 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1242 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1243 print
'<input type="hidden" name="action" value="list">';
1246 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type; $num = count($tickets);
$nbtotalofrecords =
''; $newcardbutton =
'';
1247 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1250 print
'<table class="noborder centpercent">'.
"\n";
1251 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1253 if (count($tickets) > 0) {
1255 foreach ($tickets as $ticket) {
1257 if ($i > $limit)
break;
1259 print
"\t".
'<tr class="oddeven">'.
"\n";
1260 print
'<td class="nowrap" valign="top">';
1261 print $ticket->getNomUrl(1);
1263 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1265 print
'<td class="right">';
1267 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$ticket->id.
"'>";
1268 print $langs->trans(
"DeleteFromCat");
1269 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1276 print
'<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1280 print
'</form>'.
"\n";
1283 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'ticket');
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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...
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Class to generate the form for creating a new ticket.
$nbtotalofrecords
Count total nb of records.
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.