Index: trunk/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r7391 -r7635 --- trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 7391) +++ trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 7635) @@ -104,6 +104,10 @@ 'OnMassDelete' => Array('self' => 'delete', 'subitem' => 'add|edit'), 'OnMassClone' => Array('self' => 'add', 'subitem' => 'add|edit'), + 'OnCut' => array('self'=>'edit', 'subitem' => 'edit'), + 'OnCopy' => array('self'=>'edit', 'subitem' => 'edit'), + 'OnPaste' => array('self'=>'edit', 'subitem' => 'edit'), + 'OnSelectItems' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), 'OnProcessSelected' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), 'OnSelectUser' => Array('self' => 'add|edit', 'subitem' => 'add|edit'), @@ -131,6 +135,7 @@ 'OnSetFilter' => Array('self' => true, 'subitem' => true), 'OnApplyFilters' => Array('self' => true, 'subitem' => true), 'OnRemoveFilters' => Array('self' => true, 'subitem' => true), + 'OnSetFilterPattern' => Array('self' => true, 'subitem' => true), 'OnSetPerPage' => Array('self' => true, 'subitem' => true), @@ -465,6 +470,7 @@ function OnListBuild(&$event) { $object =& $event->getObject(); + /* @var $object kDBList */ $this->dbBuild($object,$event); @@ -790,24 +796,33 @@ { $cur_sort1 = $this->Application->RecallVar($event->Prefix_Special.'_Sort1'); $cur_sort1_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort1_Dir'); - $cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2'); - $cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir'); + $use_double_sorting = $this->Application->ConfigValue('UseDoubleSorting') !== false ? $this->Application->ConfigValue('UseDoubleSorting') : true; + + if ($use_double_sorting) { + $cur_sort2 = $this->Application->RecallVar($event->Prefix_Special.'_Sort2'); + $cur_sort2_dir = $this->Application->RecallVar($event->Prefix_Special.'_Sort2_Dir'); + } + $passed_sort1 = $this->Application->GetVar($event->getPrefixSpecial(true).'_Sort1'); if ($cur_sort1 == $passed_sort1) { $cur_sort1_dir = $cur_sort1_dir == 'asc' ? 'desc' : 'asc'; } else { - $cur_sort2 = $cur_sort1; - $cur_sort2_dir = $cur_sort1_dir; + if ($use_double_sorting) { + $cur_sort2 = $cur_sort1; + $cur_sort2_dir = $cur_sort1_dir; + } $cur_sort1 = $passed_sort1; $cur_sort1_dir = 'asc'; } $this->Application->StoreVar($event->Prefix_Special.'_Sort1', $cur_sort1); $this->Application->StoreVar($event->Prefix_Special.'_Sort1_Dir', $cur_sort1_dir); - $this->Application->StoreVar($event->Prefix_Special.'_Sort2', $cur_sort2); - $this->Application->StoreVar($event->Prefix_Special.'_Sort2_Dir', $cur_sort2_dir); + if ($use_double_sorting) { + $this->Application->StoreVar($event->Prefix_Special.'_Sort2', $cur_sort2); + $this->Application->StoreVar($event->Prefix_Special.'_Sort2_Dir', $cur_sort2_dir); + } } /**