From e8acf038f2c9d6274b57406c7b1476727bec11de Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Fri, 16 Sep 2016 18:38:01 +0000 Subject: [PATCH] Fix #687 @1 --- framework/application/controllers/AjaxController.php | 12 +++++++++++- framework/application/views/helpers/QuoteForm.php | 6 ++++-- less/315-quote.less | 4 ++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/framework/application/controllers/AjaxController.php b/framework/application/controllers/AjaxController.php index b4eaf78..368beb5 100644 --- a/framework/application/controllers/AjaxController.php +++ b/framework/application/controllers/AjaxController.php @@ -22,7 +22,17 @@ class AjaxController extends CubeIT_Controller_AjaxController { $okmessage = (string)$okmessage->content; } - $this->_datas->addReplace('#' . $formID, '
' . $okmessage . '
'); + // If we're processing the popup form, the success message will replace the whole section including the text + // Otherwise, just the form itself is replaced. + if ($formID == 'requestQuotePopup') { + // Todo: work out why CSS isn't taking effect (see #confirmationQuote in 315-quote.less) - using inline CSS for now. + // Todo: see issue https://team.cubedesigners.com/redmine/issues/737 for possible cause + $this->_datas->addReplace('#' . $formID .'Wrapper', '
' . $okmessage . '
'); + } else { + $this->_datas->addReplace('#' . $formID, '
' . $okmessage . '
'); + } + + $this->_datas->addGAEvent('form', 'sent', 'quote'); } else { $this->_datas->refreshForm($form); // Respond with validation errors diff --git a/framework/application/views/helpers/QuoteForm.php b/framework/application/views/helpers/QuoteForm.php index 147d136..1d67d89 100644 --- a/framework/application/views/helpers/QuoteForm.php +++ b/framework/application/views/helpers/QuoteForm.php @@ -12,9 +12,11 @@ class Fluidbook_View_Helper_QuoteForm extends CubeIT_View_Helper_Abstract { if ($formID) { $form->setId($formID); $form->setAction($form->getAction() . '/' . $formID); - } + } else { + $formID = $form->getId(); + } - $res = '
'; + $res = '
'; $res .= '
'; $res .= $this->title($this->option('quote_heading')); $res .= $this->markupDotclear($this->option('quote_description')); diff --git a/less/315-quote.less b/less/315-quote.less index 3f7dfd5..49e3619 100644 --- a/less/315-quote.less +++ b/less/315-quote.less @@ -225,6 +225,10 @@ font-size: 22px; padding: 200px 120px; text-align: center; + + .ajaxpopup & { + background-color: #fff; + } } .popupWindow .closePopup { -- 2.39.5