This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 7528b06306b8bc504d7eb91e4f36ce6eee2462af (commit)
from 4acfbe44218e63a4735cfc6479a23ebe035b9e1e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7528b06306b8bc504d7eb91e4f36ce6eee2462af
commit 7528b06306b8bc504d7eb91e4f36ce6eee2462af
Author: Franck Villaume <[email protected]>
Date: Sat May 4 17:08:39 2019 +0200
prepare diary page for archives support
diff --git a/src/common/diary/DiaryNoteFactory.class.php
b/src/common/diary/DiaryNoteFactory.class.php
index 953d138..af9922a 100644
--- a/src/common/diary/DiaryNoteFactory.class.php
+++ b/src/common/diary/DiaryNoteFactory.class.php
@@ -50,9 +50,13 @@ class DiaryNoteFactory extends FFObject {
$this->User =& $User;
}
- function getDiaryNoteIDs($public) {
+ function getDiaryNoteIDs($public, $limit = 0) {
if (is_array($this->diarynoteids)) {
- return $this->diarynoteids;
+ if ($limit) {
+ return array_slice($this->diarynoteids, 0,
$limit);
+ } else {
+ return $this->diarynoteids;
+ }
}
$qpa = false;
$qpa = db_construct_qpa($qpa, 'SELECT id FROM user_diary WHERE
user_id = $1', array($this->User->getID()));
@@ -62,7 +66,11 @@ class DiaryNoteFactory extends FFObject {
$qpa = db_construct_qpa($qpa, ' ORDER BY date_posted DESC',
array());
$res = db_query_qpa($qpa);
$this->diarynoteids = util_result_column_to_array($res);
- return $this->diarynoteids;
+ if ($limit) {
+ return array_slice($this->diarynoteids, 0, $limit);
+ } else {
+ return $this->diarynoteids;
+ }
}
function hasNotes($public = 0) {
@@ -80,4 +88,9 @@ class DiaryNoteFactory extends FFObject {
function getUser() {
return $this->User;
}
+
+ function getArchivesTree($public) {
+ global $HTML;
+ return $HTML->information(_('No archive available'));
+ }
}
diff --git a/src/www/developer/diary.php b/src/www/developer/diary.php
index 6d19d54..bb297d6 100644
--- a/src/www/developer/diary.php
+++ b/src/www/developer/diary.php
@@ -5,6 +5,7 @@
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2010 (c) Franck Villaume
* Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2019, Franck Villaume - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
@@ -47,6 +48,8 @@ if ($diary_user) {
$title = _('Diary and Notes for') . ' ' .
$diaryNoteFactoryObject->getUser()->getRealName();
$HTML->header(array('title' => $title));
+ echo '<div id="diary">
+ <div id="diary_left">';
if ($diary_id) {
if
($diaryNoteFactoryObject->getDiaryNote($diary_id)->isPublic()) {
echo
$HTML->boxTop($diaryNoteFactoryObject->getDiaryNote($diary_id)->getSummary());
@@ -58,29 +61,34 @@ if ($diary_user) {
}
}
- echo html_e('h2', array(), _('Existing Diary and Notes Entries'));
- echo $HTML->listTableTop();
/*
List all diary entries
*/
if ($diaryNoteFactoryObject->hasNotes(1)) {
+ echo html_e('h2', array(), _('Existing Last 10 Diary and Notes
Entries'));
+ echo $HTML->listTableTop();
$cells = array();
$cells[][] = _('Subject');
$cells[][] = _('Date');
echo $HTML->multiTableRow(array(), $cells, true);
- foreach ($diaryNoteFactoryObject->getDiaryNoteIDs(1) as
$diarynoteid) {
+ foreach ($diaryNoteFactoryObject->getDiaryNoteIDs(1, 10) as
$diarynoteid) {
$cells = array();
$cells[][] =
util_make_link('/developer/diary.php?diary_id='.$diarynoteid.'&diary_user='.
$diary_user, $diaryNoteFactoryObject->getDiaryNote($diarynoteid)->getSummary());
$cells[][] =
$diaryNoteFactoryObject->getDiaryNote($diary_id)->getDatePostedOn();
echo $HTML->multiTableRow(array(), $cells);
}
+ echo $HTML->listTableBottom();
} else {
- echo '<tr><td><strong>'._('This User Has No Diary
Entries').'</strong></td></tr>';
+ echo $HTML->information(_('This User Has No Diary Entries'));
}
- echo $HTML->listTableBottom();
-
+ echo '</div>
+ <div id="diary_right">';
+ echo $HTML->boxTop(_('Archives'));
+ echo $diaryNoteFactoryObject->getArchivesTree(1);
+ echo $HTML->boxBottom();
+ echo '</div></div>';
$HTML->footer();
} else {
- exit_error(_('No User Selected'),'home');
+ exit_error(_('No User Selected'), 'home');
}
diff --git a/src/www/themes/funky/css/theme-pages.css
b/src/www/themes/funky/css/theme-pages.css
index 2e5f631..b055ea4 100644
--- a/src/www/themes/funky/css/theme-pages.css
+++ b/src/www/themes/funky/css/theme-pages.css
@@ -212,6 +212,26 @@
}
/*
+ * PAGE: Diary (eg:
http://fusionforge/developer/diary.php?diary_id=<id>&diary_user=<userid>)
+ *
==========================================================================================
+ */
+#diary {
+ display: table;
+ width: 100%;
+}
+
+#diary_left {
+ float: left;
+ width: 75%;
+}
+
+#diary_right {
+ overflow : hidden;
+ padding-left: 10px;
+}
+
+
+/*
* PAGE: docman (eg: http://fusionforge/docman/?group_id=<id>)
* ========================================================
*/
-----------------------------------------------------------------------
Summary of changes:
src/common/diary/DiaryNoteFactory.class.php | 19 ++++++++++++++++---
src/www/developer/diary.php | 22 +++++++++++++++-------
src/www/themes/funky/css/theme-pages.css | 20 ++++++++++++++++++++
3 files changed, 51 insertions(+), 10 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits