33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
40$langs->loadLangs(array(
"categories",
"compta"));
43$label =
GETPOST(
'label',
'alpha');
47$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
48$massaction =
GETPOST(
'massaction',
'alpha');
50$confirm =
GETPOST(
'confirm',
'alpha');
51$cancel =
GETPOST(
'cancel',
'alpha');
52$toselect =
GETPOST(
'toselect',
'array');
53$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'categorylist';
54$backtopage =
GETPOST(
'backtopage',
'alpha');
55$optioncss =
GETPOST(
'optioncss',
'aZ');
60$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
61$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
63if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
66$offset = $limit * $page;
70if ($id ==
"" && $label ==
"") {
79$result =
$object->fetch($id, $label);
86if (is_numeric($type)) {
87 $type = Categorie::$MAP_ID_TO_CODE[$type];
91$extrafields->fetch_name_optionals_label(
$object->table_element);
94$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
100if ($confirm ==
'no') {
102 header(
"Location: ".$backtopage);
107$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
108$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
110if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
111 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
112 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
114 $result = $tmpobject->fetch($removeelem);
115 $elementtype =
'product';
116 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
118 $result = $tmpobject->fetch($removeelem);
119 $elementtype =
'supplier';
120 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
122 $result = $tmpobject->fetch($removeelem);
123 $elementtype =
'customer';
124 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
125 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
127 $result = $tmpobject->fetch($removeelem);
128 $elementtype =
'member';
129 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
130 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
132 $result = $tmpobject->fetch($removeelem);
133 $elementtype =
'contact';
134 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
135 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
137 $result = $tmpobject->fetch($removeelem);
138 $elementtype =
'account';
139 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
140 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
142 $result = $tmpobject->fetch($removeelem);
143 $elementtype =
'project';
144 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
145 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
146 $tmpobject =
new User($db);
147 $result = $tmpobject->fetch($removeelem);
148 $elementtype =
'user';
149 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
150 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
151 $tmpobject =
new Ticket($db);
152 $result = $tmpobject->fetch($removeelem);
153 $elementtype =
'ticket';
156 $result =
$object->del_type($tmpobject, $elementtype);
162if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
163 if (
$object->delete($user) >= 0) {
165 header(
"Location: ".$backtopage);
168 header(
"Location: ".DOL_URL_ROOT.
'/categories/index.php?type='.$type);
176if ($elemid && $action ==
'addintocategory' &&
178 ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) ||
179 ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) ||
180 ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) ||
181 ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) ||
182 ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) ||
183 ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) ||
184 ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) ||
185 ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) ||
186 ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer'))
188 if ($type == Categorie::TYPE_PRODUCT) {
189 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
191 $elementtype =
'product';
192 } elseif ($type == Categorie::TYPE_CUSTOMER) {
193 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
195 $elementtype =
'customer';
196 } elseif ($type == Categorie::TYPE_SUPPLIER) {
197 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
199 $elementtype =
'supplier';
200 } elseif ($type == Categorie::TYPE_TICKET) {
201 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
202 $newobject =
new Ticket($db);
203 $elementtype =
'ticket';
204 } elseif ($type == Categorie::TYPE_PROJECT) {
205 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
207 $elementtype =
'project';
208 } elseif ($type == Categorie::TYPE_MEMBER) {
209 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
211 $elementtype =
'member';
212 } elseif ($type == Categorie::TYPE_CONTACT) {
213 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
215 $elementtype =
'contact';
216 } elseif ($type == Categorie::TYPE_USER) {
217 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
218 $newobject =
new User($db);
219 $elementtype =
'user';
220 } elseif ($type == Categorie::TYPE_ACCOUNT) {
221 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
223 $elementtype =
'bank_account';
227 $result = $newobject->fetch($elemid);
230 $result =
$object->add_type($newobject, $elementtype);
232 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
234 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
235 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
247$form =
new Form($db);
250$arrayofjs = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
'/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
251$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
255llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
257$title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
262$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type));
263$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
266$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/index.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a> >> ';
267$ways =
$object->print_all_ways(
" >> ",
'', 1);
268foreach ($ways as $way) {
269 $morehtmlref .= $way.
"<br>\n";
271$morehtmlref .=
'</div>';
273dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
280if ($action ==
'delete') {
282 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.$type.
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
284 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.$type, $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
290print
'<div class="fichecenter">';
291print
'<div class="underbanner clearboth"></div>';
292print
'<table class="border centpercent tableforfield">';
295print
'<tr><td class="titlefield notopnoleft tdtop">';
296print $langs->trans(
"Description").
'</td><td>';
301print
'<tr><td class="notopnoleft">';
302print $langs->trans(
"Color").
'</td><td>';
303print $formother->showColor(
$object->color);
307print
'<tr><td class="titlefield notopnoleft">';
308print $langs->trans(
"Position").
'</td><td>';
313include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
325print
"<div class='tabsAction'>\n";
326$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
330if (empty($reshook)) {
331 if ($user->hasRight(
'categorie',
'creer')) {
332 $socid = (
$object->socid ?
"&socid=".$object->socid :
"");
333 print
'<a class="butAction" href="edit.php?id='.$object->id.$socid.
'&type='.$type.
'">'.$langs->trans(
"Modify").
'</a>';
336 if ($user->hasRight(
'categorie',
'supprimer')) {
337 print
'<a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&id='.
$object->id.
'&type='.$type.
'&backtolist='.urlencode($backtolist).
'">'.$langs->trans(
"Delete").
'</a>';
344if ($user->hasRight(
'categorie',
'creer')) {
345 $link = DOL_URL_ROOT.
'/categories/card.php';
346 $link .=
'?action=create';
347 $link .=
'&type='.$type;
348 $link .=
'&catorigin='.$object->id;
349 $link .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?type='.$type.
'&id='.$id);
351 $newcardbutton =
'<div class="right">';
352 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
353 $newcardbutton .=
'</div>';
361print
'<div class="fichecenter">';
363print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
366print
'<table class="liste nohover centpercent borderbottom">';
368print
'<tr class="liste_titre">';
369print
'<td>'.$langs->trans(
"SubCats").
'</td>';
371print
'<td class="right">';
373if (!empty($conf->use_javascript_ajax)) {
374 print
'<div id="iddivjstreecontrol">';
375 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
377 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
387} elseif (count($cats) < 1) {
388 print
'<tr class="oddeven nobottom">';
389 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
394 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
398 if ($type == Categorie::TYPE_MEMBER) {
399 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
401 if ($type == Categorie::TYPE_ACCOUNT) {
402 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
404 if ($type == Categorie::TYPE_PROJECT) {
405 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
407 if ($type == Categorie::TYPE_USER) {
408 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
414 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
"racine",
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
415 foreach ($fulltree as $key => $val) {
416 $categstatic->id = $val[
'id'];
417 $categstatic->ref = $val[
'label'];
418 $categstatic->color = $val[
'color'];
419 $categstatic->type = $type;
425 $elements = $categstatic->getObjectsInCateg($type, 1);
427 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
430 $color = $categstatic->color ?
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"' :
' style="background: #bbb"';
431 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$id.
'&type='.$type));
433 $entry =
'<table class="nobordernopadding centpercent">';
437 $entry .=
'<span class="noborderoncategories" '.$color.
'>'.$li.
'</span>';
442 $entry .=
'<td class="right" width="20px;">';
443 $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>';
445 $entry .=
'<td class="right" width="20px;">';
446 $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>';
448 $entry .=
'<td class="right" width="20px;">';
449 $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>';
453 $entry .=
'</table>';
455 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
458 $nbofentries = (count($data) - 1);
459 if ($nbofentries > 0) {
460 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
461 print
'<tr class="pair">';
462 print
'<td colspan="3">';
470 print
'<tr class="pair">';
471 print
'<td colspan="3">';
472 print
'<table class="nobordernopadding">';
474 print
'<tr class="nobordernopadding">';
475 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
476 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
477 print
'<td> </td>';
490$arrayofmassactions = array(
496$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
502if ($type == Categorie::TYPE_PRODUCT) {
503 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
504 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
506 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset);
511 '@phan-var-force Product[] $prods';
513 $showclassifyform = 1;
514 if ($showclassifyform) {
516 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
517 print
'<input type="hidden" name="token" value="'.newToken().
'">';
518 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
519 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
520 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
521 print
'<input type="hidden" name="action" value="addintocategory">';
522 print
'<table class="noborder centpercent">';
523 print
'<tr class="liste_titre"><td>';
524 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
525 $form->select_produits(
'',
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
526 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
532 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
533 print
'<input type="hidden" name="token" value="'.newToken().
'">';
534 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
535 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
536 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
537 print
'<input type="hidden" name="action" value="list">';
540 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
541 $num = count($prods);
542 $nbtotalofrecords =
'';
543 $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'));
546 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
549 print
'<table class="noborder centpercent">'.
"\n";
550 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
552 if (count($prods) > 0) {
554 foreach ($prods as $prod) {
560 print
"\t".
'<tr class="oddeven">'.
"\n";
561 print
'<td class="nowrap" valign="top">';
562 print $prod->getNomUrl(1);
564 print
'<td class="tdtop">'.$prod->label.
"</td>\n";
566 print
'<td class="right">';
568 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.
'">';
569 print $langs->trans(
"DeleteFromCat");
570 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
577 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
581 print
'</form>'.
"\n";
584 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'products');
590if ($type == Categorie::TYPE_CUSTOMER) {
591 if ($user->hasRight(
"societe",
"read")) {
592 $permission = $user->hasRight(
'societe',
'creer');
594 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset);
599 '@phan-var-force Societe[] $socs';
601 $showclassifyform = 1;
602 if ($showclassifyform) {
604 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
605 print
'<input type="hidden" name="token" value="'.newToken().
'">';
606 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
607 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
608 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
609 print
'<input type="hidden" name="action" value="addintocategory">';
610 print
'<table class="noborder centpercent">';
611 print
'<tr class="liste_titre"><td>';
612 print $langs->trans(
"AddCustomerIntoCategory").
' ';
613 $filter =
'(s.client:IN:1,3)';
614 print $form->select_company(
'',
'elemid', $filter);
615 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
621 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
622 print
'<input type="hidden" name="token" value="'.newToken().
'">';
623 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
624 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
625 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
626 print
'<input type="hidden" name="action" value="list">';
629 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
631 $nbtotalofrecords =
'';
632 $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'));
635 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
637 print
'<table class="noborder centpercent">'.
"\n";
638 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
640 if (count($socs) > 0) {
642 foreach ($socs as $key => $soc) {
648 print
"\t".
'<tr class="oddeven">'.
"\n";
649 print
'<td class="nowrap tdtop">';
650 print $soc->getNomUrl(1);
653 print
'<td class="right">';
655 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.
"'>";
656 print $langs->trans(
"DeleteFromCat");
657 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
664 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
668 print
'</form>'.
"\n";
671 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
677if ($type == Categorie::TYPE_SUPPLIER) {
678 if ($user->hasRight(
"fournisseur",
"read")) {
679 $permission = $user->hasRight(
'societe',
'creer');
681 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset);
687 '@phan-var-force Fournisseur[] $socs';
689 $showclassifyform = 1;
690 if ($showclassifyform) {
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="addintocategory">';
698 print
'<table class="noborder centpercent">';
699 print
'<tr class="liste_titre"><td>';
700 print $langs->trans(
"AddSupplierIntoCategory").
' ';
701 $filter =
'(s.fournisseur:=:1)';
702 print $form->select_company(
'',
'elemid', $filter);
703 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
709 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
710 print
'<input type="hidden" name="token" value="'.newToken().
'">';
711 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
712 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
713 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
714 print
'<input type="hidden" name="action" value="list">';
717 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
719 $nbtotalofrecords =
'';
720 $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'));
723 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
725 print
'<table class="noborder centpercent">'.
"\n";
726 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
728 if (count($socs) > 0) {
730 foreach ($socs as $soc) {
736 print
"\t".
'<tr class="oddeven">'.
"\n";
737 print
'<td class="nowrap tdtop">';
738 print $soc->getNomUrl(1);
741 print
'<td class="right">';
743 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$soc->id.($limit?
'&limit='.$limit:
'').
'">';
744 print $langs->trans(
"DeleteFromCat");
745 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
753 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
757 print
'</form>'.
"\n";
760 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'companies');
766if ($type == Categorie::TYPE_MEMBER) {
767 if ($user->hasRight(
"adherent",
"read")) {
768 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
770 $permission = $user->hasRight(
'adherent',
'creer');
772 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset);
777 '@phan-var-force Adherent[] $members';
779 $showclassifyform = 1;
780 if ($showclassifyform) {
782 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
783 print
'<input type="hidden" name="token" value="'.newToken().
'">';
784 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
785 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
786 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
787 print
'<input type="hidden" name="action" value="addintocategory">';
788 print
'<table class="noborder centpercent">';
789 print
'<tr class="liste_titre"><td>';
790 print $langs->trans(
"AssignCategoryTo").
' ';
791 print $form->selectMembers(
'',
'elemid');
792 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
798 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
799 print
'<input type="hidden" name="token" value="'.newToken().
'">';
800 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
801 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
802 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
803 print
'<input type="hidden" name="action" value="list">';
806 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
807 $num = count($members);
808 $nbtotalofrecords =
'';
809 $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'));
812 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
814 print
'<table class="noborder centpecent">'.
"\n";
815 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
817 if (count($members) > 0) {
819 foreach ($members as $key => $member) {
825 print
"\t".
'<tr class="oddeven">'.
"\n";
826 print
'<td class="nowrap tdtop">';
827 $member->ref = $member->login;
828 print $member->getNomUrl(1, 0);
830 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
831 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
833 print
'<td class="right">';
835 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$member->id.
"'>";
836 print $langs->trans(
"DeleteFromCat");
837 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
844 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
848 print
'</form>'.
"\n";
851 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'members');
857if ($type == Categorie::TYPE_CONTACT) {
858 if ($user->hasRight(
"societe",
"read")) {
859 $permission = $user->hasRight(
'societe',
'creer');
861 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
862 if (is_numeric($contacts) && $contacts < 0) {
866 '@phan-var-force Contact[] $contacts';
868 $showclassifyform = 1;
869 if ($showclassifyform) {
871 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
872 print
'<input type="hidden" name="token" value="'.newToken().
'">';
873 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
874 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
875 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
876 print
'<input type="hidden" name="action" value="addintocategory">';
877 print
'<table class="noborder centpercent">';
878 print
'<tr class="liste_titre"><td>';
879 print $langs->trans(
"AssignCategoryTo").
' ';
881 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
882 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
887 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
888 print
'<input type="hidden" name="token" value="'.newToken().
'">';
889 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
890 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
891 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
892 print
'<input type="hidden" name="action" value="list">';
895 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
896 $num = count($contacts);
897 $nbtotalofrecords =
'';
898 $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'));
901 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
905 print
'<table class="noborder centpercent">'.
"\n";
906 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
908 if (is_array($contacts) && count($contacts) > 0) {
910 foreach ($contacts as $key => $contact) {
916 print
"\t".
'<tr class="oddeven">'.
"\n";
917 print
'<td class="nowrap tdtop">';
918 print $contact->getNomUrl(1,
'category');
919 if ($contact->socid > 0) {
920 $objsoc->fetch($contact->socid);
922 print $objsoc->getNomUrl(1,
'contact');
926 print
'<td class="right">';
928 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$contact->id.
"'>";
929 print $langs->trans(
"DeleteFromCat");
930 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
937 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
941 print
'</form>'.
"\n";
944 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'contact');
950if ($type == Categorie::TYPE_ACCOUNT) {
951 if ($user->hasRight(
"banque",
"read")) {
952 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
954 $permission = $user->hasRight(
'banque',
'creer');
956 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
961 '@phan-var-force Account[] $accounts';
963 $showclassifyform = 1;
964 if ($showclassifyform) {
966 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
967 print
'<input type="hidden" name="token" value="'.newToken().
'">';
968 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
969 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
970 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
971 print
'<input type="hidden" name="action" value="addintocategory">';
972 print
'<table class="noborder centpercent">';
973 print
'<tr class="liste_titre"><td>';
974 print $langs->trans(
"AddObjectIntoCategory").
' ';
975 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
976 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
982 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
983 print
'<input type="hidden" name="token" value="'.newToken().
'">';
984 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
985 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
986 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
987 print
'<input type="hidden" name="action" value="list">';
990 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
991 $num = count($accounts);
992 $nbtotalofrecords =
'';
996 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
998 print
'<table class="noborder centpecent">'.
"\n";
999 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1001 if (count($accounts) > 0) {
1003 foreach ($accounts as $key => $account) {
1009 print
"\t".
'<tr class="oddeven">'.
"\n";
1010 print
'<td class="nowrap tdtop">';
1011 print $account->getNomUrl(1, 0);
1013 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1014 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1016 print
'<td class="right">';
1018 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$account->id.
"'>";
1019 print $langs->trans(
"DeleteFromCat");
1020 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1027 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1031 print
'</form>'.
"\n";
1034 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'bank');
1040if ($type == Categorie::TYPE_PROJECT) {
1041 if ($user->hasRight(
"project",
"read")) {
1042 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1044 $permission = $user->hasRight(
'projet',
'creer');
1046 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1051 '@phan-var-force Project $object';
1053 $showclassifyform = 1;
1054 if ($showclassifyform) {
1056 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1057 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1058 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1059 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1060 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1061 print
'<input type="hidden" name="action" value="addintocategory">';
1062 print
'<table class="noborder centpercent">';
1063 print
'<tr class="liste_titre"><td>';
1064 print $langs->trans(
"AddObjectIntoCategory").
' ';
1065 $form->selectProjects(
'',
'elemid');
1066 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1072 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1073 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1074 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1075 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1076 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1077 print
'<input type="hidden" name="action" value="list">';
1080 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1081 $num = count($objects);
1082 $nbtotalofrecords =
'';
1083 $newcardbutton =
'';
1086 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1088 print
'<table class="noborder centpecent">'.
"\n";
1089 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1091 if (count($objects) > 0) {
1093 foreach ($objects as $key => $project) {
1099 print
"\t".
'<tr class="oddeven">'.
"\n";
1100 print
'<td class="nowrap tdtop">';
1101 print $project->getNomUrl(1);
1103 print
'<td class="tdtop">'.$project->ref.
"</td>\n";
1104 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1106 print
'<td class="right">';
1108 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$project->id.
"'>";
1109 print $langs->trans(
"DeleteFromCat");
1110 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1117 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1121 print
'</form>'.
"\n";
1124 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'project');
1130if ($type == Categorie::TYPE_USER) {
1131 if ($user->hasRight(
"user",
"user",
"read")) {
1132 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1134 $users =
$object->getObjectsInCateg($type);
1139 '@phan-var-force User[] $users';
1141 $showclassifyform = 1;
1142 if ($showclassifyform) {
1144 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1145 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1146 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1147 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1148 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1149 print
'<input type="hidden" name="action" value="addintocategory">';
1150 print
'<table class="noborder centpercent">';
1151 print
'<tr class="liste_titre"><td>';
1153 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1154 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1155 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1160 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1161 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1162 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1163 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1164 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1165 print
'<input type="hidden" name="action" value="list">';
1169 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1170 $num = count($users);
1171 $nbtotalofrecords =
'';
1172 $newcardbutton =
'';
1175 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1177 print
'<table class="noborder centpecent">'.
"\n";
1178 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1180 if (count($users) > 0) {
1182 foreach ($users as $key => $userentry) {
1183 print
"\t".
'<tr class="oddeven">'.
"\n";
1184 print
'<td class="nowrap tdtop">';
1185 print $userentry->getNomUrl(-1);
1187 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1190 print
'<td class="right">';
1191 if ($user->hasRight(
'user',
'user',
'creer')) {
1192 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$userentry->id.
"'>";
1193 print $langs->trans(
"DeleteFromCat");
1194 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1201 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1205 print
'</form>'.
"\n";
1208 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'user');
1215if ($type == Categorie::TYPE_WAREHOUSE) {
1216 if ($user->hasRight(
"stock",
"read")) {
1217 $permission = $user->hasRight(
'stock',
'creer');
1219 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1221 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1226 '@phan-var-force Entrepot[] $objects';
1227 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1228 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1229 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1230 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1231 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1232 print
'<input type="hidden" name="action" value="list">';
1235 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1236 $num = count($objects);
1237 $nbtotalofrecords =
'';
1238 $newcardbutton =
'';
1241 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1243 print
'<table class="noborder centpecent">'.
"\n";
1244 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1246 if (count($objects) > 0) {
1248 foreach ($objects as $key => $warehouse) {
1254 print
"\t".
'<tr class="oddeven">'.
"\n";
1255 print
'<td class="nowrap tdtop">';
1256 print $warehouse->getNomUrl(1);
1258 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1259 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1261 print
'<td class="right">';
1263 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$warehouse->id.
"'>";
1264 print $langs->trans(
"DeleteFromCat");
1265 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1272 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1276 print
'</form>'.
"\n";
1279 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'stock');
1285if ($type == Categorie::TYPE_TICKET) {
1286 if ($user->hasRight(
"ticket",
"read")) {
1287 $permission = $user->hasRight(
'categorie',
'creer');
1289 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1294 '@phan-var-force Ticket[] $tickets';
1296 $showclassifyform = 1;
1297 if ($showclassifyform) {
1299 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1300 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1301 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1302 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1303 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1304 print
'<input type="hidden" name="action" value="addintocategory">';
1305 print
'<table class="noborder centpercent">';
1306 print
'<tr class="liste_titre"><td>';
1307 print $langs->trans(
"AddTicketIntoCategory").
' ';
1308 $form->selectTickets(
'',
'elemid');
1309 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1315 print
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
1316 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1317 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1318 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1319 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1320 print
'<input type="hidden" name="action" value="list">';
1323 $param =
'&limit='.$limit.
'&id='.$id.
'&type='.$type;
1324 $num = count($tickets);
1325 $nbtotalofrecords =
'';
1326 $newcardbutton =
'';
1329 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1332 print
'<table class="noborder centpercent">'.
"\n";
1333 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1335 if (count($tickets) > 0) {
1337 foreach ($tickets as $ticket) {
1343 print
"\t".
'<tr class="oddeven">'.
"\n";
1344 print
'<td class="nowrap tdtop">';
1345 print $ticket->getNomUrl(1);
1347 print
'<td class="tdtop">'.$ticket->label.
"</td>\n";
1349 print
'<td class="right">';
1351 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$ticket->id.
"'>";
1352 print $langs->trans(
"DeleteFromCat");
1353 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'',
false, 0, 0,
'',
'paddingleft');
1360 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1364 print
'</form>'.
"\n";
1367 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'',
'',
'',
'ticket');
1373$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1374$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()
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.
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.
print_barre_liste($title, $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.
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.
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 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.