Development

Changeset 10104

You must first sign up to be able to contribute.

Changeset 10104

Show
Ignore:
Timestamp:
07/03/08 19:08:18 (5 months ago)
Author:
pmacadden
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfAdvancedAdminGeneratorPlugin/branches/pmacadden/data/generator/sfAdvancedAdmin/default/template/actions/actions.class.php

    r10099 r10104  
    2424    $table  = sfInflector::camelize($this->getRequestParameter('table')); 
    2525    $field  = sfInflector::camelize($this->getRequestParameter('field')); 
    26     $search = $this->getRequestParameter("${table}_${field}_search"); 
     26    $search = $this->getRequestParameter(strtolower("${table}_${field}_search")); 
    2727    $return = ''; 
    2828    $c = new Criteria(); 
  • plugins/sfAdvancedAdminGeneratorPlugin/branches/pmacadden/lib/helper/AdvancedAdminHelper.php

    r9935 r10104  
    1212 */ 
    1313function object_select_map_tag($object, $method, $options = array(), $default_value = null) { 
    14   $map = (isset($options['map'])?$options['map']:array()); 
    15   unset($options['map']); 
    16   return select_tag(_convert_method_to_name($method, $options), options_for_select($map), $options); 
     14 $map = (isset($options['map'])?$options['map']:array()); 
     15 unset($options['map']); 
     16 return select_tag(_convert_method_to_name($method, $options), options_for_select($map), $options); 
    1717} 
    1818 
    1919function object_input_auto_complete_tag($object, $method, $options = array(), $default_value = null) { 
    20   $peer_table = _get_option($options, 'peer_table'); 
    21   $peer_field = _get_option($options, 'peer_field'); 
    22   $input_name = _convert_method_to_name($method, $options); 
    23  
    24   echo input_auto_complete_tag("${peer_table}_${peer_field}_search", '', 
    25       sfContext::getInstance()->getModuleName()."/autocomplete?table=$peer_table&field=$peer_field", 
    26       array('autocomplete' => 'off'), 
    27       array( 
    28         'use_style'            => true, 
    29         'after_update_element' => "function (inputField, selectedItem) { $('".get_id_from_name($input_name)."').value = selectedItem.id; }", 
    30         'method' => 'get' 
    31       ) 
    32   ); 
    33   echo input_hidden_tag($input_name); 
     20  $peer_table = _get_option($options, 'peer_table'); 
     21  $peer_field = _get_option($options, 'peer_field'); 
     22  $input_name = _convert_method_to_name($method, $options); 
     23  $current_value = ($object) ? $object->$method() : null; 
     24   
     25  $peer_class = sfInflector::camelize($peer_table).'Peer'; 
     26  $current_value = call_user_func(array($peer_class, 'retrieveByPk'), $current_value); 
     27   
     28  echo input_auto_complete_tag("${peer_table}_${peer_field}_search", $current_value, 
     29      sfContext::getInstance()->getModuleName()."/autocomplete?table=$peer_table&field=$peer_field", 
     30      array('autocomplete' => 'off'), 
     31      array( 
     32        'use_style'            => true, 
     33        'after_update_element' => "function (inputField, selectedItem) { $('".get_id_from_name($input_name)."').value = selectedItem.id; }", 
     34        'method' => 'get' 
     35      ) 
     36  ); 
     37  echo input_hidden_tag($input_name); 
    3438} 
    3539?>