dolibarr 21.0.0-alpha
card_view.tpl.php
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
18// Protection to avoid direct call of template
19if (empty($conf) || !is_object($conf)) {
20 print "Error, template page can't be called as URL";
21 exit(1);
22}
23
24
25$object = $GLOBALS['object'];
26?>
27
28<!-- BEGIN PHP TEMPLATE product/canvas/product/tpl/card_view.tpl.php -->
29<?php
30$head = product_prepare_head($object);
31$titre = $langs->trans("CardProduct".$object->type);
32
33print dol_get_fiche_head($head, 'card', $titre, -1, 'product');
34
35$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?restore_lastsearch_values=1&type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
36$object->next_prev_filter = "fk_product_type = ".((int) $object->type);
37
38$shownav = 1;
39if ($user->socid && !in_array('product', explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')))) {
40 $shownav = 0;
41}
42
43dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
44?>
45
46<?php dol_htmloutput_errors($object->error, $object->errors); ?>
47
48<table class="border allwidth">
49
50<tr>
51<td width="15%"><?php echo $langs->trans("Ref"); ?></td>
52<td colspan="2"><?php echo dol_escape_htmltag($object->ref); ?></td>
53</tr>
54
55<tr>
56<td><?php echo $langs->trans("Label") ?></td>
57<td><?php echo dol_escape_htmltag($object->label); ?></td>
58
59<?php if ($object->photos) { ?>
60<td valign="middle" align="center" width="30%" rowspan="<?php echo $object->nblines; ?>">
61 <?php echo $object->photos; ?>
62</td>
63<?php } ?>
64
65</tr>
66
67<tr>
68<td class="tdtop"><?php echo $langs->trans("Description"); ?></td>
69<td colspan="2"><?php echo dol_escape_htmltag($object->description); ?></td>
70</tr>
71
72<tr>
73<td><?php echo $langs->trans("Nature"); ?></td>
74<td colspan="2"><?php echo dol_escape_htmltag($object->finished); ?></td>
75</tr>
76
77<tr>
78<td><?php echo $langs->trans("Weight"); ?></td>
79<td colspan="2"><?php echo dol_escape_htmltag($object->weight); ?></td>
80</tr>
81
82<tr>
83<td><?php echo $langs->trans("Length"); ?></td>
84<td colspan="2"><?php echo dol_escape_htmltag($object->length); ?></td>
85</tr>
86
87<tr>
88<td><?php echo $langs->trans("Surface"); ?></td>
89<td colspan="2"><?php echo dol_escape_htmltag($object->surface); ?></td>
90</tr>
91
92<tr>
93<td><?php echo $langs->trans("Volume"); ?></td>
94<td colspan="2"><?php echo dol_escape_htmltag($object->volume); ?></td>
95</tr>
96
97<tr>
98<td class="tdtop"><?php echo $langs->trans("Note"); ?></td>
99<td colspan="2" class="valeur sensiblehtmlcontent"><?php echo dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note)); ?></td>
100</tr>
101
102</table>
103
104<!-- END PHP TEMPLATE -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0)
Clean a string to keep only desirable HTML tags.
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...
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).
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
treeview li table
No Email.
product_prepare_head($object)
Prepare array with list of tabs.