dolibarr  13.0.2
viewcat.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
3  * Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
5  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
7  * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
8  * Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
30 require '../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
35 
36 // Load translation files required by the page
37 $langs->load("categories");
38 
39 $id = GETPOST('id', 'int');
40 $label = GETPOST('label', 'alpha');
41 $type = GETPOST('type', 'aZ09');
42 $removeelem = GETPOST('removeelem', 'int');
43 $elemid = GETPOST('elemid', 'int');
44 
45 $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
46 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
47 $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
48 $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
49 $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
50 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
51 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'categorylist'; // To manage different context of search
52 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
53 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
54 
55 
56 // Load variable for pagination
57 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
58 $sortfield = GETPOST('sortfield', 'aZ09comma');
59 $sortorder = GETPOST('sortorder', 'aZ09comma');
60 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
61 if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
62 $offset = $limit * $page;
63 $pageprev = $page - 1;
64 $pagenext = $page + 1;
65 
66 if ($id == "" && $label == "")
67 {
68  dol_print_error('', 'Missing parameter id');
69  exit();
70 }
71 
72 // Security check
73 $result = restrictedArea($user, 'categorie', $id, '&category');
74 
75 $object = new Categorie($db);
76 $result = $object->fetch($id, $label, $type);
77 if ($result <= 0) {
78  dol_print_error($db, $object->error); exit;
79 }
80 $object->fetch_optionals();
81 if ($result <= 0) {
82  dol_print_error($db, $object->error); exit;
83 }
84 
85 $objecttype = $object->type;
86 if (is_numeric($objecttype)) $objecttype = Categorie::$MAP_ID_TO_CODE[$objecttype];
87 if ($type === '') $type = $objecttype;
88 
89 if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
90 
91 $extrafields = new ExtraFields($db);
92 $extrafields->fetch_name_optionals_label($object->table_element);
93 
94 // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
95 $hookmanager->initHooks(array('categorycard', 'globalcard'));
96 
97 // Protection when type provided is not similare to type of category
98 if ($objecttype != $type) {
99  print 'Error: Value for type parameter does not match value of the type of the category with id='.$id;
100  exit;
101 }
102 
103 /*
104  * Actions
105  */
106 
107 $parameters = array();
108 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
109 // Remove element from category
110 if ($id > 0 && $removeelem > 0)
111 {
112  if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
113  {
114  require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
115  $tmpobject = new Product($db);
116  $result = $tmpobject->fetch($removeelem);
117  $elementtype = 'product';
118  } elseif ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
119  {
120  $tmpobject = new Societe($db);
121  $result = $tmpobject->fetch($removeelem);
122  $elementtype = 'supplier';
123  } elseif ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
124  {
125  $tmpobject = new Societe($db);
126  $result = $tmpobject->fetch($removeelem);
127  $elementtype = 'customer';
128  } elseif ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
129  {
130  require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
131  $tmpobject = new Adherent($db);
132  $result = $tmpobject->fetch($removeelem);
133  $elementtype = 'member';
134  } elseif ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
135  require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
136  $tmpobject = new Contact($db);
137  $result = $tmpobject->fetch($removeelem);
138  $elementtype = 'contact';
139  } elseif ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
140  {
141  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
142  $tmpobject = new Account($db);
143  $result = $tmpobject->fetch($removeelem);
144  $elementtype = 'account';
145  } elseif ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
146  {
147  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
148  $tmpobject = new Project($db);
149  $result = $tmpobject->fetch($removeelem);
150  $elementtype = 'project';
151  } elseif ($type == Categorie::TYPE_USER && $user->rights->user->user->creer)
152  {
153  require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
154  $tmpobject = new User($db);
155  $result = $tmpobject->fetch($removeelem);
156  $elementtype = 'user';
157  }
158 
159  $result = $object->del_type($tmpobject, $elementtype);
160  if ($result < 0) dol_print_error('', $object->error);
161 }
162 
163 if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confirm == 'yes')
164 {
165  if ($object->delete($user) >= 0)
166  {
167  header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type);
168  exit;
169  } else {
170  setEventMessages($object->error, $object->errors, 'errors');
171  }
172 }
173 
174 if ($elemid && $action == 'addintocategory' &&
175  (($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) ||
176  ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) ||
177  ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
178  ))
179 {
180  if ($type == Categorie::TYPE_PRODUCT)
181  {
182  require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
183  $newobject = new Product($db);
184  $elementtype = 'product';
185  } elseif ($type == Categorie::TYPE_CUSTOMER)
186  {
187  require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
188  $newobject = new Societe($db);
189  $elementtype = 'customer';
190  } elseif ($type == Categorie::TYPE_SUPPLIER)
191  {
192  require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
193  $newobject = new Societe($db);
194  $elementtype = 'supplier';
195  }
196  $result = $newobject->fetch($elemid);
197 
198  // TODO Add into categ
199  $result = $object->add_type($newobject, $elementtype);
200  if ($result >= 0)
201  {
202  setEventMessages($langs->trans("WasAddedSuccessfully", $newobject->ref), null, 'mesgs');
203  } else {
204  if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
205  {
206  setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings');
207  } else {
208  setEventMessages($object->error, $object->errors, 'errors');
209  }
210  }
211 }
212 
213 
214 /*
215  * View
216  */
217 
218 $form = new Form($db);
219 $formother = new FormOther($db);
220 
221 $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
222 $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
223 $helpurl = '';
224 llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss);
225 
226 $title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
227 
228 $head = categories_prepare_head($object, $type);
229 
230 
231 print dol_get_fiche_head($head, 'card', $langs->trans($title), -1, 'category');
232 $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
233 $linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
234 $object->next_prev_filter = ' type = '.$object->type;
235 $object->ref = $object->label;
236 $morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
237 $ways = $object->print_all_ways(" &gt;&gt; ", '', 1);
238 foreach ($ways as $way)
239 {
240  $morehtmlref .= $way."<br>\n";
241 }
242 $morehtmlref .= '</div>';
243 
244 dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.$type, 0, '', '', 1);
245 
246 
247 /*
248  * Confirmation suppression
249  */
250 
251 if ($action == 'delete')
252 {
253  print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1);
254 }
255 
256 print '<br>';
257 
258 print '<div class="fichecenter">';
259 print '<div class="underbanner clearboth"></div>';
260 print '<table class="border centpercent tableforfield">';
261 
262 // Description
263 print '<tr><td class="titlefield notopnoleft tdtop">';
264 print $langs->trans("Description").'</td><td>';
265 print dol_htmlentitiesbr($object->description);
266 print '</td></tr>';
267 
268 // Color
269 print '<tr><td class="notopnoleft">';
270 print $langs->trans("Color").'</td><td>';
271 print $formother->showColor($object->color);
272 print '</td></tr>';
273 
274 // Other attributes
275 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
276 
277 print '</table>';
278 print '</div>';
279 
281 
282 
283 /*
284  * Boutons actions
285  */
286 
287 print "<div class='tabsAction'>\n";
288 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
289 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
290 if (empty($reshook)) {
291  if ($user->rights->categorie->creer)
292  {
293  $socid = ($object->socid ? "&socid=".$object->socid : "");
294  print '<a class="butAction" href="edit.php?id='.$object->id.$socid.'&type='.$type.'">'.$langs->trans("Modify").'</a>';
295  }
296 
297  if ($user->rights->categorie->supprimer)
298  {
299  print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
300  }
301 }
302 
303 print "</div>";
304 
305 $newcardbutton = '';
306 if (!empty($user->rights->categorie->creer))
307 {
308  $link = DOL_URL_ROOT.'/categories/card.php';
309  $link .= '?action=create';
310  $link .= '&type='.$type;
311  $link .= '&catorigin='.$object->id;
312  $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id);
313 
314  $newcardbutton = '<div class="right">';
315  $newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link);
316  $newcardbutton .= '</div>';
317 }
318 
319 
320 /*
321  * Sub-category tree view of this category
322  */
323 
324 print '<div class="fichecenter">';
325 
326 print load_fiche_titre($langs->trans("SubCats"), $newcardbutton, 'object_category');
327 
328 
329 print '<table class="liste nohover" width="100%">';
330 
331 print '<tr class="liste_titre">';
332 print '<td>'.$langs->trans("SubCats").'</td>';
333 print '<td></td>';
334 print '<td class="right">';
335 
336 if (!empty($conf->use_javascript_ajax))
337 {
338  print '<div id="iddivjstreecontrol">';
339  print '<a class="notasortlink" href="#">'.img_picto('', 'folder').' '.$langs->trans("UndoExpandAll").'</a>';
340  print " | ";
341  print '<a class="notasortlink" href="#">'.img_picto('', 'folder-open').' '.$langs->trans("ExpandAll").'</a>';
342  print '</div>';
343 }
344 
345 print '</td>';
346 print '</tr>';
347 
348 $cats = $object->get_filles();
349 if ($cats < 0)
350 {
351  dol_print_error($db, $object->error, $object->errors);
352 } elseif (count($cats) < 1)
353 {
354  print '<tr class="oddeven">';
355  print '<td colspan="3" class="opacitymedium">'.$langs->trans("NoSubCat").'</td>';
356  print '</tr>';
357 } else {
358  $categstatic = new Categorie($db);
359 
360  $fulltree = $categstatic->get_full_arbo($type, $object->id, 1);
361 
362  // Load possible missing includes
363  if ($conf->global->CATEGORY_SHOW_COUNTS)
364  {
365  if ($type == Categorie::TYPE_MEMBER) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
366  if ($type == Categorie::TYPE_ACCOUNT) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
367  if ($type == Categorie::TYPE_PROJECT) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
368  if ($type == Categorie::TYPE_USER) require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
369  }
370 
371  // Define data (format for treeview)
372  $data = array();
373  $data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>'');
374  foreach ($fulltree as $key => $val)
375  {
376  $categstatic->id = $val['id'];
377  $categstatic->ref = $val['label'];
378  $categstatic->color = $val['color'];
379  $categstatic->type = $type;
380  $desc = dol_htmlcleanlastbr($val['description']);
381 
382  $counter = 0;
383 
384  if ($conf->global->CATEGORY_SHOW_COUNTS)
385  {
386  // we need only a count of the elements, so it is enough to consume only the id's from the database
387  $elements = $type == Categorie::TYPE_ACCOUNT
388  ? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
389  : $categstatic->getObjectsInCateg($type, 1);
390 
391  $counter = is_countable($elements) ? count($elements) : 0;
392  }
393 
394  $color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"';
395 
396  $entry = '<table class="nobordernopadding centpercent">';
397  $entry .= '<tr>';
398 
399  $entry .= '<td>';
400  $entry .= '<span class="noborderoncategories" '.$color.'>'.$categstatic->getNomUrl(1, '', 60).'</span>';
401  $entry .= '</td>';
402 
403  $entry .= '<td class="left" width="40px;">'.$counter.'</td>';
404 
405  $entry .= '<td class="right" width="20px;">';
406  $entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a>';
407  $entry .= '</td>';
408 
409  $entry .= '</tr>';
410  $entry .= '</table>';
411 
412  $data[] = array('rowid' => $val['rowid'], 'fk_menu' => $val['fk_parent'], 'entry' => $entry);
413  }
414 
415  if ((count($data) - 1))
416  {
417  require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
418  print '<tr class="pair">';
419  print '<td colspan="3">';
420 
421  // $data[0] is the current shown category, to don'T show the current category use $data[1] instead
422  tree_recur($data, $data[1], 0);
423 
424  print '</td>';
425  print '</tr>';
426  } else {
427  print '<tr class="pair">';
428  print '<td colspan="3">';
429  print '<table class="nobordernopadding">';
430 
431  print '<tr class="nobordernopadding">';
432  print '<td>'.img_picto_common('', 'treemenu/branchbottom.gif').'</td>';
433  print '<td valign="middle">'.$langs->trans("NoCategoryYet").'</td>';
434  print '<td>&nbsp;</td>';
435  print '</tr>';
436 
437  print '</table>';
438  print '</td>';
439  print '</tr>';
440  }
441 }
442 
443 print "</table>";
444 print "</div>";
445 
446 // List of mass actions available
447 $arrayofmassactions = array(
448  //'validate'=>$langs->trans("Validate"),
449  //'generate_doc'=>$langs->trans("ReGeneratePDF"),
450  //'builddoc'=>$langs->trans("PDFMerge"),
451  //'presend'=>$langs->trans("SendByMail"),
452 );
453 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
454 
455 $typeid = $type;
456 
457 
458 // List of products or services (type is type of category)
459 if ($type == Categorie::TYPE_PRODUCT)
460 {
461  $permission = ($user->rights->produit->creer || $user->rights->service->creer);
462 
463  $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
464  if ($prods < 0)
465  {
466  dol_print_error($db, $object->error, $object->errors);
467  } else {
468  // Form to add record into a category
469  $showclassifyform = 1;
470  if ($showclassifyform)
471  {
472  print '<br>';
473  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
474  print '<input type="hidden" name="token" value="'.newToken().'">';
475  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
476  print '<input type="hidden" name="type" value="'.$typeid.'">';
477  print '<input type="hidden" name="id" value="'.$object->id.'">';
478  print '<input type="hidden" name="action" value="addintocategory">';
479  print '<table class="noborder centpercent">';
480  print '<tr class="liste_titre"><td>';
481  print $langs->trans("AddProductServiceIntoCategory").' &nbsp;';
482  $form->select_produits('', 'elemid', '', 0, 0, -1, 2, '', 1);
483  print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
484  print '</tr>';
485  print '</table>';
486  print '</form>';
487  }
488 
489  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
490  print '<input type="hidden" name="token" value="'.newToken().'">';
491  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
492  print '<input type="hidden" name="type" value="'.$typeid.'">';
493  print '<input type="hidden" name="id" value="'.$object->id.'">';
494  print '<input type="hidden" name="action" value="list">';
495 
496  print '<br>';
497  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = '';
498  print_barre_liste($langs->trans("ProductsAndServices"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit);
499 
500 
501  print '<table class="noborder centpercent">'."\n";
502  print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Ref").'</td></tr>'."\n";
503 
504  if (count($prods) > 0)
505  {
506  $i = 0;
507  foreach ($prods as $prod)
508  {
509  $i++;
510  if ($i > $limit) break;
511 
512  print "\t".'<tr class="oddeven">'."\n";
513  print '<td class="nowrap" valign="top">';
514  print $prod->getNomUrl(1);
515  print "</td>\n";
516  print '<td class="tdtop">'.$prod->label."</td>\n";
517  // Link to delete from category
518  print '<td class="right">';
519  if ($permission)
520  {
521  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$prod->id."'>";
522  print $langs->trans("DeleteFromCat");
523  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
524  print "</a>";
525  }
526  print '</td>';
527  print "</tr>\n";
528  }
529  } else {
530  print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
531  }
532  print "</table>\n";
533 
534  print '</form>'."\n";
535  }
536 }
537 
538 if ($type == Categorie::TYPE_CUSTOMER)
539 {
540  $permission = $user->rights->societe->creer;
541 
542  $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
543  if ($socs < 0)
544  {
545  dol_print_error($db, $object->error, $object->errors);
546  } else {
547  // Form to add record into a category
548  $showclassifyform = 1;
549  if ($showclassifyform)
550  {
551  print '<br>';
552  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
553  print '<input type="hidden" name="token" value="'.newToken().'">';
554  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
555  print '<input type="hidden" name="type" value="'.$typeid.'">';
556  print '<input type="hidden" name="id" value="'.$object->id.'">';
557  print '<input type="hidden" name="action" value="addintocategory">';
558  print '<table class="noborder centpercent">';
559  print '<tr class="liste_titre"><td>';
560  print $langs->trans("AddCustomerIntoCategory").' &nbsp;';
561  print $form->select_company('', 'elemid', 's.client IN (1,3)');
562  print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
563  print '</tr>';
564  print '</table>';
565  print '</form>';
566  }
567 
568  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
569  print '<input type="hidden" name="token" value="'.newToken().'">';
570  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
571  print '<input type="hidden" name="type" value="'.$typeid.'">';
572  print '<input type="hidden" name="id" value="'.$object->id.'">';
573  print '<input type="hidden" name="action" value="list">';
574 
575  print '<br>';
576  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = '';
577  print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit);
578 
579  print '<table class="noborder centpercent">'."\n";
580  print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Name").'</td></tr>'."\n";
581 
582  if (count($socs) > 0)
583  {
584  $i = 0;
585  foreach ($socs as $key => $soc)
586  {
587  $i++;
588  if ($i > $limit) break;
589 
590  print "\t".'<tr class="oddeven">'."\n";
591  print '<td class="nowrap" valign="top">';
592  print $soc->getNomUrl(1);
593  print "</td>\n";
594  // Link to delete from category
595  print '<td class="right">';
596  if ($permission)
597  {
598  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>";
599  print $langs->trans("DeleteFromCat");
600  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
601  print "</a>";
602  }
603  print '</td>';
604  print "</tr>\n";
605  }
606  } else {
607  print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
608  }
609  print "</table>\n";
610 
611  print '</form>'."\n";
612  }
613 }
614 
615 
616 if ($type == Categorie::TYPE_SUPPLIER)
617 {
618  $permission = $user->rights->societe->creer;
619 
620  $socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
621  if ($socs < 0)
622  {
623  dol_print_error($db, $object->error, $object->errors);
624  } else {
625  // Form to add record into a category
626  $showclassifyform = 1;
627  if ($showclassifyform)
628  {
629  print '<br>';
630  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
631  print '<input type="hidden" name="token" value="'.newToken().'">';
632  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
633  print '<input type="hidden" name="type" value="'.$typeid.'">';
634  print '<input type="hidden" name="id" value="'.$object->id.'">';
635  print '<input type="hidden" name="action" value="addintocategory">';
636  print '<table class="noborder centpercent">';
637  print '<tr class="liste_titre"><td>';
638  print $langs->trans("AddSupplierIntoCategory").' &nbsp;';
639  print $form->select_company('', 'elemid', 's.fournisseur = 1');
640  print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
641  print '</tr>';
642  print '</table>';
643  print '</form>';
644  }
645 
646  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
647  print '<input type="hidden" name="token" value="'.newToken().'">';
648  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
649  print '<input type="hidden" name="type" value="'.$typeid.'">';
650  print '<input type="hidden" name="id" value="'.$object->id.'">';
651  print '<input type="hidden" name="action" value="list">';
652 
653  print '<br>';
654  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = '';
655  print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit);
656 
657  print '<table class="noborder centpercent">'."\n";
658  print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Name")."</td></tr>\n";
659 
660  if (count($socs) > 0)
661  {
662  $i = 0;
663  foreach ($socs as $soc)
664  {
665  $i++;
666  if ($i > $limit) break;
667 
668  print "\t".'<tr class="oddeven">'."\n";
669  print '<td class="nowrap" valign="top">';
670  print $soc->getNomUrl(1);
671  print "</td>\n";
672  // Link to delete from category
673  print '<td class="right">';
674  if ($permission)
675  {
676  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>";
677  print $langs->trans("DeleteFromCat");
678  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
679  print "</a>";
680  }
681  print '</td>';
682 
683  print "</tr>\n";
684  }
685  } else {
686  print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
687  }
688  print "</table>\n";
689 
690  print '</form>'."\n";
691  }
692 }
693 
694 // List of members
695 if ($type == Categorie::TYPE_MEMBER)
696 {
697  require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
698 
699  $permission = $user->rights->adherent->creer;
700 
701  $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
702  if ($prods < 0)
703  {
704  dol_print_error($db, $object->error, $object->errors);
705  } else {
706  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
707  print '<input type="hidden" name="token" value="'.newToken().'">';
708  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
709  print '<input type="hidden" name="type" value="'.$typeid.'">';
710  print '<input type="hidden" name="id" value="'.$object->id.'">';
711  print '<input type="hidden" name="action" value="list">';
712 
713  print '<br>';
714  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = ''; $newcardbutton = '';
715  print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
716 
717  print "<table class='noborder' width='100%'>\n";
718  print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Name").'</td></tr>'."\n";
719 
720  if (count($prods) > 0)
721  {
722  $i = 0;
723  foreach ($prods as $key => $member)
724  {
725  $i++;
726  if ($i > $limit) break;
727 
728  print "\t".'<tr class="oddeven">'."\n";
729  print '<td class="nowrap" valign="top">';
730  $member->ref = $member->login;
731  print $member->getNomUrl(1, 0);
732  print "</td>\n";
733  print '<td class="tdtop">'.$member->lastname."</td>\n";
734  print '<td class="tdtop">'.$member->firstname."</td>\n";
735  // Link to delete from category
736  print '<td class="right">';
737  if ($permission)
738  {
739  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$member->id."'>";
740  print $langs->trans("DeleteFromCat");
741  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
742  print "</a>";
743  }
744  print "</tr>\n";
745  }
746  } else {
747  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
748  }
749  print "</table>\n";
750 
751  print '</form>'."\n";
752  }
753 }
754 
755 // Categorie contact
756 if ($type == Categorie::TYPE_CONTACT)
757 {
758  $permission = $user->rights->societe->creer;
759 
760  $contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
761  if ($contacts < 0)
762  {
763  dol_print_error($db, $object->error, $object->errors);
764  } else {
765  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
766  print '<input type="hidden" name="token" value="'.newToken().'">';
767  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
768  print '<input type="hidden" name="type" value="'.$typeid.'">';
769  print '<input type="hidden" name="id" value="'.$object->id.'">';
770  print '<input type="hidden" name="action" value="list">';
771 
772  print '<br>';
773  $param = '&limit='.$limit.'&id='.$id.'&type='.$type;
774  $num = count($contacts);
775  $nbtotalofrecords = '';
776  $newcardbutton = '';
777  print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit);
778 
779  print '<table class="noborder centpercent">'."\n";
780  print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Ref").'</td></tr>'."\n";
781 
782  if (count($contacts) > 0)
783  {
784  $i = 0;
785  foreach ($contacts as $key => $contact)
786  {
787  $i++;
788  if ($i > $limit) break;
789 
790  print "\t".'<tr class="oddeven">'."\n";
791  print '<td class="nowrap" valign="top">';
792  print $contact->getNomUrl(1, 'category');
793  print "</td>\n";
794  // Link to delete from category
795  print '<td class="right">';
796  if ($permission)
797  {
798  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$contact->id."'>";
799  print $langs->trans("DeleteFromCat");
800  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
801  print "</a>";
802  }
803  print '</td>';
804  print "</tr>\n";
805  }
806  } else {
807  print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
808  }
809  print "</table>\n";
810 
811  print '</form>'."\n";
812  }
813 }
814 
815 // List of bank accounts
816 if ($type == Categorie::TYPE_ACCOUNT)
817 {
818  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
819 
820  $permission = $user->rights->banque->creer;
821 
822  $accounts = $object->getObjectsInCateg($type, 0, $limit, $offset);
823  if ($accounts < 0)
824  {
825  dol_print_error($db, $object->error, $object->errors);
826  } else {
827  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
828  print '<input type="hidden" name="token" value="'.newToken().'">';
829  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
830  print '<input type="hidden" name="type" value="'.$typeid.'">';
831  print '<input type="hidden" name="id" value="'.$object->id.'">';
832  print '<input type="hidden" name="action" value="list">';
833 
834  print '<br>';
835  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($accounts); $nbtotalofrecords = ''; $newcardbutton = '';
836  print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit);
837 
838  print "<table class='noborder' width='100%'>\n";
839  print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
840 
841  if (count($accounts) > 0)
842  {
843  $i = 0;
844  foreach ($accounts as $key => $account)
845  {
846  $i++;
847  if ($i > $limit) break;
848 
849  print "\t".'<tr class="oddeven">'."\n";
850  print '<td class="nowrap" valign="top">';
851  print $account->getNomUrl(1, 0);
852  print "</td>\n";
853  print '<td class="tdtop">'.$account->bank."</td>\n";
854  print '<td class="tdtop">'.$account->number."</td>\n";
855  // Link to delete from category
856  print '<td class="right">';
857  if ($permission)
858  {
859  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$account->id."'>";
860  print $langs->trans("DeleteFromCat");
861  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
862  print "</a>";
863  }
864  print "</tr>\n";
865  }
866  } else {
867  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
868  }
869  print "</table>\n";
870 
871  print '</form>'."\n";
872  }
873 }
874 
875 // List of Project
876 if ($type == Categorie::TYPE_PROJECT)
877 {
878  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
879 
880  $permission = $user->rights->projet->creer;
881 
882  $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
883  if ($objects < 0)
884  {
885  dol_print_error($db, $object->error, $object->errors);
886  } else {
887  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
888  print '<input type="hidden" name="token" value="'.newToken().'">';
889  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
890  print '<input type="hidden" name="type" value="'.$typeid.'">';
891  print '<input type="hidden" name="id" value="'.$object->id.'">';
892  print '<input type="hidden" name="action" value="list">';
893 
894  print '<br>';
895  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
896 
897  print_barre_liste($langs->trans("Project"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit);
898 
899  print "<table class='noborder' width='100%'>\n";
900  print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
901 
902  if (count($objects) > 0)
903  {
904  $i = 0;
905  foreach ($objects as $key => $project)
906  {
907  $i++;
908  if ($i > $limit) break;
909 
910  print "\t".'<tr class="oddeven">'."\n";
911  print '<td class="nowrap" valign="top">';
912  print $project->getNomUrl(1);
913  print "</td>\n";
914  print '<td class="tdtop">'.$project->ref."</td>\n";
915  print '<td class="tdtop">'.$project->title."</td>\n";
916  // Link to delete from category
917  print '<td class="right">';
918  if ($permission)
919  {
920  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$project->id."'>";
921  print $langs->trans("DeleteFromCat");
922  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
923  print "</a>";
924  }
925  print "</tr>\n";
926  }
927  } else {
928  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
929  }
930  print "</table>\n";
931 
932  print '</form>'."\n";
933  }
934 }
935 
936 // List of users
937 if ($type == Categorie::TYPE_USER)
938 {
939  require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
940 
941  $users = $object->getObjectsInCateg($type);
942  if ($users < 0)
943  {
944  dol_print_error($db, $object->error, $object->errors);
945  } else {
946  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
947  print '<input type="hidden" name="token" value="'.newToken().'">';
948  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
949  print '<input type="hidden" name="type" value="'.$typeid.'">';
950  print '<input type="hidden" name="id" value="'.$object->id.'">';
951  print '<input type="hidden" name="action" value="list">';
952 
953  print '<br>';
954 
955  $param = '&limit='.$limit.'&id='.$id.'&type='.$type;
956  $num = count($users);
957 
958  print_barre_liste($langs->trans("Users"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, '', 'user', 0, '', '', $limit);
959 
960  print "<table class='noborder' width='100%'>\n";
961  print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Users").' <span class="badge">'.$num.'</span></td></tr>'."\n";
962 
963  if (count($users) > 0)
964  {
965  // Use "$userentry" here, because "$user" is the current user
966  foreach ($users as $key => $userentry)
967  {
968  print "\t".'<tr class="oddeven">'."\n";
969  print '<td class="nowrap" valign="top">';
970  print $userentry->getNomUrl(1);
971  print "</td>\n";
972  print '<td class="tdtop">'.$userentry->job."</td>\n";
973 
974  // Link to delete from category
975  print '<td class="right">';
976  if ($user->rights->user->user->creer)
977  {
978  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$type."&amp;removeelem=".$userentry->id."'>";
979  print $langs->trans("DeleteFromCat");
980  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
981  print "</a>";
982  }
983  print "</tr>\n";
984  }
985  } else {
986  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
987  }
988  print "</table>\n";
989 
990  print '</form>'."\n";
991  }
992 }
993 
994 
995 // List of warehouses
996 if ($type == Categorie::TYPE_WAREHOUSE)
997 {
998  $permission = $user->rights->stock->creer;
999 
1000  require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
1001 
1002  $objects = $object->getObjectsInCateg($type, 0, $limit, $offset);
1003  if ($objects < 0)
1004  {
1005  dol_print_error($db, $object->error, $object->errors);
1006  } else {
1007  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
1008  print '<input type="hidden" name="token" value="'.newToken().'">';
1009  print '<input type="hidden" name="typeid" value="'.$typeid.'">';
1010  print '<input type="hidden" name="type" value="'.$typeid.'">';
1011  print '<input type="hidden" name="id" value="'.$object->id.'">';
1012  print '<input type="hidden" name="action" value="list">';
1013 
1014  print '<br>';
1015  $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
1016 
1017  print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit);
1018 
1019  print "<table class='noborder' width='100%'>\n";
1020  print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";
1021 
1022  if (count($objects) > 0)
1023  {
1024  $i = 0;
1025  foreach ($objects as $key => $project)
1026  {
1027  $i++;
1028  if ($i > $limit) break;
1029 
1030  print "\t".'<tr class="oddeven">'."\n";
1031  print '<td class="nowrap" valign="top">';
1032  print $project->getNomUrl(1);
1033  print "</td>\n";
1034  print '<td class="tdtop">'.$project->ref."</td>\n";
1035  print '<td class="tdtop">'.$project->title."</td>\n";
1036  // Link to delete from category
1037  print '<td class="right">';
1038  if ($permission)
1039  {
1040  print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$project->id."'>";
1041  print $langs->trans("DeleteFromCat");
1042  print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
1043  print "</a>";
1044  }
1045  print "</tr>\n";
1046  }
1047  } else {
1048  print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
1049  }
1050  print "</table>\n";
1051 
1052  print '</form>'."\n";
1053  }
1054 }
1055 
1056 
1057 // End of page
1058 llxFooter();
1059 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage contact/addresses.
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.
Class to manage products or services.
Class to manage Dolibarr users.
Definition: user.class.php:44
categories_prepare_head(Categorie $object, $type)
Prepare array with list of tabs.
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...
Class to manage bank accounts.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage standard extra fields.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
Class to manage generation of HTML components Only common components must be here.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage categories.
Class to manage projects.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
Classe permettant la generation de composants html autre Only common components are here...
Class to manage members of a foundation.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name &#39;newtoken&#39;.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_view($titlealt= 'default', $float=0, $other= '')
Show logo view card.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
llxFooter()
Empty footer.
Definition: wrapper.php:59
tree_recur($tab, $pere, $rang, $iddivjstree= 'iddivjstree', $donoresetalreadyloaded=0, $showfk=0, $moreparam= '')
Recursive function to output a tree.