dolibarr 18.0.6
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// Load Dolibarr environment
29require '../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
32
33// Load translation files required by the page
34$langs->loadLangs(array('companies', 'interventions'));
35
36$id = GETPOST('id', 'int');
37$ref = GETPOST('ref', 'alpha');
38$action = GETPOST('action', 'aZ09');
39
40// Security check
41if ($user->socid) {
42 $socid = $user->socid;
43}
44// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
45$hookmanager->initHooks(array('resourcenote'));
46
47$object = new Dolresource($db);
48
49// Load object
50include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
51
52$result = restrictedArea($user, 'resource', $object->id, 'resource');
53
54$permissionnote = $user->rights->resource->write; // Used by the include of actions_setnotes.inc.php
55
56
57/*
58 * Actions
59 */
60
61$parameters = array();
62$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
63if ($reshook < 0) {
64 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
65}
66if (empty($reshook)) {
67 include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
68}
69
70
71/*
72 * View
73 */
74
75llxHeader();
76
77$form = new Form($db);
78
79if ($id > 0 || !empty($ref)) {
80 $head = resource_prepare_head($object);
81 print dol_get_fiche_head($head, 'note', $langs->trans('ResourceSingular'), -1, 'resource');
82
83 $linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php'.(!empty($socid) ? '?id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
84
85
86 $morehtmlref = '<div class="refidno">';
87 $morehtmlref .= '</div>';
88
89
90 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
91
92
93 print '<div class="fichecenter">';
94 print '<div class="underbanner clearboth"></div>';
95
96 print '<table class="border tableforfield centpercent">';
97
98 // Resource type
99 print '<tr>';
100 print '<td class="titlefield">'.$langs->trans("ResourceType").'</td>';
101 print '<td>';
102 print $object->type_label;
103 print '</td>';
104 print '</tr>';
105
106 print "</table>";
107
108 print '</div>';
109
110 $permission = $user->rights->resource->write;
111 $cssclass = 'titlefield';
112 include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
113
114 print dol_get_fiche_end();
115}
116
117// End of page
118llxFooter();
119$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:56
llxFooter()
Empty footer.
Definition wrapper.php:70
DAO Resource object.
Class to manage generation of HTML components Only common components must be here.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
resource_prepare_head($object)
Prepare head for tabs.
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.