openrat-cms

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

commit 68fef14878dbd03c06c0bd15cbb72751d8a445ce
parent 41891327d35c20f0b5267895596dcea9f46aaa26
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 18 Sep 2018 23:00:14 +0200

Einträge aus dem Benutzerverlauf sind nun anklickbar.

Diffstat:
modules/cms-core/action/UserAction.class.php | 14++++++++++++--
modules/cms-ui/themes/default/html/views/user/history.php | 11+++++++----
modules/cms-ui/themes/default/html/views/user/history.tpl.src.xml | 8+++++---
3 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/modules/cms-core/action/UserAction.class.php b/modules/cms-core/action/UserAction.class.php @@ -498,8 +498,18 @@ class UserAction extends Action */ public function historyView() { - $result = $this->user->getLastChanges(); - $this->setTemplateVar('timeline', $result); + $lastChanges = $this->user->getLastChanges(); + + $timeline = array(); + + foreach( $lastChanges as $entry ) + { + $timeline[ $entry['objectid'] ] = $entry; + $baseObject = new BaseObject( $entry['objectid']); + $baseObject->objectLoad(); + $timeline[ $entry['objectid'] ]['type'] = $baseObject->getType(); + } + $this->setTemplateVar('timeline', $timeline); } diff --git a/modules/cms-ui/themes/default/html/views/user/history.php b/modules/cms-ui/themes/default/html/views/user/history.php @@ -18,15 +18,18 @@ <?php foreach($timeline as $list_key=>$list_value){ ?><?php extract($list_value) ?> <tr class="data"> <td class="clickable"> - <a target="_self" data-type="post" data-action="start" data-method="projectmenu" data-id="<?php echo $projectid ?>" data-extra="[]" data-data="{&quot;action&quot;:&quot;start&quot;,&quot;subaction&quot;:&quot;projectmenu&quot;,&quot;id&quot;:&quot;<?php echo $projectid ?>&quot;,&quot;token&quot;:&quot;<?php echo token() ?>&quot;,&quot;none&quot;:&quot;0&quot;}"> + <a target="_self" data-type="open" data-action="project" data-method="history" data-id="<?php echo $projectid ?>" data-extra="[]" href="<?php echo Html::url('project','',$projectid,array()) ?>"> <span class="text"><?php echo nl2br(encodeHtml(htmlentities($projectname))); ?></span> </a> </td> - <td title="<?php echo $filename ?>"> - <span class="text"><?php echo nl2br(encodeHtml(htmlentities(Text::maxLength( $filename,30,'..',constant('STR_PAD_BOTH') )))); ?></span> - + <td title="<?php echo $filename ?>" class="clickable"> + <a target="_self" data-type="open" data-action="<?php echo $type ?>" data-method="history" data-id="<?php echo $objectid ?>" data-extra="[]" href="<?php echo Html::url($type,'',$objectid,array()) ?>"> + <span class="text"><?php echo nl2br(encodeHtml(htmlentities(Text::maxLength( $filename,30,'..',constant('STR_PAD_BOTH') )))); ?></span> + + </a> + </td> <td> <?php include_once( 'modules/template-engine/components/html/date/component-date.php') ?><?php component_date($lastchange_date) ?> diff --git a/modules/cms-ui/themes/default/html/views/user/history.tpl.src.xml b/modules/cms-ui/themes/default/html/views/user/history.tpl.src.xml @@ -16,12 +16,14 @@ <list list="timeline" extract="true"> <row class="data"> <column class="clickable"> - <link type="post" action="start" subaction="projectmenu" id="var:projectid"> + <link type="open" action="project" id="var:projectid"> <text var="projectname"></text> </link> </column> - <column title="var:filename"> - <text var="filename" maxlength="30"></text> + <column title="var:filename" class="clickable"> + <link type="open" action="var:type" id="var:objectid"> + <text var="filename" maxlength="30"></text> + </link> </column> <column> <date date="var:lastchange_date" />