From 46dee7f2bae6b0ee693298e8246e2d6b4e0e4498 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Thu, 6 Nov 2014 18:07:42 +0530 Subject: [PATCH] removed encode function --- CRM/Wci/BAO/Widget.php | 2 +- CRM/Wci/Form/CreateWidget.php | 16 ++++++++-------- CRM/Wci/Page/WidgetList.php | 2 +- ReleaseNotes | 9 ++++++++- extern/wciwidget.php | 2 +- templates/CRM/Wci/Form/CreateWidget.tpl | 2 +- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CRM/Wci/BAO/Widget.php b/CRM/Wci/BAO/Widget.php index a3420b5..e881e0f 100644 --- a/CRM/Wci/BAO/Widget.php +++ b/CRM/Wci/BAO/Widget.php @@ -141,7 +141,7 @@ class CRM_Wci_BAO_Widget extends CRM_Wci_DAO_Widget { $data["button_title"] = $dao->button_title; $data["button_link_to"] = $dao->button_link_to; $data["progress_bar_id"] = $dao->progress_bar_id; - $data["description"] = strip_tags(base64_decode($dao->description)); + $data["description"] = $dao->description; $data["email_signup_group_id"] = $dao->email_signup_group_id; $data["size_variant"] = $dao->size_variant; $data["color_title"] = $dao->color_title; diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 1df5148..188f9a8 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -151,7 +151,7 @@ where w.id=" . $this->_id;*/ $this->setDefaults(array( 'progress_bar' => $dao->progress_bar_id/*$dao->pbid*/)); - $description = base64_decode($wid_page[$dao->id]['description']); + $description = $wid_page[$dao->id]['description']; $this->setDefaults(array( 'description' => $description)); $this->setDefaults(array( @@ -175,7 +175,7 @@ where w.id=" . $this->_id;*/ $this->setDefaults(array( 'color_button_bg' => $wid_page[$dao->id]['color_button_bg'])); $this->setDefaults(array( - 'style_rules' => base64_decode($wid_page[$dao->id]['style_rules']))); + 'style_rules' => $wid_page[$dao->id]['style_rules'])); $this->setDefaults(array( 'override' => $wid_page[$dao->id]['override'])); $this->setDefaults(array( @@ -185,7 +185,7 @@ where w.id=" . $this->_id;*/ $this->setDefaults(array( 'hide_pbcap' => $wid_page[$dao->id]['hide_pbcap'])); if(true == $wid_page[$dao->id]['override']) { - $cust_templ = base64_decode($wid_page[$dao->id]['custom_template']); + $cust_templ = html_entity_decode($wid_page[$dao->id]['custom_template']); $this->setDefaults(array( 'custom_template' => $cust_templ)); } else { @@ -223,7 +223,7 @@ where w.id=" . $this->_id;*/ */ if(isset($values['override'])){ $override = $values['override']; - $cust_tmpl = base64_encode(html_entity_decode($values['custom_template'])); + $cust_tmpl = str_replace("'", "''", $values['custom_template']); $cust_tmpl_col = "custom_template"; $coma = ","; $equals = " = "; @@ -246,7 +246,7 @@ where w.id=" . $this->_id;*/ . $values['image'] . "', button_title = '" . $values['button_title'] . "', button_link_to = '" . $values['button_link_to'] . "', progress_bar_id = '" . $values['progress_bar'] - . "', description = '" . base64_encode($values['description']) + . "', description = '" . str_replace("'", "''", $values['description']) . "', email_signup_group_id = '" . $values['email_signup_group_id'] . "', size_variant = '" . $values['size_variant'] . "', color_title = '" . $values['color_title'] @@ -260,7 +260,7 @@ where w.id=" . $this->_id;*/ . "', hide_title = '" . $hide_title . "', hide_border = '" . $hide_border . "', hide_pbcap = '" . $hide_pbcap - . "', style_rules = '" . base64_encode($values['style_rules']) . "', override = '" + . "', style_rules = '" . str_replace("'", "''", $values['style_rules']) . "', override = '" . $override . $quote . $coma . $cust_tmpl_col . $equals . $quote . $cust_tmpl . "' where id =" . $this->_id ; } else { @@ -272,7 +272,7 @@ where w.id=" . $this->_id;*/ VALUES ('" . $title . "','" . $values['logo_image'] . "','" . $values['image'] . "','" . $values['button_title'] . "','" . $values['button_link_to'] . "','" . $values['progress_bar'] . "','" . - base64_encode($values['description']) . "','" . + str_replace("'", "''", $values['description']) . "','" . $values['email_signup_group_id'] . "','" . $values['size_variant'] . "','" . $values['color_title'] . "','" . $values['color_title_bg'] . "','" . $values['color_bar'] . "','" . @@ -280,7 +280,7 @@ where w.id=" . $this->_id;*/ $values['color_border'] . "','" . $values['color_button'] . "','" . $values['color_button_bg'] . "','" . $hide_title . "','" . $hide_border . "','" . $hide_pbcap . "','" - . base64_encode($values['style_rules']) . "','" . + . str_replace("'", "''", $values['style_rules']) . "','" . $override . $quote . $coma . $quote . $cust_tmpl . "')"; } diff --git a/CRM/Wci/Page/WidgetList.php b/CRM/Wci/Page/WidgetList.php index c3b0ce0..f2277fa 100644 --- a/CRM/Wci/Page/WidgetList.php +++ b/CRM/Wci/Page/WidgetList.php @@ -51,7 +51,7 @@ class CRM_Wci_Page_WidgetList extends CRM_Core_Page { $wid_page[$dao->id] = array(); CRM_Core_DAO::storeValues($dao, $wid_page[$dao->id]); $wid_page[$dao->id]['title'] = $wid_page[$dao->id]['title']; - $description = base64_decode($wid_page[$dao->id]['description']); + $description = $wid_page[$dao->id]['description']; $wid_page[$dao->id]['description'] = strip_tags($description); $action = array_sum(array_keys($this->actionLinks())); diff --git a/ReleaseNotes b/ReleaseNotes index 77b6c14..96f2050 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -1,5 +1,12 @@ -Release Notes for civicrm-wci CiciCRM extension. Alpha - III +Release Notes for civicrm-wci CiciCRM extension. Beta - I =========================================================== + +Beta - I +------------------------------------------ +1. Fixed UT Bugs +2. Decoupled widget id from widget +3. Show and hide checkboxes + Alpha - III. 10/30/2014 ------------------------------------------ 1. Fixed UT Bugs diff --git a/extern/wciwidget.php b/extern/wciwidget.php index 59730c4..0437366 100644 --- a/extern/wciwidget.php +++ b/extern/wciwidget.php @@ -67,7 +67,7 @@ if (isset($format)) { $template->template_dir[] = getWciWidgetTemplatePath(); $wcidata = $template->fetch('wciwidget.tpl'); } else { - $wcidata = $template->fetch('string:' . base64_decode($data['custom_template'])); + $wcidata = $template->fetch('string:' . html_entity_decode($data['custom_template'])); } $output = 'var wciwidgetcode = ' . json_encode($wcidata) . ';'; echo $output; diff --git a/templates/CRM/Wci/Form/CreateWidget.tpl b/templates/CRM/Wci/Form/CreateWidget.tpl index 783b41b..5c1bf99 100644 --- a/templates/CRM/Wci/Form/CreateWidget.tpl +++ b/templates/CRM/Wci/Form/CreateWidget.tpl @@ -25,7 +25,7 @@ $template->template_dir[] = getWciWidgetTemplatePath(); $wcidata = $template->fetch('wciwidget.tpl'); } else { - $wcidata = $template->fetch('string:' . base64_decode($wid_page[$dao->id]['custom_template'])); + $wcidata = $template->fetch('string:' . $wid_page[$dao->id]['custom_template']); } $widget_controller_path = getWciWidgetControllerPath(); $extension_root_path = getExtensionRootPath(); -- 2.25.1