New: Add a first version of a Paybox module

Qual: Renamed directories in public in english
This commit is contained in:
Laurent Destailleur
2009-02-11 20:44:00 +00:00
parent 8dc37f13f2
commit 317d5a6ea9
31 changed files with 1108 additions and 93 deletions

View File

@@ -1,4 +1,4 @@
#Wed Feb 11 15:08:12 CET 2009 #Wed Feb 11 17:58:49 CET 2009
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//dev/initdemo/initdemo.sql=UTF-8 encoding//dev/initdemo/initdemo.sql=UTF-8
encoding//dev/skeletons/modMyModule.class.php=ISO-8859-1 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/orders.lang=UTF-8
encoding//htdocs/langs/en_US/oscommerce.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/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/products.lang=UTF-8
encoding//htdocs/langs/en_US/projects.lang=UTF-8 encoding//htdocs/langs/en_US/projects.lang=UTF-8
encoding//htdocs/langs/en_US/propal.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/orders.lang=UTF-8
encoding//htdocs/langs/fr_FR/oscommerce.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/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/products.lang=UTF-8
encoding//htdocs/langs/fr_FR/projects.lang=UTF-8 encoding//htdocs/langs/fr_FR/projects.lang=UTF-8
encoding//htdocs/langs/fr_FR/propal.lang=UTF-8 encoding//htdocs/langs/fr_FR/propal.lang=UTF-8

View File

@@ -30,6 +30,7 @@ For users:
- New: Added a page /support to provide a help center service on Dolibarr. - New: Added a page /support to provide a help center service on Dolibarr.
- New: Distinct status "running not expired" from "running expired" in lines - New: Distinct status "running not expired" from "running expired" in lines
contract status. contract status.
- New: Add a first version of a module for Paybox.
- Fix: Handle correctly the comment in status changing of supplier orders. - Fix: Handle correctly the comment in status changing of supplier orders.
- Fix: Author, title and topic are correctly encoded in PDF. - 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. - Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users.

View File

@@ -81,8 +81,8 @@ class modMyModule extends DolibarrModules
// Dependencies // Dependencies
$this->depends = array(); // List of modules id that must be enabled if this module is enabled $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->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->phpmin = array(4,3); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(2,4); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(2,5); // Minimum version of Dolibarr required by module
$this->langfiles = array("mymodule"); $this->langfiles = array("mymodule");
// Constants // Constants

View File

@@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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&amp;filter=uptodate",$langs->trans("MenuMembersUpToDate")); $menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=1&amp;filter=uptodate",$langs->trans("MenuMembersUpToDate"));
$menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=0",$langs->trans("MenuMembersResiliated")); $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(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Exports"));
$menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas")); $menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"));

View File

@@ -16,9 +16,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 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 \ingroup member
\brief Fichier de la page de l'espace publique adherent \brief Fichier de la page de l'espace publique adherent
\author Laurent Destailleur \author Laurent Destailleur
@@ -32,7 +32,7 @@ require("./pre.inc.php");
/* /*
* View * View
*/ */
llxHeader(); llxHeader();
print_fiche_titre($langs->trans("PublicMembersArea")); print_fiche_titre($langs->trans("PublicMembersArea"));
@@ -47,13 +47,13 @@ print '<br>';
print '<table class="border" cellspacing="0" cellpadding="3">'; print '<table class="border" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/adherents/new.php'.'">'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/new.php'.'</a></td></tr>'; print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/members/new.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/adherents/public_list.php'.'">'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/public_list.php'.'</a></td></tr>'; print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
$firstpart=$dolibarr_main_url_root; $firstpart=$dolibarr_main_url_root;
$regex=DOL_URL_ROOT.'$'; $regex=DOL_URL_ROOT.'$';
$firstpart=eregi_replace($regex,'',$firstpart); $firstpart=eregi_replace($regex,'',$firstpart);
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.$firstpart.DOL_URL_ROOT.'/public/adherents/public_card.php?id=xxx'.'</td></tr>'; print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.$firstpart.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>'; print '</table>';

