Skip to content
Snippets Groups Projects
Commit 7d9f50a2 authored by colemanw's avatar colemanw
Browse files

CRM-14023 CRM-14015 - Add apis for Premium & Product

parent cf021bc5
Branches
Tags
No related merge requests found
......@@ -164,7 +164,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
$premiums[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(),
$action,
array('id' => $dao->id)),
array('id' => $dao->id),
ts('more'),
FALSE,
'premium.manage.row',
......
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*/
/**
* File for the CiviCRM APIv3 premium functions
*
* @package CiviCRM_APIv3
* @subpackage API_premium
*
*/
/**
* Save a premium
*
* Allowed @params array keys are:
* {@getfields premium_create}
* @example premiumCreate.php
*
* @return array of newly created premium property values.
* @access public
*/
function civicrm_api3_premium_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* Get a premium
*
* Allowed @params array keys are:
* {@getfields premium_get}
* @example premiumCreate.php
*
* @return array of retrieved premium property values.
* @access public
*/
function civicrm_api3_premium_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* Delete a premium
*
* Allowed @params array keys are:
* {@getfields premium_delete}
* @example premiumCreate.php
*
* @return array of deleted values.
* @access public
*/
function civicrm_api3_premium_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* return field specification specific to get requests
*/
function _civicrm_api3_premium_get_spec(&$params) {
$params['premium_active']['api.aliases'] = array('is_active');
}
/**
* return field specification specific to create requests
*/
function _civicrm_api3_premium_create_spec(&$params) {
$params['premium_active']['api.aliases'] = array('is_active');
}
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*/
/**
* File for the CiviCRM APIv3 product functions
*
* @package CiviCRM_APIv3
* @subpackage API_product
*
*/
/**
* Save a product
*
* Allowed @params array keys are:
* {@getfields product_create}
* @example productCreate.php
*
* @return array of newly created product property values.
* @access public
*/
function civicrm_api3_product_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* Get a product
*
* Allowed @params array keys are:
* {@getfields product_get}
* @example productCreate.php
*
* @return array of retrieved product property values.
* @access public
*/
function civicrm_api3_product_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* Delete a product
*
* Allowed @params array keys are:
* {@getfields product_delete}
* @example productCreate.php
*
* @return array of deleted values.
* @access public
*/
function civicrm_api3_product_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
......@@ -58,9 +58,9 @@
</tr>
</thead>
{foreach from=$rows item=row}
<tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
<td class="crm-contribution-form-block-name">{$row.name}</td>
<td class="crm-contribution-form-block-sku">{$row.sku}</td>
<tr id="product-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
<td class="crm-contribution-form-block-name crm-editable" data-field="name">{$row.name}</td>
<td class="crm-contribution-form-block-sku crm-editable" data-field="sku">{$row.sku}</td>
<td class="crm-contribution-form-block-price">{$row.price }</td>
<td class="crm-contribution-form-block-financial_type">{$row.financial_type_id}</td>
<td class="crm-contribution-form-block-min_contribution">{$row.min_contribution}</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment