Example #1
0
function printPages($startdate, $enddate)
{
    global $dayinseconds;
    //start monday before start date
    $currentdate = $startdate - (date('N', $startdate) - 1) * $dayinseconds;
    global $eventFeed, $service, $holidayFeed;
    date_default_timezone_set('America/New_York');
    $current_month = date('m', $currentdate);
    $feeds = getFeeds($currentdate, $enddate);
    $data_xml = "<PlannerData>";
    //week loop:
    while (!($currentdate > $enddate)) {
        $data_xml .= "<Month>";
        $data_xml .= "<PreviousMonth>" . getMonthXml(strtotime(date('c', $currentdate) . ' - 1 month')) . "</PreviousMonth>";
        $data_xml .= "<NextMonth>" . getMonthXml(strtotime(date('c', $currentdate) . ' + 1 month')) . "</NextMonth>";
        $data_xml .= getMonthXml($currentdate);
        while (date('m', $currentdate) == $current_month) {
            $data_xml .= "<Week>";
            $ongoing_events = '';
            for ($i = 0; $i < 7; $i++) {
                $data_xml .= "<Day id=\"" . date('N', $currentdate) . "\">";
                $data_xml .= "<ShortName>" . date('D', $currentdate) . "</ShortName>";
                $data_xml .= "<Month>" . date('F', $currentdate) . "</Month>";
                $data_xml .= "<Date>" . date('j', $currentdate) . "</Date>";
                //get event list
                $event_list = '';
                foreach ($feeds as $feed) {
                    $lists = getEventList($currentdate, $feed);
                    $ongoing_events .= $lists['ongoing_events'];
                    $event_list .= $lists['event_list'];
                }
                $data_xml .= $event_list ? '<EventList>' . $event_list . '</EventList>' : '';
                $data_xml .= "</Day>";
                $currentdate = strtotime(date('Y-m-d', $currentdate) . ' + 1 day');
            }
            $data_xml .= $ongoing_events ? '<OngoingEvents>' . $ongoing_events . '</OngoingEvents>' : '';
            $data_xml .= "</Week>";
        }
        $data_xml .= '</Month>';
        $current_month = date('m', $currentdate);
    }
    $data_xml .= '</PlannerData>';
    echo $data_xml;
}
Example #2
0
             $cal_log->debug("going to get calendar Event HourView");
             if ($calendar_arr['view'] == 'day') {
                 echo getDayViewLayout($calendar_arr) . "####" . getEventInfo($calendar_arr, 'listcnt');
             } 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';
Example #3
0
/**
 * Fuction constructs Events ListView depends on the view
 * @param   array  $cal            - collection of objects and strings
 * @param   string $mode           - string 'listcnt' or empty. if empty means get Events ListView else get total no. of events and no. of pending events Info.
 * returns  string $activity_list  - total no. of events and no. of pending events Info(Eg: Total Events : 2, 1 Pending).
 */
function getEventListView(&$cal, $mode = '')
{
    global $cal_log, $theme;
    $list_view = "";
    $cal_log->debug("Entering getEventListView() method...");
    if ($cal['calendar']->view == 'day') {
        $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date();
    } elseif ($cal['calendar']->view == 'week') {
        $start_date = $cal['calendar']->slices[0];
        $end_date = $cal['calendar']->slices[6];
    } elseif ($cal['calendar']->view == 'month') {
        $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0);
        $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1);
        $start_date = $start_date->get_formatted_date();
        $end_date = $end_date->get_formatted_date();
    } elseif ($cal['calendar']->view == 'year') {
        $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0);
        $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment');
        $start_date = $start_date->get_formatted_date();
        $end_date = $end_date->get_formatted_date();
    } else {
        die("view:" . $cal['calendar']->view . " is not defined");
    }
    //if $mode value is empty means get Events list in array format else get the count of total events and pending events in array format.
    if ($mode != '') {
        $activity_list = getEventList($cal, $start_date, $end_date, $mode);
        $cal_log->debug("Exiting getEventListView() method...");
        return $activity_list;
    } else {
        $ret_arr = getEventList($cal, $start_date, $end_date, $mode);
        $activity_list = $ret_arr[0];
        $navigation_array = $ret_arr[1];
    }
    //To get Events listView
    $list_view .= "<br><div id='listView'>";
    $list_view .= constructEventListView($cal, $activity_list, $navigation_array);
    $list_view .= "<br></div>\n\t\t</div>";
    $list_view .= "<br></td></tr></table></td></tr></table>\n\t\t\t</td></tr></table>\n\t\t</td></tr></table>\n\t\t</div>\n\t\t</td></tr></table>\n\t\t</td>\n\t\t<td valign=top><img src='" . vtiger_imageurl('showPanelTopRight.gif', $theme) . "'></td>\n\t\t</tr>\n\t</table>\n\t<br>";
    echo $list_view;
    $cal_log->debug("Exiting getEventListView() method...");
}
 private function retrieveEvents($calendarId)
 {
     global $client;
     return getEventList($client, htmlspecialchars($calendarId))['items'];
 }
