]> _ Git - fluidbook-v3.git/commitdiff
done #3219 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 18 Dec 2019 16:33:24 +0000 (16:33 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 18 Dec 2019 16:33:24 +0000 (16:33 +0000)
framework/application/controllers/AjaxpopupController.php
framework/application/views/helpers/ContactDetails.php [new file with mode: 0644]
framework/application/views/helpers/QuoteForm.php
framework/application/views/scripts/templates/contact.phtml

index bdc4be5eb5be3f6426140ccc5afaa8c1334bd097..39a779828a0b65b6342f66ca123eb7118ba68313 100644 (file)
@@ -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 (file)
index 0000000..a5409f8
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_ContactDetails extends CubeIT_View_Helper_Abstract\r
+{\r
+    /**\r
+     * @return string\r
+     */\r
+    public function contactDetails()\r
+    {\r
+        $address = $this->option('address');\r
+        $locale = new Zend_Locale();\r
+        $country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));\r
+        $content = '<address>';\r
+        $content .= '<h4>' . $address['company'] . '</h4>';\r
+        $content .= $address['adresse'];\r
+        $content .= '<br>';\r
+        $content .= "{$address['code_postal']} {$address['ville']} - $country";\r
+        $content .= '<br>';\r
+        $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);\r
+        $content .= '<br>';\r
+        $content .= __('email :') . ' ' . $this->linkEmail($address['email']);\r
+        $content .= '</address>';\r
+        return $content;\r
+    }\r
+}
\ No newline at end of file
index bab3407c2f8c4714f42cda0791ee835bb184ae1c..e7324f3ea34106795773fea1fdc79880aaf6756f 100644 (file)
@@ -1,39 +1,44 @@
 <?php
 
-class Fluidbook_View_Helper_QuoteForm extends CubeIT_View_Helper_Abstract {
-
-       public function quoteForm($formID = null, $paddingTop = 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 = '<div class="text col-2">';
-               $res .= $this->title($this->option('quote_heading'), 'h2');
-               $res .= $this->markupDotclear($this->option('quote_description'));
-               $res .= '</div>'; // .text
-               $res .= '<div class="form col-4">';
-               $res .= $form;
-               $res .= '<div class="validation-messages"></div>';
-               $res .= '</div>'; // .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 = '<div class="text col-2">';
+        $res .= $this->title($this->option('quote_heading'), 'h2');
+        $res .= $this->markupDotclear($this->option('quote_description'));
+        if ($contact) {
+            $res .= '<div style="padding: 40px 0 0 0">' . $this->contactDetails() . '</div>';
+        }
+        $res .= '</div>'; // .text
+        $res .= '<div class="form col-4">';
+        $res .= $form;
+        $res .= '<div class="validation-messages"></div>';
+        $res .= '</div>'; // .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;
+    }
 }
index b489b7e857c6401678b4aeb98532a44cba6a644f..5aa60299ec770a3e822d2ca3a06263cdf2e07040 100644 (file)
@@ -2,19 +2,9 @@
 \r
 $this->headScript()->addScriptAndStyle('310-contact');\r
 \r
-$address = $this->option('address');\r
-$locale = new Zend_Locale();\r
-$country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));\r
-$content = '<address>';\r
-$content .= '<h4>' . $address['company'] . '</h4>';\r
-$content .= $address['adresse'];\r
-$content .= '<br>';\r
-$content .= "{$address['code_postal']} {$address['ville']} - $country";\r
-$content .= '<br>';\r
-$content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);\r
-$content .= '<br>';\r
-$content .= __('email :') . ' ' . $this->linkEmail($address['email']);\r
-$content .= '</address>';\r
+$locale=new Zend_Locale();\r
+\r
+$content = $this->contactDetails();\r
 \r
 // Request Quote form\r
 $form = $this->quoteForm(null, $this->form_first);\r
@@ -24,9 +14,9 @@ $intro .= $this->introBlock($this->intro, $content, '', !$this->form_first);
 $intro .= '</div>'; // .contact-intro\r
 \r
 if ($this->form_first) {\r
-       $res = $form . $intro;\r
+    $res = $form . $intro;\r
 } else {\r
-       $res = $intro . $form;\r
+    $res = $intro . $form;\r
 }\r
 \r
 \r
@@ -34,11 +24,11 @@ if ($this->form_first) {
 $res .= '<div class="resellers content-wrapper grid">';\r
 $res .= '<h2 class="title col-6">' . nl2br($this->resellers_title) . '</h2>';\r
 foreach ($this->resellers as $reseller) {\r
-       $res .= '<div class="reseller col-1">';\r
-       $res .= '<h4>' . $locale->getTranslation($reseller['country'], 'Territory') . '</h4>';\r
-       $res .= $reseller['company'];\r
-       $res .= $this->markupDotclear($reseller['details']);\r
-       $res .= '</div>'; // .reseller\r
+    $res .= '<div class="reseller col-1">';\r
+    $res .= '<h4>' . $locale->getTranslation($reseller['country'], 'Territory') . '</h4>';\r
+    $res .= $reseller['company'];\r
+    $res .= $this->markupDotclear($reseller['details']);\r
+    $res .= '</div>'; // .reseller\r
 }\r
 $res .= '</div>'; // .resellers\r
 \r