Results 1 to 5 of 5

Thread: Get appointment of shared calendar

Hybrid View

  1. #1
    Join Date
    Nov 2010
    Posts
    6
    Rep Power
    4

    Default Get appointment of shared calendar

    Hi !

    I use the excellent module "Zimbra Calendar" for Joomla by Richard Gate.

    It works great, but I want to add one little function :

    For now, the module list the day appointment, for the Default calendar only.

    So, I go see the code (helper.php), I see "inid:10" and I think it's the id of the Default Calendar :


    PHP Code:
     //Get today's appointments
     
    function zimbra_get_appts_today($calsort)
     {
      
    $datestart mktime(0,0,0);
      
    $dateend $datestart + (24 60 60) - 1;
      
    $sortby "dateDesc";
      if (
    $calsort == '1'$sortby "dateAsc";
      
    $req =
      
    '<SearchRequest xmlns="urn:zimbraMail" types="appointment" calExpandInstStart="'.$datestart.'000" calExpandInstEnd="'.$dateend.'000" limit="10" sortBy="'.$sortby.'">
       <query> inid:526 </query>
       </SearchRequest>'
    ;
      
    $this->zimbraSOAP_build_request($req);
      if (!(
    $res $this->zimbraSOAP_execute_request())) return false;
      if (!isset(
    $res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHRESPONSE'])) return false;
      return 
    $res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHRESPONSE'];
     } 

    So, I try to change the id in the request, for example "inid:526" for the Calendar name "Others".

    But, it doesn't work with the id of shared calendar.

    How I can change the request to list all day events of all calendar, including shared calendar ?

    It will be even better if we can list that only for the calendar checked in Zimbra tree List.

    Thanks a lot

  2. #2
    Join Date
    Mar 2011
    Location
    Lansing, MI
    Posts
    17
    Rep Power
    4

    Default

    We are doing similar thing, getting other user's calendar. I believe the same will work for user's own calendars. We get ID for those calendars (those are folders/links) using GetFolderRequest. Perhaps you can find what you need with this request, and set inid:VALUE with VALUE with value in folder's attribute "id".

    Let me know if you want example of this (I have example SOAP requests and responses).

  3. #3
    Join Date
    Nov 2010
    Posts
    6
    Rep Power
    4

    Default

    Yes, to display one specific calendar, I used the line :

    Inid:10

    10 is the id of default calendar, so I put the id I want.
    And to display all calendar, i have just to replace the inid Line by :

    Item:all

    It works great, except for shared calendar :/ Grrrr

    The only problem is that don't display these shared calendar, and I already checked in soap api and forum, I don't find anything...

    The best solution would be to display all appointment of the calendar who are selected (checked) in Zimbra left tree

  4. #4
    Join Date
    Mar 2011
    Location
    Lansing, MI
    Posts
    17
    Rep Power
    4

    Default

    Dear jujusous3,

    Something small (just in case): please confirm appt-start and appt-end are correct to ensure catching some appointments. The time you see appointments on your calendar will be correct using the time zone, but these parameters use number of milliseconds since January 1, 1970, 00:00:00 GMT.

    Note if you put app-start > appt-end, the response will look fine, with no data, since no appointment can start after it finishes.

    Talking about tree on browser, it sounds like you may be using REST. We are using SOAP; believe both SOAP and REST should work fine.

    What version of Zimbra are you using? Our examples are on Zimbra v6.0.8.

    It would help if you could show the requests and responses being made (SOAP or JSON would work); Wireshark should be able to catch those for you.

    Here is how we successfully get appointments from a shared calendar.

    Calendar "Rescal's Test1" was shared, giving advisor-admin role "Admin", and with "Allow user(s) to see my private appointments" checked.

    1. Login as advisor-admin
    2. Get advisor-admin's folders (and links):
    <zmail:GetFolderRequest>
    3. Get ID for link "Rescal's Test1" from response to step 2
    - name="Rescal's Test1" id="300"
    4. Make request for appointments.

    Here is part of the response, including the shared calendar Friend needs access to.

    Response for step 2:
    Code:
            <GetFolderResponse xmlns="urn:zimbraMail">
                <folder i4ms="1" i4next="2" id="1" l="11" ms="1" n="0" name="USER_ROOT" rev="1" s="0">
                    <link color="1" f="#" id="300" l="1" ms="10775" name="Rescal's Test1" owner="rescal@carmen.egr.msu.edu" rev="10775" rgb="#5B9BF2" rid="257" view="appointment" zid="a1dcec46-6ef4-444d-b13c-5547d58b0860"/>
                    <link color="1" id="262" l="1" ms="10780" name="User One's Calendar" owner="user1@carmen.egr.msu.edu" rev="13" rgb="#5B9BF2" rid="10" view="appointment" zid="e583b35d-c01d-49cd-85eb-d98380d7ca48"/>
                </folder>
            </GetFolderResponse>
    When we make SearchRequest with inid:300, it returns appointments for "Rescal's Test1".

    Request for step 4:
    Code:
    	<soap:Body>
    		<zmail:SearchRequest
    				types="appointment">
    			<query>
    				inid:300
    				AND appt-start:&lt;=1304618943139
    				AND appt-end:&gt;=1304446143139
    			</query>
    		</zmail:SearchRequest>
    	</soap:Body>
    Response for step 4:
    Code:
    	<soap:Body>
            <SearchResponse xmlns="urn:zimbraMail" more="0" offset="0" sortBy="dateDesc">
                <appt alarm="1" class="PUB" cm="1" compNum="0" d="1304529598000" dur="1800000" f="" fb="B" fba="B" id="a1dcec46-6ef4-444d-b13c-5547d58b0860:264" invId="a1dcec46-6ef4-444d-b13c-5547d58b0860:264-263" isOrg="1" l="a1dcec46-6ef4-444d-b13c-5547d58b0860:257" loc="" md="1304529598" ms="12" name="Test event" ptst="AC" rev="12" s="0" score="1.0" sf="1304529598000" status="CONF" t="" transp="O" uid="eadd1337-c9cb-464b-8f3f-e8b2a372e3f0" x_uid="eadd1337-c9cb-464b-8f3f-e8b2a372e3f0">
                    <or a="rescal@carmen.egr.msu.edu" d="Resource Calendar" url="rescal@carmen.egr.msu.edu"/>
                </appt>
            </SearchResponse>
        </soap:Body>

  5. #5
    Join Date
    Jan 2012
    Posts
    69
    Rep Power
    3

    Default

    Is it possible to add appointments from Joomla in Zimbra Calendar?

Similar Threads

  1. Replies: 4
    Last Post: 03-15-2013, 01:46 PM
  2. Shared Event Shows Up Multiple Times on Calendar
    By amartin in forum Administrators
    Replies: 0
    Last Post: 03-25-2011, 06:27 AM
  3. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM
  4. Replies: 5
    Last Post: 03-28-2008, 02:24 AM
  5. Replies: 2
    Last Post: 01-15-2008, 04:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •