dolibarr 19.0.3
info.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24// Load Dolibarr environment
25require '../../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
29
30// Load translation files required by the page
31$langs->load("stocks");
32
33$id = GETPOST('id', 'int');
34$ref = GETPOST('ref', 'alpha');
35
36// Security check
37//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
38$result = restrictedArea($user, 'stock');
39$usercancreate = $user->rights->stock->creer;
40
41/*
42 * View
43 */
44
45$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
46llxHeader("", $langs->trans("Stocks"), $help_url);
47
48$object = new Entrepot($db);
49$object->fetch($id, $ref);
50$object->info($object->id);
51
52$head = stock_prepare_head($object);
53
54print dol_get_fiche_head($head, 'info', $langs->trans("Warehouse"), -1, 'stock');
55
56
57$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
58
59$morehtmlref = '<div class="refidno">';
60$morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
61
62// Project
63if (isModEnabled('project')) {
64 $langs->load("projects");
65 $morehtmlref .= '<br>'.img_picto('', 'project').' '.$langs->trans('Project').' ';
66 if ($usercancreate) {
67 if ($action != 'classify') {
68 $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
69 }
70 if ($action == 'classify') {
71 $projectid = $object->fk_project;
72 $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
73 $morehtmlref .= '<input type="hidden" name="action" value="classin">';
74 $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
75 $morehtmlref .= $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
76 $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
77 $morehtmlref .= '</form>';
78 } else {
79 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!empty($object->socid) ? $object->socid : 0), $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
80 }
81 } else {
82 if (!empty($object->fk_project)) {
83 $proj = new Project($db);
84 $proj->fetch($object->fk_project);
85 $morehtmlref .= ' : '.$proj->getNomUrl(1);
86 if ($proj->title) {
87 $morehtmlref .= ' - '.$proj->title;
88 }
89 } else {
90 $morehtmlref .= '';
91 }
92 }
93}
94$morehtmlref .= '</div>';
95
96$shownav = 1;
97if ($user->socid && !in_array('stock', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
98 $shownav = 0;
99}
100
101dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
102
103
104print '<div class="fichecenter">';
105print '<div class="underbanner clearboth"></div>';
106
107print '<br>';
108
109dol_print_object_info($object);
110
111print '</div>';
112
113// End of page
114llxFooter();
115$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:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage warehouses.
Class to manage projects.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
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.
stock_prepare_head($object)
Prepare array with list of tabs.
Definition stock.lib.php:30