From 7649f36154d1e96e5b9c0b96be2b765038193a83 Mon Sep 17 00:00:00 2001 From: Stephen Nielson Date: Tue, 18 Jun 2024 15:03:50 -0600 Subject: [PATCH] Initial refactor to make edit page extensible --- controllers/C_Prescription.class.php | 15 +++++++++++++++ .../{general_edit.html => general_edit.html.twig} | 0 2 files changed, 15 insertions(+) rename templates/prescription/{general_edit.html => general_edit.html.twig} (100%) diff --git a/controllers/C_Prescription.class.php b/controllers/C_Prescription.class.php index 56a11eb93b4..4ae57dc7613 100644 --- a/controllers/C_Prescription.class.php +++ b/controllers/C_Prescription.class.php @@ -102,6 +102,21 @@ function __construct($template_mod = "general") function default_action() { $this->assign("prescription", $this->prescriptions[0]); + $vars = $this->getTemplateVars(); +// $vars['rx_send_email'] = $GLOBALS['rx_send_email'] ?? false; +// $vars['rx_show_drug_drug'] = $GLOBALS['rx_show_drug_drug'] ?? false; +// $vars['rx_zend_pdf_template'] = $GLOBALS['rx_zend_pdf_template'] ?? false; +// $vars['baseModDir'] = $GLOBALS['baseModDir'] ?? ''; +// $vars['zendModDir'] = $GLOBALS['zendModDir'] ?? ''; +// $vars['printm'] = null; // TODO: figure out where printm is used or defined +// $vars['rx_zend_pdf_action'] = $GLOBALS['rx_zend_pdf_action'] ?? ''; +// $vars['rx_zend_html_template'] = $GLOBALS['rx_zend_html_template'] ?? ''; +// $vars['rx_zend_html_action'] = $GLOBALS['rx_zend_pdf_action'] ?? ''; +// $vars['rx_use_fax_template'] = $GLOBALS['rx_use_fax_template'] ?? ''; +// $vars['rx_send_email'] = $GLOBALS['rx_send_email'] ?? false; + $twig = (new TwigContainer(null, $GLOBALS['kernel']))->getTwig(); + echo $twig->render("prescription/" . $this->template_mod . "_edit.html.twig", $vars); + $this->display($GLOBALS['template_dir'] . "prescription/" . $this->template_mod . "_edit.html"); } diff --git a/templates/prescription/general_edit.html b/templates/prescription/general_edit.html.twig similarity index 100% rename from templates/prescription/general_edit.html rename to templates/prescription/general_edit.html.twig