diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index b6d526bf8e1..1a9aa1c0476 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -194,6 +194,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install +%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 32c6e50018e..b14e3d107f4 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -274,6 +274,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install +%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index dbb8e0d1310..91d36e77bd7 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -191,6 +191,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install +%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index aa810a737b9..a4adb450219 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -202,6 +202,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install +%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan diff --git a/htdocs/core/modules/modIntracommreport.class.php b/htdocs/core/modules/modIntracommreport.class.php index e7d5a704a67..6d2d4171a77 100644 --- a/htdocs/core/modules/modIntracommreport.class.php +++ b/htdocs/core/modules/modIntracommreport.class.php @@ -59,7 +59,7 @@ class modIntracommreport extends DolibarrModules $this->dirs = array('/intracommreport/temp'); // Config pages - $this->config_page_url = array("intracommreport.php"); + $this->config_page_url = array("intracommreport.php@intracommreport"); // Dependencies $this->depends = array("modFacture","modTax"); // List of modules id that must be enabled if this module is enabled @@ -201,46 +201,4 @@ class modIntracommreport extends DolibarrModules $r=1; } - - /** - * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. - * It also creates data directories - * - * @param string $options Options when enabling module ('', 'noboxes') - * @return int 1 if OK, 0 if KO - */ - function init($options='') - { - global $db; - - $sql = array(); - - define('INC_FROM_DOLIBARR',true); - - dol_include_once('/intracommreport/config.php'); - dol_include_once('/intracommreport/script/create-maj-base.php'); - - $result=$this->_load_tables('/intracommreport/sql/'); - - $TModesTransport = array( - 'options'=>array( - 1=>'Transport maritime (y compris camions ou wagons sur bateau)' - ,2=>'Transport par chemin de fer (y compris camions sur wagon)' - ,3=>'Transport par route' - ,4=>'Transport par air' - ,5=>'Envois postaux' - ,7=>'Installations de transport fixe (oléoduc)' - ,8=>'Transport par navigation intérieure' - ,9=>'Propulsion propre' - ) - ); - - $e = new ExtraFields($db); - $e->addExtraField('mode_transport', 'Mode de transport', 'select', '', '', 'facture', 0, 0, '', $TModesTransport); - $e->addExtraField('mode_transport', 'Mode de transport', 'select', '', '', 'facture_fourn', 0, 0, '', $TModesTransport); - - return $this->_init($sql, $options); - } - } diff --git a/htdocs/intracommreport/admin/intracommreport.php b/htdocs/intracommreport/admin/intracommreport.php index 7d733886ecb..68531304206 100644 --- a/htdocs/intracommreport/admin/intracommreport.php +++ b/htdocs/intracommreport/admin/intracommreport.php @@ -32,16 +32,54 @@ $langs->loadLangs(array("admin","intracommreport")); if (! $user->admin) accessforbidden(); -$action=__get('action',''); +$action = GETPOST('action', 'aZ09'); -if($action=='save') { - - foreach($_REQUEST['TParamProDeb'] as $name=>$param) { - - dolibarr_set_const($db, $name, $param); +// Parameters ACCOUNTING_* and others +$list_DEB = array ( + 'INTRACOMMREPORT_NUM_AGREMENT', +); - } - +$list_DES = array ( + 'INTRACOMMREPORT_NUM_DECLARATION', +); + +if ($action == 'update') { + $error = 0; + + if (! $error) + { + foreach ($list_DEB as $constname) + { + $constvalue = GETPOST($constname, 'alpha'); + + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + + foreach ($list_DES as $constname) + { + $constvalue = GETPOST($constname, 'alpha'); + + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { + $error++; + } + } + + dolibarr_set_const($db, "INTRACOMMREPORT_TYPE_ACTEUR", GETPOST("INTRACOMMREPORT_TYPE_ACTEUR", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INTRACOMMREPORT_ROLE_ACTEUR", GETPOST("INTRACOMMREPORT_ROLE_ACTEUR", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION", GETPOST("INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION", GETPOST("INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INTRACOMMREPORT_CATEG_FRAISDEPORT", GETPOST("INTRACOMMREPORT_CATEG_FRAISDEPORT", 'alpha'), 'chaine', 0, '', $conf->entity); + + if ($error) { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } + + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } } /* @@ -51,7 +89,7 @@ if($action=='save') { $form=new Form($db); $formother=new FormOther($db); -llxHeader('', $langs->trans(IntracommReportSetup)); +llxHeader('', $langs->trans("IntracommReportSetup")); $linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($langs->trans("IntracommReportSetup"), $linkback, 'title_setup'); @@ -60,9 +98,9 @@ $head = intracommReportAdminPrepareHead(); dol_fiche_head($head, 'general', $langs->trans("IntracommReport"), 0, "intracommreport"); -print '
'; - -print '