Example #5
0
/**
 * Builds newletter template using the assigned template replacing universal variables with their content.
 *
 * @param int $nID Newsletter ID
 * @return string
 */
function buildUniversal($nID)
{
    global $hc_lang_news, $hc_cfg;
    $tmplCache = HCPATH . '/cache/news' . date("ymd") . '_' . $nID . '.txt';
    if (!file_exists($tmplCache)) {
        foreach (glob(HCPATH . '/cache/news*_' . $nID . '.txt') as $filename) {
            unlink($filename);
        }
        $result = doQuery("SELECT tn.TemplateSource, n.Message, n.IsArchive\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "newsletters n\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "templatesnews tn ON (n.TemplateID = tn.PkID)\r\n\t\t\t\t\t\t\tWHERE n.PkID = '" . $nID . "' AND n.IsActive = 1 AND tn.IsActive = 1");
        $template = $message = $archive = '';
        $doArchive = 0;
        if (hasRows($result)) {
            $template = cOut(mysql_result($result, 0, 0));
            $message = cOut(mysql_result($result, 0, 1));
            $doArchive = cOut(mysql_result($result, 0, 2));
            $archive = CalRoot . '/newsletter/index.php?n=' . md5($nID);
        } else {
            stopError($hc_lang_news['Err01']);
        }
        $template = str_replace('[message]', $message, $template);
        if (stristr($template, '[billboard]')) {
            $query = "SELECT PkID, Title, StartDate, StartTime, IsBillboard, SeriesID, TBD, EndTime FROM " . HC_TblPrefix . "events WHERE IsActive = 1 AND IsApproved = 1 AND StartDate >= '" . SYSDATE . "' AND IsBillboard = 1 ORDER BY IsBillboard DESC, StartDate, StartTime, Title LIMIT " . $hc_cfg[12];
            $template = str_replace('[billboard]', getEventList($query), $template);
        }
        if (stristr($template, '[popular]')) {
            $query = "SELECT PkID, Title, StartDate, StartTime, IsBillboard, SeriesID, TBD, EndTime, (Views / (DATEDIFF('" . SYSDATE . "', PublishDate)+1)) as Ave FROM " . HC_TblPrefix . "events WHERE IsActive = 1 AND IsApproved = 1 AND StartDate >= '" . SYSDATE . "' ORDER BY Ave DESC, StartDate, StartTime, Title LIMIT " . $hc_cfg[10];
            $template = str_replace('[popular]', getEventList($query), $template);
        }
        if (stristr($template, '[newest]')) {
            $query = "SELECT PkID, Title, StartDate, StartTime, IsBillboard, SeriesID, TBD, EndTime FROM " . HC_TblPrefix . "events WHERE IsActive = 1 AND IsApproved = 1 AND StartDate >= '" . SYSDATE . "' ORDER BY PublishDate DESC, StartDate LIMIT " . $hc_cfg[66];
            $template = str_replace('[newest]', getEventList($query), $template);
        }
        if (stristr($template, '[updated]')) {
            $query = "SELECT PkID, Title, StartDate, StartTime, IsBillboard, SeriesID, TBD, EndTime FROM " . HC_TblPrefix . "events WHERE IsActive = 1 AND IsApproved = 1 AND StartDate >= '" . SYSDATE . "' ORDER BY LastMod DESC, StartDate LIMIT " . $hc_cfg[66];
            $template = str_replace('[updated]', getEventList($query), $template);
        }
        if (stristr($template, '[today]')) {
            $query = "SELECT PkID, Title, StartDate, StartTime, IsBillboard, SeriesID, TBD, EndTime FROM " . HC_TblPrefix . "events WHERE IsActive = 1 AND IsApproved = 1 AND StartDate = '" . SYSDATE . "' ORDER BY StartDate, StartTime, Title LIMIT " . $hc_cfg[12];
            $template = str_replace('[today]', getEventList($query), $template);
        }
        if (stristr($template, '[twitter]')) {
            $template = str_replace('[twitter]', '<a href="http://twitter.com/share?url=' . urlencode($archive) . '" target="_blank"><img src="' . CalRoot . '/newsletter/images/twitter.png" style="border:0px;" /></a>', $template);
        }
        if (stristr($template, '[facebook]')) {
            $template = str_replace('[facebook]', '<a href="http://www.facebook.com/sharer.php?u=' . urlencode($archive) . '" target="_blank"><img src="' . CalRoot . '/newsletter/images/facebook.png" style="border:0px;" /></a>', $template);
        }
        if (stristr($template, '[follow]')) {
            $follow = $hc_cfg[63] != '' ? '<a href="http://www.twitter.com/' . $hc_cfg[63] . '" target="_blank"><img src="' . CalRoot . '/newsletter/images/follow_me.png" style="border:0px;" /></a>' : '';
            $template = str_replace('[follow]', $follow, $template);
        }
        if (stristr($template, '[calendarurl]')) {
            $template = str_replace('[calendarurl]', '<a href="' . CalRoot . '/" target="_blank">' . CalRoot . '/</a>', $template);
        }
        if (stristr($template, '[editcancel]')) {
            $template = str_replace('[editcancel]', '<a href="' . CalRoot . '/index.php?com=edit" target="_blank">' . $hc_lang_news['EditLinkTxt'] . '</a>', $template);
        }
        if (stristr($template, '[archive]')) {
            $template = $doArchive == 1 ? str_replace('[archive]', '<a href="' . $archive . '" target="_blank">' . $hc_lang_news['ArchiveLinkTxt'] . '</a>', $template) : str_replace('[archive]', '', $template);
        }
        if (stristr($template, '[event-count]')) {
            $result = doQuery("SELECT COUNT(*) FROM " . HC_TblPrefix . "events WHERE IsActive = 1 AND IsApproved = 1 AND StartDate >= '" . cIn(SYSDATE) . "'");
            $eCnt = hasRows($result) ? number_format(mysql_result($result, 0, 0), 0, '.', ',') : 0;
            $template = str_replace('[event-count]', $eCnt, $template);
        }
        if (stristr($template, '[location-count]')) {
            $result = doQuery("SELECT COUNT(*) FROM " . HC_TblPrefix . "locations WHERE IsActive = 1");
            $lCnt = hasRows($result) ? number_format(mysql_result($result, 0, 0), 0, '.', ',') : 0;
            $template = str_replace('[location-count]', $lCnt, $template);
        }
        if (stristr($template, '[track]')) {
            $template = str_replace('[track]', '<img src="' . CalRoot . '/newsletter/a.php?a=' . md5($nID) . '" width="1" height="1" />', $template);
        }
        ob_flush();
        ob_start();
        $fp = fopen($tmplCache, 'w');
        echo $template;
        fwrite($fp, ob_get_contents());
        fclose($fp);
        ob_end_clean();
    }
    return includeToString(realpath($tmplCache));
}
Example #6
0
function listAllEvents()
{
    $events = getEventList();
    include '../view/eventList.php';
}
Example #7
0
			getHospitalLegaleseTimestamps("1");

		case '1.9.5':
			reportPerson($personXML, $eventShortname, $xmlFormat, $user, $pass);
			createPersonUuid($user, $pass);
			createPersonUuidBatch($number, $user, $pass);
			createNoteUuid($user, $pass);
			createNoteUuidBatch($number, $user, $pass);
			search("test", "t");
			searchWithAuth("test", "t", $user, $pass);
			getSessionTimeout();
			registerUser("testCaseUser", "*****@*****.**", "testPassword99", "testCaseGiven", "testCaseFamily");
			changeUserPassword($user, $pass, $pass);
			forgotUsername($email);
			checkUserAuth($user, $pass);
			getUserStatus($user);
			getUserGroup($user);
			getEventList();
			getEventListUser($user, $pass);
			getGroupList();
			getHospitalList();
			getHospitalData("1");
			getHospitalPolicy("1");
	}
	echo "</table><b>Note: deprecated functions are not listed/tested.</b></body>";
}




 function getEventsForCalendar($calendarId)
 {
     return getEventList($this->client, $calendarId)['items'];
 }
function retrieveEvents($client, $calendarId)
{
    return getEventList($client, htmlspecialchars($calendarId))['items'];
}