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 dcccfa03d64dd69d768bfb4dce0fd672b0b9438c (commit)
via cd626020dd31e181b011b1165169a8a43dd1b313 (commit)
from c959a34e11780f89889e16a75cfd6e67e4df43a2 (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=dcccfa03d64dd69d768bfb4dce0fd672b0b9438c
commit dcccfa03d64dd69d768bfb4dce0fd672b0b9438c
Author: Franck Villaume <[email protected]>
Date: Sun Dec 9 18:06:53 2018 +0100
make initial usage of MyFollowers widget
diff --git a/src/common/widget/Widget_MyFollowers.class.php
b/src/common/widget/Widget_MyFollowers.class.php
index 93dae6f..482a314 100644
--- a/src/common/widget/Widget_MyFollowers.class.php
+++ b/src/common/widget/Widget_MyFollowers.class.php
@@ -38,20 +38,138 @@ require_once $gfcommon.'include/MonitorElement.class.php';
function getContent() {
global $HTML;
- $nousers = true;
$monitorUser = new MonitorElement('user');
$monitoredUserIds =
$monitorUser->getMonitedByUserIdInArray(user_getid());
$followerIds =
$monitorUser->getMonitorUsersIdsInArray(user_getid());
- if (is_array($monitoredUserIds) && count($monitoredUserIds) >
0) {
- echo 'found something'."\n";
- $nousers = false;
- }
- if (is_array($followerIds) && count($followerIds) > 0) {
- echo 'found another thing'."\n";
- $nousers = false;
- }
- if ($nousers) {
+ if (!(is_array($monitoredUserIds) && count($monitoredUserIds) >
0) && !(is_array($followerIds) && count($followerIds) > 0)) {
echo $HTML->warning_msg(_('You are not following any
user and not followed by any.'));
+ } else {
+ echo $HTML->listTableTop();
+ $cells[][] = _('Following');
+ $cells[][] = _('Followers');
+ echo $HTML->multiTableRow(array(), $cells);
+ $cells = array();
+ $cells[][] = count($followerIds);
+ $cells[][] = count($monitoredUserIds);
+ echo $HTML->multiTableRow(array(), $cells);
+ echo $HTML->listTableBottom();
+ $groupsArr = array();
+ $date_format = _('%Y-%m-%d');
+ $ids = array();
+ $texts = array();
+
+ if (forge_get_config('use_forum')) {
+ $ids[] = 'forumpost';
+ $texts[] = _('Forum Post');
+ }
+
+ if (forge_get_config('use_tracker')) {
+ $ids[] = 'trackeropen';
+ $texts[] = _('Tracker Opened');
+ $ids[] = 'trackerclose';
+ $texts[] = _('Tracker Closed');
+ }
+
+ if (forge_get_config('use_news')) {
+ $ids[] = 'news';
+ $texts[] = _('News');
+ }
+
+ if (forge_get_config('use_pm')) {
+ $ids[] = 'taskopen';
+ $texts[] = _('Tasks Opened');
+ $ids[] = 'taskclose';
+ $texts[] = _('Tasks Closed');
+ $ids[] = 'taskdelete';
+ $texts[] = _('Tasks Deleted');
+ }
+
+ if (forge_get_config('use_frs')) {
+ $ids[] = 'frsrelease';
+ $texts[] = _('FRS Release');
+ }
+
+ if (forge_get_config('use_docman')) {
+ $ids[] = 'docmannew';
+ $texts[] = _('New Documents');
+ $ids[] = 'docmanupdate';
+ $texts[] = _('Updated Documents');
+ $ids[] = 'docgroupnew';
+ $texts[] = _('New Directories');
+ }
+
+ if (forge_get_config('use_diary')) {
+ $ids[] = 'diaryentry';
+ $texts[] = _('New Diary Entries');
+ }
+ if (count($followerIds) > 0) {
+ $section = $ids;
+ $ffactivity = new Activity();
+ if (!isset($begin)) {
+ $begin = (time() - (30 * 86400));
+ }
+ if (!isset($end)) {
+ $end = time();
+ }
+ $results =
$ffactivity->getActivitiesForUsers($followerIds, $begin, $end, $section);
+ if ($results === false) {
+ echo $HTML->error_msg(_('Unable to get
activities')._(':').$ffactivity->getErrorMessage());
+ }
+ if (count($results) < 1) {
+ echo $HTML->information(_('No Activity
Found'));
+ } else {
+ $cached_perms = array();
+
+ usort($results,
'Activity::date_compare');
+
+ $displayTableTop = 0;
+ $j = 0;
+ $last_day = 0;
+ foreach ($results as $arr) {
+ if
(!$ffactivity->check_perm_for_activity($arr, $cached_perms)) {
+ continue;
+ }
+
+ $displayinfo =
$ffactivity->getDisplayInfo($arr);
+ if (!$displayinfo) {
+ continue;
+ }
+
+ if (!$displayTableTop) {
+ $theader = array();
+ $theader[] = _('Time');
+ $theader[] =
_('Project');
+ $theader[] =
_('Activity');
+
+ echo
$HTML->listTableTop($theader);
+ $displayTableTop = 1;
+ }
+
+ if ($last_day !=
strftime($date_format, $arr['activity_date'])) {
+ echo '<tr
class="tableheading"><td colspan="3">'.strftime($date_format,
$arr['activity_date']).'</td></tr>';
+
$last_day=strftime($date_format, $arr['activity_date']);
+ }
+ $cells = array();
+ $cells[][] =
date('H:i:s',$arr['activity_date']);
+ if (isset($arr['group_id']) &&
$arr['group_id']) {
+ if
(!isset($groupsArr[$arr['group_id']])) {
+
$groupsArr[$arr['group_id']] = group_get_object($arr['group_id']);
+ }
+ $cells[][] =
util_make_link_g($groupsArr[$arr['group_id']]->getUnixName(),
$groupsArr[$arr['group_id']]->getID(),
$groupsArr[$arr['group_id']]->getPublicName());
+ } else {
+ $cells[][] = '--';
+ }
+ $cells[][] = $displayinfo;
+ echo
$HTML->multiTableRow(array(), $cells);
+ }
+ if ($displayTableTop) {
+ echo $HTML->listTableBottom();
+ }
+ if (!$displayTableTop) {
+ echo $HTML->information(_('No
Activity Found'));
+ }
+ }
+ }
}
}
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=cd626020dd31e181b011b1165169a8a43dd1b313
commit cd626020dd31e181b011b1165169a8a43dd1b313
Author: Franck Villaume <[email protected]>
Date: Sun Dec 9 18:06:27 2018 +0100
add followers info to user profile
diff --git a/src/common/include/user_profile.php
b/src/common/include/user_profile.php
index 003d51b..2d4eb22 100644
--- a/src/common/include/user_profile.php
+++ b/src/common/include/user_profile.php
@@ -137,6 +137,10 @@ function user_personal_information($user, $compact =
false, $title = false) {
$subcells[][] =
'<small>'.util_make_link_u($user->getUnixName(), $user->getID(),
util_make_url_u($user->getUnixName(), $user->getID())).'</small>';
$subtable .= $HTML->multiTableRow(array(), $subcells);
}
+ $subcells = array();
+ $subcells[][] = _('Followers/Following')._(':');
+ $subcells[][] =
count($user->getMonitorIds()).'/'.count($user->isMonitoredBy());
+ $subtable .= $HTML->multiTableRow(array(), $subcells);
$subtable .= $HTML->listTableBottom();
$cells[][] = $subtable;
$html .= $HTML->multiTableRow(array(), $cells);
-----------------------------------------------------------------------
Summary of changes:
src/common/include/user_profile.php | 4 +
src/common/widget/Widget_MyFollowers.class.php | 138 +++++++++++++++++++++++--
2 files changed, 132 insertions(+), 10 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits