dolibarr  17.0.4
productlot_note.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) ---Put here your own copyright and developer email---
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
27 require '../../main.inc.php';
28 dol_include_once('/product/stock/class/productlot.class.php');
29 dol_include_once('/core/lib/product.lib.php');
30 
31 // Load translation files required by the page
32 $langs->loadLangs(array('other', 'products'));
33 
34 // Get parameters
35 $id = GETPOST('id', 'int');
36 $ref = GETPOST('ref', 'alpha');
37 $action = GETPOST('action', 'aZ09');
38 
39 // Initialize technical objects
40 $object = new Productlot($db);
41 $extrafields = new ExtraFields($db);
42 $diroutputmassaction = $conf->productlot->dir_output.'/temp/massgeneration/'.$user->id;
43 $hookmanager->initHooks(array('productlotnote')); // Note that conf->hooks_modules contains array
44 // Fetch optionals attributes and labels
45 $extrafields->fetch_name_optionals_label($object->table_element);
46 
47 // Load object
48 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
49 if ($id > 0 || !empty($ref)) {
50  $upload_dir = $conf->productlot->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
51 }
52 
53 $permissionnote = $user->rights->produit->lire; // Used by the include of actions_setnotes.inc.php
54 
55 // Security check (enable the most restrictive one)
56 //if ($user->socid > 0) accessforbidden();
57 //if ($user->socid > 0) $socid = $user->socid;
58 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
59 //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
60 //if (empty($conf->calibration->enabled)) accessforbidden();
61 //if (!$permissiontoread) accessforbidden();
62 
63 
64 /*
65  * Actions
66  */
67 
68 $reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
69 if ($reshook < 0) {
70  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
71 }
72 if (empty($reshook)) {
73  include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
74 }
75 
76 
77 /*
78  * View
79  */
80 
81 $form = new Form($db);
82 
83 $help_url = '';
84 llxHeader('', $langs->trans('productlot'), $help_url);
85 
86 if ($id > 0 || !empty($ref)) {
87  $object->fetch_thirdparty();
88 
89  $head = productlot_prepare_head($object);
90 
91  print dol_get_fiche_head($head, 'note', '', -1, $object->picto);
92 
93  // Object card
94  // ------------------------------------------------------------
95  $linkback = '<a href="'.dol_buildpath('/stock/productlot_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
96 
97  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'batch');
98 
99  print '<div class="fichecenter">';
100  print '<div class="underbanner clearboth"></div>';
101 
102  $cssclass = "titlefield";
103  include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
104 
105  print '</div>';
106 
107 
108  print dol_get_fiche_end();
109 }
110 
111 // End of page
112 llxFooter();
113 $db->close();
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
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
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class with list of lots and properties.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
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='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
productlot_prepare_head($object)
Prepare array with list of tabs.