CRM-13997 CRM-13863 - Fix form snippet to still work with non-json calls (fix for...
authorColeman Watts <coleman@civicrm.org>
Sat, 28 Dec 2013 19:14:04 +0000 (11:14 -0800)
committerColeman Watts <coleman@civicrm.org>
Mon, 6 Jan 2014 19:11:39 +0000 (11:11 -0800)
CRM/Campaign/Form/Survey.php
CRM/Contribute/Form/ContributionPage.php
CRM/Event/Form/ManageEvent.php

index 86a09d82c76988bdfef508e32e82f03f6ec9b1ca..e9567c6a384064c4b10123361b700e8f751853dc 100644 (file)
@@ -172,8 +172,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
   }
 
   function getTemplateFileName() {
-    if ($this->controller->getPrint() === CRM_Core_Smarty::PRINT_JSON ||
-      $this->getVar('_surveyId') <= 0 ) {
+    if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0 ) {
       return parent::getTemplateFileName();
     }
     else {
index 17061972326dc2a47cd19522115438c7632a9e31..9fa9d093ef5cd4ad6c881f68e168a94cd741421a 100644 (file)
@@ -436,8 +436,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
   }
 
   function getTemplateFileName() {
-    if ($this->controller->getPrint() === CRM_Core_Smarty::PRINT_JSON ||
-      $this->getVar('_id') <= 0 ||
+    if ($this->controller->getPrint() || $this->getVar('_id') <= 0 ||
       ($this->_action & CRM_Core_Action::DELETE) ||
       (CRM_Utils_String::getClassName($this->_name) == 'AddProduct')
     ) {
index 5fbd7050fe7c891826666cfd6389f51dbbe24633..32c0651b5d39dca3753621e7074db455de52478f 100644 (file)
@@ -372,10 +372,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
   }
 
   function getTemplateFileName() {
-    if ($this->controller->getPrint() === CRM_Core_Smarty::PRINT_JSON ||
-      $this->getVar('_id') <= 0 ||
-      ($this->_action & CRM_Core_Action::DELETE)
-    ) {
+    if ($this->controller->getPrint() || $this->getVar('_id') <= 0 || $this->_action & CRM_Core_Action::DELETE) {
       return parent::getTemplateFileName();
     }
     else {