function getUserEvents($userId, $eventIds) { if ($eventIds == null) { return null; } $events = array(); foreach ($eventIds as $key => $value) { $events[] = getEventInfo($userId, $value->id); } return $events; }
} elseif ($calendar_arr['view'] == 'week') { echo getWeekViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt'); } elseif ($calendar_arr['view'] == 'month') { echo getMonthViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt'); } elseif ($calendar_arr['view'] == 'year') { echo getYearViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt'); } else { die("view:" . $view['view'] . " is not defined"); } } elseif ($_REQUEST['viewOption'] == 'listview') { $cal_log->debug("going to get calendar Event ListView"); //To get Events List $activity_arr = getEventList($calendar_arr, $start_date, $end_date); $activity_list = $activity_arr[0]; $navigation_arr = $activity_arr[1]; echo constructEventListView($calendar_arr, $activity_list, $navigation_arr) . "####" . getEventInfo($calendar_arr, 'listcnt'); } } elseif ($subtab == 'todo') { $cal_log->debug("going to get calendar Todo ListView"); //To get Todos List $todo_arr = getTodoList($calendar_arr, $start_date, $end_date); $todo_list = $todo_arr[0]; $navigation_arr = $todo_arr[1]; echo constructTodoListView($todo_list, $calendar_arr, $subtab, $navigation_arr) . "####" . getTodoInfo($calendar_arr, 'listcnt'); } } elseif ($type == 'view') { checkFileAccess('modules/Calendar/' . $_REQUEST['file'] . '.php'); require_once 'modules/Calendar/' . $_REQUEST['file'] . '.php'; } else { die("View option is not defined"); }
/** * Function creates HTML to display number of Events, Todos and pending list in calendar under header(Eg:Total Events : 5, 2 Pending / Total To Dos: 4, 1 Pending) * @param array $cal_arr - collection of objects and strings * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means Events ListView.if 'hourview' means Events HourView. */ function get_cal_header_data(&$cal_arr, $viewBox, $subtab) { global $mod_strings, $cal_log, $current_user, $adb, $theme; $cal_log->debug("Entering get_cal_header_data() method..."); global $current_user, $app_strings; $date_format = $current_user->date_format; $format = $cal_arr['calendar']->hour_format; $hour_startat = timeString(array('hour' => date('H:i', time() + 5 * 60), 'minute' => 0), '24'); $hour_endat = timeString(array('hour' => date('H:i', time() + 60 * 60), 'minute' => 0), '24'); $time_arr = getaddEventPopupTime($hour_startat, $hour_endat, $format); $temp_ts = $cal_arr['calendar']->date_time->ts; //To get date in user selected format $temp_date = $date_format == 'dd-mm-yyyy' ? date('d-m-Y', $temp_ts) : ($date_format == 'mm-dd-yyyy' ? date('m-d-Y', $temp_ts) : ($date_format == 'yyyy-mm-dd' ? date('Y-m-d', $temp_ts) : '')); if ($current_user->column_fields['is_admin'] == 'on') { $Res = $adb->pquery("select * from vtiger_activitytype", array()); } else { $roleid = $current_user->roleid; $subrole = getRoleSubordinates($roleid); if (count($subrole) > 0) { $roleids = $subrole; array_push($roleids, $roleid); } else { $roleids = $roleid; } if (count($roleids) > 1) { $Res = $adb->pquery("select distinct activitytype from vtiger_activitytype inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_activitytype.picklist_valueid where roleid in (" . generateQuestionMarks($roleids) . ") and picklistid in (select picklistid from vtiger_activitytype) order by sortid asc", array($roleids)); } else { $Res = $adb->pquery("select distinct activitytype from vtiger_activitytype inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_activitytype.picklist_valueid where roleid = ? and picklistid in (select picklistid from vtiger_activitytype) order by sortid asc", array($roleid)); } } $eventlist = ''; for ($i = 0; $i < $adb->num_rows($Res); $i++) { $eventlist .= $adb->query_result($Res, $i, 'activitytype') . ";"; } $headerdata = ""; $headerdata .= "\n\t\t\t<div style='display: block;' id='mnuTab'>\n\t\t\t<form name='EventViewOption' method='POST' action='index.php' style='display:inline;'>\n\t\t\t<input type='hidden' id='complete_view' name='complete_view' value='' />\n\t\t\t<table align='center' border='0' cellpadding='5' cellspacing='0' width='98%'>\n\t\t\t<tr><td colspan='3'> </td></tr>"; if (isPermitted("Calendar", "EditView") == "yes") { $headerdata .= "<tr>\n\t\t\t\t<td>\n\t\t\t\t<table><tr><td class='calAddButton' style='cursor:pointer;height:30px' align='center' width='15%' onMouseOver='fnAddEvent(this,\"addEventDropDown\",\"" . $temp_date . "\",\"" . $temp_date . "\",\"" . $time_arr['starthour'] . "\",\"" . $time_arr['startmin'] . "\",\"" . $time_arr['startfmt'] . "\",\"" . $time_arr['endhour'] . "\",\"" . $time_arr['endmin'] . "\",\"" . $time_arr['endfmt'] . "\",\"" . $viewBox . "\",\"" . $subtab . "\",\"" . $eventlist . "\");'>\n\t\t\t\t\t" . $mod_strings['LBL_ADD'] . "\n\t\t\t\t\t<img src='" . vtiger_imageurl('menuDnArrow.gif', $theme) . "' style='padding-left: 5px;' border='0'>\n\t\t\t\t</td></tr></table> </td>"; } else { $headerdata .= "<tr><td> </td>"; } $headerdata .= "<td align='center' width='43%'><span id='total_activities'>"; //USER SELECT CUSTOMIZATION $headerdata .= getEventInfo($cal_arr, 'listcnt'); $headerdata .= "</span></td>\n\t\t\t\t<td align='center' width='40%'><table border=0 cellspacing=0 cellpadding=2><tr><td class=small><b>" . $mod_strings['LBL_VIEW'] . " : </b></td><td>"; //USER SELECT CUSTOMIZATION $view_options = getEventViewOption($cal_arr, $viewBox); // User Select Customization $view_options .= calendarview_getUserSelectOptions(calendarview_getSelectedUserId()); // END $headerdata .= $view_options . "</td></tr></table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table></form>"; echo $headerdata; $cal_log->debug("Exiting get_cal_header_data() method..."); }
if ($request_obj->account_priv == "Officer" or $request_obj->account_priv == "Admin") { createNewEvent($request_obj); } $cal_obj = new EventCalendar($request_obj); echo $cal_obj->createTable(); break; case "PUT": if ($request_obj->account_priv == "Officer" or $request_obj->account_priv == "Admin") { updateEvent($request_obj); } $cal_obj = new EventCalendar($request_obj); echo $cal_obj->createTable(); break; case "GET": $event_day = new EventDay($request_obj); $event = getEventInfo($request_obj); $event_day->fillEventInfo($event); echo $event_day->displayEvent(); break; case "DELETE": if ($request_obj->account_priv == "Officer" or $request_obj->account_priv == "Admin") { deleteEvent($request_obj); } $cal_obj = new EventCalendar($request_obj); echo $cal_obj->createTable(); break; } break; case "blankForm": $event_day = new EventDay($request_obj); echo $event_day->createEventForm();
if (isset($_POST['deleteEvent']) && !$cancelProcess) { $userid = $_SESSION['UserID']; $eventid = $_POST['eventid']; $task = deleteEvent($userid, $eventid); if (!$task) { $data = array("success" => false, "message" => "Error!"); } else { $data = array("success" => true, "message" => "Success!"); } echo json_encode($data); } //deleteEvent if (isset($_POST['geteventinfo']) && !$cancelProcess) { $eventid = $_POST['eventid']; $userid = $_SESSION['UserID']; $data = getEventInfo($eventid, $userid); $data = array("success" => true, "message" => "Success!", "capacity" => $data->capacity, "startdate" => $data->startdate, "eventname" => $data->eventname, "eventid" => $data->eventid, "enddate" => $data->enddate, "displaycapacity" => $data->displaycapacity); echo json_encode($data); } if (isset($_POST['addPaymentPlan']) && !$cancelProcess) { $eventid = $_POST['eventid']; $timeframeid = $_POST['timeframeid']; $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $paymenttypeid = $_POST['paymenttypeid']; $default = $_POST['setdefault']; $note = ""; $userid = $_SESSION['UserID']; if ($timeframeid == "") { $task = createPaymentPlan($eventid, $startdate, $enddate, $paymenttypeid, $note, $userid, $default); } else {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //This is what I want from Jasper $DB_results = curl_exec($ch); curl_close($ch); $json = json_decode($DB_results, true); //echo $DB_results; //print_r($json); if ($json['status'] == 200) { $events['events'] = array(); $tags = $json['tags']; //print_r($tags); echo"<br>"; $futureEvents = getFutureEvents(); //print_r($futureEvents); echo"<br>"; $eventTags = getEventInfo($futureEvents); //print_r($eventTags); echo"<br>"; foreach ($eventTags as $index => $singleEvent) { //echo $singleEvent; foreach ($tags as $tag) { if (count(array_intersect($tag, $singleEvent)) > 0) { if ($events['events'] != null) { if (!in_array($index, $events['events'])) { $events['events'][] = $index; } else { continue; } } else { $events['events'][] = $index; } }
<?php /* This file contains functions to handle the tathva event details. @author Rahul Raveendran VP <*****@*****.**> */ include "interface.php"; /* * "preeventid" is passed to get all details of event. * @return json encoded form of all details of a particular event. */ if (isset($_POST['preeventid'])) { return json_encode(getEventInfo($_POST['eventid'])); } /* * "posteventid" is passed to get details of 1st,2nd and 3rd prize when event is over. * @return json encoded form of details. */ if (isset($_POST['posteventid'])) { return json_encode(getEventWinnersInfo($_POST['eventid'])); } /* * here the updation of prizeList is happening :-) */ if (isset($_POST['eventid']) && isset($_POST['prize1']) && isset($_POST['prize2']) && isset($_POST['prize3'])) { updatePrizelist($evid,$p1,$p2,$p3); }