Commit 63be91d7 authored by Monish Deb's avatar Monish Deb

Minor issue fixes

parent 39cc7997
......@@ -75,24 +75,21 @@ function syncintacct_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
}
function syncintacct_civicrm_buildForm($formName, &$form) {
if ($formName == 'CRM_Financial_Form_Export') {
$optionTypes = array(
'IIF' => ts('Export to IIF'),
'CSV' => ts('Export to CSV'),
'SyncIntacctAP' => ts('Sync to Sage Intacct A/P'),
'SyncIntacctGL' => ts('Sync to Sage Intacct G/L'),
);
if ($formName == 'CRM_Financial_Form_Search') {
$htmlOptions = '';
foreach ($optionTypes as $key => $optionType) {
$htmlOptions .= "<option value='{$key}'>{$optionType}</option>";
}
$form->assign('htmlOptions', $htmlOptions);
CRM_Core_Region::instance('page-body')->add(array(
'template' => 'CRM/Syncintacct/FinancialSearch.tpl',
));
}
if ($formName == 'CRM_Financial_Form_Export') {
$form->addRadio('export_format', NULL, $optionTypes, NULL, '<br/>', TRUE);
if (!empty($_GET['export_format'])) {
CRM_Core_Resources::singleton()->addScript(
"CRM.$(function($) {
$('input[name=\"export_format\"]').filter('[value=" . $_GET['export_format'] . "]').prop('checked', true);
});"
);
}
}
}
......@@ -122,7 +119,7 @@ function syncintacct_civicrm_validateForm($formName, &$fields, &$files, &$form,
]);
}
}
}
}
}
......
This diff is collapsed.
{literal}
<script type="text/javascript">
CRM.$(function($) {
$('#Go').click(function() {
if ($('#batch_update').val() == 'export') {
var htmlOptions = "{/literal}{$htmlOptions}{literal}";
$('select.export-format').html(htmlOptions);
return false;
}
});
});
</script>
{/literal}
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