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