3 * FusionForge Documentation Manager
5 * Copyright 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 $g; // the group object
28 global $dirid; // id of doc_group
29 global $HTML; // Layout object
30 global $nested_pending_docs;
32 if (!forge_check_perm('docman', $g->getID(), 'approve')) {
33 $return_msg= _('Document Manager Access Denied');
34 session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
37 if (!isset($nested_pending_docs)) {
38 echo '<p class="information">'._('No pending documents.').'</p>';
42 <script language="JavaScript" type="text/javascript">/* <![CDATA[ */
43 var controllerListPending;
45 jQuery(document).ready(function() {
46 controllerListPending = new DocManListFileController({
47 groupId: <?php echo $group_id ?>,
48 docManURL: '<?php util_make_uri("docman") ?>',
49 lockIntervalDelay: 60000, //in microsecond and if you change this value, please update the check value 600
54 if (isset($nested_pending_docs[$dirid]) && is_array($nested_pending_docs[$dirid])) {
55 echo '<div class="docmanDiv">';
56 echo '<h4>'._('Pending files').'</h4>';
57 $tabletop = array('<input id="checkallpending" type="checkbox" onchange="controllerListPending.checkAll(\'checkeddocidpending\', \'pending\')" />', '', _('Filename'), _('Title'), _('Description'), _('Author'), _('Last time'), _('Status'), _('Size'), _('Actions'));
58 $classth = array('unsortable', 'unsortable', '', '', '', '', '', '', '', 'unsortable');
59 echo $HTML->listTableTop($tabletop, false, 'sortable_docman_listfile', 'sortable', $classth);
61 foreach ($nested_pending_docs[$dirid] as $d) {
64 echo '<input type="checkbox" value="'.$d->getID().'" class="checkeddocidpending" onchange="controllerListPending.checkgeneral(\'pending\')" />';
66 switch ($d->getFileType()) {
68 $docurl = $d->getFileName();
72 $docurl = util_make_uri('/docman/view.php/'.$g->getID().'/'.$d->getID().'/'.urlencode($d->getFileName()));
75 echo '<td><a href="'.$docurl.'" class="tabtitle-nw" title="'._('View this document').'" >';
76 echo html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType()));;
79 if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
80 $html_image_attr = array();
81 $html_image_attr['alt'] = _('new');
82 $html_image_attr['class'] = 'docman-newdocument';
83 $html_image_attr['title'] = _('Created or updated since less than 7 days');
84 echo html_image('docman/new.png', '14', '14', $html_image_attr);
86 echo ' '.$d->getFileName();
88 echo '<td>'.$d->getName().'</td>';
89 echo '<td>'.$d->getDescription().'</td>';
90 echo '<td>'.make_user_link($d->getCreatorUserName(), $d->getCreatorRealName()).'</td>';
92 if ( $d->getUpdated() ) {
93 echo date(_('Y-m-d H:i'), $d->getUpdated());
95 echo date(_('Y-m-d H:i'), $d->getCreated());
99 echo $d->getStateName().'</td>';
101 switch ($d->getFileType()) {
107 echo human_readable_bytes($d->getFileSize());
114 echo '<a class="tabtitle-ne" href="#" onclick="javascript:controllerListPending.toggleEditFileView(\''.$d->getID().'\')" title="'. _('Edit this document') .'" >'.html_image('docman/edit-file.png', 22, 22, array('alt'=>_('Edit this document'))). '</a>';
117 echo '<tr id="docid'.$d->getID().'" class="docman_editfile_nodisplay" ><td colspan="10" >';
121 echo $HTML->listTableBottom();
123 echo '<span id="docman-massactionpendingmessage" class="tabtitle-nw" title="'. _('Actions availables for checked files, you need to check at least one file to get actions') . '">';
124 echo _('Mass actions for selected pending files:');
126 echo '<span id="massactionpending" class="docman-massaction-hide" style="display:none;" >';
127 echo '<a class="tabtitle" href="#" onclick="window.location.href=\'/docman/view.php/'.$g->getID().'/zip/selected/'.$dirid.'/\'+controllerListPending.buildUrlByCheckbox(\'pending\')" title="'. _('Download as a zip') . '" >' . html_image('docman/download-directory-zip.png', 22, 22, array('alt'=>'Download as Zip')). '</a>';
128 echo '<a class="tabtitle" href="#" onclick="window.location.href=\'?group_id='.$group_id.'&action=validatefile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListPending.buildUrlByCheckbox(\'pending\')" title="'. _('Activate in this directory') . '" >' . html_image('docman/validate.png', 22, 22, array('alt'=>'Activate in this directory')). '</a>';