25require
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
32$action =
GETPOST(
'action',
'aZ09');
33$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'adminaccoutant';
36$langs->loadLangs(array(
'admin',
'companies'));
50$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
55if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))
56|| ($action ==
'updateedit')) {
58 dolibarr_set_const($db,
"MAIN_INFO_ACCOUNTANT_ADDRESS",
GETPOST(
"address",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
62 dolibarr_set_const($db,
"MAIN_INFO_ACCOUNTANT_REGION",
GETPOST(
"region_code",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
71 if ($action !=
'updateedit' && !$error) {
73 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
84llxHeader(
'', $langs->trans(
"CompanyFoundation"), $help_url);
86print
load_fiche_titre($langs->trans(
"CompanyFoundation"),
'',
'title_setup');
96$countrynotdefined =
'<span class="error">'.$langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')</span>';
98print
'<span class="opacitymedium">'.$langs->trans(
"AccountantDesc").
"</span><br>\n";
104if (!empty($conf->use_javascript_ajax)) {
105 print
"\n".
'<script type="text/javascript">';
106 print
'$(document).ready(function () {
107 $("#selectcountry_id").change(function() {
108 document.form_index.action.value="updateedit";
109 document.form_index.submit();
112 print
'</script>'.
"\n";
115print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="form_index">';
116print
'<input type="hidden" name="token" value="'.newToken().
'">';
117print
'<input type="hidden" name="action" value="update">';
119print
'<table class="noborder centpercent editmode">';
120print
'<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans(
"CompanyInfo").
'</th><th>'.$langs->trans(
"Value").
'</th></tr>'.
"\n";
123print
'<tr class="oddeven"><td><label for="name">'.$langs->trans(
"CompanyName").
'</label></td><td>';
124print
'<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag(GETPOSTISSET(
'nom') ?
GETPOST(
'nom',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_NAME) ? $conf->global->MAIN_INFO_ACCOUNTANT_NAME :
'')).
'"'.(empty($conf->global->MAIN_INFO_ACCOUNTANT_NAME) ?
' autofocus="autofocus"' :
'').
'></td></tr>'.
"\n";
127print
'<tr class="oddeven"><td><label for="address">'.$langs->trans(
"CompanyAddress").
'</label></td><td>';
128print
'<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.
dol_escape_htmltag(GETPOSTISSET(
'address') ?
GETPOST(
'address',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) ? $conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS :
'')).
'</textarea></td></tr>'.
"\n";
131print
'<tr class="oddeven"><td><label for="zipcode">'.$langs->trans(
"CompanyZip").
'</label></td><td>';
132print
'<input class="minwidth100" name="zipcode" id="zipcode" value="'.dol_escape_htmltag(GETPOSTISSET(
'zipcode') ?
GETPOST(
'zipcode',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP) ? $conf->global->MAIN_INFO_ACCOUNTANT_ZIP :
'')).
'"></td></tr>'.
"\n";
135print
'<tr class="oddeven"><td><label for="town">'.$langs->trans(
"CompanyTown").
'</label></td><td>';
136print
'<input name="town" class="minwidth100" id="town" value="'.dol_escape_htmltag(GETPOSTISSET(
'town') ?
GETPOST(
'town',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN) ? $conf->global->MAIN_INFO_ACCOUNTANT_TOWN :
'')).
'"></td></tr>'.
"\n";
139print
'<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans(
"Country").
'</label></td><td class="maxwidthonsmartphone">';
140print
img_picto(
'',
'globe-americas',
'class="pictofixedwidth"');
141print $form->select_country((GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY :
'')),
'country_id');
143 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
145print
'</td></tr>'.
"\n";
148print
'<tr class="oddeven"><td><label for="state_id">'.$langs->trans(
"State").
'</label></td><td class="maxwidthonsmartphone">';
149print
img_picto(
'',
'state',
'class="pictofixedwidth"');
150print $formcompany->select_state((GETPOSTISSET(
'state_id') ?
GETPOST(
'state_id',
'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE :
'')), (GETPOSTISSET(
'country_id') ?
GETPOST(
'country_id',
'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY :
'')),
'state_id');
151print
'</td></tr>'.
"\n";
154print
'<tr class="oddeven"><td><label for="phone">'.$langs->trans(
"Phone").
'</label></td><td>';
155print
img_picto(
'',
'object_phoning',
'',
false, 0, 0,
'',
'pictofixedwidth');
156print
'<input name="tel" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET(
'tel') ?
GETPOST(
'tel',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE :
'')).
'"></td></tr>';
157print
'</td></tr>'.
"\n";
160print
'<tr class="oddeven"><td><label for="fax">'.$langs->trans(
"Fax").
'</label></td><td>';
161print
img_picto(
'',
'object_phoning_fax',
'',
false, 0, 0,
'',
'pictofixedwidth');
162print
'<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET(
'fax') ?
GETPOST(
'fax',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX :
'')).
'"></td></tr>';
163print
'</td></tr>'.
"\n";
166print
'<tr class="oddeven"><td><label for="email">'.$langs->trans(
"EMail").
'</label></td><td>';
167print
img_picto(
'',
'object_email',
'',
false, 0, 0,
'',
'pictofixedwidth');
168print
'<input name="mail" id="email" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET(
'mail') ?
GETPOST(
'mail',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL :
'')).
'"></td></tr>';
169print
'</td></tr>'.
"\n";
172print
'<tr class="oddeven"><td><label for="web">'.$langs->trans(
"Web").
'</label></td><td>';
173print
img_picto(
'',
'globe',
'',
false, 0, 0,
'',
'pictofixedwidth');
174print
'<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET(
'web') ?
GETPOST(
'web',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB :
'')).
'"></td></tr>';
175print
'</td></tr>'.
"\n";
178print
'<tr class="oddeven"><td><label for="code">'.$langs->trans(
"AccountantFileNumber").
'</label></td><td>';
179print
'<input name="code" id="code" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET(
'code') ?
GETPOST(
'code',
'alphanohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_CODE) ? $conf->global->MAIN_INFO_ACCOUNTANT_CODE :
'')).
'"></td></tr>'.
"\n";
182print
'<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans(
"Note").
'</label></td><td>';
183print
'<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.
'">'.(GETPOSTISSET(
'note') ?
GETPOST(
'note',
'restricthtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? $conf->global->MAIN_INFO_ACCOUNTANT_NOTE :
'')).
'</textarea></td></tr>';
188print $form->buttonsSaveCancel(
"Save",
'');
if(!empty($conf->use_javascript_ajax)) print $_SERVER["PHP_SELF"]
Edit parameters.
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 informations.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.