Compare commits

...

2 Commits

Author SHA1 Message Date
272b00f459 added time format 2018-06-29 03:01:30 +05:30
d755faf26b added install code to create custom field 2018-06-29 02:58:54 +05:30

View File

@ -85,6 +85,47 @@ function batchexportperm_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
*/
function batchexportperm_civicrm_managed(&$entities) {
_batchexportperm_civix_civicrm_managed($entities);
$entities[] = [
'module' => 'org.agbu.batchexportperm',
'name' => 'batchexportperm_batch_details',
'entity' => 'CustomGroup',
'params' => [
'version' => 3,
'name' => 'batchexportperm_batch_details',
'title' => 'Batch Details',
'extends' => 'Contribution',
'style' => 'Inline',
'collapse_display' => TRUE,
'is_active' => TRUE,
'is_multiple' => FALSE,
'collapse_adv_display' => FALSE,
'is_reserved' => TRUE,
],
];
$entities[] = [
'module' => 'org.agbu.batchexportperm',
'name' => 'export_date',
'entity' => 'CustomField',
'params' => [
'version' => 3,
'name' => 'export_date',
'label' => 'Export Date',
'data_type' => 'Date',
'html_type' => 'Select Date',
'is_required' => FALSE,
'is_searchable' => FALSE,
'is_search_range' => FALSE,
'is_active' => TRUE,
'is_view' => TRUE,
'date_format' => 'mm/dd/yy',
'time_format' => 1,
'text_length' => 255,
'column_name' => 'export_date',
'note_columns' => 150,
'note_rows' => 4,
'custom_group_id' => 'batchexportperm_batch_details',
],
];
}
/**
@ -226,8 +267,8 @@ function _batchexportperm_civicrm_check_permission($contributionId, $errorType =
function _batchexportperm_civicrm_allow_contribution_to_edit($contributionId) {
$customFieldId = civicrm_api3('CustomField', 'getvalue', [
'return' => "id",
'custom_group_id' => "Batch_Details",
'name' => "Export_Date",
'custom_group_id' => "batchexportperm_batch_details",
'name' => "export_date",
]);
$exportDate = civicrm_api3('Contribution', 'getvalue', [
'return' => "custom_{$customFieldId}",