dolibarr 21.0.0-beta
card_view.tpl.php
1<?php
2/* Copyright (C) 2010-2018 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
23// Protection to avoid direct call of template
24if (empty($conf) || !is_object($conf)) {
25 print "Error, template page can't be called as URL";
26 exit(1);
27}
28
29
30$object = $GLOBALS['object'];
32?>
33
34<!-- BEGIN PHP TEMPLATE VIEW.TPL -->
35<?php
36$head = product_prepare_head($object);
37$titre = $langs->trans("CardProduct".$object->type);
38
39print dol_get_fiche_head($head, 'card', $titre, -1, 'service');
40
41$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
42$object->next_prev_filter = " fk_product_type:=:".((int) $object->type);
43
44$shownav = 1;
45if ($user->socid && !in_array('product', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
46 $shownav = 0;
47}
48
49dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
50?>
51
52<?php dol_htmloutput_errors($object->error, $object->errors); ?>
53
54<table class="border allwidth">
55
56<tr>
57<td width="15%"><?php echo $langs->trans("Ref"); ?></td>
58<td colspan="2"><?php echo $object->ref; ?></td>
59</tr>
60
61<tr>
62<td><?php echo $langs->trans("Label") ?></td>
63<td><?php echo $object->label; ?></td>
64
65<?php if ($object->photos) { ?>
66<td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
67 <?php echo $object->photos; ?>
68</td>
69<?php } ?>
70
71</tr>
72
73<tr>
74<td class="tdtop"><?php echo $langs->trans("Description"); ?></td>
75<td colspan="2"><?php echo $object->description; ?></td>
76</tr>
77
78<tr><td><?php echo $langs->trans("Duration"); ?></td>
79<td><?php echo $object->duration_value; ?>&nbsp;
80<?php echo $object->duration_unit; ?>&nbsp;
81</td></tr>
82
83<tr>
84<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
85<td colspan="2" class="valeur sensiblehtmlcontent"><?php echo dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); ?></td>
86</tr>
87
88</table>
89
90<!-- END PHP TEMPLATE -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0, $allowphp=0)
Clean a string to keep only desirable HTML tags.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
treeview li table
No Email.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
product_prepare_head($object)
Prepare array with list of tabs.