openrat-cms

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

commit 8c30d9701b0e8e68bad2f921c15da83711e07c73
parent 2d2ddf0cbf38e93608b60e96e3145fec66e6d514
Author: dankert <devnull@localhost>
Date:   Thu, 12 Nov 2009 22:53:15 +0100

Neue Funktion zum Anzeigen von Projektinformationen.

Diffstat:
actionClasses/ProjectAction.class.php | 7+++++++
actionClasses/ProjectAction.ini.php | 5++++-
objectClasses/Project.class.php | 29+++++++++++++++++++++++++++++
themes/default/templates/project/info.tpl.src.php | 8++++++++
4 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/actionClasses/ProjectAction.class.php b/actionClasses/ProjectAction.class.php @@ -273,7 +273,14 @@ class ProjectAction extends Action phpinfo(); } + + + + function info() + { + $this->setTemplateVar( 'info', $this->project->info() ); + } diff --git a/actionClasses/ProjectAction.ini.php b/actionClasses/ProjectAction.ini.php @@ -32,6 +32,9 @@ write=true menu=list write=true +[info] +menu=edit + [menu] list=listing,add -edit=edit,remove,export,maintenance +edit=edit,remove,info,export,maintenance diff --git a/objectClasses/Project.class.php b/objectClasses/Project.class.php @@ -680,6 +680,35 @@ EOF $db_dest->commit(); } + + + + // Liefert alle verf?gbaren Projekt-Ids + function info() + { + $info = array(); + + $db = db_connection(); + $sql = new Sql( 'SELECT COUNT(*) FROM {t_object} '. + ' WHERE projectid = {projectid}' ); + $sql->setInt( 'projectid', $this->projectid ); + + $info['count_objects'] = $db->getOne( $sql ); + + $sql = new Sql( <<<SQL + SELECT SUM(size) FROM {t_file} + LEFT JOIN {t_object} + ON {t_file}.objectid = {t_object}.id + WHERE projectid = {projectid} +SQL +); + $sql->setInt( 'projectid', $this->projectid ); + + $info['sum_filesize'] = number_format($db->getOne( $sql )/1000).' kB'; + + + return $info; + } } ?> \ No newline at end of file diff --git a/themes/default/templates/project/info.tpl.src.php b/themes/default/templates/project/info.tpl.src.php @@ -0,0 +1,8 @@ +page + window icon:project name:GLOBAL_PROJECT widths:20%,80% + list list:info + row + cell + text key:var:list_key prefix:project_info_ + cell + text type:strong var:list_value