note.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
  3. * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
  4. * Copyright (C) 2016 Laurent Destailleur <aldy@users.sourceforge.net>
  5. * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
  6. * Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/resource/note.php
  23. * \ingroup fichinter
  24. * \brief Fiche d'information sur une resource
  25. */
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php';
  29. // Load translation files required by the page
  30. $langs->loadLangs(array('companies', 'interventions'));
  31. $id = GETPOST('id','int');
  32. $ref = GETPOST('ref','alpha');
  33. $action=GETPOST('action','alpha');
  34. // Security check
  35. if ($user->societe_id) $socid=$user->societe_id;
  36. $result = restrictedArea($user, 'resource', $id, 'resource');
  37. $object = new DolResource($db);
  38. $object->fetch($id,$ref);
  39. $permissionnote=$user->rights->resource->write; // Used by the include of actions_setnotes.inc.php
  40. /*
  41. * Actions
  42. */
  43. include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
  44. /*
  45. * View
  46. */
  47. llxHeader();
  48. $form = new Form($db);
  49. if ($id > 0 || ! empty($ref))
  50. {
  51. $head = resource_prepare_head($object);
  52. dol_fiche_head($head, 'note', $langs->trans('ResourceSingular'), -1, 'resource');
  53. $linkback = '<a href="' . DOL_URL_ROOT . '/resource/list.php' . (! empty($socid) ? '?id=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
  54. $morehtmlref='<div class="refidno">';
  55. $morehtmlref.='</div>';
  56. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  57. print '<div class="fichecenter">';
  58. print '<div class="underbanner clearboth"></div>';
  59. print '<table class="border" width="100%">';
  60. // Resource type
  61. print '<tr>';
  62. print '<td class="titlefield">' . $langs->trans("ResourceType") . '</td>';
  63. print '<td>';
  64. print $object->type_label;
  65. print '</td>';
  66. print '</tr>';
  67. print "</table>";
  68. print '</div>';
  69. $permission=$user->rights->resource->write;
  70. $cssclass='titlefield';
  71. include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
  72. dol_fiche_end();
  73. }
  74. // End of page
  75. llxFooter();
  76. $db->close();