card_view.tpl.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@inodbox.com>
  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. // Protection to avoid direct call of template
  18. if (empty($conf) || !is_object($conf)) {
  19. print "Error, template page can't be called as URL";
  20. exit;
  21. }
  22. $object = $GLOBALS['object'];
  23. ?>
  24. <!-- BEGIN PHP TEMPLATE VIEW.TPL -->
  25. <?php
  26. $head = product_prepare_head($object);
  27. $titre = $langs->trans("CardProduct".$object->type);
  28. print dol_get_fiche_head($head, 'card', $titre, -1, 'service');
  29. $linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
  30. $object->next_prev_filter = " fk_product_type = ".$object->type;
  31. $shownav = 1;
  32. if ($user->socid && !in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
  33. $shownav = 0;
  34. }
  35. dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
  36. ?>
  37. <?php dol_htmloutput_errors($object->error, $object->errors); ?>
  38. <table class="border allwidth">
  39. <tr>
  40. <td width="15%"><?php echo $langs->trans("Ref"); ?></td>
  41. <td colspan="2"><?php echo $object->ref; ?></td>
  42. </tr>
  43. <tr>
  44. <td><?php echo $langs->trans("Label") ?></td>
  45. <td><?php echo $object->label; ?></td>
  46. <?php if ($object->photos) { ?>
  47. <td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
  48. <?php echo $object->photos; ?>
  49. </td>
  50. <?php } ?>
  51. </tr>
  52. <tr>
  53. <td class="tdtop"><?php echo $langs->trans("Description"); ?></td>
  54. <td colspan="2"><?php echo $object->description; ?></td>
  55. </tr>
  56. <tr><td><?php echo $langs->trans("Duration"); ?></td>
  57. <td><?php echo $object->duration_value; ?>&nbsp;
  58. <?php echo $object->duration_unit; ?>&nbsp;
  59. </td></tr>
  60. <tr>
  61. <td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
  62. <td colspan="2" class="valeur sensiblehtmlcontent"><?php echo dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); ?></td>
  63. </tr>
  64. </table>
  65. <!-- END PHP TEMPLATE -->