openrat-cms

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

commit d681e2b0b50079389093ddc8dc347ea742bf57a2
parent 24f37b3bc8e88825cfd866fd94c1519df9a743da
Author: Jan Dankert <devnull@localhost>
Date:   Wed,  7 Dec 2016 22:20:12 +0100

Verlauf-Funktion nicht mehr neben der Navigation, sondern bei den entsprechenden Objekten (Projekt, Benutzer, Seite) anzeigen.

Diffstat:
action/PageelementAction.class.php | 4++--
action/ProjectAction.class.php | 12++++++++++++
action/ProjectlistAction.class.php | 10++++++++++
action/StartAction.class.php | 32++------------------------------
action/UserAction.class.php | 11+++++++++++
language/de.ini.php | 2+-
language/en.ini.php | 1+
model/Project.class.php | 29-----------------------------
model/User.class.php | 31+++++++++++++++++++++++++++++++
themes/default/layout/perspective/administration.ini.php | 2+-
themes/default/layout/perspective/normal.ini.php | 4++--
11 files changed, 73 insertions(+), 65 deletions(-)

diff --git a/action/PageelementAction.class.php b/action/PageelementAction.class.php @@ -793,7 +793,7 @@ class PageelementAction extends Action /** * Erzeugt eine Liste aller Versionsst?nde zu diesem Inhalt */ - public function archiveView() + public function historyView() { $this->page->public = true; $this->page->simple = true; @@ -858,7 +858,7 @@ class PageelementAction extends Action $this->setTemplateVar('withid' ,$list[$lfd_nr ]['id']); } - $this->setTemplateVar('name' ,$value->element->name); + $this->setTemplateVar('name' ,$this->element->name); $this->setTemplateVar('el' ,$list ); } diff --git a/action/ProjectAction.class.php b/action/ProjectAction.class.php @@ -330,4 +330,16 @@ class ProjectAction extends Action } } + + /** + * Ermittelt die letzten Änderungen, die im aktuellen Projekt gemacht worden sind. + */ + public function historyView() + { + $result = $this->project->getLastChanges(); + + $this->setTemplateVar('timeline', $result); + } + + } \ No newline at end of file diff --git a/action/ProjectlistAction.class.php b/action/ProjectlistAction.class.php @@ -109,4 +109,14 @@ class ProjectlistAction extends Action } } + + /** + * Ermittelt die letzten Änderungen, die in allen Projekten gemacht worden sind. + */ + function historyView() + { + $result = Project::getAllLastChanges(); + $this->setTemplateVar('timeline', $result); + } + } \ No newline at end of file diff --git a/action/StartAction.class.php b/action/StartAction.class.php @@ -1660,15 +1660,7 @@ class StartAction extends Action - /** - * Ermittelt die letzten Änderungen, die durch den aktuellen Benutzer in allen Projekten gemacht worden sind. - */ - public function usertimelineView() - { - $result = Project::getMyAllLastChanges(); - $this->setTemplateVar('timeline', $result); - } - + /** @@ -1685,28 +1677,8 @@ class StartAction extends Action - /** - * Ermittelt die letzten Änderungen, die in allen Projekten gemacht worden sind. - */ - public function timelineView() - { - $result = Project::getAllLastChanges(); - $this->setTemplateVar('timeline', $result); - } - - + - /** - * Ermittelt die letzten Änderungen, die im aktuellen Projekt gemacht worden sind. - */ - public function projecttimelineView() - { - $project = Session::getProject(); - - $result = $project->getLastChanges(); - - $this->setTemplateVar('timeline', $result); - } } diff --git a/action/UserAction.class.php b/action/UserAction.class.php @@ -430,6 +430,17 @@ class UserAction extends Action Session::setUser( $user ); $this->refresh(); + } + + + /** + * Ermittelt die letzten Änderungen, die durch den aktuellen Benutzer in allen Projekten gemacht worden sind. + */ + public function historyView() + { + $result = $this->user->getLastChanges(); + $this->setTemplateVar('timeline', $result); } + } \ No newline at end of file diff --git a/language/de.ini.php b/language/de.ini.php @@ -584,7 +584,7 @@ MENU_ADD = Neu MENU_APPLICATIONS="Anwendungen" MENU_APPLICATIONS_DESC="Weitere Anwendungen starten" MENU_ARCHIVE="Archiv" -MENU_ARCHIVE="Archiv" +MENU_HISTORY="Verlauf" MENU_CHANGETEMPLATE="Vorlage wechseln" MENU_CLIPBOARD="Zwischenablage" MENU_COMPRESS_DESC =Die Datei komprimieren diff --git a/language/en.ini.php b/language/en.ini.php @@ -604,6 +604,7 @@ MENU_ADD = New MENU_APPLICATIONS="Applications" MENU_APPLICATIONS_DESC="Start more applications" MENU_ARCHIVE="Archive" +MENU_HISTORY="History" MENU_ARCHIVE_DESC="Archive" MENU_CHANGETEMPLATE="Change template" MENU_CLIPBOARD="Clipboard" diff --git a/model/Project.class.php b/model/Project.class.php @@ -777,35 +777,6 @@ SQL } - /** - * Ermittelt projektübergreifend die letzten Änderungen des angemeldeten Benutzers. - * - * @return Ambigous <string, unknown> - */ - public static function getMyAllLastChanges() - { - $db = db_connection(); - - $sql = new Sql( <<<SQL - SELECT {t_object}.id as objectid, - {t_object}.filename as filename, - {t_object}.lastchange_date as lastchange_date, - {t_project}.id as projectid, - {t_project}.name as projectname - FROM {t_object} - LEFT JOIN {t_project} - ON {t_object}.projectid = {t_project}.id - WHERE {t_object}.lastchange_userid = {userid} - ORDER BY {t_object}.lastchange_date DESC -SQL - ); - - $user = Session::getUser(); - $sql->setInt( 'userid', $user->userid ); - - return $db->getAll( $sql ); - - } /** diff --git a/model/User.class.php b/model/User.class.php @@ -895,6 +895,37 @@ SQL global $conf; return $conf['security']['password']['pepper'].$pass; } + + + /** + * Ermittelt projektübergreifend die letzten Änderungen des Benutzers. + * + * @return Ambigous <string, unknown> + */ + public function getLastChanges() + { + $db = db_connection(); + + $sql = new Sql( <<<SQL + SELECT {t_object}.id as objectid, + {t_object}.filename as filename, + {t_object}.lastchange_date as lastchange_date, + {t_project}.id as projectid, + {t_project}.name as projectname + FROM {t_object} + LEFT JOIN {t_project} + ON {t_object}.projectid = {t_project}.id + WHERE {t_object}.lastchange_userid = {userid} + ORDER BY {t_object}.lastchange_date DESC +SQL + ); + + $sql->setInt( 'userid', $this->userid ); + + return $db->getAll( $sql ); + + } + } ?> \ No newline at end of file diff --git a/themes/default/layout/perspective/administration.ini.php b/themes/default/layout/perspective/administration.ini.php @@ -19,5 +19,5 @@ default=memberships [bottom] -views=info,pw,rights +views=info,pw,rights,history default=info diff --git a/themes/default/layout/perspective/normal.ini.php b/themes/default/layout/perspective/normal.ini.php @@ -5,7 +5,7 @@ icons=templatelist,languagelist [tree] title=navigator -views=tree:tree,tree:settings,start:projectmenu,start:projecttimeline,start:userprojecttimeline +views=tree:tree,tree:settings,start:projectmenu,start:userprojecttimeline default=tree @@ -25,5 +25,5 @@ views=prop,pub title= default=structure -views=structure,info,preview,progress,console,search,archive,rights +views=structure,info,preview,progress,console,search,history,rights