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);
84if (is_numeric($type)) {
85 $type = Categorie::$MAP_ID_TO_CODE[$type];
89$extrafields->fetch_name_optionals_label($object->table_element);
92$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
98if ($confirm ==
'no') {
100 header(
"Location: ".$backtopage);
105$parameters = array();
106$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
108if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
109 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
110 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
112 $result = $tmpobject->fetch($removeelem);
113 $elementtype =
'product';
114 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
116 $result = $tmpobject->fetch($removeelem);
117 $elementtype =
'supplier';
118 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
120 $result = $tmpobject->fetch($removeelem);
121 $elementtype =
'customer';
122 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
123 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
125 $result = $tmpobject->fetch($removeelem);
126 $elementtype =
'member';
127 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
128 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
130 $result = $tmpobject->fetch($removeelem);
131 $elementtype =
'contact';
132 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
133 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
135 $result = $tmpobject->fetch($removeelem);
136 $elementtype =
'account';
137 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
138 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
140 $result = $tmpobject->fetch($removeelem);
141 $elementtype =
'project';
142 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
143 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
144 $tmpobject =
new User($db);
145 $result = $tmpobject->fetch($removeelem);
146 $elementtype =
'user';
147 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
148 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
149 $tmpobject =
new Ticket($db);
150 $result = $tmpobject->fetch($removeelem);
151 $elementtype =
'ticket';
154 $result = $object->del_type($tmpobject, $elementtype);
160if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
161 if ($object->delete($user) >= 0) {
163 header(
"Location: ".$backtopage);
166 header(
"Location: ".DOL_URL_ROOT.
'/categories/index.php?type='.$type);
174if ($elemid && $action ==
'addintocategory' &&
176 ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) ||
177 ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) ||
178 ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) ||
179 ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) ||
180 ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) ||
181 ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) ||
182 ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) ||
183 ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) ||
184 ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer'))
186 if ($type == Categorie::TYPE_PRODUCT) {
187 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
189 $elementtype =
'product';
190 } elseif ($type == Categorie::TYPE_CUSTOMER) {
191 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
193 $elementtype =
'customer';
194 } elseif ($type == Categorie::TYPE_SUPPLIER) {
195 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
197 $elementtype =
'supplier';
198 } elseif ($type == Categorie::TYPE_TICKET) {
199 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
200 $newobject =
new Ticket($db);
201 $elementtype =
'ticket';
202 } elseif ($type == Categorie::TYPE_PROJECT) {
203 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
205 $elementtype =
'project';
206 } elseif ($type == Categorie::TYPE_MEMBER) {
207 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
209 $elementtype =
'member';
210 } elseif ($type == Categorie::TYPE_CONTACT) {
211 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
213 $elementtype =
'contact';
214 } elseif ($type == Categorie::TYPE_USER) {
215 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
216 $newobject =
new User($db);
217 $elementtype =
'user';
218 } elseif ($type == Categorie::TYPE_ACCOUNT) {
219 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
221 $elementtype =
'bank_account';
225 $result = $newobject->fetch($elemid);
228 $result = $object->add_type($newobject, $elementtype);
230 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
232 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
233 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
245$form =
new Form($db);
248$arrayofjs = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
'/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
249$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
253llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
255$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
260$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type));
261$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
262$object->next_prev_filter =
'type = '.((int) $object->type);
263$object->ref = $object->label;
264$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
265$ways = $object->print_all_ways(
" >> ",
'', 1);
266foreach ($ways as $way) {
267 $morehtmlref .= $way.
"<br>\n";
269$morehtmlref .=
'</div>';
271dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
278if ($action ==
'delete') {
280 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&type='.$type.
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
282 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&type='.$type, $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
288print
'<div class="fichecenter">';
289print
'<div class="underbanner clearboth"></div>';
290print
'<table class="border centpercent tableforfield">';
293print
'<tr><td class="titlefield notopnoleft tdtop">';
294print $langs->trans(
"Description").
'</td><td>';
299print
'<tr><td class="notopnoleft">';
300print $langs->trans(
"Color").
'</td><td>';
301print $formother->showColor($object->color);
305include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
317print
"<div class='tabsAction'>\n";
318$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
322if (empty($reshook)) {
323 if ($user->hasRight(
'categorie',
'creer')) {
324 $socid = ($object->socid ?
"&socid=".$object->socid :
"");
325 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.$type.
'">'.$langs->trans(
"Modify").
'</a>';
328 if ($user->hasRight(
'categorie',
'supprimer')) {
329 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&id='.$object->id.
'&type='.$type.
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
336if ($user->hasRight(
'categorie',
'creer')) {
337 $link = DOL_URL_ROOT.
'/categories/card.php';
338 $link .=
'?action=create';
339 $link .=
'&type='.$type;
340 $link .=
'&catorigin='.$object->id;
341 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
343 $newcardbutton =
'<div class="right">';
344 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
345 $newcardbutton .=
'</div>';
353print
'<div class="fichecenter">';
355print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
358print
'<table class="liste nohover centpercent borderbottom">';
360print
'<tr class="liste_titre">';
361print
'<td>'.$langs->trans(
"SubCats").
'</td>';
363print
'<td class="right">';
365if (!empty($conf->use_javascript_ajax)) {
366 print
'<div id="iddivjstreecontrol">';
367 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
369 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
376$cats = $object->get_filles();
379} elseif (count($cats) < 1) {
380 print
'<tr class="oddeven nobottom">';
381 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
386 $fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
390 if ($type == Categorie::TYPE_MEMBER) {
391 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
393 if ($type == Categorie::TYPE_ACCOUNT) {
394 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
396 if ($type == Categorie::TYPE_PROJECT) {
397 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
399 if ($type == Categorie::TYPE_USER) {
400 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
406 $data[] = array(
'rowid'=>0,
'fk_menu'=>-1,
'title'=>
"racine",
'mainmenu'=>
'',
'leftmenu'=>
'',
'fk_mainmenu'=>
'',
'fk_leftmenu'=>
'');
407 foreach ($fulltree as $key => $val) {
408 $categstatic->id = $val[
'id'];
409 $categstatic->ref = $val[
'label'];
410 $categstatic->color = $val[
'color'];
411 $categstatic->type = $type;
417 $elements = $categstatic->getObjectsInCateg($type, 1);
419 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
422 $color = $categstatic->color ?
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"' :
' style="background: #bbb"';
423 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$id.
'&type='.$type));
425 $entry =
'<table class="nobordernopadding centpercent">';
429 $entry .=
'<span class="noborderoncategories" '.$color.
'>'.$li.
'</span>';
434 $entry .=
'<td class="right" width="20px;">';
435 $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>';
437 $entry .=
'<td class="right" width="20px;">';
438 $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>';
440 $entry .=
'<td class="right" width="20px;">';
441 $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>';
445 $entry .=
'</table>';
447 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
450 $nbofentries = (count($data) - 1);
451 if ($nbofentries > 0) {
452 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
453 print
'<tr class="pair">';
454 print
'<td colspan="3">';
462 print
'<tr class="pair">';
463 print
'<td colspan="3">';
464 print
'<table class="nobordernopadding">';
466 print
'<tr class="nobordernopadding">';
467 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
468 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
469 print
'<td> </td>';
482$arrayofmassactions = array(
488$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
494if ($type == Categorie::TYPE_PRODUCT) {
495 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
496 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
498 $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
503 $showclassifyform = 1;
504 if ($showclassifyform) {
506 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
507 print
'<input type="hidden" name="token" value="'.newToken().
'">';
508 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
509 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
510 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
511 print
'<input type="hidden" name="action" value="addintocategory">';
512 print
'<table class="noborder centpercent">';
513 print
'<tr class="liste_titre"><td>';
514 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
515 $form->select_produits(
'',
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
516 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
522 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
523 print
'<input type="hidden" name="token" value="'.newToken().
'">';
524 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
525 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
526 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
527 print
'<input type="hidden" name="action" value="list">';
530 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
531 $num = count($prods);
532 $nbtotalofrecords =
'';
533 $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);
535 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
538 print
'<table class="noborder centpercent">'.
"\n";
539 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
541 if (count($prods) > 0) {
543 foreach ($prods as $prod) {
549 print
"\t".
'<tr class="oddeven">'.
"\n";
550 print
'<td class="nowrap" valign="top">';
551 print $prod->getNomUrl(1);
553 print
'<td class="tdtop">'.$prod->label.
"</td>\n";
555 print
'<td class="right">';
557 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$prod->id.
"'>";
558 print $langs->trans(
"DeleteFromCat");
559 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
566 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
570 print
'</form>'.
"\n";
573 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'products');
579if ($type == Categorie::TYPE_CUSTOMER) {
580 if ($user->hasRight(
"societe",
"read")) {
581 $permission = $user->hasRight(
'societe',
'creer');
583 $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
588 $showclassifyform = 1;
589 if ($showclassifyform) {
591 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
592 print
'<input type="hidden" name="token" value="'.newToken().
'">';
593 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
594 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
595 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
596 print
'<input type="hidden" name="action" value="addintocategory">';
597 print
'<table class="noborder centpercent">';
598 print
'<tr class="liste_titre"><td>';
599 print $langs->trans(
"AddCustomerIntoCategory").
' ';
600 $filter =
'(s.client:IN:1,3)';
601 print $form->select_company(
'',
'elemid', $filter);
602 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
608 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
609 print
'<input type="hidden" name="token" value="'.newToken().
'">';
610 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
611 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
612 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
613 print
'<input type="hidden" name="action" value="list">';
616 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
618 $nbtotalofrecords =
'';
619 $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);
621 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
623 print
'<table class="noborder centpercent">'.
"\n";
624 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
626 if (count($socs) > 0) {
628 foreach ($socs as $key => $soc) {
634 print
"\t".
'<tr class="oddeven">'.
"\n";
635 print
'<td class="nowrap tdtop">';
636 print $soc->getNomUrl(1);
639 print
'<td class="right">';
641 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$soc->id.
"'>";
642 print $langs->trans(
"DeleteFromCat");
643 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
650 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
654 print
'</form>'.
"\n";
657 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
663if ($type == Categorie::TYPE_SUPPLIER) {
664 if ($user->hasRight(
"fournisseur",
"read")) {
665 $permission = $user->hasRight(
'societe',
'creer');
667 $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
672 $showclassifyform = 1;
673 if ($showclassifyform) {
675 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
676 print
'<input type="hidden" name="token" value="'.newToken().
'">';
677 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
678 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
679 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
680 print
'<input type="hidden" name="action" value="addintocategory">';
681 print
'<table class="noborder centpercent">';
682 print
'<tr class="liste_titre"><td>';
683 print $langs->trans(
"AddSupplierIntoCategory").
' ';
684 $filter =
'(s.fournisseur:=:1)';
685 print $form->select_company(
'',
'elemid', $filter);
686 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
692 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
693 print
'<input type="hidden" name="token" value="'.newToken().
'">';
694 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
695 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
696 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
697 print
'<input type="hidden" name="action" value="list">';
700 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
702 $nbtotalofrecords =
'';
703 $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);
705 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
707 print
'<table class="noborder centpercent">'.
"\n";
708 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
710 if (count($socs) > 0) {
712 foreach ($socs as $soc) {
718 print
"\t".
'<tr class="oddeven">'.
"\n";
719 print
'<td class="nowrap tdtop">';
720 print $soc->getNomUrl(1);
723 print
'<td class="right">';
725 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$soc->id.
"'>";
726 print $langs->trans(
"DeleteFromCat");
727 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
735 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
739 print
'</form>'.
"\n";
742 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
748if ($type == Categorie::TYPE_MEMBER) {
749 if ($user->hasRight(
"adherent",
"read")) {
750 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
752 $permission = $user->hasRight(
'adherent',
'creer');
754 $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
759 $showclassifyform = 1;
760 if ($showclassifyform) {
762 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
763 print
'<input type="hidden" name="token" value="'.newToken().
'">';
764 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
765 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
766 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
767 print
'<input type="hidden" name="action" value="addintocategory">';
768 print
'<table class="noborder centpercent">';
769 print
'<tr class="liste_titre"><td>';
770 print $langs->trans(
"AssignCategoryTo").
' ';
771 print $form->selectMembers(
'',
'elemid');
772 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
778 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
779 print
'<input type="hidden" name="token" value="'.newToken().
'">';
780 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
781 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
782 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
783 print
'<input type="hidden" name="action" value="list">';
786 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
787 $num = count($prods);
788 $nbtotalofrecords =
'';
789 $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'));
791 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
793 print
'<table class="noborder centpecent">'.
"\n";
794 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
796 if (count($prods) > 0) {
798 foreach ($prods as $key => $member) {
804 print
"\t".
'<tr class="oddeven">'.
"\n";
805 print
'<td class="nowrap tdtop">';
806 $member->ref = $member->login;
807 print $member->getNomUrl(1, 0);
809 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
810 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
812 print
'<td class="right">';
814 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$member->id.
"'>";
815 print $langs->trans(
"DeleteFromCat");
816 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
823 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
827 print
'</form>'.
"\n";
830 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'members');
836if ($type == Categorie::TYPE_CONTACT) {
837 if ($user->hasRight(
"societe",
"read")) {
838 $permission = $user->hasRight(
'societe',
'creer');
840 $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
841 if (is_numeric($contacts) && $contacts < 0) {
845 $showclassifyform = 1;
846 if ($showclassifyform) {
848 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
849 print
'<input type="hidden" name="token" value="'.newToken().
'">';
850 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
851 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
852 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
853 print
'<input type="hidden" name="action" value="addintocategory">';
854 print
'<table class="noborder centpercent">';
855 print
'<tr class="liste_titre"><td>';
856 print $langs->trans(
"AssignCategoryTo").
' ';
857 print $form->selectContacts(
'',
'',
'elemid');
858 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
863 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
864 print
'<input type="hidden" name="token" value="'.newToken().
'">';
865 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
866 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
867 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
868 print
'<input type="hidden" name="action" value="list">';
871 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
872 $num = count($contacts);
873 $nbtotalofrecords =
'';
874 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddContact"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create&contcats[]='.$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$object->id),
'', $user->rights->societe->creer);
876 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
880 print
'<table class="noborder centpercent">'.
"\n";
881 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
883 if (is_array($contacts) && count($contacts) > 0) {
885 foreach ($contacts as $key => $contact) {
891 print
"\t".
'<tr class="oddeven">'.
"\n";
892 print
'<td class="nowrap tdtop">';
893 print $contact->getNomUrl(1,
'category');
894 if ($contact->socid > 0) {
895 $objsoc->fetch($contact->socid);
897 print $objsoc->getNomUrl(1,
'contact');
901 print
'<td class="right">';
903 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$contact->id.
"'>";
904 print $langs->trans(
"DeleteFromCat");
905 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
912 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
916 print
'</form>'.
"\n";
919 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'contact');
925if ($type == Categorie::TYPE_ACCOUNT) {
926 if ($user->hasRight(
"banque",
"read")) {
927 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
929 $permission = $user->hasRight(
'banque',
'creer');
931 $accounts = $object->getObjectsInCateg($type, 0, $limit, $offset);
936 $showclassifyform = 1;
937 if ($showclassifyform) {
939 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
940 print
'<input type="hidden" name="token" value="'.newToken().
'">';
941 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
942 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
943 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
944 print
'<input type="hidden" name="action" value="addintocategory">';
945 print
'<table class="noborder centpercent">';
946 print
'<tr class="liste_titre"><td>';
947 print $langs->trans(
"AddObjectIntoCategory").
' ';
948 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
949 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
955 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
956 print
'<input type="hidden" name="token" value="'.newToken().
'">';
957 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
958 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
959 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
960 print
'<input type="hidden" name="action" value="list">';
963 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
964 $num = count($accounts);
965 $nbtotalofrecords =
'';
968 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
970 print
'<table class="noborder centpecent">'.
"\n";
971 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
973 if (count($accounts) > 0) {
975 foreach ($accounts as $key => $account) {
981 print
"\t".
'<tr class="oddeven">'.
"\n";
982 print
'<td class="nowrap tdtop">';
983 print $account->getNomUrl(1, 0);
985 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
986 print
'<td class="tdtop">'.$account->number.
"</td>\n";
988 print
'<td class="right">';
990 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$account->id.
"'>";
991 print $langs->trans(
"DeleteFromCat");
992 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
999 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1003 print
'</form>'.
"\n";
1006 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'bank');
1012if ($type == Categorie::TYPE_PROJECT) {
1013 if ($user->hasRight(
"project",
"read")) {
1014 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1016 $permission = $user->rights->projet->creer;
1018 $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
1023 $showclassifyform = 1;
1024 if ($showclassifyform) {
1026 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1027 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1028 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1029 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1030 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1031 print
'<input type="hidden" name="action" value="addintocategory">';
1032 print
'<table class="noborder centpercent">';
1033 print
'<tr class="liste_titre"><td>';
1034 print $langs->trans(
"AddObjectIntoCategory").
' ';
1035 $form->selectProjects(
'',
'elemid');
1036 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1042 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1043 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1044 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1045 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1046 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1047 print
'<input type="hidden" name="action" value="list">';
1050 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1051 $num = count($objects);
1052 $nbtotalofrecords =
'';
1053 $newcardbutton =
'';
1055 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1057 print
'<table class="noborder centpecent">'.
"\n";
1058 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1060 if (count($objects) > 0) {
1062 foreach ($objects as $key => $project) {
1068 print
"\t".
'<tr class="oddeven">'.
"\n";
1069 print
'<td class="nowrap tdtop">';
1070 print $project->getNomUrl(1);
1072 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1073 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1075 print
'<td class="right">';
1077 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$project->id.
"'>";
1078 print $langs->trans(
"DeleteFromCat");
1079 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1086 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1090 print
'</form>'.
"\n";
1093 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'project');
1099if ($type == Categorie::TYPE_USER) {
1100 if ($user->hasRight(
"user",
"user",
"read")) {
1101 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1103 $users = $object->getObjectsInCateg($type);
1108 $showclassifyform = 1;
1109 if ($showclassifyform) {
1111 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1112 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1113 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1114 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1115 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1116 print
'<input type="hidden" name="action" value="addintocategory">';
1117 print
'<table class="noborder centpercent">';
1118 print
'<tr class="liste_titre"><td>';
1119 $force_entity =
getEntity($object->element);
1120 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1121 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1122 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1127 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1128 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1129 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1130 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1131 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1132 print
'<input type="hidden" name="action" value="list">';
1136 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1137 $num = count($users);
1138 $nbtotalofrecords =
'';
1139 $newcardbutton =
'';
1141 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1143 print
'<table class="noborder centpecent">'.
"\n";
1144 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1146 if (count($users) > 0) {
1148 foreach ($users as $key => $userentry) {
1149 print
"\t".
'<tr class="oddeven">'.
"\n";
1150 print
'<td class="nowrap tdtop">';
1151 print $userentry->getNomUrl(-1);
1153 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1156 print
'<td class="right">';
1157 if ($user->hasRight(
'user',
'user',
'creer')) {
1158 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$userentry->id.
"'>";
1159 print $langs->trans(
"DeleteFromCat");
1160 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1167 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1171 print
'</form>'.
"\n";
1174 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'user');
1181if ($type == Categorie::TYPE_WAREHOUSE) {
1182 if ($user->hasRight(
"stock",
"read")) {
1183 $permission = $user->rights->stock->creer;
1185 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1187 $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
1191 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1192 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1193 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1194 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1195 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1196 print
'<input type="hidden" name="action" value="list">';
1199 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1200 $num = count($objects);
1201 $nbtotalofrecords =
'';
1202 $newcardbutton =
'';
1204 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1206 print
'<table class="noborder centpecent">'.
"\n";
1207 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1209 if (count($objects) > 0) {
1211 foreach ($objects as $key => $project) {
1217 print
"\t".
'<tr class="oddeven">'.
"\n";
1218 print
'<td class="nowrap tdtop">';
1219 print $project->getNomUrl(1);
1221 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1222 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1224 print
'<td class="right">';
1226 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$project->id.
"'>";
1227 print $langs->trans(
"DeleteFromCat");
1228 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1235 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1239 print
'</form>'.
"\n";
1242 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'stock');
1248if ($type == Categorie::TYPE_TICKET) {
1249 if ($user->hasRight(
"ticket",
"read")) {
1250 $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer);
1252 $tickets = $object->getObjectsInCateg($type, 0, $limit, $offset);
1257 $showclassifyform = 1;
1258 if ($showclassifyform) {
1260 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1261 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1262 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1263 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1264 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1265 print
'<input type="hidden" name="action" value="addintocategory">';
1266 print
'<table class="noborder centpercent">';
1267 print
'<tr class="liste_titre"><td>';
1268 print $langs->trans(
"AddTicketIntoCategory").
' ';
1269 $form->selectTickets(
'',
'elemid');
1270 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1276 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1277 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1278 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1279 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1280 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1281 print
'<input type="hidden" name="action" value="list">';
1284 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1285 $num = count($tickets);
1286 $nbtotalofrecords =
'';
1287 $newcardbutton =
'';
1289 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1292 print
'<table class="noborder centpercent">'.
"\n";
1293 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1295 if (count($tickets) > 0) {
1297 foreach ($tickets as $ticket) {
1303 print
"\t".
'<tr class="oddeven">'.
"\n";
1304 print
'<td class="nowrap tdtop">';
1305 print $ticket->getNomUrl(1);
1307 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1309 print
'<td class="right">';
1311 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".$object->id.
"&type=".$typeid.
"&action=unlink&token=".newToken().
"&removeelem=".$ticket->id.
"'>";
1312 print $langs->trans(
"DeleteFromCat");
1313 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1320 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1324 print
'</form>'.
"\n";
1327 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.