Go to the documentation of this file.
24 require
'../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31 $action =
GETPOST(
'action',
'aZ09');
32 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'adminaccoutant';
35 $langs->loadLangs(array(
'admin',
'companies'));
48 $parameters = array();
49 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
54 if (($action ==
'update' && !
GETPOST(
"cancel",
'alpha'))
55 || ($action ==
'updateedit')) {
57 dolibarr_set_const($db,
"MAIN_INFO_ACCOUNTANT_ADDRESS",
GETPOST(
"address",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
61 dolibarr_set_const($db,
"MAIN_INFO_ACCOUNTANT_REGION",
GETPOST(
"region_code",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
70 if ($action !=
'updateedit' && !$error) {
72 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
85 print
load_fiche_titre($langs->trans(
"CompanyFoundation"),
'',
'title_setup');
95 $countrynotdefined =
'<span class="error">'.$langs->trans(
"ErrorSetACountryFirst").
' ('.$langs->trans(
"SeeAbove").
')</span>';
97 print
'<span class="opacitymedium">'.$langs->trans(
"AccountantDesc").
"</span><br>\n";
103 if (!empty($conf->use_javascript_ajax)) {
104 print
"\n".
'<script type="text/javascript">';
105 print
'$(document).ready(function () {
106 $("#selectcountry_id").change(function() {
107 document.form_index.action.value="updateedit";
108 document.form_index.submit();
111 print
'</script>'.
"\n";
114 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'" name="form_index">';
115 print
'<input type="hidden" name="token" value="'.newToken().
'">';
116 print
'<input type="hidden" name="action" value="update">';
118 print
'<table class="noborder centpercent editmode">';
119 print
'<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans(
"CompanyInfo").
'</th><th>'.$langs->trans(
"Value").
'</th></tr>'.
"\n";
122 print
'<tr class="oddeven"><td><label for="name">'.$langs->trans(
"CompanyName").
'</label></td><td>';
123 print
'<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";
126 print
'<tr class="oddeven"><td><label for="address">'.$langs->trans(
"CompanyAddress").
'</label></td><td>';
127 print
'<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";
130 print
'<tr class="oddeven"><td><label for="zipcode">'.$langs->trans(
"CompanyZip").
'</label></td><td>';
131 print
'<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";
134 print
'<tr class="oddeven"><td><label for="town">'.$langs->trans(
"CompanyTown").
'</label></td><td>';
135 print
'<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";
138 print
'<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans(
"Country").
'</label></td><td class="maxwidthonsmartphone">';
139 print
img_picto(
'',
'globe-americas',
'class="pictofixedwidth"');
140 print
$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');
142 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
144 print
'</td></tr>'.
"\n";
147 print
'<tr class="oddeven"><td><label for="state_id">'.$langs->trans(
"State").
'</label></td><td class="maxwidthonsmartphone">';
148 print
img_picto(
'',
'state',
'class="pictofixedwidth"');
149 print $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');
150 print
'</td></tr>'.
"\n";
153 print
'<tr class="oddeven"><td><label for="phone">'.$langs->trans(
"Phone").
'</label></td><td>';
154 print
img_picto(
'',
'object_phoning',
'',
false, 0, 0,
'',
'pictofixedwidth');
155 print
'<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>';
156 print
'</td></tr>'.
"\n";
159 print
'<tr class="oddeven"><td><label for="fax">'.$langs->trans(
"Fax").
'</label></td><td>';
160 print
img_picto(
'',
'object_phoning_fax',
'',
false, 0, 0,
'',
'pictofixedwidth');
161 print
'<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>';
162 print
'</td></tr>'.
"\n";
165 print
'<tr class="oddeven"><td><label for="email">'.$langs->trans(
"EMail").
'</label></td><td>';
166 print
img_picto(
'',
'object_email',
'',
false, 0, 0,
'',
'pictofixedwidth');
167 print
'<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>';
168 print
'</td></tr>'.
"\n";
171 print
'<tr class="oddeven"><td><label for="web">'.$langs->trans(
"Web").
'</label></td><td>';
172 print
img_picto(
'',
'globe',
'',
false, 0, 0,
'',
'pictofixedwidth');
173 print
'<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>';
174 print
'</td></tr>'.
"\n";
177 print
'<tr class="oddeven"><td><label for="code">'.$langs->trans(
"AccountantFileNumber").
'</label></td><td>';
178 print
'<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";
181 print
'<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans(
"Note").
'</label></td><td>';
182 print
'<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>';
187 print
$form->buttonsSaveCancel(
"Save",
'');
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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='')
Show tabs of a record.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
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).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
if(!empty($conf->use_javascript_ajax)) print $_SERVER["PHP_SELF"]
Edit parameters.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
company_admin_prepare_head()
Return array head with list of tabs to view object informations.