3 * FusionForge Documentation Manager
5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright 2012-2013, 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 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 injectZip: jQuery('#injectzip'),
46 submitZip: jQuery('#submitinjectzip')
50 jQuery(document).ready(function() {
51 jQuery("#tabs").tabs();
57 <li><a href="#tabs-new-document" class="tabtitle" title="<?php echo _('Submit a new document in this folder.') ?>">
58 <?php echo _('New Document') ?></a></li>
59 <li><a href="#tabs-new-folder" class="tabtitle" title="<?php echo _('Create a folder based on this name.') ?>">
60 <?php echo _('New Folder') ?></a></li>
61 <li><a href="#tabs-inject-tree" class="tabtitle" title="<?php echo _('Create a full folders tree using an compressed archive. Only zip format support.') ?>">
62 <?php echo _('Inject Tree') ?></a></li>
66 echo '<div id="tabs-new-document">';
67 echo '<div class="docman_div_include" id="addfile">';
68 include ($gfcommon.'docman/views/addfile.php');
72 echo '<div id="tabs-new-folder">';
73 if (forge_check_perm('docman', $group_id, 'approve')) {
74 echo '<div class="docman_div_include" id="addsubdocgroup">';
75 include ($gfcommon.'docman/views/addsubdocgroup.php');
80 echo '<div id="tabs-inject-tree">';
81 if (forge_check_perm('docman', $group_id, 'approve')) {
82 echo '<div class="docman_div_include" id="zipinject">';
83 echo '<form id="injectzip" name="injectzip" method="post" action="?group_id='.$group_id.'&action=injectzip&dirid='.$dirid.'" enctype="multipart/form-data">';
85 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()));
86 echo '<input id="submitinjectzip" type="button" value="'. _('Inject Tree') .'" onclick="javascript:doItInject()" />';