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  d59192aa3d3c1fa579a262d148fa56d02f4fb97a (commit)
      from  fb878748146dd39aef85af4cfc121b5906287ebc (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=d59192aa3d3c1fa579a262d148fa56d02f4fb97a

commit d59192aa3d3c1fa579a262d148fa56d02f4fb97a
Author: Franck Villaume <[email protected]>
Date:   Sun Oct 23 19:25:59 2016 +0200

    Association: support Document to add association

diff --git a/src/common/docman/actions/editfile.php 
b/src/common/docman/actions/editfile.php
index 6f13367..f73827a 100644
--- a/src/common/docman/actions/editfile.php
+++ b/src/common/docman/actions/editfile.php
@@ -73,6 +73,7 @@ $current_version_radio = 
getIntFromRequest('doc_version_cv_radio');
 $current_version = getIntFromRequest('current_version', 0);
 $version = getIntFromRequest('edit_version', 0);
 $new_version = getIntFromRequest('new_version', 0);
+$newobjectsassociation = getStringFromRequest('newobjectsassociation');
 
 if (!$docid) {
        $warning_msg = _('No document found to update');
@@ -162,6 +163,13 @@ if ($version) {
        $vcomment = $dv->getComment();
        $version = $current_version_radio;
        $current_version = 1;
+} elseif ($newobjectsassociation) {
+       if (!$d->addAssociations($newobjectsassociation)) {
+               $error_msg = $d->getErrorMessage();
+       } else {
+               $feedback = sprintf(_('Document [D%s] updated successfully.'), 
$d->getID());
+       }
+       session_redirect($urlparam);
 } else {
        $warning_msg = _('No action to perform');
        session_redirect($urlparam);
diff --git a/src/common/include/FFObject.class.php 
b/src/common/include/FFObject.class.php
index b4e8e0f..af9d5f7 100644
--- a/src/common/include/FFObject.class.php
+++ b/src/common/include/FFObject.class.php
@@ -343,8 +343,7 @@ class FFObject extends FFError {
 
        function showAddAssociations($url = false) {
                global $HTML;
-               $content = '';
-               echo _('Add new associate object')._(':');
+               $content = html_ao('span', array()). _('Add new associate 
object')._(':');
                if ($url !== false) {
                        $content .= $HTML->openForm(array('action' => $url, 
'method' => 'post'));
                }
@@ -353,6 +352,7 @@ class FFObject extends FFError {
                        $content .= html_e('input', array('type' => 'submit', 
'value' => _('Add')));
                        $content .= $HTML->closeForm();
                }
+               $content .= html_ac(html_ap() -1);
                return $content;
        }
 }
diff --git a/src/www/docman/scripts/DocManController.js 
b/src/www/docman/scripts/DocManController.js
index b01ae10..b605b07 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -441,10 +441,12 @@ DocManListFileController.prototype =
                        }, this));
 
                jQuery.getJSON(this.listfileparams.docManURL + '/?group_id=' + 
docid_groupid + '&action=getassociations&docid='+ this.docparams.id, 
jQuery.proxy(function(data){
-                       if (typeof data.html != 'undefined') {
+                               if (typeof data.html != 'undefined') {
                                        jQuery('#tabbereditfile-association > 
.feedback').remove();
                                        jQuery('#tabbereditfile-association > 
.error').remove();
                                        jQuery('#tabbereditfile-association > 
.warning_msg').remove();
+                                       jQuery('#tabbereditfile-association > 
table').remove();
+                                       jQuery('#tabbereditfile-association > 
span').remove();
                                        
jQuery('#tabbereditfile-association').prepend(data.html);
                                }
                        }, this));

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

Summary of changes:
 src/common/docman/actions/editfile.php     | 8 ++++++++
 src/common/include/FFObject.class.php      | 4 ++--
 src/www/docman/scripts/DocManController.js | 4 +++-
 3 files changed, 13 insertions(+), 3 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