7 * @link http://www.open-emr.org
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @author Jerry Padgett <sjpadgett@gmail.com>
10 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
11 * @copyright Copyright (c) 2019 Jerry Padgett <sjpadgett@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
17 // this allows us to keep our viewtype between screens -- JRM calendar_view_type
18 $viewtype = $GLOBALS['calendar_view_type'];
19 if (isset($_SESSION['viewtype'])) {
20 $viewtype = $_SESSION['viewtype'];
23 // this allows us to keep our selected providers between screens -- JRM
24 $pcuStr = "pc_username=" . attr_url($_SESSION['authUser']);
25 if (isset($_SESSION['pc_username'])) {
27 if (!empty($_SESSION['pc_username']) && is_array($_SESSION['pc_username']) && count($_SESSION['pc_username']) > 1) {
28 // loop over the array of values in pc_username to build
29 // a list of pc_username HTTP vars
30 foreach ($_SESSION['pc_username'] as $pcu) {
31 $pcuStr .= "&pc_username[]=" . attr_url($pcu);
34 // two possibilities here
35 // 1) pc_username is an array with a single element
36 // 2) pc_username is just a string, not an array
37 if (is_string($_SESSION['pc_username'])) {
38 $pcuStr .= "&pc_username[]=" . attr_url($_SESSION['pc_username']);
40 $pcuStr .= "&pc_username[]=" . attr_url($_SESSION['pc_username'][0]);
45 // different frame source page depending on session vars
46 if ($_SESSION['userauthorized'] && $GLOBALS['docs_see_entire_calendar']) {
47 $framesrc = "calendar/index.php?module=PostCalendar&viewtype=" . attr_url($viewtype) . "&func=view";
48 } elseif ($_SESSION['userauthorized']) {
49 $framesrc = "calendar/index.php?module=PostCalendar&viewtype=" . attr_url($viewtype) . "&func=view&" . $pcuStr;
51 $framesrc = "calendar/index.php?module=PostCalendar&func=view&viewtype=" . attr_url($viewtype);
54 // Removed frame as it causes framing issues related to height
55 // This functions completely normally without it
56 header("Location: " . $framesrc);