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  60a84789e0f318cbf26e845a6ca309d9804d2d1f (commit)
      from  28451f934c304dac83ec7c2966bd2bc13a470e61 (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=60a84789e0f318cbf26e845a6ca309d9804d2d1f

commit 60a84789e0f318cbf26e845a6ca309d9804d2d1f
Author: Franck Villaume <[email protected]>
Date:   Wed Feb 17 15:00:51 2016 +0100

    docman: upload archive. fix when no existing folder

diff --git a/src/common/docman/views/addfile.php 
b/src/common/docman/views/addfile.php
index 5e0a748..7d93fc5 100644
--- a/src/common/docman/views/addfile.php
+++ b/src/common/docman/views/addfile.php
@@ -36,6 +36,7 @@ global $HTML; // Layout object
 global $warning_msg;
 global $error_msg;
 global $childgroup_id;
+global $stateidArr;
 
 $actionurl = '/docman/?group_id='.$group_id.'&action=addfile&dirid='.$dirid;
 $redirecturl = '/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid;
@@ -77,10 +78,6 @@ jQuery(document).ready(function() {
 <?php
 echo html_ac(html_ap() - 1);
 echo html_ao('div', array('class' => 'docmanDivIncluded'));
-$stateidArr = array(1);
-if (forge_check_perm('docman', $group_id, 'approve')) {
-       $stateidArr[] = 5;
-}
 if ($dgf->getNested($stateidArr) == NULL) {
        $dg = new DocumentGroup($g);
 
diff --git a/src/common/docman/views/additem.php 
b/src/common/docman/views/additem.php
index c007721..eace0a4 100644
--- a/src/common/docman/views/additem.php
+++ b/src/common/docman/views/additem.php
@@ -3,7 +3,7 @@
  * FusionForge Documentation Manager
  *
  * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2012-2015, Franck Villaume - TrivialDev
+ * Copyright 2012-2016, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -35,6 +35,11 @@ if (!forge_check_perm('docman', $group_id, 'submit')) {
        session_redirect('/docman/?group_id='.$group_id);
 }
 
+$stateidArr = array(1);
+if (forge_check_perm('docman', $group_id, 'approve')) {
+       $stateidArr[] = 5;
+}
+
 echo html_ao('script', array('type' => 'text/javascript'));
 ?>
 //<![CDATA[
@@ -73,14 +78,18 @@ if (forge_check_perm('docman', $group_id, 'approve')) {
        echo html_ac(html_ap() -2);
        echo html_ao('div', array('id' => 'tabs-inject-tree'));
        echo html_ao('div', array('class' => 'docman_div_include', 'id' => 
'zipinject'));
-       echo $HTML->openForm(array('id' => 'injectzip', 'name' => 'injectzip', 
'method' => 'post', 'action' => 
util_make_uri('/docman/?group_id='.$group_id.'&action=injectzip&dirid='.$dirid),
 'enctype' => 'multipart/form-data'));
-       echo html_ao('p');
-       echo html_e('label', array(), _('Upload archive:'), false);
-       echo html_e('input', array('type' => 'file', 'name' => 'uploaded_zip', 
'required' => 'required'));
-       echo html_e('span', array(), sprintf(_('(max upload size: 
%s)'),human_readable_bytes(util_get_maxuploadfilesize())), false);
-       echo html_e('input', array('id' => 'submitinjectzip', 'type' => 
'button', 'value' => _('Inject Tree')));
-       echo html_ac(html_ap() -1);
-       echo $HTML->closeForm();
+       if ($dgf->getNested($stateidArr) == NULL) {
+               echo $HTML->warning_msg(_('You MUST first create at least one 
folder to upload your archive.'));
+       } else {
+               echo $HTML->openForm(array('id' => 'injectzip', 'name' => 
'injectzip', 'method' => 'post', 'action' => 
util_make_uri('/docman/?group_id='.$group_id.'&action=injectzip&dirid='.$dirid),
 'enctype' => 'multipart/form-data'));
+               echo html_ao('p');
+               echo html_e('label', array(), _('Upload archive:'), false);
+               echo html_e('input', array('type' => 'file', 'name' => 
'uploaded_zip', 'required' => 'required'));
+               echo html_e('span', array(), sprintf(_('(max upload size: 
%s)'),human_readable_bytes(util_get_maxuploadfilesize())), false);
+               echo html_e('input', array('id' => 'submitinjectzip', 'type' => 
'button', 'value' => _('Inject Tree')));
+               echo html_ac(html_ap() -1);
+               echo $HTML->closeForm();
+       }
        echo html_ac(html_ap() -2);
 }
 

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

Summary of changes:
 src/common/docman/views/addfile.php |  5 +----
 src/common/docman/views/additem.php | 27 ++++++++++++++++++---------
 2 files changed, 19 insertions(+), 13 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