openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6cd069b74f54a39afa5e6da3212da640f1148006
parent bd721926709b6b9252772dcc2fe7c111c0adcfe3
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 26 Oct 2012 22:50:22 +0200

Den höchsten Ordner nach dem Auswählen eines Projektes auswählen.

Diffstat:
action/WorkbenchAction.class.php | 35++++++++++++++++++++++-------------
themes/default/layout/perspective/header.php | 21++++++++++++---------
2 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/action/WorkbenchAction.class.php b/action/WorkbenchAction.class.php @@ -30,7 +30,7 @@ class WorkbenchAction extends Action public function showView() { global $conf; - global $preselectobject; + global $preselectedobjects; if ( empty($this->perspective) ) { $guestConf = $conf['security']['guest']; @@ -43,20 +43,29 @@ class WorkbenchAction extends Action Session::set('perspective',$this->perspective); } + + $preselectedobjects = array();; // Zuletzt geändertes Objekt laden. - if ( $this->perspective == 'normal' && - $conf['login']['start']['start_lastchanged_object'] ) { - $user = Session::getUser(); + if ( $this->perspective == 'normal' ) + { $project = Session::getProject(); - - $objectid = Value::getLastChangedObjectInProjectByUserId($project->projectid, $user->userid); - if ( Object::available($objectid)) - { - $object = new Object($objectid); - $object->load(); - - Logger::debug('preselecting object '.$objectid); - $preselectobject = $object; + $rootFolder = new Folder( $project->getRootObjectId() ); + $rootFolder->load(); + $preselectedobjects[] = $rootFolder; + + if ( $conf['login']['start']['start_lastchanged_object'] ) + { + $user = Session::getUser(); + + $objectid = Value::getLastChangedObjectInProjectByUserId($project->projectid, $user->userid); + if ( Object::available($objectid)) + { + $object = new Object($objectid); + $object->load(); + + Logger::debug('preselecting object '.$objectid); + $preselectedobjects[] = $object; + } } } diff --git a/themes/default/layout/perspective/header.php b/themes/default/layout/perspective/header.php @@ -59,20 +59,23 @@ function view_header( $name ) ?> </ul> +<script name="javascript" type="text/javascript"> +<!-- <?php - -global $preselectobject; -if ( $name=='content' && is_object($preselectobject) ) +if ( $name=='content' ) { + global $preselectedobjects; + + foreach( $preselectedobjects as $object ) + { +?> +setTimeout( function() { openNewAction( '<?php echo $object->name; ?>','<?php echo $object->getType() ?>','<?php echo $object->objectid ?>',0 );} ,500); +<?php + } +} ?> - -<script name="javascript" type="text/javascript"> -<!-- -openNewAction( '<?php echo $preselectobject->name; ?>','<?php echo $preselectobject->getType() ?>','<?php echo $preselectobject->objectid ?>',0 ) //--> </script> - -<?php } ?> <div class="icons"> <div class="icon">