fix some language translation bugs
[openemr.git] / contrib / forms / hp_tje_primary / C_FormHpTje.class.php
bloba6bae82906397a8a488543fe73ac82b78ea93f46
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php");
4 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
5 require_once("FormHpTjePrimary.class.php");
7 class C_FormHpTje extends Controller {
9 var $template_dir;
11 function C_FormHPTje($template_mod = "general") {
12 parent::Controller();
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['webroot'] . "/interface/patient_file/encounter/patient_encounter.php");
17 $this->assign("STYLE", $GLOBALS['style']);
20 function default_action() {
21 $hptje_primary = new FormHpTjePrimary();
22 $this->assign("hptje_primary",$hptje_primary);
23 $this->assign("checks",$hptje_primary->_form_layout());
24 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
27 function view_action($form_id) {
28 if (is_numeric($form_id)) {
29 $hptje_primary = new FormHpTjePrimary($form_id);
31 else {
32 $hptje_primary = new FormHpTjePrimary();
35 $this->assign("hptje_primary",$hptje_primary);
36 $this->assign("checks",$hptje_primary->_form_layout());
37 $this->assign("VIEW",true);
38 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
42 function default_action_process() {
43 if ($_POST['process'] != "true")
44 return;
45 $this->hptje_primary = new FormHpTjePrimary($_POST['id']);
46 parent::populate_object($this->hptje_primary);
48 $this->hptje_primary->persist();
49 if ($GLOBALS['encounter'] == "") {
50 $GLOBALS['encounter'] = date("Ymd");
52 addForm($GLOBALS['encounter'], "Head Pain TJE", $this->hptje_primary->id, "hp_tje_primary", $GLOBALS['pid'], $_SESSION['userauthorized']);
53 $_POST['process'] = "";
54 return;