/** * Generate html code to visualize the executed match. * * @val $match match data as previously generated by this plugin instance * @val $btx the bank transaction the match refers to * @return html code snippet */ function visualize_execution_info(CRM_Banking_Matcher_Suggestion $match, $btx) { // just assign to smarty and compile HTML $smarty_vars = array(); $smarty_vars['contribution_id'] = $match->getParameter('contribution_id'); $smarty_vars['contact_id'] = $match->getParameter('contact_id'); // assign to smarty and compile HTML $smarty = CRM_Banking_Helpers_Smarty::singleton(); $smarty->pushScope($smarty_vars); $html_snippet = $smarty->fetch('CRM/Banking/PluginImpl/Matcher/CreateContribution.execution.tpl'); $smarty->popScope(); return $html_snippet; }
/** * Generate html code to visualize the given match. The visualization may also provide interactive form elements. * * @val $match match data as previously generated by this plugin instance * @val $btx the bank transaction the match refers to * @return html code snippet */ function visualize_match(CRM_Banking_Matcher_Suggestion $match, $btx) { $smarty_vars = array(); $btx_data = array(); CRM_Core_DAO::storeValues($btx, $btx_data); $smarty_vars['btx'] = $btx_data; $smarty_vars['mode'] = $match->getId(); $smarty_vars['contact_ids'] = $match->getParameter('contact_ids'); $smarty_vars['contact_ids2probablility'] = $match->getParameter('contact_ids2probablility'); $smarty_vars['ignore_message'] = $this->_plugin_config->ignore_message; $smarty_vars['booking_date'] = date('YmdHis', strtotime($btx->booking_date)); $smarty_vars['status_pending'] = banking_helper_optionvalue_by_groupname_and_name('contribution_status', 'Pending'); $smarty_vars['manual_default_source'] = $this->_plugin_config->manual_default_source; $smarty_vars['manual_default_financial_type_id'] = $this->_plugin_config->manual_default_financial_type_id; $smarty_vars['create_propagation'] = $this->getPropagationSet($btx, $match, 'contribution', $this->_plugin_config->createnew_value_propagation); // assign to smarty and compile HTML $smarty = CRM_Banking_Helpers_Smarty::singleton(); $smarty->pushScope($smarty_vars); $html_snippet = $smarty->fetch('CRM/Banking/PluginImpl/Matcher/DefaultOptions.suggestion.tpl'); $smarty->popScope(); return $html_snippet; }
/** * Generate html code to visualize the executed match. * * @val $match match data as previously generated by this plugin instance * @val $btx the bank transaction the match refers to * @return html code snippet */ function visualize_execution_info(CRM_Banking_Matcher_Suggestion $match, $btx) { // just assign to smarty and compile HTML $smarty_vars = array(); $smarty_vars['contribution_id'] = $match->getParameter('contribution_id'); $contact_id = $match->getParameter('contact_id'); if (empty($contact_id)) { // this information has not been stored (old matcher version) $result = civicrm_api('Contribution', 'get', array('version' => 3, 'id' => $match->getParameter('contribution_id'))); if (isset($result['id'])) { $contribution = $result['values'][$result['id']]; $contact_id = $contribution['contact_id']; $smarty_vars['contact_id'] = $contact_id; } else { // TODO: error handling? $smarty_vars['contact_id'] = 0; } } else { $smarty_vars['contact_id'] = $contact_id; } $smarty_vars['cancellation_mode'] = $match->getParameter('cancellation_mode'); $smarty_vars['cancel_fee'] = $match->getParameter('cancel_fee'); $smarty_vars['cancel_reason'] = $match->getParameter('cancel_reason'); $smarty = CRM_Banking_Helpers_Smarty::singleton(); $smarty->pushScope($smarty_vars); $html_snippet = $smarty->fetch('CRM/Banking/PluginImpl/Matcher/SepaMandate.execution.tpl'); $smarty->popScope(); return $html_snippet; }