36require
'../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/categories.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
50$langs->loadLangs(array(
"categories",
"compta"));
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);
108$extrafields->fetch_name_optionals_label(
$object->table_element);
114if ($confirm ==
'no') {
116 header(
"Location: ".$backtopage);
120$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
121$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
123if ($id > 0 && $removeelem > 0 && $action ==
'unlink') {
126 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
127 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
129 $result = $tmpobject->fetch($removeelem);
130 $elementtype =
'product';
131 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
133 $result = $tmpobject->fetch($removeelem);
134 $elementtype =
'supplier';
135 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
137 $result = $tmpobject->fetch($removeelem);
138 $elementtype =
'customer';
139 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
140 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
142 $result = $tmpobject->fetch($removeelem);
143 $elementtype =
'member';
144 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
145 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
147 $result = $tmpobject->fetch($removeelem);
148 $elementtype =
'contact';
149 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
150 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
152 $result = $tmpobject->fetch($removeelem);
153 $elementtype =
'account';
154 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
155 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
157 $result = $tmpobject->fetch($removeelem);
158 $elementtype =
'project';
159 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
160 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
161 $tmpobject =
new User($db);
162 $result = $tmpobject->fetch($removeelem);
163 $elementtype =
'user';
164 } elseif ($type == Categorie::TYPE_WAREHOUSE && $user->hasRight(
'stock',
'creer')) {
165 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
167 $result = $tmpobject->fetch($removeelem);
168 $elementtype =
'warehouse';
169 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
170 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
171 $tmpobject =
new Ticket($db);
172 $result = $tmpobject->fetch($removeelem);
173 $elementtype =
'ticket';
174 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
175 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
177 $result = $tmpobject->fetch($removeelem);
178 $elementtype =
'fichinter';
179 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
180 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
182 $result = $tmpobject->fetch($removeelem);
183 $elementtype =
'order';
184 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
185 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
187 $result = $tmpobject->fetch($removeelem);
188 $elementtype =
'invoice';
189 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
190 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
192 $result = $tmpobject->fetch($removeelem);
193 $elementtype =
'supplier_order';
194 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
195 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
197 $result = $tmpobject->fetch($removeelem);
198 $elementtype =
'supplier_invoice';
204 if ($tmpobject !==
null) {
206 $result =
$object->del_type($tmpobject, $elementtype);
213if ($user->hasRight(
'categorie',
'supprimer') && $action ==
'confirm_delete' && $confirm ==
'yes') {
214 if (
$object->delete($user) >= 0) {
216 header(
"Location: ".$backtopage);
219 header(
"Location: ".
dolBuildUrl(DOL_URL_ROOT.
'/categories/categorie_list.php', [
'type' => $type]));
227if ($elemid && $action ==
'addintocategory') {
230 if ($type == Categorie::TYPE_PRODUCT && ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'))) {
231 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
233 $elementtype =
'product';
234 } elseif ($type == Categorie::TYPE_CUSTOMER && $user->hasRight(
'societe',
'creer')) {
235 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
237 $elementtype =
'customer';
238 } elseif ($type == Categorie::TYPE_SUPPLIER && $user->hasRight(
'societe',
'creer')) {
239 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
241 $elementtype =
'supplier';
242 } elseif ($type == Categorie::TYPE_TICKET && $user->hasRight(
'ticket',
'write')) {
243 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
244 $newobject =
new Ticket($db);
245 $elementtype =
'ticket';
246 } elseif ($type == Categorie::TYPE_FICHINTER && $user->hasRight(
'ficheinter',
'write')) {
247 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
249 $elementtype =
'fichinter';
250 } elseif ($type == Categorie::TYPE_PROJECT && $user->hasRight(
'projet',
'creer')) {
251 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
253 $elementtype =
'project';
254 } elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight(
'adherent',
'creer')) {
255 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
257 $elementtype =
'member';
258 } elseif ($type == Categorie::TYPE_CONTACT && $user->hasRight(
'societe',
'creer')) {
259 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
261 $elementtype =
'contact';
262 } elseif ($type == Categorie::TYPE_USER && $user->hasRight(
'user',
'user',
'creer')) {
263 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
264 $newobject =
new User($db);
265 $elementtype =
'user';
266 } elseif ($type == Categorie::TYPE_WAREHOUSE && $user->hasRight(
'stock',
'creer')) {
267 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
269 $elementtype =
'warehouse';
270 } elseif ($type == Categorie::TYPE_ACCOUNT && $user->hasRight(
'banque',
'configurer')) {
271 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
273 $elementtype =
'bank_account';
274 } elseif ($type == Categorie::TYPE_ORDER && $user->hasRight(
'commande',
'creer')) {
275 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
277 $elementtype =
'order';
278 } elseif ($type == Categorie::TYPE_INVOICE && $user->hasRight(
'facture',
'creer')) {
279 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
281 $elementtype =
'invoice';
282 } elseif ($type == Categorie::TYPE_SUPPLIER_ORDER && $user->hasRight(
'fournisseur',
'commande',
'creer')) {
283 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
285 $elementtype =
'supplier_order';
286 } elseif ($type == Categorie::TYPE_SUPPLIER_INVOICE && $user->hasRight(
'fournisseur',
'facture',
'creer')) {
287 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
289 $elementtype =
'supplier_invoice';
293 $object->error = $langs->trans(
"NotEnoughPermissions");
295 if ($newobject !==
null) {
296 $result = $newobject->fetch($elemid);
299 if ($result >= 0 && $newobject !==
null) {
301 $result =
$object->add_type($newobject, $elementtype);
304 setEventMessages($langs->trans(
"WasAddedSuccessfully", $newobject->ref),
null,
'mesgs');
306 if (
$object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
307 setEventMessages($langs->trans(
"ObjectAlreadyLinkedToCategory"),
null,
'warnings');
319$form =
new Form($db);
323 '/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
324 '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
326$arrayofcss = array(
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
330llxHeader(
"", $langs->trans(
"Categories"), $help_url,
'', 0, 0, $arrayofjs, $arrayofcss);
332$title = $langs->trans(
"Categories");
333$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
338$backtolist = (
GETPOST(
'backtolist') ?
GETPOST(
'backtolist') : DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type));
339$linkback =
'<a href="'.dol_sanitizeUrl($backtolist).
'">'.$langs->trans(
"BackToList").
'</a>';
342$morehtmlref =
'<br><div class="refidno"><a href="'.DOL_URL_ROOT.
'/categories/categorie_list.php?leftmenu=cat&type='.urlencode($type).
'">'.$langs->trans(
"Root").
'</a>';
343$morehtmlref .=
' > ';
344$ways =
$object->print_all_ways(
"auto",
'', 1, 0, 1);
345foreach ($ways as $way) {
346 $morehtmlref .= $way.
"<br>\n";
348$morehtmlref .=
'</div>';
350dol_banner_tab($object,
'label', $linkback, ($user->socid ? 0 : 1),
'label',
'label', $morehtmlref,
'&type='.urlencode($type), 0,
'',
'', 1);
354if ($action ==
'delete') {
356 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type).
'&backtopage='.urlencode($backtopage), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 2);
358 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&type='.urlencode($type), $langs->trans(
'DeleteCategory'), $langs->trans(
'ConfirmDeleteCategory'),
'confirm_delete',
'',
'', 1);
364print
'<div class="fichecenter">';
365print
'<div class="underbanner clearboth"></div>';
366print
'<table class="border centpercent tableforfield">';
369print
'<tr><td class="titlefield notopnoleft tdtop">';
370print $langs->trans(
"Description").
'</td><td>';
375print
'<tr><td class="notopnoleft">';
376print $langs->trans(
"Color").
'</td><td>';
377print $formother->showColor(
$object->color);
381print
'<tr><td class="titlefield notopnoleft">';
382print $langs->trans(
"Position").
'</td><td>';
387include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
399print
"<div class='tabsAction'>\n";
400$reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
404if (empty($reshook)) {
405 if ($user->hasRight(
'categorie',
'creer')) {
407 print
'<a class="butAction" href="'.dolBuildUrl(DOL_URL_ROOT.
'/categories/edit.php', [
'id' =>
$object->id,
'socid' => $socid,
'type' => $type]).
'">'.$langs->trans(
"Modify").
'</a>';
410 if ($user->hasRight(
'categorie',
'supprimer')) {
411 print
'<a class="butActionDelete" href="'.dolBuildUrl($_SERVER[
"PHP_SELF"], [
'action' =>
'delete',
'id' =>
$object->id,
'type' => $type,
'backtolist' => $backtolist],
true).
'">'.$langs->trans(
"Delete").
'</a>';
418if ($user->hasRight(
'categorie',
'creer')) {
419 $link =
dolBuildUrl(DOL_URL_ROOT.
'/categories/card.php', [
'action'=>
'create',
'type' => $type,
'catorigin' =>
$object->id,
'backtopage' =>
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'type' => $type,
'id' => $id])]);
421 $newcardbutton =
'<div class="right">';
422 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewCategory'),
'',
'fa fa-plus-circle', $link);
423 $newcardbutton .=
'</div>';
431print
'<div class="fichecenter">';
433print
load_fiche_titre($langs->trans(
"SubCats"), $newcardbutton,
'object_category');
437print
'<table class="liste nohover noborder centpercent borderbottom">';
439print
'<tr class="liste_titre">';
440print
'<td>'.$langs->trans(
"SubCats").
'</td>';
442print
'<td class="right">';
444if (is_array($cats) && count($cats) > 1 && !empty($conf->use_javascript_ajax)) {
445 print
'<div id="iddivjstreecontrol">';
446 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder').
' '.$langs->trans(
"UndoExpandAll").
'</a>';
448 print
'<a class="notasortlink" href="#">'.img_picto(
'',
'folder-open').
' '.$langs->trans(
"ExpandAll").
'</a>';
455if (is_numeric($cats) && $cats < 0) {
457} elseif (count($cats) < 1) {
458 print
'<tr class="oddeven nobottom nohover">';
459 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoSubCat").
'</span></td>';
464 $fulltree = $categstatic->get_full_arbo($type,
$object->id, 1);
468 if ($type == Categorie::TYPE_MEMBER) {
469 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
471 if ($type == Categorie::TYPE_ACCOUNT) {
472 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
474 if ($type == Categorie::TYPE_PROJECT) {
475 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
477 if ($type == Categorie::TYPE_USER) {
478 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
484 $data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
'racine',
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
485 foreach ($fulltree as $key => $val) {
486 $categstatic->id = $val[
'id'];
487 $categstatic->ref = $val[
'label'];
488 $categstatic->color = $val[
'color'];
489 $categstatic->type = $type;
495 $elements = $categstatic->getObjectsInCateg($type, 1);
497 $counter =
"<td class='left' width='40px;'>".(is_array($elements) ? count($elements) :
'0').
"</td>";
500 if ($categstatic->color) {
501 $stylecolor =
' style="background: #'.sprintf(
"%06s", $categstatic->color).
';"';
503 $stylecolor =
' style="background: #bbb;"';
505 $li = $categstatic->getNomUrl(1,
'', 60,
'&backtolist='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.((
int) $id).
'&type='.urlencode($type)), 0);
507 $entry =
'<table class="nobordernopadding centpercent">';
511 $entry .=
'<span class="noborderoncategories" '.$stylecolor.
'>'.$li.
'</span>';
516 $entry .=
'<td class="right" width="20px;">';
517 $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>';
519 $entry .=
'<td class="right" width="20px;">';
520 $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>';
522 $entry .=
'<td class="right" width="20px;">';
523 $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>';
527 $entry .=
'</table>';
529 $data[] = array(
'rowid' => $val[
'rowid'],
'fk_menu' => $val[
'fk_parent'],
'entry' => $entry);
532 $nbofentries = (count($data) - 1);
533 if ($nbofentries > 0) {
534 require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
535 print
'<tr class="pair">';
536 print
'<td colspan="3">';
544 print
'<tr class="pair">';
545 print
'<td colspan="3">';
546 print
'<table class="nobordernopadding">';
548 print
'<tr class="nobordernopadding">';
549 print
'<td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
550 print
'<td class="valignmiddle"><span class="opacitymedium">'.$langs->trans(
"NoCategoryYet").
'</span></td>';
551 print
'<td> </td>';
564$arrayofmassactions = array(
570$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
576if ($type == Categorie::TYPE_PRODUCT) {
577 if ($user->hasRight(
"product",
"read") || $user->hasRight(
"service",
"read")) {
578 $permission = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
579 $showclassifyform = ($user->hasRight(
'produit',
'creer') || $user->hasRight(
'service',
'creer'));
581 $prods =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'ref');
586 '@phan-var-force Product[] $prods';
588 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
589 print
'<input type="hidden" name="token" value="'.newToken().
'">';
590 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
591 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
592 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
593 print
'<input type="hidden" name="page_y" value="">';
594 print
'<input type="hidden" name="action" value="list">';
597 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
598 $num = count($prods);
599 $nbtotalofrecords =
'';
600 $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'));
603 print_barre_liste($langs->trans(
"ProductsAndServices"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'products', 0, $newcardbutton,
'', $limit);
605 if ($showclassifyform) {
606 print
'<table class="noborder centpercent">';
607 print
'<tr class="liste_titre"><td>';
608 print $langs->trans(
"AddProductServiceIntoCategory").
' ';
609 $form->select_produits(0,
'elemid',
'', 0, 0, -1, 2,
'', 1, array(), 0, 1, 0,
'', 0,
'',
null);
610 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
615 print
'<table class="noborder centpercent">'.
"\n";
616 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
618 if (count($prods) > 0) {
620 foreach ($prods as $prod) {
626 print
'<tr class="oddeven">'.
"\n";
627 print
'<td class="nowrap tdtop">';
628 print $prod->getNomUrl(1);
630 print
'<td class="tdtop">'.dolPrintHTML($prod->label).
"</td>\n";
632 print
'<td class="right">';
634 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 :
'').
'">';
636 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
643 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
650 print_barre_liste($langs->trans(
"ProductsAndServices"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'products');
656if ($type == Categorie::TYPE_CUSTOMER) {
657 if ($user->hasRight(
"societe",
"read")) {
658 $permission = $user->hasRight(
'societe',
'creer');
659 $showclassifyform = $user->hasRight(
'societe',
'creer');
661 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
666 '@phan-var-force Societe[] $socs';
668 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
669 print
'<input type="hidden" name="token" value="'.newToken().
'">';
670 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
671 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
672 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
673 print
'<input type="hidden" name="action" value="list">';
674 print
'<input type="hidden" name="page_y" value="">';
677 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
679 $nbtotalofrecords =
'';
680 $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'));
683 print_barre_liste($langs->trans(
"Customers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
685 if ($showclassifyform) {
686 print
'<table class="noborder centpercent">';
687 print
'<tr class="liste_titre"><td>';
688 print $langs->trans(
"AddCustomerIntoCategory").
' ';
689 $filter =
'(s.client:IN:1,2,3)';
690 print $form->select_company(
'',
'elemid', $filter);
691 print
'<input type="submit" class="reposition button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
696 print
'<table class="noborder centpercent">'.
"\n";
697 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
699 if (count($socs) > 0) {
701 foreach ($socs as $key => $soc) {
707 print
"\t".
'<tr class="oddeven">'.
"\n";
708 print
'<td class="nowrap tdtop tdoverflowmax250">';
709 print $soc->getNomUrl(1);
712 print
'<td class="right">';
714 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 :
'').
"'>";
716 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
723 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
730 print_barre_liste($langs->trans(
"Customers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
736if ($type == Categorie::TYPE_SUPPLIER) {
737 if ($user->hasRight(
"fournisseur",
"read")) {
738 $permission = $user->hasRight(
'societe',
'creer');
739 $showclassifyform = $user->hasRight(
'societe',
'creer');
741 $socs =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'nom');
747 '@phan-var-force Fournisseur[] $socs';
749 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
750 print
'<input type="hidden" name="token" value="'.newToken().
'">';
751 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
752 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
753 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
754 print
'<input type="hidden" name="page_y" value="">';
755 print
'<input type="hidden" name="action" value="list">';
758 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
760 $nbtotalofrecords =
'';
761 $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'));
764 print_barre_liste($langs->trans(
"Suppliers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'companies', 0, $newcardbutton,
'', $limit);
766 if ($showclassifyform) {
767 print
'<table class="noborder centpercent">';
768 print
'<tr class="liste_titre"><td>';
769 print $langs->trans(
"AddSupplierIntoCategory").
' ';
770 $filter =
'(s.fournisseur:=:1)';
771 print $form->select_company(
'',
'elemid', $filter);
772 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
777 print
'<table class="noborder centpercent">'.
"\n";
778 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Name").
"</td></tr>\n";
780 if (count($socs) > 0) {
782 foreach ($socs as $soc) {
788 print
"\t".
'<tr class="oddeven">'.
"\n";
789 print
'<td class="nowrap tdtop">';
790 print $soc->getNomUrl(1);
793 print
'<td class="right">';
795 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 :
'').
'">';
797 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
805 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
812 print_barre_liste($langs->trans(
"Suppliers"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'companies');
818if ($type == Categorie::TYPE_MEMBER) {
819 if ($user->hasRight(
"adherent",
"read")) {
820 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
822 $permission = $user->hasRight(
'adherent',
'creer');
823 $showclassifyform = $user->hasRight(
'adherent',
'creer');
825 $members =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
830 '@phan-var-force Adherent[] $members';
832 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
833 print
'<input type="hidden" name="token" value="'.newToken().
'">';
834 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
835 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
836 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
837 print
'<input type="hidden" name="page_y" value="">';
838 print
'<input type="hidden" name="action" value="list">';
841 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
842 $num = count($members);
843 $nbtotalofrecords =
'';
844 $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'));
847 print_barre_liste($langs->trans(
"Member"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'members', 0, $newcardbutton,
'', $limit);
849 if ($showclassifyform) {
850 print
'<table class="noborder centpercent">';
851 print
'<tr class="liste_titre"><td>';
852 print $langs->trans(
"AssignCategoryTo").
' ';
853 print $form->selectMembers(
'',
'elemid');
854 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"Save").
'"></td>';
859 print
'<table class="noborder centpercent">'.
"\n";
860 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Name").
'</td></tr>'.
"\n";
862 if (count($members) > 0) {
864 foreach ($members as $key => $member) {
870 print
"\t".
'<tr class="oddeven">'.
"\n";
871 print
'<td class="nowrap tdtop">';
872 $member->ref = $member->login;
873 print $member->getNomUrl(1, 0);
875 print
'<td class="tdtop">'.$member->lastname.
"</td>\n";
876 print
'<td class="tdtop">'.$member->firstname.
"</td>\n";
878 print
'<td class="right">';
880 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 :
'').
"'>";
882 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
889 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
896 print_barre_liste($langs->trans(
"Member"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'members');
902if ($type == Categorie::TYPE_CONTACT) {
903 if ($user->hasRight(
"societe",
"read")) {
904 $permission = $user->hasRight(
'societe',
'creer');
905 $showclassifyform = $user->hasRight(
'societe',
'creer');
907 $contacts =
$object->getObjectsInCateg($type, 0, $limit, $offset,
'lastname');
908 if (is_numeric($contacts) && $contacts < 0) {
912 '@phan-var-force Contact[] $contacts';
914 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
915 print
'<input type="hidden" name="token" value="'.newToken().
'">';
916 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
917 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
918 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
919 print
'<input type="hidden" name="page_y" value="">';
920 print
'<input type="hidden" name="action" value="list">';
923 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
924 $num = count($contacts);
925 $nbtotalofrecords =
'';
926 $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'));
931 print_barre_liste($langs->trans(
"Contact"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'contact', 0, $newcardbutton,
'', $limit);
933 if ($showclassifyform) {
934 print
'<table class="noborder centpercent">';
935 print
'<tr class="liste_titre"><td>';
936 print $langs->trans(
"AssignCategoryTo").
' ';
937 print $form->select_contact(0,
'',
'elemid',
'',
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
938 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
943 print
'<table class="noborder centpercent">'.
"\n";
944 print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
946 if (is_array($contacts) && count($contacts) > 0) {
948 foreach ($contacts as $key => $contact) {
954 print
"\t".
'<tr class="oddeven">'.
"\n";
955 print
'<td class="nowrap tdtop">';
956 print $contact->getNomUrl(1,
'category');
957 if ($contact->socid > 0) {
958 $objsoc->fetch($contact->socid);
960 print $objsoc->getNomUrl(1,
'contact');
964 print
'<td class="right">';
966 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 :
'').
"'>";
968 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
975 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
982 print_barre_liste($langs->trans(
"Contact"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'contact');
988if ($type == Categorie::TYPE_ACCOUNT) {
989 if ($user->hasRight(
"banque",
"read")) {
990 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
992 $permission = $user->hasRight(
'banque',
'creer');
993 $showclassifyform = $user->hasRight(
'banque',
'creer');
995 $accounts =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1000 '@phan-var-force Account[] $accounts';
1002 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1003 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1004 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1005 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1006 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1007 print
'<input type="hidden" name="page_y" value="">';
1008 print
'<input type="hidden" name="action" value="list">';
1011 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1012 $num = count($accounts);
1013 $nbtotalofrecords =
'';
1014 $newcardbutton =
'';
1017 print_barre_liste($langs->trans(
"Account"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit);
1019 if ($showclassifyform) {
1020 print
'<table class="noborder centpercent">';
1021 print
'<tr class="liste_titre"><td>';
1022 print $langs->trans(
"AddObjectIntoCategory").
' ';
1023 print $form->select_comptes(
'',
'elemid', 0,
'', 0,
'', 0,
'', 1);
1024 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1029 print
'<table class="noborder centpercent">'.
"\n";
1030 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1032 if (count($accounts) > 0) {
1034 foreach ($accounts as $key => $account) {
1040 print
"\t".
'<tr class="oddeven">'.
"\n";
1041 print
'<td class="nowrap tdtop">';
1042 print $account->getNomUrl(1,
'0');
1044 print
'<td class="tdtop">'.$account->bank.
"</td>\n";
1045 print
'<td class="tdtop">'.$account->number.
"</td>\n";
1047 print
'<td class="right">';
1049 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 :
'').
"'>";
1051 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1058 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1065 print_barre_liste($langs->trans(
"Banque"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'bank');
1071if ($type == Categorie::TYPE_PROJECT) {
1072 if ($user->hasRight(
"project",
"read")) {
1073 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1075 $permission = $user->hasRight(
'projet',
'creer');
1076 $showclassifyform = $user->hasRight(
'projet',
'creer');
1078 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1083 '@phan-var-force Project[] $objects';
1085 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1086 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1087 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1088 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1089 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1090 print
'<input type="hidden" name="page_y" value="">';
1091 print
'<input type="hidden" name="action" value="list">';
1094 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1095 $num = count($objects);
1096 $nbtotalofrecords =
'';
1097 $newcardbutton =
'';
1100 print_barre_liste($langs->trans(
"Project"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit);
1102 if ($showclassifyform) {
1103 print
'<table class="noborder centpercent">';
1104 print
'<tr class="liste_titre"><td>';
1105 print $langs->trans(
"AddObjectIntoCategory").
' ';
1106 $form->selectProjects(
'',
'elemid');
1107 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1112 print
'<table class="noborder centpercent">'.
"\n";
1113 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1115 if (count($objects) > 0) {
1117 foreach ($objects as $key => $project) {
1123 print
"\t".
'<tr class="oddeven">'.
"\n";
1124 print
'<td class="nowrap tdtop">';
1125 print $project->getNomUrl(1);
1127 print
'<td class="tdtop">'.$project->title.
"</td>\n";
1129 print
'<td class="right">';
1131 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 :
'').
"'>";
1133 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1140 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1147 print_barre_liste($langs->trans(
"Project"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'project');
1153if ($type == Categorie::TYPE_USER) {
1154 if ($user->hasRight(
"user",
"user",
"read")) {
1155 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1156 $showclassifyform = $user->hasRight(
"user",
"user",
"creer");
1158 $users =
$object->getObjectsInCateg($type, 0, 0, 0,
'lastname');
1163 '@phan-var-force User[] $users';
1166 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1167 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1168 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1169 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1170 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1171 print
'<input type="hidden" name="page_y" value="">';
1172 print
'<input type="hidden" name="action" value="list">';
1176 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1177 $num = count($users);
1178 $nbtotalofrecords =
'';
1179 $newcardbutton =
'';
1182 print_barre_liste($langs->trans(
"Users"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'user', 0,
'',
'', $limit);
1184 if ($showclassifyform) {
1185 print
'<table class="noborder centpercent">';
1186 print
'<tr class="liste_titre"><td>';
1188 print
img_picto(
'', $type,
'class="pictofixedwidth"');
1189 print $form->select_dolusers(
'',
'elemid', 1,
null, 0,
'',
'', $force_entity);
1190 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1195 print
'<table class="noborder centpercent">'.
"\n";
1196 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Users").
' <span class="badge">'.$num.
'</span></td></tr>'.
"\n";
1198 if (count($users) > 0) {
1200 foreach ($users as $key => $userentry) {
1201 print
"\t".
'<tr class="oddeven">'.
"\n";
1202 print
'<td class="nowrap tdtop">';
1203 print $userentry->getNomUrl(-1);
1205 print
'<td class="tdtop">'.$userentry->job.
"</td>\n";
1208 print
'<td class="right">';
1209 if ($user->hasRight(
'user',
'user',
'creer')) {
1210 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 :
'').
"'>";
1212 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1219 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1226 print_barre_liste($langs->trans(
"Users"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'user');
1232if ($type == Categorie::TYPE_WAREHOUSE) {
1233 if ($user->hasRight(
"stock",
"read")) {
1234 $permission = $user->hasRight(
'stock',
'creer');
1235 $showclassifyform = $user->hasRight(
'stock',
'creer');
1237 require_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
1239 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1244 '@phan-var-force Entrepot[] $objects';
1245 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1246 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1247 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1248 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1249 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1250 print
'<input type="hidden" name="page_y" value="">';
1251 print
'<input type="hidden" name="action" value="list">';
1254 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1255 $num = count($objects);
1256 $nbtotalofrecords =
'';
1257 $newcardbutton =
'';
1260 print_barre_liste($langs->trans(
"Warehouses"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'stock', 0, $newcardbutton,
'', $limit);
1262 if ($showclassifyform) {
1263 print
'<table class="noborder centpercent">';
1264 print
'<tr class="liste_titre"><td>';
1265 print $langs->trans(
"AddWarehouseIntoCategory").
' ';
1266 print $form->selectForForms(
'Entrepot:product/stock/class/entrepot.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1267 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1272 print
'<table class="noborder centpercent">'.
"\n";
1273 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1275 if (count($objects) > 0) {
1277 foreach ($objects as $key => $warehouse) {
1283 print
"\t".
'<tr class="oddeven">'.
"\n";
1284 print
'<td class="nowrap tdtop">';
1285 print $warehouse->getNomUrl(1);
1287 print
'<td class="tdtop">'.$warehouse->ref.
"</td>\n";
1288 print
'<td class="tdtop">'.$warehouse->lieu.
"</td>\n";
1290 print
'<td class="right">';
1292 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 :
'').
"'>";
1294 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1301 print
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1308 print_barre_liste($langs->trans(
"Warehouse"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'stock');
1314if ($type == Categorie::TYPE_TICKET) {
1315 if ($user->hasRight(
"ticket",
"read")) {
1316 $permission = $user->hasRight(
'categorie',
'creer');
1317 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1319 $tickets =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1324 '@phan-var-force Ticket[] $tickets';
1326 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1327 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1328 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1329 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1330 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1331 print
'<input type="hidden" name="page_y" value="">';
1332 print
'<input type="hidden" name="action" value="list">';
1335 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1336 $num = count($tickets);
1337 $nbtotalofrecords =
'';
1338 $newcardbutton =
'';
1341 print_barre_liste($langs->trans(
"Ticket"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'ticket', 0, $newcardbutton,
'', $limit);
1343 if ($showclassifyform) {
1344 print
'<table class="noborder centpercent">';
1345 print
'<tr class="liste_titre"><td>';
1346 print $langs->trans(
"AddTicketIntoCategory").
' ';
1347 $form->selectTickets(
'',
'elemid');
1348 print
'<input type="submit" class="button buttongen" name="addintocategory" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1353 print
'<table class="noborder centpercent">'.
"\n";
1354 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1356 if (count($tickets) > 0) {
1358 foreach ($tickets as $ticket) {
1364 print
"\t".
'<tr class="oddeven">'.
"\n";
1365 print
'<td class="nowrap tdtop">';
1366 print $ticket->getNomUrl(1);
1368 print
'<td class="tdtop">'.$ticket->track_id.
"</td>\n";
1370 print
'<td class="right">';
1372 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 :
'').
"'>";
1374 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1381 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1388 print_barre_liste($langs->trans(
"Ticket"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'ticket');
1394if ($type == Categorie::TYPE_FICHINTER) {
1395 if ($user->hasRight(
"fichinter",
"lire")) {
1396 $permission = $user->hasRight(
'categorie',
'creer');
1397 $showclassifyform = $user->hasRight(
'categorie',
'creer');
1399 $fichinters =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1400 if ($fichinters < 0) {
1404 '@phan-var-force Fichinter[] $fichinters';
1407 if ($showclassifyform) {
1409 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1410 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1411 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1412 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1413 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1414 print
'<input type="hidden" name="action" value="addintocategory">';
1415 print
'<table class="noborder centpercent">';
1416 print
'<tr class="liste_titre"><td>';
1417 print $langs->trans(
"AddFichinterIntoCategory").
' ';
1418 print $form->selectForForms(
'Fichinter:fichinter/class/fichinter.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1419 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1425 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1426 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1427 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1428 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1429 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1430 print
'<input type="hidden" name="action" value="list">';
1433 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1434 $num = count($fichinters);
1435 $nbtotalofrecords =
'';
1436 $newcardbutton =
'';
1438 $langs->load(
'interventions');
1440 print_barre_liste($langs->trans(
"Intervention"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_intervention', 0, $newcardbutton,
'', $limit);
1441 print
'<table class="noborder centpercent">'.
"\n";
1442 print
'<tr class="liste_titre"><td colspan="3">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1444 if (count($fichinters) > 0) {
1446 foreach ($fichinters as $fichinter) {
1452 print
"\t".
'<tr class="oddeven">'.
"\n";
1453 print
'<td class="nowrap tdtop">';
1454 print $fichinter->getNomUrl(1);
1456 print
'<td class="tdtop">'.$fichinter->description.
"</td>\n";
1458 print
'<td class="right">';
1460 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 :
'').
"'>";
1461 print $langs->trans(
"DeleteFromCat");
1462 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1469 print
'<tr class="oddeven"><td colspan="2"><span class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</span></td></tr>';
1475 print_barre_liste($langs->trans(
"Intervention"),
null, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', 0,
'',
'fichinter');
1482if ($type == Categorie::TYPE_ORDER && !$user->hasRight(
'commande',
'lire')) {
1485if ($type == Categorie::TYPE_ORDER) {
1486 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
1488 $permission = $user->hasRight(
'commande',
'creer');
1490 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1495 '@phan-var-force Commande[] $objects';
1497 $showclassifyform = $user->hasRight(
'order',
'write');
1498 if ($showclassifyform) {
1500 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1501 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1502 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1503 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1504 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1505 print
'<input type="hidden" name="action" value="addintocategory">';
1506 print
'<table class="noborder centpercent">';
1507 print
'<tr class="liste_titre"><td>';
1508 print $langs->trans(
"AddOrderIntoCategory").
' ';
1509 print $form->selectForForms(
'Commande:commande/class/commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1510 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1516 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1517 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1518 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1519 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1520 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1521 print
'<input type="hidden" name="action" value="list">';
1524 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1525 $num = count($objects);
1526 $nbtotalofrecords =
'';
1527 $newcardbutton =
'';
1530 print_barre_liste($langs->trans(
"Orders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1532 print
"<table class='noborder centpercent'>\n";
1533 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1535 if (count($objects) > 0) {
1537 foreach ($objects as $key => $order) {
1543 print
"\t".
'<tr class="oddeven">'.
"\n";
1544 print
'<td class="nowrap tdtop">';
1545 print $order->getNomUrl(1);
1547 print
'<td class="tdtop">'.$order->ref.
"</td>\n";
1549 print
'<td class="right">';
1551 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$order->id.
"'>";
1552 print $langs->trans(
"DeleteFromCat");
1553 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1559 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1568if ($type == Categorie::TYPE_INVOICE && !$user->hasRight(
'facture',
'lire')) {
1571if ($type == Categorie::TYPE_INVOICE) {
1572 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
1574 $permission = $user->hasRight(
'facture',
'creer');
1576 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1581 $showclassifyform = $user->hasRight(
'facture',
'write');
1582 if ($showclassifyform) {
1584 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1585 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1586 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1587 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1588 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1589 print
'<input type="hidden" name="action" value="addintocategory">';
1590 print
'<table class="noborder centpercent">';
1591 print
'<tr class="liste_titre"><td>';
1592 print $langs->trans(
"AddInvoiceIntoCategory").
' ';
1593 print $form->selectForForms(
'Facture:compta/facture/class/facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1594 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1600 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1601 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1602 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1603 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1604 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1605 print
'<input type="hidden" name="action" value="list">';
1608 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1609 $num = count($objects);
1610 $nbtotalofrecords =
'';
1611 $newcardbutton =
'';
1614 print_barre_liste($langs->trans(
"BillsCustomers"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bill', 0, $newcardbutton,
'', $limit);
1616 print
"<table class='noborder centpercent'>\n";
1617 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1619 if (count($objects) > 0) {
1621 foreach ($objects as $key => $invoice) {
1627 print
"\t".
'<tr class="oddeven">'.
"\n";
1628 print
'<td class="nowrap tdtop">';
1629 print $invoice->getNomUrl(1);
1631 print
'<td class="tdtop">'.$invoice->ref.
"</td>\n";
1633 print
'<td class="right">';
1635 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$invoice->id.
"'>";
1636 print $langs->trans(
"DeleteFromCat");
1637 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1643 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1652if ($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')))) {
1655if ($type == Categorie::TYPE_SUPPLIER_ORDER) {
1656 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
1658 $permission = $user->hasRight(
'fournisseur',
'commande',
'creer');
1660 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1665 $showclassifyform = $user->hasRight(
'fournisseur',
'commande',
'creer');
1667 if ($showclassifyform) {
1669 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1670 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1671 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1672 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1673 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1674 print
'<input type="hidden" name="action" value="addintocategory">';
1675 print
'<table class="noborder centpercent">';
1676 print
'<tr class="liste_titre"><td>';
1677 print $langs->trans(
"AddSupplierOrderIntoCategory").
' ';
1678 print $form->selectForForms(
'CommandeFournisseur:fourn/class/fournisseur.commande.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1679 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1685 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1686 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1687 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1688 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1689 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1690 print
'<input type="hidden" name="action" value="list">';
1693 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type;
1694 $num = count($objects);
1695 $nbtotalofrecords =
'';
1696 $newcardbutton =
'';
1699 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1701 print
"<table class='noborder centpercent'>\n";
1702 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1704 if (count($objects) > 0) {
1706 foreach ($objects as $key => $supplier_order) {
1712 print
"\t".
'<tr class="oddeven">'.
"\n";
1713 print
'<td class="nowrap tdtop">';
1714 print $supplier_order->getNomUrl(1);
1716 print
'<td class="tdtop">'.$supplier_order->ref.
"</td>\n";
1718 print
'<td class="right">';
1720 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_order->id.
"'>";
1721 print $langs->trans(
"DeleteFromCat");
1722 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1728 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1737if ($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')))) {
1740if ($type == Categorie::TYPE_SUPPLIER_INVOICE) {
1741 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
1743 $permission = $user->hasRight(
'fournisseur',
'facture',
'creer');
1745 $objects =
$object->getObjectsInCateg($type, 0, $limit, $offset);
1750 $showclassifyform = $user->hasRight(
'fournisseur',
'facture',
'creer');;
1751 if ($showclassifyform) {
1753 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1754 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1755 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1756 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1757 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1758 print
'<input type="hidden" name="action" value="addintocategory">';
1759 print
'<table class="noborder centpercent">';
1760 print
'<tr class="liste_titre"><td>';
1761 print $langs->trans(
"AddSupplierInvoiceIntoCategory").
' ';
1762 print $form->selectForForms(
'FactureFournisseur:fourn/class/fournisseur.facture.class.php',
'elemid', 0, 1,
'',
'',
'maxwidth500');
1763 print
'<input type="submit" class="button buttongen" value="'.$langs->trans(
"ClassifyInCategory").
'"></td>';
1769 print
'<form method="post" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1770 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1771 print
'<input type="hidden" name="typeid" value="'.$typeid.
'">';
1772 print
'<input type="hidden" name="type" value="'.$typeid.
'">';
1773 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
1774 print
'<input type="hidden" name="action" value="list">';
1777 $param =
'&limit='.$limit.
'&id='.
$id.
'&type='.$type; $num = count($objects); $nbtotalofrecords =
''; $newcardbutton =
'';
1780 print_barre_liste($langs->trans(
"SuppliersOrders"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'supplier_order', 0, $newcardbutton,
'', $limit);
1782 print
"<table class='noborder centpercent'>\n";
1783 print
'<tr class="liste_titre"><td colspan="4">'.$langs->trans(
"Ref").
'</td></tr>'.
"\n";
1785 if (count($objects) > 0) {
1787 foreach ($objects as $key => $supplier_invoice) {
1793 print
"\t".
'<tr class="oddeven">'.
"\n";
1794 print
'<td class="nowrap tdtop">';
1795 print $supplier_invoice->getNomUrl(1);
1797 print
'<td class="tdtop">'.$supplier_invoice->ref.
"</td>\n";
1799 print
'<td class="right">';
1801 print
"<a href= '".$_SERVER[
'PHP_SELF'].
"?".(empty($socid) ?
'id' :
'socid').
"=".
$object->id.
"&type=".$typeid.
"&action=unlink&token=".
newToken().
"&removeelem=".$supplier_invoice->id.
"'>";
1802 print $langs->trans(
"DeleteFromCat");
1803 print
img_picto($langs->trans(
"DeleteFromCat"),
'unlink',
'', 0, 0, 0,
'',
'paddingleft');
1809 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"ThisCategoryHasNoItems").
'</td></tr>';
1818$parameters = array(
'type' => $type,
'id' => $id,
'label' => $label);
1819$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.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolBuildUrl($url, $params=[], $addtoken=false)
Return path of url.
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.
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)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetalreadyloaded=0, $showfk=0, $moreparam='')
Recursive function to output a tree.