thirdparty creation OK, wip on conforboothattendee creation
This commit is contained in:
parent
60341e8a14
commit
a590f945e9
@ -111,7 +111,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
|
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
|
||||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
|
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2),
|
||||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
|
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
|
||||||
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,),
|
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||||
|
|||||||
@ -493,10 +493,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||||
$link_subscription = 'http://localhost/dolibarr/htdocs/public/members/attendee_subscription.php?id=';
|
$link_subscription = 'http://localhost/dolibarr/htdocs/public/eventorganization/attendee_subscription.php?id=';
|
||||||
//$link_subscription .= base64_encode($id);
|
//$link_subscription .= base64_encode($id);
|
||||||
$key = 'DV3PH';
|
$key = 'DV3PH';
|
||||||
$link_subscription .= openssl_encrypt($id, 'aes-256-ctr', $key);
|
$link_subscription .= dol_encode($id, $key);
|
||||||
$link_subscription .= '&securekey='.$conf->global->EVENTORGANIZATION_SECUREKEY;
|
$link_subscription .= '&securekey='.$conf->global->EVENTORGANIZATION_SECUREKEY;
|
||||||
$object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1);
|
$object->fields['pubregister'] = array('type'=>'url', 'label'=>'Lien public d\'enregistrement à une conférence', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1);
|
||||||
$object->pubregister = $link_subscription;
|
$object->pubregister = $link_subscription;
|
||||||
|
|||||||
@ -325,7 +325,7 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee(
|
|||||||
note_private text,
|
note_private text,
|
||||||
date_creation datetime NOT NULL,
|
date_creation datetime NOT NULL,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
fk_user_creat integer NOT NULL,
|
fk_user_creat integer,
|
||||||
fk_user_modif integer,
|
fk_user_modif integer,
|
||||||
last_main_doc varchar(255),
|
last_main_doc varchar(255),
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
@ -339,7 +339,6 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_evento
|
|||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm);
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm(id);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm(id);
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_email (email);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_email (email);
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT llx_eventorganization_conferenceorboothattendee_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
|
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status);
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_actioncomm, email);
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_actioncomm, email);
|
||||||
|
|
||||||
|
|||||||
@ -94,6 +94,7 @@ EvntOrgCancelled = Cancelled
|
|||||||
#
|
#
|
||||||
# Public page
|
# Public page
|
||||||
#
|
#
|
||||||
|
MissingOrBadSecureKey = The security key is invalid or missing
|
||||||
EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference
|
EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference
|
||||||
EvntOrgStartDuration = This conference starts on
|
EvntOrgStartDuration = This conference starts on
|
||||||
EvntOrgEndDuration = and ends on
|
EvntOrgEndDuration = and ends on
|
||||||
|
|||||||
@ -1,412 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
|
|
||||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
|
||||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
|
||||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
|
||||||
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file htdocs/public/members/new.php
|
|
||||||
* \ingroup member
|
|
||||||
* \brief Example of form to add a new member
|
|
||||||
*
|
|
||||||
* Note that you can add following constant to change behaviour of page
|
|
||||||
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
|
|
||||||
* MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited
|
|
||||||
* MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe
|
|
||||||
* MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation)
|
|
||||||
* MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted
|
|
||||||
* MEMBER_NEWFORM_FORCETYPE Force type of member
|
|
||||||
* MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy)
|
|
||||||
* MEMBER_NEWFORM_FORCECOUNTRYCODE Force country
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('NOLOGIN')) {
|
|
||||||
define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
|
||||||
}
|
|
||||||
if (!defined('NOCSRFCHECK')) {
|
|
||||||
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
|
||||||
}
|
|
||||||
if (!defined('NOIPCHECK')) {
|
|
||||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
|
||||||
}
|
|
||||||
if (!defined('NOBROWSERNOTIF')) {
|
|
||||||
define('NOBROWSERNOTIF', '1');
|
|
||||||
}
|
|
||||||
if (!defined('NOIPCHECK')) {
|
|
||||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
|
||||||
}
|
|
||||||
|
|
||||||
// For MultiCompany module.
|
|
||||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
|
||||||
// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
|
|
||||||
$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
|
|
||||||
if (is_numeric($entity)) {
|
|
||||||
define("DOLENTITY", $entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
require '../../main.inc.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|
||||||
|
|
||||||
|
|
||||||
// Init vars
|
|
||||||
$errmsg = '';
|
|
||||||
$num = 0;
|
|
||||||
$error = 0;
|
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
|
||||||
//$id = base64_decode(GETPOST("id"));
|
|
||||||
$key = 'DV3PH';
|
|
||||||
$id = openssl_decrypt(GETPOST('id'), 'aes-256-ctr', $key);
|
|
||||||
|
|
||||||
// Securekey check
|
|
||||||
$securekey = GETPOST('securekey', 'alpha');
|
|
||||||
if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY) {
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load translation files
|
|
||||||
$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization"));
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
|
||||||
$hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
|
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
|
||||||
|
|
||||||
$user->loadDefaultValues();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show header for new member
|
|
||||||
*
|
|
||||||
* @param string $title Title
|
|
||||||
* @param string $head Head array
|
|
||||||
* @param int $disablejs More content into html header
|
|
||||||
* @param int $disablehead More content into html header
|
|
||||||
* @param array $arrayofjs Array of complementary js files
|
|
||||||
* @param array $arrayofcss Array of complementary css files
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
|
|
||||||
{
|
|
||||||
global $user, $conf, $langs, $mysoc;
|
|
||||||
|
|
||||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
|
||||||
|
|
||||||
print '<body id="mainbody" class="publicnewmemberform">';
|
|
||||||
|
|
||||||
// Define urllogo
|
|
||||||
$urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
|
|
||||||
|
|
||||||
if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
|
|
||||||
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo);
|
|
||||||
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
|
|
||||||
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<div class="center">';
|
|
||||||
// Output html code for logo
|
|
||||||
if ($urllogo) {
|
|
||||||
print '<div class="backgreypublicpayment">';
|
|
||||||
print '<div class="logopublicpayment">';
|
|
||||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
|
||||||
print '>';
|
|
||||||
print '</div>';
|
|
||||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
|
||||||
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<div class="divmainbodylarge">';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show footer for new member
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function llxFooterVierge()
|
|
||||||
{
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
printCommonFooter('public');
|
|
||||||
|
|
||||||
print "</body>\n";
|
|
||||||
print "</html>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Actions
|
|
||||||
*/
|
|
||||||
$parameters = array();
|
|
||||||
// Note that $action and $object may have been modified by some hooks
|
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
|
|
||||||
if ($reshook < 0) {
|
|
||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action called when page is submitted
|
|
||||||
if (empty($reshook) && $action == 'add') {
|
|
||||||
$error = 0;
|
|
||||||
$urlback = '';
|
|
||||||
|
|
||||||
$db->begin();
|
|
||||||
|
|
||||||
if (!GETPOST("email")) {
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
|
||||||
}
|
|
||||||
if (!GETPOST("societe")) {
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n";
|
|
||||||
}
|
|
||||||
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
|
||||||
$error++;
|
|
||||||
$langs->load("errors");
|
|
||||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
|
|
||||||
}
|
|
||||||
if (!$error) {
|
|
||||||
// Vérifier si client existe
|
|
||||||
$thirdparty = new Societe($db);
|
|
||||||
$nomsociete = GETPOST("societe");
|
|
||||||
// @todo utiliser fetch avec la "réf"
|
|
||||||
$resultfetchthirdparty = $thirdparty->fetch('', $nomsociete);
|
|
||||||
if($resultfetchthirdparty<0){
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $thirdparty->error;
|
|
||||||
$res = -1;
|
|
||||||
} elseif($resultfetchthirdparty==0){
|
|
||||||
// creation of a new thirdparty
|
|
||||||
$thirdparty->name = $nomsociete;
|
|
||||||
$thirdparty->address = GETPOST("address");
|
|
||||||
$thirdparty->zip = GETPOST("zipcode");
|
|
||||||
$thirdparty->town = GETPOST("town");
|
|
||||||
$thirdparty->client = 2;
|
|
||||||
$thirdparty->fournisseur = 0;
|
|
||||||
$thirdparty->country_id = GETPOST("country_id", 'int');
|
|
||||||
$thirdparty->state_id = GETPOST("state_id", 'int');
|
|
||||||
//$thirdparty->code_client = -1;
|
|
||||||
//$thirdparty->code_fournisseur = -1;
|
|
||||||
|
|
||||||
// Load object modCodeTiers
|
|
||||||
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
|
|
||||||
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
|
|
||||||
$module = substr($module, 0, dol_strlen($module) - 4);
|
|
||||||
}
|
|
||||||
$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
|
|
||||||
foreach ($dirsociete as $dirroot) {
|
|
||||||
$res = dol_include_once($dirroot.$module.'.php');
|
|
||||||
if ($res) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$modCodeClient = new $module($db);
|
|
||||||
// We verified if the tag prefix is used
|
|
||||||
if ($modCodeClient->code_auto) {
|
|
||||||
$prefixCustomerIsUsed = $modCodeClient->verif_prefixIsUsed();
|
|
||||||
}
|
|
||||||
$module = $conf->global->SOCIETE_CODECLIENT_ADDON;
|
|
||||||
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
|
|
||||||
$module = substr($module, 0, dol_strlen($module) - 4);
|
|
||||||
}
|
|
||||||
$dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']);
|
|
||||||
foreach ($dirsociete as $dirroot) {
|
|
||||||
$res = dol_include_once($dirroot.$module.'.php');
|
|
||||||
if ($res) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = $thirdparty->create($user);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($res < 0){
|
|
||||||
$error++;
|
|
||||||
$errmsg .= $thirdparty->error;
|
|
||||||
} else {
|
|
||||||
// creation of an attendee
|
|
||||||
$confattendee = new ConferenceOrBoothAttendee($db);
|
|
||||||
$confattendee->fk_soc = $thirdparty->id;
|
|
||||||
$confattendee->date_subscription = dol_now();
|
|
||||||
$confattendee->email = GETPOST("email");
|
|
||||||
$confattendee->fk_actioncomm = $id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$db->commit();
|
|
||||||
Header("Location: ".$urlback);
|
|
||||||
exit;
|
|
||||||
} else {
|
|
||||||
$db->rollback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action called after a submitted was send and member created successfully
|
|
||||||
// If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url.
|
|
||||||
// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url.
|
|
||||||
if (empty($reshook) && $action == 'added') {
|
|
||||||
llxHeaderVierge($langs->trans("NewMemberForm"));
|
|
||||||
|
|
||||||
// Si on a pas ete redirige
|
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
|
||||||
print $langs->trans("NewMemberbyWeb");
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
llxFooterVierge();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* View
|
|
||||||
*/
|
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
$formcompany = new FormCompany($db);
|
|
||||||
|
|
||||||
$conference = new ConferenceOrBooth($db);
|
|
||||||
$resultconf = $conference->fetch($id);
|
|
||||||
if ($resultconf < 0){
|
|
||||||
setEventMessages(null, $object->errors, "errors");
|
|
||||||
}
|
|
||||||
|
|
||||||
llxHeaderVierge($langs->trans("NewSubscription"));
|
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center');
|
|
||||||
|
|
||||||
|
|
||||||
print '<div align="center">';
|
|
||||||
print '<div id="divsubscribe">';
|
|
||||||
print '<div class="center subscriptionformhelptext justify">';
|
|
||||||
|
|
||||||
// Welcome message
|
|
||||||
print $langs->trans("EvntOrgWelcomeMessage");
|
|
||||||
print $id.".".'<br>';
|
|
||||||
print $langs->trans("EvntOrgStartDuration");
|
|
||||||
print dol_print_date($conference->datep).' ';
|
|
||||||
print $langs->trans("EvntOrgEndDuration");
|
|
||||||
print ' '.dol_print_date($conference->datef).".";
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
dol_htmloutput_errors($errmsg);
|
|
||||||
|
|
||||||
// Print form
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'."\n";
|
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'" / >';
|
|
||||||
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
|
||||||
print '<input type="hidden" name="action" value="add" />';
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
|
|
||||||
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
|
|
||||||
|
|
||||||
print dol_get_fiche_head('');
|
|
||||||
|
|
||||||
print '<script type="text/javascript">
|
|
||||||
jQuery(document).ready(function () {
|
|
||||||
jQuery(document).ready(function () {
|
|
||||||
jQuery("#selectcountry_id").change(function() {
|
|
||||||
document.newmember.action.value="create";
|
|
||||||
document.newmember.submit();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>';
|
|
||||||
|
|
||||||
print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
|
|
||||||
|
|
||||||
// Company
|
|
||||||
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
|
|
||||||
// Address
|
|
||||||
print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
|
|
||||||
print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
|
|
||||||
// Zip / Town
|
|
||||||
print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>';
|
|
||||||
print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
|
|
||||||
print ' / ';
|
|
||||||
print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
|
|
||||||
print '</td></tr>';
|
|
||||||
// Country
|
|
||||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
|
||||||
$country_id = GETPOST('country_id');
|
|
||||||
if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) {
|
|
||||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
|
||||||
}
|
|
||||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
|
||||||
$country_code = dol_user_country();
|
|
||||||
//print $country_code;
|
|
||||||
if ($country_code) {
|
|
||||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
|
||||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
|
||||||
if ($new_country_id) {
|
|
||||||
$country_id = $new_country_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
|
||||||
print $form->select_country($country_id, 'country_id');
|
|
||||||
print '</td></tr>';
|
|
||||||
// State
|
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
|
||||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
|
||||||
if ($country_code) {
|
|
||||||
print $formcompany->select_state(GETPOST("state_id"), $country_code);
|
|
||||||
} else {
|
|
||||||
print '';
|
|
||||||
}
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
// Email
|
|
||||||
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
|
|
||||||
|
|
||||||
print "</table>\n";
|
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
|
||||||
|
|
||||||
// Save
|
|
||||||
print '<div class="center">';
|
|
||||||
print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">';
|
|
||||||
if (!empty($backtopage)) {
|
|
||||||
print ' <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
|
|
||||||
print "</form>\n";
|
|
||||||
print "<br>";
|
|
||||||
print '</div></div>';
|
|
||||||
|
|
||||||
|
|
||||||
llxFooterVierge();
|
|
||||||
|
|
||||||
$db->close();
|
|
||||||
Loading…
Reference in New Issue
Block a user