Portal version update (#1915)
[openemr.git] / interface / main / tabs / js / user_data_view_model.js
blob47cc2fa43cf242b2703999969687d33023d97dc3
1 /**
2  * Copyright (C) 2016 Kevin Yeh <kevin.y@integralemr.com>
3  * Copyright (C) 2016 Brady Miller <brady.g.miller@gmail.com>
4  *
5  * LICENSE: This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 3
8  * of the License, or (at your option) any later version.
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
15  *
16  * @package OpenEMR
17  * @author  Kevin Yeh <kevin.y@integralemr.com>
18  * @author  Brady Miller <brady.g.miller@gmail.com>
19  * @link    http://www.open-emr.org
20  */
22 function user_data_view_model(username,fname,lname,authGrp)
24     var self=this;
25     self.username=ko.observable(username);
26     self.fname=ko.observable(fname);
27     self.lname=ko.observable(lname);
28     self.authorization_group=ko.observable(authGrp);
29     self.messages=ko.observable(false);
30     self.portal=ko.observable(isPortalEnabled);
31     self.portalAlerts=ko.observable("");
32     self.portalAudits=ko.observable("");
33     self.portalMail=ko.observable("");
34     self.portalChats=ko.observable("");
36     return this;
40 function viewPtFinder()
42     navigateTab(webroot_url+"/interface/main/finder/dynamic_finder.php","fin", function () {
43         activateTabByName("fin",true);
44     });
47 function viewTgFinder() {
49     navigateTab(webroot_url+"/interface/therapy_groups/index.php?method=listGroups","gfn", function () {
50         activateTabByName("gfn",true);
51     });
54 function viewMessages()
56     navigateTab(webroot_url+"/interface/main/messages/messages.php?form_active=1","msg", function () {
57         activateTabByName("msg",true);
58     });
61 function viewPortalAudits()
63     navigateTab(webroot_url+"/portal/patient/onsiteactivityviews","msc", function () {
64         activateTabByName("msc",true);
65     });
68 function viewPortalMail()
70     navigateTab(webroot_url+"/portal/messaging/messages.php","por", function () {
71        activateTabByName("por",true);
72     });
75 function viewPortalChats()
77     navigateTab(webroot_url+"/portal/messaging/secure_chat.php","pop", function () {
78         activateTabByName("pop",true);
79     });
82 function editSettings()
84     navigateTab(webroot_url+"/interface/super/edit_globals.php?mode=user","msc", function () {
85         activateTabByName("msc",true);
86     });
89 function changePassword()
91     navigateTab(webroot_url+"/interface/usergroup/user_info.php","msc", function () {
92         activateTabByName("msc",true);
93     });
96 function logout()
98     top.restoreSession();
99     top.window.location=webroot_url+"/interface/logout.php";