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  ad10224a804e63ce498c7b894574a6e17b9ff7cc (commit)
       via  432969469f159dc1226ec85f4ea468fe0d523f27 (commit)
       via  fb071d50dfd74293858ec6e2741bade5c7760208 (commit)
      from  f16f610958bff568ecec01c4d88fe77d6ffb10f7 (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=ad10224a804e63ce498c7b894574a6e17b9ff7cc

commit ad10224a804e63ce498c7b894574a6e17b9ff7cc
Author: Franck Villaume <[email protected]>
Date:   Sat Dec 8 17:20:44 2018 +0100

    /users/<nickname> improvement: be able to monitor an user.

diff --git a/src/common/include/User.class.php 
b/src/common/include/User.class.php
index 2e1f0b2..4a9627a 100644
--- a/src/common/include/User.class.php
+++ b/src/common/include/User.class.php
@@ -1814,6 +1814,86 @@ Email: %3$s
                        return 
group_get_objects(util_result_column_to_array($res,0));
                }
        }
+
+       /**
+        * getMonitoredUserEmailAddress - get the email addresses of users who 
monitor this user
+        *
+        * @return      string  The list of emails comma separated
+        */
+       function getMonitoredUserEmailAddress() {
+               $MonitorElementObject = new MonitorElement('user');
+               return 
$MonitorElementObject->getAllEmailsInCommatSeparated($this->getID());
+       }
+
+       /**
+        * getMonitorIds - get user ids monitoring this user.
+        *
+        * @return      array of user ids monitoring this user.
+        */
+       function getMonitorIds() {
+               $MonitorElementObject = new MonitorElement('user');
+               return 
$MonitorElementObject->getMonitorUsersIdsInArray($this->getID());
+       }
+
+       /**
+        * isMonitoredBy - get the monitored status of this user for a specific 
user id.
+        *
+        * @param       string  $userid
+        * @return      bool    true if monitored by this user
+        */
+       function isMonitoredBy($userid = 'ALL') {
+               $MonitorElementObject = new MonitorElement('user');
+               if ( $userid == 'ALL' ) {
+                       return 
$MonitorElementObject->isMonitoredByAny($this->getID());
+               } else {
+                       return 
$MonitorElementObject->isMonitoredByUserId($this->getID(), $userid);
+               }
+       }
+
+       /**
+        * removeMonitoredBy - remove this user for a specific user id for 
monitoring.
+        *
+        * @param       int     $userid User ID
+        * @return      bool    true if success
+        */
+       function removeMonitoredBy($userid) {
+               $MonitorElementObject = new MonitorElement('user');
+               if 
(!$MonitorElementObject->disableMonitoringByUserId($this->getID(), $userid)) {
+                       
$this->setError($MonitorElementObject->getErrorMessage());
+                       return false;
+               }
+               return true;
+       }
+
+       /**
+        * addMonitoredBy - add this user for a specific user id for monitoring.
+        *
+        * @param       int     $userid User ID
+        * @return      bool    true if success
+        */
+       function addMonitoredBy($userid) {
+               $MonitorElementObject = new MonitorElement('user');
+               if 
(!$MonitorElementObject->enableMonitoringByUserId($this->getID(), $userid)) {
+                       
$this->setError($MonitorElementObject->getErrorMessage());
+                       return false;
+               }
+               return true;
+       }
+
+       /**
+        * clearMonitor - remove all entries of monitoring for this user.
+        *
+        * @return      bool    true if success.
+        */
+       function clearMonitor() {
+               $MonitorElementObject = new MonitorElement('user');
+               if (!$MonitorElementObject->clearMonitor($this->getID())) {
+                       
$this->setError($MonitorElementObject->getErrorMessage());
+                       return false;
+               }
+               return true;
+       }
+
 }
 
 
diff --git a/src/www/users b/src/www/users
index 1da2a8f..1e5a6c8 100644
--- a/src/www/users
+++ b/src/www/users
@@ -84,8 +84,20 @@ if (!$user || !is_object($user) || $user->isError() || 
!$user->isActive()) {
                }
        } else { // default HTML view
                //now show the user page
-               $title = _('User Profile');
-               $HTML->header(array('title'=>$title));
+               $title = '<i>'.$username.'</i> '._('Profile');
+               if (forge_get_config('use_diary') && session_loggedin()) {
+                       if ($user->isMonitoredBy(user_getid())) {
+                               $option = 'stop';
+                               $titleMonitor = _('Stop monitoring this user');
+                               $image = 
$HTML->getStopMonitoringPic($titleMonitor, '');
+                       } else {
+                               $option = 'start';
+                               $titleMonitor = _('Start monitoring this user');
+                               $image = 
$HTML->getStartMonitoringPic($titleMonitor, '');
+                       }
+                       $title .= 
util_make_link('/developer/monitor.php?diary_user='.$user->getID(), $image, 
array('title' => $titleMonitor));
+               }
+               $HTML->header(array('title' => $title));
 
                if (forge_get_config('user_home_widget')) {
                        if (session_loggedin() && ($user->getID() == 
user_getid())) {

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=432969469f159dc1226ec85f4ea468fe0d523f27

commit 432969469f159dc1226ec85f4ea468fe0d523f27
Author: Franck Villaume <[email protected]>
Date:   Sat Dec 8 17:10:18 2018 +0100

    fix comment

diff --git a/src/common/docman/Document.class.php 
b/src/common/docman/Document.class.php
index dac69b7..639a978 100644
--- a/src/common/docman/Document.class.php
+++ b/src/common/docman/Document.class.php
@@ -607,7 +607,7 @@ class Document extends FFObject {
        /**
         * getMonitorIds - get user ids monitoring this Document.
         *
-        * @return      array of user ids monitoring this Artifact.
+        * @return      array of user ids monitoring this Document.
         */
        function getMonitorIds() {
                $MonitorElementObject = new MonitorElement('docdata');

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=fb071d50dfd74293858ec6e2741bade5c7760208

commit fb071d50dfd74293858ec6e2741bade5c7760208
Author: Franck Villaume <[email protected]>
Date:   Sat Dec 8 16:54:36 2018 +0100

    tabs

diff --git a/src/www/users b/src/www/users
index 8457bca..1da2a8f 100644
--- a/src/www/users
+++ b/src/www/users
@@ -75,13 +75,12 @@ if (!$user || !is_object($user) || $user->isError() || 
!$user->isActive()) {
                $hook_params['accept'] = $content_type;
                $hook_params['return'] = '';
                plugin_hook_by_reference('content_negociated_user_home', 
$hook_params);
-               if($hook_params['content_type'] != ''){
-                               header('Content-type: '. 
$hook_params['content_type']);
-                               echo $hook_params['content'];
-               }
-               else {
-                               header('HTTP/1.1 406 Not Acceptable',true,406);
-                               exit(0);
+               if ($hook_params['content_type'] != '') {
+                       header('Content-type: '. $hook_params['content_type']);
+                       echo $hook_params['content'];
+               } else {
+                       header('HTTP/1.1 406 Not Acceptable',true,406);
+                       exit(0);
                }
        } else { // default HTML view
                //now show the user page

-----------------------------------------------------------------------

Summary of changes:
 src/common/docman/Document.class.php |  2 +-
 src/common/include/User.class.php    | 80 ++++++++++++++++++++++++++++++++++++
 src/www/users                        | 29 +++++++++----
 3 files changed, 101 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to