Subversion Repositories HomeAutomation

Rev

Rev 1169 | Rev 1215 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1169 Rev 1194
Line 2... Line 2...
2
 
2
 
3
require(dirname(__FILE__)."/config.php");
3
require(dirname(__FILE__)."/config.php");
-
 
4
 
-
 
5
/*
-
 
6
 
-
 
7
  http://www.howtoforge.com/talking-soap-with-exchange
-
 
8
 
-
 
9
*/
4
 
10
 
5
if (isset($_GET["function"]))
11
if (isset($_GET["function"]))
6
{
12
{
7
    switch ($_GET["function"])
13
    switch ($_GET["function"])
8
    {
14
    {
9
        case "getMeetingsRestOfDay":
15
        case "getMeetingsRestOfDay":
10
        if (isset($_GET["shortname"]))
16
        if (isset($_GET["shortname"]))
11
        {
17
        {
12
            echo getMeetingsRestOfDay($_GET["shortname"]);
18
            echo getMeetingsRestOfDay($_GET["shortname"]);
13
        }
19
        }
14
        break;
20
        break;
15
       
21
       
16
        case "bookMeeting":
22
        case "bookMeeting":
17
        if (isset($_GET["from"]) && isset($_GET["to"]))
23
        if (isset($_GET["from"]) && isset($_GET["to"]))
18
        {
24
        {
Line 24... Line 30...
24
        //
30
        //
25
        //break;
31
        //break;
26
    }
32
    }
27
}
33
}
28
 
34
 
-
 
35
/*
-
 
36
    $CreateItem->SendMeetingInvitations = "SendToNone";
-
 
37
    $CreateItem->SavedItemFolderId->DistinguishedFolderId->Id = "calendar";
-
 
38
    $CreateItem->Items->CalendarItem = array();
-
 
39
    $CreateItem->Items->CalendarItem[0]->Subject = "Hello from PHP";
-
 
40
    $CreateItem->Items->CalendarItem[0]->Start = "2010-01-01T16:00:00Z"; # ISO date format. Z denotes UTC time
-
 
41
    $CreateItem->Items->CalendarItem[0]->End = "2010-01-01T17:00:00Z";
-
 
42
    $CreateItem->Items->CalendarItem[0]->IsAllDayEvent = false;
-
 
43
    $CreateItem->Items->CalendarItem[0]->LegacyFreeBusyStatus = "Busy";
-
 
44
    $CreateItem->Items->CalendarItem[0]->Location = "Bahamas";
-
 
45
    $CreateItem->Items->CalendarItem[0]->Categories->String = "MyCategory";
-
 
46
    $result = $client->CreateItem($CreateItem);
-
 
47
    print_array($result);
-
 
48
*/
-
 
49
 
-
 
50
/*
-
 
51
  Get all meetings from now and 9 hours later
-
 
52
  Return a JSON formed string
-
 
53
*/
29
function getMeetingsRestOfDay($shortname)
54
function getMeetingsRestOfDay($shortname)
30
{
55
{
31
    global $Calender;
56
    global $Calender;
32
    global $wsdl;
57
    global $wsdl;
33
    $founditem = false;
58
    $founditem = false;
Line 45... Line 70...
45
    {
70
    {
46
        $FindItem->Traversal = "Shallow";
71
        $FindItem->Traversal = "Shallow";
47
        $FindItem->ItemShape->BaseShape = "AllProperties";
72
        $FindItem->ItemShape->BaseShape = "AllProperties";
48
        $FindItem->ParentFolderIds->DistinguishedFolderId->Id = "calendar";
73
        $FindItem->ParentFolderIds->DistinguishedFolderId->Id = "calendar";
49
        /* Dont forget to use the proper timezone and setting for daylight saving time (php handles this fine) */
74
        /* Dont forget to use the proper timezone and setting for daylight saving time (php handles this fine) */
50
        $FindItem->CalendarView->StartDate = date("c");     //"2009-04-07T08:00:00Z";
75
        $FindItem->CalendarView->StartDate = date("c");                     //"2009-04-07T08:00:00Z";
51
        $FindItem->CalendarView->EndDate = date("c", strtotime("+9 hour")); //"2009-04-08T00:00:00Z";
76
        $FindItem->CalendarView->EndDate = date("c", strtotime("+9 hour")); //"2009-04-08T00:00:00Z";
52
        //echo date("c")." ".date("c", strtotime("+8 hour"))." ".date("c", strtotime("18:00"))."\n";
77
        //echo date("c")." ".date("c", strtotime("+8 hour"))." ".date("c", strtotime("18:00"))."\n";
53
 
78
 
54
        stream_wrapper_unregister('https');
79
        stream_wrapper_unregister('https');
55
        stream_wrapper_register('https', 'NTLMStream') or die("Failed to register protocol");
80
        stream_wrapper_register('https', 'NTLMStream') or die("Failed to register protocol");