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  4f3ecb97f1a748c76f6d2ac9cda9fa0d2321ce9f (commit)
       via  5851b5903f040331b11b933289b92a6fb02bc7d5 (commit)
      from  5414bb28f34a3c44ace33f22370b80d2d1ca7bc4 (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=4f3ecb97f1a748c76f6d2ac9cda9fa0d2321ce9f

commit 4f3ecb97f1a748c76f6d2ac9cda9fa0d2321ce9f
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Sat May 1 16:14:51 2021 +0200

    clean-up

diff --git a/src/common/forum/AttachManager.class.php 
b/src/common/forum/AttachManager.class.php
index 363a1b5..f90a3c6 100644
--- a/src/common/forum/AttachManager.class.php
+++ b/src/common/forum/AttachManager.class.php
@@ -32,7 +32,6 @@ class AttachManager extends FFError {
 
        var $attachs = array(); //the attached files
        var $msg_id; //the msg_id that links to the attachs
-       var 
$user_id,$dateline,$filename,$filedata,$filesize,$visible,$filehash,$posthash;
        var $messages = array();
        var $ForumMsg; // The Forum object
 
@@ -44,16 +43,6 @@ class AttachManager extends FFError {
                return $this->messages;
        }
 
-       function 
fillvalues($user_id,$dateline,$filename,$filedata,$filesize,$visible,$filehash,$posthash)
 {
-               $this->user_id = $user_id;
-               $this->dateline = $dateline;
-               $this->filename = $filename;
-               $this->filedata = $filedata;
-               $this->visible = $visible;
-               $this->filehash = $filehash;
-               $this->posthash = $posthash;
-       }
-
        /**
         * Function SetForumMsg
         *
@@ -121,14 +110,14 @@ class AttachManager extends FFError {
        function PrintAttachLink(&$msg, $group_id, $forum_id) {
 
                //ask if the message has an attachment
-               $msg_id = $msg->getID();
+               $lmsg_id = $msg->getID();
                if ($msg->isPending()) {
                        $res = db_query_params('SELECT 
attachmentid,filename,userid,counter FROM forum_pending_attachment where 
msg_id=$1',
-                                               array ($msg_id));
+                                               array ($lmsg_id));
                        $pend = "&amp;pending=yes";
                } else {
                        $res = db_query_params('SELECT 
attachmentid,filename,userid,counter FROM forum_attachment where msg_id=$1',
-                                               array ($msg_id));
+                                               array ($lmsg_id));
                        $pend = "";
                }
 
@@ -149,7 +138,7 @@ class AttachManager extends FFError {
                                if ( ((user_getid() == $attach_userid)
                                      || (forge_check_perm ('forum_admin', 
$f->Group->getID())))
                                     && (!$msg->isPending()) ) { //only permit 
the user who created the attach to delete it, or an admin
-                                       $attach .= "   <a 
href=\"javascript:manageattachments('/forum/attachment.php?attachid=$attachid&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;msg_id=$msg_id&amp;edit=yes','no');\">"
 . html_image('ic/attach_edit.png', '', '', array('alt'=>_("Edit"))) . "</a>";
+                                       $attach .= "   <a 
href=\"javascript:manageattachments('/forum/attachment.php?attachid=$attachid&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;msg_id=$lmsg_id&amp;edit=yes','no');\">"
 . html_image('ic/attach_edit.png', '', '', array('alt'=>_("Edit"))) . "</a>";
                                        $attach .= "     <a 
href=\"javascript:manageattachments('/forum/attachment.php?attachid=$attachid&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;delete=yes','yes');\">"
 .  html_image('ic/attach_delete.png', '', '', array('alt'=>_("Delete"))) . 
"</a>";
                                }
                        }
@@ -163,7 +152,7 @@ class AttachManager extends FFError {
                                if ( ((user_getid() == $msg->getPosterID())
                                      || (forge_check_perm ('forum_admin', 
$f->Group->getID())))
                                     && (!$msg->isPending()) ) { //only permit 
the user who created the message to insert an attach
-                                       $attach .= "   <a 
href=\"javascript:manageattachments('".util_make_url 
("/forum/attachment.php?attachid=0&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;msg_id=$msg_id&amp;edit=yes")."','no');\">"
 .  html_image('ic/attach_add.png', '', '', array('alt'=>_("Add"))) . "</a>";
+                                       $attach .= "   <a 
href=\"javascript:manageattachments('".util_make_url 
("/forum/attachment.php?attachid=0&amp;group_id=$group_id&amp;forum_id=$forum_id&amp;msg_id=$lmsg_id&amp;edit=yes")."','no');\">"
 .  html_image('ic/attach_add.png', '', '', array('alt'=>_("Add"))) . "</a>";
                                }
                        }
                }
@@ -247,7 +236,7 @@ class AttachManager extends FFError {
                $attachment_size = trim($attach['size']);
                $attachment_type = trim($attach['type']);
 
-               if ($attachment == 'none' OR empty($attachment) OR 
empty($attachment_name)) {
+               if ($attachment == 'none' || empty($attachment) || 
empty($attachment_name)) {
                        return false; //no point in continuing if there's no 
file
                }
 
diff --git a/src/common/forum/ForumAdmin.class.php 
b/src/common/forum/ForumAdmin.class.php
index 12d62f7..ea65e86 100644
--- a/src/common/forum/ForumAdmin.class.php
+++ b/src/common/forum/ForumAdmin.class.php
@@ -39,7 +39,6 @@ class ForumAdmin extends FFError {
                        $this->p =& $this->g->getPermission();
                        if (!$this->g->usesForum()) {
                                $this->setError(sprintf(_('%s does not use the 
Forum tool.'), $this->g->getPublicName()));
-                               return;
                        }
                }
        }
@@ -65,7 +64,6 @@ class ForumAdmin extends FFError {
 
                $return .= 
util_make_link('/forum/admin/?editmsg='.$msg_id.'&group_id='.$group_id.'&thread_id='.$thread_id.'&forum_id='.$forum_id,
 html_image('ic/forum_edit.png', 16, 18, array('alt' => _("Edit"))));
                $return .= 
util_make_link('/forum/admin/?deletemsg='.$msg_id.'&group_id='.$group_id.'&thread_id='.$thread_id.'&forum_id='.$forum_id,
 html_image('ic/forum_delete.png', 16, 18, array('alt'=>_("Delete"))));
-               //              $return .= "<br />";
                return $return;
        }
 
@@ -188,7 +186,7 @@ class ForumAdmin extends FFError {
                                
form_release_key(getStringFromRequest("form_key"));
                                exit_permission_denied('forums');
                        }
-                       $f=new Forum($this->g);
+                       $f = new Forum($this->g);
                        if (!$f || !is_object($f)) {
                                
form_release_key(getStringFromRequest("form_key"));
                                exit_error(_('Error getting Forum'),'forums');
@@ -207,7 +205,7 @@ class ForumAdmin extends FFError {
                if ($action == "delete") { //Deleting messages or threads
                        $msg_id = getIntFromRequest('deletemsg');
                        $forum_id = getIntFromRequest('forum_id');
-                       $f=new Forum($this->g,$forum_id);
+                       $f = new Forum($this->g,$forum_id);
                        if (!$f || !is_object($f)) {
                                exit_error(_('Error getting Forum'),'forums');
                        } elseif ($f->isError()) {
@@ -216,7 +214,7 @@ class ForumAdmin extends FFError {
 
                        session_require_perm ('forum_admin', 
$f->Group->getID()) ;
 
-                       $fm=new ForumMessage($f,$msg_id);
+                       $fm = new ForumMessage($f, $msg_id);
                        if (!$fm || !is_object($fm)) {
                                exit_error(_('Error Getting 
ForumMessage'),'forums');
                        } elseif ($fm->isError()) {
@@ -235,7 +233,7 @@ class ForumAdmin extends FFError {
                                Deleting entire forum
                        */
                        $group_forum_id = getIntFromRequest('group_forum_id');
-                       $f=new Forum($this->g,$group_forum_id);
+                       $f = new Forum($this->g, $group_forum_id);
                        if (!$f || !is_object($f)) {
                                exit_error(_('Error getting Forum'),'forums');
                        } elseif ($f->isError()) {
@@ -271,7 +269,7 @@ class ForumAdmin extends FFError {
                                $moderated_forums[$aux[1]] = $aux[0];
                        }
 
-                       if (count($moderated_forums)==0) {
+                       if (empty($moderated_forums)) {
                                echo $HTML->feedback(_('No forums are moderated 
for this group'));
                                forum_footer();
                                exit();
@@ -346,18 +344,13 @@ class ForumAdmin extends FFError {
                        echo $HTML->closeForm();
                }
                if ($action == "update_pending") {
-                       $group_id = getIntFromRequest("group_id");
                        $forum_id = getIntFromRequest("forum_id");
                        $msgids = getStringFromRequest("msgids");//the message 
ids to update
                        $doaction = getArrayFromRequest("doaction"); //the 
actions for the messages
 
-                       $msgids = explode(",",$msgids);
+                       $msgids = explode(",", $msgids);
                        array_pop($msgids);//this last one is empty
 
-                       /*if ($this->isGroupAdmin()) {
-                               $this->PrintAdminOptions();
-                       }*/
-
                        for($i=0;$i<count($msgids);$i++) {
                                switch ($doaction[$i]) {
                                        case 1 : {
@@ -423,7 +416,7 @@ class ForumAdmin extends FFError {
                                                        $feedback .= 
"($subject) " . _('Pending message released') . "<br />";
                                                        if 
(db_numrows($res2)>0) {
                                                                //if there's an 
attachment
-                                                               $am = NEW 
AttachManager();//object that will handle and insert the attachment into the db
+                                                               $am = new 
AttachManager();//object that will handle and insert the attachment into the db
                                                                
$am->SetForumMsg($fm);
                                                                $userid = 
db_result($res2,0,"userid");
                                                                $dateline = 
db_result($res2,0,"dateline");
@@ -454,7 +447,7 @@ class ForumAdmin extends FFError {
 
                                                if ( isset($am) && 
(is_object($am)) ) {
                                                        //if there was an 
attach, check if it was uploaded ok
-                                                        if ((!$am->isError())) 
{
+                                                        if (!$am->isError()) {
                                                                $deleteok = 
true;
                                                         } else {
                                                                //undo the 
changes to the forum table
diff --git a/src/common/forum/ForumFactory.class.php 
b/src/common/forum/ForumFactory.class.php
index 0166c07..ffb2519 100644
--- a/src/common/forum/ForumFactory.class.php
+++ b/src/common/forum/ForumFactory.class.php
@@ -43,10 +43,10 @@ class ForumFactory extends FFError {
        var $forums;
 
        /**
-        * @param       object $Group The Group object to which this forum is 
associated.
-        * @param       bool $skip_check
+        * @param       object  $Group          The Group object to which this 
forum is associated.
+        * @param       bool    $skip_check
         */
-       function __construct(&$Group, $skip_check=false) {
+       function __construct(&$Group, $skip_check = false) {
                parent::__construct();
                if (!$Group || !is_object($Group)) {
                        $this->setError(_('Invalid Project'));
@@ -206,8 +206,10 @@ class ForumFactory extends FFError {
                                // Update row
                                $count = db_result($res, 0, 'count');
                                $count -= $msg_count;
-                               if ($count < 0) $count = 0;
-                               $res = db_query_params('UPDATE 
forum_agg_msg_count SET count=$1 WHERE group_forum_id=$2',
+                               if ($count < 0) {
+                                       $count = 0;
+                               }
+                               db_query_params('UPDATE forum_agg_msg_count SET 
count=$1 WHERE group_forum_id=$2',
                                                        array($count, 
$old_forum_id));
                        } else {
                                // Error because row doesn't exist... insert it
@@ -215,7 +217,7 @@ class ForumFactory extends FFError {
                                                        array($old_forum_id));
                                if ($res && db_numrows($res)) {
                                        $count = db_result($res, 0, 'count');
-                                       $res = db_query_params('INSERT INTO 
forum_agg_msg_count (group_forum_id, count) VALUES ($1,$2)',
+                                       db_query_params('INSERT INTO 
forum_agg_msg_count (group_forum_id, count) VALUES ($1,$2)',
                                                                
array($old_forum_id, $count));
                                }
                        }
@@ -227,11 +229,11 @@ class ForumFactory extends FFError {
                                // Update row
                                $count = db_result($res, 0, 'count');
                                $count += $msg_count;
-                               $res = db_query_params('UPDATE 
forum_agg_msg_count SET count=$1 WHERE group_forum_id=$2',
+                               db_query_params('UPDATE forum_agg_msg_count SET 
count=$1 WHERE group_forum_id=$2',
                                                        array($count, 
$group_forum_id));
                        } else {
                                // Insert row
-                               $res = db_query_params('INSERT INTO 
forum_agg_msg_count (group_forum_id, count) VALUES ($1,$2)',
+                               db_query_params('INSERT INTO 
forum_agg_msg_count (group_forum_id, count) VALUES ($1,$2)',
                                                        array($group_forum_id, 
$msg_count));
                        }
                }
diff --git a/src/common/forum/ForumHTML.class.php 
b/src/common/forum/ForumHTML.class.php
index 89567c2..feaa10f 100644
--- a/src/common/forum/ForumHTML.class.php
+++ b/src/common/forum/ForumHTML.class.php
@@ -122,17 +122,15 @@ function forum_header($params = array()) {
                                
$menu_links[]='/forum/admin/?group_id='.$group_id;
                        }
                }
-               if (count($menu_text) > 0) {
-                       $params['submenu'] 
=$HTML->subMenu($menu_text,$menu_links);
-               }
 
+               $params['submenu'] =$HTML->subMenu($menu_text,$menu_links);
                site_project_header($params);
        }
 
        $pluginManager = plugin_manager_get_object();
-       if ($f && $pluginManager->PluginIsInstalled('blocks') && 
plugin_hook("blocks", "forum_".$f->getName()))
+       if ($f && $pluginManager->PluginIsInstalled('blocks') && 
plugin_hook("blocks", "forum_".$f->getName())) {
                echo '<br />';
-
+       }
        if (session_loggedin()) {
                if ($f) {
                        if ($f->isMonitoring()) {
@@ -377,8 +375,8 @@ class ForumHTML extends FFError {
        function showNestedMessages(&$msg_arr, $msg_id) {
                global $total_rows;
 
-               $rows=count($msg_arr["$msg_id"]);
-               $ret_val='';
+               $rows = count($msg_arr["$msg_id"]);
+               $ret_val = '';
 
                if ($msg_arr["$msg_id"] && $rows > 0) {
                        $ret_val .= '
@@ -402,10 +400,7 @@ class ForumHTML extends FFError {
                        }
                        $ret_val .= '
                        </li></ul>';
-               } else {
-                       //$ret_val .= "<p><strong>no messages actually follow 
up to $msg_id</strong>";
                }
-
                return $ret_val;
        }
 
@@ -424,12 +419,11 @@ class ForumHTML extends FFError {
                */
                global $total_rows,$current_message,$group_id, $HTML;
 
-               if (!isset($msg_arr["$msg_id"]))
+               if (!isset($msg_arr["$msg_id"])) {
                        return "";
-
+               }
                $rows=count($msg_arr["$msg_id"]);
                $ret_val = "";
-               //echo "<p>ShowSubmessages() $msg_id | $rows";
                if ($rows > 0) {
                        for ($i=($rows-1); $i >= 0; $i--) {
                                /*
@@ -623,7 +617,7 @@ class ForumHTML extends FFError {
                                        echo '<textarea required="required" 
name="body"  rows="10" cols="70">' . $body . '</textarea>';
                                }
                                unset($GLOBALS['editor_was_set_up']);
-                               //$text_support->displayTextField('body'); ?>
+                       ?>
                <br />
                <!--            <span class="selected"><?php echo _('HTML tags 
will display in your post as text'); ?></span> -->
                <br />
@@ -637,8 +631,10 @@ class ForumHTML extends FFError {
                }
                ?> <br />
                <input type="submit" name="submit"
-                       value="<?php echo _('Post Comment'); echo 
((!session_loggedin())?' '._('Anonymously'):''); ?>" /><?php
-                       echo ((session_loggedin()) ? '&nbsp;&nbsp;&nbsp;<input 
type="checkbox" value="1" name="monitor" />&nbsp;'._('Receive comments via 
email').'.' : ''); ?>
+                       value="<?php echo _('Post Comment'); echo 
((!session_loggedin())?' '._('Anonymously'):''); ?>" />
+                       <?php if (session_loggedin()) {
+                               echo '&nbsp;&nbsp;&nbsp;<input type="checkbox" 
value="1" name="monitor" />&nbsp;'._('Receive comments via email').'.';
+                       } ?>
                </p>
                </td>
        </tr>
diff --git a/src/common/forum/ForumMessage.class.php 
b/src/common/forum/ForumMessage.class.php
index 3cb43e1..394cb54 100644
--- a/src/common/forum/ForumMessage.class.php
+++ b/src/common/forum/ForumMessage.class.php
@@ -75,9 +75,7 @@ class ForumMessage extends FFError {
                        } else {
                                $this->awaits_moderation = false;
                                if (!$arr || !is_array($arr)) {
-                                       if (!$this->fetchData($msg_id)) {
-                                               return;
-                                       }
+                                       $this->fetchData($msg_id))
                                } else {
                                        $this->data_array =& $arr;
                                        //
@@ -86,7 +84,6 @@ class ForumMessage extends FFError {
                                        if ($this->data_array['group_forum_id'] 
!= $this->Forum->getID()) {
                                                
$this->setError(_('Group_forum_id in db result does not match Forum Object'));
                                                $this->data_array=null;
-                                               return;
                                        }
                                }
                        }

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

commit 5851b5903f040331b11b933289b92a6fb02bc7d5
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Sat May 1 15:36:10 2021 +0200

    improve code clarity/lisibility

diff --git a/src/bin/systasks_wait_until_empty.php 
b/src/bin/systasks_wait_until_empty.php
index 69f188d..fc37da8 100755
--- a/src/bin/systasks_wait_until_empty.php
+++ b/src/bin/systasks_wait_until_empty.php
@@ -28,9 +28,9 @@ require_once $gfcommon.'include/pre.php';
 
 $first = true;
 do {
-       if (!$first)
+       if (!$first) {
                sleep(1);
-
+       }
        $res = db_query_params("SELECT * FROM systasks WHERE status=$1"
                               . " ORDER BY systask_id", array('TODO'));
        $nb = db_numrows($res);
diff --git a/src/common/dao/CodendiDataAccess.class.php 
b/src/common/dao/CodendiDataAccess.class.php
index f8b4b79..775997d 100644
--- a/src/common/dao/CodendiDataAccess.class.php
+++ b/src/common/dao/CodendiDataAccess.class.php
@@ -24,10 +24,6 @@ require_once 'include/DataAccess.class.php';
 
 class CodendiDataAccess extends DataAccess {
 
-       function __construct() {
-               parent::__construct();
-       }
-
        protected static $_instance;
 
        public static function instance() {
diff --git a/src/common/diary/DiaryFactory.class.php 
b/src/common/diary/DiaryFactory.class.php
index 96874cb..6b0fc68 100644
--- a/src/common/diary/DiaryFactory.class.php
+++ b/src/common/diary/DiaryFactory.class.php
@@ -29,7 +29,6 @@ class DiaryFactory extends FFObject {
                parent::__construct();
                if (!forge_get_config('use_diary')) {
                        $this->setError(_('Diary feature is off.'));
-                       return;
                }
        }
 
diff --git a/src/common/diary/DiaryNote.class.php 
b/src/common/diary/DiaryNote.class.php
index 5519694..37a6e1a 100644
--- a/src/common/diary/DiaryNote.class.php
+++ b/src/common/diary/DiaryNote.class.php
@@ -108,7 +108,6 @@ class DiaryNote extends FFObject {
                                if (!$this->getUser->getID() != user_getid()) {
                                        $this->setPermissionDeniedError();
                                        $this->data_array = null;
-                                       return;
                                }
                        }
                }
@@ -267,14 +266,14 @@ class DiaryNote extends FFObject {
                        return $this->votes;
                }
 
-               $voters = $this->getVoters();
-               if (($numvoters = count($voters)) < 1) {
+               $lvoters = $this->getVoters();
+               if (($numvoters = count($lvoters)) < 1) {
                        $this->votes = array(0, 0, 0);
                        return $this->votes;
                }
 
                $res = db_query_params('SELECT COUNT(*) AS count FROM 
diary_votes WHERE diary_id = $1 AND user_id = ANY($2)',
-                                       array($this->getID(), 
db_int_array_to_any_clause($voters)));
+                                       array($this->getID(), 
db_int_array_to_any_clause($lvoters)));
                $db_count = db_fetch_array($res);
                $numvotes = $db_count['count'];
 
diff --git a/src/common/docman/Document.class.php 
b/src/common/docman/Document.class.php
index 639a978..47ee1ab 100644
--- a/src/common/docman/Document.class.php
+++ b/src/common/docman/Document.class.php
@@ -122,7 +122,6 @@ class Document extends FFObject {
                                if (!$perm || !is_object($perm) || 
!$perm->isDocEditor()) {
                                        $this->setPermissionDeniedError();
                                        $this->data_array = null;
-                                       return;
                                }
                        }
                }
@@ -337,8 +336,7 @@ class Document extends FFObject {
         */
        function getDescription() {
                $result = util_gen_cross_ref($this->data_array['description'], 
$this->Group->getID());
-               $result = nl2br($result);
-               return $result;
+               return nl2br($result);;
        }
 
        /**
@@ -490,9 +488,9 @@ class Document extends FFObject {
         * @return      string  The filedata.
         */
        function getFileData($download = true) {
-               if ($download)
+               if ($download) {
                        $this->downloadUp();
-
+               }
                return file_get_contents($this->getFilePath());
        }
 
@@ -1036,9 +1034,9 @@ class Document extends FFObject {
         * @return      bool    success.
         */
        function sendApprovalNotice() {
-               if ($this->getStateID() != 3)
+               if ($this->getStateID() != 3) {
                        return true;
-
+               }
                $doc_name = $this->getName();
                $desc     = 
util_unconvert_htmlspecialchars($this->getDescription());
                $group_id = $this->Group->getID();
diff --git a/src/common/docman/DocumentFactory.class.php 
b/src/common/docman/DocumentFactory.class.php
index 195bd58..6f49f10 100644
--- a/src/common/docman/DocumentFactory.class.php
+++ b/src/common/docman/DocumentFactory.class.php
@@ -326,7 +326,7 @@ class DocumentFactory extends FFError {
                        }
                }
 
-               if (count($return) === 0) {
+               if (empty($return)) {
                        $this->setError(_('No Documents Found'));
                        return NULL;
                }
diff --git a/src/common/docman/DocumentGroup.class.php 
b/src/common/docman/DocumentGroup.class.php
index 84d2e4a..19e62e9 100644
--- a/src/common/docman/DocumentGroup.class.php
+++ b/src/common/docman/DocumentGroup.class.php
@@ -128,7 +128,6 @@ class DocumentGroup extends FFError {
                if ($this->getState() == 5 && !forge_check_perm('docman', 
$this->Group->getID(), 'approve')) {
                        $this->data_array = null;
                        $this->setError(_('Permission refused'));
-                       return;
                }
        }
 
@@ -240,16 +239,19 @@ class DocumentGroup extends FFError {
                /* delete documents in directory */
                $result = db_query_params('DELETE FROM doc_data where doc_group 
= $1 and group_id = $2',
                                        array($doc_groupid, $project_group_id));
-
+               if (!$result) {
+                       db_rollback();
+                       return false;
+               }
+               
                /* delete directory */
                $result = db_query_params('DELETE FROM doc_groups where 
doc_group = $1 and group_id = $2',
                                        array($doc_groupid, $project_group_id));
-
-               db_commit();
-
                if (!$result) {
+                       db_rollback();
                        return false;
                }
+               db_commit();
 
                /* update the parent if any */
                if ($this->getParentID()) {
@@ -535,9 +537,9 @@ class DocumentGroup extends FFError {
                $valArr = array(htmlspecialchars($name), $parent_doc_group, 
$updatetimestamp, $user_id, 0, NULL, $state);
                if ($this->setValueinDB($colArr, $valArr)) {
                        $parentDg = new DocumentGroup($this->Group, 
$parent_doc_group);
-                       if ($parentDg->getParentID())
+                       if ($parentDg->getParentID()) {
                                $parentDg->update($parentDg->getName(), 
$parentDg->getParentID(), 1, $parentDg->getState(), $updatetimestamp);
-
+                       }
                        $this->fetchData($this->getID());
                        $this->sendNotice(false);
                        return true;
@@ -562,12 +564,12 @@ class DocumentGroup extends FFError {
        function hasDocuments(&$nested_groups, &$document_factory, $stateid = 
0) {
                $doc_group_id = $this->getID();
                static $result = array();       // this function will probably 
be called several times so we better store results in order to speed things up
-               if (!array_key_exists($stateid, $result) || 
!is_array($result[$stateid]))
+               if (!array_key_exists($stateid, $result) || 
!is_array($result[$stateid])) {
                        $result[$stateid] = array();
-
-               if (array_key_exists($doc_group_id, $result[$stateid]))
+               }
+               if (array_key_exists($doc_group_id, $result[$stateid])) {
                        return $result[$stateid][$doc_group_id];
-
+               }
 
                $stateIdDg = 1;
                if (forge_check_perm('docman', 
$document_factory->Group->getID(), 'approve')) {
@@ -626,9 +628,9 @@ class DocumentGroup extends FFError {
         * @return      int     the number of found documents
         */
        function getNumberOfDocuments($stateId = 1) {
-               if (isset($this->data_array['numberFiles'][$stateId]))
+               if (isset($this->data_array['numberFiles'][$stateId])) {
                        return $this->data_array['numberFiles'][$stateId];
-
+               }
                $res = db_query_params('select count(*) from docdata_vw where 
doc_group = $1 and group_id = $2 and stateid = $3',
                                        array($this->getID(), 
$this->Group->getID(), $stateId));
                if (!$res) {
@@ -708,8 +710,7 @@ class DocumentGroup extends FFError {
                                $returnPath .= '/'.$this->getName();
                        }
                }
-               $returnPath = preg_replace('/\/\//','/', $returnPath);
-               return $returnPath;
+               return preg_replace('/\/\//','/', $returnPath);
        }
 
        /**
@@ -723,13 +724,13 @@ class DocumentGroup extends FFError {
        function setStateID($stateid, $recursive = false) {
                if ($recursive) {
                        $df = new DocumentFactory($this->Group);
-                       if ($df->isError())
+                       if ($df->isError()) {
                                exit_error($df->getErrorMessage(), 'docman');
-
+                       }
                        $dgf = new DocumentGroupFactory($this->Group);
-                       if ($dgf->isError())
+                       if ($dgf->isError()) {
                                exit_error($dgf->getErrorMessage(), 'docman');
-
+                       }
                        $stateidArr = array(1, 3, 4, 5);
                        $nested_groups =& $dgf->getNested($stateidArr);
 
@@ -749,9 +750,9 @@ class DocumentGroup extends FFError {
                        $localdocgroup_arr[] = $this->getID();
                        if (is_array($nested_groups[$this->getID()])) {
                                foreach ($nested_groups[$this->getID()] as $dg) 
{
-                                       if (!$dg->setStateID($stateid))
+                                       if (!$dg->setStateID($stateid)) {
                                                return false;
-
+                                       }
                                        $localdocgroup_arr[] = $dg->getID();
                                        $localdf = new 
DocumentFactory($this->Group);
                                        $localdf->setDocGroupID($dg->getID());
@@ -767,8 +768,9 @@ class DocumentGroup extends FFError {
                        foreach ($localdocgroup_arr as $docgroup_id) {
                                if (isset($nested_docs[$docgroup_id]) && 
is_array($nested_docs[$docgroup_id])) {
                                        foreach ($nested_docs[$docgroup_id] as 
$d) {
-                                               if (!$d->setState($stateid))
+                                               if (!$d->setState($stateid)) {
                                                        return false;
+                                               }
                                        }
                                }
                        }
@@ -834,9 +836,9 @@ class DocumentGroup extends FFError {
                if (!$this->getLocked() || ((time() - $this->getLockdate()) > 
600)) {
                        //we need to move recursively all docs and all 
doc_groups in trash
                        // aka setStateID to 2.
-                       if (!$this->setStateID(2, true))
+                       if (!$this->setStateID(2, true)) {
                                return false;
-
+                       }
                        $dm = new DocumentManager($this->Group);
                        $this->setParentDocGroupId($dm->getTrashID());
                        $this->setLock(0);
diff --git a/src/common/docman/DocumentManager.class.php 
b/src/common/docman/DocumentManager.class.php
index 9a72395..65ec0f9 100644
--- a/src/common/docman/DocumentManager.class.php
+++ b/src/common/docman/DocumentManager.class.php
@@ -75,9 +75,9 @@ class DocumentManager extends FFError {
         * @return      int     The trash doc_group id.
         */
        function getTrashID() {
-               if (isset($this->data_array['trashid']))
+               if (isset($this->data_array['trashid'])) {
                        return $this->data_array['trashid'];
-
+               }
                $res = db_query_params('SELECT doc_group from doc_groups
                                        WHERE groupname = $1
                                        AND group_id = $2
@@ -233,7 +233,7 @@ class DocumentManager extends FFError {
                                                $linkname .= ' '._('(private)');
                                        }
                                        //use &nbsp + inline to support Chrome 
browser correctly
-                                       echo html_ao('li', array('id' => 
'leaf-'.$subGroupIdValue, 'class' => $liclass)).'&nbsp;'.util_make_link($link, 
$localDg->getName(), array('title'=>$lititle, 'style' => 'display: 
inline')).$nbDocsLabel;
+                                       echo html_ao('li', array('id' => 
'leaf-'.$subGroupIdValue, 'class' => $liclass)).'&nbsp;'.util_make_link($link, 
$linkname, array('title'=>$lititle, 'style' => 'display: inline')).$nbDocsLabel;
                                } else {
                                        echo html_ao('li', array('id' => 
'leaf-'.$subGroupIdValue, 'class' => $liclass)).'&nbsp;'.util_make_link($link, 
$localDg->getName(), array('style' => 'display: inline')).$nbDocsLabel;
                                }
@@ -309,8 +309,7 @@ class DocumentManager extends FFError {
                                while ($stateArr = db_fetch_array($stateQuery)) 
{
                                        $returnString .= 
util_html_secure($stateArr['name']).': \''.$stateArr['stateid'].'\',';
                                }
-                               $returnString .= '}';
-                               return $returnString;
+                               return $returnString.'}';
                        }
                        default: {
                                return $stateQuery;
@@ -323,15 +322,12 @@ class DocumentManager extends FFError {
         *
         * @param       array   $nested_groups
         * @param       string  $format         must be json which is wrong, 
this function does not return any json object
-        * @param       bool    $allow_none     allow the "None" which is the 
"/"
-        * @param       int     $selected_id    the selected folder id
-        * @param       array   $dont_display   folders id to not display
         * @return      string
         */
-       function getDocGroupList($nested_groups, $format = '', $allow_none = 
true, $selected_id = 0, $dont_display = array()) {
+       function getDocGroupList($nested_groups, $format = '') {
                $id_array = array();
                $text_array = array();
-               $this->buildArrays($nested_groups, $id_array, $text_array, 
$dont_display);
+               $this->buildArrays($nested_groups, $id_array, $text_array, 
array());
                $rows = count($id_array);
                switch ($format) {
                        case 'json': {
@@ -386,15 +382,17 @@ class DocumentManager extends FFError {
         * @param       bool    $display_files  Set filename instead of 
directory name.
         */
        function buildArrays($group_arr, &$id_array, &$text_array, 
&$dont_display, $parent = 0, $level = 0, $display_files = false) {
-               if (!is_array($group_arr) || !array_key_exists("$parent", 
$group_arr)) return;
-
+               if (!is_array($group_arr) || !array_key_exists("$parent", 
$group_arr)) {
+                       return;
+               }
                $child_count = count($group_arr["$parent"]);
                for ($i = 0; $i < $child_count; $i++) {
                        $doc_group =& $group_arr["$parent"][$i];
 
                        // Should we display this element?
-                       if (in_array($doc_group->getID(), $dont_display)) 
continue;
-
+                       if (in_array($doc_group->getID(), $dont_display)) {
+                               continue;
+                       }
                        $margin = str_repeat("--", $level);
 
                        if (!$display_files) {
diff --git a/src/common/docman/DocumentReview.class.php 
b/src/common/docman/DocumentReview.class.php
index 214b89c..96226c4 100644
--- a/src/common/docman/DocumentReview.class.php
+++ b/src/common/docman/DocumentReview.class.php
@@ -43,7 +43,7 @@ class DocumentReview extends FFError {
        var $version    = null;
        var $serialid   = null;
 
-       function __construct(&$Document, $revid = false, $arr = false) {
+       function __construct(&$Document, $revid = false) {
                parent::__construct();
                if (!$Document || !is_object($Document)) {
                        $this->setError(_('No Valid Document Object'));
diff --git a/src/common/docman/DocumentReviewComment.class.php 
b/src/common/docman/DocumentReviewComment.class.php
index be55fc2..a29f627 100644
--- a/src/common/docman/DocumentReviewComment.class.php
+++ b/src/common/docman/DocumentReviewComment.class.php
@@ -38,7 +38,7 @@ class DocumentReviewComment extends FFError {
         */
        var $data_array = array();
 
-       function __construct(&$DocumentReview, $commentid = false, $arr = 
false) {
+       function __construct(&$DocumentReview, $commentid = false) {
                parent::__construct();
                if (!$DocumentReview || !is_object($DocumentReview)) {
                        $this->setError(_('No Valid DocumentReview Object'));
@@ -88,8 +88,7 @@ class DocumentReviewComment extends FFError {
 
        function getReviewComment() {
                $result = util_gen_cross_ref($this->data_array['rcomment'], 
$this->DocumentReview->Document->Group->getID());
-               $result = nl2br($result);
-               return $result;
+               return nl2br($result);
        }
 
        function attachFile($filename, $filetype, $createdate, $data) {
diff --git a/src/common/docman/DocumentVersion.class.php 
b/src/common/docman/DocumentVersion.class.php
index 131cf58..8852dd9 100644
--- a/src/common/docman/DocumentVersion.class.php
+++ b/src/common/docman/DocumentVersion.class.php
@@ -79,11 +79,11 @@ class DocumentVersion extends FFError {
                parent::__construct();
                if (!$Document || !is_object($Document)) {
                        $this->setError(_('No Valid Document Object'));
-                       return;
+                       return false;
                }
                if ($Document->isError()) {
                        $this->setError(_('Document Version')._(': 
').$Document->getErrorMessage());
-                       return;
+                       return false;
                }
                $this->Document =& $Document;
                if ($verid) {
diff --git a/src/common/docman/DocumentVersionFactory.class.php 
b/src/common/docman/DocumentVersionFactory.class.php
index 9f76343..22367ca 100644
--- a/src/common/docman/DocumentVersionFactory.class.php
+++ b/src/common/docman/DocumentVersionFactory.class.php
@@ -106,7 +106,6 @@ class DocumentVersionFactory extends FFError {
                $res = db_query_params('SELECT serial_id, version as version, 
docid, current_version, title, updatedate, createdate, created_by, description, 
filename, filetype, filesize, vcomment FROM doc_data_version WHERE docid = $1 
ORDER by version DESC',
                                        array($this->Document->getID()));
                if ($res) {
-                       $numrows = db_numrows($res);
                        $i = 0;
                        while ($arr = db_fetch_array($res)) {
                                $versions[$i] = $arr;
diff --git a/src/common/docman/actions/addfile.php 
b/src/common/docman/actions/addfile.php
index 52ca75d..8933b10 100644
--- a/src/common/docman/actions/addfile.php
+++ b/src/common/docman/actions/addfile.php
@@ -74,12 +74,12 @@ if (!$doc_group) {
 
 if (!$title || !$description || (!$uploaded_data && !$file_url && 
!$manual_path && (!$editor && !$name))) {
        $missing_params = array();
-       if (!$title)
+       if (!$title) {
                $missing_params[] = 'title';
-
-       if (!$description)
+       }
+       if (!$description) {
                $missing_params[] = 'description';
-
+       }
        exit_missing_param($_SERVER['HTTP_REFERER'], $missing_params, 'docman');
 }
 
diff --git a/src/common/docman/actions/editdocgroup.php 
b/src/common/docman/actions/editdocgroup.php
index e2a7408..503dae3 100644
--- a/src/common/docman/actions/editdocgroup.php
+++ b/src/common/docman/actions/editdocgroup.php
@@ -69,7 +69,7 @@ if ($dg->getState() == 2 && ($currentParentID == 
$dm->getTrashID())) {
 }
 
 $feedback = sprintf(_('Documents folder %s updated successfully'), 
$dg->getName());
-if ($childgroup_id)
+if ($childgroup_id) {
        $feedback .= ' '.sprintf(_('on project %s'), $g->getPublicName());
-
+}
 session_redirect($urlredirect);
diff --git a/src/common/docman/engine/parser_html.php 
b/src/common/docman/engine/parser_html.php
index 662599b..5c148b2 100755
--- a/src/common/docman/engine/parser_html.php
+++ b/src/common/docman/engine/parser_html.php
@@ -29,16 +29,16 @@ require_once $gfcommon.'docman/engine/parser_text.inc.php';
 
 if ($argc != 2) {
        echo "Usage : parser_html.php <filename>\n";
-       exit (1);
+       exit(1);
 }
 
 $fichin = $argv[1];
-if (!is_file($fichin))
-       exit (1);
-
-if (filesize($fichin) == 0)
-       exit (1);
-
+if (!is_file($fichin)) {
+       exit(1);
+}
+if (filesize($fichin) == 0) {
+       exit(1);
+}
 $fd = fopen($fichin, "r");
 $contents = fread($fd, filesize($fichin));
 fclose($fd);
@@ -50,7 +50,7 @@ fwrite($fd , $strip_content);
 fclose($fd);
 
 echo parser_text($filename);
-unlink ($filename);
+unlink($filename);
 
 // Local Variables:
 // mode: php
diff --git a/src/common/docman/engine/parser_pdf.inc.php 
b/src/common/docman/engine/parser_pdf.inc.php
index 4c59894..a8e0b49 100644
--- a/src/common/docman/engine/parser_pdf.inc.php
+++ b/src/common/docman/engine/parser_pdf.inc.php
@@ -28,12 +28,12 @@ require dirname(__FILE__).'/../../include/env.inc.php';
 require_once $gfcommon.'docman/engine/parser_text.inc.php';
 
 function parser_pdf($fichin) {
-       if (!is_file($fichin))
+       if (!is_file($fichin)) {
                return '';
-
-       if (filesize($fichin) == 0)
+       }
+       if (filesize($fichin) == 0) {
                return '';
-
+       }
        $fichout = tempnam(forge_get_config('data_path'),'tmp');
        $cmd = '/usr/bin/pdftotext '.$fichin.' '.$fichout;
        shell_exec($cmd);
diff --git a/src/common/docman/engine/parser_pdf.php 
b/src/common/docman/engine/parser_pdf.php
index 1a1559c..31e58d9 100755
--- a/src/common/docman/engine/parser_pdf.php
+++ b/src/common/docman/engine/parser_pdf.php
@@ -35,9 +35,9 @@ if ($argc != 2) {
 }
 
 $fichin = $argv[1];
-if (!is_file($fichin))
+if (!is_file($fichin)) {
        exit(1);
-
+}
 echo parser_pdf($fichin);
 
 // Local Variables:
diff --git a/src/common/docman/engine/parser_text.inc.php 
b/src/common/docman/engine/parser_text.inc.php
index f091d3f..0d920e1 100644
--- a/src/common/docman/engine/parser_text.inc.php
+++ b/src/common/docman/engine/parser_text.inc.php
@@ -27,12 +27,12 @@
 require_once $gfcommon.'include/config.php';
 
 function parser_text($fichin) {
-       if (!is_file($fichin))
+       if (!is_file($fichin)) {
                return '';
-
-       if (filesize($fichin) == 0)
+       }
+       if (filesize($fichin) == 0) {
                return '';
-
+       }
        $handle = fopen($fichin, 'r');
        $buff = fread($handle, filesize($fichin));
 
@@ -55,8 +55,7 @@ function parser_text($fichin) {
        // élimination des doublons
        $words = array_unique($words);
        // envoi du résultat sur stdout
-       $rep = print_list($words);
-       return $rep;
+       return print_list($words);
 }
 
 function print_list($list) {
@@ -68,8 +67,7 @@ function print_list($list) {
 }
 
 function delete_specific_chars($text) {
-       $text = strtr($text, "\t\r\n?.*'\":;,#![]()/", "                  ");
-       return $text;
+       return strtr($text, "\t\r\n?.*'\":;,#![]()/", "                  ");
 }
 
 function microtime_float() {
diff --git a/src/common/docman/engine/parser_text.php 
b/src/common/docman/engine/parser_text.php
index 9112326..e56c22f 100755
--- a/src/common/docman/engine/parser_text.php
+++ b/src/common/docman/engine/parser_text.php
@@ -34,9 +34,9 @@ if ($argc != 2) {
 }
 
 $fichin = $argv[1];
-if (!is_file($fichin))
+if (!is_file($fichin)) {
        exit(1);
-
+}
 echo parser_text($fichin);
 
 // Local Variables:
diff --git a/src/common/docman/engine/parser_unoconv_document.php 
b/src/common/docman/engine/parser_unoconv_document.php
index 9b2f094..85fd0ec 100755
--- a/src/common/docman/engine/parser_unoconv_document.php
+++ b/src/common/docman/engine/parser_unoconv_document.php
@@ -35,9 +35,9 @@ if ($argc != 2) {
 }
 
 $fichin = $argv[1];
-if (!is_file($fichin))
+if (!is_file($fichin)) {
        exit (1);
-
+}
 $fichout = tempnam(sys_get_temp_dir(), 'docman');
 $cmd = "HOME=/tmp; /usr/bin/unoconv -d document -f text -o $fichout $fichin";
 $res = shell_exec($cmd);
diff --git a/src/common/docman/engine/parser_unoconv_presentation.php 
b/src/common/docman/engine/parser_unoconv_presentation.php
index f8c886e..94da00f 100755
--- a/src/common/docman/engine/parser_unoconv_presentation.php
+++ b/src/common/docman/engine/parser_unoconv_presentation.php
@@ -31,13 +31,13 @@ require_once $gfcommon.'docman/engine/parser_pdf.inc.php';
 
 if ($argc != 2) {
        echo 'Usage : parser_unoconv_document.php <filename>'."\n";
-       exit (1);
+       exit(1);
 }
 
 $fichin = $argv[1];
-if (!is_file($fichin))
-       exit (1);
-
+if (!is_file($fichin)) {
+       exit(1);
+}
 $fichout = tempnam(sys_get_temp_dir(), 'docman');
 $cmd = "HOME=/tmp; /usr/bin/unoconv -d presentation -f pdf -o $fichout 
$fichin";
 $res = shell_exec($cmd);
diff --git a/src/common/docman/engine/parser_unoconv_spreadsheet.php 
b/src/common/docman/engine/parser_unoconv_spreadsheet.php
index 4a751e1..10696e7 100755
--- a/src/common/docman/engine/parser_unoconv_spreadsheet.php
+++ b/src/common/docman/engine/parser_unoconv_spreadsheet.php
@@ -31,13 +31,13 @@ require_once $gfcommon.'docman/engine/parser_pdf.inc.php';
 
 if ($argc != 2) {
        echo 'Usage : parser_unoconv_document.php <filename>'."\n";
-       exit (1);
+       exit(1);
 }
 
 $fichin = $argv[1];
-if (!is_file($fichin))
-       exit (1);
-
+if (!is_file($fichin)) {
+       exit(1);
+}
 $fichout = tempnam(sys_get_temp_dir(), 'docman');
 $cmd = "HOME=/tmp; /usr/bin/unoconv -d spreadsheet -f pdf -o $fichout $fichin";
 $res = shell_exec($cmd);
diff --git a/src/common/docman/include/webdav.php 
b/src/common/docman/include/webdav.php
index 8203a82..7408c96 100644
--- a/src/common/docman/include/webdav.php
+++ b/src/common/docman/include/webdav.php
@@ -110,9 +110,9 @@ class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
                        $path = rtrim($options['path'], '/');
                        $res = db_query_params('select * from doc_groups where 
group_id = $1 and doc_group = $2 and stateid = ANY ($3)',
                                                array($group_id, 
$analysed_path['doc_group'], db_int_array_to_any_clause(array(1, 5))));
-                       if (!$res)
+                       if (!$res) {
                                return '404';
-
+                       }
                        if (db_numrows($res)) {
                                $arr = db_fetch_array($res);
                        } else {
@@ -140,9 +140,9 @@ class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
                        $files['files'][$i]['props'][] = 
$this->mkprop('getcontenttype', 'httpd/unix-directory');
                        $res = db_query_params('select * from doc_groups where 
group_id = $1 and parent_doc_group = $2 and stateid = ANY ($3)',
                                                array($group_id, 
$analysed_path['doc_group'], db_int_array_to_any_clause(array(1, 5))));
-                       if (!$res)
+                       if (!$res) {
                                return '404';
-
+                       }
                        while ($arr = db_fetch_array($res)) {
                                $i++;
                                if ($arr['updatedate']) {
@@ -163,9 +163,9 @@ class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
                        }
                        $res = db_query_params('select 
filename,filetype,filesize,createdate,updatedate from docdata_vw where group_id 
= $1 and doc_group = $2',
                                array($group_id, $analysed_path['doc_group']));
-                       if (!$res)
+                       if (!$res) {
                                return '404';
-
+                       }
                        while ($arr = db_fetch_array($res)) {
                                $i++;
                                if ($arr['updatedate']) {
@@ -187,9 +187,9 @@ class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
                } elseif (isset($analysed_path['docid'])) {
                        $res = db_query_params('select 
filename,filetype,filesize,createdate,updatedate from docdata_vw where group_id 
= $1 and docid = $2',
                                array($group_id, $analysed_path['docid']));
-                       if (!$res)
+                       if (!$res) {
                                return '404';
-
+                       }
                        $arr = db_fetch_array($res);
                        if ($arr['updatedate']) {
                                $lastmodifieddate = $arr['updatedate'];
@@ -321,9 +321,9 @@ class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
                /* Open a file for writing */
                $tmpfile = sys_get_temp_dir().'/'.uniqid();
                $fp = fopen($tmpfile, "w");
-               while ($data = fread($options['stream'], 1024))
+               while ($data = fread($options['stream'], 1024)) {
                        fwrite($fp, $data);
-
+               }
                /* Close the streams */
                fclose($fp);
                fclose($options['stream']);
@@ -402,16 +402,16 @@ class HTTP_WebDAV_Server_Docman extends 
HTTP_WebDAV_Server {
                if ($analysed_path['isdir']) {
                        /* set this doc_group to trash */
                        $dg = new DocumentGroup($g, 
$analysed_path['doc_group']);
-                       if ($dg->trash())
+                       if ($dg->trash()) {
                                return '200';
-
+                       }
                        return '423';
                } else {
                        if ($analysed_path['docid']) {
                                $d = new Document($g, $analysed_path['docid']);
-                               if ($d->trash())
+                               if ($d->trash()) {
                                        return '200';
-
+                               }
                                return '423';
                        }
                }
@@ -436,9 +436,9 @@ class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
                $dgId = $this->findDgID($arr_path, $group_id);
                if ($dgId >= 0) {
                        $g = group_get_object($group_id);
-                       if (!$g || !is_object($g))
+                       if (!$g || !is_object($g)) {
                                exit_no_group();
-
+                       }
                        $dg = new DocumentGroup($g);
                        if (!$dg->create($coltocreate, $dgId)) {
                                return '409';
@@ -664,15 +664,12 @@ class HTTP_WebDAV_Server_Docman extends 
HTTP_WebDAV_Server {
         */
        function doWeUseDocman($group_id) {
                $g = group_get_object($group_id);
-               if (!$g || !is_object($g))
+               if (!$g || !is_object($g)) {
                        exit_no_group();
-
-               if (!$g->usesDocman())
-                       exit_disabled();
-
-               if (!$g->useWebdav())
+               }
+               if (!$g->usesDocman() || !$g->useWebdav()) {
                        exit_disabled();
-
+               }
                if ($g->isError())
                        exit_error($g->getErrorMessage(), 'docman');
 
diff --git a/src/common/docman/views/addfile.php 
b/src/common/docman/views/addfile.php
index 3d1d184..fc8bf24 100644
--- a/src/common/docman/views/addfile.php
+++ b/src/common/docman/views/addfile.php
@@ -48,9 +48,9 @@ if (isset($childgroup_id) && $childgroup_id) {
 }
 
 $dgf = new DocumentGroupFactory($g);
-if ($dgf->isError())
+if ($dgf->isError()) {
        exit_error($dgf->getErrorMessage(), 'docman');
-
+}
 if (!forge_check_perm('docman', $group_id, 'submit')) {
        $warning_msg = _('Document Manager Action Denied.');
        session_redirect($redirecturl);
diff --git a/src/common/docman/views/listfile.php 
b/src/common/docman/views/listfile.php
index 0c459fc..b8da700 100644
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@ -70,17 +70,17 @@ if (session_loggedin()) {
        $paging = $LUSER->getPreference('paging');
 }
 
-if(!isset($paging) || !$paging)
+if(!isset($paging) || !$paging) {
        $paging = 25;
-
+}
 $df = new DocumentFactory($g);
-if ($df->isError())
+if ($df->isError()) {
        exit_error($df->getErrorMessage(), 'docman');
-
+}
 $dgf = new DocumentGroupFactory($g);
-if ($dgf->isError())
+if ($dgf->isError()) {
        exit_error($dgf->getErrorMessage(), 'docman');
-
+}
 $stateidArr = array(1);
 $stateIdDg = 1;
 if (forge_check_perm('docman', $g->getID(), 'approve')) {
@@ -208,9 +208,9 @@ if ($DocGroupName) {
                }
        }
 
-       if ($ndg->hasDocuments($nested_groups, $df))
+       if ($ndg->hasDocuments($nested_groups, $df)) {
                echo 
util_make_link('/docman/view.php/'.$ndg->Group->getID().'/zip/full/'.$dirid, 
html_image('docman/download-directory-zip.png', 22, 22, array('alt' => 
'downloadaszip')), array('title' => _('Download this folder as a ZIP')));
-
+       }
        if (session_loggedin()) {
                if ($ndg->isMonitoredBy($LUSER->getID())) {
                        $option = 'stop';
diff --git a/src/common/docman/views/listtrashfile.php 
b/src/common/docman/views/listtrashfile.php
index 64dad2a..a8a3720 100644
--- a/src/common/docman/views/listtrashfile.php
+++ b/src/common/docman/views/listtrashfile.php
@@ -57,13 +57,13 @@ if (!forge_check_perm('docman', $g->getID(), 'approve')) {
 }
 
 $df = new DocumentFactory($g);
-if ($df->isError())
+if ($df->isError()) {
        exit_error($df->getErrorMessage(), 'docman');
-
+}
 $dgf = new DocumentGroupFactory($g);
-if ($dgf->isError())
+if ($dgf->isError()) {
        exit_error($dgf->getErrorMessage(), 'docman');
-
+}
 // deleted state id
 $df->setStateID(array(2));
 $df->setDocGroupState(2);
diff --git a/src/common/docman/views/reporting.php 
b/src/common/docman/views/reporting.php
index 5c72b32..0c1fa79 100644
--- a/src/common/docman/views/reporting.php
+++ b/src/common/docman/views/reporting.php
@@ -64,7 +64,9 @@ if ($report->isError()) {
        exit_error($report->getErrorMessage(), 'docman');
 }
 
-if (!$start || !$end) $z =& $report->getMonthStartArr();
+if (!$start || !$end) {
+       $z =& $report->getMonthStartArr();
+}
 
 if (!$start) {
        $start = $z[0];
@@ -73,7 +75,9 @@ if (!$start) {
 if (!$end) {
        $end = $z[ count($z)-1 ];
 }
-if ($end < $start) list($start, $end) = array($end, $start);
+if ($end < $start) {
+       list($start, $end) = array($end, $start);
+}
 
 html_use_jqueryjqplotpluginCanvas();
 html_use_jqueryjqplotpluginhighlighter();
@@ -96,7 +100,7 @@ if ($report->isError()) {
 
        $data = $report->getData();
 
-       if (count($data) == 0) {
+       if (empty($data)) {
                echo $HTML->information(_('There have been no viewed documents 
for this project yet.'));
        } else {
                echo html_ao('script', array('type' => 'text/javascript'));
diff --git a/src/common/docman/views/search.php 
b/src/common/docman/views/search.php
index 28f8e3b..c587bde 100644
--- a/src/common/docman/views/search.php
+++ b/src/common/docman/views/search.php
@@ -97,8 +97,9 @@ echo html_e('input', $attrsInputSearchAll)._('With all the 
words');
 echo html_e('input', $attrsInputSearchOne)._('With at least one of words');
 if ($g->useDocmanSearch()) {
        $attrsInputInsideDocs = array('type' => 'checkbox', 'name'  => 
'insideDocuments', 'value' => 1, 'title' => _('Filename & contents are used to 
match searched words.'));
-       if ($insideDocuments)
+       if ($insideDocuments) {
                $attrsInputInsideDocs['checked'] = 'checked';
+       }
        echo html_e('input', $attrsInputInsideDocs)._('Inside documents');
 }
 $attrsFieldSet = array('id' => 'fieldset1_closed', 'class' => 'coolfieldset');
@@ -113,8 +114,9 @@ if ($g->usesPlugin('projects-hierarchy')) {
        $projectIDsArray = $projectsHierarchy->getFamily($group_id, 'child', 
true, 'validated');
        if (is_array($projectIDsArray)) {
                $attrsInputIncludeSubprojects = array('type' => 'checkbox', 
'name'  => 'includesubprojects', 'value' => 1, 'title' => _('Search into childs 
following project hierarchy.'));
-               if ($subprojectsIncluded)
+               if ($subprojectsIncluded) {
                        $attrsInputIncludeSubprojects['checked'] = 'checked';
+               }
                echo html_e('p', array(), html_e('input', 
$attrsInputIncludeSubprojects)._('Include child projects'));
        }
 }
@@ -171,8 +173,9 @@ if (session_loggedin()) {
        $paging = (int)$LUSER->getPreference('paging');
 }
 
-if(!isset($paging) || !$paging)
+if(!isset($paging) || !$paging) {
        $paging = 25;
+}
 
 if ($searchString) {
        $docsHtmlSearchRenderer = new DocsHtmlSearchRenderer($searchString, 
$start, $isExact, $group_id, SEARCH__ALL_SECTIONS, $paging, $search_options);

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

Summary of changes:
 src/bin/systasks_wait_until_empty.php              |  4 +-
 src/common/dao/CodendiDataAccess.class.php         |  4 --
 src/common/diary/DiaryFactory.class.php            |  1 -
 src/common/diary/DiaryNote.class.php               |  7 ++-
 src/common/docman/Document.class.php               | 12 +++---
 src/common/docman/DocumentFactory.class.php        |  2 +-
 src/common/docman/DocumentGroup.class.php          | 50 +++++++++++-----------
 src/common/docman/DocumentManager.class.php        | 26 ++++++-----
 src/common/docman/DocumentReview.class.php         |  2 +-
 src/common/docman/DocumentReviewComment.class.php  |  5 +--
 src/common/docman/DocumentVersion.class.php        |  4 +-
 src/common/docman/DocumentVersionFactory.class.php |  1 -
 src/common/docman/actions/addfile.php              |  8 ++--
 src/common/docman/actions/editdocgroup.php         |  4 +-
 src/common/docman/engine/parser_html.php           | 16 +++----
 src/common/docman/engine/parser_pdf.inc.php        |  8 ++--
 src/common/docman/engine/parser_pdf.php            |  4 +-
 src/common/docman/engine/parser_text.inc.php       | 14 +++---
 src/common/docman/engine/parser_text.php           |  4 +-
 .../docman/engine/parser_unoconv_document.php      |  4 +-
 .../docman/engine/parser_unoconv_presentation.php  |  8 ++--
 .../docman/engine/parser_unoconv_spreadsheet.php   |  8 ++--
 src/common/docman/include/webdav.php               | 43 +++++++++----------
 src/common/docman/views/addfile.php                |  4 +-
 src/common/docman/views/listfile.php               | 16 +++----
 src/common/docman/views/listtrashfile.php          |  8 ++--
 src/common/docman/views/reporting.php              | 10 +++--
 src/common/docman/views/search.php                 |  9 ++--
 src/common/forum/AttachManager.class.php           | 23 +++-------
 src/common/forum/ForumAdmin.class.php              | 23 ++++------
 src/common/forum/ForumFactory.class.php            | 18 ++++----
 src/common/forum/ForumHTML.class.php               | 28 ++++++------
 src/common/forum/ForumMessage.class.php            |  5 +--
 33 files changed, 176 insertions(+), 207 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to