diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index d44b01c21b4..7972a9924d3 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,4 @@ -#Wed Feb 11 15:08:12 CET 2009 +#Wed Feb 11 17:58:49 CET 2009 eclipse.preferences.version=1 encoding//dev/initdemo/initdemo.sql=UTF-8 encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 @@ -235,6 +235,7 @@ encoding//htdocs/langs/en_US/members.lang=UTF-8 encoding//htdocs/langs/en_US/orders.lang=UTF-8 encoding//htdocs/langs/en_US/oscommerce.lang=UTF-8 encoding//htdocs/langs/en_US/other.lang=UTF-8 +encoding//htdocs/langs/en_US/paybox.lang=UTF-8 encoding//htdocs/langs/en_US/products.lang=UTF-8 encoding//htdocs/langs/en_US/projects.lang=UTF-8 encoding//htdocs/langs/en_US/propal.lang=UTF-8 @@ -344,6 +345,7 @@ encoding//htdocs/langs/fr_FR/members.lang=UTF-8 encoding//htdocs/langs/fr_FR/orders.lang=UTF-8 encoding//htdocs/langs/fr_FR/oscommerce.lang=UTF-8 encoding//htdocs/langs/fr_FR/other.lang=UTF-8 +encoding//htdocs/langs/fr_FR/paybox.lang=UTF-8 encoding//htdocs/langs/fr_FR/products.lang=UTF-8 encoding//htdocs/langs/fr_FR/projects.lang=UTF-8 encoding//htdocs/langs/fr_FR/propal.lang=UTF-8 diff --git a/ChangeLog b/ChangeLog index 23c596710b7..a66745a5a55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,7 @@ For users: - New: Added a page /support to provide a help center service on Dolibarr. - New: Distinct status "running not expired" from "running expired" in lines contract status. +- New: Add a first version of a module for Paybox. - Fix: Handle correctly the comment in status changing of supplier orders. - Fix: Author, title and topic are correctly encoded in PDF. - Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users. diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 705a17e01a4..0a3b1dc0a8b 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -81,8 +81,8 @@ class modMyModule extends DolibarrModules // Dependencies $this->depends = array(); // 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 + $this->phpmin = array(4,3); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(2,5); // Minimum version of Dolibarr required by module $this->langfiles = array("mymodule"); // Constants diff --git a/htdocs/adherents/cartes/pre.inc.php b/htdocs/adherents/cartes/pre.inc.php index 8aea0eed960..fea196f68e0 100644 --- a/htdocs/adherents/cartes/pre.inc.php +++ b/htdocs/adherents/cartes/pre.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2002 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ function llxHeader($head = "") { $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=1&filter=uptodate",$langs->trans("MenuMembersUpToDate")); $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=0",$langs->trans("MenuMembersResiliated")); - $menu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks")); + $menu->add(DOL_URL_ROOT."/adherents/public.php?leftmenu=member_public",$langs->trans("MemberPublicLinks")); $menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Exports")); $menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas")); diff --git a/htdocs/adherents/public.php b/htdocs/adherents/public.php index 730b335ad23..13bedf6adba 100644 --- a/htdocs/adherents/public.php +++ b/htdocs/adherents/public.php @@ -16,9 +16,9 @@ * 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/public/adherents/index.php + \file htdocs/adherents/public.php \ingroup member \brief Fichier de la page de l'espace publique adherent \author Laurent Destailleur @@ -32,7 +32,7 @@ require("./pre.inc.php"); /* * View */ - + llxHeader(); print_fiche_titre($langs->trans("PublicMembersArea")); @@ -47,13 +47,13 @@ print '
'; print ''; print ''; -print ''; -print ''; +print ''; +print ''; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' $firstpart=$dolibarr_main_url_root; $regex=DOL_URL_ROOT.'$'; $firstpart=eregi_replace($regex,'',$firstpart); -print ''; +print ''; print '
'.$langs->trans("Description").''.$langs->trans("URL").'
'.$langs->trans("BlankSubscriptionForm").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/new.php'.'
'.$langs->trans("PublicMemberList").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/public_list.php'.'
'.$langs->trans("BlankSubscriptionForm").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/members/new.php'.'
'.$langs->trans("PublicMemberList").''.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/members/public_list.php'.'
'.$langs->trans("PublicMemberCard").''.$firstpart.DOL_URL_ROOT.'/public/adherents/public_card.php?id=xxx'.'
'.$langs->trans("PublicMemberCard").''.$firstpart.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'
'; diff --git a/htdocs/admin/bookmark.php b/htdocs/admin/bookmark.php index a3bc3cbe0c7..602ba9f6703 100644 --- a/htdocs/admin/bookmark.php +++ b/htdocs/admin/bookmark.php @@ -37,7 +37,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$_POST["BOOKMARKS_SHOW_IN_MENU"]); if ($result >= 0) { - $mesg='
'.$langs->trans("Success").'
'; + $mesg='
'.$langs->trans("SetupSaved").'
'; } else { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 367e571bd39..4ec0641625a 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -388,9 +388,22 @@ foreach ($orders as $key => $value) print ' '; } print "\n"; + + // Picto print ' '; - print ! empty($objMod->picto)?img_object('',$objMod->picto):img_object('','generic'); - print ''.$objMod->getName(); + if (! empty($objMod->picto)) + { + if (eregi('^/',$objMod->picto)) print img_picto('',$objMod->picto,'',1); + else print img_object('',$objMod->picto); + } + else + { + print img_object('','generic'); + } + print ''; + + // Name + print ''.$objMod->getName(); print "\n "; print nl2br($objMod->getDesc()); print "\n "; diff --git a/htdocs/admin/paybox.php b/htdocs/admin/paybox.php new file mode 100644 index 00000000000..f658b6d1877 --- /dev/null +++ b/htdocs/admin/paybox.php @@ -0,0 +1,142 @@ + + * Copyright (C) 2005-2009 Laurent Destailleur + * + * 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/aybox.php + * \ingroup bookmark + * \brief Page to setup bookmark module + * \version $Id$ + */ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); + +$langs->load("admin"); +$langs->load("paybox"); + +if (!$user->admin) + accessforbidden(); + + +if ($_POST["action"] == 'setvalue' && $user->admin) +{ + $result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"]); + $result=dolibarr_set_const($db, "PAYBOX_CGI_URL",$_POST["PAYBOX_CGI_URL"]); + $result=dolibarr_set_const($db, "PAYBOX_CSS_URL",$_POST["PAYBOX_CSS_URL"]); + $result=dolibarr_set_const($db, "PAYBOX_IBS_SITE",$_POST["PAYBOX_IBS_SITE"]); + $result=dolibarr_set_const($db, "PAYBOX_IBS_RANG",$_POST["PAYBOX_IBS_RANG"]); + + if ($result >= 0) + { + $mesg='
'.$langs->trans("SetupSaved").'
'; + } + else + { + dolibarr_print_error($db); + } +} + + +/* + * View + */ + +$IBS_SITE="1999888"; # Site test +if (empty($conf->global->PAYBOX_IBS_SITE)) $conf->global->PAYBOX_IBS_SITE=$IBS_SITE; +$IBS_RANG="99"; # Rang test +if (empty($conf->global->PAYBOX_IBS_RANG)) $conf->global->PAYBOX_IBS_RANG=$IBS_RANG; +$IBS_DEVISE="978"; # Euro +if (empty($conf->global->PAYBOX_IBS_DEVISE)) $conf->global->PAYBOX_IBS_DEVISE=$IBS_DEVISE; + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'setup'); + +print $langs->trans("PayBoxDesc")."
\n"; + + +if ($mesg) print '
'.$mesg; + +print '
'; +print '
'; +print ''; + +$var=true; + +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=!$var; +print ''; + +$var=!$var; +print ''; + +$var=!$var; +print ''; + +$var=!$var; +print ''; + +$var=!$var; +print ''; + +print ''; +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print $langs->trans("PAYBOX_IBS_DEVISE").''; +print ''; +print '
'.$langs->trans("Example").': 978 (EUR)'; +print '
'; +print $langs->trans("PAYBOX_CGI_URL").''; +print ''; +print '
'.$langs->trans("Example").': http://mysite/cgi-bin/module_linux.cgi'; +print '
'; +print $langs->trans("PAYBOX_CSS_URL").''; +print ''; +print '
'.$langs->trans("Example").': http://mysite/mycss.css'; +print '
'; +print $langs->trans("PAYBOX_IBS_SITE").''; +print ''; +print '
'.$langs->trans("Example").': 1999888 ('.$langs->trans("Test").')'; +print '
'; +print $langs->trans("PAYBOX_IBS_RANG").''; +print ''; +print '
'.$langs->trans("Example").': 99 ('.$langs->trans("Test").')'; +print '
'; + +print '

