Example #1
0
 /**
  * Day view
  *
  * @param String $handler_id    Name of the request handler
  * @param array $args           Variable arguments
  * @param array &$data          Public request data, passed by reference
  */
 public function _handler_day($handler_id, array $args, array &$data)
 {
     midcom::get('auth')->require_valid_user();
     $this->_generate_date($args);
     // Instantiate calendar widget
     $this->_calendar = new org_openpsa_widgets_calendar(date('Y', $this->_selected_time), date('m', $this->_selected_time), date('d', $this->_selected_time));
     $this->_calendar->type = org_openpsa_widgets_calendar::DAY;
     // Slots are 2 hours long
     $this->_calendar->calendar_slot_length = $this->_config->get('day_slot_length') * 60;
     $this->_calendar->start_hour = $this->_config->get('day_start_time');
     $this->_calendar->end_hour = $this->_config->get('day_end_time');
     $this->_calendar->column_width = 60;
     $this->_populate_toolbar('day');
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'month/' . $this->_get_datestring() . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('month view'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png'));
     $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'week/' . $this->_get_datestring() . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('week view'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png'));
     // Clicking a free slot should bring up 'new event' dialogue
     $nap = new midcom_helper_nav();
     $this_node = $nap->get_node($nap->get_current_node());
     if ($this->_root_event->can_do('midgard:create')) {
         $this->_calendar->reservation_div_options = array('onclick' => org_openpsa_calendar_interface::calendar_editevent_js('__GUID__', $this_node));
     }
     $this->_calendar->free_div_options = array('onclick' => org_openpsa_calendar_interface::calendar_newevent_js($this_node, '__START__', '__RESOURCE__'));
     // Populate contacts
     $this->_populate_calendar_contacts($this->_calendar->get_day_start(), $this->_calendar->get_day_end());
     $this->_request_data['calendar'] =& $this->_calendar;
     // Set the breadcrumb
     $this->add_breadcrumb('year/' . date('Y-01-01', $this->_selected_time) . '/', strftime('%Y', $this->_selected_time));
     $this->add_breadcrumb('month/' . date('Y-m-01', $this->_selected_time) . '/', strftime('%B', $this->_selected_time));
     $this->add_breadcrumb('day/' . date('Y-m-d', $this->_selected_time) . '/', strftime('%x', $this->_selected_time));
     midcom::get('head')->set_pagetitle(strftime("%x", $this->_selected_time));
 }
Example #2
0
 public function _on_initialize()
 {
     org_openpsa_widgets_calendar::add_head_elements();
 }
Example #3
0
 /**
  * Maps the content topic from the request data to local member variables.
  */
 public function _on_initialize()
 {
     org_openpsa_widgets_calendar::add_head_elements();
     org_openpsa_widgets_contact::add_head_elements();
     midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/org.openpsa.projects/projectbroker.js");
 }