29require
'../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/intracommreport/lib/intracommreport.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
43$langs->loadLangs(array(
"admin",
"intracommreport"));
51$action =
GETPOST(
'action',
'aZ09');
55 'INTRACOMMREPORT_NUM_AGREMENT',
59 'INTRACOMMREPORT_NUM_DECLARATION',
62if ($action ==
'update') {
66 foreach ($list_DEB as $constname) {
67 $constvalue =
GETPOST($constname,
'alpha');
69 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
74 foreach ($list_DES as $constname) {
75 $constvalue =
GETPOST($constname,
'alpha');
77 if (!
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0,
'', $conf->entity)) {
82 dolibarr_set_const($db,
"INTRACOMMREPORT_TYPE_ACTEUR",
GETPOST(
"INTRACOMMREPORT_TYPE_ACTEUR",
'alpha'),
'chaine', 0,
'', $conf->entity);
83 dolibarr_set_const($db,
"INTRACOMMREPORT_ROLE_ACTEUR",
GETPOST(
"INTRACOMMREPORT_ROLE_ACTEUR",
'alpha'),
'chaine', 0,
'', $conf->entity);
84 dolibarr_set_const($db,
"INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION",
GETPOST(
"INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION",
'alpha'),
'chaine', 0,
'', $conf->entity);
85 dolibarr_set_const($db,
"INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION",
GETPOST(
"INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION",
'alpha'),
'chaine', 0,
'', $conf->entity);
86 dolibarr_set_const($db,
"INTRACOMMREPORT_CATEG_FRAISDEPORT",
GETPOST(
"INTRACOMMREPORT_CATEG_FRAISDEPORT",
'alpha'),
'chaine', 0,
'', $conf->entity);
103$form =
new Form($db);
106llxHeader(
'', $langs->trans(
"IntracommReportSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-intracommreport page-admin_intracommreport');
108$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
109print
load_fiche_titre($langs->trans(
"IntracommReportSetup"), $linkback,
'title_setup');
113print
dol_get_fiche_head($head,
'general', $langs->trans(
"IntracommReport"), -1,
"intracommreport");
115print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
116print
'<input type="hidden" name="token" value="'.newToken().
'">';
117print
'<input type="hidden" name="action" value="update">';
121print
'<table class="noborder" width="100%">';
122print
'<tr class="liste_titre">';
123print
'<td>'.$langs->trans(
"Description").
'</td>';
124print
'<td>'.$langs->trans(
"Value").
'</td>';
127foreach ($list_DEB as $key) {
128 print
'<tr class="oddeven value">';
131 $label = $langs->trans($key);
132 print
'<td>'.$label.
'</td>';
134 print
'<td class="left">';
135 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
141print
'<tr class="oddeven">';
142print
'<td>'.$langs->trans(
"INTRACOMMREPORT_TYPE_ACTEUR").
'</td>';
143$arraychoices = array(
'' => $langs->trans(
"None"),
'PSI' =>
'Déclarant pour son compte',
'TDP' =>
'Tiers déclarant');
145print $form->selectarray(
'INTRACOMMREPORT_TYPE_ACTEUR', $arraychoices,
getDolGlobalString(
'INTRACOMMREPORT_TYPE_ACTEUR'), 0);
149print
'<tr class="oddeven">';
150print
'<td>'.$langs->trans(
"INTRACOMMREPORT_ROLE_ACTEUR").
'</td>';
151$arraychoices = array(
'' => $langs->trans(
"None"),
'sender' =>
'Emetteur',
'PSI' =>
'Déclarant');
153print $form->selectarray(
'INTRACOMMREPORT_ROLE_ACTEUR', $arraychoices,
getDolGlobalString(
'INTRACOMMREPORT_ROLE_ACTEUR'), 0);
157print
'<tr class="oddeven">';
158print
'<td>'.$langs->trans(
"INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION").
'</td>';
159$arraychoices = array(1 =>
'Seuil de 460 000 €', 2 =>
'En dessous de 460 000 €');
161print $form->selectarray(
'INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION', $arraychoices,
getDolGlobalString(
'INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION'), 0);
165print
'<tr class="oddeven">';
166print
'<td>'.$langs->trans(
"INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION").
'</td>';
167$arraychoices = array(3 =>
'Seuil de 460 000 €', 4 =>
'En dessous de 460 000 €');
169print $form->selectarray(
'INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION', $arraychoices,
getDolGlobalString(
'INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION'), 0);
173print
'<tr class="oddeven">';
174print
'<td>'.$langs->trans(
"INTRACOMMREPORT_CATEG_FRAISDEPORT").
'</td>';
176print $formother->select_categories(
'product',
getDolGlobalInt(
'INTRACOMMREPORT_CATEG_FRAISDEPORT'),
'INTRACOMMREPORT_CATEG_FRAISDEPORT');
185print
'<table class="noborder" width="100%">';
186print
'<tr class="liste_titre">';
187print
'<td>'.$langs->trans(
"Description").
'</td>';
188print
'<td>'.$langs->trans(
"Value").
'</td>';
191foreach ($list_DES as $key) {
192 print
'<tr class="oddeven value">';
195 $label = $langs->trans($key);
196 print
'<td>'.$label.
'</td>';
198 print
'<td class="left">';
199 print
'<input type="text" class="maxwidth100" id="'.$key.
'" name="'.$key.
'" value="'.
getDolGlobalString($key).
'">';
207print
'<div class="center">';
208print
'<input type="submit" name="bt_save" class="butAction button-save" value="'.$langs->trans(
"Update").
'" />';
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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
intracommreportAdminPrepareHead()
Prepare admin pages header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.