#30900 show labels on progressbar
authorJagadedes <jagadees.pillai@zyxware.com>
Mon, 3 Nov 2014 05:17:12 +0000 (10:47 +0530)
committerJagadedes <jagadees.pillai@zyxware.com>
Mon, 3 Nov 2014 05:17:12 +0000 (10:47 +0530)
CRM/Wci/BAO/ProgressBar.php
extern/wciwidget.php
templates/CRM/Wci/Page/wciwidget.tpl

index ab2aa716ad98597cd2f407d1d5cc21e5e4a3603c..932ccd1ddb79542312f88ffe485bdb5179a48d90 100644 (file)
@@ -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;
+  }
 }
index 3e0d2e53ce799cd11a50b8491852e2f87bcf8918..f62041a06715a92656a75109508842ecd13a8c2d 100644 (file)
@@ -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']);
index 564758fb829f7979898077f7ef6481bb502cd8c2..06e6003f698bd791d32a891ef789d75d961aed9e 100644 (file)
       </div>
     {/if}
     <div class="crm-amounts">
-        <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high"></div>
-        <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low"></div>
-        <div id="crm_wid_{$wciform.widgetId}_percentage" class="crm-percentage"></div>
+        <div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high">${$wciform.goal_amount}</div>
+        <div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low">${$wciform.starting_amount}</div>
+        <div id="crm_wid_{$wciform.widgetId}_percentage" class="crm-percentage">{$wciform.pb_percentage}%</div>
     </div>
     <div class="crm-amount-bar">
         <div class="crm-amount-fill" id="crm_wid_{$wciform.widgetId}_amt_fill"></div>