View File

@@ -37,7 +37,7 @@ if ($_POST["action"] == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$_POST["BOOKMARKS_SHOW_IN_MENU"]); $result=dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$_POST["BOOKMARKS_SHOW_IN_MENU"]);
if ($result >= 0) if ($result >= 0)
{ {
$mesg='<div class="ok">'.$langs->trans("Success").'</div>'; $mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
} }
else else
{ {

View File

@@ -388,9 +388,22 @@ foreach ($orders as $key => $value)
print '&nbsp;'; print '&nbsp;';
} }
print "</td>\n"; print "</td>\n";
// Picto
print ' <td valign="top" width="14" align="center">'; print ' <td valign="top" width="14" align="center">';
print ! empty($objMod->picto)?img_object('',$objMod->picto):img_object('','generic'); if (! empty($objMod->picto))
print '</td><td valign="top">'.$objMod->getName(); {
if (eregi('^/',$objMod->picto)) print img_picto('',$objMod->picto,'',1);
else print img_object('',$objMod->picto);
}
else
{
print img_object('','generic');
}
print '</td>';
// Name
print '<td valign="top">'.$objMod->getName();
print "</td>\n <td valign=\"top\">"; print "</td>\n <td valign=\"top\">";
print nl2br($objMod->getDesc()); print nl2br($objMod->getDesc());
print "</td>\n <td align=\"center\" valign=\"top\">"; print "</td>\n <td align=\"center\" valign=\"top\">";

142
htdocs/admin/paybox.php Normal file
View File

