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_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';
170 $tmpobject =
new Ticket($db);
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';
204 dol_print_error(
null,
"Not supported value of type = ".$type);
208 if ($tmpobject !==
null) {
210 $result =
$object->del_type($tmpobject, $elementtype);
212 dol_print_error(
null,
$object->error);
217if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
219 if (
$object->delete($user) >= 0) {
221 header(
"Location: ".$backtopage);
224 header(
"Location: ".
dolBuildUrl(DOL_URL_ROOT.
'/categories/categorie_list.php', [
'type' => $type]));
232if ($elemid && $action ==
'addintocategory') {
235 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
236 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
238 $elementtype =
'product';
239 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
240 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
242 $elementtype =
'customer';
243 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
244 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
246 $elementtype =
'supplier';
247 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
248 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
249 $newobject =
new Ticket($db);
250 $elementtype =
'ticket';
251 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
252 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
254 $elementtype =
'fichinter';
255 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
256 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
258 $elementtype =
'project';
259 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
260 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
262 $elementtype =
'member';
263 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
264 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
266 $elementtype =
'contact';
267 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
268 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
269 $newobject =
new User($db);
270 $elementtype =
'user';
271 } elseif ($type == Categorie::TYPE_WAREHOUSE && $user->hasRight(
'stock',
'creer')) {
272 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
274 $elementtype =
'warehouse';
275 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
276 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
278 $elementtype =
'bank_account';
279 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
280 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
282 $elementtype =
'order';
283 } elseif ($type == Categorie::TYPE_MO && $user->hasRight(
'mrp',
'write')) {
284 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
285 $newobject =
new Mo($db);
287 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
288 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
290 $elementtype =
'invoice';
291 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
292 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
294 $elementtype =
'supplier_order';
295 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
296 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
298 $elementtype =
'supplier_invoice';
302 $object->error = $langs->trans(
"NotEnoughPermissions");
304 if ($newobject !==
null) {
305 $result = $newobject->fetch($elemid);
308 if ($result >= 0 && $newobject !==
null) {
310 $result =
$object->add_type($newobject, $elementtype);
313 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
315 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
316 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
328$form =
new Form($db);
332 '/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
333 '/public/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
335$arrayofcss = array(
'/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
339llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
341$title = $langs->trans(
"Categories");
342$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
347$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
348$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
351$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a>';
352$morehtmlref .=
' > ';
353$ways =
$object->print_all_ways(
"auto",
'', 1, 0, 1);
354foreach ($ways as $way) {
355 $morehtmlref .= $way.
"<br>\n";
357$morehtmlref .=
'</div>';
359dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
363if ($action ==
'delete') {
365 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
367 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
373print
'<div class="fichecenter">';
374print
'<div class="underbanner clearboth"></div>';
375print
'<table class="border centpercent tableforfield">';
378print
'<tr><td class="titlefield notopnoleft tdtop">';
379print $langs->trans(
"Description").
'</td><td>';
384print
'<tr><td class="notopnoleft">';
385print $langs->trans(
"Color").
'</td><td>';
386print $formother->showColor(
$object->color);
390print
'<tr><td class="titlefield notopnoleft">';
391print $langs->trans(
"Position").
'</td><td>';
396include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
408print
"<div class='tabsAction'>\n";
409$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
411 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
413if (empty($reshook)) {
414 if ($user->hasRight(
'categorie',
'creer')) {
416 print
'<a class="butAction" href="'.dolBuildUrl(DOL_URL_ROOT.
'/categories/edit.php', [
'id' =>
$object->id,
'socid' => $socid,
'type' => $type]).
'">'.$langs->trans(
"Modify").
'</a>';
419 if ($user->hasRight(
'categorie',
'supprimer')) {
420 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";
427if ($user->hasRight(
'categorie',
'creer')) {
428 $link =
dolBuildUrl(DOL_URL_ROOT.
'/categories/card.php', [
'action'=>
'create',
'type' => $type,
'catorigin' =>
$object->id,
'backtopage' =>
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'type' => $type,
'id' => $id])]);
430 $newcardbutton =
'<div class="right">';
431 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
432 $newcardbutton .=
'</div>';
440print
'<div class="fichecenter">';
442print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
446print
'<table class="liste nohover noborder centpercent borderbottom">';
448print
'<tr class="liste_titre">';
449print
'<td>'.$langs->trans(
"SubCats").
'</td>';
451print
'<td class="right">';
453if (is_array($cats) && count($cats) > 1 && !empty(
$conf->use_javascript_ajax)) {
454 print
'<div id="iddivjstreecontrol">';
455 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
457 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
464if (is_numeric($cats) && $cats < 0) {
466} elseif (count($cats) < 1) {
467 print
'<tr class="oddeven nobottom nohover">';
468 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
473 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
477 if ($type == Categorie::TYPE_MEMBER) {
478 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
480 if ($type == Categorie::TYPE_ACCOUNT) {
481 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
483 if ($type == Categorie::TYPE_PROJECT) {
484 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
486 if ($type == Categorie::TYPE_USER) {
487 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
493 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
494 foreach ($fulltree as $key => $val) {
495 $categstatic->id = $val[
'id'];
496 $categstatic->ref = $val[
'label'];
497 $categstatic->color = $val[
'color'];
498 $categstatic->type = $type;
504 $elements = $categstatic->getObjectsInCateg($type, 1);
506 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
509 if ($categstatic->color) {
510 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
512 $stylecolor =
' style="background: #bbb;"';
514 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
516 $entry =
'<table class="nobordernopadding centpercent">';
520 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
525 $entry .=
'<td class="right" width="20px;">';
526 $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>';
528 $entry .=
'<td class="right" width="20px;">';
529 $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>';
531 $entry .=
'<td class="right" width="20px;">';
532 $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>';
536 $entry .=
'</table>';
538 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
541 $nbofentries = (count($data) - 1);
542 if ($nbofentries > 0) {
543 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
544 print
'<tr class="pair">';
545 print
'<td colspan="3">';
553 print
'<tr class="pair">';
554 print
'<td colspan="3">';
555 print
'<table class="nobordernopadding">';
557 print
'<tr class="nobordernopadding">';
558 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
559 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
560 print
'<td> </td>';
573$arrayofmassactions = array(
579$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
585if ($type == Categorie::TYPE_PRODUCT) {
586 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
587 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
588 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
590 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
595 '@phan-var-force Product[] $prods';
597 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
598 print
'<input type="hidden" name="token" value="'.newToken().
'">';
599 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
600 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
601 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
602 print
'<input type="hidden" name="page_y" value="">';
603 print
'<input type="hidden" name="action" value="list">';
606 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
607 $num = count($prods);
608 $nbtotalofrecords =
'';
609 $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'));
612 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
614 if ($showclassifyform) {
615 print
'<table class="noborder centpercent">';
616 print
'<tr class="liste_titre"><td>';
617 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
618 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
619 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
624 print
'<table class="noborder centpercent">'.
"\n";
625 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
627 if (count($prods) > 0) {
629 foreach ($prods as $prod) {
635 print
'<tr class="oddeven">'.
"\n";
636 print
'<td class="nowrap tdtop">';
637 print $prod->getNomUrl(1);
640 $product_thumbnail_html =
'';
641 if (!empty($prod->entity)) {
642 $product_thumbnail = $prod->show_photos(
'product',
$conf->product->multidir_output[(
int) $prod->entity], 1, 1, 0, 0, 0, 80);
643 if ($prod->nbphoto > 0) {
644 $product_thumbnail_html = $product_thumbnail;
647 print
'<td class="left">' . $product_thumbnail_html .
'</td>';
648 $product_stock_info =
"";
649 if (
isModEnabled(
"stock") && ($user->hasRight(
"stock",
"read"))) {
650 $product_stock_info =
"<br>" . $langs->trans(
"Stock") .
": " . $prod->stock_reel;
653 print
'<td class="tdtop">' . dolPrintHTML($prod->label) .
"<br>" . dolPrintHTML($prod->description) . $product_stock_info .
"</td>\n";
656 print
'<td class="right">';
658 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 :
'').
'">';
660 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
667 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
674 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
680if ($type == Categorie::TYPE_CUSTOMER) {
681 if ($user->hasRight(
"societe",
"read")) {
682 $permission = $user->hasRight(
'societe',
'creer');
683 $showclassifyform = $user->hasRight(
'societe',
'creer');
685 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
690 '@phan-var-force Societe[] $socs';
692 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
693 print
'<input type="hidden" name="token" value="'.newToken().
'">';
694 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
695 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
696 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
697 print
'<input type="hidden" name="action" value="list">';
698 print
'<input type="hidden" name="page_y" value="">';
701 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
703 $nbtotalofrecords =
'';
704 $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'));
707 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
709 if ($showclassifyform) {
710 print
'<table class="noborder centpercent">';
711 print
'<tr class="liste_titre"><td>';
712 print $langs->trans(
"AddCustomerIntoCategory").
' ';
713 $filter =
'(s.client:IN:1,2,3)';
714 print $form->select_company(
'',
'elemid', $filter);
715 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
720 print
'<table class="noborder centpercent">'.
"\n";
721 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
723 if (count($socs) > 0) {
725 foreach ($socs as $key => $soc) {
731 print
"\t".
'<tr class="oddeven">'.
"\n";
732 print
'<td class="nowrap tdtop tdoverflowmax250">';
733 print $soc->getNomUrl(1);
736 print
'<td class="right">';
738 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 :
'').
"'>";
740 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
747 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
754 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
760if ($type == Categorie::TYPE_SUPPLIER) {
761 if ($user->hasRight(
"fournisseur",
"read")) {
762 $permission = $user->hasRight(
'societe',
'creer');
763 $showclassifyform = $user->hasRight(
'societe',
'creer');
765 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
771 '@phan-var-force Fournisseur[] $socs';
773 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
774 print
'<input type="hidden" name="token" value="'.newToken().
'">';
775 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
776 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
777 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
778 print
'<input type="hidden" name="page_y" value="">';
779 print
'<input type="hidden" name="action" value="list">';
782 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
784 $nbtotalofrecords =
'';
785 $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'));
788 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
790 if ($showclassifyform) {
791 print
'<table class="noborder centpercent">';
792 print
'<tr class="liste_titre"><td>';
793 print $langs->trans(
"AddSupplierIntoCategory").
' ';
794 $filter =
'(s.fournisseur:=:1)';
795 print $form->select_company(
'',
'elemid', $filter);
796 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
801 print
'<table class="noborder centpercent">'.
"\n";
802 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
804 if (count($socs) > 0) {
806 foreach ($socs as $soc) {
812 print
"\t".
'<tr class="oddeven">'.
"\n";
813 print
'<td class="nowrap tdtop">';
814 print $soc->getNomUrl(1);
817 print
'<td class="right">';
819 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 :
'').
'">';
821 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
829 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
836 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
842if ($type == Categorie::TYPE_MEMBER) {
843 if ($user->hasRight(
"adherent",
"read")) {
844 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
846 $permission = $user->hasRight(
'adherent',
'creer');
847 $showclassifyform = $user->hasRight(
'adherent',
'creer');
849 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
854 '@phan-var-force Adherent[] $members';
856 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
857 print
'<input type="hidden" name="token" value="'.newToken().
'">';
858 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
859 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
860 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
861 print
'<input type="hidden" name="page_y" value="">';
862 print
'<input type="hidden" name="action" value="list">';
865 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
866 $num = count($members);
867 $nbtotalofrecords =
'';
868 $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'));
871 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
873 if ($showclassifyform) {
874 print
'<table class="noborder centpercent">';
875 print
'<tr class="liste_titre"><td>';
876 print $langs->trans(
"AssignCategoryTo").
' ';
877 print $form->selectMembers(
'',
'elemid');
878 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
883 print
'<table class="noborder centpercent">'.
"\n";
884 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
886 if (count($members) > 0) {
888 foreach ($members as $key => $member) {
894 print
"\t".
'<tr class="oddeven">'.
"\n";
895 print
'<td class="nowrap tdtop">';
896 $member->ref = $member->login;
897 print $member->getNomUrl(1, 0);
899 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
900 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
902 print
'<td class="right">';
904 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 :
'').
"'>";
906 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
913 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
920 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
926if ($type == Categorie::TYPE_CONTACT) {
927 if ($user->hasRight(
"societe",
"read")) {
928 $permission = $user->hasRight(
'societe',
'creer');
929 $showclassifyform = $user->hasRight(
'societe',
'creer');
931 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
932 if (is_numeric($contacts) && $contacts < 0) {
936 '@phan-var-force Contact[] $contacts';
938 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
939 print
'<input type="hidden" name="token" value="'.newToken().
'">';
940 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
941 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
942 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
943 print
'<input type="hidden" name="page_y" value="">';
944 print
'<input type="hidden" name="action" value="list">';
947 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
948 $num = count($contacts);
949 $nbtotalofrecords =
'';
950 $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'));
955 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
957 if ($showclassifyform) {
958 print
'<table class="noborder centpercent">';
959 print
'<tr class="liste_titre"><td>';
960 print $langs->trans(
"AssignCategoryTo").
' ';
961 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
962 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
967 print
'<table class="noborder centpercent">'.
"\n";
968 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
970 if (is_array($contacts) && count($contacts) > 0) {
972 foreach ($contacts as $key => $contact) {
978 print
"\t".
'<tr class="oddeven">'.
"\n";
979 print
'<td class="nowrap tdtop">';
980 print $contact->getNomUrl(1,
'category');
981 if ($contact->socid > 0) {
982 $objsoc->fetch($contact->socid);
984 print $objsoc->getNomUrl(1,
'contact');
988 print
'<td class="right">';
990 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 :
'').
"'>";
992 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
999 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1006 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
1012if ($type == Categorie::TYPE_ACCOUNT) {
1013 if ($user->hasRight(
"banque",
"read")) {
1014 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1016 $permission = $user->hasRight(
'banque',
'creer');
1017 $showclassifyform = $user->hasRight(
'banque',
'creer');
1019 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1020 if ($accounts < 0) {
1024 '@phan-var-force Account[] $accounts';
1026 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1027 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1028 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1029 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1030 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1031 print
'<input type="hidden" name="page_y" value="">';
1032 print
'<input type="hidden" name="action" value="list">';
1035 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1036 $num = count($accounts);
1037 $nbtotalofrecords =
'';
1038 $newcardbutton =
'';
1041 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1043 if ($showclassifyform) {
1044 print
'<table class="noborder centpercent">';
1045 print
'<tr class="liste_titre"><td>';
1046 print $langs->trans(
"AddObjectIntoCategory").
' ';
1047 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1048 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1053 print
'<table class="noborder centpercent">'.
"\n";
1054 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1056 if (count($accounts) > 0) {
1058 foreach ($accounts as $key => $account) {
1064 print
"\t".
'<tr class="oddeven">'.
"\n";
1065 print
'<td class="nowrap tdtop">';
1066 print $account->getNomUrl(1,
'0');
1068 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1069 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1071 print
'<td class="right">';
1073 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 :
'').
"'>";
1075 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1082 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1089 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1095if ($type == Categorie::TYPE_PROJECT) {
1096 if ($user->hasRight(
"project",
"read")) {
1097 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1099 $permission = $user->hasRight(
'projet',
'creer');
1100 $showclassifyform = $user->hasRight(
'projet',
'creer');
1102 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1107 '@phan-var-force Project[] $objects';
1109 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1110 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1111 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1112 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1113 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1114 print
'<input type="hidden" name="page_y" value="">';
1115 print
'<input type="hidden" name="action" value="list">';
1118 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1119 $num = count($objects);
1120 $nbtotalofrecords =
'';
1121 $newcardbutton =
'';
1124 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1126 if ($showclassifyform) {
1127 print
'<table class="noborder centpercent">';
1128 print
'<tr class="liste_titre"><td>';
1129 print $langs->trans(
"AddObjectIntoCategory").
' ';
1130 $form->selectProjects(
'',
'elemid');
1131 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1136 print
'<table class="noborder centpercent">'.
"\n";
1137 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1139 if (count($objects) > 0) {
1141 foreach ($objects as $key => $project) {
1147 print
"\t".
'<tr class="oddeven">'.
"\n";
1148 print
'<td class="nowrap tdtop">';
1149 print $project->getNomUrl(1);
1151 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1153 print
'<td class="right">';
1155 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 :
'').
"'>";
1157 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1164 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1171 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1177if ($type == Categorie::TYPE_USER) {
1178 if ($user->hasRight(
"user",
"user",
"read")) {
1179 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1180 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1182 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1187 '@phan-var-force User[] $users';
1190 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1191 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1192 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1193 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1194 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1195 print
'<input type="hidden" name="page_y" value="">';
1196 print
'<input type="hidden" name="action" value="list">';
1200 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1201 $num = count($users);
1202 $nbtotalofrecords =
'';
1203 $newcardbutton =
'';
1206 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1208 if ($showclassifyform) {
1209 print
'<table class="noborder centpercent">';
1210 print
'<tr class="liste_titre"><td>';
1212 print img_picto(
'', $type,
'class="pictofixedwidth"');
1213 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1214 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1219 print
'<table class="noborder centpercent">'.
"\n";
1220 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1222 if (count($users) > 0) {
1224 foreach ($users as $key => $userentry) {
1225 print
"\t".
'<tr class="oddeven">'.
"\n";
1226 print
'<td class="nowrap tdtop">';
1227 print $userentry->getNomUrl(-1);
1229 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1232 print
'<td class="right">';
1233 if ($user->hasRight(
'user',
'user',
'creer')) {
1234 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 :
'').
"'>";
1236 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1243 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1250 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1256if ($type == Categorie::TYPE_WAREHOUSE) {
1257 if ($user->hasRight(
"stock",
"read")) {
1258 $permission = $user->hasRight(
'stock',
'creer');
1259 $showclassifyform = $user->hasRight(
'stock',
'creer');
1261 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1263 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1268 '@phan-var-force Entrepot[] $objects';
1269 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1270 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1271 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1272 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1273 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1274 print
'<input type="hidden" name="page_y" value="">';
1275 print
'<input type="hidden" name="action" value="list">';
1278 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1279 $num = count($objects);
1280 $nbtotalofrecords =
'';
1281 $newcardbutton =
'';
1284 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1286 if ($showclassifyform) {
1287 print
'<table class="noborder centpercent">';
1288 print
'<tr class="liste_titre"><td>';
1289 print $langs->trans(
"AddWarehouseIntoCategory").
' ';
1290 print $form->selectForForms(
'Entrepot:product/stock/class/entrepot.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1291 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1296 print
'<table class="noborder centpercent">'.
"\n";
1297 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1299 if (count($objects) > 0) {
1301 foreach ($objects as $key => $warehouse) {
1307 print
"\t".
'<tr class="oddeven">'.
"\n";
1308 print
'<td class="nowrap tdtop">';
1309 print $warehouse->getNomUrl(1);
1311 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1312 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1314 print
'<td class="right">';
1316 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 :
'').
"'>";
1318 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1325 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1332 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1338if ($type == Categorie::TYPE_TICKET) {
1339 if ($user->hasRight(
"ticket",
"read")) {
1340 $permission = $user->hasRight(
'categorie',
'creer');
1341 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1343 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1348 '@phan-var-force Ticket[] $tickets';
1350 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1351 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1352 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1353 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1354 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1355 print
'<input type="hidden" name="page_y" value="">';
1356 print
'<input type="hidden" name="action" value="list">';
1359 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1360 $num = count($tickets);
1361 $nbtotalofrecords =
'';
1362 $newcardbutton =
'';
1365 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1367 if ($showclassifyform) {
1368 print
'<table class="noborder centpercent">';
1369 print
'<tr class="liste_titre"><td>';
1370 print $langs->trans(
"AddTicketIntoCategory").
' ';
1371 $form->selectTickets(
'',
'elemid');
1372 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1377 print
'<table class="noborder centpercent">'.
"\n";
1378 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1380 if (count($tickets) > 0) {
1382 foreach ($tickets as $ticket) {
1388 print
"\t".
'<tr class="oddeven">'.
"\n";
1389 print
'<td class="nowrap tdtop">';
1390 print $ticket->getNomUrl(1);
1392 print
'<td class="tdtop">'.$ticket->track_id.
"</td>\n";
1394 print
'<td class="right">';
1396 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 :
'').
"'>";
1398 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1405 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1412 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1418if ($type == Categorie::TYPE_FICHINTER) {
1419 if ($user->hasRight(
"fichinter",
"lire")) {
1420 $permission = $user->hasRight(
'categorie',
'creer');
1421 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1423 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1424 if ($fichinters < 0) {
1428 '@phan-var-force Fichinter[] $fichinters';
1431 if ($showclassifyform) {
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="addintocategory">';
1439 print
'<table class="noborder centpercent">';
1440 print
'<tr class="liste_titre"><td>';
1441 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1442 print $form->selectForForms(
'Fichinter:fichinter/class/fichinter.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1443 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1449 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1450 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1451 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1452 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1453 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1454 print
'<input type="hidden" name="action" value="list">';
1457 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1458 $num = count($fichinters);
1459 $nbtotalofrecords =
'';
1460 $newcardbutton =
'';
1462 $langs->load(
'interventions');
1464 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1465 print
'<table class="noborder centpercent">'.
"\n";
1466 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1468 if (count($fichinters) > 0) {
1470 foreach ($fichinters as $fichinter) {
1476 print
"\t".
'<tr class="oddeven">'.
"\n";
1477 print
'<td class="nowrap tdtop">';
1478 print $fichinter->getNomUrl(1);
1480 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1482 print
'<td class="right">';
1484 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 :
'').
"'>";
1485 print $langs->trans(
"DeleteFromCat");
1486 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1493 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1499 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1506if ($type == Categorie::TYPE_ORDER && !$user->hasRight(
'commande',
'lire')) {
1509if ($type == Categorie::TYPE_ORDER) {
1510 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1512 $permission = $user->hasRight(
'commande',
'creer');
1514 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1519 '@phan-var-force Commande[] $objects';
1521 $showclassifyform = $user->hasRight(
'order',
'write');
1522 if ($showclassifyform) {
1524 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1525 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1526 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1527 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1528 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1529 print
'<input type="hidden" name="action" value="addintocategory">';
1530 print
'<table class="noborder centpercent">';
1531 print
'<tr class="liste_titre"><td>';
1532 print $langs->trans(
"AddOrderIntoCategory").
' ';
1533 print $form->selectForForms(
'Commande:commande/class/commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1534 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1540 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1541 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1542 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1543 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1544 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1545 print
'<input type="hidden" name="action" value="list">';
1548 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1549 $num = count($objects);
1550 $nbtotalofrecords =
'';
1551 $newcardbutton =
'';
1554 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1556 print
"<table class='noborder centpercent'>\n";
1557 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1559 if (count($objects) > 0) {
1561 foreach ($objects as $key => $order) {
1567 print
"\t".
'<tr class="oddeven">'.
"\n";
1568 print
'<td class="nowrap tdtop">';
1569 print $order->getNomUrl(1);
1571 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1573 print
'<td class="right">';
1575 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$order->id.
"'>";
1576 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1582 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1592if ($type == Categorie::TYPE_MO && !$user->hasRight(
'mrp',
'read')) {
1595if ($type == Categorie::TYPE_MO) {
1596 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
1598 $permission = $user->hasRight(
'mrp',
'write');
1600 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1605 '@phan-var-force Mo[] $objects';
1607 $showclassifyform = $user->hasRight(
'mrp',
'write');
1608 if ($showclassifyform) {
1610 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1611 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1612 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1613 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1614 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1615 print
'<input type="hidden" name="action" value="addintocategory">';
1616 print
'<table class="noborder centpercent">';
1617 print
'<tr class="liste_titre"><td>';
1618 print $langs->trans(
"AddMoIntoCategory").
' ';
1619 print $form->selectForForms(
'Mo:mrp/class/mo.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1620 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1626 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1627 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1628 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1629 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1630 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1631 print
'<input type="hidden" name="action" value="list">';
1634 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1635 $num = count($objects);
1636 $nbtotalofrecords =
'';
1637 $newcardbutton =
'';
1640 print_barre_liste($langs->trans(
"MOs"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'mrp', 0, $newcardbutton,
'', $limit);
1642 print
"<table class='noborder centpercent'>\n";
1643 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1645 if (count($objects) > 0) {
1647 foreach ($objects as $key => $mo) {
1653 print
"\t".
'<tr class="oddeven">'.
"\n";
1654 print
'<td class="nowrap tdtop">';
1655 print $mo->getNomUrl(1);
1657 print
'<td class="tdtop">'.$mo->ref.
"</td>\n";
1659 print
'<td class="right">';
1661 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$mo->id.
"'>";
1662 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1668 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1677if ($type == Categorie::TYPE_INVOICE && !$user->hasRight(
'facture',
'lire')) {
1680if ($type == Categorie::TYPE_INVOICE) {
1681 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1683 $permission = $user->hasRight(
'facture',
'creer');
1685 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1690 $showclassifyform = $user->hasRight(
'facture',
'write');
1691 if ($showclassifyform) {
1693 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1694 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1695 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1696 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1697 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1698 print
'<input type="hidden" name="action" value="addintocategory">';
1699 print
'<table class="noborder centpercent">';
1700 print
'<tr class="liste_titre"><td>';
1701 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1702 print $form->selectForForms(
'Facture:compta/facture/class/facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1703 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1709 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1710 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1711 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1712 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1713 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1714 print
'<input type="hidden" name="action" value="list">';
1717 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1718 $num = count($objects);
1719 $nbtotalofrecords =
'';
1720 $newcardbutton =
'';
1723 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1725 print
"<table class='noborder centpercent'>\n";
1726 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1728 if (count($objects) > 0) {
1730 foreach ($objects as $key => $invoice) {
1736 print
"\t".
'<tr class="oddeven">'.
"\n";
1737 print
'<td class="nowrap tdtop">';
1738 print $invoice->getNomUrl(1);
1740 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1742 print
'<td class="right">';
1744 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$invoice->id.
"'>";
1745 print $langs->trans(
"DeleteFromCat");
1746 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1752 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1761if ($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')))) {
1764if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1765 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1767 $permission = $user->hasRight(
'fournisseur',
'commande',
'creer');
1769 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1774 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1776 if ($showclassifyform) {
1778 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1779 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1780 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1781 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1782 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1783 print
'<input type="hidden" name="action" value="addintocategory">';
1784 print
'<table class="noborder centpercent">';
1785 print
'<tr class="liste_titre"><td>';
1786 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1787 print $form->selectForForms(
'CommandeFournisseur:fourn/class/fournisseur.commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1788 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1794 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1795 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1796 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1797 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1798 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1799 print
'<input type="hidden" name="action" value="list">';
1802 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1803 $num = count($objects);
1804 $nbtotalofrecords =
'';
1805 $newcardbutton =
'';
1808 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1810 print
"<table class='noborder centpercent'>\n";
1811 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1813 if (count($objects) > 0) {
1815 foreach ($objects as $key => $supplier_order) {
1821 print
"\t".
'<tr class="oddeven">'.
"\n";
1822 print
'<td class="nowrap tdtop">';
1823 print $supplier_order->getNomUrl(1);
1825 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1827 print
'<td class="right">';
1829 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_order->id.
"'>";
1830 print $langs->trans(
"DeleteFromCat");
1831 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1837 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1846if ($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')))) {
1849if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1850 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1852 $permission = $user->hasRight(
'fournisseur',
'facture',
'creer');
1854 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1859 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1860 if ($showclassifyform) {
1862 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1863 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1864 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1865 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1866 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1867 print
'<input type="hidden" name="action" value="addintocategory">';
1868 print
'<table class="noborder centpercent">';
1869 print
'<tr class="liste_titre"><td>';
1870 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1871 print $form->selectForForms(
'FactureFournisseur:fourn/class/fournisseur.facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1872 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1878 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1879 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1880 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1881 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1882 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1883 print
'<input type="hidden" name="action" value="list">';
1886 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1889 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1891 print
"<table class='noborder centpercent'>\n";
1892 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1894 if (count($objects) > 0) {
1896 foreach ($objects as $key => $supplier_invoice) {
1902 print
"\t".
'<tr class="oddeven">'.
"\n";
1903 print
'<td class="nowrap tdtop">';
1904 print $supplier_invoice->getNomUrl(1);
1906 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1908 print
'<td class="right">';
1910 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_invoice->id.
"'>";
1911 print $langs->trans(
"DeleteFromCat");
1912 print img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1918 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1927$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1928$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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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.
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.