fix: set default x12 partner for item in billing manager (#7513)
[openemr.git] / contrib / forms / hp_tje_primary / C_FormHpTje.class.php
blob26527a07dc0a54ee36554109d987bc3b6bd768bb
1 <?php
3 require_once($GLOBALS['fileroot'] . "/library/forms.inc.php");
4 require_once("FormHpTjePrimary.class.php");
6 class C_FormHpTje extends Controller
8 var $template_dir;
10 function __construct($template_mod = "general")
12 parent::__construct();
13 $this->template_mod = $template_mod;
14 $this->template_dir = dirname(__FILE__) . "/templates/hp_tje/";
15 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
16 $this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']);
17 $this->assign("STYLE", $GLOBALS['style']);
20 function default_action()
22 $hptje_primary = new FormHpTjePrimary();
23 $this->assign("hptje_primary", $hptje_primary);
24 $this->assign("checks", $hptje_primary->_form_layout());
25 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
28 function view_action($form_id)
30 if (is_numeric($form_id)) {
31 $hptje_primary = new FormHpTjePrimary($form_id);
32 } else {
33 $hptje_primary = new FormHpTjePrimary();
36 $this->assign("hptje_primary", $hptje_primary);
37 $this->assign("checks", $hptje_primary->_form_layout());
38 $this->assign("VIEW", true);
39 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
42 function default_action_process()
44 if ($_POST['process'] != "true") {
45 return;
48 $this->form = new FormHpTjePrimary($_POST['id']);
49 parent::populate_object($this->form);
51 $this->form->persist();
52 if ($GLOBALS['encounter'] == "") {
53 $GLOBALS['encounter'] = date("Ymd");
56 addForm($GLOBALS['encounter'], "Head Pain TJE", $this->form->id, "hp_tje_primary", $GLOBALS['pid'], $_SESSION['userauthorized']);
57 $_POST['process'] = "";
58 return;