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