36require
'../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
50$langs->loadLangs(array(
"categories",
"compta",
"mrp",
"stocks"));
52$action =
GETPOST(
'action',
'aZ09') ?
GETPOST(
'action',
'aZ09') :
'view';
53$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array:int');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'categorylist';
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$optioncss =
GETPOST(
'optioncss',
'aZ');
63$label =
GETPOST(
'label',
'alpha');
67if (
GETPOST(
'addintocategory')) {
68 $action =
'addintocategory';
74$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
75$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
77if (empty($page) || $page == -1 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha') || (empty($toselect) && $massaction ===
'0')) {
80$offset = $limit * $page;
84if ($id ==
"" && $label ==
"") {
85 dol_print_error(
null,
'Missing parameter id');
90$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
93$result =
$object->fetch($id, $label);
95 dol_print_error($db,
$object->error);
103if (is_numeric($type)) {
104 $type = array_search($type,
$object->MAP_ID);
107$extrafields->fetch_name_optionals_label(
$object->table_element);
113if ($confirm ==
'no') {
115 header(
"Location: ".$backtopage);
119$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
120$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
122if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
125 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
126 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
128 $result = $tmpobject->fetch($removeelem);
129 $elementtype =
'product';
130 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
132 $result = $tmpobject->fetch($removeelem);
133 $elementtype =
'supplier';
134 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
136 $result = $tmpobject->fetch($removeelem);
137 $elementtype =
'customer';
138 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
139 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
141 $result = $tmpobject->fetch($removeelem);
142 $elementtype =
'member';
143 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
144 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
146 $result = $tmpobject->fetch($removeelem);
147 $elementtype =
'contact';
148 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
149 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
151 $result = $tmpobject->fetch($removeelem);
152 $elementtype =
'account';
153 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
154 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
156 $result = $tmpobject->fetch($removeelem);
157 $elementtype =
'project';
158 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
159 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
160 $tmpobject =
new User($db);
161 $result = $tmpobject->fetch($removeelem);
162 $elementtype =
'user';
163 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
164 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
165 $tmpobject =
new Ticket($db);
166 $result = $tmpobject->fetch($removeelem);
167 $elementtype =
'ticket';
168 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
169 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
171 $result = $tmpobject->fetch($removeelem);
172 $elementtype =
'fichinter';
173 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
174 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
176 $result = $tmpobject->fetch($removeelem);
177 $elementtype =
'order';
178 } elseif ($type == Categorie::TYPE_MO && $user->hasRight(
'mrp',
'write')) {
179 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
180 $tmpobject =
new Mo($db);
181 $result = $tmpobject->fetch($removeelem);
183 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
184 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
186 $result = $tmpobject->fetch($removeelem);
187 $elementtype =
'invoice';
188 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
189 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
191 $result = $tmpobject->fetch($removeelem);
192 $elementtype =
'supplier_order';
194 dol_print_error(
null,
"Not supported value of type = ".$type);
198 if ($tmpobject !==
null) {
200 $result =
$object->del_type($tmpobject, $elementtype);
202 dol_print_error(
null,
$object->error);
207if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
209 if (
$object->delete($user) >= 0) {
211 header(
"Location: ".$backtopage);
214 header(
"Location: ".
dolBuildUrl(DOL_URL_ROOT.
'/categories/categorie_list.php', [
'type' => $type]));
222if ($elemid && $action ==
'addintocategory') {
225 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
226 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
228 $elementtype =
'product';
229 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
230 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
232 $elementtype =
'customer';
233 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
234 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
236 $elementtype =
'supplier';
237 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
238 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
239 $newobject =
new Ticket($db);
240 $elementtype =
'ticket';
241 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
242 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
244 $elementtype =
'fichinter';
245 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
246 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
248 $elementtype =
'project';
249 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
250 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
252 $elementtype =
'member';
253 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
254 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
256 $elementtype =
'contact';
257 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
258 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
259 $newobject =
new User($db);
260 $elementtype =
'user';
261 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
262 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
264 $elementtype =
'bank_account';
265 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
266 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
268 $elementtype =
'order';
269 } elseif ($type == Categorie::TYPE_MO && $user->hasRight(
'mrp',
'write')) {
270 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
271 $newobject =
new Mo($db);
273 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
274 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
276 $elementtype =
'invoice';
277 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
278 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
280 $elementtype =
'supplier_order';
281 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
282 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
284 $elementtype =
'supplier_invoice';
286 dol_print_error(
null,
"Not supported value of type = ".$type);
288 if ($newobject !==
null) {
289 $result = $newobject->fetch($elemid);
292 if ($result >= 0 && $newobject !==
null) {
294 $result =
$object->add_type($newobject, $elementtype);
297 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
299 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
300 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
312$form =
new Form($db);
316 '/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
317 '/public/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
319$arrayofcss = array(
'/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
323llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
325$title = $langs->trans(
"Categories");
326$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
331$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
332$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
335$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a>';
336$morehtmlref .=
' > ';
337$ways =
$object->print_all_ways(
"auto",
'', 1, 0, 1);
338foreach ($ways as $way) {
339 $morehtmlref .= $way.
"<br>\n";
341$morehtmlref .=
'</div>';
343dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
347if ($action ==
'delete') {
349 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
351 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
357print
'<div class="fichecenter">';
358print
'<div class="underbanner clearboth"></div>';
359print
'<table class="border centpercent tableforfield">';
362print
'<tr><td class="titlefield notopnoleft tdtop">';
363print $langs->trans(
"Description").
'</td><td>';
368print
'<tr><td class="notopnoleft">';
369print $langs->trans(
"Color").
'</td><td>';
370print $formother->showColor(
$object->color);
374print
'<tr><td class="titlefield notopnoleft">';
375print $langs->trans(
"Position").
'</td><td>';
380include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
392print
"<div class='tabsAction'>\n";
393$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
395 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
397if (empty($reshook)) {
398 if ($user->hasRight(
'categorie',
'creer')) {
400 print
'<a class="butAction" href="'.dolBuildUrl(DOL_URL_ROOT.
'/categories/edit.php', [
'id' =>
$object->id,
'socid' => $socid,
'type' => $type]).
'">'.$langs->trans(
"Modify").
'</a>';
403 if ($user->hasRight(
'categorie',
'supprimer')) {
404 print dolGetButtonAction($langs->trans(
"Delete"), $langs->trans(
"Delete"),
'delete',
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'action' =>
'delete',
'id' =>
$object->id,
'type' => $type,
'backtolist' => $backtolist],
true),
'',
true, array(
'attr' => array(
'class' =>
'reposition'))).
"\n";
411if ($user->hasRight(
'categorie',
'creer')) {
412 $link =
dolBuildUrl(DOL_URL_ROOT.
'/categories/card.php', [
'action'=>
'create',
'type' => $type,
'catorigin' =>
$object->id,
'backtopage' =>
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'type' => $type,
'id' => $id])]);
414 $newcardbutton =
'<div class="right">';
415 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
416 $newcardbutton .=
'</div>';
424print
'<div class="fichecenter">';
426print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
430print
'<table class="liste nohover noborder centpercent borderbottom">';
432print
'<tr class="liste_titre">';
433print
'<td>'.$langs->trans(
"SubCats").
'</td>';
435print
'<td class="right">';
437if (is_array($cats) && count($cats) > 1 && !empty(
$conf->use_javascript_ajax)) {
438 print
'<div id="iddivjstreecontrol">';
439 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
441 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
448if (is_numeric($cats) && $cats < 0) {
450} elseif (count($cats) < 1) {
451 print
'<tr class="oddeven nobottom nohover">';
452 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
457 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
461 if ($type == Categorie::TYPE_MEMBER) {
462 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
464 if ($type == Categorie::TYPE_ACCOUNT) {
465 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
467 if ($type == Categorie::TYPE_PROJECT) {
468 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
470 if ($type == Categorie::TYPE_USER) {
471 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
477 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
478 foreach ($fulltree as $key => $val) {
479 $categstatic->id = $val[
'id'];
480 $categstatic->ref = $val[
'label'];
481 $categstatic->color = $val[
'color'];
482 $categstatic->type = $type;
488 $elements = $categstatic->getObjectsInCateg($type, 1);
490 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
493 if ($categstatic->color) {
494 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
496 $stylecolor =
' style="background: #bbb;"';
498 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
500 $entry =
'<table class="nobordernopadding centpercent">';
504 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
509 $entry .=
'<td class="right" width="20px;">';
510 $entry .=
'<a href="'.DOL_URL_ROOT.
'/categories/viewcat.php?id='.$val[
'id'].
'&type='.urlencode($type).
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'">'.img_view().
'</a>';
512 $entry .=
'<td class="right" width="20px;">';
513 $entry .=
'<a class="editfielda" href="'.DOL_URL_ROOT.
'/categories/edit.php?id='.$val[
'id'].
'&type='.urlencode($type).
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'">'.img_edit().
'</a>';
515 $entry .=
'<td class="right" width="20px;">';
516 $entry .=
'<a class="deletefilelink" href="'.DOL_URL_ROOT.
'/categories/viewcat.php?action=delete&token='.
newToken().
'&id='.$val[
'id'].
'&type='.urlencode($type).
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$id.
'&type='.urlencode($type)).
'">'.img_delete().
'</a>';
520 $entry .=
'</table>';
522 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
525 $nbofentries = (count($data) - 1);
526 if ($nbofentries > 0) {
527 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
528 print
'<tr class="pair">';
529 print
'<td colspan="3">';
537 print
'<tr class="pair">';
538 print
'<td colspan="3">';
539 print
'<table class="nobordernopadding">';
541 print
'<tr class="nobordernopadding">';
542 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
543 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
544 print
'<td> </td>';
557$arrayofmassactions = array(
563$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
569if ($type == Categorie::TYPE_PRODUCT) {
570 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
571 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
572 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
574 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
579 '@phan-var-force Product[] $prods';
581 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
582 print
'<input type="hidden" name="token" value="'.newToken().
'">';
583 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
584 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
585 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
586 print
'<input type="hidden" name="page_y" value="">';
587 print
'<input type="hidden" name="action" value="list">';
590 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
591 $num = count($prods);
592 $nbtotalofrecords =
'';
593 $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'));
596 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
598 if ($showclassifyform) {
599 print
'<table class="noborder centpercent">';
600 print
'<tr class="liste_titre"><td>';
601 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
602 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
603 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
608 print
'<table class="noborder centpercent">'.
"\n";
609 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
611 if (count($prods) > 0) {
613 foreach ($prods as
$prod) {
619 print
'<tr class="oddeven">'.
"\n";
620 print
'<td class="nowrap tdtop">';
621 print
$prod->getNomUrl(1);
624 $product_thumbnail_html =
'';
625 if (!empty(
$prod->entity)) {
626 $product_thumbnail =
$prod->show_photos(
'product',
$conf->product->multidir_output[(
int)
$prod->entity], 1, 1, 0, 0, 0, 80);
627 if (
$prod->nbphoto > 0) {
628 $product_thumbnail_html = $product_thumbnail;
631 print
'<td class="left">' . $product_thumbnail_html .
'</td>';
632 $product_stock_info =
"";
633 if (
isModEnabled(
"stock") && ($user->hasRight(
"stock",
"read"))) {
634 $product_stock_info =
"<br>" . $langs->trans(
"Stock") .
": " .
$prod->stock_reel;
637 print
'<td class="tdtop">' . dolPrintHTML(
$prod->label) .
"<br>" . dolPrintHTML(
$prod->description) . $product_stock_info .
"</td>\n";
640 print
'<td class="right">';
642 print
'<a class="reposition" href= "'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".((
int)
$object->id).
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int)
$prod->id).($limit ?
'&limit='.$limit :
'').
'">';
644 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
651 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
658 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
664if ($type == Categorie::TYPE_CUSTOMER) {
665 if ($user->hasRight(
"societe",
"read")) {
666 $permission = $user->hasRight(
'societe',
'creer');
667 $showclassifyform = $user->hasRight(
'societe',
'creer');
669 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
674 '@phan-var-force Societe[] $socs';
676 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
677 print
'<input type="hidden" name="token" value="'.newToken().
'">';
678 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
679 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
680 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
681 print
'<input type="hidden" name="action" value="list">';
682 print
'<input type="hidden" name="page_y" value="">';
685 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
687 $nbtotalofrecords =
'';
688 $newcardbutton =
dolGetButtonTitle($langs->trans(
"AddThirdParty"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/societe/card.php?action=create&customer=3&custcats[]='.
$object->id.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.
$object->id),
'', $user->hasRight(
'societe',
'creer'));
691 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
693 if ($showclassifyform) {
694 print
'<table class="noborder centpercent">';
695 print
'<tr class="liste_titre"><td>';
696 print $langs->trans(
"AddCustomerIntoCategory").
' ';
697 $filter =
'(s.client:IN:1,2,3)';
698 print $form->select_company(
'',
'elemid', $filter);
699 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
704 print
'<table class="noborder centpercent">'.
"\n";
705 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
707 if (count($socs) > 0) {
709 foreach ($socs as $key => $soc) {
715 print
"\t".
'<tr class="oddeven">'.
"\n";
716 print
'<td class="nowrap tdtop tdoverflowmax250">';
717 print $soc->getNomUrl(1);
720 print
'<td class="right">';
722 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $soc->id).($limit ?
'&limit='.$limit :
'').
"'>";
724 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
731 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
738 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
744if ($type == Categorie::TYPE_SUPPLIER) {
745 if ($user->hasRight(
"fournisseur",
"read")) {
746 $permission = $user->hasRight(
'societe',
'creer');
747 $showclassifyform = $user->hasRight(
'societe',
'creer');
749 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
755 '@phan-var-force Fournisseur[] $socs';
757 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
758 print
'<input type="hidden" name="token" value="'.newToken().
'">';
759 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
760 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
761 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
762 print
'<input type="hidden" name="page_y" value="">';
763 print
'<input type="hidden" name="action" value="list">';
766 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
768 $nbtotalofrecords =
'';
769 $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'));
772 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
774 if ($showclassifyform) {
775 print
'<table class="noborder centpercent">';
776 print
'<tr class="liste_titre"><td>';
777 print $langs->trans(
"AddSupplierIntoCategory").
' ';
778 $filter =
'(s.fournisseur:=:1)';
779 print $form->select_company(
'',
'elemid', $filter);
780 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
785 print
'<table class="noborder centpercent">'.
"\n";
786 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
788 if (count($socs) > 0) {
790 foreach ($socs as $soc) {
796 print
"\t".
'<tr class="oddeven">'.
"\n";
797 print
'<td class="nowrap tdtop">';
798 print $soc->getNomUrl(1);
801 print
'<td class="right">';
803 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $soc->id).($limit ?
'&limit='.$limit :
'').
'">';
805 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
813 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
820 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
826if ($type == Categorie::TYPE_MEMBER) {
827 if ($user->hasRight(
"adherent",
"read")) {
828 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
830 $permission = $user->hasRight(
'adherent',
'creer');
831 $showclassifyform = $user->hasRight(
'adherent',
'creer');
833 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
838 '@phan-var-force Adherent[] $members';
840 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
841 print
'<input type="hidden" name="token" value="'.newToken().
'">';
842 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
843 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
844 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
845 print
'<input type="hidden" name="page_y" value="">';
846 print
'<input type="hidden" name="action" value="list">';
849 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
850 $num = count($members);
851 $nbtotalofrecords =
'';
852 $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'));
855 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
857 if ($showclassifyform) {
858 print
'<table class="noborder centpercent">';
859 print
'<tr class="liste_titre"><td>';
860 print $langs->trans(
"AssignCategoryTo").
' ';
861 print $form->selectMembers(
'',
'elemid');
862 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
867 print
'<table class="noborder centpercent">'.
"\n";
868 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
870 if (count($members) > 0) {
872 foreach ($members as $key => $member) {
878 print
"\t".
'<tr class="oddeven">'.
"\n";
879 print
'<td class="nowrap tdtop">';
880 $member->ref = $member->login;
881 print $member->getNomUrl(1, 0);
883 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
884 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
886 print
'<td class="right">';
888 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $member->id).($limit ?
'&limit='.$limit :
'').
"'>";
890 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
897 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
904 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
910if ($type == Categorie::TYPE_CONTACT) {
911 if ($user->hasRight(
"societe",
"read")) {
912 $permission = $user->hasRight(
'societe',
'creer');
913 $showclassifyform = $user->hasRight(
'societe',
'creer');
915 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
916 if (is_numeric($contacts) && $contacts < 0) {
920 '@phan-var-force Contact[] $contacts';
922 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
923 print
'<input type="hidden" name="token" value="'.newToken().
'">';
924 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
925 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
926 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
927 print
'<input type="hidden" name="page_y" value="">';
928 print
'<input type="hidden" name="action" value="list">';
931 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
932 $num = count($contacts);
933 $nbtotalofrecords =
'';
934 $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'));
939 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
941 if ($showclassifyform) {
942 print
'<table class="noborder centpercent">';
943 print
'<tr class="liste_titre"><td>';
944 print $langs->trans(
"AssignCategoryTo").
' ';
945 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
946 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
951 print
'<table class="noborder centpercent">'.
"\n";
952 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
954 if (is_array($contacts) && count($contacts) > 0) {
956 foreach ($contacts as $key => $contact) {
962 print
"\t".
'<tr class="oddeven">'.
"\n";
963 print
'<td class="nowrap tdtop">';
964 print $contact->getNomUrl(1,
'category');
965 if ($contact->socid > 0) {
966 $objsoc->fetch($contact->socid);
968 print $objsoc->getNomUrl(1,
'contact');
972 print
'<td class="right">';
974 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $contact->id).($limit ?
'&limit='.$limit :
'').
"'>";
976 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
983 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
990 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
996if ($type == Categorie::TYPE_ACCOUNT) {
997 if ($user->hasRight(
"banque",
"read")) {
998 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1000 $permission = $user->hasRight(
'banque',
'creer');
1001 $showclassifyform = $user->hasRight(
'banque',
'creer');
1003 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1004 if ($accounts < 0) {
1008 '@phan-var-force Account[] $accounts';
1010 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1011 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1012 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1013 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1014 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1015 print
'<input type="hidden" name="page_y" value="">';
1016 print
'<input type="hidden" name="action" value="list">';
1019 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1020 $num = count($accounts);
1021 $nbtotalofrecords =
'';
1022 $newcardbutton =
'';
1025 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1027 if ($showclassifyform) {
1028 print
'<table class="noborder centpercent">';
1029 print
'<tr class="liste_titre"><td>';
1030 print $langs->trans(
"AddObjectIntoCategory").
' ';
1031 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1032 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1037 print
'<table class="noborder centpercent">'.
"\n";
1038 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1040 if (count($accounts) > 0) {
1042 foreach ($accounts as $key => $account) {
1048 print
"\t".
'<tr class="oddeven">'.
"\n";
1049 print
'<td class="nowrap tdtop">';
1050 print $account->getNomUrl(1,
'0');
1052 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1053 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1055 print
'<td class="right">';
1057 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $account->id).($limit ?
'&limit='.$limit :
'').
"'>";
1059 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1066 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1073 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1079if ($type == Categorie::TYPE_PROJECT) {
1080 if ($user->hasRight(
"project",
"read")) {
1081 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1083 $permission = $user->hasRight(
'projet',
'creer');
1084 $showclassifyform = $user->hasRight(
'projet',
'creer');
1086 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1091 '@phan-var-force Project[] $objects';
1093 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1094 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1095 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1096 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1097 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1098 print
'<input type="hidden" name="page_y" value="">';
1099 print
'<input type="hidden" name="action" value="list">';
1102 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1103 $num = count($objects);
1104 $nbtotalofrecords =
'';
1105 $newcardbutton =
'';
1108 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1110 if ($showclassifyform) {
1111 print
'<table class="noborder centpercent">';
1112 print
'<tr class="liste_titre"><td>';
1113 print $langs->trans(
"AddObjectIntoCategory").
' ';
1114 $form->selectProjects(
'',
'elemid');
1115 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1120 print
'<table class="noborder centpercent">'.
"\n";
1121 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1123 if (count($objects) > 0) {
1125 foreach ($objects as $key => $project) {
1131 print
"\t".
'<tr class="oddeven">'.
"\n";
1132 print
'<td class="nowrap tdtop">';
1133 print $project->getNomUrl(1);
1135 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1137 print
'<td class="right">';
1139 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $project->id).($limit ?
'&limit='.$limit :
'').
"'>";
1141 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1148 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1155 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1161if ($type == Categorie::TYPE_USER) {
1162 if ($user->hasRight(
"user",
"user",
"read")) {
1163 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1164 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1166 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1171 '@phan-var-force User[] $users';
1174 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1175 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1176 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1177 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1178 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1179 print
'<input type="hidden" name="page_y" value="">';
1180 print
'<input type="hidden" name="action" value="list">';
1184 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1185 $num = count($users);
1186 $nbtotalofrecords =
'';
1187 $newcardbutton =
'';
1190 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1192 if ($showclassifyform) {
1193 print
'<table class="noborder centpercent">';
1194 print
'<tr class="liste_titre"><td>';
1196 print img_picto(
'', $type,
'class="pictofixedwidth"');
1197 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1198 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1203 print
'<table class="noborder centpercent">'.
"\n";
1204 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1206 if (count($users) > 0) {
1208 foreach ($users as $key => $userentry) {
1209 print
"\t".
'<tr class="oddeven">'.
"\n";
1210 print
'<td class="nowrap tdtop">';
1211 print $userentry->getNomUrl(-1);
1213 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1216 print
'<td class="right">';
1217 if ($user->hasRight(
'user',
'user',
'creer')) {
1218 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $userentry->id).($limit ?
'&limit='.$limit :
'').
"'>";
1220 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1227 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1234 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1240if ($type == Categorie::TYPE_WAREHOUSE) {
1241 if ($user->hasRight(
"stock",
"read")) {
1242 $permission = $user->hasRight(
'stock',
'creer');
1243 $showclassifyform = $user->hasRight(
'stock',
'creer');
1245 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1247 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1252 '@phan-var-force Entrepot[] $objects';
1253 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1254 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1255 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1256 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1257 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1258 print
'<input type="hidden" name="page_y" value="">';
1259 print
'<input type="hidden" name="action" value="list">';
1262 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1263 $num = count($objects);
1264 $nbtotalofrecords =
'';
1265 $newcardbutton =
'';
1268 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1270 if ($showclassifyform) {
1271 print
'<table class="noborder centpercent">';
1272 print
'<tr class="liste_titre"><td>';
1273 print $langs->trans(
"AddTicketIntoCategory").
' ';
1274 print $form->selectForForms(
'Entrepot:product/stock/class/entrepot.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1275 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1280 print
'<table class="noborder centpercent">'.
"\n";
1281 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1283 if (count($objects) > 0) {
1285 foreach ($objects as $key => $warehouse) {
1291 print
"\t".
'<tr class="oddeven">'.
"\n";
1292 print
'<td class="nowrap tdtop">';
1293 print $warehouse->getNomUrl(1);
1295 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1296 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1298 print
'<td class="right">';
1300 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $warehouse->id).($limit ?
'&limit='.$limit :
'').
"'>";
1302 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1309 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1316 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1322if ($type == Categorie::TYPE_TICKET) {
1323 if ($user->hasRight(
"ticket",
"read")) {
1324 $permission = $user->hasRight(
'categorie',
'creer');
1325 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1327 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1332 '@phan-var-force Ticket[] $tickets';
1334 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1335 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1336 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1337 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1338 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1339 print
'<input type="hidden" name="page_y" value="">';
1340 print
'<input type="hidden" name="action" value="list">';
1343 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1344 $num = count($tickets);
1345 $nbtotalofrecords =
'';
1346 $newcardbutton =
'';
1349 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1351 if ($showclassifyform) {
1352 print
'<table class="noborder centpercent">';
1353 print
'<tr class="liste_titre"><td>';
1354 print $langs->trans(
"AddTicketIntoCategory").
' ';
1355 $form->selectTickets(
'',
'elemid');
1356 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1361 print
'<table class="noborder centpercent">'.
"\n";
1362 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1364 if (count($tickets) > 0) {
1366 foreach ($tickets as $ticket) {
1372 print
"\t".
'<tr class="oddeven">'.
"\n";
1373 print
'<td class="nowrap tdtop">';
1374 print $ticket->getNomUrl(1);
1376 print
'<td class="tdtop">'.$ticket->track_id.
"</td>\n";
1378 print
'<td class="right">';
1380 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $ticket->id).($limit ?
'&limit='.$limit :
'').
"'>";
1382 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1389 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1396 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1402if ($type == Categorie::TYPE_FICHINTER) {
1403 if ($user->hasRight(
"fichinter",
"lire")) {
1404 $permission = $user->hasRight(
'categorie',
'creer');
1405 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1407 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1408 if ($fichinters < 0) {
1412 '@phan-var-force Fichinter[] $fichinters';
1415 if ($showclassifyform) {
1417 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1418 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1419 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1420 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1421 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1422 print
'<input type="hidden" name="action" value="addintocategory">';
1423 print
'<table class="noborder centpercent">';
1424 print
'<tr class="liste_titre"><td>';
1425 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1426 print $form->selectForForms(
'Fichinter:fichinter/class/fichinter.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1427 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1433 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1434 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1435 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1436 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1437 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1438 print
'<input type="hidden" name="action" value="list">';
1441 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1442 $num = count($fichinters);
1443 $nbtotalofrecords =
'';
1444 $newcardbutton =
'';
1446 $langs->load(
'interventions');
1448 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1449 print
'<table class="noborder centpercent">'.
"\n";
1450 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1452 if (count($fichinters) > 0) {
1454 foreach ($fichinters as $fichinter) {
1460 print
"\t".
'<tr class="oddeven">'.
"\n";
1461 print
'<td class="nowrap tdtop">';
1462 print $fichinter->getNomUrl(1);
1464 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1466 print
'<td class="right">';
1468 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".((
int)
$object->id).
"&type=".urlencode($typeid).
"&action=unlink&token=".
newToken().
"&removeelem=".((int) $fichinter->id).($limit ?
'&limit='.$limit :
'').
"'>";
1469 print $langs->trans(
"DeleteFromCat");
1470 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1477 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1483 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1489if ($type == Categorie::TYPE_ORDER) {
1490 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1492 $permission = $user->hasRight(
'commande',
'creer');
1494 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1499 '@phan-var-force Commande[] $objects';
1501 $showclassifyform = $user->hasRight(
'order',
'write');
1502 if ($showclassifyform) {
1504 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1505 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1506 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1507 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1508 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1509 print
'<input type="hidden" name="action" value="addintocategory">';
1510 print
'<table class="noborder centpercent">';
1511 print
'<tr class="liste_titre"><td>';
1512 print $langs->trans(
"AddOrderIntoCategory").
' ';
1513 print $form->selectForForms(
'Commande:commande/class/commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1514 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1520 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1521 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1522 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1523 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1524 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1525 print
'<input type="hidden" name="action" value="list">';
1528 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1529 $num = count($objects);
1530 $nbtotalofrecords =
'';
1531 $newcardbutton =
'';
1534 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1536 print
"<table class='noborder centpercent'>\n";
1537 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1539 if (count($objects) > 0) {
1541 foreach ($objects as $key => $order) {
1547 print
"\t".
'<tr class="oddeven">'.
"\n";
1548 print
'<td class="nowrap tdtop">';
1549 print $order->getNomUrl(1);
1551 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1553 print
'<td class="right">';
1555 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$order->id.
"'>";
1556 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1562 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1571if ($type == Categorie::TYPE_MO) {
1572 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
1574 $permission = $user->hasRight(
'mrp',
'write');
1576 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1581 '@phan-var-force Mo[] $objects';
1583 $showclassifyform = $user->hasRight(
'mrp',
'write');
1584 if ($showclassifyform) {
1586 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1587 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1588 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1589 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1590 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1591 print
'<input type="hidden" name="action" value="addintocategory">';
1592 print
'<table class="noborder centpercent">';
1593 print
'<tr class="liste_titre"><td>';
1594 print $langs->trans(
"AddMoIntoCategory").
' ';
1595 print $form->selectForForms(
'Mo:mrp/class/mo.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1596 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1602 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1603 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1604 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1605 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1606 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1607 print
'<input type="hidden" name="action" value="list">';
1610 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1611 $num = count($objects);
1612 $nbtotalofrecords =
'';
1613 $newcardbutton =
'';
1616 print_barre_liste($langs->trans(
"MOs"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'mrp', 0, $newcardbutton,
'', $limit);
1618 print
"<table class='noborder centpercent'>\n";
1619 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1621 if (count($objects) > 0) {
1623 foreach ($objects as $key => $mo) {
1629 print
"\t".
'<tr class="oddeven">'.
"\n";
1630 print
'<td class="nowrap tdtop">';
1631 print $mo->getNomUrl(1);
1633 print
'<td class="tdtop">'.$mo->ref.
"</td>\n";
1635 print
'<td class="right">';
1637 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$mo->id.
"'>";
1638 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1644 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1653if ($type == Categorie::TYPE_INVOICE) {
1654 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1656 $permission = $user->hasRight(
'facture',
'creer');
1658 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1663 $showclassifyform = $user->hasRight(
'facture',
'write');
1664 if ($showclassifyform) {
1666 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1667 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1668 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1669 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1670 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1671 print
'<input type="hidden" name="action" value="addintocategory">';
1672 print
'<table class="noborder centpercent">';
1673 print
'<tr class="liste_titre"><td>';
1674 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1675 print $form->selectForForms(
'Facture:compta/facture/class/facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1676 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1682 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1683 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1684 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1685 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1686 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1687 print
'<input type="hidden" name="action" value="list">';
1690 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1691 $num = count($objects);
1692 $nbtotalofrecords =
'';
1693 $newcardbutton =
'';
1696 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1698 print
"<table class='noborder centpercent'>\n";
1699 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1701 if (count($objects) > 0) {
1703 foreach ($objects as $key => $invoice) {
1709 print
"\t".
'<tr class="oddeven">'.
"\n";
1710 print
'<td class="nowrap tdtop">';
1711 print $invoice->getNomUrl(1);
1713 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1715 print
'<td class="right">';
1717 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$invoice->id.
"'>";
1718 print $langs->trans(
"DeleteFromCat");
1719 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1725 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1734if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1735 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1737 $permission = $user->hasRight(
'fournisseur',
'commande',
'creer');
1739 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1744 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1746 if ($showclassifyform) {
1748 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1749 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1750 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1751 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1752 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1753 print
'<input type="hidden" name="action" value="addintocategory">';
1754 print
'<table class="noborder centpercent">';
1755 print
'<tr class="liste_titre"><td>';
1756 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1757 print $form->selectForForms(
'CommandeFournisseur:fourn/class/fournisseur.commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1758 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1764 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1765 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1766 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1767 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1768 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1769 print
'<input type="hidden" name="action" value="list">';
1772 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1773 $num = count($objects);
1774 $nbtotalofrecords =
'';
1775 $newcardbutton =
'';
1778 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1780 print
"<table class='noborder centpercent'>\n";
1781 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1783 if (count($objects) > 0) {
1785 foreach ($objects as $key => $supplier_order) {
1791 print
"\t".
'<tr class="oddeven">'.
"\n";
1792 print
'<td class="nowrap tdtop">';
1793 print $supplier_order->getNomUrl(1);
1795 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1797 print
'<td class="right">';
1799 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_order->id.
"'>";
1800 print $langs->trans(
"DeleteFromCat");
1801 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1807 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1816if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1817 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1819 $permission = $user->hasRight(
'fournisseur',
'facture',
'creer');
1821 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1826 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1827 if ($showclassifyform) {
1829 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1830 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1831 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1832 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1833 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1834 print
'<input type="hidden" name="action" value="addintocategory">';
1835 print
'<table class="noborder centpercent">';
1836 print
'<tr class="liste_titre"><td>';
1837 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1838 print $form->selectForForms(
'FactureFournisseur:fourn/class/fournisseur.facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1839 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1845 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1846 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1847 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1848 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1849 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1850 print
'<input type="hidden" name="action" value="list">';
1853 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1856 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1858 print
"<table class='noborder centpercent'>\n";
1859 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1861 if (count($objects) > 0) {
1863 foreach ($objects as $key => $supplier_invoice) {
1869 print
"\t".
'<tr class="oddeven">'.
"\n";
1870 print
'<td class="nowrap tdtop">';
1871 print $supplier_invoice->getNomUrl(1);
1873 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1875 print
'<td class="right">';
1877 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_invoice->id.
"'>";
1878 print $langs->trans(
"DeleteFromCat");
1879 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1885 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1894$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1895$reshook = $hookmanager->executeHooks(
'addMoreCategoriesList', $parameters, $object, $action);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 predefined suppliers products.
Class to manage customers orders.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage products or services.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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, $nodie=0, $mode='')
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.