Changeset 12707

Show
Ignore:
Timestamp:
10/09/07 12:42:17 (1 year ago)
Author:
bergie
Message:

Some initial work for being able to use choosers with mnrelation fields. Doesn't work yet

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.user/config/schemadb_person.inc

    r12696 r12707  
    7373            'widget' => 'radiocheckselect', 
    7474        ), 
     75        /*'groups' => array 
     76        ( 
     77            'title' => 'groups', 
     78            'storage' => null, 
     79            'type' => 'mnrelation', 
     80            'type_config' => array 
     81            ( 
     82                'mapping_class_name' => 'midcom_db_member', 
     83                'master_fieldname' => 'uid', 
     84                'member_fieldname' => 'gid', 
     85                'master_is_id' => true, 
     86                'option_callback' => 'midcom_helper_datamanager2_callback_select_grouplister', 
     87                'option_callback_arg' => array 
     88                ( 
     89                    'value_field' => 'official', 
     90                    'key_field' => 'id' 
     91                ), 
     92            ), 
     93            'widget' => 'chooser', 
     94            'widget_config' => array 
     95            ( 
     96                'clever_class' => 'group', 
     97                'id_field' => 'id', 
     98            ), 
     99        ),*/ 
    75100    ), 
    76101), 
  • trunk/midcom/midcom.helper.datamanager2/widget/chooser.php

    r12462 r12707  
    267267    function _on_initialize() 
    268268    { 
    269         if (is_a('midcom_helper_datamanager2_type_select', $this->_type)) 
     269        if (   is_a('midcom_helper_datamanager2_type_select', $this->_type) 
     270            || is_a('midcom_helper_datamanager2_type_mnrelation', $this->_type)) 
    270271        { 
    271272            debug_push_class(__CLASS__, __FUNCTION__); 
     
    624625                    array('metadata.published' => 'ASC'), 
    625626                ), 
     627            ), 
     628            'group' => array 
     629            ( 
     630                'class' => 'midcom_db_group', 
     631                'component' => 'midgard.admin.asgard', 
     632                'headers' => array 
     633                ( 
     634                    'name', 
     635                    'official', 
     636                ), 
     637                'constraints' => array(), 
     638                'searchfields' => array 
     639                ( 
     640                    'name', 
     641                    'official', 
     642                ), 
     643                'orders' => array 
     644                ( 
     645                    array('extra' => 'ASC'),  
     646                    array('metadata.published' => 'ASC'), 
     647                ), 
     648                'id_field' => 'id', 
    626649            ), 
    627650        );