dolibarr  13.0.2
info.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php';
30 
31 if (!$user->rights->categorie->lire) {
33 }
34 
35 // Load translation files required by the page
36 $langs->loadLangs(array('categories', 'sendings'));
37 
38 $socid = 0;
39 $id = GETPOST('id', 'int');
40 
41 // Security check
42 if ($user->socid) $socid = $user->socid;
43 $result = restrictedArea($user, 'categorie', $id, '&category');
44 
45 $object = new Categorie($db);
46 if (!$object->fetch($id) > 0) {
47  dol_print_error($db);
48  exit;
49 }
50 $type = $object->type;
51 if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
52 
53 /*
54  * View
55  */
56 
57 $form = new Form($db);
58 
59 llxHeader('', $langs->trans('Categories'), '');
60 
61 //$object->info($object->id);
62 
63 $title = Categorie::$MAP_TYPE_TITLE_AREA[$type];
64 
65 $head = categories_prepare_head($object, $type);
66 
67 print dol_get_fiche_head($head, 'info', $langs->trans($title), -1, 'category');
68 $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type);
69 $linkback = '<a href="'.$backtolist.'">'.$langs->trans("BackToList").'</a>';
70 $object->next_prev_filter = ' type = '.$type;
71 $object->ref = $object->label;
72 $morehtmlref = '<br><div class="refidno"><a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> ';
73 $ways = $object->print_all_ways(" &gt;&gt; ", '', 1);
74 foreach ($ways as $way) {
75  $morehtmlref .= $way."<br>\n";
76 }
77 $morehtmlref .= '</div>';
78 
79 dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.$type, 0, '', '', 1);
80 
81 print '<br>';
82 
83 print '<div class="fichecenter">';
84 print '<div class="underbanner clearboth"></div>';
85 
86 print '<br>';
87 
88 print '<table "border centpercent tableforfield">';
89 
90 print '<tr><td>';
91 dol_print_object_info($object);
92 print '</td></tr>';
93 
94 print '</table>';
95 
96 print '</div>';
97 
99 
100 // End of page
101 llxFooter();
102 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
categories_prepare_head(Categorie $object, $type)
Prepare array with list of tabs.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage generation of HTML components Only common components must be here.
Class to manage categories.
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.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
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_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a 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