@@ -0,0 +1,142 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.org>
*
* 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='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
}
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='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'setup');
print $langs->trans("PayBoxDesc")."<br>\n";
if ($mesg) print '<br>'.$mesg;
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="setvalue">';
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYBOX_IBS_DEVISE").'</td><td>';
print '<input size="32" type="text" name="PAYBOX_IBS_DEVISE" value="'.$conf->global->PAYBOX_IBS_DEVISE.'">';
print '<br>'.$langs->trans("Example").': 978 (EUR)';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYBOX_CGI_URL").'</td><td>';
print '<input size="64" type="text" name="PAYBOX_CGI_URL" value="'.$conf->global->PAYBOX_CGI_URL.'">';
print '<br>'.$langs->trans("Example").': http://mysite/cgi-bin/module_linux.cgi';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYBOX_CSS_URL").'</td><td>';
print '<input size="64" type="text" name="PAYBOX_CSS_URL" value="'.$conf->global->PAYBOX_CSS_URL.'">';
print '<br>'.$langs->trans("Example").': http://mysite/mycss.css';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYBOX_IBS_SITE").'</td><td>';
print '<input size="32" type="text" name="PAYBOX_IBS_SITE" value="'.$conf->global->PAYBOX_IBS_SITE.'">';
print '<br>'.$langs->trans("Example").': 1999888 ('.$langs->trans("Test").')';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PAYBOX_IBS_RANG").'</td><td>';
print '<input size="32" type="text" name="PAYBOX_IBS_RANG" value="'.$conf->global->PAYBOX_IBS_RANG.'">';
print '<br>'.$langs->trans("Example").': 99 ('.$langs->trans("Test").')';
print '</td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table></form>';
print '<br><br>';
print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>';
// 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=<i>orderref</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=<i>invoiceref</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
//print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=<i>contractlineref</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
print $firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=<i>value</i>&tag=<i>ATAGOFYOURCHOICE</i>'."<br>\n";
$db->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
{ {
$this->db = $DB; $this->db = $DB;
$this->numero = 310 ; $this->numero = 310 ;
$this->family = "hr"; $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) // 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)); $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->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
$this->picto='user'; $this->picto='user';
// Dir // Dir
//---- //----
$this->dirs = array(); $this->dirs = array();
// Config pages // Config pages
//------------- //-------------
$this->config_page_url = array("adherent.php"); $this->config_page_url = array("adherent.php");
// Dependances // Dependances
//------------ //------------
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
$this->langfiles = array("members","companies"); $this->langfiles = array("members","companies");
// Constantes // Constantes
//----------- //-----------
$this->const = array(); $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[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[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[3] = array("ADHERENT_MAIL_RESIL","texte","Votre adhesion vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de resiliation");
$this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine","Votre adhesion a ete validee","Sujet du 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[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"); $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[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[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)"); $this->const[34] = array("ADHERENT_ETIQUETTE_TYPE","chaine","L7163","Type d etiquette (pour impression de planche d etiquette)");
// Boites // Boites
//------- //-------
$this->boxes = array(); $this->boxes = array();
// Permissions // Permissions
//------------ //------------
$this->rights = array(); $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][3] 1=Permis par defaut, 0=Non permis par defaut
// $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][4] Niveau 1 pour nommer permission dans code
// $this->rights[$r][5] Niveau 2 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code
$r++; $r++;
$this->rights[$r][0] = 71; $this->rights[$r][0] = 71;
$this->rights[$r][1] = 'Lire les fiche adherents'; $this->rights[$r][1] = 'Lire les fiche adherents';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1; $this->rights[$r][3] = 1;
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 72; $this->rights[$r][0] = 72;
$this->rights[$r][1] = 'Creer/modifier tous les adherents'; $this->rights[$r][1] = 'Creer/modifier tous les adherents';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
$r++; $r++;
$this->rights[$r][0] = 73; $this->rights[$r][0] = 73;
$this->rights[$r][1] = 'Creer/modifier ses propres infos adherents'; $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][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'supprimer'; $this->rights[$r][4] = 'supprimer';
$r++; $r++;
$this->rights[$r][0] = 76; $this->rights[$r][0] = 76;
$this->rights[$r][1] = 'Exporter les adherents'; $this->rights[$r][1] = 'Exporter les adherents';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'export'; $this->rights[$r][4] = 'export';
$r++; $r++;
$this->rights[$r][0] = 75; $this->rights[$r][0] = 75;
$this->rights[$r][1] = 'Configurer les types et attributs des adherents'; $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][3] = 1;
$this->rights[$r][4] = 'cotisation'; $this->rights[$r][4] = 'cotisation';
$this->rights[$r][5] = 'lire'; $this->rights[$r][5] = 'lire';
$r++; $r++;
$this->rights[$r][0] = 79; $this->rights[$r][0] = 79;
$this->rights[$r][1] = 'Creer/modifier/supprimer les cotisations'; $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_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'); $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 // 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); $resql=$this->db->query($sql);
while ($obj=$this->db->fetch_object($resql)) 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'; $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. * \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. * Definit egalement les repertoires de donnees a creer pour ce module.
@@ -225,17 +224,17 @@ class modAdherent extends DolibarrModules
function init() function init()
{ {
global $conf; global $conf;
// Dir // Dir
$this->dirs[0] = $conf->adherent->dir_output; $this->dirs[0] = $conf->adherent->dir_output;
$this->dirs[1] = $conf->adherent->dir_output."/photos"; $this->dirs[1] = $conf->adherent->dir_output."/photos";
$this->dirs[2] = $conf->adherent->dir_export; $this->dirs[2] = $conf->adherent->dir_export;
$sql = array(); $sql = array();
return $this->_init($sql); return $this->_init($sql);
} }
/** /**
* \brief Fonction appelee lors de la desactivation d'un module. * \brief Fonction appelee lors de la desactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module. * Supprime de la base les constantes, boites et permissions du module.
@@ -243,7 +242,7 @@ class modAdherent extends DolibarrModules
function remove() function remove()
{ {
$sql = array(); $sql = array();
return $this->_remove($sql); return $this->_remove($sql);
} }

View File

@@ -0,0 +1,228 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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/');
}
}
?>

View File

@@ -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 <a href="http://www.paybox.com" target="_blank">Paybox</a> 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

View File

@@ -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 <a href="http://www.paybox.com" target="_blank">Paybox</a> 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

View File

@@ -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 '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
//print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd>';
print "\n";
print "<html>\n";
print "<head>\n";
print '<meta name="robots" content="noindex,nofollow">'."\n";
print '<meta name="keywords" content="dolibarr,payment,online">'."\n";
print '<meta name="description" content="Welcome on Dolibarr online payment form">'."\n";
print "<title>".$title."</title>\n";
if ($head) print $head."\n";
if ($conf->global->PAYBOX_CSS_URL) print '<link rel="stylesheet" type="text/css" href="'.$conf->global->PAYBOX_CSS_URL.'">'."\n";
else
{
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/'.$conf->css.'">'."\n";
print '<style type="text/css">';
print '.CTableRow1 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #e6E6eE; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
print '.CTableRow2 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #FFFFFF; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
print '</style>';
}
print "</head>\n";
print '<body style="margin: 20px;">'."\n";
}
function llxFooterPayBox()
{
print "</body>\n";
print "</html>\n";
}
/** /**
* \brief Create a redirect form to paybox form * \brief Create a redirect form to paybox form
* \return int 1 if OK, -1 if ERROR * \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; global $conf, $langs, $db;
dol_syslog("Paypal.lib::print_paybox_redirect", LOG_DEBUG); 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 $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"; } if ($_SERVER["WINDIR"] && eregi("windows",$_SERVER["WINDIR"])) { $ModulePaybox="module_NT_2000.cgi"; }
$URLPAYBOX=URL_ROOT.'/cgi-bin/'.$ModulePaybox; $URLPAYBOX=URL_ROOT.'/cgi-bin/'.$ModulePaybox;
if ($conf->global->PAYBOX_CGI_URL) $URLPAYBOX=$conf->global->PAYBOX_CGI_URL; 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)) if (empty($URLPAYBOX))
{ {
dol_print_error('',"Paybox setup param PAYBOX_CGI_URL not defined"); 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; 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); dol_syslog("Paypal.lib::print_paybox_redirect PRICE: ".$PRICE, LOG_DEBUG);
// Definition des parametres vente produit pour paybox // Definition des parametres vente produit pour paybox
$IBS_CMD="DOL:SITE=dolibarr-ID=".$ID; $IBS_CMD=$DOLSTRING;
$IBS_TOTAL=$PRICE*100; # En centimes $IBS_TOTAL=$PRICE*100; # En centimes
$IBS_MODE=1; # Mode formulaire $IBS_MODE=1; # Mode formulaire
$IBS_PORTEUR=$EMAIL; $IBS_PORTEUR=$EMAIL;
$IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des param<61>tres du get de validation en reponse (url a definir sous paybox) $IBS_RETOUR="montant:M;ref:R;auto:A;trans:T"; # Format des param<61>tres du get de validation en reponse (url a definir sous paybox)
$IBS_TXT="<center><b>Vous allez <20>tre envoy<6F> vers la page de paiement s<>curis<69> Paybox</b><br><i>Merci de patienter quelques secondes...</i><br></center>"; $IBS_TXT="<center><b>".$langs->trans("YouWillBeRedirectedOnPayBox")."</b><br><i>".$langs->trans("PleaseBePatient")."...</i><br></center>";
$IBS_EFFECTUE=$urlok; $IBS_EFFECTUE=$urlok;
$IBS_ANNULE=$urlko; $IBS_ANNULE=$urlko;
$IBS_REFUSE=$urlko; $IBS_REFUSE=$urlko;
$IBS_BOUTPI="Continuer"; $IBS_BOUTPI=$langs->trans("Continue");
$IBS_BKGD="#FFFFFF"; $IBS_BKGD="#FFFFFF";
$IBS_WAIT="4000"; $IBS_WAIT="4000";
$IBS_LANG="FRA";
dol_syslog("Soumission Paybox"); $IBS_LANG="ENG";
dol_syslog("IBS_MODE: $IBS_MODE"); if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA";
dol_syslog("IBS_SITE: $IBS_SITE");
dol_syslog("IBS_RANG: $IBS_RANG"); dol_syslog("Soumission Paybox", LOG_DEBUG);
dol_syslog("IBS_TOTAL: $IBS_TOTAL"); dol_syslog("IBS_MODE: $IBS_MODE", LOG_DEBUG);
dol_syslog("IBS_DEVISE: $IBS_DEVISE"); dol_syslog("IBS_SITE: $IBS_SITE", LOG_DEBUG);
dol_syslog("IBS_CMD: $IBS_CMD"); dol_syslog("IBS_RANG: $IBS_RANG", LOG_DEBUG);
dol_syslog("IBS_PORTEUR: $IBS_PORTEUR"); dol_syslog("IBS_TOTAL: $IBS_TOTAL", LOG_DEBUG);
dol_syslog("IBS_RETOUR: $IBS_RETOUR"); dol_syslog("IBS_DEVISE: $IBS_DEVISE", LOG_DEBUG);
dol_syslog("IBS_EFFECTUE: $IBS_EFFECTUE"); dol_syslog("IBS_CMD: $IBS_CMD", LOG_DEBUG);
dol_syslog("IBS_ANNULE: $IBS_ANNULE"); dol_syslog("IBS_PORTEUR: $IBS_PORTEUR", LOG_DEBUG);
dol_syslog("IBS_REFUSE: $IBS_REFUSE"); dol_syslog("IBS_RETOUR: $IBS_RETOUR", LOG_DEBUG);
dol_syslog("IBS_BKGD: $IBS_BKGD"); dol_syslog("IBS_EFFECTUE: $IBS_EFFECTUE", LOG_DEBUG);
dol_syslog("IBS_WAIT: $IBS_WAIT"); dol_syslog("IBS_ANNULE: $IBS_ANNULE", LOG_DEBUG);
dol_syslog("IBS_LANG: $IBS_LANG"); 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 '<html><body>'; print '<html><body>';
print "\n"; 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 '<br><br><hr>'."\n";
print '<center><font style="font-size: 10px;">'."\n";
print $fromcompany->nom.'<br>';
print $ligne1.'<br>';
print $ligne2;
print '</font></center>'."\n";
}
?> ?>

View File

@@ -0,0 +1,31 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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');
?>

View File

@@ -18,12 +18,12 @@
*/ */
/** /**
\file htdocs/public/demo/index.php * \file htdocs/public/demo/index.php
\ingroup core * \ingroup core
\brief File to access demo * \brief File to access demo
\author Laurent Destailleur * \author Laurent Destailleur
\version $Id$ * \version $Id$
*/ */
require("../../master.inc.php"); require("../../master.inc.php");

View File

@@ -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) ) if ( $db->query( $sql) )
{ {
$num = $db->num_rows(); $num = $db->num_rows();
if ($num) if ($num)
{ {
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR>'; print '<TR>';
print "<td>Pr<EFBFBD>nom Nom / Soci<63>t<EFBFBD></td>"; print "<td>".$langs->trans("Name")." / ".$langs->trans("Company")."</td>";
print "<td>Date</td>"; print "<td>Date</td>";
print "<td align=\"right\">Montant</TD>"; print "<td align=\"right\">Montant</TD>";
print "</TR>\n"; print "</TR>\n";
$var=True; $var=True;
$bc[1]='bgcolor="#f5f5f5"'; $bc[1]='bgcolor="#f5f5f5"';
$bc[0]='bgcolor="#f0f0f0"'; $bc[0]='bgcolor="#f0f0f0"';

View File

@@ -0,0 +1,31 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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');
?>

View File

@@ -18,7 +18,7 @@
*/ */
/** /**
\file htdocs/public/dons/therm.php \file htdocs/public/donations/therm.php
\ingroup donation \ingroup donation
\brief Screen with thermometer \brief Screen with thermometer
\version $Id$ \version $Id$
@@ -35,7 +35,7 @@ $langs->setDefaultLang('auto');
* View * View
*/ */
$dontherm = new Don($db); $dontherm = new Don($db);
$intentValue = $dontherm->sum_donations(1); $intentValue = $dontherm->sum_donations(1);
$pendingValue = $dontherm->sum_donations(2); $pendingValue = $dontherm->sum_donations(2);
$actualValue = $dontherm->sum_donations(3); $actualValue = $dontherm->sum_donations(3);
@@ -43,7 +43,7 @@ $actualValue = $dontherm->sum_donations(3);
$db->close(); $db->close();
/* /*
* Graph thermometer * Graph thermometer
*/ */
print moneyMeter($actualValue, $pendingValue, $intentValue); print moneyMeter($actualValue, $pendingValue, $intentValue);

View File

@@ -11,7 +11,7 @@
Sorry. You are not allowed to access this resource. Sorry. You are not allowed to access this resource.
<br> <br>
You come from <?php print $_SERVER["HTTP_REFERER"] ?>. <?php print isset($_SERVER["HTTP_REFERER"])?'You come from '.$_SERVER["HTTP_REFERER"].'.':''; ?>
<hr> <hr>
</body> </body>

View File

@@ -11,7 +11,7 @@
You requested a page that does not exists. You requested a page that does not exists.
<br> <br>
You come from <?php print $_SERVER["HTTP_REFERER"] ?>. <?php print isset($_SERVER["HTTP_REFERER"])?'You come from '.$_SERVER["HTTP_REFERER"].'.':''; ?>
<hr> <hr>
</body> </body>

31
htdocs/public/index.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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');
?>

View File

@@ -0,0 +1,31 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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');
?>

View File

@@ -19,7 +19,7 @@
*/ */
/** /**
\file htdocs/public/adherents/new.php \file htdocs/public/members/new.php
\ingroup adherent \ingroup adherent
\brief Form example to add a new member \brief Form example to add a new member
\version $Id$ \version $Id$
@@ -229,7 +229,7 @@ print "</td>\n";
print '<td valign="top" rowspan="14"><textarea name="comment" wrap="soft" cols="40" rows="25">'.$comment.'</textarea></td></tr>'; print '<td valign="top" rowspan="14"><textarea name="comment" wrap="soft" cols="40" rows="25">'.$comment.'</textarea></td></tr>';
print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> '.$langs->trans("Surname").'</td><td><input type="text" name="prenom" size="40" value="'.$prenom.'"></td></tr>'; print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> '.$langs->trans("Surname").'</td><td><input type="text" name="prenom" size="40" value="'.$prenom.'"></td></tr>';
print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> '.$langs->trans("Name").'</td><td><input type="text" name="nom" size="40" value="'.$nom.'"></td></tr>'; print '<tr><td><FONT COLOR="red">*</FONT> <FONT COLOR="blue">*</FONT> '.$langs->trans("Name").'</td><td><input type="text" name="nom" size="40" value="'.$nom.'"></td></tr>';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td><input type="text" name="societe" size="40" value="'.$societe.'"></td></tr>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td><input type="text" name="societe" size="40" value="'.$societe.'"></td></tr>';

View File

@@ -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 * \brief Fichier de gestion de la popup de selection de date eldy
* \version $Id$ * \version $Id$
*/ */
@@ -76,15 +76,15 @@ if ($rowid > 0)
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$adh->societe.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$adh->societe.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Address").'</td><td class="valeur">'.nl2br($adh->adresse).'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Address").'</td><td class="valeur">'.nl2br($adh->adresse).'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Zip").' '.$langs->trans("Town").'</td><td class="valeur">'.$adh->cp.' '.$adh->ville.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Zip").' '.$langs->trans("Town").'</td><td class="valeur">'.$adh->cp.' '.$adh->ville.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'.$adh->pays.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'.$adh->pays.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.$adh->naiss.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.$adh->naiss.'&nbsp;</td></tr>';
if (isset($adh->photo) && $adh->photo !=''){ if (isset($adh->photo) && $adh->photo !=''){
print '<tr><td>URL Photo</td><td class="valeur">'."<A HREF=\"$adh->photo\"><IMG SRC=\"$adh->photo\"></A>".'&nbsp;</td></tr>'; print '<tr><td>URL Photo</td><td class="valeur">'."<A HREF=\"$adh->photo\"><IMG SRC=\"$adh->photo\"></A>".'&nbsp;</td></tr>';
} }
@@ -93,7 +93,7 @@ if ($rowid > 0)
// } // }
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'.nl2br($adh->note).'</td></tr>'; print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>'.nl2br($adh->note).'</td></tr>';
print '</table>'; print '</table>';
} }

View File

@@ -19,7 +19,7 @@
*/ */
/** /**
\file htdocs/public/adherents/priv_liste.php \file htdocs/public/members/priv_liste.php
\brief File sample to list members \brief File sample to list members
\version $Id$ \version $Id$
*/ */
@@ -48,8 +48,8 @@ function llxHeaderVierge($title, $head = "")
function llxFooter() function llxFooter()
{ {
print "</body>\n"; print "</body>\n";
print "</html>\n"; print "</html>\n";
} }

View File

@@ -0,0 +1,31 @@
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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');
?>

View File

@@ -0,0 +1,198 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<center>';
print '<form name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="action" value="dopayment">';
print '<input type="hidden" name="amount" value="'.$_REQUEST["amount"].'">';
print '<input type="hidden" name="tag" value="'.$_REQUEST["tag"].'">';
print "\n";
print '<table style="font-size:14px;" summary="Logo" width="80%">'."\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&amp;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&amp;file='.urlencode($mysoc->logo);
$width=96;
}
if ($urllogo)
{
print '<tr>';
print '<td align="center"><img title="'.$title.'" src="'.$urllogo.'"';
if ($width) print ' width="'.$width.'"';
print '></td>';
print '</tr>'."\n";
}
print '<tr><td align="center"><br>'.$langs->trans("WelcomeOnPaymentPage").'<br></td></tr>'."\n";
print '<tr><td align="left"><br>'.$langs->trans("ThisScreenAllowsYouToPay",$mysoc->nom).'<br><br></td></tr>'."\n";
print '<tr><td align="center">';
print '<table with="100%">';
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("ThisIsInformationOnPayment").' :</td></tr>'."\n";
$found=false;
$var=false;
if (is_numeric($_REQUEST["amount"]))
{
$found=true;
// Currency
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$mysoc->nom.'</b></td></tr>'."\n";
// Amount
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
print '</td><td class="CTableRow'.($var?'1':'2').'">';
if (empty($amount) || ! is_numeric($amount)) print '<input class="flat" size=8 type="text" name="newamount" value="'.$_REQUEST["newamount"].'">';
else {
print '<b>'.price($amount).'</b>';
print '<input type="hidden" name="newamount" value="'.$amount.'">';
}
print '</td></tr>'."\n";
// Currency
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Currency");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>EUR</b></td></tr>'."\n";
// Tag
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$_REQUEST["tag"].'</b></td></tr>'."\n";
// EMail
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("YourEMail");
print ' ('.$langs->trans("ToComplete").')';
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="EMAIL" size="48" value="'.$_REQUEST["EMAIL"].'"></td></tr>'."\n";
}
if (! $found) $mesg=$langs->trans("ErrorBadParameters");
if ($mesg) print '<tr><td align="center" colspan="2"><br><div class="warning">'.$mesg.'</div></td></tr>';
print '<tr><td align="center" colspan="2"><br><input class="none" type="submit" name="dopayment" value="'.$langs->trans("PayBoxDoPayment").'"></td></tr>';
print '<tr><td align="center" colspan="2">'.$langs->trans("YouWillBeRedirectedOnPayBox").'...</td></tr>';
print '</table>';
print '</td></tr>';
print '</table>';
print '</form>';
print '</center>';
print '<br>';
html_print_footer($mysoc,$langs);
$db->close();
llxFooterPayBox('$Date$ - $Revision$');
?>

View File

@@ -0,0 +1,67 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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$');
?>

View File

@@ -0,0 +1,67 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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$');
?>

View File

@@ -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_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_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_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_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\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_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_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_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); 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);