New: Can edit options of autosubscribe form for member module

This commit is contained in:
Laurent Destailleur 2011-07-03 16:00:18 +00:00
parent 80477ccb58
commit 503ff66100
9 changed files with 251 additions and 105 deletions

188
htdocs/adherents/admin/public.php Executable file
View File

@ -0,0 +1,188 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2010 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/adherents/admin/public.php
* \ingroup member
* \brief File of main public page for member module
* \author Laurent Destailleur
* \version $Id: public.php,v 1.1 2011/07/03 16:00:19 eldy Exp $
*/
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php");
$action=GETPOST('action');
/*
* Actions
*/
if ($action == 'update')
{
$i=0;
$i+=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$_POST["MEMBER_ENABLE_PUBLIC"],'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$_POST["MEMBER_NEWFORM_AMOUNT"],'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$_POST["MEMBER_NEWFORM_EDITAMOUNT"],'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$_POST["MEMBER_NEWFORM_PAYONLINE"],'chaine',0,'',$conf->entity);
if ($i == 4) $mesg=$langs->trans("RecordModifiedSuccessfully");
}
/*
* View
*/
$form=new Form($db);
$help_url='EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
$head = member_admin_prepare_head($adh);
dol_fiche_head($head, 'public', $langs->trans("Member"), 0, 'user');
dol_htmloutput_mesg($mesg);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
{
jQuery(".drag").hide();
}
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\')
{
jQuery(".drag").show();
}
}
initfields();
jQuery("#MEMBER_ENABLE_PUBLIC").change(function() {
initfields();
});
})';
print '</script>'."\n";
}
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=true;
// Allow public form
$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
print "</td></tr>\n";
print '</form>';
// Type
/*$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="center">';
print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1);
print "</td></tr>\n"; */
// Amount
$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("DefaultAmount");
print '</td><td width="60" align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.$conf->global->MEMBER_NEWFORM_AMOUNT.'">';;
print "</td></tr>\n";
// Can edit
$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("CanEditAmount");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",$conf->global->MEMBER_NEWFORM_EDITAMOUNT,1);
print "</td></tr>\n";
if ($conf->paybox->enabled || $conf->paypal->enabled)
{
// Jump to an online payment page
$var=! $var;
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td width="60" align="right">';
$listofval=array();
if ($conf->paybox->enabled) $listofval['paybox']='Paybox';
if ($conf->paypal->enabled) $listofval['paypal']='PayPal';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,$conf->global->MEMBER_NEWFORM_PAYONLINE,1);
print "</td></tr>\n";
}
print '</table>';
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
print '</form>';
dol_fiche_end();
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
print '<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.'</a>';
/*
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><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'..'</td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>';
*/
$db->close();
llxFooter('$Date: 2011/07/03 16:00:19 $ - $Revision: 1.1 $');
?>

View File

