[Fusionforge-commits] FusionForge branch master updated. 6.0.4-1226-g3245e6a

Franck Villaume nerville at libremir.placard.fr.eu.org
Wed Dec 7 07:35:45 CET 2016


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  3245e6a6a4f34fa4c990731f47c7220eddfc62aa (commit)
      from  031934441b35c26ed15c8d3032be826274384cdd (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=3245e6a6a4f34fa4c990731f47c7220eddfc62aa

commit 3245e6a6a4f34fa4c990731f47c7220eddfc62aa
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Dec 7 07:35:19 2016 +0100

    docman: implement complete. part 2

diff --git a/src/common/docman/DocumentReviewComment.class.php b/src/common/docman/DocumentReviewComment.class.php
new file mode 100644
index 0000000..e87e6ba
--- /dev/null
+++ b/src/common/docman/DocumentReviewComment.class.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2016, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+class DocumentReviewComment extends FFError {
+}
diff --git a/src/common/docman/DocumentReviewCommentFactory.class.php b/src/common/docman/DocumentReviewCommentFactory.class.php
new file mode 100644
index 0000000..6e925fc
--- /dev/null
+++ b/src/common/docman/DocumentReviewCommentFactory.class.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2016, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+class DocumentReviewCommentFactory extends FFError {
+	/**
+	 * The DocumentReview object.
+	 *
+	 * @var	object	$DocumentReview
+	 */
+	var $DocumentReview;
+
+	function __construct(&$DocumentReview) {
+		parent::__construct();
+		if (!$DocumentReview || !is_object($DocumentReview)) {
+			$this->setError(_('No Valid DocumentReview Object'));
+			return false;
+		}
+		if ($DocumentReview->isError()) {
+			$this->setError(_('DocumentReview')._(': ').$DocumentReview->getErrorMessage());
+			return false;
+		}
+		$this->DocumentReview =& $DocumentReview;
+		return true;
+	}
+
+	function getNbComments() {
+		$res = db_query_params('SELECT COUNT(commentid) FROM doc_review_comments WHERE revid = $1', array($this->DocumentReview->getID()));
+		if ($res) {
+			return db_result($res, 0, 0);
+		}
+		return null;
+	}
+
+	function getComments() {
+		return array();
+	}
+}
diff --git a/src/common/docman/DocumentReviewStorage.class.php b/src/common/docman/DocumentReviewStorage.class.php
new file mode 100644
index 0000000..485c453
--- /dev/null
+++ b/src/common/docman/DocumentReviewStorage.class.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * FusionForge Document Manager Review Storage Class
+ *
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2016, 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
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *
+ * "The Artifact ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+
+require_once $gfcommon.'include/Storage.class.php';
+
+class DocumentReviewStorage extends Storage {
+	protected static $_instance;
+	public static function instance() {
+		if (!isset(self::$_instance)) {
+			$c = __CLASS__;
+			self::$_instance = new $c;
+		}
+		return self::$_instance;
+	}
+
+	function get_storage_path() {
+		return forge_get_config('data_path').'/docmanreview';
+	}
+}
+
diff --git a/src/common/docman/actions/getdocreviewcompleteform.php b/src/common/docman/actions/getdocreviewcompleteform.php
new file mode 100644
index 0000000..492722c
--- /dev/null
+++ b/src/common/docman/actions/getdocreviewcompleteform.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2016, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* please do not add require here : use www/docman/index.php to add require */
+/* global variables used */
+global $group_id; // id of group
+global $HTML;
+
+$sysdebug_enable = false;
+$result = array();
+
+if (!forge_check_perm('docman', $group_id, 'approve')) {
+	$result['html'] = $HTML->error_msg(_('Document Manager Action Denied.'));
+	echo json_encode($result);
+	exit;
+}
+
+$docid = getIntFromRequest('docid');
+$revid = getIntFromRequest('revid');
+if ($docid & $revid) {
+	$documentObject = document_get_object($docid, $group_id);
+	if ($documentObject && !$documentObject->isError()) {
+		$dr = new DocumentReview($documentObject, $revid);
+		if ($dr && !$dr->isError()) {
+			$result['html'] .= $dr->showCompleteFormHTML();
+		} else {
+			$result['html'] = $HTML->warning_msg(_('Cannot retrieve review')._(': ').$revid);
+		}
+	} else {
+		$result['html'] = $HTML->warning_msg(_('Cannot retrieve document')._(': ').$docid);
+	}
+} else {
+	$result['html'] = $HTML->warning_msg(_('No document ID or no review id. Cannot retrieve inforamtion.'));
+}
+
+echo json_encode($result);
+exit;
diff --git a/src/common/docman/actions/getdocreviewuserstatus.php b/src/common/docman/actions/getdocreviewuserstatus.php
new file mode 100644
index 0000000..c3483aa
--- /dev/null
+++ b/src/common/docman/actions/getdocreviewuserstatus.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2016, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* please do not add require here : use www/docman/index.php to add require */
+/* global variables used */
+global $group_id; // id of group
+global $HTML;
+
+$sysdebug_enable = false;
+$result = array();
+
+if (!forge_check_perm('docman', $group_id, 'approve')) {
+	$result['html'] = $HTML->error_msg(_('Document Manager Action Denied.'));
+	echo json_encode($result);
+	exit;
+}
+
+$docid = getIntFromRequest('docid');
+$revid = getIntFromRequest('revid');
+if ($docid & $revid) {
+	$documentObject = document_get_object($docid, $group_id);
+	if ($documentObject && !$documentObject->isError()) {
+		$dr = new DocumentReview($documentObject, $revid);
+		if ($dr && !$dr->isError()) {
+			$result['html'] .= $dr->showUsersStatusHTML();
+		} else {
+			$result['html'] = $HTML->warning_msg(_('Cannot retrieve review')._(': ').$revid);
+		}
+	} else {
+		$result['html'] = $HTML->warning_msg(_('Cannot retrieve document')._(': ').$docid);
+	}
+} else {
+	$result['html'] = $HTML->warning_msg(_('No document ID or no review id. Cannot retrieve inforamtion.'));
+}
+
+echo json_encode($result);
+exit;

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

Summary of changes:
 .../docman/DocumentReviewComment.class.php}        | 10 ++--
 .../docman/DocumentReviewCommentFactory.class.php  | 57 ++++++++++++++++++++++
 ...e.class.php => DocumentReviewStorage.class.php} |  9 ++--
 ...ocversions.php => getdocreviewcompleteform.php} | 16 +++---
 ...tdocversions.php => getdocreviewuserstatus.php} | 16 +++---
 5 files changed, 80 insertions(+), 28 deletions(-)
 copy src/{plugins/mantisbt/view/admin/StatPerMember.php => common/docman/DocumentReviewComment.class.php} (85%)
 create mode 100644 src/common/docman/DocumentReviewCommentFactory.class.php
 copy src/common/docman/{DocumentStorage.class.php => DocumentReviewStorage.class.php} (91%)
 copy src/common/docman/actions/{getdocversions.php => getdocreviewcompleteform.php} (79%)
 copy src/common/docman/actions/{getdocversions.php => getdocreviewuserstatus.php} (79%)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list