Ticket #2953: list_params_carry_over.patch
| File list_params_carry_over.patch, 10.5 kB (added by manickam, 11 months ago) |
|---|
-
lib/plugins/sfPropelPlugin/data/generator/sfPropelAdmin/default/template/templates/_filters.php
old new 25 25 <?php endif; ?> 26 26 27 27 <?php endforeach; ?> 28 [?php echo $param_tags; ?] 28 29 </fieldset> 29 30 30 31 <ul class="sf_admin_actions"> 31 <li>[?php echo button_to(__('reset'), '<?php echo $this->getModuleName() ?>/list?filter=filter' , 'class=sf_admin_action_reset_filter') ?]</li>32 <li>[?php echo button_to(__('reset'), '<?php echo $this->getModuleName() ?>/list?filter=filter'.$param_args, 'class=sf_admin_action_reset_filter') ?]</li> 32 33 <li>[?php echo submit_tag(__('filter'), 'name=filter class=sf_admin_action_filter') ?]</li> 33 34 </ul> 34 35 -
lib/plugins/sfPropelPlugin/data/generator/sfPropelAdmin/default/template/templates/_list.php
old new 1 [?php //Set the filter Argument 2 3 $filters = $sf_request->getParameterHolder()->get('filters'); 4 $filter_args = ''; 5 foreach( $filters as $key => $value ) 6 { 7 if( $value ) 8 { 9 if( is_array( $value ) ) 10 { 11 foreach( $value as $key2 => $val) 12 { 13 if( $val ) 14 { 15 $filter_args .= "&filters[$key][$key2]=$val"; 16 } 17 } 18 } 19 else 20 { 21 $filter_args .= "&filters[$key]=$value"; 22 } 23 } 24 } 25 $filter_args .= '&filter=filter'; 26 27 ?] 28 29 [?php $sort = $sf_params->get('sort'); 30 if( $sort ) 31 { 32 $sort_args = "&sort=$sort&type=".$sf_params->get( 'type' ); 33 } 34 ?] 35 1 36 <?php if ($this->getParameterValue('list.batch_actions')): ?> 2 37 [?php echo form_tag('<?php echo $this->getModuleNAme() ?>/batchAction') ?] 3 38 <?php endif; ?> … … 7 42 <?php if ($this->getParameterValue('list.batch_actions')): ?> 8 43 <th id="sf_admin_list_th_sf_batch_actions">[?php echo checkbox_tag('foo', 1, 0, array('onclick' => "boxes = document.getElementsByTagName('input'); for(index in boxes) { box = boxes[index]; if (box.type == 'checkbox' && box.className == 'sf_admin_batch_checkbox') box.checked = this.checked } return true;")) ?]</th> 9 44 <?php endif; ?> 10 [?php include_partial('list_th_<?php echo $this->getParameterValue('list.layout', 'tabular') ?>' ) ?]45 [?php include_partial('list_th_<?php echo $this->getParameterValue('list.layout', 'tabular') ?>', array( 'filter_args' => $filter_args, 'param_args' => $param_args) ) ?] 11 46 <?php if ($this->getParameterValue('list.object_actions')): ?> 12 47 <th id="sf_admin_list_th_sf_actions">[?php echo __('Actions') ?]</th> 13 48 <?php endif; ?> … … 17 52 <tr><th colspan="<?php echo count($this->getColumns('list.display')) + ($this->getParameterValue('list.object_actions') ? 1 : 0) + ($this->getParameterValue('list.batch_actions') ? 1 : 0) ?>"> 18 53 <div class="float-right"> 19 54 [?php if ($pager->haveToPaginate()): ?] 20 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/first.png', array('align' => 'absmiddle', 'alt' => __('First'), 'title' => __('First'))), '<?php echo $this->getModuleName() ?>/list?page=1' ) ?]21 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', array('align' => 'absmiddle', 'alt' => __('Previous'), 'title' => __('Previous'))), '<?php echo $this->getModuleName() ?>/list?page='.$pager->getPreviousPage() ) ?]55 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/first.png', array('align' => 'absmiddle', 'alt' => __('First'), 'title' => __('First'))), '<?php echo $this->getModuleName() ?>/list?page=1'.$filter_args.$param_args.$sort_args) ?] 56 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png', array('align' => 'absmiddle', 'alt' => __('Previous'), 'title' => __('Previous'))), '<?php echo $this->getModuleName() ?>/list?page='.$pager->getPreviousPage().$filter_args.$param_args.$sort_args) ?] 22 57 23 58 [?php foreach ($pager->getLinks() as $page): ?] 24 [?php echo link_to_unless($page == $pager->getPage(), $page, '<?php echo $this->getModuleName() ?>/list?page='.$page ) ?]59 [?php echo link_to_unless($page == $pager->getPage(), $page, '<?php echo $this->getModuleName() ?>/list?page='.$page.$filter_args.$param_args.$sort_args) ?] 25 60 [?php endforeach; ?] 26 61 27 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', array('align' => 'absmiddle', 'alt' => __('Next'), 'title' => __('Next'))), '<?php echo $this->getModuleName() ?>/list?page='.$pager->getNextPage() ) ?]28 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/last.png', array('align' => 'absmiddle', 'alt' => __('Last'), 'title' => __('Last'))), '<?php echo $this->getModuleName() ?>/list?page='.$pager->getLastPage() ) ?]62 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png', array('align' => 'absmiddle', 'alt' => __('Next'), 'title' => __('Next'))), '<?php echo $this->getModuleName() ?>/list?page='.$pager->getNextPage().$filter_args.$param_args.$sort_args) ?] 63 [?php echo link_to(image_tag(sfConfig::get('sf_admin_web_dir').'/images/last.png', array('align' => 'absmiddle', 'alt' => __('Last'), 'title' => __('Last'))), '<?php echo $this->getModuleName() ?>/list?page='.$pager->getLastPage().$filter_args.$param_args.$sort_args) ?] 29 64 [?php endif; ?] 30 65 </div> 31 [?php echo format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults()) ?]66 [?php echo $pager->getFirstIndice()." to ".$pager->getLastIndice()." of ".format_number_choice('[0] no result|[1] 1 result|(1,+Inf] %1% results', array('%1%' => $pager->getNbResults()), $pager->getNbResults()) ?] 32 67 </th></tr> 33 68 </tfoot> 34 69 <tbody> -
lib/plugins/sfPropelPlugin/data/generator/sfPropelAdmin/default/template/templates/_list_th_tabular.php
old new 8 8 <th id="sf_admin_list_th_<?php echo $column->getName() ?>"> 9 9 <?php if ($column->isReal()): ?> 10 10 [?php if ($sf_user->getAttribute('sort', null, 'sf_admin/<?php echo $this->getSingularName() ?>/sort') == '<?php echo $column->getName() ?>'): ?] 11 [?php echo link_to(__('<?php echo str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), '<?php echo $this->getModuleName() ?>/list?sort=<?php echo $column->getName() ?>&type='.($sf_user->getAttribute('type', 'asc', 'sf_admin/<?php echo $this->getSingularName() ?>/sort') == 'asc' ? 'desc' : 'asc') ) ?]11 [?php echo link_to(__('<?php echo str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), '<?php echo $this->getModuleName() ?>/list?sort=<?php echo $column->getName() ?>&type='.($sf_user->getAttribute('type', 'asc', 'sf_admin/<?php echo $this->getSingularName() ?>/sort') == 'asc' ? 'desc' : 'asc').$filter_args.$param_args) ?] 12 12 ([?php echo __($sf_user->getAttribute('type', 'asc', 'sf_admin/<?php echo $this->getSingularName() ?>/sort')) ?]) 13 13 [?php else: ?] 14 [?php echo link_to(__('<?php echo str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), '<?php echo $this->getModuleName() ?>/list?sort=<?php echo $column->getName() ?>&type=asc' ) ?]14 [?php echo link_to(__('<?php echo str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), '<?php echo $this->getModuleName() ?>/list?sort=<?php echo $column->getName() ?>&type=asc'.$filter_args.$param_args) ?] 15 15 [?php endif; ?] 16 16 <?php else: ?> 17 17 [?php echo __('<?php echo str_replace("'", "\\'", $this->getParameterValue('list.fields.'.$column->getName().'.name')) ?>') ?] -
lib/plugins/sfPropelPlugin/data/generator/sfPropelAdmin/default/template/templates/listSuccess.php
old new 2 2 3 3 [?php use_stylesheet('<?php echo $this->getParameterValue('css', sfConfig::get('sf_admin_web_dir').'/css/main') ?>') ?] 4 4 5 [?php 6 $params = $sf_request->getParameterHolder()->getAll(); 7 $param_args = ''; 8 $sorted = $sf_params->get( 'sort' );//Used to make sure 'type' parameter is passed to links unless it is for sorting purposes 9 foreach( $params as $key => $value ) 10 { 11 if( $value && !is_array( $value ) && strcmp( $key, 'filter') != 0 && strcmp( $key, 'page' ) != 0 12 && strcmp( $key, 'module') != 0 && strcmp( $key, 'action' ) != 0 13 && ( !$sorted || ( strcmp( $key, 'sort' ) != 0 && strcmp( $key, 'type' ) ) ) ) 14 { 15 $param_args .= "&$key=$value"; 16 $param_tags .= input_hidden_tag( "$key", "$value" ); 17 } 18 } 19 //echo "<br/>Param Args = $param_args<br/>"; 20 ?] 5 21 <div id="sf_admin_container"> 6 22 7 23 <h1><?php echo $this->getI18NString('list.title', $this->getModuleName().' list') ?></h1> … … 13 29 14 30 <div id="sf_admin_bar"> 15 31 <?php if ($this->getParameterValue('list.filters')): ?> 16 [?php include_partial('filters', array('filters' => $filters )) ?]32 [?php include_partial('filters', array('filters' => $filters, 'param_args' => $param_args, 'param_tags' => $param_tags)) ?] 17 33 <?php endif; ?> 18 34 </div> 19 35 … … 21 37 [?php if (!$pager->getNbResults()): ?] 22 38 [?php echo __('no result') ?] 23 39 [?php else: ?] 24 [?php include_partial('<?php echo $this->getModuleName() ?>/list', array('pager' => $pager )) ?]40 [?php include_partial('<?php echo $this->getModuleName() ?>/list', array('pager' => $pager, 'param_args' => $param_args)) ?] 25 41 [?php endif; ?] 26 42 [?php include_partial('list_batch_actions') ?] 27 43 [?php include_partial('list_actions') ?]