note.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 <https://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', 'aZ09');
  34. // Security check
  35. if ($user->socid) {
  36. $socid = $user->socid;
  37. }
  38. $result = restrictedArea($user, 'resource', $id, 'resource');
  39. $object = new DolResource($db);
  40. $object->fetch($id, $ref);
  41. $permissionnote = $user->rights->resource->write; // Used by the include of actions_setnotes.inc.php
  42. /*
  43. * Actions
  44. */
  45. include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
  46. /*
  47. * View
  48. */
  49. llxHeader();
  50. $form = new Form($db);
  51. if ($id > 0 || !empty($ref)) {
  52. $head = resource_prepare_head($object);
  53. print dol_get_fiche_head($head, 'note', $langs->trans('ResourceSingular'), -1, 'resource');
  54. $linkback = '<a href="'.DOL_URL_ROOT.'/resource/list.php'.(!empty($socid) ? '?id='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
  55. $morehtmlref = '<div class="refidno">';
  56. $morehtmlref .= '</div>';
  57. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  58. print '<div class="fichecenter">';
  59. print '<div class="underbanner clearboth"></div>';
  60. print '<table class="border tableforfield centpercent">';
  61. // Resource type
  62. print '<tr>';
  63. print '<td class="titlefield">'.$langs->trans("ResourceType").'</td>';
  64. print '<td>';
  65. print $object->type_label;
  66. print '</td>';
  67. print '</tr>';
  68. print "</table>";
  69. print '</div>';
  70. $permission = $user->rights->resource->write;
  71. $cssclass = 'titlefield';
  72. include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
  73. print dol_get_fiche_end();
  74. }
  75. // End of page
  76. llxFooter();
  77. $db->close();