From: Jagadedes Date: Mon, 3 Nov 2014 05:17:12 +0000 (+0530) Subject: #30900 show labels on progressbar X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=143ff5a237f258e4613ebd809702367ec5efe598;p=com.zyxware.civiwci.git #30900 show labels on progressbar --- diff --git a/CRM/Wci/BAO/ProgressBar.php b/CRM/Wci/BAO/ProgressBar.php index ab2aa71..932ccd1 100644 --- a/CRM/Wci/BAO/ProgressBar.php +++ b/CRM/Wci/BAO/ProgressBar.php @@ -199,4 +199,18 @@ class CRM_Wci_BAO_ProgressBar extends CRM_Wci_DAO_ProgressBar { } return $perc; } + public static function getProgressbarData($pbId) { + + $query = "SELECT * FROM civicrm_wci_progress_bar where id=".$pbId; + $params = array(); + + $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Wci_DAO_Widget'); + + $pbData = array(); + while ($dao->fetch()) { + $pbData["starting_amount"] = $dao->starting_amount; + $pbData["goal_amount"] = $dao->goal_amount; + } + return $pbData; + } } diff --git a/extern/wciwidget.php b/extern/wciwidget.php index 3e0d2e5..f62041a 100644 --- a/extern/wciwidget.php +++ b/extern/wciwidget.php @@ -52,7 +52,9 @@ $embed = CRM_Utils_Request::retrieve('embed', 'Positive', CRM_Core_DAO::$_nullOb if (isset($format)) { $jsonvar .= $cpageId; } else { - $data = CRM_Wci_BAO_Widget::getWidgetData($widgetId); + $widData = CRM_Wci_BAO_Widget::getWidgetData($widgetId); + $pbData = CRM_Wci_BAO_ProgressBar::getProgressbarData($widData["progress_bar_id"]); + $data = array_merge($widData, $pbData); $template->assign('wciform', $data); $template->assign('cpageId', $data['button_link_to']); diff --git a/templates/CRM/Wci/Page/wciwidget.tpl b/templates/CRM/Wci/Page/wciwidget.tpl index 564758f..06e6003 100644 --- a/templates/CRM/Wci/Page/wciwidget.tpl +++ b/templates/CRM/Wci/Page/wciwidget.tpl @@ -160,9 +160,9 @@ {/if}
-
-
-
+
${$wciform.goal_amount}
+
${$wciform.starting_amount}
+
{$wciform.pb_percentage}%