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 ==
"") {
90$hookmanager->initHooks(array(
'categorycard',
'globalcard'));
93$result =
$object->fetch($id, $label);
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';
161 $result = $tmpobject->fetch($removeelem);
162 $elementtype =
'user';
163 } elseif ($type == Categorie::TYPE_WAREHOUSE && $user->hasRight(
'stock',
'creer')) {
164 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
166 $result = $tmpobject->fetch($removeelem);
167 $elementtype =
'warehouse';
168 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
169 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
171 $result = $tmpobject->fetch($removeelem);
172 $elementtype =
'ticket';
173 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
174 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
176 $result = $tmpobject->fetch($removeelem);
177 $elementtype =
'fichinter';
178 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
179 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
181 $result = $tmpobject->fetch($removeelem);
182 $elementtype =
'order';
183 } elseif ($type == Categorie::TYPE_MO && $user->hasRight(
'mrp',
'write')) {
184 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
185 $tmpobject =
new Mo(
$db);
186 $result = $tmpobject->fetch($removeelem);
188 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
189 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
191 $result = $tmpobject->fetch($removeelem);
192 $elementtype =
'invoice';
193 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
194 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
196 $result = $tmpobject->fetch($removeelem);
197 $elementtype =
'supplier_order';
198 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
199 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
201 $result = $tmpobject->fetch($removeelem);
202 $elementtype =
'supplier_invoice';
208 if ($tmpobject !==
null) {
210 $result =
$object->del_type($tmpobject, $elementtype);
217if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
218 if (
$object->delete($user) >= 0) {
220 header(
"Location: ".$backtopage);
223 header(
"Location: ".
dolBuildUrl(DOL_URL_ROOT.
'/categories/categorie_list.php', [
'type' => $type]));
231if ($elemid && $action ==
'addintocategory') {
234 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
235 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
237 $elementtype =
'product';
238 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
239 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
241 $elementtype =
'customer';
242 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
243 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
245 $elementtype =
'supplier';
246 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
247 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
249 $elementtype =
'ticket';
250 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
251 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
253 $elementtype =
'fichinter';
254 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
255 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
257 $elementtype =
'project';
258 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
259 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
261 $elementtype =
'member';
262 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
263 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
265 $elementtype =
'contact';
266 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
267 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
269 $elementtype =
'user';
270 } elseif ($type == Categorie::TYPE_WAREHOUSE && $user->hasRight(
'stock',
'creer')) {
271 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
273 $elementtype =
'warehouse';
274 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
275 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
277 $elementtype =
'bank_account';
278 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
279 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
281 $elementtype =
'order';
282 } elseif ($type == Categorie::TYPE_MO && $user->hasRight(
'mrp',
'write')) {
283 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
284 $newobject =
new Mo(
$db);
286 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
287 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
289 $elementtype =
'invoice';
290 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
291 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
293 $elementtype =
'supplier_order';
294 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
295 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
297 $elementtype =
'supplier_invoice';
301 $object->error = $langs->trans(
"NotEnoughPermissions");
303 if ($newobject !==
null) {
304 $result = $newobject->fetch($elemid);
307 if ($result >= 0 && $newobject !==
null) {
309 $result =
$object->add_type($newobject, $elementtype);
312 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
314 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
315 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
331 '/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
332 '/public/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
334$arrayofcss = array(
'/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
338llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
340$title = $langs->trans(
"Categories");
341$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
346$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
347$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
350$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a>';
351$morehtmlref .=
' > ';
352$ways =
$object->print_all_ways(
"auto",
'', 1, 0, 1);
353foreach ($ways as $way) {
354 $morehtmlref .= $way.
"<br>\n";
356$morehtmlref .=
'</div>';
358dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
362if ($action ==
'delete') {
364 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
366 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
372print
'<div class="fichecenter">';
373print
'<div class="underbanner clearboth"></div>';
374print
'<table class="border centpercent tableforfield">';
377print
'<tr><td class="titlefield notopnoleft tdtop">';
378print $langs->trans(
"Description").
'</td><td>';
383print
'<tr><td class="notopnoleft">';
384print $langs->trans(
"Color").
'</td><td>';
385print $formother->showColor(
$object->color);
389print
'<tr><td class="titlefield notopnoleft">';
390print $langs->trans(
"Position").
'</td><td>';
395include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
407print
"<div class='tabsAction'>\n";
408$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
412if (empty($reshook)) {
413 if ($user->hasRight(
'categorie',
'creer')) {
415 print
'<a class="butAction" href="'.dolBuildUrl(DOL_URL_ROOT.
'/categories/edit.php', [
'id' =>
$object->id,
'socid' => $socid,
'type' => $type]).
'">'.$langs->trans(
"Modify").
'</a>';
418 if ($user->hasRight(
'categorie',
'supprimer')) {
419 print
'<a class="butActionDelete" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'action' =>
'delete',
'id' =>
$object->id,
'type' => $type,
'backtolist' => $backtolist],
true).
'">'.$langs->trans(
"Delete").
'</a>';
426if ($user->hasRight(
'categorie',
'creer')) {
427 $link =
dolBuildUrl(DOL_URL_ROOT.
'/categories/card.php', [
'action'=>
'create',
'type' => $type,
'catorigin' =>
$object->id,
'backtopage' =>
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'type' => $type,
'id' => $id])]);
429 $newcardbutton =
'<div class="right">';
430 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
431 $newcardbutton .=
'</div>';
439print
'<div class="fichecenter">';
441print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
445print
'<table class="liste nohover noborder centpercent borderbottom">';
447print
'<tr class="liste_titre">';
448print
'<td>'.$langs->trans(
"SubCats").
'</td>';
450print
'<td class="right">';
452if (is_array($cats) && count($cats) > 1 && !empty(
$conf->use_javascript_ajax)) {
453 print
'<div id="iddivjstreecontrol">';
454 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
456 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
463if (is_numeric($cats) && $cats < 0) {
465} elseif (count($cats) < 1) {
466 print
'<tr class="oddeven nobottom nohover">';
467 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
472 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
476 if ($type == Categorie::TYPE_MEMBER) {
477 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
479 if ($type == Categorie::TYPE_ACCOUNT) {
480 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
482 if ($type == Categorie::TYPE_PROJECT) {
483 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
485 if ($type == Categorie::TYPE_USER) {
486 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
492 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
493 foreach ($fulltree as $key => $val) {
494 $categstatic->id = $val[
'id'];
495 $categstatic->ref = $val[
'label'];
496 $categstatic->color = $val[
'color'];
497 $categstatic->type = $type;
503 $elements = $categstatic->getObjectsInCateg($type, 1);
505 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
508 if ($categstatic->color) {
509 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
511 $stylecolor =
' style="background: #bbb;"';
513 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
515 $entry =
'<table class="nobordernopadding centpercent">';
519 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
524 $entry .=
'<td class="right" width="20px;">';
525 $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>';
527 $entry .=
'<td class="right" width="20px;">';
528 $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>';
530 $entry .=
'<td class="right" width="20px;">';
531 $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>';
535 $entry .=
'</table>';
537 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
540 $nbofentries = (count($data) - 1);
541 if ($nbofentries > 0) {
542 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
543 print
'<tr class="pair">';
544 print
'<td colspan="3">';
552 print
'<tr class="pair">';
553 print
'<td colspan="3">';
554 print
'<table class="nobordernopadding">';
556 print
'<tr class="nobordernopadding">';
557 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
558 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
559 print
'<td> </td>';
572$arrayofmassactions = array(
578$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
584if ($type == Categorie::TYPE_PRODUCT) {
585 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
586 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
587 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
589 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
594 '@phan-var-force Product[] $prods';
596 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
597 print
'<input type="hidden" name="token" value="'.newToken().
'">';
598 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
599 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
600 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
601 print
'<input type="hidden" name="page_y" value="">';
602 print
'<input type="hidden" name="action" value="list">';
605 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
606 $num = count($prods);
607 $nbtotalofrecords =
'';
608 $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'));
611 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
613 if ($showclassifyform) {
614 print
'<table class="noborder centpercent">';
615 print
'<tr class="liste_titre"><td>';
616 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
617 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
618 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
623 print
'<table class="noborder centpercent">'.
"\n";
624 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
626 if (count($prods) > 0) {
628 foreach ($prods as
$prod) {
634 print
'<tr class="oddeven">'.
"\n";
635 print
'<td class="nowrap tdtop">';
636 print
$prod->getNomUrl(1);
639 $product_thumbnail_html =
'';
640 if (!empty(
$prod->entity)) {
641 $product_thumbnail =
$prod->show_photos(
'product',
$conf->product->multidir_output[(
int)
$prod->entity], 1, 1, 0, 0, 0, 80);
642 if (
$prod->nbphoto > 0) {
643 $product_thumbnail_html = $product_thumbnail;
646 print
'<td class="left">' . $product_thumbnail_html .
'</td>';
647 $product_stock_info =
"";
648 if (
isModEnabled(
"stock") && ($user->hasRight(
"stock",
"read"))) {
649 $product_stock_info =
"<br>" . $langs->trans(
"Stock") .
": " .
$prod->stock_reel;
655 print
'<td class="right">';
657 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 :
'').
'">';
659 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
666 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
673 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
679if ($type == Categorie::TYPE_CUSTOMER) {
680 if ($user->hasRight(
"societe",
"read")) {
681 $permission = $user->hasRight(
'societe',
'creer');
682 $showclassifyform = $user->hasRight(
'societe',
'creer');
684 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
689 '@phan-var-force Societe[] $socs';
691 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
692 print
'<input type="hidden" name="token" value="'.newToken().
'">';
693 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
694 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
695 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
696 print
'<input type="hidden" name="action" value="list">';
697 print
'<input type="hidden" name="page_y" value="">';
700 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
702 $nbtotalofrecords =
'';
703 $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'));
706 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
708 if ($showclassifyform) {
709 print
'<table class="noborder centpercent">';
710 print
'<tr class="liste_titre"><td>';
711 print $langs->trans(
"AddCustomerIntoCategory").
' ';
712 $filter =
'(s.client:IN:1,2,3)';
713 print $form->select_company(
'',
'elemid', $filter);
714 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
719 print
'<table class="noborder centpercent">'.
"\n";
720 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
722 if (count($socs) > 0) {
724 foreach ($socs as $key => $soc) {
730 print
"\t".
'<tr class="oddeven">'.
"\n";
731 print
'<td class="nowrap tdtop tdoverflowmax250">';
732 print $soc->getNomUrl(1);
735 print
'<td class="right">';
737 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 :
'').
"'>";
739 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
746 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
753 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
759if ($type == Categorie::TYPE_SUPPLIER) {
760 if ($user->hasRight(
"fournisseur",
"read")) {
761 $permission = $user->hasRight(
'societe',
'creer');
762 $showclassifyform = $user->hasRight(
'societe',
'creer');
764 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
770 '@phan-var-force Fournisseur[] $socs';
772 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
773 print
'<input type="hidden" name="token" value="'.newToken().
'">';
774 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
775 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
776 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
777 print
'<input type="hidden" name="page_y" value="">';
778 print
'<input type="hidden" name="action" value="list">';
781 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
783 $nbtotalofrecords =
'';
784 $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'));
787 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
789 if ($showclassifyform) {
790 print
'<table class="noborder centpercent">';
791 print
'<tr class="liste_titre"><td>';
792 print $langs->trans(
"AddSupplierIntoCategory").
' ';
793 $filter =
'(s.fournisseur:=:1)';
794 print $form->select_company(
'',
'elemid', $filter);
795 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
800 print
'<table class="noborder centpercent">'.
"\n";
801 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
803 if (count($socs) > 0) {
805 foreach ($socs as $soc) {
811 print
"\t".
'<tr class="oddeven">'.
"\n";
812 print
'<td class="nowrap tdtop">';
813 print $soc->getNomUrl(1);
816 print
'<td class="right">';
818 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 :
'').
'">';
820 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
828 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
835 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
841if ($type == Categorie::TYPE_MEMBER) {
842 if ($user->hasRight(
"adherent",
"read")) {
843 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
845 $permission = $user->hasRight(
'adherent',
'creer');
846 $showclassifyform = $user->hasRight(
'adherent',
'creer');
848 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
853 '@phan-var-force Adherent[] $members';
855 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
856 print
'<input type="hidden" name="token" value="'.newToken().
'">';
857 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
858 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
859 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
860 print
'<input type="hidden" name="page_y" value="">';
861 print
'<input type="hidden" name="action" value="list">';
864 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
865 $num = count($members);
866 $nbtotalofrecords =
'';
867 $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'));
870 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
872 if ($showclassifyform) {
873 print
'<table class="noborder centpercent">';
874 print
'<tr class="liste_titre"><td>';
875 print $langs->trans(
"AssignCategoryTo").
' ';
876 print $form->selectMembers(
'',
'elemid');
877 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
882 print
'<table class="noborder centpercent">'.
"\n";
883 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
885 if (count($members) > 0) {
887 foreach ($members as $key => $member) {
893 print
"\t".
'<tr class="oddeven">'.
"\n";
894 print
'<td class="nowrap tdtop">';
895 $member->ref = $member->login;
896 print $member->getNomUrl(1, 0);
898 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
899 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
901 print
'<td class="right">';
903 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 :
'').
"'>";
905 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
912 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
919 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
925if ($type == Categorie::TYPE_CONTACT) {
926 if ($user->hasRight(
"societe",
"read")) {
927 $permission = $user->hasRight(
'societe',
'creer');
928 $showclassifyform = $user->hasRight(
'societe',
'creer');
930 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
931 if (is_numeric($contacts) && $contacts < 0) {
935 '@phan-var-force Contact[] $contacts';
937 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
938 print
'<input type="hidden" name="token" value="'.newToken().
'">';
939 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
940 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
941 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
942 print
'<input type="hidden" name="page_y" value="">';
943 print
'<input type="hidden" name="action" value="list">';
946 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
947 $num = count($contacts);
948 $nbtotalofrecords =
'';
949 $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'));
954 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
956 if ($showclassifyform) {
957 print
'<table class="noborder centpercent">';
958 print
'<tr class="liste_titre"><td>';
959 print $langs->trans(
"AssignCategoryTo").
' ';
960 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
961 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
966 print
'<table class="noborder centpercent">'.
"\n";
967 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
969 if (is_array($contacts) && count($contacts) > 0) {
971 foreach ($contacts as $key => $contact) {
977 print
"\t".
'<tr class="oddeven">'.
"\n";
978 print
'<td class="nowrap tdtop">';
979 print $contact->getNomUrl(1,
'category');
980 if ($contact->socid > 0) {
981 $objsoc->fetch($contact->socid);
983 print $objsoc->getNomUrl(1,
'contact');
987 print
'<td class="right">';
989 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 :
'').
"'>";
991 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
998 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1005 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
1011if ($type == Categorie::TYPE_ACCOUNT) {
1012 if ($user->hasRight(
"banque",
"read")) {
1013 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1015 $permission = $user->hasRight(
'banque',
'creer');
1016 $showclassifyform = $user->hasRight(
'banque',
'creer');
1018 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1019 if ($accounts < 0) {
1023 '@phan-var-force Account[] $accounts';
1025 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1026 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1027 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1028 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1029 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1030 print
'<input type="hidden" name="page_y" value="">';
1031 print
'<input type="hidden" name="action" value="list">';
1034 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1035 $num = count($accounts);
1036 $nbtotalofrecords =
'';
1037 $newcardbutton =
'';
1040 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1042 if ($showclassifyform) {
1043 print
'<table class="noborder centpercent">';
1044 print
'<tr class="liste_titre"><td>';
1045 print $langs->trans(
"AddObjectIntoCategory").
' ';
1046 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1047 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1052 print
'<table class="noborder centpercent">'.
"\n";
1053 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1055 if (count($accounts) > 0) {
1057 foreach ($accounts as $key => $account) {
1063 print
"\t".
'<tr class="oddeven">'.
"\n";
1064 print
'<td class="nowrap tdtop">';
1065 print $account->getNomUrl(1,
'0');
1067 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1068 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1070 print
'<td class="right">';
1072 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 :
'').
"'>";
1074 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1081 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1088 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1094if ($type == Categorie::TYPE_PROJECT) {
1095 if ($user->hasRight(
"project",
"read")) {
1096 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1098 $permission = $user->hasRight(
'projet',
'creer');
1099 $showclassifyform = $user->hasRight(
'projet',
'creer');
1101 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1106 '@phan-var-force Project[] $objects';
1108 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1109 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1110 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1111 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1112 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1113 print
'<input type="hidden" name="page_y" value="">';
1114 print
'<input type="hidden" name="action" value="list">';
1117 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1118 $num = count($objects);
1119 $nbtotalofrecords =
'';
1120 $newcardbutton =
'';
1123 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1125 if ($showclassifyform) {
1126 print
'<table class="noborder centpercent">';
1127 print
'<tr class="liste_titre"><td>';
1128 print $langs->trans(
"AddObjectIntoCategory").
' ';
1129 $form->selectProjects(
'',
'elemid');
1130 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1135 print
'<table class="noborder centpercent">'.
"\n";
1136 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1138 if (count($objects) > 0) {
1140 foreach ($objects as $key => $project) {
1146 print
"\t".
'<tr class="oddeven">'.
"\n";
1147 print
'<td class="nowrap tdtop">';
1148 print $project->getNomUrl(1);
1150 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1152 print
'<td class="right">';
1154 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 :
'').
"'>";
1156 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1163 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1170 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1176if ($type == Categorie::TYPE_USER) {
1177 if ($user->hasRight(
"user",
"user",
"read")) {
1178 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1179 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1181 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1186 '@phan-var-force User[] $users';
1189 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1190 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1191 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1192 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1193 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1194 print
'<input type="hidden" name="page_y" value="">';
1195 print
'<input type="hidden" name="action" value="list">';
1199 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1200 $num = count($users);
1201 $nbtotalofrecords =
'';
1202 $newcardbutton =
'';
1205 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1207 if ($showclassifyform) {
1208 print
'<table class="noborder centpercent">';
1209 print
'<tr class="liste_titre"><td>';
1211 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1212 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1213 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1218 print
'<table class="noborder centpercent">'.
"\n";
1219 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1221 if (count($users) > 0) {
1223 foreach ($users as $key => $userentry) {
1224 print
"\t".
'<tr class="oddeven">'.
"\n";
1225 print
'<td class="nowrap tdtop">';
1226 print $userentry->getNomUrl(-1);
1228 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1231 print
'<td class="right">';
1232 if ($user->hasRight(
'user',
'user',
'creer')) {
1233 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 :
'').
"'>";
1235 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1242 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1249 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1255if ($type == Categorie::TYPE_WAREHOUSE) {
1256 if ($user->hasRight(
"stock",
"read")) {
1257 $permission = $user->hasRight(
'stock',
'creer');
1258 $showclassifyform = $user->hasRight(
'stock',
'creer');
1260 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1262 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1267 '@phan-var-force Entrepot[] $objects';
1268 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1269 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1270 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1271 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1272 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1273 print
'<input type="hidden" name="page_y" value="">';
1274 print
'<input type="hidden" name="action" value="list">';
1277 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1278 $num = count($objects);
1279 $nbtotalofrecords =
'';
1280 $newcardbutton =
'';
1283 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1285 if ($showclassifyform) {
1286 print
'<table class="noborder centpercent">';
1287 print
'<tr class="liste_titre"><td>';
1288 print $langs->trans(
"AddWarehouseIntoCategory").
' ';
1289 print $form->selectForForms(
'Entrepot:product/stock/class/entrepot.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1290 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1295 print
'<table class="noborder centpercent">'.
"\n";
1296 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1298 if (count($objects) > 0) {
1300 foreach ($objects as $key => $warehouse) {
1306 print
"\t".
'<tr class="oddeven">'.
"\n";
1307 print
'<td class="nowrap tdtop">';
1308 print $warehouse->getNomUrl(1);
1310 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1311 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1313 print
'<td class="right">';
1315 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 :
'').
"'>";
1317 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1324 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1331 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1337if ($type == Categorie::TYPE_TICKET) {
1338 if ($user->hasRight(
"ticket",
"read")) {
1339 $permission = $user->hasRight(
'categorie',
'creer');
1340 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1342 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1347 '@phan-var-force Ticket[] $tickets';
1349 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1350 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1351 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1352 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1353 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1354 print
'<input type="hidden" name="page_y" value="">';
1355 print
'<input type="hidden" name="action" value="list">';
1358 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1359 $num = count($tickets);
1360 $nbtotalofrecords =
'';
1361 $newcardbutton =
'';
1364 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1366 if ($showclassifyform) {
1367 print
'<table class="noborder centpercent">';
1368 print
'<tr class="liste_titre"><td>';
1369 print $langs->trans(
"AddTicketIntoCategory").
' ';
1370 $form->selectTickets(
'',
'elemid');
1371 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1376 print
'<table class="noborder centpercent">'.
"\n";
1377 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1379 if (count($tickets) > 0) {
1381 foreach ($tickets as $ticket) {
1387 print
"\t".
'<tr class="oddeven">'.
"\n";
1388 print
'<td class="nowrap tdtop">';
1389 print $ticket->getNomUrl(1);
1391 print
'<td class="tdtop">'.$ticket->track_id.
"</td>\n";
1393 print
'<td class="right">';
1395 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 :
'').
"'>";
1397 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1404 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1411 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1417if ($type == Categorie::TYPE_FICHINTER) {
1418 if ($user->hasRight(
"fichinter",
"lire")) {
1419 $permission = $user->hasRight(
'categorie',
'creer');
1420 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1422 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1423 if ($fichinters < 0) {
1427 '@phan-var-force Fichinter[] $fichinters';
1430 if ($showclassifyform) {
1432 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1433 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1434 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1435 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1436 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1437 print
'<input type="hidden" name="action" value="addintocategory">';
1438 print
'<table class="noborder centpercent">';
1439 print
'<tr class="liste_titre"><td>';
1440 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1441 print $form->selectForForms(
'Fichinter:fichinter/class/fichinter.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1442 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1448 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1449 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1450 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1451 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1452 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1453 print
'<input type="hidden" name="action" value="list">';
1456 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1457 $num = count($fichinters);
1458 $nbtotalofrecords =
'';
1459 $newcardbutton =
'';
1461 $langs->load(
'interventions');
1463 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1464 print
'<table class="noborder centpercent">'.
"\n";
1465 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1467 if (count($fichinters) > 0) {
1469 foreach ($fichinters as $fichinter) {
1475 print
"\t".
'<tr class="oddeven">'.
"\n";
1476 print
'<td class="nowrap tdtop">';
1477 print $fichinter->getNomUrl(1);
1479 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1481 print
'<td class="right">';
1483 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 :
'').
"'>";
1484 print $langs->trans(
"DeleteFromCat");
1485 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1492 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1498 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1505if ($type == Categorie::TYPE_ORDER && !$user->hasRight(
'commande',
'lire')) {
1508if ($type == Categorie::TYPE_ORDER) {
1509 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1511 $permission = $user->hasRight(
'commande',
'creer');
1513 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1518 '@phan-var-force Commande[] $objects';
1520 $showclassifyform = $user->hasRight(
'order',
'write');
1521 if ($showclassifyform) {
1523 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1524 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1525 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1526 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1527 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1528 print
'<input type="hidden" name="action" value="addintocategory">';
1529 print
'<table class="noborder centpercent">';
1530 print
'<tr class="liste_titre"><td>';
1531 print $langs->trans(
"AddOrderIntoCategory").
' ';
1532 print $form->selectForForms(
'Commande:commande/class/commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1533 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1539 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1540 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1541 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1542 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1543 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1544 print
'<input type="hidden" name="action" value="list">';
1547 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1548 $num = count($objects);
1549 $nbtotalofrecords =
'';
1550 $newcardbutton =
'';
1553 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1555 print
"<table class='noborder centpercent'>\n";
1556 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1558 if (count($objects) > 0) {
1560 foreach ($objects as $key => $order) {
1566 print
"\t".
'<tr class="oddeven">'.
"\n";
1567 print
'<td class="nowrap tdtop">';
1568 print $order->getNomUrl(1);
1570 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1572 print
'<td class="right">';
1574 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$order->id.
"'>";
1575 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1581 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1591if ($type == Categorie::TYPE_MO && !$user->hasRight(
'mrp',
'read')) {
1594if ($type == Categorie::TYPE_MO) {
1595 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
1597 $permission = $user->hasRight(
'mrp',
'write');
1599 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1604 '@phan-var-force Mo[] $objects';
1606 $showclassifyform = $user->hasRight(
'mrp',
'write');
1607 if ($showclassifyform) {
1609 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1610 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1611 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1612 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1613 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1614 print
'<input type="hidden" name="action" value="addintocategory">';
1615 print
'<table class="noborder centpercent">';
1616 print
'<tr class="liste_titre"><td>';
1617 print $langs->trans(
"AddMoIntoCategory").
' ';
1618 print $form->selectForForms(
'Mo:mrp/class/mo.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1619 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1625 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1626 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1627 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1628 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1629 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1630 print
'<input type="hidden" name="action" value="list">';
1633 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1634 $num = count($objects);
1635 $nbtotalofrecords =
'';
1636 $newcardbutton =
'';
1639 print_barre_liste($langs->trans(
"MOs"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'mrp', 0, $newcardbutton,
'', $limit);
1641 print
"<table class='noborder centpercent'>\n";
1642 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1644 if (count($objects) > 0) {
1646 foreach ($objects as $key => $mo) {
1652 print
"\t".
'<tr class="oddeven">'.
"\n";
1653 print
'<td class="nowrap tdtop">';
1654 print $mo->getNomUrl(1);
1656 print
'<td class="tdtop">'.$mo->ref.
"</td>\n";
1658 print
'<td class="right">';
1660 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$mo->id.
"'>";
1661 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1667 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1676if ($type == Categorie::TYPE_INVOICE && !$user->hasRight(
'facture',
'lire')) {
1679if ($type == Categorie::TYPE_INVOICE) {
1680 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1682 $permission = $user->hasRight(
'facture',
'creer');
1684 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1689 $showclassifyform = $user->hasRight(
'facture',
'write');
1690 if ($showclassifyform) {
1692 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1693 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1694 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1695 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1696 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1697 print
'<input type="hidden" name="action" value="addintocategory">';
1698 print
'<table class="noborder centpercent">';
1699 print
'<tr class="liste_titre"><td>';
1700 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1701 print $form->selectForForms(
'Facture:compta/facture/class/facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1702 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1708 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1709 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1710 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1711 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1712 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1713 print
'<input type="hidden" name="action" value="list">';
1716 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1717 $num = count($objects);
1718 $nbtotalofrecords =
'';
1719 $newcardbutton =
'';
1722 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1724 print
"<table class='noborder centpercent'>\n";
1725 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1727 if (count($objects) > 0) {
1729 foreach ($objects as $key => $invoice) {
1735 print
"\t".
'<tr class="oddeven">'.
"\n";
1736 print
'<td class="nowrap tdtop">';
1737 print $invoice->getNomUrl(1);
1739 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1741 print
'<td class="right">';
1743 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$invoice->id.
"'>";
1744 print $langs->trans(
"DeleteFromCat");
1745 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1751 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1760if ($type == Categorie::TYPE_SUPPLIER_ORDER && !((
isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
'fournisseur',
'commande',
'lire')) || (
isModEnabled(
'supplier_order') && $user->hasRight(
'supplier_order',
'lire')))) {
1763if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1764 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1766 $permission = $user->hasRight(
'fournisseur',
'commande',
'creer');
1768 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1773 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1775 if ($showclassifyform) {
1777 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1778 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1779 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1780 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1781 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1782 print
'<input type="hidden" name="action" value="addintocategory">';
1783 print
'<table class="noborder centpercent">';
1784 print
'<tr class="liste_titre"><td>';
1785 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1786 print $form->selectForForms(
'CommandeFournisseur:fourn/class/fournisseur.commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1787 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1793 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1794 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1795 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1796 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1797 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1798 print
'<input type="hidden" name="action" value="list">';
1801 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1802 $num = count($objects);
1803 $nbtotalofrecords =
'';
1804 $newcardbutton =
'';
1807 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1809 print
"<table class='noborder centpercent'>\n";
1810 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1812 if (count($objects) > 0) {
1814 foreach ($objects as $key => $supplier_order) {
1820 print
"\t".
'<tr class="oddeven">'.
"\n";
1821 print
'<td class="nowrap tdtop">';
1822 print $supplier_order->getNomUrl(1);
1824 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1826 print
'<td class="right">';
1828 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_order->id.
"'>";
1829 print $langs->trans(
"DeleteFromCat");
1830 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1836 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1845if ($type == Categorie::TYPE_SUPPLIER_INVOICE && !((
isModEnabled(
'fournisseur') && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight(
'fournisseur',
'facture',
'lire')) || (
isModEnabled(
'supplier_invoice') && $user->hasRight(
'supplier_invoice',
'lire')))) {
1848if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1849 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1851 $permission = $user->hasRight(
'fournisseur',
'facture',
'creer');
1853 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1858 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1859 if ($showclassifyform) {
1861 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1862 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1863 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1864 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1865 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1866 print
'<input type="hidden" name="action" value="addintocategory">';
1867 print
'<table class="noborder centpercent">';
1868 print
'<tr class="liste_titre"><td>';
1869 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1870 print $form->selectForForms(
'FactureFournisseur:fourn/class/fournisseur.facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1871 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1877 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1878 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1879 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1880 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1881 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1882 print
'<input type="hidden" name="action" value="list">';
1885 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1888 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1890 print
"<table class='noborder centpercent'>\n";
1891 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1893 if (count($objects) > 0) {
1895 foreach ($objects as $key => $supplier_invoice) {
1901 print
"\t".
'<tr class="oddeven">'.
"\n";
1902 print
'<td class="nowrap tdtop">';
1903 print $supplier_invoice->getNomUrl(1);
1905 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1907 print
'<td class="right">';
1909 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_invoice->id.
"'>";
1910 print $langs->trans(
"DeleteFromCat");
1911 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1917 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1926$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1927$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 warehouses.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
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'.
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_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.
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, $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.