Skip to content
Snippets Groups Projects
Commit f6170361 authored by Pradeep Nayak's avatar Pradeep Nayak
Browse files

--more work on RG-108

parent 4730957c
No related branches found
No related tags found
No related merge requests found
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.1 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License and the CiviCRM Licensing Exception along |
| 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 |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2011
* $Id$
*
*/
require_once 'CRM/Core/OptionGroup.php';
/**
* This class holds all the Pseudo constants that are specific to Grant. This avoids
* polluting the core class and isolates the Grant
*/
class CRM_Grant_PseudoConstant extends CRM_Core_PseudoConstant
{
/**
* Grant Status
*
* @var array
* @static
*/
private static $grantStatus;
/**
* grant Type
*
* @var array
* @static
*/
private static $grantType;
private static $grantProgramStatus;
/**
* Get all the n grant statuses
*
* @access public
* @return array - array reference of all grant statuses if any
* @static
*/
public static function &grantStatus( $id = null )
{
if ( ! self::$grantStatus ) {
self::$grantStatus = array( );
self::$grantStatus = CRM_Core_OptionGroup::values( 'grant_status' );
}
if( $id ) {
return self::$grantStatus[$id];
}
return self::$grantStatus ;
}
/**
* Get all the n grant types
*
* @access public
* @return array - array reference of all grant types if any
* @static
*/
public static function &grantType( $id = null )
{
if ( ! self::$grantType ) {
self::$grantType = array( );
self::$grantType = CRM_Core_OptionGroup::values( 'grant_type' );
}
If( $id ) {
return self::$grantType[$id];
}
return self::$grantType ;
}
/**
* Get all the n grant program statuses
*
* @access public
* @return array - array reference of all grant program statuses if any
* @static
*/
public static function &grantProgramStatus( $id = null )
{
if ( ! self::$grantProgramStatus ) {
self::$grantProgramStatus = array( );
self::$grantProgramStatus = CRM_Core_OptionGroup::values( 'grant_program_status' );
}
if( $id ) {
return self::$grantProgramStatus[$id];
}
return self::$grantProgramStatus ;
}
}
......@@ -22,7 +22,14 @@ function grantprograms_civicrm_xmlMenu(&$files) {
* Implementation of hook_civicrm_install
*/
function grantprograms_civicrm_install() {
return _grantprograms_civix_civicrm_install();
_grantprograms_civix_civicrm_install();
$smarty = CRM_Core_Smarty::singleton();
$config = CRM_Core_Config::singleton();
$data = $smarty->fetch($config->extensionsDir . 'biz.jmaconsulting.grantprograms/sql/civicrm_msg_template.tpl');
file_put_contents($config->uploadDir . "civicrm_data.sql", $data);
CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $config->uploadDir . "civicrm_data.sql");
return TRUE;
}
/**
......
......@@ -17,7 +17,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.eer/issues
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.grantprograms/issues
*
* Contact: info@jmaconsulting.biz
* JMA Consulting
......
......@@ -17,7 +17,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.eer/issues
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.grantprograms/issues
*
* Contact: info@jmaconsulting.biz
* JMA Consulting
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment