Interim autoloaded library/classes via composer classmap, take 4. (#422)
[openemr.git] / interface / forms / ros / C_FormROS.class.php
blob2dcea1b7658c4a70b1c32d793645554ad62c55dd
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
4 require_once("FormROS.class.php");
6 class C_FormROS extends Controller {
8 var $template_dir;
10 function __construct($template_mod = "general") {
11 parent::__construct();
12 $returnurl = 'encounter_top.php';
13 $this->template_mod = $template_mod;
14 $this->template_dir = dirname(__FILE__) . "/templates/ros/";
15 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
16 $this->assign("DONT_SAVE_LINK",$GLOBALS['webroot'] . "/interface/patient_file/encounter/$returnurl");
17 $this->assign("STYLE", $GLOBALS['style']);
20 function default_action() {
21 $ros = new FormROS();
22 $this->assign("form",$ros);
23 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
26 function view_action($form_id) {
28 if (is_numeric($form_id)) {
29 $ros = new FormROS($form_id);
31 else {
32 $ros = new FormROS();
35 $this->assign("form",$ros);
36 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
40 function default_action_process() {
41 if ($_POST['process'] != "true"){
43 return;
45 $this->ros = new FormROS($_POST['id']);
47 parent::populate_object($this->ros);
48 $this->ros->persist();
50 if ($GLOBALS['encounter'] == "") {
51 $GLOBALS['encounter'] = date("Ymd");
53 if(empty($_POST['id']))
55 addForm($GLOBALS['encounter'], "Review Of Systems", $this->ros->id, "ros", $GLOBALS['pid'], $_SESSION['userauthorized']);
56 $_POST['process'] = "";
58 return;