*/
static function getReferenceColumns()
{
- /*if (!self::$_links) {
+ if (!self::$_links) {
self::$_links = array(
new CRM_Core_EntityReference(self::getTableName() , 'progress_bar_id', 'civicrm_wci_progress_bar', 'id') ,
new CRM_Core_EntityReference(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id') ,
);
- }*/
+ }
return self::$_links;
}
/**
if (CRM_Utils_Array::value('import', $field)) {
if ($prefix) {
self::$_import['wci_progress_bar_formula'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_import[$name] = & $fields[$name];
}
}
if (CRM_Utils_Array::value('export', $field)) {
if ($prefix) {
self::$_export['wci_progress_bar_formula'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_export[$name] = & $fields[$name];
}
}
CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.wci', 'addmore.js');
parent::preProcess();
}
- function fill_data() {
+ function fillData() {
// $_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'REQUEST');
$count = 1;
if (isset($this->_id)) {
$count++;
}
$count--; // because last iteration increments it to the next
- } else {
+ }
+ else {
/** New progress bar*/
$this->add(
'select', // field type
true // is required
);*/
- $this->fill_data();
+ $this->fillData();
$this->addElement('link', 'addmore_link',' ', 'addmore', 'Add more');
$sql = "UPDATE civicrm_wci_progress_bar_formula SET contribution_page_id = '". $_REQUEST[$page] . "',
percentage = '". $_REQUEST[$perc] . "'
WHERE id = " . (int)$_REQUEST['contrib_elem_'.$i];
- } else {
+ }
+ else {
$sql = "INSERT INTO civicrm_wci_progress_bar_formula (contribution_page_id, progress_bar_id, percentage)
VALUES ('" . $_REQUEST[$page] . "','" . $this->_id . "','" . $_REQUEST[$perc] . "')";
}
$transaction->rollback();
}
- } else {
+ }
+ else {
$sql = "INSERT INTO civicrm_wci_progress_bar (name, starting_amount, goal_amount)
VALUES ('" . $_REQUEST['progressbar_name'] . "','" . $_REQUEST['starting_amount'] . "','" . $_REQUEST['goal_amount'] . "')";
try {
$controller->set('id', $id);
$controller->process();
return $controller->run();
- } elseif ($action & CRM_Core_Action::DELETE) {
+ }
+ elseif ($action & CRM_Core_Action::DELETE) {
try {
$transaction = new CRM_Core_Transaction();
$sql = "DELETE FROM civicrm_wci_progress_bar_formula where progress_bar_id = " . $id;
'attributes' => array (
'label' => ts('Manage Progress bar'),
'name' => 'manage_progress_bar',
- 'url' => 'civicrm/wci/progress-bar',
+ 'url' => 'civicrm/wci/progress-bar?reset=1',
'permission' => 'access CiviReport,access CiviContribute',
'operator' => 'OR',
'separator' => 1,