dolibarr 24.0.0-beta
subcontractors.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
3 * Copyright (C) 2024-2025 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
25// Load Dolibarr environment
26require '../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
40
41$action = GETPOST('action', 'aZ09');
42$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'adminsubcontractors'; // To manage different context of search
43
44// Load translation files required by the page
45$langs->loadLangs(array('admin', 'companies'));
46
47if (!$user->admin) {
49}
50
51$object = new stdClass();
52
53
54/*
55 * Actions
56 */
57
58$parameters = array();
59$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
60if ($reshook < 0) {
61 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
62}
63
64if (($action == 'update' && !GETPOST("cancel", 'alpha')) || ($action == 'updateedit')) {
65 $error = 0;
66
67 // Test the idprof1 and 2 of accountant
68 // Not required
69
70 // Test the idprof1 and 2 of IT supplier
71 $country_code_itprovider_array = getCountry(GETPOSTINT('itprovider_country_id'), 'all', $db, $langs, 0);
72 $country_code_itprovider = $country_code_itprovider_array['code'];
73 $tmpthirdparty = new Societe($db);
74 $tmpthirdparty->country_code = $country_code_itprovider;
75 $tmpthirdparty->country_id = getCountry($country_code_itprovider, '3', $db, $langs, 0);
76 $tmpthirdparty->idprof1 = GETPOST("itprovider_idprof1");
77 $tmpthirdparty->idprof2 = GETPOST("itprovider_idprof2");
78
79 if ($mysoc->country_code == 'FR') {
80 if (empty($tmpthirdparty->country_code)) {
81 $langs->loadLangs(array("errors", "companies"));
82 setEventMessages($langs->trans("ErrorBadValueForParameter", $tmpthirdparty->country_code, $langs->trans("Country")), null, 'errors');
83 $error++;
84 }
85 if ($tmpthirdparty->idprof1 && isValidProfIds(1, $tmpthirdparty) <= 0) {
86 $langs->loadLangs(array("errors", "companies"));
87 setEventMessages($langs->trans("ErrorBadValueForParameter", $tmpthirdparty->idprof1, $langs->transcountry("ProfId1Short", $tmpthirdparty->country_code)), null, 'errors');
88 $error++;
89 }
90 if ($tmpthirdparty->idprof2 && isValidProfIds(2, $tmpthirdparty) <= 0) {
91 $langs->loadLangs(array("errors", "companies"));
92 setEventMessages($langs->trans("ErrorBadValueForParameter", $tmpthirdparty->idprof2, $langs->transcountry("ProfId2Short", $tmpthirdparty->country_code)), null, 'errors');
93 $error++;
94 }
95 }
96
97 if (!$error) {
98 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
99 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
100 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
101 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
102 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOSTINT("state_id"), 'chaine', 0, '', $conf->entity);
103 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
104 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOSTINT('country_id'), 'chaine', 0, '', $conf->entity);
105 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
106 //dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
107 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
108 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
109 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_IDPROF1", GETPOST("idprof1", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
110 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_IDPROF2", GETPOST("idprof2", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
111 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
112 dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity);
113
114 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_NAME", GETPOST("itprovider_nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
115 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_ADDRESS", GETPOST("itprovider_address", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
116 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_TOWN", GETPOST("itprovider_town", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
117 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_ZIP", GETPOST("itprovider_zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
118 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_STATE", GETPOSTINT("itprovider_state_id"), 'chaine', 0, '', $conf->entity);
119 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_REGION", GETPOST("itprovider_region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
120 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_COUNTRY", GETPOSTINT('itprovider_country_id'), 'chaine', 0, '', $conf->entity);
121 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_PHONE", GETPOST("itprovider_phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
122 //dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_FAX", GETPOST("itprovider_fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
123 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_MAIL", GETPOST("itprovider_mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
124 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_WEB", GETPOST("itprovider_web", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
125 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_IDPROF1", GETPOST("itprovider_idprof1", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
126 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_IDPROF2", GETPOST("itprovider_idprof2", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
127 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_CODE", GETPOST("itprovider_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
128 dolibarr_set_const($db, "MAIN_INFO_ITPROVIDER_NOTE", GETPOST("itprovider_note", 'restricthtml'), 'chaine', 0, '', $conf->entity);
129
130 if ($action != 'updateedit') {
131 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
132 }
133 }
134}
135
136
137/*
138 * View
139 */
140
141$help_url = '';
142llxHeader('', $langs->trans("CompanyFoundation"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-subcontractors');
143
144print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
145
147
148print dol_get_fiche_head($head, 'subcontractors', '', -1, '');
149
150$form = new Form($db);
151$formother = new FormOther($db);
152$formcompany = new FormCompany($db);
153
154$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
155
156print '<span class="opacitymedium">'.$langs->trans("SubcontractorsDesc")."</span><br>\n";
157print "<br><br>\n";
158
162if (!empty($conf->use_javascript_ajax)) {
163 print "\n".'<script type="text/javascript">';
164 print '$(document).ready(function () {
165 $("#selectcountry_id").change(function() {
166 console.log("selectcountry_id change");
167 document.form_index.action.value="updateedit";
168 document.form_index.submit();
169 });
170 $("#selectitprovider_country_id").change(function() {
171 console.log("selectitprovider_country_id change");
172 document.form_index.action.value="updateedit";
173 document.form_index.submit();
174 });
175 });';
176 print '</script>'."\n";
177}
178
179print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" name="form_index">';
180print '<input type="hidden" name="token" value="'.newToken().'">';
181print '<input type="hidden" name="action" value="update">';
182print '<input type="hidden" name="page_y" value="">';
183
184print load_fiche_titre($langs->trans("AccountingProvider"), '', 'accounting', 0, '', '', '', '');
185
186print '<table class="noborder centpercent editmode">';
187print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
188
189// Name of Accountant Company
190print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
191print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag(GETPOSTISSET('nom') ? GETPOST('nom', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_NAME')).'"'.(!getDolGlobalString('MAIN_INFO_ACCOUNTANT_NAME') ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
192
193// Address
194print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
195print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_2.'">';
196print dolPrintText(GETPOSTISSET('address') ? GETPOST('address', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_ADDRESS'));
197print '</textarea></td></tr>'."\n";
198
199// ZIP
200print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
201print '<input class="width100" name="zipcode" id="zipcode" value="'.dol_escape_htmltag(GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_ZIP')).'"></td></tr>'."\n";
202
203// Town/City
204print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
205print '<input name="town" class="minwidth100" id="town" value="'.dol_escape_htmltag(GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_TOWN')).'"></td></tr>'."\n";
206
207// Country
208print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
209print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
210print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id');
211print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
212print '</td></tr>'."\n";
213
214// State
215print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
216print img_picto('', 'state', 'class="pictofixedwidth"');
217print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'state_id');
218print '</td></tr>'."\n";
219
220// Telephone
221print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
222print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth');
223print '<input name="phone" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('phone') ? GETPOST('phone', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_PHONE')).'"></td></tr>';
224print '</td></tr>'."\n";
225
226// Fax
227/*
228print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
229print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth');
230print '<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_FAX')).'"></td></tr>';
231print '</td></tr>'."\n";
232*/
233
234// eMail
235print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
236print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth');
237print '<input name="mail" id="email" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_MAIL')).'"></td></tr>';
238print '</td></tr>'."\n";
239
240// Web
241print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
242print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth');
243print '<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_WEB')).'"></td></tr>';
244print '</td></tr>'."\n";
245
246// Id prof 1
247print '<tr class="oddeven"><td><label for="idprof1">'.$langs->transcountry("ProfId1", $mysoc->country_code).'</label></td><td>';
248print '<input name="idprof1" id="idprof1" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('idprof1') ? GETPOST('idprof1', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_IDPROF1')).'"></td></tr>'."\n";
249
250// Id prof 2
251print '<tr class="oddeven"><td><label for="idprof2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>';
252print '<input name="idprof2" id="idprof2" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('idprof2') ? GETPOST('idprof2', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_IDPROF2')).'"></td></tr>'."\n";
253
254// Accountancy code
255print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
256print '<input name="code" id="code" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('code') ? GETPOST('code', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE')).'"></td></tr>'."\n";
257
258// Note
259print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
260print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_2.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_NOTE')).'</textarea></td></tr>';
261print '</td></tr>';
262
263print '</table>';
264
265print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition');
266
267print '<br>';
268
269
270// IT service provider
271
272print load_fiche_titre($langs->trans("ITProvider"), '', 'hdd', 0, '', '', '', '');
273
274print '<table class="noborder centpercent editmode">';
275print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
276
277// Name of Accountant Company
278print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
279print '<input name="itprovider_nom" id="itprovider_name" class="minwidth200" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_nom') ? GETPOST('itprovider_nom', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_NAME')).'"></td></tr>'."\n";
280
281// Address
282print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
283print '<textarea name="itprovider_address" id="itprovider_address" class="quatrevingtpercent" rows="'.ROWS_2.'">';
284print dolPrintText(GETPOSTISSET('itprovider_address') ? GETPOST('itprovider_address', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_ADDRESS'));
285print '</textarea></td></tr>'."\n";
286
287// ZIP
288print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
289print '<input class="width100" name="itprovider_zipcode" id="itprovider_zipcode" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_zipcode') ? GETPOST('itprovider_zipcode', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_ZIP')).'"></td></tr>'."\n";
290
291// Town/City
292print '<tr class="oddeven"><td><label for="itprovider_town">'.$langs->trans("CompanyTown").'</label></td><td>';
293print '<input name="itprovider_town" class="minwidth100" id="itprovider_town" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_town') ? GETPOST('itprovider_town', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_TOWN')).'"></td></tr>'."\n";
294
295// Country
296print '<tr class="oddeven"><td><label for="selectitprovider_country_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
297print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
298print $form->select_country((GETPOSTISSET('itprovider_country_id') ? GETPOSTINT('itprovider_country_id') : getDolGlobalString('MAIN_INFO_ITPROVIDER_COUNTRY')), 'itprovider_country_id');
299print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
300print '</td></tr>'."\n";
301
302// State
303print '<tr class="oddeven"><td><label for="itprovider_state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
304print img_picto('', 'state', 'class="pictofixedwidth"');
305print $formcompany->select_state((GETPOSTISSET('itprovider_state_id') ? GETPOSTINT('itprovider_state_id') : getDolGlobalString('MAIN_INFO_ITPROVIDER_STATE')), (GETPOSTISSET('itprovider_country_id') ? GETPOSTINT('itprovider_country_id') : getDolGlobalString('MAIN_INFO_ITPROVIDER_COUNTRY')), 'itprovider_state_id');
306print '</td></tr>'."\n";
307
308// Telephone
309print '<tr class="oddeven"><td><label for="itprovider_phone">'.$langs->trans("Phone").'</label></td><td>';
310print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth');
311print '<input name="itprovider_phone" id="itprovider_phone" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_phone') ? GETPOST('itprovider_phone', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_PHONE')).'"></td></tr>';
312print '</td></tr>'."\n";
313
314// Fax
315/*
316print '<tr class="oddeven"><td><label for="itprovider_fax">'.$langs->trans("Fax").'</label></td><td>';
317print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth');
318print '<input name="itprovider_fax" id="itprovider_fax" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_fax') ? GETPOST('itprovider_fax', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_FAX')).'"></td></tr>';
319print '</td></tr>'."\n";
320*/
321
322// eMail
323print '<tr class="oddeven"><td><label for="itprovider_email">'.$langs->trans("EMail").'</label></td><td>';
324print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth');
325print '<input name="itprovider_mail" id="itprovider_email" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_mail') ? GETPOST('itprovider_mail', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_MAIL')).'"></td></tr>';
326print '</td></tr>'."\n";
327
328// Web
329print '<tr class="oddeven"><td><label for="itprovider_web">'.$langs->trans("Web").'</label></td><td>';
330print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth');
331print '<input name="itprovider_web" id="itprovider_web" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_web') ? GETPOST('itprovider_web', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_WEB')).'"></td></tr>';
332print '</td></tr>'."\n";
333
334// Prof ID 1
335print '<tr class="oddeven"><td><label for="itprovider_idprof1">'.$langs->transcountry("ProfId1", $mysoc->country_code).'</label></td><td>';
336print '<input name="itprovider_idprof1" id="itprovider_idprof1" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_idprof1') ? GETPOST('itprovider_idprof1', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_IDPROF1')).'"></td></tr>'."\n";
337
338// Prof ID 2
339print '<tr class="oddeven"><td><label for="itprovider_idprof2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>';
340print '<input name="itprovider_idprof2" id="itprovider_idprof2" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_idprof2') ? GETPOST('itprovider_idprof2', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_IDPROF2')).'"></td></tr>'."\n";
341
342// Accountancy code
343print '<tr class="oddeven"><td><label for="itprovider_code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
344print '<input name="itprovider_code" id="itprovider_code" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('itprovider_code') ? GETPOST('itprovider_code', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_CODE')).'"></td></tr>'."\n";
345
346// Note
347print '<tr class="oddeven"><td class="tdtop"><label for="itprovider_note">'.$langs->trans("Note").'</label></td><td>';
348print '<textarea class="flat quatrevingtpercent" name="itprovider_note" id="itprovider_note" rows="'.ROWS_2.'">'.(GETPOSTISSET('itprovider_note') ? GETPOST('itprovider_note', 'restricthtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_NOTE')).'</textarea></td></tr>';
349print '</td></tr>';
350
351print '</table>';
352
353print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition');
354
355print '</form>';
356
357
358llxFooter();
359
360$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
company_admin_prepare_head()
Return array head with list of tabs to view object information.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
Class to help generate other html components Only common components are here.
Class to manage third parties objects (customers, suppliers, prospects...)
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
global $mysoc
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolPrintText($s)
Return a string label (possible on several lines and that should not contains any HTML) ready to be o...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isValidProfIds($idprof, $thirdparty, $lenghtonly=0)
Check the validity of a professional identifier according to the properties (country) of the company ...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.