diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 708acf6bc86..023593ea2a7 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,42 +67,7 @@ if ($action == 'updateMask') } } -if ($action == 'set_FICHINTER_FREE_TEXT') -{ - $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'set_FICHINTER_DRAFT_WATERMARK') -{ - $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); - - $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'specimen') +else if ($action == 'specimen') // For fiche inter { $modele= GETPOST('module','alpha'); @@ -147,12 +112,13 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -161,7 +127,8 @@ if ($action == 'del') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { @@ -178,7 +145,7 @@ if ($action == 'setdoc') } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -186,6 +153,41 @@ if ($action == 'setmod') dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity); } +else if ($action == 'set_FICHINTER_FREE_TEXT') +{ + $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha'); + $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + +else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') +{ + $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); + + $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + /* * View @@ -202,6 +204,17 @@ print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup'); print "
"; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/fichinter.php"; +$head[$h][1] = $langs->trans("Interventions"); +$head[$h][2] = 'Ficheinter'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +// Interventions numbering model print_titre($langs->trans("FicheinterNumberingModules")); @@ -234,22 +247,22 @@ foreach ($dirmodels as $reldir) $file = $reg[1]; $classname = substr($file,4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/fichinter/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print ''.$module->nom."\n"; print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -295,6 +308,9 @@ foreach ($dirmodels as $reldir) print '
'; +/* + * Documents models for Interventions + */ print_titre($langs->trans("TemplatePDFInterventions")); @@ -377,7 +393,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ""; if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { @@ -413,11 +429,14 @@ foreach ($dirmodels as $reldir) } print ''; - -//Autres Options print "
"; -print_titre($langs->trans("OtherOptions")); +/* + * Other options + * + */ + +print_titre($langs->trans("OtherOptions")); print ''; print ''; print '';
'.$langs->trans("Parameter").'