Interim autoloaded library/classes via composer classmap, take 4. (#422)
[openemr.git] / contrib / forms / soap2 / C_FormSOAP.class.php
blob291314fad35a91334774248d87dae216081e8da1
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
4 require_once("FormSOAP.class.php");
6 class C_FormSOAP extends Controller {
8 var $template_dir;
10 function __construct($template_mod = "general") {
11 parent::__construct();
12 $this->template_mod = $template_mod;
13 $this->template_dir = dirname(__FILE__) . "/templates/";
14 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
15 $this->assign("DONT_SAVE_LINK",$GLOBALS['form_exit_url']);
16 $this->assign("STYLE", $GLOBALS['style']);
19 function default_action() {
20 $form = new FormSOAP();
21 $this->assign("data",$form);
22 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
25 function view_action($form_id) {
26 if (is_numeric($form_id)) {
27 $form = new FormSOAP($form_id);
29 else {
30 $form = new FormSOAP();
32 $dbconn = $GLOBALS['adodb']['db'];
33 $this->assign("data",$form);
34 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
37 function default_action_process() {
38 if ($_POST['process'] != "true")
39 return;
40 $this->form = new FormSOAP($_POST['id']);
41 parent::populate_object($this->form);
42 $this->form->persist();
43 if ($GLOBALS['encounter'] == "") {
44 $GLOBALS['encounter'] = date("Ymd");
46 if (empty($_POST['id'])) {
47 addForm($GLOBALS['encounter'], "SOAP", $this->form->id, "soap2",
48 $GLOBALS['pid'], $_SESSION['userauthorized']);
49 $_POST['process'] = "";
51 return;