@ -1,62 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2010 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/adherents/public.php
* \ingroup member
* \brief File of main public page for member module
* \author Laurent Destailleur
* \version $Id$
*/
require("../main.inc.php");
/*
* View
*/
llxHeader();
print_fiche_titre($langs->trans("PublicMembersArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="100%" class="notopnoleft">';
print $langs->trans('FollowingLinksArePublic').'<br>';
print '<br>';
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><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>';
print '</td></tr></table>';
$db->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,6 +1,6 @@
--
-- $Id: init_menu_auguria.sql,v 1.118 2011/06/29 17:55:34 eldy Exp $
-- $Revision: 1.118 $
-- $Id: init_menu_auguria.sql,v 1.119 2011/07/03 16:00:20 eldy Exp $
-- $Revision: 1.119 $
--
-- Menu base entries
-- This file is loaded when a menu handler base is activated (auguria, etc..)
@ -263,7 +263,6 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled && $conf->export->enabled', __HANDLER__, 'left', 4501__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'Datas', 1, 'members', '$user->rights->adherent->export', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/htpasswd.php?leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 1, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/cartes/carte.php?leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 2, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/public.php?leftmenu=member_public', 'MemberPublicLinks', 0, 'members', '$user->rights->adherent->export', '', 2, 4, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&amp;mainmenu=members', 'MembersType', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&amp;mainmenu=members&amp;action=create', 'New', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&amp;mainmenu=members', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__);

View File

@ -1,6 +1,6 @@
--
-- $Id$
-- $Revision$
-- $Id: init_menu_smartphone.sql,v 1.7 2011/07/03 16:00:20 eldy Exp $
-- $Revision: 1.7 $
--
-- Menu base entries
-- This file is loaded when a menu handler base is activated (auguria, etc..)
@ -281,7 +281,6 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled && $conf->export->enabled', __HANDLER__, 'left', 4501__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'Datas', 1, 'members', '$user->rights->adherent->export', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/htpasswd.php?leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 1, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/cartes/carte.php?leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 2, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/public.php?leftmenu=member_public', 'MemberPublicLinks', 0, 'members', '$user->rights->adherent->export', '', 2, 4, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?leftmenu=setup&amp;mainmenu=members', 'Setup', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup', 'MembersTypes', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/options.php?leftmenu=setup', 'MembersAttributes', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__);

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/includes/menus/standard/eldy.lib.php
* \brief Library for file eldy menus
* \version $Id: eldy.lib.php,v 1.53 2011/06/29 22:41:49 eldy Exp $
* \version $Id: eldy.lib.php,v 1.54 2011/07/03 16:00:18 eldy Exp $
*/
@ -1301,7 +1301,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
if ($leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
$newmenu->add("/adherents/public.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
// Type
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members",$langs->trans("MembersTypes"),0,$user->rights->adherent->configurer);
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members&amp;action=create",$langs->trans("New"),1,$user->rights->adherent->configurer);

View File

@ -76,7 +76,7 @@ EditMember=Edit member
SubscriptionEndDate=Subscription's end date
MembersTypeSetup=Members type setup
NewSubscription=New subscription
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription being already a member, please contact foundation board instead.
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead.
Subscription=Subscription
Subscriptions=Subscriptions
SubscriptionLate=Late
@ -109,7 +109,9 @@ ValidateMember=Validate a member
ConfirmValidateMember=Are you sure you want to validate this member ?
FollowingLinksArePublic=The following links are open pages not protected by any Dolibarr permission. They are not formated pages, provided as example to show how to list members database.
PublicMemberList=Public member list
BlankSubscriptionForm=Subscription form
BlankSubscriptionForm=Public auto-subscription form
BlankSubscriptionFormDesc=Dolibarr can provide you a public URL to allow external visitors to ask to subscribe to the foundation. If an online payment module is enabled, a payment form will also be automatically provided.
EnablePublicSubscriptionForm=Enable the public auto-subscription form
MemberPublicLinks=Public links/pages
ExportDataset_member_1=Members and subscriptions
ImportDataset_member_1=Members
@ -176,11 +178,14 @@ MembersStatisticsDesc=Choose statistics you want to read...
MenuMembersStats=Statistics
LastMemberDate=Last member date
Nature=Nature
Public=Public
Public=Information are public (no=private)
Exports=Exports
NewMemberbyWeb=New member added. Awaiting approval
NewMemberForm=New member form
SubscriptionsStatistics=Statistics on subscriptions
NbOfSubscriptions=Number of subscriptions
AmountOfSubscriptions=Amount of subscriptions
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
DefaultAmount=Default amount of subscription
CanEditAmount=Visitor can choose/edit amount of its subscription
MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page

View File

@ -110,7 +110,9 @@ ValidateMember=Valider un adhérent
ConfirmValidateMember=Êtes-vous sûr de vouloir valider cet adhérent ?
FollowingLinksArePublic=Les liens suivants sont des pages accessibles à tous et non protégées par aucune habilitation Dolibarr. Ces pages n'ont aucun formatage et sont fournies à titre d'exemple pour les associations qui veulent des scripts publics de consultation.
PublicMemberList=Liste des membres publics
BlankSubscriptionForm=Formulaire inscription
BlankSubscriptionForm=Formulaire publique d'auto-inscription
BlankSubscriptionFormDesc=Dolibarr peut offrir une URL de page publique pour les visiteurs externes permettant de postuler à une adhésion. Si un un module de paiement en ligne est également actif, un formulaire de paiement sera également automatiquement proposé.
EnablePublicSubscriptionForm=Activer le formulaire publique d'autoinscription
MemberPublicLinks=Liens/pages publiques
ExportDataset_member_1=Adhérents et adhésions
ImportDataset_member_1=Adhérents
@ -177,11 +179,14 @@ MembersStatisticsDesc=Choisissez les statistiques que vous désirez consulter...
MenuMembersStats=Statistiques
LastMemberDate=Date dernier adhérent
Nature=Nature
Public=Public
Public=Informations publiques (no=privées)
Exports=Exports
NewMemberbyWeb=Nouvel Adherent ajoute. En attente de validation
NewMemberForm=Nouvel Adherent form
SubscriptionsStatistics=Statistiques sur les cotisations
NbOfSubscriptions=Nombre de cotisations
AmountOfSubscriptions=Montant de cotisations
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
DefaultAmount=Montant par défaut de la cotisation
CanEditAmount=Le visiteur peut modifier/choisir le montant de sa cotisation
MEMBER_NEWFORM_PAYONLINE=Débrancher sur la page intégrée de paiement en ligne

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/lib/member.lib.php
* \brief Ensemble de fonctions de base pour les adherents
* \version $Id$
* \version $Id: member.lib.php,v 1.24 2011/07/03 16:00:19 eldy Exp $
*
* Ensemble de fonctions de base de dolibarr sous forme d'include
*/
@ -116,6 +116,11 @@ function member_admin_prepare_head($object)
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/public.php';
$head[$h][1] = $langs->trans("BlankSubscriptionForm");
$head[$h][2] = 'public';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@ -22,7 +22,7 @@
* \file htdocs/public/members/new.php
* \ingroup member
* \brief Example of form to add a new member
* \version $Id: new.php,v 1.29 2011/06/26 21:51:34 eldy Exp $
* \version $Id: new.php,v 1.30 2011/07/03 16:00:19 eldy Exp $
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form
@ -45,8 +45,12 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
// Security check
if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1);
// Init vars
$errmsg='';
$num=0;
$error=0;
$backtopage=GETPOST('backtopage');
$action=GETPOST('action');
// Load translation files
$langs->load("main");
@ -55,12 +59,14 @@ $langs->load("companies");
$langs->load("install");
$langs->load("other");
// Init vars
$errmsg='';
$num=0;
$error=0;
$backtopage=GETPOST('backtopage');
$action=GETPOST('action');
// Security check
if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1);
if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print $langs->trans("Auto subscription form for public visitors has no be enabled");
exit;
}
// Function for page HTML header
@ -263,7 +269,7 @@ if ($action == 'added')
print $langs->trans("NewMemberbyWeb");
print '</center>';
llxFooterVierge('$Date: 2011/06/26 21:51:34 $ - $Revision: 1.29 $');
llxFooterVierge('$Date: 2011/07/03 16:00:19 $ - $Revision: 1.30 $');
exit;
}
@ -290,7 +296,7 @@ if (! empty($conf->global->MEMBER_NEWFORM_TEXT)) print $langs->trans($conf->glob
dol_htmloutput_errors($errmsg);
print '<br>'.$langs->trans("FieldsWithAreMandatory",'*').'<br>';
print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print '<script type="text/javascript">
jQuery(document).ready(function () {
@ -326,8 +332,13 @@ print '<table class="border">'."\n";
// Type
if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE))
{
print '<tr><td width="15%">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td width="35%">';
print $html->selectarray("type", $adht->liste_array(), GETPOST('type'), 1);
$listoftype=$adht->liste_array();
$tmp=array_keys($listoftype);
$defaulttype='';
$isempty=1;
if (sizeof($listoftype)==1) { $defaulttype=$tmp[0]; $isempty=0; }
print '<tr><td width="15%">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td width="35%">';
print $html->selectarray("type", $adht->liste_array(), GETPOST('type')?GETPOST('type'):$defaulttype, $isempty);
print '</td></tr>'."\n";
}
else
@ -341,7 +352,7 @@ $morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY))
{
print '<tr><td>'.$langs->trans("MorPhy").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT> </td><td>'."\n";
print '<tr><td>'.$langs->trans("MorPhy").' <FONT COLOR="red">*</FONT></td><td>'."\n";
print $html->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
print '</td></tr>'."\n";
}
@ -354,9 +365,9 @@ else
print '<tr><td>'.$langs->trans("Civility").'</td><td>';
print $formcompany->select_civilite(GETPOST('civilite_id'),'civilite_id').'</td></tr>'."\n";
// Lastname
print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td><input type="text" name="nom" size="40" value="'.dol_escape_htmltag(GETPOST('nom')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="nom" size="40" value="'.dol_escape_htmltag(GETPOST('nom')).'"></td></tr>'."\n";
// Firstname
print '<tr><td>'.$langs->trans("Firstname").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td><input type="text" name="prenom" size="40" value="'.dol_escape_htmltag(GETPOST('prenom')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Firstname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="prenom" size="40" value="'.dol_escape_htmltag(GETPOST('prenom')).'"></td></tr>'."\n";
// Company
print '<tr id="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
// Address
@ -380,12 +391,12 @@ print '</td></tr>';
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($pays_id) print $formcompany->select_state(GETPOST("departement_id"),$pays_code);
if ($pays_code) print $formcompany->select_state(GETPOST("departement_id"),$pays_code);
else print '';
print '</td></tr>';
}
// EMail
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
@ -398,9 +409,9 @@ print '<tr><td>'.$langs->trans("Birthday").'</td><td>';
print $html->select_date($birthday,'birth',0,0,1,"newmember");
print '</td></tr>'."\n";
// Photo
print '<tr><td>'.$langs->trans("URLPhoto").' <FONT COLOR="blue">**</FONT></td><td><input type="text" name="photo" size="40" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" size="40" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
// Public
print '<tr><td>'.$langs->trans("Public").' ?</td><td><input type="checkbox" name="public" value="1" checked></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Public").'</td><td><input type="checkbox" name="public" value="1" checked></td></tr>'."\n";
// Extrafields
foreach($extrafields->attribute_label as $key=>$value)
{
@ -459,21 +470,18 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)
$amount=GETPOST('amount')?GETPOST('amount'):$conf->global->MEMBER_NEWFORM_AMOUNT;
}
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal' or 'paybox'
print '<tr><td>'.$langs->trans("Subscription").'</td><td>';
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT))
{
print '<tr><td>'.$langs->trans("Subscription").'</td><td>';
print '<input type="text" name="amount" id="amount" class="flat" size="6" value="'.$amount.'">';
print ' € or $';
print '</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans("Subscription").'</td><td>';
print $amount;
print '<input type="hidden" name="amount" id="amount" class="flat" size="6" value="'.$amount.'">';
print ' € or $';
print '</td></tr>';
}
print ' '.$langs->trans("Currency".$conf->monnaie);
print '</td></tr>';
}
print "</table>\n";
@ -490,5 +498,5 @@ print "<br></form>\n";
$db->close();
llxFooterVierge('$Date: 2011/06/26 21:51:34 $ - $Revision: 1.29 $');
llxFooterVierge('$Date: 2011/07/03 16:00:19 $ - $Revision: 1.30 $');
?>