34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41$langs->loadLangs(array(
"categories",
"compta"));
44$label =
GETPOST(
'label',
'alpha');
48$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
49$massaction =
GETPOST(
'massaction',
'alpha');
51$confirm =
GETPOST(
'confirm',
'alpha');
52$cancel =
GETPOST(
'cancel',
'alpha');
53$toselect =
GETPOST(
'toselect',
'array');
54$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'categorylist';
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$optioncss =
GETPOST(
'optioncss',
'aZ');
61$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
62$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
64if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
67$offset = $limit * $page;
71if ($id ==
"" && $label ==
"") {
77$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
83$result =
$object->fetch($id, $label);
90if (is_numeric($type)) {
91 $type = Categorie::$MAP_ID_TO_CODE[$type];
95$extrafields->fetch_name_optionals_label(
$object->table_element);
101if ($confirm ==
'no') {
103 header(
"Location: ".$backtopage);
108$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
109$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
111if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
113 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
114 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
116 $result = $tmpobject->fetch($removeelem);
117 $elementtype =
'product';
118 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
120 $result = $tmpobject->fetch($removeelem);
121 $elementtype =
'supplier';
122 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
124 $result = $tmpobject->fetch($removeelem);
125 $elementtype =
'customer';
126 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
127 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
129 $result = $tmpobject->fetch($removeelem);
130 $elementtype =
'member';
131 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
132 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
134 $result = $tmpobject->fetch($removeelem);
135 $elementtype =
'contact';
136 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
137 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
139 $result = $tmpobject->fetch($removeelem);
140 $elementtype =
'account';
141 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
142 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
144 $result = $tmpobject->fetch($removeelem);
145 $elementtype =
'project';
146 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
147 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
148 $tmpobject =
new User($db);
149 $result = $tmpobject->fetch($removeelem);
150 $elementtype =
'user';
151 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
152 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
153 $tmpobject =
new Ticket($db);
154 $result = $tmpobject->fetch($removeelem);
155 $elementtype =
'ticket';
158 $result =
$object->del_type($tmpobject, $elementtype);
164if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
165 if (
$object->delete($user) >= 0) {
167 header(
"Location: ".$backtopage);
170 header(
"Location: ".DOL_URL_ROOT.
'/categories/index.php?type='.$type);
178if ($elemid && $action ==
'addintocategory') {
179 if (($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) ||
180 ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) ||
181 ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) ||
182 ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) ||
183 ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) ||
184 ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) ||
185 ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) ||
186 ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) ||
187 ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer'))
190 if ($type == Categorie::TYPE_PRODUCT) {
191 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
193 $elementtype =
'product';
194 } elseif ($type == Categorie::TYPE_CUSTOMER) {
195 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
197 $elementtype =
'customer';
198 } elseif ($type == Categorie::TYPE_SUPPLIER) {
199 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
201 $elementtype =
'supplier';
202 } elseif ($type == Categorie::TYPE_TICKET) {
203 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
204 $newobject =
new Ticket($db);
205 $elementtype =
'ticket';
206 } elseif ($type == Categorie::TYPE_PROJECT) {
207 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
209 $elementtype =
'project';
210 } elseif ($type == Categorie::TYPE_MEMBER) {
211 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
213 $elementtype =
'member';
214 } elseif ($type == Categorie::TYPE_CONTACT) {
215 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
217 $elementtype =
'contact';
218 } elseif ($type == Categorie::TYPE_USER) {
219 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
220 $newobject =
new User($db);
221 $elementtype =
'user';
222 } elseif ($type == Categorie::TYPE_ACCOUNT) {
223 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
225 $elementtype =
'bank_account';
229 if ($newobject !==
null) {
230 $result = $newobject->fetch($elemid);
234 $result =
$object->add_type($newobject, $elementtype);
236 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
238 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
239 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
252$form =
new Form($db);
255$arrayofjs = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
'/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
256$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
260llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
262$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
267$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type));
268$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
271$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
272$ways =
$object->print_all_ways(
" >> ",
'', 1);
273foreach ($ways as $way) {
274 $morehtmlref .= $way.
"<br>\n";
276$morehtmlref .=
'</div>';
278dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
285if ($action ==
'delete') {
287 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.$type.
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
289 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.$type, $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
295print
'<div class="fichecenter">';
296print
'<div class="underbanner clearboth"></div>';
297print
'<table class="border centpercent tableforfield">';
300print
'<tr><td class="titlefield notopnoleft tdtop">';
301print $langs->trans(
"Description").
'</td><td>';
306print
'<tr><td class="notopnoleft">';
307print $langs->trans(
"Color").
'</td><td>';
308print $formother->showColor(
$object->color);
312print
'<tr><td class="titlefield notopnoleft">';
313print $langs->trans(
"Position").
'</td><td>';
318include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
330print
"<div class='tabsAction'>\n";
331$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
335if (empty($reshook)) {
336 if ($user->hasRight(
'categorie',
'creer')) {
337 $socid = (
$object->socid ?
"&socid=".$object->socid :
"");
338 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.$type.
'">'.$langs->trans(
"Modify").
'</a>';
341 if ($user->hasRight(
'categorie',
'supprimer')) {
342 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'&type='.$type.
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
349if ($user->hasRight(
'categorie',
'creer')) {
350 $link = DOL_URL_ROOT.
'/categories/card.php';
351 $link .=
'?action=create';
352 $link .=
'&type='.$type;
353 $link .=
'&catorigin='.$object->id;
354 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
356 $newcardbutton =
'<div class="right">';
357 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
358 $newcardbutton .=
'</div>';
366print
'<div class="fichecenter">';
368print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
371print
'<table class="liste nohover centpercent borderbottom">';
373print
'<tr class="liste_titre">';
374print
'<td>'.$langs->trans(
"SubCats").
'</td>';
376print
'<td class="right">';
378if (!empty($conf->use_javascript_ajax)) {
379 print
'<div id="iddivjstreecontrol">';
380 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
382 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
392} elseif (count($cats) < 1) {
393 print
'<tr class="oddeven nobottom">';
394 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
399 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
403 if ($type == Categorie::TYPE_MEMBER) {
404 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
406 if ($type == Categorie::TYPE_ACCOUNT) {
407 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
409 if ($type == Categorie::TYPE_PROJECT) {
410 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
412 if ($type == Categorie::TYPE_USER) {
413 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
419 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
"racine",
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
420 foreach ($fulltree as $key => $val) {
421 $categstatic->id = $val[
'id'];
422 $categstatic->ref = $val[
'label'];
423 $categstatic->color = $val[
'color'];
424 $categstatic->type = $type;
430 $elements = $categstatic->getObjectsInCateg($type, 1);
432 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
435 $color = $categstatic->color ?
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"' :
' style="background: #bbb"';
436 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.$type));
438 $entry =
'<table class="nobordernopadding centpercent">';
442 $entry .=
'<span class="noborderoncategories" '.$color.
'>'.$li.
'</span>';
447 $entry .=
'<td class="right" width="20px;">';
448 $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>';
450 $entry .=
'<td class="right" width="20px;">';
451 $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>';
453 $entry .=
'<td class="right" width="20px;">';
454 $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>';
458 $entry .=
'</table>';
460 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
463 $nbofentries = (count($data) - 1);
464 if ($nbofentries > 0) {
465 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
466 print
'<tr class="pair">';
467 print
'<td colspan="3">';
475 print
'<tr class="pair">';
476 print
'<td colspan="3">';
477 print
'<table class="nobordernopadding">';
479 print
'<tr class="nobordernopadding">';
480 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
481 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
482 print
'<td> </td>';
495$arrayofmassactions = array(
501$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
507if ($type == Categorie::TYPE_PRODUCT) {
508 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
509 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
511 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset);
516 '@phan-var-force Product[] $prods';
518 $showclassifyform = 1;
519 if ($showclassifyform) {
521 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
522 print
'<input type="hidden" name="token" value="'.newToken().
'">';
523 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
524 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
525 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
526 print
'<input type="hidden" name="action" value="addintocategory">';
527 print
'<table class="noborder centpercent">';
528 print
'<tr class="liste_titre"><td>';
529 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
530 $form->select_produits(
'',
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
531 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
537 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
538 print
'<input type="hidden" name="token" value="'.newToken().
'">';
539 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
540 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
541 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
542 print
'<input type="hidden" name="action" value="list">';
545 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
546 $num = count($prods);
547 $nbtotalofrecords =
'';
548 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddProduct"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/product/card.php?action=create&categories[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
551 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
554 print
'<table class="noborder centpercent">'.
"\n";
555 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
557 if (count($prods) > 0) {
559 foreach ($prods as $prod) {
565 print
"\t".
'<tr class="oddeven">'.
"\n";
566 print
'<td class="nowrap" valign="top">';
567 print $prod->getNomUrl(1);
569 print
'<td class="tdtop">'.$prod->label.
"</td>\n";
571 print
'<td class="right">';
573 print
'<a class="reposition" href= "'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".((
int)
$object->id).
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".$prod->id.
'">';
574 print $langs->trans(
"DeleteFromCat");
575 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
582 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
586 print
'</form>'.
"\n";
589 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
595if ($type == Categorie::TYPE_CUSTOMER) {
596 if ($user->hasRight(
"societe",
"read")) {
597 $permission = $user->hasRight(
'societe',
'creer');
599 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset);
604 '@phan-var-force Societe[] $socs';
606 $showclassifyform = 1;
607 if ($showclassifyform) {
609 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
610 print
'<input type="hidden" name="token" value="'.newToken().
'">';
611 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
612 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
613 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
614 print
'<input type="hidden" name="action" value="addintocategory">';
615 print
'<table class="noborder centpercent">';
616 print
'<tr class="liste_titre"><td>';
617 print $langs->trans(
"AddCustomerIntoCategory").
' ';
618 $filter =
'(s.client:IN:1,3)';
619 print $form->select_company(
'',
'elemid', $filter);
620 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
626 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
627 print
'<input type="hidden" name="token" value="'.newToken().
'">';
628 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
629 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
630 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
631 print
'<input type="hidden" name="action" value="list">';
634 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
636 $nbtotalofrecords =
'';
637 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddThirdParty"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/societe/card.php?action=create&client=3&custcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
640 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
642 print
'<table class="noborder centpercent">'.
"\n";
643 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
645 if (count($socs) > 0) {
647 foreach ($socs as $key => $soc) {
653 print
"\t".
'<tr class="oddeven">'.
"\n";
654 print
'<td class="nowrap tdtop">';
655 print $soc->getNomUrl(1);
658 print
'<td class="right">';
660 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.
"'>";
661 print $langs->trans(
"DeleteFromCat");
662 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
669 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
673 print
'</form>'.
"\n";
676 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
682if ($type == Categorie::TYPE_SUPPLIER) {
683 if ($user->hasRight(
"fournisseur",
"read")) {
684 $permission = $user->hasRight(
'societe',
'creer');
686 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset);
692 '@phan-var-force Fournisseur[] $socs';
694 $showclassifyform = 1;
695 if ($showclassifyform) {
697 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
698 print
'<input type="hidden" name="token" value="'.newToken().
'">';
699 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
700 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
701 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
702 print
'<input type="hidden" name="action" value="addintocategory">';
703 print
'<table class="noborder centpercent">';
704 print
'<tr class="liste_titre"><td>';
705 print $langs->trans(
"AddSupplierIntoCategory").
' ';
706 $filter =
'(s.fournisseur:=:1)';
707 print $form->select_company(
'',
'elemid', $filter);
708 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
714 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
715 print
'<input type="hidden" name="token" value="'.newToken().
'">';
716 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
717 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
718 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
719 print
'<input type="hidden" name="action" value="list">';
722 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
724 $nbtotalofrecords =
'';
725 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddSupplier"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/societe/card.php?action=create&fournisseur=1&suppcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
728 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
730 print
'<table class="noborder centpercent">'.
"\n";
731 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
733 if (count($socs) > 0) {
735 foreach ($socs as $soc) {
741 print
"\t".
'<tr class="oddeven">'.
"\n";
742 print
'<td class="nowrap tdtop">';
743 print $soc->getNomUrl(1);
746 print
'<td class="right">';
748 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.($limit ?
'&limit='.$limit :
'').
'">';
749 print $langs->trans(
"DeleteFromCat");
750 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
758 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
762 print
'</form>'.
"\n";
765 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
771if ($type == Categorie::TYPE_MEMBER) {
772 if ($user->hasRight(
"adherent",
"read")) {
773 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
775 $permission = $user->hasRight(
'adherent',
'creer');
777 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset);
782 '@phan-var-force Adherent[] $members';
784 $showclassifyform = 1;
785 if ($showclassifyform) {
787 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
788 print
'<input type="hidden" name="token" value="'.newToken().
'">';
789 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
790 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
791 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
792 print
'<input type="hidden" name="action" value="addintocategory">';
793 print
'<table class="noborder centpercent">';
794 print
'<tr class="liste_titre"><td>';
795 print $langs->trans(
"AssignCategoryTo").
' ';
796 print $form->selectMembers(
'',
'elemid');
797 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
803 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
804 print
'<input type="hidden" name="token" value="'.newToken().
'">';
805 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
806 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
807 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
808 print
'<input type="hidden" name="action" value="list">';
811 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
812 $num = count($members);
813 $nbtotalofrecords =
'';
814 $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'));
817 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
819 print
'<table class="noborder centpercent">'.
"\n";
820 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
822 if (count($members) > 0) {
824 foreach ($members as $key => $member) {
830 print
"\t".
'<tr class="oddeven">'.
"\n";
831 print
'<td class="nowrap tdtop">';
832 $member->ref = $member->login;
833 print $member->getNomUrl(1, 0);
835 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
836 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
838 print
'<td class="right">';
840 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$member->id.
"'>";
841 print $langs->trans(
"DeleteFromCat");
842 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
849 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
853 print
'</form>'.
"\n";
856 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
862if ($type == Categorie::TYPE_CONTACT) {
863 if ($user->hasRight(
"societe",
"read")) {
864 $permission = $user->hasRight(
'societe',
'creer');
866 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
867 if (is_numeric($contacts) && $contacts < 0) {
871 '@phan-var-force Contact[] $contacts';
873 $showclassifyform = 1;
874 if ($showclassifyform) {
876 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
877 print
'<input type="hidden" name="token" value="'.newToken().
'">';
878 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
879 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
880 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
881 print
'<input type="hidden" name="action" value="addintocategory">';
882 print
'<table class="noborder centpercent">';
883 print
'<tr class="liste_titre"><td>';
884 print $langs->trans(
"AssignCategoryTo").
' ';
886 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
887 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
892 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
893 print
'<input type="hidden" name="token" value="'.newToken().
'">';
894 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
895 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
896 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
897 print
'<input type="hidden" name="action" value="list">';
900 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
901 $num = count($contacts);
902 $nbtotalofrecords =
'';
903 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddContact"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/contact/card.php?action=create&contcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
906 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
910 print
'<table class="noborder centpercent">'.
"\n";
911 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
913 if (is_array($contacts) && count($contacts) > 0) {
915 foreach ($contacts as $key => $contact) {
921 print
"\t".
'<tr class="oddeven">'.
"\n";
922 print
'<td class="nowrap tdtop">';
923 print $contact->getNomUrl(1,
'category');
924 if ($contact->socid > 0) {
925 $objsoc->fetch($contact->socid);
927 print $objsoc->getNomUrl(1,
'contact');
931 print
'<td class="right">';
933 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$contact->id.
"'>";
934 print $langs->trans(
"DeleteFromCat");
935 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
942 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
946 print
'</form>'.
"\n";
949 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
955if ($type == Categorie::TYPE_ACCOUNT) {
956 if ($user->hasRight(
"banque",
"read")) {
957 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
959 $permission = $user->hasRight(
'banque',
'creer');
961 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
966 '@phan-var-force Account[] $accounts';
968 $showclassifyform = 1;
969 if ($showclassifyform) {
971 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
972 print
'<input type="hidden" name="token" value="'.newToken().
'">';
973 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
974 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
975 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
976 print
'<input type="hidden" name="action" value="addintocategory">';
977 print
'<table class="noborder centpercent">';
978 print
'<tr class="liste_titre"><td>';
979 print $langs->trans(
"AddObjectIntoCategory").
' ';
980 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
981 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
987 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
988 print
'<input type="hidden" name="token" value="'.newToken().
'">';
989 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
990 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
991 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
992 print
'<input type="hidden" name="action" value="list">';
995 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
996 $num = count($accounts);
997 $nbtotalofrecords =
'';
1001 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1003 print
'<table class="noborder centpercent">'.
"\n";
1004 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1006 if (count($accounts) > 0) {
1008 foreach ($accounts as $key => $account) {
1014 print
"\t".
'<tr class="oddeven">'.
"\n";
1015 print
'<td class="nowrap tdtop">';
1016 print $account->getNomUrl(1, 0);
1018 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1019 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1021 print
'<td class="right">';
1023 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$account->id.
"'>";
1024 print $langs->trans(
"DeleteFromCat");
1025 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1032 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1036 print
'</form>'.
"\n";
1039 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1045if ($type == Categorie::TYPE_PROJECT) {
1046 if ($user->hasRight(
"project",
"read")) {
1047 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1049 $permission = $user->hasRight(
'projet',
'creer');
1051 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1056 '@phan-var-force Project $object';
1058 $showclassifyform = 1;
1059 if ($showclassifyform) {
1061 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1062 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1063 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1064 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1065 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1066 print
'<input type="hidden" name="action" value="addintocategory">';
1067 print
'<table class="noborder centpercent">';
1068 print
'<tr class="liste_titre"><td>';
1069 print $langs->trans(
"AddObjectIntoCategory").
' ';
1070 $form->selectProjects(
'',
'elemid');
1071 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1077 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1078 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1079 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1080 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1081 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1082 print
'<input type="hidden" name="action" value="list">';
1085 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1086 $num = count($objects);
1087 $nbtotalofrecords =
'';
1088 $newcardbutton =
'';
1091 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1093 print
'<table class="noborder centpercent">'.
"\n";
1094 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1096 if (count($objects) > 0) {
1098 foreach ($objects as $key => $project) {
1104 print
"\t".
'<tr class="oddeven">'.
"\n";
1105 print
'<td class="nowrap tdtop">';
1106 print $project->getNomUrl(1);
1108 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1109 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1111 print
'<td class="right">';
1113 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$project->id.
"'>";
1114 print $langs->trans(
"DeleteFromCat");
1115 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1122 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1126 print
'</form>'.
"\n";
1129 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1135if ($type == Categorie::TYPE_USER) {
1136 if ($user->hasRight(
"user",
"user",
"read")) {
1137 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1139 $users =
$object->getObjectsInCateg($type);
1144 '@phan-var-force User[] $users';
1146 $showclassifyform = 1;
1147 if ($showclassifyform) {
1149 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1150 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1151 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1152 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1153 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1154 print
'<input type="hidden" name="action" value="addintocategory">';
1155 print
'<table class="noborder centpercent">';
1156 print
'<tr class="liste_titre"><td>';
1158 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1159 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1160 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1165 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1166 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1167 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1168 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1169 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1170 print
'<input type="hidden" name="action" value="list">';
1174 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1175 $num = count($users);
1176 $nbtotalofrecords =
'';
1177 $newcardbutton =
'';
1180 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1182 print
'<table class="noborder centpercent">'.
"\n";
1183 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1185 if (count($users) > 0) {
1187 foreach ($users as $key => $userentry) {
1188 print
"\t".
'<tr class="oddeven">'.
"\n";
1189 print
'<td class="nowrap tdtop">';
1190 print $userentry->getNomUrl(-1);
1192 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1195 print
'<td class="right">';
1196 if ($user->hasRight(
'user',
'user',
'creer')) {
1197 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$userentry->id.
"'>";
1198 print $langs->trans(
"DeleteFromCat");
1199 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1206 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1210 print
'</form>'.
"\n";
1213 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1220if ($type == Categorie::TYPE_WAREHOUSE) {
1221 if ($user->hasRight(
"stock",
"read")) {
1222 $permission = $user->hasRight(
'stock',
'creer');
1224 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1226 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1231 '@phan-var-force Entrepot[] $objects';
1232 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1233 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1234 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1235 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1236 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1237 print
'<input type="hidden" name="action" value="list">';
1240 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1241 $num = count($objects);
1242 $nbtotalofrecords =
'';
1243 $newcardbutton =
'';
1246 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1248 print
'<table class="noborder centpercent">'.
"\n";
1249 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1251 if (count($objects) > 0) {
1253 foreach ($objects as $key => $warehouse) {
1259 print
"\t".
'<tr class="oddeven">'.
"\n";
1260 print
'<td class="nowrap tdtop">';
1261 print $warehouse->getNomUrl(1);
1263 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1264 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1266 print
'<td class="right">';
1268 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$warehouse->id.
"'>";
1269 print $langs->trans(
"DeleteFromCat");
1270 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1277 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1281 print
'</form>'.
"\n";
1284 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1290if ($type == Categorie::TYPE_TICKET) {
1291 if ($user->hasRight(
"ticket",
"read")) {
1292 $permission = $user->hasRight(
'categorie',
'creer');
1294 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1299 '@phan-var-force Ticket[] $tickets';
1301 $showclassifyform = 1;
1302 if ($showclassifyform) {
1304 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1305 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1306 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1307 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1308 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1309 print
'<input type="hidden" name="action" value="addintocategory">';
1310 print
'<table class="noborder centpercent">';
1311 print
'<tr class="liste_titre"><td>';
1312 print $langs->trans(
"AddTicketIntoCategory").
' ';
1313 $form->selectTickets(
'',
'elemid');
1314 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1320 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1321 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1322 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1323 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1324 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1325 print
'<input type="hidden" name="action" value="list">';
1328 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1329 $num = count($tickets);
1330 $nbtotalofrecords =
'';
1331 $newcardbutton =
'';
1334 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1337 print
'<table class="noborder centpercent">'.
"\n";
1338 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1340 if (count($tickets) > 0) {
1342 foreach ($tickets as $ticket) {
1348 print
"\t".
'<tr class="oddeven">'.
"\n";
1349 print
'<td class="nowrap tdtop">';
1350 print $ticket->getNomUrl(1);
1352 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1354 print
'<td class="right">';
1356 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$ticket->id.
"'>";
1357 print $langs->trans(
"DeleteFromCat");
1358 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1365 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1369 print
'</form>'.
"\n";
1372 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1378$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1379$reshook = $hookmanager->executeHooks(
'addMoreCategoriesList', $parameters, $object, $action);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
categories_prepare_head(Categorie $object, $type)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage members of a foundation.
Class to manage categories.
Class to manage products or services.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_view($titlealt='default', $float=0, $other='class="valignmiddle"')
Show logo view card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.