From: vincent@cubedesigners.com Date: Wed, 18 Dec 2019 16:33:24 +0000 (+0000) Subject: done #3219 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b6c5af7c4fe84b9d82fadc50649a60a90793f43c;p=fluidbook-v3.git done #3219 @0.5 --- diff --git a/framework/application/controllers/AjaxpopupController.php b/framework/application/controllers/AjaxpopupController.php index bdc4be5..39a7798 100644 --- a/framework/application/controllers/AjaxpopupController.php +++ b/framework/application/controllers/AjaxpopupController.php @@ -12,7 +12,7 @@ class AjaxpopupController extends CubeIT_Controller_AjaxpopupController { } public function quoteForm() { - return $this->view->quoteForm('requestQuotePopup'); // Different ID for popup form so it doesn't conflict with contact page form + return $this->view->quoteForm('requestQuotePopup',false,true); // Different ID for popup form so it doesn't conflict with contact page form } diff --git a/framework/application/views/helpers/ContactDetails.php b/framework/application/views/helpers/ContactDetails.php new file mode 100644 index 0000000..a5409f8 --- /dev/null +++ b/framework/application/views/helpers/ContactDetails.php @@ -0,0 +1,25 @@ +option('address'); + $locale = new Zend_Locale(); + $country = strtoupper($locale->getTranslation($address['pays'], 'Territory')); + $content = '
'; + $content .= '

' . $address['company'] . '

'; + $content .= $address['adresse']; + $content .= '
'; + $content .= "{$address['code_postal']} {$address['ville']} - $country"; + $content .= '
'; + $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']); + $content .= '
'; + $content .= __('email :') . ' ' . $this->linkEmail($address['email']); + $content .= '
'; + return $content; + } +} \ No newline at end of file diff --git a/framework/application/views/helpers/QuoteForm.php b/framework/application/views/helpers/QuoteForm.php index bab3407..e7324f3 100644 --- a/framework/application/views/helpers/QuoteForm.php +++ b/framework/application/views/helpers/QuoteForm.php @@ -1,39 +1,44 @@ headScript()->addScriptAndStyle('005-fancyselect'); - $this->headScript()->addScriptAndStyle('315-quote'); - - $form = new Fluidbook_Form_RequestQuote(); - - if ($formID) { - $form->setId($formID); - $form->setAction($form->getAction() . '/' . $formID); - } else { - $formID = $form->getId(); - } - - - $res = '
'; - $res .= $this->title($this->option('quote_heading'), 'h2'); - $res .= $this->markupDotclear($this->option('quote_description')); - $res .= '
'; // .text - $res .= '
'; - $res .= $form; - $res .= '
'; - $res .= '
'; // .form - - $attrs = array('class' => array('request-quote', 'content-wrapper', 'grid'), - 'id' => $formID . 'Wrapper'); - if ($paddingTop) { - $attrs['class'][] = 'pad'; - } - - return $this->htmlElement($res, 'div', $attrs); - - return $res; - } +class Fluidbook_View_Helper_QuoteForm extends CubeIT_View_Helper_Abstract +{ + + public function quoteForm($formID = null, $paddingTop = false, $contact = false) + { + + $this->headScript()->addScriptAndStyle('005-fancyselect'); + $this->headScript()->addScriptAndStyle('315-quote'); + + $form = new Fluidbook_Form_RequestQuote(); + + if ($formID) { + $form->setId($formID); + $form->setAction($form->getAction() . '/' . $formID); + } else { + $formID = $form->getId(); + } + + + $res = '
'; + $res .= $this->title($this->option('quote_heading'), 'h2'); + $res .= $this->markupDotclear($this->option('quote_description')); + if ($contact) { + $res .= '
' . $this->contactDetails() . '
'; + } + $res .= '
'; // .text + $res .= '
'; + $res .= $form; + $res .= '
'; + $res .= '
'; // .form + + $attrs = array('class' => array('request-quote', 'content-wrapper', 'grid'), + 'id' => $formID . 'Wrapper'); + if ($paddingTop) { + $attrs['class'][] = 'pad'; + } + + return $this->htmlElement($res, 'div', $attrs); + + return $res; + } } diff --git a/framework/application/views/scripts/templates/contact.phtml b/framework/application/views/scripts/templates/contact.phtml index b489b7e..5aa6029 100644 --- a/framework/application/views/scripts/templates/contact.phtml +++ b/framework/application/views/scripts/templates/contact.phtml @@ -2,19 +2,9 @@ $this->headScript()->addScriptAndStyle('310-contact'); -$address = $this->option('address'); -$locale = new Zend_Locale(); -$country = strtoupper($locale->getTranslation($address['pays'], 'Territory')); -$content = '
'; -$content .= '

' . $address['company'] . '

'; -$content .= $address['adresse']; -$content .= '
'; -$content .= "{$address['code_postal']} {$address['ville']} - $country"; -$content .= '
'; -$content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']); -$content .= '
'; -$content .= __('email :') . ' ' . $this->linkEmail($address['email']); -$content .= '
'; +$locale=new Zend_Locale(); + +$content = $this->contactDetails(); // Request Quote form $form = $this->quoteForm(null, $this->form_first); @@ -24,9 +14,9 @@ $intro .= $this->introBlock($this->intro, $content, '', !$this->form_first); $intro .= ''; // .contact-intro if ($this->form_first) { - $res = $form . $intro; + $res = $form . $intro; } else { - $res = $intro . $form; + $res = $intro . $form; } @@ -34,11 +24,11 @@ if ($this->form_first) { $res .= '
'; $res .= '

' . nl2br($this->resellers_title) . '

'; foreach ($this->resellers as $reseller) { - $res .= '
'; - $res .= '

' . $locale->getTranslation($reseller['country'], 'Territory') . '

'; - $res .= $reseller['company']; - $res .= $this->markupDotclear($reseller['details']); - $res .= '
'; // .reseller + $res .= '
'; + $res .= '

' . $locale->getTranslation($reseller['country'], 'Territory') . '

'; + $res .= $reseller['company']; + $res .= $this->markupDotclear($reseller['details']); + $res .= '
'; // .reseller } $res .= '
'; // .resellers