openrat-cms

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

commit 41891327d35c20f0b5267895596dcea9f46aaa26
parent adc2f8cd59c1e93941e787904e0ff9aaa72a40ae
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 18 Sep 2018 22:55:29 +0200

Eintr├Ąge aus dem Benutzerverlauf sind nun anklickbar.

Diffstat:
modules/cms-core/action/ProfileAction.class.php | 15+++++++++++++--
modules/cms-core/model/User.class.php | 1+
modules/cms-ui/themes/default/html/views/profile/history.php | 11+++++++----
modules/cms-ui/themes/default/html/views/profile/history.tpl.src.xml | 8+++++---
4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/modules/cms-core/action/ProfileAction.class.php b/modules/cms-core/action/ProfileAction.class.php @@ -19,6 +19,7 @@ namespace cms\action; // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +use cms\model\BaseObject; use language\Language; use LogicException; use Mail; @@ -312,8 +313,18 @@ class ProfileAction 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-core/model/User.class.php b/modules/cms-core/model/User.class.php @@ -957,6 +957,7 @@ SQL $sql = $db->sql( <<<SQL SELECT {{object}}.id as objectid, {{object}}.filename as filename, + {{object}}.typeid as typeid, {{object}}.lastchange_date as lastchange_date, {{project}}.id as projectid, {{project}}.name as projectname diff --git a/modules/cms-ui/themes/default/html/views/profile/history.php b/modules/cms-ui/themes/default/html/views/profile/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/profile/history.tpl.src.xml b/modules/cms-ui/themes/default/html/views/profile/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" />