simplify decrypt to return blank value when a empty value is sent (#2115)
[openemr.git] / controllers / C_X12Partner.class.php
blob99aca8899dcd3d7974a5892df8075873201d4990
1 <?php
4 class C_X12Partner extends Controller
7 var $template_mod;
8 var $providers;
9 var $x12_partners;
11 function __construct($template_mod = "general")
13 parent::__construct();
14 $this->x12_partner = array();
15 $this->template_mod = $template_mod;
16 $this->assign("FORM_ACTION", $GLOBALS['webroot']."/controller.php?" . attr($_SERVER['QUERY_STRING']));
17 $this->assign("CURRENT_ACTION", $GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&");
18 $this->assign("STYLE", $GLOBALS['style']);
21 function default_action()
23 return $this->list_action();
26 function edit_action($id = "", $x_obj = null)
28 if ($x_obj != null && get_class($x_obj) == "x12partner") {
29 $this->x12_partners[0] = $x_obj;
30 } elseif (is_numeric($id)) {
31 $this->x12_partners[0] = new X12Partner($id);
32 } else {
33 $this->x12_partners[0] = new X12Partner();
36 $this->assign("partner", $this->x12_partners[0]);
37 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod . "_edit.html");
40 function list_action()
43 $x = new X12Partner();
44 //$x->set_name("Medi-Cal");
45 //$x->set_x12_sender_id("123454");
46 //$x->set_x12_receiver_id("123454");
47 //$x->persist();
48 //$x->populate();
50 $this->assign("partners", $x->x12_partner_factory());
51 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod . "_list.html");
55 function edit_action_process()
57 if ($_POST['process'] != "true") {
58 return;
61 //print_r($_POST);
62 if (is_numeric($_POST['id'])) {
63 $this->x12_partner[0] = new X12Partner($_POST['id']);
64 } else {
65 $this->x12_partner[0] = new X12Partner();
68 parent::populate_object($this->x12_partner[0]);
70 $this->x12_partner[0]->persist();
71 //insurance numbers need to be repopulated so that insurance_company_name recieves a value
72 $this->x12_partner[0]->populate();
74 //echo "action processeed";
75 $_POST['process'] = "";
76 $this->_state = false;
77 header('Location:'.$GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&action=list");//Z&H
78 //return $this->edit_action(null,$this->x12_partner[0]);