* Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2011-2016 Juanjo Menent รน * Copyright (C) 2015 Claudio Aschieri * * 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 3 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, see . */ /** * \file htdocs/admin/confexped.php * \ingroup produit * \brief Page to setup sending module */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'sendings', 'deliveries')); if (!$user->admin) accessforbidden(); $action=GETPOST('action','alpha'); /* * Actions */ // Shipment note if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { // This option should always be set to on when module is on. dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); } /* if ($action == 'activate_sending') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); header("Location: confexped.php"); exit; } if ($action == 'disable_sending') { dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity); header("Location: confexped.php"); exit; } */ // Delivery note if ($action == 'activate_delivery') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); // We must also enable this dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1",'chaine',0,'',$conf->entity); header("Location: confexped.php"); exit; } else if ($action == 'disable_delivery') { dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity); header("Location: confexped.php"); exit; } /* * View */ $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/"; $form=new Form($db); llxHeader("",$langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); print '
'; $head = expedition_admin_prepare_head(); dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending'); // Miscellaneous parameters print ''; print ''; print ''; print ''; print ''; print ''."\n"; // expedition activation/desactivation print ""; print ''; print ''; print '"; print ''; // Bon de livraison activation/desactivation print ''; print ''; print ''; print '"; print ''; print '
'.$langs->trans("Feature").' '.$langs->trans("Status").'
'.$langs->trans("SendingsAbility").''; print ''; print $langs->trans("Required"); /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; }*/ print "
'; print $langs->trans("DeliveriesOrderAbility"); print '
'.info_admin($langs->trans("NoNeedForDeliveryReceipts"), 0, 1); print '
'; print ''; if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } print "
'; print ''; llxFooter(); $db->close();