php7 related fixes in the contributed forms
[openemr.git] / contrib / forms / ros2 / C_FormROS2.class.php
blobd618f6b513464115a9e1d1223741e481d74179ad
1 <?php
2 // Copyright (C) 2009 Aron Racho <aron@mi-squared.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
8 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
9 require_once("FormROS2.class.php");
11 class C_FormROS2 extends Controller {
13 var $template_dir;
15 function __construct($template_mod = "general") {
16 parent::__construct();
17 $this->template_mod = $template_mod;
18 $this->template_dir = dirname(__FILE__) . "/templates/";
19 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
20 $this->assign("DONT_SAVE_LINK",$GLOBALS['form_exit_url']);
21 $this->assign("STYLE", $GLOBALS['style']);
24 function default_action() {
25 $form = new FormROS2();
26 $this->assign("data",$form);
27 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
30 function view_action($form_id) {
31 if (is_numeric($form_id)) {
32 $form = new FormROS2($form_id);
34 else {
35 $form = new FormROS2();
37 $dbconn = $GLOBALS['adodb']['db'];
38 $this->assign("data",$form);
39 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->form = new FormROS2($_POST['id']);
46 parent::populate_object($this->form);
47 $this->form->persist();
48 if ($GLOBALS['encounter'] == "") {
49 $GLOBALS['encounter'] = date("Ymd");
51 if (empty($_POST['id'])) {
52 addForm($GLOBALS['encounter'], "Review of Systems &#150; Details", $this->form->id, "ros2",
53 $GLOBALS['pid'], $_SESSION['userauthorized']);
54 $_POST['process'] = "";
56 return;