From: Jagadedes Date: Fri, 31 Oct 2014 10:04:47 +0000 (+0530) Subject: #30846 made changes to accept apostrophe in title X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7b653fab295aab40953dad7602d65f3ced3b3071;p=com.zyxware.civiwci.git #30846 made changes to accept apostrophe in title --- diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 9c5acb9..934d9e2 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -140,7 +140,7 @@ where w.id=" . $this->_id;*/ CRM_Core_DAO::storeValues($dao, $wid_page[$dao->id]); $this->setDefaults(array( - 'title' => $wid_page[$dao->id]['title'])); + 'title' => base64_decode($wid_page[$dao->id]['title']))); $this->setDefaults(array( 'logo_image' => $wid_page[$dao->id]['logo_image'])); $this->setDefaults(array( @@ -176,7 +176,7 @@ where w.id=" . $this->_id;*/ $this->setDefaults(array( 'color_button_bg' => $wid_page[$dao->id]['color_button_bg'])); $this->setDefaults(array( - 'style_rules' => $wid_page[$dao->id]['style_rules'])); + 'style_rules' => base64_decode($wid_page[$dao->id]['style_rules']))); $this->setDefaults(array( 'override' => $wid_page[$dao->id]['override'])); if(true == $wid_page[$dao->id]['override']) { @@ -224,7 +224,7 @@ where w.id=" . $this->_id;*/ } if (isset($this->_id)) { - $sql = "UPDATE civicrm_wci_widget SET title = '". $values['title'] + $sql = "UPDATE civicrm_wci_widget SET title = '". base64_encode($values['title']) . "', logo_image = '" . $values['logo_image'] . "', image = '" . $values['image'] . "', button_title = '" . $values['button_title'] . "', button_link_to = '" . $values['button_link_to'] @@ -240,7 +240,7 @@ where w.id=" . $this->_id;*/ . "', color_border = '" . $values['color_border'] . "', color_button = '" . $values['color_button'] . "', color_button_bg = '" . $values['color_button_bg'] - . "', style_rules = '" . $values['style_rules'] . "', override = '" + . "', style_rules = '" . base64_encode($values['style_rules']) . "', override = '" . $override . $quote . $coma . $cust_tmpl_col . $equals . $quote . $cust_tmpl . "' where id =" . $this->_id ; } else { @@ -249,7 +249,7 @@ where w.id=" . $this->_id;*/ email_signup_group_id, size_variant, color_title, color_title_bg, color_progress_bar, color_widget_bg, color_description, color_border, color_button, color_button_bg, style_rules, override" . $coma . $cust_tmpl_col ." ) - VALUES ('" . $values['title'] . "','" . $values['logo_image'] . "','" . + VALUES ('" . base64_encode($values['title']) . "','" . $values['logo_image'] . "','" . $values['image'] . "','" . $values['button_title'] . "','" . $values['button_link_to'] . "','" . $values['progress_bar'] . "','" . base64_encode($values['description']) . "','" . @@ -258,7 +258,7 @@ where w.id=" . $this->_id;*/ $values['color_title_bg'] . "','" . $values['color_bar'] . "','" . $values['color_widget_bg'] . "','" . $values['color_description'] . "','" . $values['color_border'] . "','" . $values['color_button'] . "','" . - $values['color_button_bg'] . "','" . $values['style_rules'] . "','" . + $values['color_button_bg'] . "','" . base64_encode($values['style_rules']) . "','" . $override . $quote . $coma . $quote . $cust_tmpl . "')"; } @@ -272,6 +272,7 @@ where w.id=" . $this->_id;*/ $transaction->commit(); if(isset($_REQUEST['_qf_CreateWidget_next'])) { + echo "before"; (isset($this->_id)) ? $widget_id = $this->_id : $widget_id = CRM_Core_DAO::singleValueQuery('SELECT LAST_INSERT_ID()'); CRM_Utils_System::redirect('?action=update&reset=1&id=' . $widget_id); diff --git a/CRM/Wci/Page/WidgetList.php b/CRM/Wci/Page/WidgetList.php index 6f9d5e9..624d246 100644 --- a/CRM/Wci/Page/WidgetList.php +++ b/CRM/Wci/Page/WidgetList.php @@ -50,6 +50,7 @@ class CRM_Wci_Page_WidgetList extends CRM_Core_Page { while ($dao->fetch()) { $wid_page[$dao->id] = array(); CRM_Core_DAO::storeValues($dao, $wid_page[$dao->id]); + $wid_page[$dao->id]['title'] = base64_decode($wid_page[$dao->id]['title']); $description = base64_decode($wid_page[$dao->id]['description']); $wid_page[$dao->id]['description'] = strip_tags($description);