Working with BU Calendar

BU has a custom phpbin Calendar App that is the source for all the BU Calendar pages.

The calendar app data is fed into WordPress sites via the calendar #id [in the URL, at the end of the string] and custom coded within each site.
This is usually some custom html, or custom WordPress templates.

Example

University Bands Calendar,
Located at: http://www.bu.edu/bands/calendar/

Is powered by this data:
http://www.bu.edu/phpbin/calendar/app/calendar.php?id=47

[Using the page template in the responsive framework 2x:
https://github.com/bu-ist/responsive-framework/blob/master/inc/calendar.php]

 

Common Tasks & Issues

When developing in a sandbox it is helpful to have data to match production. But, by default, sandbox sites are pointed to a development version of the calendar that is usually out of sync with the main University calendar.

Making Calendar Data Viewable in Sandbox

Requesting Permission to Add Events To A Calendar

Each individual calendar has its own Access permissions. If you are looking at a calendar in the development environment and do not see the New Events, Topics, Options, and Sharing in the menu bar then you do not have access to add events.

Request Access

  1. Post the calendar URL in the #Interactive-Design Slack channel and ask if anyone in ID has admin access that can add you as an admin.
  2. If there are no general admins for that calendar, Slack Steve @srudolfi or Adam @adamzp  in Slack ( Global Access Owners ) and request they add you to the calendar as an admin.

Ask #WebTeam slack channel

Ask the #WebTeam channel in slack to copy the data over from Prod to your sandbox environment, usually this will request will be completed by Adam P. They will export the prod database and import that database into your sandbox development environment.

 

Update Sandbox BU Calendar Plugin Constants

Caution: This method will point all calendar links in your sandbox to production. Do not edit the production calendar unless that is your intention.

In Your Sandbox:

In the php file located at: wp-content/mu-plugins/bu-calendar/bu-calendar.php, add this line to the top of the file:

1 define( ‘DEV_BU_CALENDAR_RPC_URI’, ‘http://www.bu.edu/phpbin/calendar/rpc‘ );

In the php file located at: wp-content/mu-plugins/bu-calendar/calendar.php, comment out the existing endpoints and replace with new endpoints with the new constant:

1

2

3

4

5

6

7

8

9

10

11

//  const CALENDARS_ENDPOINT = BU_CALENDAR_RPC_URI  . ‘/calendars.php?cid=’;

//  const EVENTS_ENDPOINT = BU_CALENDAR_RPC_URI  . ‘/events.php?cid=’;

//  const EVENT_ENDPOINT = BU_CALENDAR_RPC_URI  . ‘/event.php?cid=’;

//  const FIELDS_ENDPOINT = BU_CALENDAR_RPC_URI  . ‘/fields.php?cid=’;

//  const TOPICS_ENDPOINT = BU_CALENDAR_RPC_URI  . ‘/topics.php?cid=’;

 

    const CALENDARS_ENDPOINT = DEV_BU_CALENDAR_RPC_URI  . ‘/calendars.php?cid=’;

    const EVENTS_ENDPOINT = DEV_BU_CALENDAR_RPC_URI  . ‘/events.php?cid=’;

    const EVENT_ENDPOINT = DEV_BU_CALENDAR_RPC_URI  . ‘/event.php?cid=’;

    const FIELDS_ENDPOINT = DEV_BU_CALENDAR_RPC_URI  . ‘/fields.php?cid=’;

    const TOPICS_ENDPOINT = DEV_BU_CALENDAR_RPC_URI  . ‘/topics.php?cid=’;

After the file’s been uploaded to the desired sandbox, wait about 30 minutes for the transients to clear and the calendar to refresh. In some cases it may take as long as 45 minutes.

 

Adding BU Calendar ID

If you don’t know the Calendar ID, go to the site you want the ID from, select settings > Site Options from the dashboard. Then, click the link for changing existing options as depicted above and search for the calendar ID. ( Or go into the database and search on the options table for the option_name: bu_calendar_id ).

For a calendar to show, there needs to be a BU Calendar ID in the site options. Sometimes on a fresh site or on a sandbox site there will often be no calendar ID defined.

To add a new calendar ID go to Settings > Site Options in the dashboard of your sandbox site.

Add the option name bu_calendar_id and the option value will be the integer of the calendar you want to show. The main [University-wide] BU Calendar id is 17. Using this ID can be helpful during development testing, when you just need an example of calendar events in general and it doesn’t need to be specific to the site.

Caching

The cache on the average devl calendar takes about 30–45 minutes to clear. If you, or a designer, needs to make changes, or add events: be patient, and check back in 30 minutes.

Calendar URLs

All Available Calendars Within The App [Listing]

Located at: http://www.bu.edu/phpbin/calendar/app/calendars.php

Official BU Calendar Plugin Documentation

Located at: http://developer.bu.edu/webteam/applications/calendar/

Main University Calendar

Located at: http://www.bu.edu/calendar/

Development Calendar

Located at: http://www-devl.bu.edu/nisdev/php5/calendar/app/calendar.php?id=1386

Production Calendar

http://www.bu.edu/phpbin/calendar/app/calendar.php?id=1386