public function renderCalendar() { $calendarData = ''; if (!empty($this->alltickets)) { foreach ($this->alltickets as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $rawTime = date("H:i:s", $timestamp); $calendarData .= "\n {\n title: '" . $rawTime . "',\n url: '?module=ticketing&showticket=" . $each['id'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n },\n "; } } $result = wf_FullCalendar($calendarData); return $result; }
/** * Renders previously generated all users as fullcalendar widget * * @return string */ public function renderAllUserDocumentsCalendar() { $allAddress = zb_AddressGetFulladdresslistCached(); $calendarData = ''; $yearDocuments = $this->getAllUsersDocumentsThisYear(); if (!empty($yearDocuments)) { foreach ($yearDocuments as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $rawTime = date("H:i:s", $timestamp); $calendarData .= "\n {\n title: '" . $rawTime . ' ' . @$allAddress[$each['login']] . "',\n url: '?module=userprofile&username="******"',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n },\n "; } } $result = wf_FullCalendar($calendarData); return $result; }
$jobdata[$eachjob['workerid']][$eachjob['jobid']] = 1; } } } //build graphs for each employee if (!empty($jobdata)) { foreach ($jobdata as $employee => $each) { $employeeName = isset($employees[$employee]) ? $employees[$employee] : __('Deleted'); $result .= wf_tag('h3', false) . $employeeName . wf_tag('h3', true); $rows = ''; if (!empty($each)) { foreach ($each as $jobid => $count) { $cells = wf_TableCell(@$jobtypes[$jobid], '40%'); $cells .= wf_TableCell($count, '20%'); $cells .= wf_TableCell(web_bar($count, sizeof($alljobs)), '40%'); $rows .= wf_TableRow($cells, 'row3'); } } $result .= wf_TableBody($rows, '100%', 0); $result .= wf_delimiter(); } } } return $result; } $jobgraphs = wf_modal(wf_img('skins/icon_stats.gif', __('Graphs')), __('Graphs'), ts_EmployeeMonthGraphs(), '', '800', '600'); $donejobs = ts_JGetJobsReport(); show_window(__('Job report') . ' ' . $jobgraphs, wf_FullCalendar($donejobs)); } else { show_error(__('Access denied')); }
if (!isset($_GET['switchdelete'])) { //display switches list show_window(__('Available switches'), web_SwitchesShow()); } } else { //show dead switch time machine if (!isset($_GET['snapshot'])) { //cleanup subroutine if (wf_CheckGet(array('flushalldead'))) { ub_SwitchesTimeMachineCleanup(); rcms_redirect("?module=switches&timemachine=true"); } //calendar view time machine if (!wf_CheckPost(array('switchdeadlogsearch'))) { $deadTimeMachine = ub_JGetSwitchDeadLog(); $timeMachine = wf_FullCalendar($deadTimeMachine); } else { //search processing $timeMachine = ub_SwitchesTimeMachineSearch($_POST['switchdeadlogsearch']); } $timeMachineCleanupControl = wf_JSAlert('?module=switches&timemachine=true&flushalldead=true', wf_img('skins/icon_cleanup.png', __('Cleanup')), __('Are you serious')); //here some searchform $timeMachineSearchForm = web_SwitchTimeMachineSearchForm() . wf_tag('br'); show_window(__('Dead switches time machine') . ' ' . $timeMachineCleanupControl, $timeMachineSearchForm . $timeMachine); } else { //showing dead switches snapshot ub_SwitchesTimeMachineShowSnapshot($_GET['snapshot']); } } } else { //editing switch form
/** * Renders tickets calendar view widget * * @return string */ function web_TicketsCalendar() { $curyear = curyear(); $query = "SELECT * from `ticketing` WHERE `to` IS NULL AND `replyid` IS NULL AND `date` LIKE '" . $curyear . "-%' ORDER BY `date` ASC"; $all = simple_queryall($query); $allAddress = zb_AddressGetFulladdresslistCached(); $result = ''; $calendarData = ''; if (!empty($all)) { foreach ($all as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $rawTime = date("H:i:s", $timestamp); if ($each['status'] == 0) { $coloring = "className : 'undone',"; } else { $coloring = ''; } $calendarData .= "\n {\n title: '" . $rawTime . ' ' . @$allAddress[$each['from']] . "',\n url: '?module=ticketing&showticket=" . $each['id'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n " . $coloring . " \n },\n "; } } $result = wf_FullCalendar($calendarData); return $result; }
if ($_GET['show'] == 'done') { $showtasks = ts_JGetDoneTasks(); } if ($_GET['show'] == 'all') { $showtasks = ts_JGetAllTasks(); } } else { $showtasks = ts_JGetUndoneTasks(); } if (!isset($_GET['edittask'])) { if (!wf_CheckGet(array('print'))) { if (!wf_CheckGet(array('lateshow'))) { //custom jobtypes color styling $customJobColorStyle = ts_GetAllJobtypesColorStyles(); //show full calendar view show_window('', $customJobColorStyle . wf_FullCalendar($showtasks)); } else { show_window(__('Show late'), ts_ShowLate()); } } else { //printable result if (wf_CheckPost(array('printdatefrom', 'printdateto'))) { ts_PrintTasks($_POST['printdatefrom'], $_POST['printdateto']); } //show printing form show_window(__('Tasks printing'), ts_PrintDialogue()); } } else { //sms post sending if (wf_CheckPost(array('postsendemployee', 'postsendsmstext'))) { $smsDataRaw = ts_SendSMS($_POST['postsendemployee'], $_POST['postsendsmstext']);
public function renderAlertsCalendar() { $result = ''; $controls = wf_TableCell($this->yearSelectorAlerts()); $controls .= wf_TableCell($this->alertsSearchForm()); $controls = wf_TableRow($controls); $result = wf_TableBody($controls, '60%', 0, ''); if (!empty($this->previousAlerts)) { $calendarData = ''; foreach ($this->previousAlerts as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $rawTime = date("H:i:s", $timestamp); $calendarData .= "\n {\n title: '" . $rawTime . ' ' . $each['event'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n className : 'undone'\n\t\t },\n "; } $result .= wf_FullCalendar($calendarData); } else { $result .= __('Nothing found'); } return $result; }
/** * renders available signups data in calendar view * * @return void */ public function renderCalendar() { $curyear = curyear(); $query = "SELECT * from `sigreq` WHERE `date` LIKE '" . $curyear . "-%' ORDER BY `date` ASC"; $all = simple_queryall($query); $result = ''; $calendarData = ''; if (!empty($all)) { foreach ($all as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $rawTime = date("H:i:s", $timestamp); if ($each['state'] == 0) { $coloring = "className : 'undone',"; } else { $coloring = ''; } $calendarData .= "\n {\n title: '" . $rawTime . ' ' . $each['street'] . ' ' . $each['build'] . '/' . $each['apt'] . "',\n url: '?module=sigreq&showreq=" . $each['id'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n " . $coloring . " \n },\n "; } } $result = wf_FullCalendar($calendarData); //check database configuration table if (zb_CheckTableExists('sigreqconf')) { $confControl = wf_Link('?module=sigreq&settings=true', wf_img('skins/settings.png', __('Settings')), false) . ' '; } else { $confControl = ''; } $viewControl = wf_Link('?module=sigreq', wf_img('skins/icon_table.png', __('Grid view')), false, ''); show_window($confControl . __('Available signup requests') . ' ' . $viewControl, $result); }
/** * Renders available operations in calendar widget * * @return string */ public function reportCalendarOps() { $calendarData = ''; if (!empty($this->allIncoming)) { foreach ($this->allIncoming as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $itemName = @$this->allItemTypeNames[$each['itemtypeid']]; $itemCount = @$each['count']; $itemUnit = @$this->unitTypes[$this->allItemTypes[$each['itemtypeid']]['unit']]; $calendarData .= "\n {\n title: '" . $itemName . " - " . $itemCount . ' ' . $itemUnit . "',\n url: '" . self::URL_ME . '&' . self::URL_VIEWERS . '&showinid=' . $each['id'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n },\n "; } } if (!empty($this->allOutcoming)) { foreach ($this->allOutcoming as $io => $each) { $timestamp = strtotime($each['date']); $date = date("Y, n-1, j", $timestamp); $itemName = @$this->allItemTypeNames[$each['itemtypeid']]; $itemCount = @$each['count']; $itemUnit = @$this->unitTypes[$this->allItemTypes[$each['itemtypeid']]['unit']]; $calendarData .= "\n {\n title: '" . $itemName . " - " . $itemCount . ' ' . $itemUnit . "',\n url: '" . self::URL_ME . '&' . self::URL_VIEWERS . '&showoutid=' . $each['id'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $date . "),\n className : 'undone',\n },\n "; } } $result = wf_FullCalendar($calendarData); return $result; }
/** * Returns available sticky notes list as full calendar * * @return string */ public function renderListCalendar() { $calendarData = ''; if (!empty($this->allnotes)) { foreach ($this->allnotes as $io => $each) { $timestamp = strtotime($each['createdate']); $date = date("Y, n-1, j", $timestamp); $rawTime = date("H:i:s", $timestamp); if ($each['active'] == 1) { $coloring = "className : 'undone',"; } else { $coloring = ''; } if (!empty($each['reminddate'])) { $remindtimestamp = strtotime($each['reminddate']); $reminddate = date("Y, n-1, j", $remindtimestamp); $textLenght = 48; } else { $reminddate = $date; $textLenght = 24; } $shortText = $each['text']; $shortText = str_replace("\n", '', $shortText); $shortText = str_replace("\r", '', $shortText); $shortText = str_replace("'", '`', $shortText); $shortText = strip_tags($shortText); $shortText = $this->cutString($shortText, $textLenght); $calendarData .= "\n {\n title: '" . $rawTime . " " . $shortText . " ',\n url: '?module=stickynotes&shownote=" . $each['id'] . "',\n start: new Date(" . $date . "),\n end: new Date(" . $reminddate . "),\n " . $coloring . " \n },\n "; } } $result = wf_FullCalendar($calendarData); return $result; }