dolibarr  13.0.2
note.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
4  * Copyright (C) 2016 Laurent Destailleur <aldy@users.sourceforge.net>
5  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
6  * Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
28 require '../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array('companies', 'interventions'));
34 
35 $id = GETPOST('id', 'int');
36 $ref = GETPOST('ref', 'alpha');
37 $action = GETPOST('action', 'aZ09');
38 
39 // Security check
40 if ($user->socid) $socid = $user->socid;
41 $result = restrictedArea($user, 'resource', $id, 'resource');
42 
43 $object = new DolResource($db);
44 $object->fetch($id, $ref);
45 
46 $permissionnote = $user->rights->resource->write; // Used by the include of actions_setnotes.inc.php
47 
48 
49 /*
50  * Actions
51  */
52 
53 include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
54 
55 
56 /*
57  * View
58  */
59 
60 llxHeader();
61 
62 $form = new Form($db);
63 
64 if ($id > 0 || !empty($ref))
65 {
66  $head = resource_prepare_head($object);
67  print dol_get_fiche_head($head, 'note', $langs->trans('ResourceSingular'), -1, 'resource');
68 
69  $linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php'.(!empty($socid) ? '?id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
70 
71 
72  $morehtmlref = '<div class="refidno">';
73  $morehtmlref .= '</div>';
74 
75 
76  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
77 
78 
79  print '<div class="fichecenter">';
80  print '<div class="underbanner clearboth"></div>';
81 
82  print '<table class="border tableforfield centpercent">';
83 
84  // Resource type
85  print '<tr>';
86  print '<td class="titlefield">'.$langs->trans("ResourceType").'</td>';
87  print '<td>';
88  print $object->type_label;
89  print '</td>';
90  print '</tr>';
91 
92  print "</table>";
93 
94  print '</div>';
95 
96  $permission = $user->rights->resource->write;
97  $cssclass = 'titlefield';
98  include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
99 
101 }
102 
103 // End of page
104 llxFooter();
105 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
llxHeader()
Empty header.
Definition: wrapper.php:45
resource_prepare_head($object)
Prepare head for tabs.
Class to manage generation of HTML components Only common components must be here.
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.
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_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