yet more changes for new frame layout
[openemr.git] / interface / forms / ros / C_FormROS.class.php
blob1a23ab376ba65c199b3a09258f78cf596ca83e55
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php");
4 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
5 require_once("FormROS.class.php");
7 class C_FormROS extends Controller {
9 var $template_dir;
11 function C_FormROS($template_mod = "general") {
12 parent::Controller();
13 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
14 $this->template_mod = $template_mod;
15 $this->template_dir = dirname(__FILE__) . "/templates/ros/";
16 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
17 $this->assign("DONT_SAVE_LINK",$GLOBALS['webroot'] . "/interface/patient_file/encounter/$returnurl");
18 $this->assign("STYLE", $GLOBALS['style']);
21 function default_action() {
22 $ros = new FormROS();
23 $this->assign("form",$ros);
24 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
27 function view_action($form_id) {
29 if (is_numeric($form_id)) {
30 $ros = new FormROS($form_id);
32 else {
33 $ros = new FormROS();
36 $this->assign("form",$ros);
37 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
41 function default_action_process() {
42 if ($_POST['process'] != "true"){
44 return;
46 $this->ros = new FormROS($_POST['id']);
48 parent::populate_object($this->ros);
49 $this->ros->persist();
51 if ($GLOBALS['encounter'] == "") {
52 $GLOBALS['encounter'] = date("Ymd");
54 if(empty($_POST['id']))
56 addForm($GLOBALS['encounter'], "Review Of Systems", $this->ros->id, "ros", $GLOBALS['pid'], $_SESSION['userauthorized']);
57 $_POST['process'] = "";
59 return;