Another fix to upgrade clickoptions in windows
[openemr.git] / contrib / forms / activity_impact / C_FormActivityImpact.class.php
blob0602a52575d197f1a92566bef45a18e314210862
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/classes/Controller.class.php");
9 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
10 require_once("FormActivityImpact.class.php");
12 class C_FormActivityImpact extends Controller {
14 var $template_dir;
16 function C_FormActivityImpact($template_mod = "general") {
17 parent::Controller();
18 $this->template_mod = $template_mod;
19 $this->template_dir = dirname(__FILE__) . "/templates/";
20 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
21 $this->assign("DONT_SAVE_LINK",$GLOBALS['form_exit_url']);
22 $this->assign("STYLE", $GLOBALS['style']);
25 function default_action() {
26 $form = new FormActivityImpact();
27 $this->assign("data",$form);
28 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
31 function view_action($form_id) {
32 if (is_numeric($form_id)) {
33 $form = new FormActivityImpact($form_id);
35 else {
36 $form = new FormActivityImpact();
38 $dbconn = $GLOBALS['adodb']['db'];
39 $this->assign("data",$form);
40 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
43 function default_action_process() {
44 if ($_POST['process'] != "true")
45 return;
46 $this->form = new FormActivityImpact($_POST['id']);
47 parent::populate_object($this->form);
48 $this->form->persist();
49 if ($GLOBALS['encounter'] == "") {
50 $GLOBALS['encounter'] = date("Ymd");
52 if (empty($_POST['id'])) {
53 addForm($GLOBALS['encounter'], "Impact of Activities of Daily Living", $this->form->id, "activity_impact",
54 $GLOBALS['pid'], $_SESSION['userauthorized']);
55 $_POST['process'] = "";
57 return;