From ddcd75e1f5f20b71ffc7362640dcf098ecc3b831 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 Oct 2008 22:29:54 +0000 Subject: [PATCH] Add cashdesk setup page --- htdocs/admin/cashdesk.php | 100 ++++++++++++++++++ htdocs/admin/syslog.php | 2 +- htdocs/cashdesk/langs/fr_FR/cashdesk.lang | 2 +- htdocs/includes/modules/modCashDesk.class.php | 5 +- htdocs/langs/en_US/admin.lang | 5 + htdocs/langs/fr_FR/admin.lang | 6 +- 6 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 htdocs/admin/cashdesk.php diff --git a/htdocs/admin/cashdesk.php b/htdocs/admin/cashdesk.php new file mode 100644 index 00000000000..25adbb6595e --- /dev/null +++ b/htdocs/admin/cashdesk.php @@ -0,0 +1,100 @@ + + * + * 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/cachdesk.php + * \ingroup cashdesk + * \brief Setup page for cashdesk module + * \version $Id$ + */ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); + +if (!$user->admin) +accessforbidden(); + +$langs->load("admin"); +$langs->load("cashdesk"); + + +/* + * Actions + */ +if ($_POST["action"] == 'set') +{ + dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",$_POST["socid"]); + dolibarr_syslog("admin/cashdesk: level ".$_POST["level"]); +} + + + +/* + * View + */ + +$form=new Form($db); + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("CashDeskSetup"),$linkback,'setup'); +print '
'; + + +// Mode +$var=true; +print '
'; +print ''; + +print ''; +print ''; +print ''; +print ''; +print "\n"; +$var=!$var; +print ''; +print ''; +if ($conf->global->MAIN_MODULE_BANQUE) +{ + $var=!$var; + print ''; + print ''; +} +if ($conf->global->MAIN_MODULE_STOCK) +{ + $var=!$var; + print ''; + print ''; +} + + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("CashDeskThirdPartyForSell").''; +print $form->select_societes($conf->global->CASHDESK_ID_THIRDPARTY,'socid','',1); +print '
'.$langs->trans("CashDeskBankAccountForSell").''; + print '
'.$langs->trans("CashDeskIdWareHouse").''; + print '
'; + +print "
\n"; + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 14ee32db59f..9e337a2f7af 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -101,7 +101,7 @@ if (! $defaultsyslogfile) $defaultsyslogfile='dolibarr.log'; print_titre($langs->trans("SyslogOutput")); // Mode -print '
'; +print ''; print ''; print ''; print ''; diff --git a/htdocs/cashdesk/langs/fr_FR/cashdesk.lang b/htdocs/cashdesk/langs/fr_FR/cashdesk.lang index 0b0599a5184..428d269e77a 100644 --- a/htdocs/cashdesk/langs/fr_FR/cashdesk.lang +++ b/htdocs/cashdesk/langs/fr_FR/cashdesk.lang @@ -1,2 +1,2 @@ # Language file - fr_FR - cashdesk -CashDesk=Caisse \ No newline at end of file +CashDesk=Caisse diff --git a/htdocs/includes/modules/modCashDesk.class.php b/htdocs/includes/modules/modCashDesk.class.php index 6be54302954..34bef3b7ff3 100644 --- a/htdocs/includes/modules/modCashDesk.class.php +++ b/htdocs/includes/modules/modCashDesk.class.php @@ -70,8 +70,11 @@ class modCashDesk extends DolibarrModules // Relative path to module style sheet if exists. Example: '/mymodule/mycss.css'. $this->style_sheet = ''; + // Config pages. Put here list of php page names stored in admmin directory used to setup module. + $this->config_page_url = array("cashdesk.php"); + // Dependencies - $this->depends = array("modFacture","modProduit"); // List of modules id that must be enabled if this module is enabled + $this->depends = array("modBanque","modFacture","modProduit","modStock"); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->phpmin = array(4,1); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c2d0d6c5e1d..ffdc8d228d2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -951,3 +951,8 @@ AgendaSetup=Actions and agenda module setup PasswordTogetVCalExport=Key to authorize vcal export link ##### ClickToDial ##### ClickToDialDesc=This module allows to add an icon after the phone number of Dolibarr contacts. A click on this icon, will call a serveur with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. +##### CashDesk ##### +CashDeskSetup=Cash desk module setup +CashDeskThirdPartyForSell=Generic third party to use for sells +CashDeskBankAccountForSell=Cash account to use for sells +CashDeskIdWareHouse=Datawarehous to user for sells diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3fbb41049b3..41cac097b7b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -957,4 +957,8 @@ AgendaSetup=Configuration du module actions et agenda PasswordTogetVCalExport=Clé pour autoriser export vcal ##### ClickToDial ##### ClickToDialDesc=Ce module permet d'ajouter un petit picto a coté des numéros de téléphones des contacts. Un clic sur ce picto provoque l'appel de l'URL définie dans ce paramétrage. Ceci permet de provoquer des appels à un serveur de téléphonie depuis Dolibarr qui peut alors composer le numéro sur un system SIP par exemple. - +##### CashDesk ##### +CashDeskSetup=Configuration du module Caisse enregistreuse +CashDeskThirdPartyForSell=Tiers générique à utiliser pour les ventes +CashDeskBankAccountForSell=Compte caisse à utiliser pour les ventes +CashDeskIdWareHouse=Entrepot à utiliser pour les ventes