3 * FusionForge Documentation Manager
5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * http://fusionforge.org
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 /* please do not add require here : use www/docman/index.php to add require */
25 /* global variables used */
26 global $group_id; // id of the group
27 global $dirid; //id of the doc_group
30 if (!forge_check_perm('docman', $group_id, 'submit')) {
31 $return_msg= _('Document Manager Access Denied');
32 session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
36 <script language="Javascript" type="text/javascript">//<![CDATA[
37 var controllerAddItem;
39 jQuery(document).ready(function() {
40 controllerAddItem = new DocManAddItemController({
41 divCreateDir: jQuery('#addsubdocgroup'),
42 divCreateDoc: jQuery('#addfile'),
43 divZipInject: jQuery('#zipinject'),
44 buttonDoc: jQuery('#buttonDoc'),
45 buttonDir: jQuery('#buttonDir'),
46 buttonZip: jQuery('#buttonZip')
51 <script language="Javascript" type="text/javascript">//<![CDATA[
52 function doItInject() {
53 document.getElementById('injectzip').submit();
54 document.getElementById('submitinjectzip').disabled = true;
58 echo '<div class="docmanDivIncluded" >';
59 echo '<input id="buttonDoc" type="radio" name="type" value="document" />';
60 echo '<label id="labelDoc" class="tabtitle-nw" title="'. _('Submit a new document in this folder.').'" >'. _('Submit a new document.') .'</label>';
61 if (forge_check_perm('docman', $group_id, 'approve')) {
62 echo '<input id="buttonDir" type="radio" name="type" value="folder" />';
63 echo '<label id="labelDir" class="tabtitle-nw" title="'. _('Create a folder based on this name.').'" >'. _('Add a new folder.') .'</label>';
64 echo '<input id="buttonZip" type="radio" name="type" value="zip" />';
65 echo '<label id="labelZip" class="tabtitle-w" title="'. _('Create a full folders tree using an compressed archive. Only zip format support.').'" >'. _('Inject Tree') . '</label>';
67 if (forge_check_perm('docman', $group_id, 'approve')) {
68 echo '<div class="docman_div_include" id="addsubdocgroup" style="display:none;">';
69 echo '<h4 class="docman_h4">'. _('Add a new sub folder') .'</h4>';
70 include ($gfcommon.'docman/views/addsubdocgroup.php');
73 echo '<div class="docman_div_include" id="addfile" style="display:none">';
74 echo '<h4 class="docman_h4">'. _('Add a new document') .'</h4>';
75 include ($gfcommon.'docman/views/addfile.php');
77 if (forge_check_perm('docman', $group_id, 'approve')) {
78 echo '<div class="docman_div_include" id="zipinject" style="display:none">';
79 echo '<h4 class="docman_h4">'. _('Inject a Tree') .'</h4>';
80 echo '<form id="injectzip" name="injectzip" method="post" action="?group_id='.$group_id.'&action=injectzip&dirid='.$dirid.'" enctype="multipart/form-data">';
82 echo '<label>' . _('Upload archive:') . ' </label><input type="file" name="uploaded_zip" size="30" />';
83 echo '<input id="submitinjectzip" type="button" value="'. _('Inject') .'" onclick="javascript:doItInject()" />';