fixed civilint

This commit is contained in:
CiviWare Solutions 2018-08-12 05:13:25 +05:30
parent 61ae4f80ea
commit 133a71f70b
4 changed files with 28 additions and 18 deletions

View File

@ -2,12 +2,23 @@
class CRM_Grant_BAO_GrantBudget extends CRM_Grant_DAO_GrantBudget {
/**
* Build Fiscal year option list.
*
*/
public static function getFiscalyear() {
$from = date("Y", strtotime(date('Y') . ' - ' . GRANT_SCHOLARSHIP_YEAR_DIFF . ' years'));
$to = date("Y", strtotime(date('Y') . ' + ' . GRANT_SCHOLARSHIP_YEAR_DIFF . ' years'));
return array_combine(range($to, $from), range($to, $from));
}
/**
* Build Fiscal year option list.
*
* @param $params array
*
* @return array
*/
public static function getGrantBudget($params) {
$fiscalYear = $params['fiscal_year'];
if (empty($fiscalYear)) {

View File

@ -23,7 +23,7 @@
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
*/
/**
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2017
@ -48,7 +48,7 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
*
* @var boolean
*/
static $_log = true;
static $_log = TRUE;
/**
*
* @var int unsigned
@ -58,7 +58,7 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
public $fiscal_year;
public $budget;
function __construct() {
public function __construct() {
$this->__table = 'civicrm_grant_budget';
parent::__construct();
}
@ -68,10 +68,10 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
* @return array
* [CRM_Core_Reference_Interface]
*/
static function getReferenceColumns() {
public static function getReferenceColumns() {
if (!isset(Civi::$statics[__CLASS__]['links'])) {
Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financialtypeid', 'civicrm_financial_type', 'id');
Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financialtypeid', 'civicrm_financial_type', 'id');
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
}
return Civi::$statics[__CLASS__]['links'];
@ -81,13 +81,13 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
*
* @return array
*/
static function &fields() {
public static function &fields() {
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
Civi::$statics[__CLASS__]['fields'] = [
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
'required' => true,
'required' => TRUE,
'table_name' => 'civicrm_grant_budget',
'entity' => 'GrantBudget',
'bao' => 'CRM_Grant_BAO_GrantBudget',
@ -165,7 +165,7 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
* @return array
* Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
public static function &fieldKeys() {
if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
@ -176,15 +176,15 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
*
* @return string
*/
static function getTableName() {
public static function getTableName() {
return self::$_tableName;
}
/**
* Returns if this table needs to be logged
*
* @return boolean
* @return bool
*/
function getLog() {
public function getLog() {
return self::$_log;
}
/**
@ -194,7 +194,7 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
*
* @return array
*/
static function &import($prefix = false) {
public static function &import($prefix = FALSE) {
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'grant_budget', $prefix, []);
return $r;
}
@ -205,7 +205,7 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
*
* @return array
*/
static function &export($prefix = false) {
public static function &export($prefix = FALSE) {
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'grant_budget', $prefix, []);
return $r;
}
@ -216,4 +216,5 @@ class CRM_Grant_DAO_GrantBudget extends CRM_Core_DAO {
$indices = [];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
}
}

View File

@ -29,7 +29,7 @@ class CRM_Grant_Page_AnnualBudgets extends CRM_Core_Page_Basic {
//check permission
if (!(CRM_Core_Permission::check('administer CiviCRM')
|| ( CRM_Core_Permission::check('access CiviGrant')
|| (CRM_Core_Permission::check('access CiviGrant')
&& CRM_Core_Permission::check('edit grants')
)
)) {

View File

@ -453,8 +453,6 @@ function _annualgrantbudgets_civix_civicrm_alterSettingsFolders(&$metaDataFolder
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes
*/
function _annualgrantbudgets_civix_civicrm_entityTypes(&$entityTypes) {
$entityTypes = array_merge($entityTypes, array (
));
$entityTypes = array_merge($entityTypes, []);
}