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  cd113f8fb90dbafdc6dd371de440ea24234eaaf9 (commit)
      from  43ceb455bd7171d4273b321a0b16b6118806de41 (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=cd113f8fb90dbafdc6dd371de440ea24234eaaf9

commit cd113f8fb90dbafdc6dd371de440ea24234eaaf9
Author: Franck Villaume <[email protected]>
Date:   Sun Dec 18 19:36:38 2016 +0100

    document review: support user to set his review status

diff --git a/src/common/docman/DocumentReview.class.php 
b/src/common/docman/DocumentReview.class.php
index 0f29702..b948ce2 100644
--- a/src/common/docman/DocumentReview.class.php
+++ b/src/common/docman/DocumentReview.class.php
@@ -344,6 +344,10 @@ class DocumentReview extends FFError {
                $cells[][] = html_e('textarea', array('id' => 'review-comment', 
'name' => 'review-comment', 'style' => 'width: 100%; box-sizing: border-box;', 
'rows' => 3, 'required' => 'required', 'pattern' => '.{10,}', 'placeholder' => 
_('Add your comment').' '.sprintf(_('(at least %s characters)'), 
DOCMAN__REVIEW_DESCRIPTION_MIN_SIZE), 'maxlength' => 
DOCMAN__REVIEW_DESCRIPTION_MAX_SIZE), '', false);
                $return .= $HTML->multiTableRow(array(), $cells);
                $cells = array();
+               $cells[][] = _('Review done')._(':');
+               $cells[][] = html_e('input', array('type' => 'checkbox', 'name' 
=> 'review-done', 'value' => 1 ,'title' => _('Tick if you want to set your 
pending review done as reviewer.')));
+               $return .= $HTML->multiTableRow(array(), $cells);
+               $cells = array();
                $cells[][] = _('Attachment')._(':');
                $cells[][] = html_e('input', array('type' => 'file', 'name' => 
'review-attachment')).html_e('br').'('._('max upload size')._(': 
').human_readable_bytes(util_get_maxuploadfilesize()).')';
                $return .= $HTML->multiTableRow(array(), $cells);
@@ -661,4 +665,14 @@ class DocumentReview extends FFError {
                        return false;
                }
        }
+
+       function setUserDone($userid, $updatedate) {
+               $res = db_query_params('UPDATE doc_review_users SET (statusid, 
updatedate) = ($1, $2) WHERE revid = $3 and userid = $4', array(2, $updatedate, 
$this->getID(), $userid));
+               if ($res) {
+                       return true;
+               } else {
+                       $this->setError(db_error());
+                       return false;
+               }
+       }
 }
diff --git a/src/common/docman/actions/editfile.php 
b/src/common/docman/actions/editfile.php
index 08c1d59..ae545e4 100644
--- a/src/common/docman/actions/editfile.php
+++ b/src/common/docman/actions/editfile.php
@@ -201,6 +201,7 @@ switch ($subaction) {
                $reviewcurrentversion = 
getIntFromRequest('review-currentversion');
                $reviewnewcomment = getIntFromRequest('review_newcomment');
                $reviewcomment = getStringFromRequest('review-comment');
+               $reviewdone = getIntFromRequest('review-done');
                if ($reviewversionserialid) {
                        if ($new_review) {
                                $dr = new DocumentReview($d);
@@ -212,7 +213,11 @@ switch ($subaction) {
                        } elseif ($reviewnewcomment) {
                                $dr = new DocumentReview($d, $reviewid);
                                $drc = new DocumentReviewComment($dr);
-                               if ($drc->create(user_getid(), $reviewid, 
$reviewcomment, time())) {
+                               $now = time();
+                               if ($drc->create(user_getid(), $reviewid, 
$reviewcomment, $now)) {
+                                       if ($reviewdone) {
+                                               $dr->setUserDone(user_getid(), 
$now);
+                                       }
                                        $feedback = _('Review commented 
successfully');
                                } else {
                                        $error_msg = $drc->getErrorMessage();

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

Summary of changes:
 src/common/docman/DocumentReview.class.php | 14 ++++++++++++++
 src/common/docman/actions/editfile.php     |  7 ++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge

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

Reply via email to