info.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 <https://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 = GETPOSTINT('id');
  29. $ref = GETPOST('ref', 'alpha');
  30. $action = GETPOST('action', 'aZ09');
  31. // Security check
  32. if ($user->socid) {
  33. $socid = $user->socid;
  34. }
  35. $result = restrictedArea($user, 'asset', $id);
  36. $object = new Asset($db);
  37. $object->fetch($id);
  38. /*
  39. * Actions
  40. */
  41. // None
  42. /*
  43. * View
  44. */
  45. $form = new Form($db);
  46. $title = $langs->trans('Asset')." - ".$langs->trans('Info');
  47. $help_url = "";
  48. llxHeader('', $title, $help_url);
  49. $object->info($id);
  50. $head = asset_prepare_head($object);
  51. print dol_get_fiche_head($head, 'info', $langs->trans("Asset"), -1, 'generic');
  52. $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
  53. $morehtmlref = '<div class="refidno">';
  54. $morehtmlref .= '</div>';
  55. dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
  56. print '<div class="fichecenter">';
  57. print '<div class="underbanner clearboth"></div>';
  58. print '<br>';
  59. print '<table width="100%"><tr><td>';
  60. dol_print_object_info($object);
  61. print '</td></tr></table>';
  62. print '</div>';
  63. print dol_get_fiche_end();
  64. // End of page
  65. llxFooter();
  66. $db->close();