info.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
  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 <http://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/asset/info.php
  19. * \ingroup asset
  20. * \brief Page to show an asset information
  21. */
  22. require '../main.inc.php';
  23. require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  25. require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
  26. // Load translation files required by the page
  27. $langs->loadLangs(array("asset"));
  28. $id = GETPOST('id','int');
  29. $ref=GETPOST('ref','alpha');
  30. $action=GETPOST('action','alpha');
  31. // Security check
  32. if ($user->societe_id) $socid=$user->societe_id;
  33. $result = restrictedArea($user, 'asset', $id, '');
  34. $object = new Asset($db);
  35. $object->fetch($id);
  36. /*
  37. * Actions
  38. */
  39. /*
  40. * View
  41. */
  42. $title = $langs->trans('Asset') . " - " . $langs->trans('Info');
  43. $helpurl = "";
  44. llxHeader('', $title, $helpurl);
  45. $form = new Form($db);
  46. $object->info($id);
  47. $head = asset_prepare_head($object);
  48. dol_fiche_head($head, 'info', $langs->trans("Asset"), -1, 'generic');
  49. $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
  50. $morehtmlref='<div class="refidno">';
  51. $morehtmlref.='</div>';
  52. dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
  53. print '<div class="fichecenter">';
  54. print '<div class="underbanner clearboth"></div>';
  55. print '<br>';
  56. print '<table width="100%"><tr><td>';
  57. dol_print_object_info($object);
  58. print '</td></tr></table>';
  59. print '</div>';
  60. dol_fiche_end();
  61. // End of page
  62. llxFooter();
  63. $db->close();