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