dolibarr 21.0.0-alpha
card_create.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 */
18
19// Protection to avoid direct call of template
20if (empty($conf) || !is_object($conf)) {
21 print "Error, template page can't be called as URL";
22 exit(1);
23}
24
25
26$object = $GLOBALS['object'];
27
28$statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell"));
29?>
30
31<!-- BEGIN PHP TEMPLATE product/canvas/product/tpl/card_create.tpl.php -->
32
33<?php
34print load_fiche_titre($langs->trans("NewProduct"), '', 'product');
35print dol_get_fiche_head([]);
36?>
37
38<?php dol_htmloutput_errors((is_numeric($object->error) ? '' : $object->error), $object->errors); ?>
39
40<?php dol_htmloutput_errors($GLOBALS['mesg'], $GLOBALS['mesgs']); ?>
41
42<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
43<input type="hidden" name="token" value="<?php echo newToken(); ?>">
44<input type="hidden" name="action" value="add">
45<input type="hidden" name="type" value="0">
46<input type="hidden" name="canvas" value="<?php echo $canvas; ?>">
47<?php if (!isModEnabled('stock')) { ?>
48<input name="seuil_stock_alerte" type="hidden" value="0">
49<?php } ?>
50
51<table class="border allwidth">
52
53<tr>
54<td class="fieldrequired" width="20%"><?php echo $langs->trans("Ref"); ?></td>
55<td><input name="ref" size="40" maxlength="32" value="<?php echo $object->ref; ?>">
56<?php if ($refalreadyexists == 1) {
57 echo $langs->trans("RefAlreadyExists");
58} ?>
59</td></tr>
60
61<tr>
62<td class="fieldrequired"><?php echo $langs->trans("Label"); ?></td>
63<td><input name="label" size="40" value="<?php echo $object->label; ?>"></td>
64</tr>
65
66<tr>
67<td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Sell").')'; ?></td>
68<td><?php echo $form->selectarray('statut', $statutarray, $object->status); ?></td>
69</tr>
70
71<tr>
72<td class="fieldrequired"><?php echo $langs->trans("Status").' ('.$langs->trans("Buy").')'; ?></td>
73<td><?php echo $form->selectarray('statut_buy', $statutarray, $object->status_buy); ?></td>
74</tr>
75
76<?php if (isModEnabled('stock')) { ?>
77<tr><td><?php echo $langs->trans("StockLimit"); ?></td><td>
78<input name="seuil_stock_alerte" size="4" value="<?php echo $object->seuil_stock_alerte; ?>">
79</td></tr>
80<?php } ?>
81
82<tr><td><?php echo $langs->trans("Nature"); ?></td><td>
83<?php echo $object->finished; ?>
84</td></tr>
85
86<tr><td><?php echo $langs->trans("Weight"); ?></td><td>
87<input name="weight" size="4" value="<?php echo $object->weight; ?>">
88<?php echo $object->weight_units; ?>
89</td></tr>
90
91<tr><td><?php echo $langs->trans("Length"); ?></td><td>
92<input name="size" size="4" value="<?php echo $object->length; ?>">
93<?php echo $object->length_units; ?>
94</td></tr>
95
96<tr><td><?php echo $langs->trans("Surface"); ?></td><td>
97<input name="surface" size="4" value="<?php echo $object->surface; ?>">
98<?php echo $object->surface_units; ?>
99</td></tr>
100
101<tr><td><?php echo $langs->trans("Volume"); ?></td><td>
102<input name="volume" size="4" value="<?php echo $object->volume; ?>">
103<?php echo $object->volume_units; ?>
104</td></tr>
105
106<tr><td class="tdtop"><?php echo $langs->trans("NoteNotVisibleOnBill"); ?></td><td>
107<?php echo $object->textarea_note; ?>
108</td></tr>
109</table>
110
111<br>
112
113<?php if (!$conf->global->PRODUIT_MULTIPRICES) { ?>
114<table class="border allwidth">
115
116<tr><td><?php echo $langs->trans("SellingPrice"); ?></td>
117<td><input name="price" size="10" value="<?php echo $object->price; ?>">
118 <?php echo $object->price_base_type; ?>
119</td></tr>
120
121<tr><td><?php echo $langs->trans("MinPrice"); ?></td>
122<td><input name="price_min" size="10" value="<?php echo $object->price_min; ?>">
123</td></tr>
124
125<tr><td width="20%"><?php echo $langs->trans("VATRate"); ?></td><td>
126 <?php echo $object->tva_tx; ?>
127</td></tr>
128
129</table>
130
131<br>
132<?php } ?>
133
134<div align="center"><input type="submit" class="button" value="<?php echo $langs->trans("Create"); ?>"></div>
135
136</form>
137
138<!-- END PHP TEMPLATE -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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_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.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:137
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140