From 246ac1fdd0b82abab3f059d7a401fde5a8dced71 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Thu, 23 Oct 2014 11:03:20 +0530 Subject: [PATCH] #29757 on update donot use setDefaultValues to fill default values. --- CRM/Wci/Form/CreateWidget.php | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 15be829..cf372ef 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -19,17 +19,10 @@ cj(function ( $ ) { } else { $('#embd_code').parents('.crm-section').hide(); } -// $('#embd_code').attr("disabled",true); } $(document).ready(setState) $('#override').click(setState); -/* - $("input[name='_qf_CreateWidget_savenprev']").on('click', function( e ) { - e.preventDefault(); - alert( document.title ); - - });*/ }); @@ -104,12 +97,12 @@ class CRM_Wci_Form_CreateWidget extends CRM_Core_Form { function setDefaultValues() { $defaults = array(); - - $defaults['size_variant'] = 'normal'; - foreach ($this->_colorFields as $name => $val) { - $defaults[$name] = $val[3]; + if (!isset($this->_id)) { + $defaults['size_variant'] = 'normal'; + foreach ($this->_colorFields as $name => $val) { + $defaults[$name] = $val[3]; + } } - return $defaults; } @@ -149,8 +142,6 @@ class CRM_Wci_Form_CreateWidget extends CRM_Core_Form { ), )); - // $this->add('textarea', 'embd_code', ts('Code to embed:')); - // export form elements $this->assign('elementNames', $this->getRenderableElementNames()); @@ -217,18 +208,6 @@ where w.id=" . $this->_id; $elem->setValue($output); } } - // $widget_controller_path = getWciWidgetControllerPath(); - // - // $emb_code = " -// -// -//
-//
"; - // $this->getElement('embd_code')->setValue($emb_code); } else { /** Keep template in civicrm-wci/templates folder*/ -- 2.25.1