'; + +print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'; +// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' +$firstpart=$dolibarr_main_url_root; +$regex=DOL_URL_ROOT.'$'; +$firstpart=eregi_replace($regex,'',$firstpart); +//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=orderref&tag=ATAGOFYOURCHOICE'."
\n"; +//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=invoiceref&tag=ATAGOFYOURCHOICE'."
\n"; +//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=contractlineref&tag=ATAGOFYOURCHOICE'."
\n"; +print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=value&tag=ATAGOFYOURCHOICE'."
\n"; + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/includes/modules/modAdherent.class.php b/htdocs/includes/modules/modAdherent.class.php index e5e64a8b43d..6649f071d72 100644 --- a/htdocs/includes/modules/modAdherent.class.php +++ b/htdocs/includes/modules/modAdherent.class.php @@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules { $this->db = $DB; $this->numero = 310 ; - + $this->family = "hr"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = eregi_replace('^mod','',get_class($this)); @@ -59,27 +59,26 @@ class modAdherent extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->special = 0; $this->picto='user'; - + // Dir //---- $this->dirs = array(); - + // Config pages //------------- $this->config_page_url = array("adherent.php"); - + // Dependances //------------ $this->depends = array(); $this->requiredby = array(); $this->langfiles = array("members","companies"); - + // Constantes //----------- $this->const = array(); $this->const[0] = array("ADHERENT_MAIL_RESIL","texte","Votre adhesion vient d'etre resiliee.\r\nNous esperons vous revoir tres bientot","Mail de resiliation"); - $this->const[1] = array("ADHERENT_MAIL_VALID","texte","Votre adhesion vient d'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante : \r\n%DOL_MAIN_URL_ROOT%/public/adherents/","Mail de validation"); - $this->const[3] = array("ADHERENT_MAIL_RESIL","texte","Votre adhesion vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de resiliation"); + $this->const[1] = array("ADHERENT_MAIL_VALID","texte","Votre adhesion vient d'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n","Mail de validation"); $this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine","Votre adhesion a ete validee","Sujet du mail de validation"); $this->const[6] = array("ADHERENT_MAIL_RESIL_SUBJECT","chaine","Resiliation de votre adhesion","Sujet du mail de resiliation"); $this->const[10] = array("ADHERENT_MAILMAN_UNSUB_URL","chaine","http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%","Url de desinscription aux listes mailman"); @@ -103,11 +102,11 @@ class modAdherent extends DolibarrModules $this->const[32] = array("ADHERENT_BANK_ACCOUNT","chaine","","ID du Compte banquaire utilise"); $this->const[33] = array("ADHERENT_BANK_CATEGORIE","chaine","","ID de la categorie banquaire des cotisations"); $this->const[34] = array("ADHERENT_ETIQUETTE_TYPE","chaine","L7163","Type d etiquette (pour impression de planche d etiquette)"); - + // Boites //------- $this->boxes = array(); - + // Permissions //------------ $this->rights = array(); @@ -120,21 +119,21 @@ class modAdherent extends DolibarrModules // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code - + $r++; $this->rights[$r][0] = 71; $this->rights[$r][1] = 'Lire les fiche adherents'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 1; $this->rights[$r][4] = 'lire'; - + $r++; $this->rights[$r][0] = 72; $this->rights[$r][1] = 'Creer/modifier tous les adherents'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; - + $r++; $this->rights[$r][0] = 73; $this->rights[$r][1] = 'Creer/modifier ses propres infos adherents'; @@ -149,14 +148,14 @@ class modAdherent extends DolibarrModules $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'supprimer'; - + $r++; $this->rights[$r][0] = 76; $this->rights[$r][1] = 'Exporter les adherents'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'export'; - + $r++; $this->rights[$r][0] = 75; $this->rights[$r][1] = 'Configurer les types et attributs des adherents'; @@ -171,7 +170,7 @@ class modAdherent extends DolibarrModules $this->rights[$r][3] = 1; $this->rights[$r][4] = 'cotisation'; $this->rights[$r][5] = 'lire'; - + $r++; $this->rights[$r][0] = 79; $this->rights[$r][1] = 'Creer/modifier/supprimer les cotisations'; @@ -199,7 +198,7 @@ class modAdherent extends DolibarrModules $this->export_entities_array[$r]=array('a.rowid'=>'member','a.nom'=>"member",'a.prenom'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); $this->export_alias_array[$r]=array('a.rowid'=>'Id','a.nom'=>"lastname",'a.prenom'=>"firstname",'a.login'=>"login",'a.morphy'=>'morphy','a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.phone'=>"phone",'a.phone_perso'=>"phone_perso",'a.phone_mobile'=>"phone_mobile",'a.email'=>"email",'a.naiss'=>"birthday",'a.statut'=>"status",'a.photo'=>'photo','a.note'=>'note','a.datec'=>'datec','a.datevalid'=>'datevalid','a.tms'=>'datem','a.datefin'=>'dateend','ta.rowid'=>'type_id','ta.libelle'=>'type_label','c.dateadh'=>'date_subscription','c.cotisation'=>'amount_subscription'); // On complete avec champs options - $sql='SELECT name, label FROM '.MAIN_DB_PREFIX.'adherent_options_label'; + $sql='SELECT name, label FROM '.MAIN_DB_PREFIX.'adherent_options_label'; $resql=$this->db->query($sql); while ($obj=$this->db->fetch_object($resql)) { @@ -217,7 +216,7 @@ class modAdherent extends DolibarrModules $this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid'; } - + /** * \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module. * Definit egalement les repertoires de donnees a creer pour ce module. @@ -225,17 +224,17 @@ class modAdherent extends DolibarrModules function init() { global $conf; - + // Dir $this->dirs[0] = $conf->adherent->dir_output; $this->dirs[1] = $conf->adherent->dir_output."/photos"; $this->dirs[2] = $conf->adherent->dir_export; - + $sql = array(); - + return $this->_init($sql); } - + /** * \brief Fonction appelee lors de la desactivation d'un module. * Supprime de la base les constantes, boites et permissions du module. @@ -243,7 +242,7 @@ class modAdherent extends DolibarrModules function remove() { $sql = array(); - + return $this->_remove($sql); } diff --git a/htdocs/includes/modules/modPaybox.class.php b/htdocs/includes/modules/modPaybox.class.php new file mode 100644 index 00000000000..9273afa225a --- /dev/null +++ b/htdocs/includes/modules/modPaybox.class.php @@ -0,0 +1,228 @@ + + * Copyright (C) 2004-2008 Laurent Destailleur + * + * 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. + */ + +/** \defgroup mymodule Module MyModule + * \brief Example of a module descriptor. + * Such a file must be copied into htdocs/includes/module directory. + */ + +/** + * \file htdocs/includes/modules/modMyModule.class.php + * \ingroup mymodule + * \brief Description and activation file for module MyModule + * \version $Id$ + */ +include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); + + +/** \class modPayBox + * \brief Description and activation class for module MyModule + */ +class modPayBox extends DolibarrModules +{ + /** + * \brief Constructor. Define names, constants, directories, boxes, permissions + * \param DB Database handler + */ + function modPayBox($DB) + { + $this->db = $DB; + + // Id for module (must be unique). + // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). + $this->numero = 10000; + // Key text used to identify module (for permissions, menus, etc...) + $this->rights_class = 'paybox'; + + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page + $this->family = "other"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = eregi_replace('^mod','',get_class($this)); + // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) + $this->description = "Paybox module"; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=other) + $this->special = 1; + // Name of png file (without png) used for this module. + // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. + $this->picto='/theme/common/paybox.png'; + + // Data directories to create when module is enabled. + $this->dirs = array(); + //$this->dirs[0] = DOL_DATA_ROOT.'/mymodule; + //$this->dirs[1] = DOL_DATA_ROOT.'/mymodule/temp; + + // 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("paybox.php"); + + // Dependencies + $this->depends = array(); // 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 + $this->langfiles = array("paybox"); + + // Constants + $this->const = array(); // List of particular constants to add when module is enabled + //Example: $this->const=array(0=>array('MODULE_MY_NEW_CONST1','chaine','myvalue','This is a constant to add',0), + // 1=>array('MODULE_MY_NEW_CONST2','chaine','myvalue','This is another constant to add',0) ); + + // New pages on tabs + $this->tabs = array(); + + + // Boxes + $this->boxes = array(); // List of boxes + $r=0; + + // Add here list of php file(s) stored in includes/boxes that contains class to show a box. + // Example: + //$this->boxes[$r][1] = "myboxa.php"; + //$r++; + //$this->boxes[$r][1] = "myboxb.php"; + //$r++; + + + // Permissions + $this->rights = array(); // Permission array used by this module + $r=0; + + // Add here list of permission defined by an id, a label, a boolean and two constant strings. + // Example: + // $this->rights[$r][0] = 2000; // Permission id (must not be already used) + // $this->rights[$r][1] = 'Permision label'; // Permission label + // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + // $r++; + + + // Main menu entries + $this->menus = array(); // List of menus to add + $r=0; + + // Add here entries to declare new menus + // Example to declare the Top Menu entry: + // $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu + // 'type'=>'top', // This is a Top menu entry + // 'titre'=>'MyModule top menu', + // 'mainmenu'=>'mymodule', + // 'leftmenu'=>'1', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school). + // 'url'=>'/mymodule/pagetop.php', + // 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + // 'position'=>100, + // 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + // 'target'=>'', + // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + // $r++; + // + // Example to declare a Left Menu entry: + // $this->menu[$r]=array( 'fk_menu'=>'r=0', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) + // 'type'=>'left', // This is a Left menu entry + // 'titre'=>'MyModule left menu 1', + // 'mainmenu'=>'mymodule', + // 'url'=>'/mymodule/pagelevel1.php', + // 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + // 'position'=>100, + // 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + // 'target'=>'', + // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + // $r++; + // + // Example to declare another Left Menu entry: + // $this->menu[$r]=array( 'fk_menu'=>'r=1', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) + // 'type'=>'left', // This is a Left menu entry + // 'titre'=>'MyModule left menu 2', + // 'mainmenu'=>'mymodule', + // 'url'=>'/mymodule/pagelevel2.php', + // 'langs'=>'mylangfile', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + // 'position'=>100, + // 'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + // 'target'=>'', + // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + // $r++; + + + // Exports + $r=1; + + // Example: + // $this->export_code[$r]=$this->rights_class.'_'.$r; + // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + // $this->export_permission[$r]=array(array("facture","facture","export")); + // $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePayed",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_taux'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef'); + // $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_taux'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'); + // $this->export_alias_array[$r]=array('s.rowid'=>"socid",'s.nom'=>'soc_name','s.address'=>'soc_adres','s.cp'=>'soc_zip','s.ville'=>'soc_ville','s.fk_pays'=>'soc_pays','s.tel'=>'soc_tel','s.siren'=>'soc_siren','s.siret'=>'soc_siret','s.ape'=>'soc_ape','s.idprof4'=>'soc_idprof4','s.code_compta'=>'soc_customer_accountancy','s.code_compta_fournisseur'=>'soc_supplier_accountancy','f.rowid'=>"invoiceid",'f.facnumber'=>"ref",'f.datec'=>"datecreation",'f.datef'=>"dateinvoice",'f.total'=>"totalht",'f.total_ttc'=>"totalttc",'f.tva'=>"totalvat",'f.paye'=>"paid",'f.fk_statut'=>'status','f.note'=>"note",'fd.rowid'=>'lineid','fd.description'=>"linedescription",'fd.price'=>"lineprice",'fd.total_ht'=>"linetotalht",'fd.total_tva'=>"linetotaltva",'fd.total_ttc'=>"linetotalttc",'fd.tva_taux'=>"linevatrate",'fd.qty'=>"lineqty",'fd.date_start'=>"linedatestart",'fd.date_end'=>"linedateend",'fd.fk_product'=>'productid','p.ref'=>'productref'); + // $this->export_sql_start[$r]='SELECT DISTINCT '; + // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; + // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; + // $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; + // $r++; + } + + /** + * \brief 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. + * \return int 1 if OK, 0 if KO + */ + function init() + { + $sql = array(); + + $result=$this->load_tables(); + + return $this->_init($sql); + } + + /** + * \brief Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted. + * \return int 1 if OK, 0 if KO + */ + function remove() + { + $sql = array(); + + return $this->_remove($sql); + } + + + /** + * \brief Create tables and keys required by module + * Files mymodule.sql and mymodule.key.sql with create table and create keys + * commands must be stored in directory /mymodule/sql/ + * This function is called by this->init. + * \return int <=0 if KO, >0 if OK + */ + function load_tables() + { + return $this->_load_tables('/paybox/sql/'); + } +} + +?> diff --git a/htdocs/langs/en_US/paybox.lang b/htdocs/langs/en_US/paybox.lang new file mode 100644 index 00000000000..367b3083a2c --- /dev/null +++ b/htdocs/langs/en_US/paybox.lang @@ -0,0 +1,16 @@ +# Dolibarr language file - en_US - paybox +CHARSET=UTF-8 +PayBoxSetup=PayBox module setup +PayBoxDesc=This module offer pages to allow payment on Paybox by customers. This can be used for a free payment or for a payment on a particular Dolibarr object (invoice, order, ...) +FollowingUrlAreAvailableToMakePayments=Following URLs are available to offer a page to a customer to make a payment on Dolibarr objects +WelcomeOnPaymentPage=Welcome on our online payment service +ThisScreenAllowsYouToPay=This screen allow you to make an online payment to %s. +ThisIsInformationOnPayment=This is informations on payment to do +ToComplete=To complete +YourEMail=Email for payment confirmation +Creditor=Creditor +PaymentCode=Payment code +PayBoxDoPayment=Go on payment +YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card informations +PleaseBePatient=Please, be patient +Continue=Next \ No newline at end of file diff --git a/htdocs/langs/fr_FR/paybox.lang b/htdocs/langs/fr_FR/paybox.lang new file mode 100644 index 00000000000..77d37ac366a --- /dev/null +++ b/htdocs/langs/fr_FR/paybox.lang @@ -0,0 +1,16 @@ +# Dolibarr language file - fr_FR - paybox +CHARSET=UTF-8 +PayBoxSetup=Configuration module PayBox +PayBoxDesc=Ce module permet d'offrir une page de paiement via le prestataire Paybox pour réaliser un paiement quelconque ou un paiement par rapport à un objet Dolibarr (factures, commande...) +FollowingUrlAreAvailableToMakePayments=Les URL suivantes sont disponibles pour permettre à un client de faire un paiement +WelcomeOnPaymentPage=Bienvenu sur notre service de paiement en ligne +ThisScreenAllowsYouToPay=Cet écran vous permet de réaliser votre paiement en ligne à destination de %s. +ThisIsInformationOnPayment=Voici les informations sur le paiement à réaliser +ToComplete=A compléter +YourEMail=Email de confirmation du paiement +Creditor=Bénéficiaire +PaymentCode=Code de paiement +PayBoxDoPayment=Poursuivre le paiement +YouWillBeRedirectedOnPayBox=Vous serez redirigé vers la page sécurisée Paybox de saisie de votre carte bancaire +PleaseBePatient=Merci de patientez quelques secondes +Continue=Continuer \ No newline at end of file diff --git a/htdocs/paybox/paybox.lib.php b/htdocs/paybox/paybox.lib.php index a0467af28c4..9545cb98774 100644 --- a/htdocs/paybox/paybox.lib.php +++ b/htdocs/paybox/paybox.lib.php @@ -25,26 +25,75 @@ */ + +function llxHeaderPaybox($title, $head = "") +{ + global $user, $conf, $langs; + + // Si feuille de style en php existe + if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php"; + + header("Content-type: text/html; charset=".$conf->character_set_client); + + print ''; + //print ''; + print "\n"; + print "\n"; + print "\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print "".$title."\n"; + if ($head) print $head."\n"; + if ($conf->global->PAYBOX_CSS_URL) print ''."\n"; + else + { + print ''."\n"; + print ''; + } + print "\n"; + print ''."\n"; +} + +function llxFooterPayBox() +{ + print "\n"; + print "\n"; +} + + /** * \brief Create a redirect form to paybox form * \return int 1 if OK, -1 if ERROR */ -function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko="",$ID=0) +function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko,$DOLSTRING,$ID=0) { global $conf, $langs, $db; dol_syslog("Paypal.lib::print_paybox_redirect", LOG_DEBUG); - + // Clean parameters + $IBS_SITE="1999888"; # Site test + if ($conf->global->PAYBOX_IBS_SITE) $IBS_SITE=$conf->global->PAYBOX_IBS_SITE; + $IBS_RANG="99"; # Rang test + if ($conf->global->PAYBOX_IBS_RANG) $IBS_RANG=$conf->global->PAYBOX_IBS_RANG; $IBS_DEVISE="978"; # Euro + if ($conf->global->PAYBOX_IBS_DEVISE) $IBS_DEVISE=$conf->global->PAYBOX_IBS_DEVISE; - $ModulePaybox="module_linux.cgi"; + + $ModulePaybox="module_linux.cgi"; if ($_SERVER["WINDIR"] && eregi("windows",$_SERVER["WINDIR"])) { $ModulePaybox="module_NT_2000.cgi"; } $URLPAYBOX=URL_ROOT.'/cgi-bin/'.$ModulePaybox; if ($conf->global->PAYBOX_CGI_URL) $URLPAYBOX=$conf->global->PAYBOX_CGI_URL; - $IBS_SITE=$conf->global->PAYBOX_IBS_SITE; - $IBS_RANG=$conf->global->PAYBOX_IBS_RANG; + if (empty($IBS_DEVISE)) + { + dol_print_error('',"Paybox setup param PAYBOX_IBS_DEVISE not defined"); + return -1; + } if (empty($URLPAYBOX)) { dol_print_error('',"Paybox setup param PAYBOX_CGI_URL not defined"); @@ -61,45 +110,43 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko="",$ID=0) return -1; } - // Value to use for test - $IBS_SITE="1999888"; # Site test - $IBS_RANG="99"; # Rang test - dol_syslog("Paypal.lib::print_paybox_redirect PRICE: ".$PRICE, LOG_DEBUG); // Definition des parametres vente produit pour paybox - $IBS_CMD="DOL:SITE=dolibarr-ID=".$ID; + $IBS_CMD=$DOLSTRING; $IBS_TOTAL=$PRICE*100; # En centimes $IBS_MODE=1; # Mode formulaire $IBS_PORTEUR=$EMAIL; $IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des paramètres du get de validation en reponse (url a definir sous paybox) - $IBS_TXT="
Vous allez être envoyé vers la page de paiement sécurisé Paybox
Merci de patienter quelques secondes...
"; + $IBS_TXT="
".$langs->trans("YouWillBeRedirectedOnPayBox")."
".$langs->trans("PleaseBePatient")."...
"; $IBS_EFFECTUE=$urlok; $IBS_ANNULE=$urlko; $IBS_REFUSE=$urlko; - $IBS_BOUTPI="Continuer"; + $IBS_BOUTPI=$langs->trans("Continue"); $IBS_BKGD="#FFFFFF"; $IBS_WAIT="4000"; - $IBS_LANG="FRA"; - dol_syslog("Soumission Paybox"); - dol_syslog("IBS_MODE: $IBS_MODE"); - dol_syslog("IBS_SITE: $IBS_SITE"); - dol_syslog("IBS_RANG: $IBS_RANG"); - dol_syslog("IBS_TOTAL: $IBS_TOTAL"); - dol_syslog("IBS_DEVISE: $IBS_DEVISE"); - dol_syslog("IBS_CMD: $IBS_CMD"); - dol_syslog("IBS_PORTEUR: $IBS_PORTEUR"); - dol_syslog("IBS_RETOUR: $IBS_RETOUR"); - dol_syslog("IBS_EFFECTUE: $IBS_EFFECTUE"); - dol_syslog("IBS_ANNULE: $IBS_ANNULE"); - dol_syslog("IBS_REFUSE: $IBS_REFUSE"); - dol_syslog("IBS_BKGD: $IBS_BKGD"); - dol_syslog("IBS_WAIT: $IBS_WAIT"); - dol_syslog("IBS_LANG: $IBS_LANG"); + $IBS_LANG="ENG"; + if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA"; + + dol_syslog("Soumission Paybox", LOG_DEBUG); + dol_syslog("IBS_MODE: $IBS_MODE", LOG_DEBUG); + dol_syslog("IBS_SITE: $IBS_SITE", LOG_DEBUG); + dol_syslog("IBS_RANG: $IBS_RANG", LOG_DEBUG); + dol_syslog("IBS_TOTAL: $IBS_TOTAL", LOG_DEBUG); + dol_syslog("IBS_DEVISE: $IBS_DEVISE", LOG_DEBUG); + dol_syslog("IBS_CMD: $IBS_CMD", LOG_DEBUG); + dol_syslog("IBS_PORTEUR: $IBS_PORTEUR", LOG_DEBUG); + dol_syslog("IBS_RETOUR: $IBS_RETOUR", LOG_DEBUG); + dol_syslog("IBS_EFFECTUE: $IBS_EFFECTUE", LOG_DEBUG); + dol_syslog("IBS_ANNULE: $IBS_ANNULE", LOG_DEBUG); + dol_syslog("IBS_REFUSE: $IBS_REFUSE", LOG_DEBUG); + dol_syslog("IBS_BKGD: $IBS_BKGD", LOG_DEBUG); + dol_syslog("IBS_WAIT: $IBS_WAIT", LOG_DEBUG); + dol_syslog("IBS_LANG: $IBS_LANG", LOG_DEBUG); print ''; print "\n"; @@ -132,4 +179,68 @@ function print_paybox_redirect($PRICE,$EMAIL,$urlok,$urlko="",$ID=0) } +/** + * Show footer of company in HTML pages + * + * @param unknown_type $fromcompany + * @param unknown_type $langs + */ +function html_print_footer($fromcompany,$langs) +{ + // Juridical status + $ligne1=""; + if ($fromcompany->forme_juridique_code) + { + $ligne1.=($ligne1?" - ":"").$langs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code)); + } + // Capital + if ($fromcompany->capital) + { + $ligne1.=($ligne1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->monnaie); + } + // Prof Id 1 + if ($fromcompany->profid1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->profid2)) + { + $field=$langs->transcountrynoentities("ProfId1",$fromcompany->pays_code); + if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; + $ligne1.=($ligne1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid1); + } + // Prof Id 2 + if ($fromcompany->profid2) + { + $field=$langs->transcountrynoentities("ProfId2",$fromcompany->pays_code); + if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; + $ligne1.=($ligne1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid2); + } + + // Second line of company infos + $ligne2=""; + // Prof Id 3 + if ($fromcompany->profid3) + { + $field=$langs->transcountrynoentities("ProfId3",$fromcompany->pays_code); + if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; + $ligne2.=($ligne2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid3); + } + // Prof Id 4 + if ($fromcompany->profid4) + { + $field=$langs->transcountrynoentities("ProfId4",$fromcompany->pays_code); + if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; + $ligne2.=($ligne2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid4); + } + // IntraCommunautary VAT + if ($fromcompany->tva_intra != '') + { + $ligne2.=($ligne2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$langs->convToOutputCharset($fromcompany->tva_intra); + } + + print '


'."\n"; + print '
'."\n"; + print $fromcompany->nom.'
'; + print $ligne1.'
'; + print $ligne2; + print '
'."\n"; +} + ?> \ No newline at end of file diff --git a/htdocs/public/bplc/index.php b/htdocs/public/bplc/index.php new file mode 100644 index 00000000000..79aab388f44 --- /dev/null +++ b/htdocs/public/bplc/index.php @@ -0,0 +1,31 @@ + + * + * 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/public/bplc/index.php + * \ingroup core + * \brief A redirect page to an error + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); + +?> diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 5b7587293e0..3be467e563e 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -18,12 +18,12 @@ */ /** - \file htdocs/public/demo/index.php - \ingroup core - \brief File to access demo - \author Laurent Destailleur - \version $Id$ -*/ + * \file htdocs/public/demo/index.php + * \ingroup core + * \brief File to access demo + * \author Laurent Destailleur + * \version $Id$ + */ require("../../master.inc.php"); diff --git a/htdocs/public/dons/.cvsignore b/htdocs/public/donations/.cvsignore similarity index 100% rename from htdocs/public/dons/.cvsignore rename to htdocs/public/donations/.cvsignore diff --git a/htdocs/public/dons/donateurs_code.php b/htdocs/public/donations/donateurs_code.php similarity index 96% rename from htdocs/public/dons/donateurs_code.php rename to htdocs/public/donations/donateurs_code.php index d1ddc7b2bbe..c77eee5b879 100644 --- a/htdocs/public/dons/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -34,18 +34,18 @@ $sql .= " WHERE d.fk_don_projet = 1 AND d.fk_statut in (2, 3) ORDER BY d.datedon if ( $db->query( $sql) ) { $num = $db->num_rows(); - + if ($num) { - + print ""; print ''; - print ""; + print ""; print ""; print ""; print "\n"; - + $var=True; $bc[1]='bgcolor="#f5f5f5"'; $bc[0]='bgcolor="#f0f0f0"'; diff --git a/htdocs/public/donations/index.php b/htdocs/public/donations/index.php new file mode 100644 index 00000000000..667d64d0525 --- /dev/null +++ b/htdocs/public/donations/index.php @@ -0,0 +1,31 @@ + + * + * 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/public/donations/index.php + * \ingroup core + * \brief A redirect page to an error + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); + +?> diff --git a/htdocs/public/dons/therm.php b/htdocs/public/donations/therm.php similarity index 96% rename from htdocs/public/dons/therm.php rename to htdocs/public/donations/therm.php index f9ddcc5dda3..56caa6def8d 100644 --- a/htdocs/public/dons/therm.php +++ b/htdocs/public/donations/therm.php @@ -18,7 +18,7 @@ */ /** - \file htdocs/public/dons/therm.php + \file htdocs/public/donations/therm.php \ingroup donation \brief Screen with thermometer \version $Id$ @@ -35,7 +35,7 @@ $langs->setDefaultLang('auto'); * View */ $dontherm = new Don($db); - + $intentValue = $dontherm->sum_donations(1); $pendingValue = $dontherm->sum_donations(2); $actualValue = $dontherm->sum_donations(3); @@ -43,7 +43,7 @@ $actualValue = $dontherm->sum_donations(3); $db->close(); -/* +/* * Graph thermometer */ print moneyMeter($actualValue, $pendingValue, $intentValue); diff --git a/htdocs/public/error-401.php b/htdocs/public/error-401.php index d64663fbcfa..947367f7546 100644 --- a/htdocs/public/error-401.php +++ b/htdocs/public/error-401.php @@ -11,7 +11,7 @@ Sorry. You are not allowed to access this resource.
- You come from . +
diff --git a/htdocs/public/error-404.php b/htdocs/public/error-404.php index 2930baead76..ed5fafd01b6 100644 --- a/htdocs/public/error-404.php +++ b/htdocs/public/error-404.php @@ -11,7 +11,7 @@ You requested a page that does not exists.
- You come from . +
diff --git a/htdocs/public/index.php b/htdocs/public/index.php new file mode 100644 index 00000000000..a0024f11310 --- /dev/null +++ b/htdocs/public/index.php @@ -0,0 +1,31 @@ + + * + * 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/public/index.php + * \ingroup core + * \brief A redirect page to an error + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../master.inc.php"); + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); + +?> diff --git a/htdocs/public/members/index.php b/htdocs/public/members/index.php new file mode 100644 index 00000000000..aa963ad8b9b --- /dev/null +++ b/htdocs/public/members/index.php @@ -0,0 +1,31 @@ + + * + * 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/public/members/index.php + * \ingroup core + * \brief A redirect page to an error + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); + +?> diff --git a/htdocs/public/adherents/new.php b/htdocs/public/members/new.php similarity index 98% rename from htdocs/public/adherents/new.php rename to htdocs/public/members/new.php index 30b1ee12b36..0f9fe2399f2 100644 --- a/htdocs/public/adherents/new.php +++ b/htdocs/public/members/new.php @@ -19,7 +19,7 @@ */ /** - \file htdocs/public/adherents/new.php + \file htdocs/public/members/new.php \ingroup adherent \brief Form example to add a new member \version $Id$ @@ -229,7 +229,7 @@ print "\n"; print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/public/adherents/public_card.php b/htdocs/public/members/public_card.php similarity index 98% rename from htdocs/public/adherents/public_card.php rename to htdocs/public/members/public_card.php index 194611c03c8..9e31c34b9ac 100644 --- a/htdocs/public/adherents/public_card.php +++ b/htdocs/public/members/public_card.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/public/adherents/priv_fiche.php + * \file htdocs/public/members/priv_fiche.php * \brief Fichier de gestion de la popup de selection de date eldy * \version $Id$ */ @@ -76,15 +76,15 @@ if ($rowid > 0) print ''; print ''; - + print ''; - + print ''; - + print ''; - + print ''; - + if (isset($adh->photo) && $adh->photo !=''){ print ''; } @@ -93,7 +93,7 @@ if ($rowid > 0) // } print ''; - + print '
Pr�nom Nom / Soci�t�".$langs->trans("Name")." / ".$langs->trans("Company")."DateMontant
* * '.$langs->trans("Surname").'
* * '.$langs->trans("Surname").'
* * '.$langs->trans("Name").'
'.$langs->trans("ThirdParty").'
'.$langs->trans("Company").''.$adh->societe.' 
'.$langs->trans("Address").''.nl2br($adh->adresse).' 
'.$langs->trans("Zip").' '.$langs->trans("Town").''.$adh->cp.' '.$adh->ville.' 
'.$langs->trans("Country").''.$adh->pays.' 
'.$langs->trans("EMail").''.$adh->email.' 
'.$langs->trans("Birthday").''.$adh->naiss.' 
URL Photo'."photo\">photo\">".' 
'.$langs->trans("Comments").''.nl2br($adh->note).'
'; } diff --git a/htdocs/public/adherents/public_list.php b/htdocs/public/members/public_list.php similarity index 97% rename from htdocs/public/adherents/public_list.php rename to htdocs/public/members/public_list.php index 2db2757ed5b..ddfea193fbe 100644 --- a/htdocs/public/adherents/public_list.php +++ b/htdocs/public/members/public_list.php @@ -19,7 +19,7 @@ */ /** - \file htdocs/public/adherents/priv_liste.php + \file htdocs/public/members/priv_liste.php \brief File sample to list members \version $Id$ */ @@ -48,8 +48,8 @@ function llxHeaderVierge($title, $head = "") function llxFooter() { - print "\n"; - print "\n"; + print "\n"; + print "\n"; } diff --git a/htdocs/public/paybox/index.php b/htdocs/public/paybox/index.php new file mode 100644 index 00000000000..55d099b9519 --- /dev/null +++ b/htdocs/public/paybox/index.php @@ -0,0 +1,31 @@ + + * + * 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/public/paybox/index.php + * \ingroup core + * \brief A redirect page to an error + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); + +header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); + +?> diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php new file mode 100644 index 00000000000..80f70c9a55f --- /dev/null +++ b/htdocs/public/paybox/newpayment.php @@ -0,0 +1,198 @@ + + * Copyright (C) 2006-2009 Laurent Destailleur + * + * 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/public/paybox/index.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr entity + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); + +$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); +$langs->setDefaultLang($langcode); + +$langs->load("main"); +$langs->load("other"); +$langs->load("paybox"); +$langs->load("dict"); +$langs->load("bills"); +$langs->load("companies"); + +// Input are: +// type ('invoice','order','contractline'), +// id (object id), +// amount (required if id is empty), +// tag (a free text, required if type is empty) +// currency (iso code) + +if (empty($_REQUEST["currency"])) $currency=$conf->global->MAIN_MONNAIE; +else $currency=$_REQUEST["currency"]; +if (empty($_REQUEST["amount"])) +{ + dolibarr_print_error('','ErrorBadParameters'); + exit; +} +$amount=$_REQUEST["amount"]; +if (is_numeric($amount) && empty($_REQUEST["tag"])) +{ + dolibarr_print_error('','ErrorBadParameters'); + exit; +} + + + +/* + * Actions + */ +if ($_REQUEST["action"] == 'dopayment') +{ + $PRICE=$_REQUEST["newamount"]; + $EMAIL=$_REQUEST["EMAIL"]; + $urlok=''; + $urlko=''; + $DOLSTRING=$_REQUEST["tag"]; + $ID=$_REQUEST["id"]; + + $mesg=''; + if (empty($PRICE)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")); + elseif (empty($EMAIL)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); + elseif (! ValidEMail($EMAIL)) $mesg=$langs->trans("ErrorBadEMail",$EMAIL); + elseif (empty($DOLSTRING)) $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentCode")); + + if (empty($mesg)) + { + print_paybox_redirect($PRICE, $EMAIL, $urlok, $urlko, $DOLSTRING, $ID); + exit; + } +} + + + +/* + * View + */ + +llxHeaderPayBox($langs->trans("PaymentForm")); + + +print '
'; +print '
'; +print ''; +print ''; +print ''; +print "\n"; + +print ''."\n"; + +// Show logo (search in order: small company logo, large company logo, theme logo, common logo) +$width=0; +$urllogo=''; +if (! empty($mysoc->logo_small) && is_readable($conf->societe->dir_logos.'/thumbs/'.$mysoc->logo_small)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); +} +elseif (! empty($mysoc->logo_small) && is_readable($conf->societe->dir_logos.'/'.$mysoc->logo)) +{ + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo); + $width=96; +} +if ($urllogo) +{ + print ''; + print ''; + print ''."\n"; +} + +print ''."\n"; + +print ''."\n"; + +print ''; + +print '

'.$langs->trans("WelcomeOnPaymentPage").'

'.$langs->trans("ThisScreenAllowsYouToPay",$mysoc->nom).'

'; +print ''; +print ''."\n"; + +$found=false; +$var=false; +if (is_numeric($_REQUEST["amount"])) +{ + $found=true; + + // Currency + $var=!$var; + print ''."\n"; + // Amount + $var=!$var; + print ''."\n"; + // Currency + $var=!$var; + print ''."\n"; + // Tag + $var=!$var; + print ''."\n"; + // EMail + $var=!$var; + print ''."\n"; + +} + + + +if (! $found) $mesg=$langs->trans("ErrorBadParameters"); + +if ($mesg) print ''; + +print ''; +print ''; + + +print '
'.$langs->trans("ThisIsInformationOnPayment").' :
'.$langs->trans("Creditor"); + print ''.$mysoc->nom.'
'.$langs->trans("Amount"); + if (empty($amount)) print ' ('.$langs->trans("ToComplete").')'; + print ''; + if (empty($amount) || ! is_numeric($amount)) print ''; + else { + print ''.price($amount).''; + print ''; + } + print '
'.$langs->trans("Currency"); + print 'EUR
'.$langs->trans("PaymentCode"); + print ''.$_REQUEST["tag"].'
'.$langs->trans("YourEMail"); + print ' ('.$langs->trans("ToComplete").')'; + print '

'.$mesg.'

'.$langs->trans("YouWillBeRedirectedOnPayBox").'...
'; +print '
'; +print '
'; +print '
'; +print '
'; + + +html_print_footer($mysoc,$langs); + +$db->close(); + +llxFooterPayBox('$Date$ - $Revision$'); +?> diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php new file mode 100644 index 00000000000..10e24f3d876 --- /dev/null +++ b/htdocs/public/paybox/paymentko.php @@ -0,0 +1,67 @@ + + * Copyright (C) 2006-2009 Laurent Destailleur + * + * 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/public/paybox/paymentok.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr entity + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); + +$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); +$langs->setDefaultLang($langcode); + +$langs->load("main"); +$langs->load("other"); +$langs->load("paybox"); +$langs->load("dict"); +$langs->load("bills"); +$langs->load("companies"); + + + + +/* + * Actions + */ + + + + + +/* + * View + */ + +llxHeaderPayBox($langs->trans("PaymentForm")); + + + +html_print_footer($mysoc,$langs); + + +$db->close(); + +llxFooterPayBox('$Date$ - $Revision$'); +?> diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php new file mode 100644 index 00000000000..10e24f3d876 --- /dev/null +++ b/htdocs/public/paybox/paymentok.php @@ -0,0 +1,67 @@ + + * Copyright (C) 2006-2009 Laurent Destailleur + * + * 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/public/paybox/paymentok.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr entity + * \author Laurent Destailleur + * \version $Id$ + */ + +require("../../master.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); + +$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); +$langs->setDefaultLang($langcode); + +$langs->load("main"); +$langs->load("other"); +$langs->load("paybox"); +$langs->load("dict"); +$langs->load("bills"); +$langs->load("companies"); + + + + +/* + * Actions + */ + + + + + +/* + * View + */ + +llxHeaderPayBox($langs->trans("PaymentForm")); + + + +html_print_footer($mysoc,$langs); + + +$db->close(); + +llxFooterPayBox('$Date$ - $Revision$'); +?> diff --git a/mysql/data/data.sql b/mysql/data/data.sql index 8db8be0130b..824308b2bcc 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -121,8 +121,8 @@ insert into llx_const(name,value,type,visible,note) values('SOCIETE_CODECOMPTA_A insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_REQUIRED','1','yesno','Le mail est obligatoire pour créer un adhérent',0); insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_FROM','adherents@domain.com','chaine','From des mails adherents',0); insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_RESIL','Votre adhesion vient d\'etre resiliee.\r\nNous esperons vous revoir tres bientot','texte','Mail de Resiliation',0); -insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_VALID','Votre adhesion vient d\'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l\'adresse suivante : \r\n%DOL_MAIN_URL_ROOT%/public/adherents/','texte','Mail de validation',0); -insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_COTIS','Bonjour %PRENOM%,\r\nMerci de votre inscription.\r\nCet email confirme que votre cotisation a ete recue et enregistree.\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l\'adresse suivante :\r\n%DOL_MAIN_URL_ROOT%/public/adherents/','texte','Mail de validation de cotisation',0); +insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_VALID','Votre adhesion vient d\'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFOS%\r\n\r\n','texte','Mail de validation',0); +insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_COTIS','Bonjour %PRENOM%,\r\nMerci de votre inscription.\r\nCet email confirme que votre cotisation a ete recue et enregistree.\r\n\r\n','texte','Mail de validation de cotisation',0); insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_VALID_SUBJECT','Votre adhésion a ete validée','chaine','Sujet du mail de validation',0); insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_RESIL_SUBJECT','Resiliation de votre adhesion','chaine','Sujet du mail de resiliation',0); insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_COTIS_SUBJECT','Recu de votre cotisation','chaine','Sujet du mail de validation de cotisation',0);