dolibarr  19.0.0-dev
card_edit.tpl.php
1 <?php
2 /* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
3  * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
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
20 if (empty($conf) || !is_object($conf)) {
21  print "Error, template page can't be called as URL";
22  exit;
23 }
24 
25 $contact = $GLOBALS['objcanvas']->control->object;
26 
27 ?>
28 
29 <!-- BEGIN PHP TEMPLATE CARD_EDIT.TPL.PHP COMPANY -->
30 
31 <?php echo $this->control->tpl['title']; ?>
32 
33 <?php echo $this->control->tpl['error']; ?>
34 
35 <?php echo $this->control->tpl['ajax_selectcountry']; ?>
36 <?php if ($this->control->tpl['js_checkVatPopup']) {
37  echo $this->control->tpl['js_checkVatPopup'];
38 } ?>
39 
40 <form action="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id']; ?>" method="POST" name="formsoc">
41 <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
42 <input type="hidden" name="action" value="update">
43 <input type="hidden" name="token" value="<?php echo newToken(); ?>">
44 <input type="hidden" name="socid" value="<?php echo $this->control->tpl['id']; ?>">
45 <?php if ($this->control->tpl['auto_customercode'] || $this->control->tpl['auto_suppliercode']) { ?>
46 <input type="hidden" name="code_auto" value="1">
47 <?php } ?>
48 
49 <table class="border allwidth">
50 
51 <tr>
52  <td><span class="fieldrequired"><?php echo $langs->trans('ThirdPartyName'); ?></span></td>
53  <td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="<?php echo $this->control->tpl['nom']; ?>"></td>
54 </tr>
55 
56 <?php if (!empty($conf->global->SOCIETE_USEPREFIX)) { ?>
57 <tr>
58  <td><?php echo $langs->trans("Prefix"); ?></td>
59  <td colspan="3">
60  <?php if (($this->control->tpl['prefix_customercode'] || $this->control->tpl['prefix_suppliercode']) && $this->control->tpl['prefix_comm']) { ?>
61  <input type="hidden" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
62  <?php echo $this->control->tpl['prefix_comm']; ?>
63  <?php } else { ?>
64  <input type="text" size="5" maxlength="5" name="prefix_comm" value="<?php echo $this->control->tpl['prefix_comm']; ?>">
65  <?php } ?>
66  </td>
67 </tr>
68 <?php } ?>
69 
70 <tr>
71  <td width="25%"><span class="fieldrequired"><?php echo $langs->trans('ProspectCustomer'); ?></span></td>
72  <td width="25%"><?php echo $this->control->tpl['select_customertype']; ?></td>
73  <td width="25%"><?php echo $langs->trans('CustomerCode'); ?></td>
74  <td width="25%">
75  <table class="nobordernopadding">
76  <tr>
77  <td>
78  <?php if ($this->control->tpl['ismodifiable_customercode']) { ?>
79  <input type="text" name="code_client" size="16" value="<?php echo $this->control->tpl['customercode']; ?>" maxlength="24">
80  <?php } else { ?>
81  <?php echo $this->control->tpl['customercode']; ?>
82  <input type="hidden" name="code_client" value="<?php echo $this->control->tpl['customercode']; ?>">
83  <?php } ?>
84  </td>
85  <td><?php echo $this->tpl['help_customercode']; ?></td>
86  </tr>
87  </table>
88  </td>
89 </tr>
90 
91 <tr>
92  <td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
93  <td><?php echo $this->control->tpl['yn_supplier']; ?></td>
94  <td><?php echo $langs->trans('SupplierCode'); ?></td>
95  <td>
96  <table class="nobordernopadding">
97  <tr>
98  <td>
99  <?php if ($this->control->tpl['ismodifiable_suppliercode']) { ?>
100  <input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24">
101  <?php } else { ?>
102  <?php echo $this->control->tpl['suppliercode']; ?>
103  <input type="hidden" name="code_fournisseur" value="<?php echo $this->control->tpl['suppliercode']; ?>">
104  <?php } ?>
105  </td>
106  <td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
107  </tr>
108  </table>
109  </td>
110 </tr>
111 
112 <?php
113 if ($this->control->tpl['fournisseur']) {
114  if (count($this->control->tpl['suppliercategory']) > 0) { ?>
115 <tr>
116  <td><?php echo $langs->trans('SupplierCategory'); ?></td>
117  <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
118 </tr>
119  <?php
120  }
121 }
122 
123 if (isModEnabled('barcode')) { ?>
124 <tr>
125  <td><?php echo $langs->trans('Gencod'); ?></td>
126  <td colspan="3"><input type="text" name="barcode" value="<?php echo $this->control->tpl['barcode']; ?>"></td>
127 </tr>
128 <?php } ?>
129 
130 <tr>
131  <td class="tdtop"><?php echo $langs->trans('Address'); ?></td>
132  <td colspan="3"><textarea name="adress" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
133 </tr>
134 
135 <tr>
136  <td><?php echo $langs->trans('Zip'); ?></td>
137  <td><?php echo $this->control->tpl['select_zip']; ?></td>
138  <td><?php echo $langs->trans('Town'); ?></td>
139  <td><?php echo $this->control->tpl['select_town']; ?></td>
140 </tr>
141 
142 <tr>
143  <td width="25%"><?php echo $langs->trans('Country'); ?></td>
144  <td colspan="3"><?php echo $this->control->tpl['select_country']; echo $this->control->tpl['info_admin']; ?></td>
145 </tr>
146 
147 <tr>
148  <td><?php echo $langs->trans('State'); ?></td>
149  <td colspan="3"><?php echo $this->control->tpl['select_state']; ?></td>
150 </tr>
151 
152 <tr>
153  <td><?php echo $langs->trans('Phone'); ?></td>
154  <td><input type="text" name="phone" value="<?php echo $this->control->tpl['phone']; ?>"></td>
155  <td><?php echo $langs->trans('Fax'); ?></td>
156  <td><input type="text" name="fax" value="<?php echo $this->control->tpl['fax']; ?>"></td>
157 </tr>
158 
159 <tr>
160  <td><?php echo $langs->trans('EMail').($conf->global->SOCIETE_EMAIL_MANDATORY ? '*' : ''); ?></td>
161  <td><input type="text" name="email" size="32" value="<?php echo $this->control->tpl['email']; ?>"></td>
162  <td><?php echo $langs->trans('Web'); ?></td>
163  <td><input type="text" name="url" size="32" value="<?php echo $this->control->tpl['url']; ?>"></td>
164 </tr>
165 
166 <?php
167 for ($i = 1; $i <= 4; $i++) {
168  if ($this->control->tpl['langprofid'.$i] != '-') {
169  if ($i == 1 || $i == 3) {
170  echo '<tr>';
171  }
172  echo '<td>'.$this->control->tpl['langprofid'.$i].'</td>';
173  echo '<td>'.$this->control->tpl['showprofid'.$i].'</td>';
174  if ($i == 2 || $i == 4) {
175  echo '</tr>';
176  }
177  } else {
178  if ($i == 1 || $i == 3) {
179  echo '<tr>';
180  }
181  echo '<td>&nbsp;</td>';
182  echo '<td>&nbsp;</td>';
183  if ($i == 2 || $i == 4) {
184  echo '</tr>';
185  }
186  }
187 }
188 ?>
189 
190 <tr>
191  <td><?php echo $langs->trans('VATIsUsed'); ?></td>
192  <td><?php echo $this->control->tpl['yn_assujtva']; ?></td>
193  <td class="nowrap"><?php echo $langs->trans('VATIntra'); ?></td>
194  <td class="nowrap"><?php echo $this->control->tpl['tva_intra']; ?></td>
195 </tr>
196 
197 <tr>
198  <td><?php echo $langs->trans('Capital'); ?></td>
199  <td colspan="3"><input type="text" name="capital" size="10" value="<?php echo $this->control->tpl['capital']; ?>"> <?php echo $langs->trans("Currency".$conf->currency); ?></td>
200 </tr>
201 
202 <tr>
203  <td><?php echo $langs->trans('JuridicalStatus'); ?></td>
204  <td colspan="3"><?php echo $this->control->tpl['select_juridicalstatus']; ?></td>
205 </tr>
206 
207 <tr>
208  <td><?php echo $langs->trans("ThirdPartyType"); ?></td>
209  <td><?php echo $this->control->tpl['select_companytype']; echo $this->control->tpl['info_admin']; ?></td>
210  <td><?php echo $langs->trans("Staff"); ?></td>
211  <td><?php echo $this->control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?></td>
212 </tr>
213 
214 <?php if (getDolGlobalInt('MAIN_MULTILANGS')) { ?>
215 <tr>
216  <td><?php echo $langs->trans("DefaultLang"); ?></td>
217  <td colspan="3"><?php echo $this->control->tpl['select_lang']; ?></td>
218 </tr>
219 <?php }
220 
221 if (!empty($this->control->tpl['localtax'])) {
222  echo $this->control->tpl['localtax'];
223 } ?>
224 
225 </table>
226 <br>
227 
228 <div class="center">
229 <input type="submit" class="button button-save" name="save" value="<?php echo $langs->trans("Save"); ?>">
230 &nbsp; &nbsp;
231 <input type="submit" class="button button-cancel" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
232 </div>
233 
234 </form>
235 
236 <!-- END PHP TEMPLATE -->
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
isModEnabled($module)
Is Dolibarr module enabled.
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