* * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/admin/dons.php * \ingroup dons * \brief Page d'administration/configuration du module Dons * \version $Id$ */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php"); $langs->load("admin"); $langs->load("donations"); if (!$user->admin) accessforbidden(); $typeconst=array('yesno','texte','chaine'); /* * Action */ if ($_GET["action"] == 'specimen') { $modele=$_GET["module"]; $don = new Don($db); $don->initAsSpecimen(); // Charge le modele $dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/"; $file = $modele.".modules.php"; if (file_exists($dir.$file)) { $classname = $modele; require_once($dir.$file); $obj = new $classname($db); if ($obj->write_file($don,$langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=donation&file=SPECIMEN.html"); return; } else { $mesg='
| '.$langs->trans("Name").' | '; print ''.$langs->trans("Description").' | '; print ''.$langs->trans("Activated").' | '; print ''.$langs->trans("Default").' | '; print ''.$langs->trans("Infos").' | '; print "|||
| '; echo $module->name; print ' | '; print ''; print $module->description; print ' | '; // Active if (in_array($name, $def)) { print "\n"; if ($conf->global->DON_ADDON_MODEL == $name) { print img_picto($langs->trans("Enabled"),'on'); } else { print ' '; print ' | '; print ''.img_picto($langs->trans("Enabled"),'on').''; } print ' | '; } else { print "\n"; print ''.img_picto($langs->trans("Disabled"),'off').''; print " | "; } // Defaut print ""; if ($conf->global->DON_ADDON_MODEL == "$name") { print img_picto($langs->trans("Default"),'on'); } else { print ''.img_picto($langs->trans("Disabled"),'off').''; } print ' | '; // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.=''; print $html->textwithpicto('',$htmltooltip,1,0); print ' | '; print ''; print ''.img_object($langs->trans("Preview"),'generic').''; print ' | '; print "