public function hookDisplayAdminOrder($params) { $order = new Order((int) $params['id_order']); if (Validate::isLoadedObject($order)) { $claim = MediafinanzClaim::getMediafinanzClaimByOrderId($order->id); if ($claim) { $this->context->smarty->assign('claim', $claim); } else { $this->context->smarty->assign('id_order', $order->id); } } return $this->display(__FILE__, 'views/templates/hook/admin_order' . (_PS_VERSION_ < '1.6.0.0' ? '_15' : '') . '.tpl'); }
public function renderView() { if (Tools::getValue('id_mf_new_message')) { $mf_message = new MediafinanzNewMessage((int) Tools::getValue('id_mf_new_message')); if (Validate::isLoadedObject($mf_message)) { $claim_object = MediafinanzClaim::getMediafinanzClaimByOrderId($mf_message->id_order); } else { $claim_object = new MediafinanzClaim(); } } else { $claim_object = new MediafinanzClaim(Tools::getValue('id_mf_claim')); } if (!Validate::isLoadedObject($claim_object)) { $this->errors[] = $this->l('The claim cannot be found within your database.'); } try { $claim_details = $this->module->getClaimDetails($claim_object); $claim_history = $this->module->getClaimHistory($claim_object->file_number); $claim_message_history = $this->module->getMessageHistory($claim_object->file_number); $claim_options = $this->module->getClaimOptions($claim_object->file_number); } catch (Exception $e) { $this->errors[] = $e->getMessage(); Mediafinanz::logToFile($e->getMessage(), 'general'); } if (in_array('close', $claim_options)) { $claim_options[] = 'bookDirectPayment'; } // add form for direct payment //remove actions from this version of module $remove_options = array('lawyer', 'factoring', 'longTermObservation', 'addressIdentification'); $claim_options = array_values(array_diff($claim_options, $remove_options)); $this->context->smarty->assign('claim_details', $claim_details); $this->context->smarty->assign('claim_history', $claim_history); $this->context->smarty->assign('claim_options', $claim_options); $this->context->smarty->assign('claim_message_history', $claim_message_history); $this->context->smarty->assign('instructions_for_assigning', $this->module->getInstructionsForAssigningClaimToLawyer()); $this->context->smarty->assign('mission_depthes', $this->module->getMissionDepthes()); $this->setTemplate('claim-view' . (_PS_VERSION_ < '1.6.0.0' ? '_15' : '') . '.tpl'); }