Changeset 17959
- Timestamp:
- 10/06/08 12:33:59 (2 months ago)
- Files:
-
- branches/MidCOM_2_8/org.openpsa.calendar/calendar_midcomdba.php (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.calendar/config/manifest.inc (modified) (2 diffs)
- branches/MidCOM_2_8/org.openpsa.calendar/config/schemadb_config.inc (modified) (4 diffs)
- branches/MidCOM_2_8/org.openpsa.calendar/config/schemadb_default.inc (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.calendar/handler/admin.php (added)
- branches/MidCOM_2_8/org.openpsa.calendar/handler/create.php (added)
- branches/MidCOM_2_8/org.openpsa.calendar/handler/filters.php (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.calendar/handler/view.php (added)
- branches/MidCOM_2_8/org.openpsa.calendar/midcom/interfaces.php (modified) (4 diffs)
- branches/MidCOM_2_8/org.openpsa.calendar/viewer.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/org.openpsa.calendar/calendar_midcomdba.php
r17251 r17959 1649 1649 } 1650 1650 $vcal_keys['ATTENDEE'][] = "mailto:{$person->email}"; 1651 $vcal_key_parameters['ATTENDEE'][] = array( 1651 $vcal_key_parameters['ATTENDEE'][] = array 1652 ( 1652 1653 'ROLE' => 'REQ-PARTICIPANT', 1653 1654 'CUTYPE' => 'INVIDUAL', branches/MidCOM_2_8/org.openpsa.calendar/config/manifest.inc
r17454 r17959 10 10 'midcom_dba_classes.inc', 11 11 ), 12 'version' => ' 2.1.1',13 'state' => ' stable',12 'version' => '3.0.0', 13 'state' => 'beta', 14 14 'package.xml' => array 15 15 ( … … 30 30 'role' => 'lead', 31 31 ), 32 'adrenalin' => array 33 ( 34 'name' => 'Arttu Manninen', 35 'email' => 'arttu@kaktus.cc', 36 'role' => 'developer', 37 ), 32 38 ), 33 39 'dependencies' => array 34 40 ( 35 'midcom.helper.datamanager ' => array(),41 'midcom.helper.datamanager2' => array(), 36 42 'org.openpsa.core' => array(), 37 43 'org.openpsa.mail' => array(), branches/MidCOM_2_8/org.openpsa.calendar/config/schemadb_config.inc
r3799 r17959 1 1 'config' => array 2 2 ( 3 'name' => 'config',4 ' description' => 'Default Configuration Schema', /* This is a topic */3 'name' => 'config', 4 'title' => 'Default Configuration Schema', /* This is a topic */ 5 5 'locktimeout' => 0, /* Don't lock this, we display the edit view always */ 6 'fields' => array6 'fields' => array 7 7 ( 8 8 /* view settings */ 9 9 'start_view' => array 10 10 ( 11 'description' => 'which view to start in', 12 'datatype' => 'text', 13 'default' => 'week', 14 'location' => 'config', 15 'config_domain' => 'org.openpsa.calendar', 16 'config_key' => 'start_view', 17 'start_fieldgroup' => array 11 'title' => 'which view to start in', 12 'type' => 'text', 13 'default' => 'week', 14 'storage' => array 15 ( 16 'location' => 'configuration', 17 'domain' => 'org.openpsa.calendar', 18 'name' => 'start_view' 19 ), 20 'start_fieldset' => array 18 21 ( 19 22 'title' => 'view settings', … … 22 25 'calendar_popup_height' => array 23 26 ( 24 'description' => 'height of the event popup window (px)', 25 'datatype' => 'integer', 26 'default' => 450, 27 'location' => 'config', 28 'config_domain' => 'org.openpsa.calendar', 29 'config_key' => 'calendar_popup_height', 27 'title' => 'height of the event popup window (px)', 28 'type' => 'integer', 29 'default' => 450, 30 'storage' => array 31 ( 32 'location' => 'configuration', 33 'domain' => 'org.openpsa.calendar', 34 'name' => 'calendar_popup_height' 35 ), 30 36 ), 31 37 'calendar_popup_width' => array 32 38 ( 33 'description' => 'width of the event popup window (px)', 34 'datatype' => 'integer', 35 'default' => 300, 36 'location' => 'config', 37 'config_domain' => 'org.openpsa.calendar', 38 'config_key' => 'calendar_popup_width', 39 'end_fieldgroup' => '', 39 'title' => 'width of the event popup window (px)', 40 'type' => 'integer', 41 'default' => 300, 42 'storage' => array 43 ( 44 'location' => 'configuration', 45 'domain' => 'org.openpsa.calendar', 46 'name' => 'calendar_popup_width' 47 ), 48 'end_fieldset' => '', 40 49 ), 41 50 /* time settings */ 42 51 'day_start_time' => array 43 52 ( 44 ' description'=> 'hour "working day" starts',45 ' datatype'=> 'integer',46 ' location'=> 'config',47 'default' => 8,53 'title' => 'hour "working day" starts', 54 'type' => 'integer', 55 'storage' => 'config', 56 'default' => 8, 48 57 'config_domain' => 'org.openpsa.calendar', 49 'config_key' => 'day_start_time',50 'start_field group' => array58 'config_key' => 'day_start_time', 59 'start_fieldset' => array 51 60 ( 52 61 'title' => 'time settings', … … 55 64 'day_end_time' => array 56 65 ( 57 ' description'=> 'hour "working day" ends',58 ' datatype'=> 'integer',59 ' location'=> 'config',60 'default' => 18,66 'title' => 'hour "working day" ends', 67 'type' => 'integer', 68 'storage' => 'config', 69 'default' => 18, 61 70 'config_domain' => 'org.openpsa.calendar', 62 'config_key' => 'day_end_time',71 'config_key' => 'day_end_time', 63 72 ), 64 73 'day_slot_length' => array 65 74 ( 66 ' description'=> 'size of week day slot (minutes)',67 ' datatype'=> 'integer',68 ' location'=> 'config',69 'default' => 60,75 'title' => 'size of week day slot (minutes)', 76 'type' => 'integer', 77 'storage' => 'config', 78 'default' => 60, 70 79 'config_domain' => 'org.openpsa.calendar', 71 'config_key' => 'day_slot_length',80 'config_key' => 'day_slot_length', 72 81 ), 73 82 'week_slot_length' => array 74 83 ( 75 ' description'=> 'size of week view slot (minutes)',76 ' datatype'=> 'integer',77 ' location'=> 'config',78 'default' => 120,84 'title' => 'size of week view slot (minutes)', 85 'type' => 'integer', 86 'storage' => 'config', 87 'default' => 120, 79 88 'config_domain' => 'org.openpsa.calendar', 80 'config_key' => 'week_slot_length',81 'end_field group' => '',89 'config_key' => 'week_slot_length', 90 'end_fieldset' => '', 82 91 ), 83 92 … … 85 94 'schemadb' => array 86 95 ( 87 'description' => 'schema database', 88 'datatype' => 'text', 89 'location' => 'config', 90 'config_domain' => 'org.openpsa.calendar', 91 'config_key' => 'schemadb', 92 'start_fieldgroup' => array 96 'title' => 'schema database', 97 'type' => 'text', 98 'storage' => array 99 ( 100 'location' => 'configuration', 101 'domain' => 'org.openpsa.calendar', 102 'name' => 'schemadb' 103 ), 104 'start_fieldset' => array 93 105 ( 94 106 'title' => 'advanced schema and data settings', 95 107 ), 96 108 ), 97 'always_show_group' => array109 'always_show_group' => array 98 110 ( 99 'description' => 'always display group', 100 'datatype' => 'text', 101 'location' => 'config', 102 'config_domain' => 'org.openpsa.calendar', 103 'config_key' => 'always_show_group', 111 'title' => 'always display group', 112 'type' => 'text', 113 'storage' => array 114 ( 115 'location' => 'configuration', 116 'domain' => 'org.openpsa.calendar', 117 'name' => 'always_show_group' 118 ), 104 119 ), 105 'always_show_self' => array120 'always_show_self' => array 106 121 ( 107 'description' => 'always display self', 108 'datatype' => 'text', 109 'location' => 'config', 110 'config_domain' => 'org.openpsa.calendar', 111 'config_key' => 'always_show_self', 112 'widget' => 'select', 113 'widget_select_choices' => array( 122 'title' => 'always display self', 123 'type' => 'text', 124 'storage' => array 125 ( 126 'location' => 'configuration', 127 'domain' => 'org.openpsa.calendar', 128 'name' => 'always_show_self' 129 ), 130 'widget' => 'select', 131 'widget_select_choices' => array 132 ( 114 133 1 => 'yes', 115 134 0 => 'no', 116 135 ), 117 136 ), 118 'event_label' => array137 'event_label' => array 119 138 ( 120 'description' => 'event label field', 121 'datatype' => 'text', 122 'location' => 'config', 123 'config_domain' => 'org.openpsa.calendar', 124 'config_key' => 'event_label', 125 'end_fieldgroup' => '', 139 'title' => 'event label field', 140 'type' => 'text', 141 'storage' => array 142 ( 143 'location' => 'configuration', 144 'domain' => 'org.openpsa.calendar', 145 'name' => 'event_label' 146 ), 147 'end_fieldset' => '', 126 148 ), 127 149 ), branches/MidCOM_2_8/org.openpsa.calendar/config/schemadb_default.inc
r4794 r17959 1 'default' => array (2 3 'name' => 'default',1 'default' => array 2 ( 3 'name' => 'default', 4 4 'description' => 'event', 5 'fields' => array ( 5 'fields' => array 6 ( 6 7 //Hidden field for orgOpenpsaObtype 7 'object_type' => array( 8 'default' => ORG_OPENPSA_OBTYPE_EVENT, 9 'hidden' => true, 10 'location' => 'orgOpenpsaObtype', 11 'datatype' => 'integer', 8 'object_type' => array 9 ( 10 'title' => 'OpenPSA type', 11 'type' => 'number', 12 'storage' => 'orgOpenpsaObtype', 13 'widget' => 'text', 14 'default' => ORG_OPENPSA_OBTYPE_EVENT, 15 'hidden' => true, 12 16 ), 13 'title' => array ( 14 'description' => 'title', 15 'datatype' => 'text', 16 'location' => 'title', 17 'start_fieldgroup' => array ( 17 'title' => array 18 ( 19 'title' => 'title', 20 'storage' => 'title', 21 'type' => 'text', 22 'widget' => 'text', 23 'start_fieldset' => array 24 ( 18 25 'title' => 'event information', 19 26 'css_group' => 'area', 20 27 ), 21 'required' => true,28 'required' => true, 22 29 ), 23 'location' => array ( 24 'description' => 'location', 25 'datatype' => 'text', 26 'location' => 'location', 30 'location' => array 31 ( 32 'title' => 'location', 33 'storage' => 'location', 34 'type' => 'text', 35 'widget' => 'text', 27 36 ), 28 'start' => array ( 29 'description' => 'start time', 30 'datatype' => 'unixdate', 31 'location' => 'start', 32 'date_withtime' => true, 33 'widget_date_enable_outside_ais' => true, 37 'start' => array 38 ( 39 'title' => 'start time', 40 'storage' => 'start', 41 'type' => 'date', 42 'type_config' => array 43 ( 44 'storage_type' => 'UNIXTIME', 45 ), 46 'widget' => 'jsdate', 34 47 ), 35 'end' => array ( 36 'description' => 'end time', 37 'datatype' => 'unixdate', 38 'location' => 'end', 39 'date_withtime' => true, 40 'widget_date_enable_outside_ais' => true, 48 'end' => array 49 ( 50 'title' => 'end time', 51 'storage' => 'end', 52 'type' => 'date', 53 'type_config' => array 54 ( 55 'storage_type' => 'UNIXTIME', 56 ), 57 'widget' => 'jsdate', 41 58 ), 42 'description' => array ( 43 'description' => 'description', 44 'datatype' => 'markdown', 45 'location' => 'description', 46 'widget_text_inputstyle' => 'longtext', 47 'end_fieldgroup' => '', 59 'description' => array 60 ( 61 'title' => 'title', 62 'storage' => 'description', 63 'type' => 'text', 64 'type_config' => array 65 ( 66 'output_mode' => 'markdown', 67 ), 68 'widget' => 'textarea', 69 'end_fieldset' => '', 48 70 ), 49 'participants' => array ( 50 'description' => 'participants', 51 'datatype' => 'array', 52 'location' => 'participants', 53 'widget' => 'contactchooser', 54 'default' => org_openpsa_helpers_resources(), 55 'start_fieldgroup' => array ( 71 'participants' => array 72 ( 73 'title' => 'participants', 74 'storage' => 'participants', 75 'type' => 'mnrelation', 76 'type_config' => array 77 ( 78 'mapping_class_name' => 'midcom_db_eventmember', 79 'master_fieldname' => 'eid', 80 'member_fieldname' => 'uid', 81 'master_is_id' => true, 82 ), 83 'widget' => 'chooser', 84 'widget_config' => array 85 ( 86 'clever_class' => 'contact', 87 'id_field' => 'id', 88 ), 89 'start_fieldset' => array 90 ( 56 91 'title' => 'participants', 57 92 'css_group' => 'area', 58 93 ), 59 94 ), 60 'orgOpenpsaAccesstype' => array ( 61 'description' => 'access type', 62 'location' => 'orgOpenpsaAccesstype', 63 'datatype' => 'integer', 64 'widget' => 'select', 65 'widget_select_choices' => array( 66 ORG_OPENPSA_ACCESSTYPE_PUBLIC => 'public', 67 ORG_OPENPSA_ACCESSTYPE_PRIVATE => 'private', 95 'orgOpenpsaAccesstype' => array 96 ( 97 'title' => 'access type', 98 'storage' => 'orgOpenpsaAccesstype', 99 'type' => 'select', 100 'type_config' => array 101 ( 102 'options' => array 103 ( 104 ORG_OPENPSA_ACCESSTYPE_PUBLIC => 'public', 105 ORG_OPENPSA_ACCESSTYPE_PRIVATE => 'private', 106 ), 68 107 ), 108 'widget' => 'select', 69 109 ), 70 'busy' => array ( 71 'description' => 'dont allow overlapping', 72 'datatype' => 'integer', 73 'widget' => 'checkbox', 74 'location' => 'busy', 75 'default' => 1, 76 'end_fieldgroup' => '', 110 'busy' => array 111 ( 112 'title' => 'dont allow overlapping', 113 'storage' => 'busy', 114 'type' => 'boolean', 115 'widget' => 'checkbox', 116 'default' => 1, 117 'end_fieldset' => '', 77 118 ), 78 119 ), branches/MidCOM_2_8/org.openpsa.calendar/handler/filters.php
r4794 r17959 94 94 { 95 95 $this->_view_toolbar->add_item( 96 Array( 96 array 97 ( 97 98 MIDCOM_TOOLBAR_URL => $_GET['org_openpsa_calendar_returnurl'], 98 99 MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('back to calendar'), branches/MidCOM_2_8/org.openpsa.calendar/midcom/interfaces.php
r12017 r17959 15 15 $this->_component = 'org.openpsa.calendar'; 16 16 $this->_autoload_class_definitions = array('midcom_dba_classes.inc'); 17 $this->_autoload_files = array( 17 $this->_autoload_files = array 18 ( 18 19 'admin.php', 19 20 'calendar_midcomdba.php', … … 24 25 'navigation.php', 25 26 ); 26 $this->_autoload_libraries = Array( 27 $this->_autoload_libraries = array 28 ( 27 29 'midcom.helper.datamanager', 28 30 'org.openpsa.core', … … 324 326 325 327 // Transfer metadata dependencies from classes that we drive 326 $classes = array( 328 $classes = array 329 ( 327 330 'org_openpsa_calendar_event', 328 331 'org_openpsa_calendar_eventmember', … … 335 338 { 336 339 default: 337 $metadata_fields = array( 340 $metadata_fields = array 341 ( 338 342 'creator' => 'id', 339 343 'revisor' => 'id' // Though this will probably get touched on update we need to check it anyways to avoid invalid links branches/MidCOM_2_8/org.openpsa.calendar/viewer.php
r15517 r17959 31 31 $this->_selected_time = time(); 32 32 33 // Load schema database snippet or file 34 debug_add("Loading Schema Database", MIDCOM_LOG_DEBUG); 35 $schemadb_contents = midcom_get_snippet_content($this->_config->get('schemadb')); 36 eval("\$schemadb = Array ( {$schemadb_contents} );"); 37 38 // Initialize the datamanager with the schema 39 $this->_datamanager = new midcom_helper_datamanager($schemadb); 40 41 if (!$this->_datamanager) { 42 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Datamanager could not be instantiated."); 43 // This will exit. 44 } 33 // Load schema database 34 $this->_schemadb = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb')); 35 $this->_datamanager = new midcom_helper_datamanager2_datamanager($this->_schemadb); 36 37 $this->_request_data['schemadb'] =& $this->_schemadb; 38 $this->_request_data['datamanager'] =& $this->_datamanager; 45 39 46 40 // Always run in uncached mode 47 41 $_MIDCOM->cache->content->no_cache(); 48 42 49 if ( !isset($GLOBALS['midcom_component_data']['org.openpsa.calendar']['calendar_root_event']) 50 || !is_object($GLOBALS['midcom_component_data']['org.openpsa.calendar']['calendar_root_event'])) 43 if (!$this->_config->get('calendar_root_event')) 51 44 { 52 45 // Match / 53 $this->_request_switch[] = array( 54 'handler' => 'notinitialized' 46 $this->_request_switch['not_initialized'] = array 47 ( 48 'handler' => 'notinitialized', 55 49 ); 56 50 } … … 58 52 { 59 53 // Match /month/<date> 60 $this->_request_switch[] = array( 54 $this->_request_switch['month_view_with_date'] = array 55 ( 56 'handler' => array 57 ( 58 'org_openpsa_calendar_handler_view', 59 'month', 60 ), 61 61 'fixed_args' => 'month', 62 62 'variable_args' => 1, 63 'handler' => 'month'64 63 ); 65 64 // Match /month/ 66 $this->_request_switch[] = array( 65 $this->_request_switch['month_view'] = array 66 ( 67 'handler' => array 68 ( 69 'org_openpsa_calendar_handler_view', 70 'month', 71 ), 67 72 'fixed_args' => 'month', 68 'handler' => 'month'69 73 ); 70 74 // Match /week/<date> 71 $this->_request_switch[] = array( 75 $this->_request_switch['week_view_with_date'] = array 76 ( 77 'handler' => array 78 ( 79 'org_openpsa_calendar_handler_view', 80 'week', 81 ), 72 82 'fixed_args' => 'week', 73 83 'variable_args' => 1, 74 'handler' => 'week'75 84 ); 76 85 // Match /week/ 77 $this->_request_switch[] = array( 86 $this->_request_switch['week_view'] = array 87 ( 88 'handler' => array 89 ( 90 'org_openpsa_calendar_handler_view', 91 'week', 92 ), 78 93 'fixed_args' => 'week', 79 'handler' => 'week'80 94 ); 81 95 // Match /day/<date> 82 $this->_request_switch[] = array( 96 $this->_request_switch['day_view_with_date'] = array 97 ( 98 'handler' => array 99 ( 100 'org_openpsa_calendar_handler_view', 101 'day', 102 ), 83 103 'fixed_args' => 'day', 84 104 'variable_args' => 1, 85 'handler' => 'day'86 105 ); 87 106 // Match /day/ 88 $this->_request_switch[] = array( 107 $this->_request_switch['day_view'] = array 108 ( 109 'handler' => array 110 ( 111 'org_openpsa_calendar_handler_view', 112 'day', 113 ), 89 114 'fixed_args' => 'day', 90 'handler' => 'day'91 115 ); 92 116 // Match /event/new/<person_guid>/<timestamp> 93 $this->_request_switch[] = array( 94 'fixed_args' => array('event', 'new'), 117 $this->_request_switch['new_event_for_person_with_time'] = array 118 ( 119 'handler' => array 120 ( 121 'org_openpsa_calendar_handler_create', 122 'create' 123 ), 124 'fixed_args' => array 125 ( 126 'event', 127 'new' 128 ), 95 129 'variable_args' => 2, 96 'handler' => 'event_new'97 130 ); 98 131 // Match /event/new/<person_guid> 99 $this->_request_switch[] = array( 100 'fixed_args' => array('event', 'new'), 101 'variable_args' => 1, 102 'handler' => 'event_new' 132 $this->_request_switch['new_event_for_person'] = array 133 ( 134 'handler' => array 135 ( 136 'org_openpsa_calendar_handler_create', 137 'create' 138 ), 139 'fixed_args' => array 140 ( 141 'event', 142 'new' 143 ), 144 'variable_args' => 1, 103 145 ); 104 146 // Match /event/new 105 $this->_request_switch[] = array( 106 'fixed_args' => array('event', 'new'), 107 'handler' => 'event_new' 147 $this->_request_switch['new_event'] = array 148 ( 149 'handler' => array 150 ( 151 'org_openpsa_calendar_handler_create', 152 'create' 153 ), 154 'fixed_args' => array 155 ( 156 'event', 157 'new' 158 ), 108 159 ); 109 160 // Match /event/raw/<guid> 110 $this->_request_switch['event_view_raw'] = array( 161 $this->_request_switch['event_view_raw'] = array 162 ( 163 'handler' => array 164 ( 165 'org_openpsa_calendar_handler_view', 166 'event', 167 ), 111 168 'fixed_args' => array('event', 'raw'), 112 169 'variable_args' => 1, 113 'handler' => 'event'114 170 ); 115 171 // Match /event/<guid>/<action> 116 $this->_request_switch[] = array( 172 $this->_request_switch['event_action'] = array 173 ( 174 'handler' => array 175 ( 176 'org_openpsa_calendar_handler_admin', 177 'admin', 178 ), 117 179 'fixed_args' => 'event', 118 180 'variable_args' => 2, 119 'handler' => 'event_action'120 181 ); 121 182 // Match /event/<guid> 122 $this->_request_switch['event_view'] = array( 183 $this->_request_switch['event_view'] = array 184 ( 185 'handler' => array 186 ( 187 'org_openpsa_calendar_handler_view', 188 'event', 189 ), 123 190 'fixed_args' => 'event', 124 191 'variable_args' => 1, 125 'handler' => 'event' 126 ); 127 //Match /debug 128 $this->_request_switch[] = array( 129 'fixed_args' => 'debug', 130 'handler' => 'debug' 131 ); 192 ); 193 194 // This will redirect to the selected mode 132 195 // Match / 133 $this->_request_switch[] = array( 134 'handler' => 'frontpage' 196 $this->_request_switch[] = array 197 ( 198 'handler' => 'frontpage', 135 199 ); 136 200 137 201 // Match /filters 138 $this->_request_switch['filters_edit'] = array( 202 $this->_request_switch['filters_edit'] = array 203 ( 204 'handler' => Array('org_openpsa_calendar_handler_filters', 'edit'), 139 205 'fixed_args' => Array('filters'), 140 'handler' => Array('org_openpsa_calendar_handler_filters', 'edit'),141 206 ); 142 207 143 208 // Match /agenda/day/<timestamp> 144 $this->_request_switch['agenda_day'] = array( 209 $this->_request_switch['agenda_day'] = array 210 ( 211 'handler' => Array('org_openpsa_calendar_handler_agenda', 'day'), 145 212 'fixed_args' => Array('agenda', 'day'), 146 213 'variable_args' => 1, 147 'handler' => Array('org_openpsa_calendar_handler_agenda', 'day'),148 214 ); 149 215 150 216 // Match /ical/events/<username> 151 $this->_request_switch['ical_user_feed'] = array( 217 $this->_request_switch['ical_user_feed'] = array 218 ( 219 'handler' => Array('org_openpsa_calendar_handler_ical', 'user_events'), 152 220 'fixed_args' => Array('ical', 'events'), 153 221 'variable_args' => 1, 154 'handler' => Array('org_openpsa_calendar_handler_ical', 'user_events'),155 222 ); 156 223 157 224 // Match /ical/busy/<username> 158 $this->_request_switch['ical_user_busy'] = array( 225 $this->_request_switch['ical_user_busy'] = array 226 ( 227 'handler' => Array('org_openpsa_calendar_handler_ical', 'user_busy'), 159 228 'fixed_args' => Array('ical', 'busy'), 160 229 'variable_args' => 1, 161 'handler' => Array('org_openpsa_calendar_handler_ical', 'user_busy'),162 230 ); 163 231 … … 178 246 179 247 // This component uses Ajax, include the handler javascripts 180 $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL. "/org.openpsa.helpers/ajaxutils.js");248 $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL.'/org.openpsa.helpers/ajaxutils.js'); 181 249 $this->_request_data['view'] = 'default'; 182 250 … … 187 255 'rel' => 'stylesheet', 188 256 'type' => 'text/css', 189 'href' => MIDCOM_STATIC_URL. "/org.openpsa.core/ui-elements.css",257 'href' => MIDCOM_STATIC_URL.'/org.openpsa.core/ui-elements.css', 190 258 ) 191 259 ); … … 208 276 { 209 277 // This is what Datamanager calls to actually create an event 210 $result = array ( 211 "storage" => null, 212 "success" => false, 278 $result = array 279 ( 280 'storage' => null, 281 'success' => false, 213 282 ); 214 283 … … 240 309 debug_add("org_openpsa_relatedto_handler returned \n===\n" . print_r($rel_ret) . "===\n"); 241 310 $this->_request_data['event']->notify_force_add = true; 242 $result[ "storage"] =& $this->_request_data['event'];243 $result[ "success"] = true;311 $result['storage'] =& $this->_request_data['event']; 312 $result['success'] = true; 244 313 //return $result; 245 314 } … … 252 321 } 253 322 254 function _get_datestring($from = false)255 {256 if (!$from)257 {258 $from = $this->_selected_time;259 }260 $datestring = date('Y-m-d', $from);261 return $datestring;262 }263 264 function _populate_toolbar($today_path = null)265 {266 // "New event" should always be in toolbar267 $nap = new midcom_helper_nav();268 $this_node = $nap->get_node($nap->get_current_node());269 if ($_MIDCOM->auth->can_do('midgard:create', $GLOBALS['midcom_component_data']['org.openpsa.calendar']['calendar_root_event']))270 {271 $this->_view_toolbar->add_item(272 Array(273 MIDCOM_TOOLBAR_URL => "#",274 MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('create event'),275 MIDCOM_TOOLBAR_HELPTEXT => null,276 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_new-event.png',277 MIDCOM_TOOLBAR_ENABLED => true,278 MIDCOM_TOOLBAR_OPTIONS => Array(279 'rel' => 'directlink',280 'onClick' => org_openpsa_calendar_interface::calendar_newevent_js($this_node),281 ),282 )283 );284 }285 286 287 if ( $this->_topic->can_do('midgard:update')288 && $this->_topic->can_do('midcom:component_config'))289 {290 $this->_node_toolbar->add_item(291 Array(292 MIDCOM_TOOLBAR_URL => 'config.html',293 MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'),294 MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('component configuration helptext'),295 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_folder-properties.png',296 )297 );298 }299 300 $prefix = MIDCOM_STATIC_URL . '/midcom.helper.datamanager/jscript-calendar';301 $_MIDCOM->add_jsfile("{$prefix}/calendar.js");302 303 // Select correct locale304 $i18n =& $_MIDCOM->get_service("i18n");305 $language = $i18n->get_current_language();306 switch ($language)307 {308 // TODO: Add more languages here when corresponding locale files exist309 case "fi":310 $_MIDCOM->add_jsfile("{$prefix}/calendar-fi.js");311 break;312 case "en":313 default:314 $_MIDCOM->add_jsfile("{$prefix}/calendar-en.js");315 break;316 }317 318 $_MIDCOM->add_jsfile("{$prefix}/calendar-setup.js");319 320 $dateopts = date('Y', $this->_selected_time).', ';321 $dateopts .= date('n', $this->_selected_time) - 1;322 $dateopts .= ', '.date('j', $this->_selected_time);323 324 $_MIDCOM->add_jscript('325 var openPsaShowMonthSelectorCalendarShown = false; <326 var openPsaShowMonthSelectorCalendarInitialized = false;
