From df78aaff889bfab4b3803e07b8d4267ce47ea895 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:49:00 +0200 Subject: [PATCH] now 2 distinct pages to suggest a conf or a booth --- htdocs/public/project/index.php | 45 ++++++++++++--------- htdocs/public/project/suggestbooth.php | 16 ++------ htdocs/public/project/suggestconference.php | 16 ++------ 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce48db9e729..9ddfc8ce759 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -103,6 +103,23 @@ if ($resultproject < 0) { * Actions */ +if (GETPOST('suggestbooth')) { + header("Location: ".dol_buildpath('/public/project/suggestbooth.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('suggestconference')) { + header("Location: ".dol_buildpath('/public/project/suggestconference.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('viewandvote')) { + header("Location: ".dol_buildpath('/public/project/viewandvote.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + + + /* * View @@ -119,24 +136,15 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); - -// Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); -} -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} - - print ''."\n"; print '
'."\n"; print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; -print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; print ''; print ''; print "\n"; @@ -200,15 +208,16 @@ print "\n"; // Show all action buttons print '
'; // Output introduction text -if ($project->accept_conference_suggestions) { - print ''; +if ($project->accept_booth_suggestions) { + print ''; print '

'; } -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; +if ($project->accept_conference_suggestions) { + print ''; + print '

'; } +print ''; + diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index e4c030c9718..119741f6233 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -90,9 +90,7 @@ $note = GETPOST("note"); $datestart = GETPOST("datestart"); $dateend = GETPOST("dateend"); -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$id = GETPOST('id'); $project = new Project($db); $resultproject = $project->fetch($id); @@ -102,7 +100,6 @@ if ($resultproject < 0) { } // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -122,7 +119,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); /** * Show header for new member @@ -322,13 +319,8 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); if ($resultcategory<=0) { $error++; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index e4c030c9718..68ed90fc260 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -90,9 +90,7 @@ $note = GETPOST("note"); $datestart = GETPOST("datestart"); $dateend = GETPOST("dateend"); -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$id = GETPOST('id'); $project = new Project($db); $resultproject = $project->fetch($id); @@ -102,7 +100,6 @@ if ($resultproject < 0) { } // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -122,7 +119,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); /** * Show header for new member @@ -322,13 +319,8 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); if ($resultcategory<=0) { $error++;