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 65f330c070f5aceb436f88e548d962fd44684abc (commit)
from 0bd0ec1194263c87b03f76bd6dda244b2d2559c4 (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=65f330c070f5aceb436f88e548d962fd44684abc
commit 65f330c070f5aceb436f88e548d962fd44684abc
Author: Franck Villaume <[email protected]>
Date: Mon Oct 24 21:16:08 2016 +0200
Associations: document remove association support
diff --git a/src/common/docman/actions/deleteassociations.php
b/src/common/docman/actions/deleteassociations.php
new file mode 100644
index 0000000..f342c9c
--- /dev/null
+++ b/src/common/docman/actions/deleteassociations.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * FusionForge Docman: Delete association Action
+ *
+ * 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 $g; // Group object
+global $group_id; // id of group
+global $childgroup_id; // id of child group if any
+global $HTML;
+global $feedback;
+global $error_msg;
+global $warning_msg;
+
+$dirid = getIntFromRequest('dirid');
+$baseurl = '/docman/?group_id='.$group_id.'&dirid='.$dirid;
+// plugin projects-hierarchy handler
+if ($childgroup_id) {
+ $g = group_get_object($childgroup_id);
+ $baseurl .= '&childgroup_id='.$childgroup_id;
+}
+
+if (!forge_check_perm('docman', $g->getID(), 'submit')) {
+ $error_msg = _('Document Manager Action Denied.');
+ session_redirect($baseurl);
+}
+
+$docid = getIntFromRequest('docid');
+if ($docid) {
+ $documentObject = document_get_object($docid, $g->getID());
+ if ($documentObject && !$documentObject->isError()) {
+ $objectRefId = getStringFromRequest('objectrefid');
+ $objectId = getStringFromRequest('objectid');
+ $objectType = getStringFromRequest('objecttype');
+ $link = getStringFromRequest('link');
+ $was_error = false;
+ if ($link == 'to') {
+ if (!$documentObject->removeAssociationTo($objectId,
$objectRefId, $objectType)) {
+ $error_msg = $documentObject->getErrorMessage();
+ $was_error = true;
+ }
+ } elseif ($link == 'from') {
+ if (!$documentObject->removeAssociationFrom($objectId,
$objectRefId, $objectType)) {
+ $error_msg = $documentObject->getErrorMessage();
+ $was_error = true;
+ }
+ } elseif ($link == 'any') {
+ if (!$documentObject->removeAllAssociations()) {
+ $error_msg = $documentObject->getErrorMessage();
+ $was_error = true;
+ }
+ }
+ if (!$was_error) {
+ $feedback = _('Associations removed successfully');
+ }
+ } else {
+ $warning_msg = _('Cannot retrieve document')._(': ').$docid;
+ }
+} else {
+ $warning_msg = _('No document ID. Cannot retrieve versions.');
+}
+
+session_redirect($baseurl.'&filedetailid='.$docid);
diff --git a/src/common/docman/actions/getassociations.php
b/src/common/docman/actions/getassociations.php
index f2da3e4..713fb1d 100644
--- a/src/common/docman/actions/getassociations.php
+++ b/src/common/docman/actions/getassociations.php
@@ -39,7 +39,7 @@ $docid = getIntFromRequest('docid');
if ($docid) {
$documentObject = document_get_object($docid, $group_id);
if ($documentObject && !$documentObject->isError()) {
- $result['html'] =
$documentObject->showAssociations('/docman/?group_id='.$group_id.'&action=deleteassociations&docid='.$docid);
+ $result['html'] =
$documentObject->showAssociations('/docman/?action=deleteassociations&group_id='.$group_id.'&dirid='.$documentObject->getDocGroupID().'&docid='.$docid);
$result['html'] .= $documentObject->showAddAssociations();
} else {
$result['html'] = $HTML->warning_msg(_('Cannot retrieve
document')._(': ').$docid);
-----------------------------------------------------------------------
Summary of changes:
src/common/docman/actions/deleteassociations.php | 82 ++++++++++++++++++++++++
src/common/docman/actions/getassociations.php | 2 +-
2 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 src/common/docman/actions/deleteassociations.php
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits