4 class C_X12Partner
extends Controller
{
10 function __construct($template_mod = "general") {
11 parent
::__construct();
12 $this->x12_partner
= array();
13 $this->template_mod
= $template_mod;
14 $this->assign("FORM_ACTION", $GLOBALS['webroot']."/controller.php?" . $_SERVER['QUERY_STRING']);
15 $this->assign("CURRENT_ACTION", $GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&");
16 $this->assign("STYLE", $GLOBALS['style']);
17 $this->assign("WEB_ROOT", $GLOBALS['webroot'] );
20 function default_action() {
21 return $this->list_action();
24 function edit_action($id = "",$x_obj = null) {
25 if ($x_obj != null && get_class($x_obj) == "x12partner") {
26 $this->x12_partners
[0] = $x_obj;
28 elseif (is_numeric($id)) {
29 $this->x12_partners
[0] = new X12Partner($id);
32 $this->x12_partners
[0] = new X12Partner();
34 $this->assign("partner", $this->x12_partners
[0]);
35 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod
. "_edit.html");
38 function list_action() {
40 $x = new X12Partner();
41 //$x->set_name("Medi-Cal");
42 //$x->set_x12_sender_id("123454");
43 //$x->set_x12_receiver_id("123454");
47 $this->assign("partners", $x->x12_partner_factory());
48 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod
. "_list.html");
52 function edit_action_process() {
53 if ($_POST['process'] != "true")
56 if (is_numeric($_POST['id'])) {
57 $this->x12_partner
[0] = new X12Partner($_POST['id']);
60 $this->x12_partner
[0] = new X12Partner();
63 parent
::populate_object($this->x12_partner
[0]);
65 $this->x12_partner
[0]->persist();
66 //insurance numbers need to be repopulated so that insurance_company_name recieves a value
67 $this->x12_partner
[0]->populate();
69 //echo "action processeed";
70 $_POST['process'] = "";
71 $this->_state
= false;
72 header('Location:'.$GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&action=list");//Z&H
73 //return $this->edit_action(null,$this->x12_partner[0]);