dolibarr/htdocs/asset/info.php

94 lines
2.2 KiB
PHP
Raw Normal View History

2018-04-01 21:26:52 +02:00
<?php
2019-01-28 21:39:22 +01:00
/* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
2018-04-01 21:26:52 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2018-04-01 21:26:52 +02:00
*/
/**
2018-08-31 23:12:55 +02:00
* \file htdocs/asset/info.php
2018-04-29 19:52:14 +02:00
* \ingroup asset
2018-04-01 21:26:52 +02:00
* \brief Page to show an asset information
*/
require '../main.inc.php';
2018-04-29 19:52:14 +02:00
require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
2018-04-01 21:26:52 +02:00
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
2018-04-29 19:52:14 +02:00
require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
2018-04-01 21:26:52 +02:00
2018-05-26 18:41:16 +02:00
// Load translation files required by the page
2018-04-29 19:52:14 +02:00
$langs->loadLangs(array("asset"));
2018-04-01 21:26:52 +02:00
2021-02-22 18:38:03 +01:00
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
2020-09-16 19:39:50 +02:00
$action = GETPOST('action', 'aZ09');
2018-04-01 21:26:52 +02:00
// Security check
2021-02-22 18:38:03 +01:00
if ($user->socid) {
$socid = $user->socid;
}
2020-09-24 17:24:23 +02:00
$result = restrictedArea($user, 'asset', $id);
2018-04-01 21:26:52 +02:00
2018-04-29 19:52:14 +02:00
$object = new Asset($db);
2018-04-01 21:26:52 +02:00
$object->fetch($id);
2020-09-24 17:24:23 +02:00
2018-04-01 21:26:52 +02:00
/*
* Actions
*/
2020-09-24 17:24:23 +02:00
// None
2019-09-06 19:12:43 +02:00
2018-04-01 21:26:52 +02:00
/*
* View
*/
2019-09-06 19:12:43 +02:00
$form = new Form($db);
$title = $langs->trans('Asset')." - ".$langs->trans('Info');
$help_url = "";
llxHeader('', $title, $help_url);
2018-04-01 21:26:52 +02:00
$object->info($id);
2018-10-14 10:57:27 +02:00
$head = asset_prepare_head($object);
2018-04-01 21:26:52 +02:00
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head($head, 'info', $langs->trans("Asset"), -1, 'generic');
2018-04-01 21:26:52 +02:00
$linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2018-04-01 21:26:52 +02:00
$morehtmlref = '<div class="refidno">';
$morehtmlref .= '</div>';
2018-04-01 21:26:52 +02:00
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<br>';
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end();
2018-04-01 21:26:52 +02:00
2018-07-29 11:33:52 +02:00
// End of page
2018-04-01 21:26:52 +02:00
llxFooter();
$db->close();