Commit f65e1d2c authored by jaapjansma's avatar jaapjansma

fixed tryout link

parent 691e1251
......@@ -34,7 +34,7 @@ Required vars: formProcessors
<!-- FIXME: Can't figure out how styling in other tables gets the nowrap effect... in absence of a consistent fix, KISS -->
<td style="white-space: nowrap">
<span>
<a class="action-item crm-hover-button" ng-click="run(formProcessor)">
<a class="action-item crm-hover-button" ng-href="{{formProcessor.try_out_url}}">
{{ts('Try out')}}
</a>
<a class="action-item crm-hover-button" ng-href="#/formProcessor/{{formProcessor.id}}">
......
......@@ -16,7 +16,7 @@
}
);
angular.module('form_processor').controller('FormProcessorListCtrl', function($scope, crmApi, formProcessors, $window) {
angular.module('form_processor').controller('FormProcessorListCtrl', function($scope, crmApi, formProcessors) {
var ts = $scope.ts = CRM.ts(null);
$scope.status_labels = CRM.form_processor.status_labels;
......@@ -53,9 +53,6 @@
})
});
};
$scope.run = function(formProcessor) {
$window.location.href = CRM.url('civicrm/admin/automation/formprocessor/run', {"_qf_formProcessorName": formProcessor.name});
};
});
})(angular, CRM.$, CRM._);
......@@ -11,24 +11,25 @@
function civicrm_api3_form_processor_instance_get($params) {
$returnValues = CRM_FormProcessor_BAO_FormProcessorInstance::getValues($params);
foreach($returnValues as $index => $formProcessor) {
// Convert inputs to arrays
// Convert inputs to arrays
foreach($formProcessor['inputs'] as $key => $input) {
$returnValues[$index]['inputs'][$key]['type'] = $input['type']->toArray();
foreach($input['validators'] as $validator_key => $validator) {
$returnValues[$index]['inputs'][$key]['validators'][$validator_key]['validator'] = $validator['validator']->toArray();
}
}
// Convert inputs to arrays
// Convert inputs to arrays
foreach($formProcessor['default_data_inputs'] as $key => $input) {
$returnValues[$index]['default_data_inputs'][$key]['type'] = $input['type']->toArray();
foreach($input['validators'] as $validator_key => $validator) {
$returnValues[$index]['default_data_inputs'][$key]['validators'][$validator_key]['validator'] = $validator['validator']->toArray();
}
}
// Convert output handler object to array
$returnValues[$index]['output_handler'] = $returnValues[$index]['output_handler']->toArray();
$returnValues[$index]['try_out_url'] = \CRM_Utils_System::url('civicrm/admin/automation/formprocessor/run', ['_qf_formProcessorName' => $formProcessor['name']]);
}
return civicrm_api3_create_success($returnValues, $params, 'FormProcessorInstance', 'Get');
}
......
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