Commit d49824a6 authored by Pradeep Nayak's avatar Pradeep Nayak

-- changed files for civicrm 4.4, RG-215

parent 619441a6
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......@@ -266,7 +266,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
$orderBy = ' ORDER BY batch.id desc';
if (!empty($params['sort'])) {
$orderBy = ' ORDER BY ' . $params['sort'];
$orderBy = ' ORDER BY ' . CRM_Utils_Type::escape($params['sort'], 'String');
}
$query = "
......@@ -285,8 +285,8 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
$links = self::links();
}
$batchTypes = CRM_Core_PseudoConstant::getBatchType();
$batchStatus = CRM_Core_PseudoConstant::getBatchStatus();
$batchTypes = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'type_id');
$batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
$paymentInstrument = CRM_Contribute_PseudoConstant::paymentInstrument();
$results = array();
......@@ -353,7 +353,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
* @param array $params associated array for params
* @access public
*/
static function getBatchCount(&$params) {
public static function getBatchCount(&$params) {
$args = array();
$whereClause = self::whereClause($params, $args);
$query = " SELECT COUNT(*) FROM civicrm_batch batch
......@@ -368,7 +368,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
* @param array $params associated array for params
* @access public
*/
function whereClause($params) {
public static function whereClause($params) {
$clauses = array();
// Exclude data-entry batches
if (empty($params['status_id'])) {
......@@ -483,14 +483,16 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
/**
* function to get batch list
*
* @return array array of batches
* @return array array of all batches
* excluding batches with data entry in progress
*/
static function getBatches() {
$query = 'SELECT id, title
$dataEntryStatusId = CRM_Core_OptionGroup::getValue('batch_status','Data Entry');
$query = "SELECT id, title
FROM civicrm_batch
WHERE type_id IN (1,2)
AND status_id = 2
ORDER BY id DESC';
WHERE item_count >= 1
AND status_id != {$dataEntryStatusId}
ORDER BY id DESC";
$batches = array();
$dao = CRM_Core_DAO::executeQuery($query);
......@@ -596,7 +598,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
}
static function closeReOpen($batchIds = array(), $status) {
$batchStatus = CRM_Core_PseudoConstant::accountOptionValues( 'batch_status' );
$batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
$params['status_id'] = CRM_Utils_Array::key( $status, $batchStatus );
$session = CRM_Core_Session::singleton( );
$params['modified_date'] = date('YmdHis');
......@@ -633,8 +635,8 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
}
$orderBy = " ORDER BY civicrm_financial_trxn.id";
if (CRM_Utils_Array::value('sort', $params)) {
$orderBy = ' ORDER BY ' . CRM_Utils_Array::value('sort', $params);
if (!empty($params['sort'])) {
$orderBy = ' ORDER BY ' . CRM_Utils_Type::escape($params['sort'], 'String');
}
$from = "civicrm_financial_trxn
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......@@ -48,7 +48,7 @@ class CRM_Financial_Page_AJAX {
empty($_GET['_value'])) {
CRM_Utils_System::civiExit();
}
$defaultId = NULL;
if ($_GET['_value'] == 'select') {
$result = CRM_Contribute_PseudoConstant::financialAccount();
}
......@@ -62,9 +62,11 @@ class CRM_Financial_Page_AJAX {
'8' => 1, //premium inventory
'9' => 3, //discount account is
);
$financialAccountType = "{$financialAccountType[$_GET['_value']]}";
$financialAccountType = CRM_Utils_Array::value($_GET['_value'], $financialAccountType);
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
if ($financialAccountType) {
$defaultId = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_financial_account WHERE is_default = 1 AND financial_account_type_id = $financialAccountType");
}
}
$elements = array(
array(
......@@ -75,10 +77,14 @@ class CRM_Financial_Page_AJAX {
if (!empty($result)){
foreach ($result as $id => $name) {
$selectedArray = array();
if ($id == $defaultId) {
$selectedArray['selected'] = 'Selected';
}
$elements[] = array(
'name' => $name,
'value' => $id,
);
) + $selectedArray;
}
}
echo json_encode($elements);
......@@ -92,7 +98,7 @@ class CRM_Financial_Page_AJAX {
}
if ($_GET['_value'] == 'select') {
$result = CRM_Core_PseudoConstant::accountOptionValues('account_relationship');
$result = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
}
else {
$financialAccountType = array(
......@@ -102,7 +108,7 @@ class CRM_Financial_Page_AJAX {
'4' => array(7), //cost of sales
);
$financialAccountTypeId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $_GET['_value'], 'financial_account_type_id');
$result = CRM_Core_PseudoConstant::accountOptionValues('account_relationship');
$result = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
}
$elements = array(
......@@ -210,7 +216,7 @@ class CRM_Financial_Page_AJAX {
case 'reopen':
$status = $op == 'close' ? 'Closed' : 'Open';
$ids['batchID'] = $recordID;
$batchStatus = CRM_Core_PseudoConstant::accountOptionValues('batch_status');
$batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
$params['status_id'] = CRM_Utils_Array::key($status, $batchStatus);
$session = CRM_Core_Session::singleton();
$params['modified_date'] = date('YmdHis');
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......@@ -153,13 +153,17 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
* @return array Array of event summary values
*/
static function getGrantStatusOptGroup() {
$params = array();
$params['name'] = CRM_Grant_BAO_Grant::$statusGroupName;
$defaults = array();
$og = CRM_Core_BAO_OptionGroup::retrieve($params, $defaults);
if (!$og) {
CRM_Core_Error::fatal('No option group for grant statuses - database discrepancy! Make sure you loaded civicrm_data.mysql');
}
return $og;
}
......@@ -259,7 +263,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
"action=view&reset=1&id={$grant->id}&cid={$grant->contact_id}&context=home"
);
$grantTypes = CRM_Core_OptionGroup::values('grant_type');
$grantTypes = CRM_Core_PseudoConstant::get('CRM_Grant_DAO_Grant', 'grant_type_id');
if (!CRM_Utils_Array::value('skipRecentView', $params)) {
if(!isset($grant->contact_id) || !isset($grant->grant_type_id)){
$grant->find(TRUE);
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......@@ -21,7 +21,7 @@
| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing
| see the CiviCRM license FAQ at http://civicrm.org/licensing
+--------------------------------------------------------------------+
*/
......@@ -148,9 +148,9 @@ class CRM_Grant_Form_Search extends CRM_Core_Form {
$this->_done = FALSE;
$this->defaults = array();
/*
* we allow the controller to set force/reset externally, useful when we are being
* driven by the wizard framework
/*
* we allow the controller to set force/reset externally, useful when we are being
* driven by the wizard framework
*/
$this->_reset = CRM_Utils_Request::retrieve('reset', 'Boolean', CRM_Core_DAO::$_nullObject);
......@@ -229,9 +229,9 @@ class CRM_Grant_Form_Search extends CRM_Core_Form {
CRM_Grant_BAO_Query::buildSearchForm($this);
/*
* add form checkboxes for each row. This is needed out here to conform to QF protocol
* of all elements being declared in builQuickForm
/*
* add form checkboxes for each row. This is needed out here to conform to QF protocol
* of all elements being declared in builQuickForm
*/
......@@ -330,7 +330,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form {
// check actionName and if next, then do not repeat a search, since we are going to the next page
// hack, make sure we reset the task values
$stateMachine = &$this->controller->getStateMachine();
$stateMachine = $this->controller->getStateMachine();
$formName = $stateMachine->getTaskFormName();
$this->controller->resetPage($formName);
return;
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.0 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......@@ -65,8 +65,6 @@ class CRM_Grant_Form_Task_Pay extends CRM_Grant_Form_Task
if ( !CRM_Core_Permission::checkActionPermission( 'CiviGrant', CRM_Core_Action::PAY ) ) {
CRM_Core_Error::fatal( ts( 'You do not have permission to access this page' ) );
}
require_once "CRM/Core/PseudoConstant.php";
require_once 'CRM/Core/OptionGroup.php';
$grantStatus = CRM_Core_OptionGroup::values( 'grant_status', TRUE );
$paidGrants = $approvedGrants = array();
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.2 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2012 |
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
......@@ -28,7 +28,7 @@
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2012
* @copyright CiviCRM LLC (c) 2004-2013
* $Id$
*
*/
......@@ -63,7 +63,7 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task {
* @return void
*/
function buildQuickForm() {
$grantStatus = CRM_Core_OptionGroup::values('grant_status');
$grantStatus = CRM_Core_PseudoConstant::get('CRM_Grant_DAO_Grant', 'status_id');
CRM_Utils_System::setTitle(ts('Update Grants'));
$this->addElement('select', 'status_id', ts('Grant Status'), array('' => '') + $grantStatus);
$this->addElement('radio', 'radio_ts', NULL, ts('&nbsp;Do not update'), 'no_update' );
......@@ -148,7 +148,6 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task {
}
}
//CRM_Core_Error::debug( '$this', $this->sorted );
foreach ($this->sorted as $grantId) {
$ids['grant_id'] = $grantId;
$grantParams = array('id' => $grantId);
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
......@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment