Changeset 18179 for trunk

Show
Ignore:
Timestamp:
10/13/08 18:53:41 (2 months ago)
Author:
flack
Message:

forward port r17959, r17966, r17982

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/org.openpsa.calendar/config/config.inc

    r3853 r18179  
    1 "schemadb" => "file:/org/openpsa/calendar/config/schemadb_default.inc", 
    2 "week_slot_length" => 120, // minutes 
    3 "day_slot_length"  => 60,  // minutes 
    4 "day_start_time"   => 8,   // hour "working day" starts 
    5 "day_end_time"     => 18,  // hour "working day" ends 
    6 "calendar_popup_width"   => 500, // width of the popup in pixels 
    7 "calendar_popup_height"  => 550, // height of the popup in pixels 
    8 "show_group_subscribers" => FALSE, // whether to show members of "subscriber" groups 
     1'schemadb' => 'file:/org/openpsa/calendar/config/schemadb_default.inc', 
     2'schemadb_filters' => 'file:/org/openpsa/calendar/config/schemadb_filters.inc', 
     3 
     4'week_slot_length' => 120, // minutes 
     5'day_slot_length'  => 60,  // minutes 
     6'day_start_time'   => 8,   // hour 'working day' starts 
     7'day_end_time'     => 18,  // hour 'working day' ends 
     8'calendar_popup_width'   => 500, // width of the popup in pixels 
     9'calendar_popup_height'  => 550, // height of the popup in pixels 
     10'show_group_subscribers' => FALSE, // whether to show members of 'subscriber' groups 
    911'start_view' => 'week', // which view to start in 
    1012'wiki_title_skeleton' => 'meeting note for %s on %s by %s', //format of wiki page title created from event 
  • trunk/midcom/org.openpsa.calendar/config/manifest.inc

    r18004 r18179  
    3131            'active' => 'no', 
    3232        ), 
     33        'adrenalin' => array 
     34        ( 
     35            'name' => 'Arttu Manninen', 
     36            'email' => 'arttu@kaktus.cc', 
     37            'role' => 'developer', 
     38        ), 
    3339    ), 
    3440    'dependencies' => array 
    3541    ( 
    36         'midcom.helper.datamanager' => array(), 
     42        'midcom.helper.datamanager2' => array(), 
    3743        'org.openpsa.core' => array(), 
    3844        'org.openpsa.mail' => array(), 
  • trunk/midcom/org.openpsa.calendar/config/schemadb_config.inc

    r3799 r18179  
    11'config' => array 
    22( 
    3     'name'        => 'config', 
    4     'description' => 'Default Configuration Schema', /* This is a topic */ 
     3    'name' => 'config', 
     4    'title' => 'Default Configuration Schema', /* This is a topic */ 
    55    'locktimeout' => 0, /* Don't lock this, we display the edit view always */ 
    6     'fields'      => array 
     6    'fields' => array 
    77    ( 
    88        /* view settings */ 
    99        'start_view' => array 
    1010        ( 
    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 
    1821            ( 
    1922                'title' => 'view settings', 
     
    2225        'calendar_popup_height' => array 
    2326        ( 
    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            ), 
    3036        ), 
    3137        'calendar_popup_width' => array 
    3238        ( 
    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' => '', 
    4049        ), 
    4150        /* time settings */ 
    4251        'day_start_time' => array 
    4352        ( 
    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, 
    4857            'config_domain' => 'org.openpsa.calendar', 
    49             'config_key'    => 'day_start_time', 
    50             'start_fieldgroup' => array 
     58            'config_key' => 'day_start_time', 
     59            'start_fieldset' => array 
    5160            ( 
    5261                'title' => 'time settings', 
     
    5564        'day_end_time' => array 
    5665        ( 
    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, 
    6170            'config_domain' => 'org.openpsa.calendar', 
    62             'config_key'    => 'day_end_time', 
     71            'config_key' => 'day_end_time', 
    6372        ), 
    6473        'day_slot_length' => array 
    6574        ( 
    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, 
    7079            'config_domain' => 'org.openpsa.calendar', 
    71             'config_key'    => 'day_slot_length', 
     80            'config_key' => 'day_slot_length', 
    7281        ), 
    7382        'week_slot_length' => array 
    7483        ( 
    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, 
    7988            'config_domain' => 'org.openpsa.calendar', 
    80             'config_key'    => 'week_slot_length', 
    81             'end_fieldgroup' => '', 
     89            'config_key' => 'week_slot_length', 
     90            'end_fieldset' => '', 
    8291        ), 
    8392         
     
    8594        'schemadb' => array 
    8695        ( 
    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 
    93105            (  
    94106                'title' => 'advanced schema and data settings', 
    95107            ), 
    96108        ), 
    97         'always_show_group' => array 
     109        'always_show_group' => array 
    98110        ( 
    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            ), 
    104119        ),  
    105         'always_show_self' => array 
     120        'always_show_self' => array 
    106121        ( 
    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            ( 
    114133                1 => 'yes',             
    115134                0 => 'no', 
    116135            ), 
    117136        ),          
    118         'event_label' => array 
     137        'event_label' => array 
    119138        ( 
    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' => '', 
    126148        ), 
    127149    ), 
  • trunk/midcom/org.openpsa.calendar/config/schemadb_default.inc

    r4794 r18179  
    1 'default' => array ( 
    2  
    3     'name'        => 'default', 
     1'default' => array 
     2
     3    'name' => 'default', 
    44    'description' => 'event', 
    5     'fields'      => array ( 
     5    'fields' => array 
     6    ( 
    67        //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, 
    1216        ), 
    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            ( 
    1825                'title' => 'event information', 
    1926                'css_group' => 'area', 
    2027            ), 
    21             'required'    => true, 
     28            'required' => true, 
    2229        ), 
    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', 
    2736        ), 
    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', 
    3447        ), 
    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', 
    4158        ), 
    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' => '', 
    4870        ), 
    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            ( 
    5691                'title' => 'participants', 
    5792                'css_group' => 'area', 
    5893            ), 
    5994        ), 
    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                ), 
    68107            ), 
     108            'widget' => 'select', 
    69109        ), 
    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' => '', 
    77118        ), 
    78119    ), 
  • trunk/midcom/org.openpsa.calendar/handler/filters.php

    r17350 r18179  
    1919        parent::__construct(); 
    2020    } 
    21  
     21     
     22    /** 
     23     * Handle the AJAX request 
     24     */ 
    2225    function _handle_ajax() 
    2326    { 
     
    5053 
    5154    /** 
    52      * @param mixed $handler_id The ID of the handler. 
    53      * @param Array $args The argument list. 
    54      * @param Array &$data The local request data. 
    55      * @return boolean Indicating success. 
     55     * Handle the request for editing contact list 
     56     *  
     57     * @access public 
     58     * @param String $handler_id    Name of the request handler 
     59     * @param array $args           Variable arguments 
     60     * @param array &$data          Public request data, passed by reference 
     61     * @return boolean              Indicating success 
    5662     */ 
    5763    function _handler_edit($handler_id, $args, &$data) 
    5864    { 
    5965        $_MIDCOM->auth->require_valid_user(); 
    60  
    61         $this->_request_data['user'] = $_MIDCOM->auth->user->get_storage(); 
    62  
    63         if (   array_key_exists('org_openpsa_calendar_filters_add', $_POST) 
    64             || array_key_exists('org_openpsa_calendar_filters_remove', $_POST)) 
     66         
     67        // Get the current user 
     68        $this->_person = new midcom_db_person($_MIDGARD['user']); 
     69        $this->_person->require_do('midgard:update'); 
     70         
     71        // Load the schema database 
     72        $this->_schemadb = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_filters')); 
     73         
     74        // Load the controller 
     75        $this->_controller = midcom_helper_datamanager2_controller::create('simple'); 
     76        $this->_controller->schemadb =& $this->_schemadb; 
     77        $this->_controller->set_storage($this->_person); 
     78        if (! $this->_controller->initialize()) 
    6579        { 
    66             $this->_handle_ajax(); 
     80            $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Failed to initialize a DM2 controller instance for article {$this->_article->id}."); 
     81            // This will exit. 
    6782        } 
    68  
    69         // Debug helpers 
    70         $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL."/org.openpsa.helpers/messages.js"); 
    71         $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL."/org.openpsa.helpers/ajaxutils.js"); 
    72  
    73         $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL."/org.openpsa.calendar/filters.js"); 
    74         $_MIDCOM->add_jsonload("org_openpsa_calendar_filters_makeEditable();"); 
    75  
    76         $this->_request_data['buddylist'] = array(); 
    77  
    78         $qb = org_openpsa_contacts_buddy::new_query_builder(); 
    79         $qb->add_constraint('account', '=', $this->_request_data['user']->guid); 
    80         $qb->add_constraint('blacklisted', '=', false); 
    81         $buddies = $qb->execute(); 
    82  
    83         foreach ($buddies as $buddy) 
     83         
     84        // Process the form 
     85        switch ($this->_controller->process_form()) 
    8486        { 
    85             $person = new org_openpsa_contacts_person($buddy->buddy); 
    86             if ($person) 
    87             { 
    88                 $this->_request_data['buddylist'][$person->id] = $person; 
    89             } 
     87            case 'save': 
     88            case 'cancel': 
     89                if (isset($_GET['org_openpsa_calendar_returnurl'])) 
     90                { 
     91                    $url = $_GET['org_openpsa_calendar_returnurl']; 
     92                } 
     93                else 
     94                { 
     95                    $url = ''; 
     96                } 
     97                $_MIDCOM->relocate($url); 
     98                // This will exit 
    9099        } 
    91  
    92         // Add user to the filter list if needed 
    93         if (   !array_key_exists($this->_request_data['user']->id, $this->_request_data['buddylist']) 
    94             && $_MIDCOM->auth->can_do('midgard:create', $GLOBALS['midcom_component_data']['org.openpsa.calendar']['calendar_root_event'])) 
     100         
     101        // Add the breadcrumb pieces 
     102        $tmp = array(); 
     103         
     104        if (isset($_GET['org_openpsa_calendar_returnurl'])) 
    95105        { 
    96                 $this->_request_data['buddylist'][$this->_request_data['user']->id] = $this->_request_data['user']; 
    97         } 
    98  
    99         if (array_key_exists('org_openpsa_calendar_returnurl', $_GET)) 
    100         { 
    101             $this->_view_toolbar->add_item( 
    102                 Array( 
    103                     MIDCOM_TOOLBAR_URL => $_GET['org_openpsa_calendar_returnurl'], 
    104                     MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('back to calendar'), 
    105                     MIDCOM_TOOLBAR_HELPTEXT => null, 
    106                     MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png', 
    107                     MIDCOM_TOOLBAR_ENABLED => true, 
    108                 ) 
     106            $tmp[] = array 
     107            ( 
     108                MIDCOM_NAV_URL => $_GET['org_openpsa_calendar_returnurl'], 
     109                MIDCOM_NAV_NAME => $this->_l10n->get('calendar'), 
    109110            ); 
    110111        } 
    111  
    112         $_MIDCOM->set_pagetitle($this->_request_data['l10n']->get('choose calendars')); 
     112         
     113        $tmp[] = array 
     114        ( 
     115            MIDCOM_NAV_URL => 'filters/', 
     116            MIDCOM_NAV_NAME => $this->_l10n->get('choose calendars'), 
     117        ); 
     118        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp); 
    113119 
    114120        return true; 
     
    116122 
    117123    /** 
    118      * 
    119      * @param mixed $handler_id The ID of the handler. 
    120      * @param mixed &$data The local request data. 
     124     * Show the contact editing interface 
     125     *  
     126     * @access public 
     127     * @param String $handler_id    Name of the request handler 
     128     * @param array &$data          Public request data, passed by reference 
    121129     */ 
    122130    function _show_edit($handler_id, &$data) 
    123131    { 
    124         if (count($this->_request_data['buddylist']) > 0) 
    125         { 
    126             midcom_show_style("show-filters-header"); 
    127             foreach ($this->_request_data['buddylist'] as $person) 
    128             { 
    129                 $this->_request_data['person'] =& $person; 
    130                 if ($this->_request_data['user']->parameter('org_openpsa_calendar_show', $person->guid)) 
    131                 { 
    132                     $this->_request_data['subscribed'] = true; 
    133                 } 
    134                 else 
    135                 { 
    136                     $this->_request_data['subscribed'] = false; 
    137                 } 
    138                 midcom_show_style("show-filters-item"); 
    139             } 
    140             midcom_show_style("show-filters-footer"); 
    141         } 
     132        $data['controller'] =& $this->_controller; 
     133        $data['person'] =& $this->_person; 
     134         
     135        midcom_show_style('calendar-filter-chooser'); 
    142136    } 
    143137} 
  • trunk/midcom/org.openpsa.calendar/locale/default.en.txt

    r4574 r18179  
    1010---STRING back to calendar 
    1111Back to calendar 
     12---STRINGEND 
     13 
     14---STRING calendar 
     15Calendar 
    1216---STRINGEND 
    1317 
     
    8084---STRINGEND 
    8185 
     86---STRING groups 
     87Groups 
     88---STRINGEND 
     89 
    8290---STRING location 
    8391Location 
     
    112120---STRINGEND 
    113121 
     122---STRING people 
     123People 
     124---STRINGEND 
     125 
    114126---STRING popup 
    115127Pop-Up 
     
    136148---STRINGEND 
    137149 
     150---STRING resources 
     151Resources 
     152---STRINGEND 
     153 
    138154---STRING start time 
    139155Start time 
     
    156172---STRINGEND 
    157173 
     174---STRING week %s 
     175Week %s 
     176---STRINGEND 
     177 
  • trunk/midcom/org.openpsa.calendar/locale/default.fi.txt

    r4574 r18179  
    1010---STRING back to calendar 
    1111Takaisin kalenteriin 
     12---STRINGEND 
     13 
     14---STRING calendar 
     15Kalenteri 
    1216---STRINGEND 
    1317 
     
    8084---STRINGEND 
    8185 
     86---STRING groups 
     87RyhmÀt 
     88---STRINGEND 
     89 
    8290---STRING location 
    8391Paikka 
     
    112120---STRINGEND 
    113121 
     122---STRING people 
     123Henkilöt 
     124---STRINGEND 
     125 
    114126---STRING popup 
    115127Pop-up -ikkuna 
     
    136148---STRINGEND 
    137149 
     150---STRING resources 
     151Resurssit 
     152---STRINGEND 
     153 
    138154---STRING start time 
    139155Alkaa 
     
    156172---STRINGEND 
    157173 
     174---STRING week %s 
     175Viikko %s 
     176---STRINGEND 
     177 
  • trunk/midcom/org.openpsa.calendar/midcom/interfaces.php

    r18177 r18179  
    2222        $this->_component = 'org.openpsa.calendar'; 
    2323        $this->_autoload_class_definitions = array('midcom_dba_classes.inc'); 
    24         $this->_autoload_files = array( 
     24        $this->_autoload_files = array 
     25        ( 
    2526            'event_resource.php', 
    2627        ); 
    27         $this->_autoload_libraries = Array( 
     28        $this->_autoload_libraries = array 
     29        ( 
    2830            'midcom.helper.datamanager', 
    2931            'org.openpsa.core', 
     
    323325 
    324326        // Transfer metadata dependencies from classes that we drive 
    325         $classes = array( 
     327        $classes = array 
     328        ( 
    326329            'org_openpsa_calendar_event', 
    327330            'org_openpsa_calendar_eventmember', 
     
    334337                { 
    335338                    default: 
    336                         $metadata_fields = array( 
     339                        $metadata_fields = array 
     340                        ( 
    337341                            'creator' => 'id', 
    338342                            'revisor' => 'id' // Though this will probably get touched on update we need to check it anyways to avoid invalid links 
  • trunk/midcom/org.openpsa.calendar/style/show-event-delete.php

    r5048 r18179  
    1717                    <?php echo $data['l10n']->get('really delete event'); ?> 
    1818                    <input type="submit" id="org_openpsa_calendar_deleteok" name="org_openpsa_calendar_deleteok" value="<?php echo $data['l10n_midcom']->get('yes'); ?>" /> 
     19                    <input type="submit" id="org_openpsa_calendar_delete_cancel" name="org_openpsa_calendar_delete_cancel" value="<?php echo $data['l10n_midcom']->get('no'); ?>" /> 
    1920                </label> 
    2021            </fieldset> 
  • trunk/midcom/org.openpsa.calendar/viewer.php

    r18160 r18179  
    3131        $this->_selected_time = time(); 
    3232 
    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; 
    4539 
    4640        // Always run in uncached mode 
    4741        $_MIDCOM->cache->content->no_cache(); 
    4842 
    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')) 
    5144        { 
    5245            // Match / 
    53             $this->_request_switch[] = array( 
    54                 'handler' => 'notinitialized' 
     46            $this->_request_switch['not_initialized'] = array 
     47            ( 
     48                'handler' => 'notinitialized', 
    5549            ); 
    5650        } 
     
    5852        { 
    5953            // 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                ), 
    6161                'fixed_args' => 'month', 
    6262                'variable_args' => 1, 
    63                 'handler' => 'month' 
    6463            ); 
    6564            // 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                ), 
    6772                'fixed_args' => 'month', 
    68                 'handler' => 'month' 
    6973            ); 
    7074            // 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                ), 
    7282                'fixed_args' => 'week', 
    7383                'variable_args' => 1, 
    74                 'handler' => 'week' 
    7584            ); 
    7685            // 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                ), 
    7893                'fixed_args' => 'week', 
    79                 'handler' => 'week' 
    8094            ); 
    8195            // 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                ), 
    83103                'fixed_args' => 'day', 
    84104                'variable_args' => 1, 
    85                 'handler' => 'day' 
    86105            ); 
    87106            // 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                ), 
    89114                'fixed_args' => 'day', 
    90                 'handler' => 'day' 
    91115            ); 
    92116            // 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                ), 
    95129                'variable_args' => 2, 
    96                 'handler' => 'event_new' 
    97130            ); 
    98131            // 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