dolibarr  9.0.0
note.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
27 require '../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array('trips', 'companies', 'bills', 'orders'));
34 
35 $id = GETPOST('id','int');
36 $ref=GETPOST('ref','alpha');
37 $socid=GETPOST('socid','int');
38 $action=GETPOST('action','alpha');
39 
40 // Security check
41 $socid=0;
42 if ($user->societe_id) $socid=$user->societe_id;
43 $result=restrictedArea($user,'expensereport',$id,'expensereport');
44 
45 
46 $object = new ExpenseReport($db);
47 if (! $object->fetch($id, $ref) > 0)
48 {
49  dol_print_error($db);
50 }
51 
52 $permissionnote=$user->rights->expensereport->creer; // Used by the include of actions_setnotes.inc.php
53 
54 
55 /*
56  * Actions
57  */
58 
59 include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
60 
61 
62 /*
63  * View
64  */
65 $title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Note");
66 $helpurl="EN:Module_Expense_Reports";
67 llxHeader("",$title,$helpurl);
68 
69 $form = new Form($db);
70 
71 if ($id > 0 || ! empty($ref))
72 {
73  $object = new ExpenseReport($db);
74  $object->fetch($id, $ref);
75  $object->info($object->id);
76 
77  $head = expensereport_prepare_head($object);
78 
79  dol_fiche_head($head, 'note', $langs->trans("ExpenseReport"), -1, 'trip');
80 
81  $linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
82 
83  $morehtmlref='<div class="refidno">';
84  $morehtmlref.='</div>';
85 
86 
87  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
88 
89  print '<div class="fichecenter">';
90  print '<div class="underbanner clearboth"></div>';
91 
92  $cssclass="titlefield";
93  include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
94 
95  print '</div>';
96 
97  dol_fiche_end();
98 }
99 
100 // End of page
101 llxFooter();
102 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
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_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
Class to manage generation of HTML components Only common components must be here.
dol_fiche_end($notab=0)
Show tab footer of a card.
expensereport_prepare_head($object)
Prepare array with list of tabs.
llxHeader()
Empty header.
Definition: wrapper.php:44
Class to manage Trips and Expenses.
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_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='')
Show tab header of a card.