dolibarr 25.0.0-alpha
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$formcompany = new FormCompany($db);
152
153
154print '<div class="info">'.$langs->trans("SubcontractorsDesc")."</div>\n";
155print "<br>\n";
156
160if (!empty($conf->use_javascript_ajax)) {
161 print "\n".'<script type="text/javascript">';
162 print '$(document).ready(function () {
163 $("#selectcountry_id").change(function() {
164 console.log("selectcountry_id change");
165 document.form_index.action.value="updateedit";
166 document.form_index.submit();
167 });
168 $("#selectitprovider_country_id").change(function() {
169 console.log("selectitprovider_country_id change");
170 document.form_index.action.value="updateedit";
171 document.form_index.submit();
172 });
173 });';
174 print '</script>'."\n";
175}
176
177print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" name="form_index">';
178print '<input type="hidden" name="token" value="'.newToken().'">';
179print '<input type="hidden" name="action" value="update">';
180print '<input type="hidden" name="page_y" value="">';
181
182print load_fiche_titre($langs->trans("AccountingProvider"), '', 'accounting', 0, '', '', '', '');
183
184print '<table class="noborder centpercent editmode">';
185print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
186
187// Name of Accountant Company
188print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
189print '<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";
190
191// Address
192print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
193print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_2.'">';
194print dolPrintText(GETPOSTISSET('address') ? GETPOST('address', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_ADDRESS'));
195print '</textarea></td></tr>'."\n";
196
197// ZIP
198print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
199print '<input class="width100" name="zipcode" id="zipcode" value="'.dol_escape_htmltag(GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_ZIP')).'"></td></tr>'."\n";
200
201// Town/City
202print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
203print '<input name="town" class="minwidth100" id="town" value="'.dol_escape_htmltag(GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_TOWN')).'"></td></tr>'."\n";
204
205// Country
206print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
207print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
208print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id');
209print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
210print '</td></tr>'."\n";
211
212// State
213print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
214print img_picto('', 'state', 'class="pictofixedwidth"');
215print $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');
216print '</td></tr>'."\n";
217
218// Telephone
219print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
220print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth');
221print '<input name="phone" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('phone') ? GETPOST('phone', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_PHONE')).'"></td></tr>';
222print '</td></tr>'."\n";
223
224// Fax
225/*
226print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
227print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth');
228print '<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_FAX')).'"></td></tr>';
229print '</td></tr>'."\n";
230*/
231
232// eMail
233print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
234print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth');
235print '<input name="mail" id="email" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_MAIL')).'"></td></tr>';
236print '</td></tr>'."\n";
237
238// Web
239print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
240print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth');
241print '<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_WEB')).'"></td></tr>';
242print '</td></tr>'."\n";
243
244// Id prof 1
245print '<tr class="oddeven"><td><label for="idprof1">'.$langs->transcountry("ProfId1", $mysoc->country_code).'</label></td><td>';
246print '<input name="idprof1" id="idprof1" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('idprof1') ? GETPOST('idprof1', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_IDPROF1')).'"></td></tr>'."\n";
247
248// Id prof 2
249print '<tr class="oddeven"><td><label for="idprof2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>';
250print '<input name="idprof2" id="idprof2" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('idprof2') ? GETPOST('idprof2', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_IDPROF2')).'"></td></tr>'."\n";
251
252// Accountancy code
253print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
254print '<input name="code" id="code" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('code') ? GETPOST('code', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE')).'"></td></tr>'."\n";
255
256// Note
257print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
258print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_2.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_NOTE')).'</textarea></td></tr>';
259print '</td></tr>';
260
261print '</table>';
262
263print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition');
264
265print '<br>';
266
267
268// IT service provider
269
270print load_fiche_titre($langs->trans("ITProvider"), '', 'hdd', 0, '', '', '', '');
271
272print '<table class="noborder centpercent editmode">';
273print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
274
275// Name of Accountant Company
276print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
277print '<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";
278
279// Address
280print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
281print '<textarea name="itprovider_address" id="itprovider_address" class="quatrevingtpercent" rows="'.ROWS_2.'">';
282print dolPrintText(GETPOSTISSET('itprovider_address') ? GETPOST('itprovider_address', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ITPROVIDER_ADDRESS'));
283print '</textarea></td></tr>'."\n";
284
285// ZIP
286print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
287print '<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";
288
289// Town/City
290print '<tr class="oddeven"><td><label for="itprovider_town">'.$langs->trans("CompanyTown").'</label></td><td>';
291print '<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";
292
293// Country
294print '<tr class="oddeven"><td><label for="selectitprovider_country_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
295print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
296print $form->select_country((GETPOSTISSET('itprovider_country_id') ? GETPOSTINT('itprovider_country_id') : getDolGlobalString('MAIN_INFO_ITPROVIDER_COUNTRY')), 'itprovider_country_id');
297print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
298print '</td></tr>'."\n";
299
300// State
301print '<tr class="oddeven"><td><label for="itprovider_state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
302print img_picto('', 'state', 'class="pictofixedwidth"');
303print $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');
304print '</td></tr>'."\n";
305
306// Telephone
307print '<tr class="oddeven"><td><label for="itprovider_phone">'.$langs->trans("Phone").'</label></td><td>';
308print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth');
309print '<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>';
310print '</td></tr>'."\n";
311
312// Fax
313/*
314print '<tr class="oddeven"><td><label for="itprovider_fax">'.$langs->trans("Fax").'</label></td><td>';
315print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth');
316print '<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>';
317print '</td></tr>'."\n";
318*/
319
320// eMail
321print '<tr class="oddeven"><td><label for="itprovider_email">'.$langs->trans("EMail").'</label></td><td>';
322print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth');
323print '<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>';
324print '</td></tr>'."\n";
325
326// Web
327print '<tr class="oddeven"><td><label for="itprovider_web">'.$langs->trans("Web").'</label></td><td>';
328print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth');
329print '<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>';
330print '</td></tr>'."\n";
331
332// Prof ID 1
333print '<tr class="oddeven"><td><label for="itprovider_idprof1">'.$langs->transcountry("ProfId1", $mysoc->country_code).'</label></td><td>';
334print '<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";
335
336// Prof ID 2
337print '<tr class="oddeven"><td><label for="itprovider_idprof2">'.$langs->transcountry("ProfId2", $mysoc->country_code).'</label></td><td>';
338print '<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";
339
340// Accountancy code
341print '<tr class="oddeven"><td><label for="itprovider_code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
342print '<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";
343
344// Note
345print '<tr class="oddeven"><td class="tdtop"><label for="itprovider_note">'.$langs->trans("Note").'</label></td><td>';
346print '<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>';
347print '</td></tr>';
348
349print '</table>';
350
351print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition');
352
353print '</form>';
354
355
356llxFooter();
357
358$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 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)
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
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.