* Copyright (C) 2010 Alcatel-Lucent
* Copyright 2010-2011, Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
* http://fusionforge.org
*
- * This file is part of FusionForge.
- *
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
*
* FusionForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* please do not add require here : use www/docman/index.php to add require */
/* global variables used */
global $group_id; // id of the group
global $dirid; // id of doc_group
-global $dgf; // document group factory
global $HTML; // Layout object
global $u; // User object
-global $use_tooltips; // enable or not tooltips in docman
global $g; // the Group object
+$linkmenu = 'listfile';
+$baseredirecturl = '/docman/?group_id='.$group_id;
+$redirecturl = $baseredirecturl.'&view=listfile&dirid='.$dirid;
+$actionlistfileurl = '?group_id='.$group_id.'&view=listfile&dirid='.$dirid;
if (!forge_check_perm('docman', $group_id, 'read')) {
$return_msg= _('Document Manager Access Denied');
- session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
+ session_redirect($baseredirecturl.'&warning_msg='.urlencode($return_msg));
}
-$treesize = getIntFromRequest('tree');
+echo '<div id="left" style="float:left; width:17%; min-width: 50px; overflow: auto;">';
+include ($gfcommon.'docman/views/tree.php');
+echo '</div>';
+
+// plugin projects_hierarchy
+$childgroup_id = getIntFromRequest('childgroup_id');
+if ($childgroup_id) {
+ if (!forge_check_perm('docman', $childgroup_id, 'read')) {
+ $return_msg= _('Document Manager Access Denied');
+ session_redirect($baseredirecturl.'&warning_msg='.urlencode($return_msg));
+ }
+ $redirecturl .= '&childgroup_id='.$childgroup_id;
+ $actionlistfileurl .= '&childgroup_id='.$childgroup_id;
+ $g = group_get_object($childgroup_id);
+}
+
+$df = new DocumentFactory($g);
+if ($df->isError())
+ exit_error($df->getErrorMessage(), 'docman');
+
+$dgf = new DocumentGroupFactory($g);
+if ($dgf->isError())
+ exit_error($dgf->getErrorMessage(), 'docman');
+
+$dgh = new DocumentGroupHTML($g);
+if ($dgh->isError())
+ exit_error($dgh->getErrorMessage(), 'docman');
$df->setDocGroupID($dirid);
-/**
- * var must be named d_arr & nested_groups
- * because used by tree.php
- */
-$d_arr =& $df->getDocuments();
+$df->setStateID('1');
+$d_arr_active =& $df->getDocuments();
+if ($d_arr_active != NULL)
+ $d_arr = $d_arr_active;
+
+$df->setStateID('4');
+$d_arr_hidden =& $df->getDocuments();
+if ($d_arr != NULL && $d_arr_hidden != NULL) {
+ $d_arr = array_merge($d_arr, $d_arr_hidden);
+} else if ($d_arr_hidden != NULL) {
+ $d_arr = $d_arr_hidden;
+}
+
+$df->setStateID('5');
+$d_arr_private =& $df->getDocuments();
+if ($d_arr != NULL && $d_arr_private != NULL) {
+ $d_arr = array_merge($d_arr, $d_arr_private);
+} else if ($d_arr_private != NULL) {
+ $d_arr = $d_arr_private;
+}
+
$nested_groups = $dgf->getNested();
-$linkmenu = 'listfile';
$nested_docs = array();
$DocGroupName = 0;
if ($dirid) {
- $ndg = new DocumentGroup($g,$dirid);
+ $ndg = new DocumentGroup($g, $dirid);
$DocGroupName = $ndg->getName();
+ $dgpath = $ndg->getPath(true, false);
if (!$DocGroupName) {
- session_redirect('/docman/?group_id='.$group_id.'&error_msg='.urlencode($g->getErrorMessage()));
+ session_redirect($baseredirecturl.'&error_msg='.urlencode($g->getErrorMessage()));
+ }
+ if ($ndg->getState() != 1) {
+ $error_msg = _('Invalid folder');
+ session_redirect($baseredirecturl.'&view=listfile&error_msg='.urlencode($error_msg));
}
}
}
}
+$df->setStateID('3');
+$d_pending_arr =& $df->getDocuments();
+$nested_pending_groups =& $dgf->getNested();
+
+if ($d_pending_arr != NULL ) {
+ if (!$d_pending_arr || count($d_pending_arr) > 0) {
+ // Get the document groups info
+ //put the doc objects into an array keyed off the docgroup
+ foreach ($d_pending_arr as $doc) {
+ $nested_pending_docs[$doc->getDocGroupID()][] = $doc;
+ }
+ }
+}
+
?>
-<script type="text/javascript">
+<script language="JavaScript" type="text/javascript">/* <![CDATA[ */
var controllerListFile;
jQuery(document).ready(function() {
controllerListFile = new DocManListFileController({
groupId: <?php echo $group_id ?>,
- tipsyElements: [
- {selector: '#docman-additem', options:{delayIn: 500, delayOut: 0, fade: true}},
- {selector: '#docman-editdirectory', options:{delayIn: 500, delayOut: 0, fade: true}},
- {selector: '#docman-deletedirectory', options:{delayIn: 500, delayOut: 0, fade: true}},
- {selector: '#docman-trashdirectory', options:{delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-downloadaszip', options:{delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-viewfile', options:{gravity: 'nw', delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-reserveddocument', options:{delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-movetotrash', options:{gravity: 'ne', delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-editfile', options:{gravity: 'ne', delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-releasereservation', options:{gravity: 'ne',delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-reservefile', options:{gravity: 'ne', delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-monitorfile', options:{gravity: 'ne', delayIn: 500, delayOut: 0, fade: true}},
- {selector: '.docman-newdocument', options:{gravity: 'ne', delayIn: 500, delayOut: 0, fade: true}}
- ],
-
divAddItem: jQuery('#additem'),
divEditDirectory: jQuery('#editdocgroup'),
buttonAddItem: jQuery('#docman-additem'),
buttonEditDirectory: jQuery('#docman-editdirectory'),
docManURL: '<?php util_make_uri("docman") ?>',
- lockIntervalDelay: 60000, //in microsecond and if you change this value, please update the check value 600
+ lockIntervalDelay: 60000, //in millisecond and if you change this value, please update the check value 600
divLeft: jQuery('#left'),
divHandle: jQuery('#handle'),
divRight: jQuery('#right'),
- treesize: '<?php echo $treesize ?>'
+ childGroupId: <?php echo util_ifsetor($childgroup_id, 0) ?>
});
});
-</script>
+/* ]]> */</script>
<?php
-echo '<div id="left" style="float:left; width:17%; min-width: 50px;">';
-include ($gfcommon.'docman/views/tree.php');
-echo '</div>';
echo '<div id="handle" style="float:left; height:100px; margin:3px; width:3px; background: #000; cursor:e-resize;"></div>';
echo '<div id="right" style="float:left; width: 80%; overflow: auto; max-width: 90%;">';
if ($DocGroupName) {
- echo '<h3 class="docman_h3" >Directory : <i>'.$DocGroupName.'</i> ';
- if (forge_check_perm('docman', $group_id, 'approve')) {
- echo '<a href="#" id="docman-editdirectory" ';
- if ($use_tooltips)
- echo 'title="'._('Edit this directory').'"';
-
- echo ' >'. html_image('docman/configure-directory.png',22,22,array('alt'=>'edit')). '</a>';
- echo '<a href="?group_id='.$group_id.'&action=trashdir&dirid='.$dirid.'" id="docman-trashdirectory" ';
- if ($use_tooltips)
- echo 'title="'._('Move this directory and his content to trash').'" ';
- echo '>'. html_image('docman/trash-empty.png',22,22,array('alt'=>'trashdir')). '</a>';
- if (!isset($nested_docs[$dirid]) && !isset($nested_groups[$dirid])) {
- echo '<a href="?group_id='.$group_id.'&action=deldir&dirid='.$dirid.'" id="docman-deletedirectory" ';
- if ($use_tooltips)
- echo ' title="'._('Permanently delete this directory').'" ';
-
- echo '>'. html_image('docman/delete-directory.png',22,22,array('alt'=>'deldir')). '</a>';
+ $headerPath = '<h4>';
+ if ($childgroup_id)
+ $headerPath .= _('Subproject').' '.':'.' '.util_make_link('/docman/?group_id='.$g->getID(),$g->getPublicName()).' ';
+
+ $headerPath .= _('Path:').' <i>'.$dgpath.'</i></h4>';
+ echo $headerPath;
+ echo '<h3 class="docman_h3" >'._('Document Folder:').' <i>'.$DocGroupName.'</i> ';
+ if (forge_check_perm('docman', $ndg->Group->getID(), 'approve')) {
+ echo '<a href="#" class="tabtitle" id="docman-editdirectory" title="'._('Edit this folder').'" >'. html_image('docman/configure-directory.png',22,22,array('alt'=>'edit')). '</a>';
+ echo '<a href="'.$actionlistfileurl.'&action=trashdir" class="tabtitle" id="docman-trashdirectory" title="'._('Move this folder and his content to trash').'" >'. html_image('docman/trash-empty.png',22,22,array('alt'=>'trashdir')). '</a>';
+ if (!isset($nested_docs[$dirid]) && !isset($nested_groups[$dirid]) && !isset($nested_pending_docs[$dirid])) {
+ echo '<a href="'.$actionlistfileurl.'&action=deldir" class="tabtitle" id="docman-deletedirectory" title="'._('Permanently delete this folder').'" >'. html_image('docman/delete-directory.png',22,22,array('alt'=>'deldir')). '</a>';
}
}
if (forge_check_perm('docman', $group_id, 'submit')) {
- echo '<a href="#" id="docman-additem" ';
- if ($use_tooltips)
- echo 'title="'. _('Add a new item in this directory') . '" ';
-
- echo '>'. html_image('docman/insert-directory.png',22,22,array('alt'=>'additem')). '</a>';
+ echo '<a href="#" class="tabtitle" id="docman-additem" title="'. _('Add a new item in this folder') . '" >'. html_image('docman/insert-directory.png',22,22,array('alt'=>'additem')). '</a>';
}
- echo '<a href="/docman/view.php/'.$group_id.'/zip/full/'.$dirid.'" ';
- if ($use_tooltips)
- echo 'class="docman-downloadaszip" title="'. _('Download this directory as a zip') . '" ';
-
- echo '>' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>'downloadaszip')). '</a>';
+ $numFiles = $ndg->getNumberOfDocuments(1);
+ if (forge_check_perm('docman', $group_id, 'approve'))
+ $numPendingFiles = $ndg->getNumberOfDocuments(3);
+ if ($numFiles || (isset($numPendingFiles) && $numPendingFiles))
+ echo '<a href="/docman/view.php/'.$ndg->Group->getID().'/zip/full/'.$dirid.'" class="tabtitle" title="'. _('Download this folder as a zip') . '" >' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>'downloadaszip')). '</a>';
echo '</h3>';
- if (forge_check_perm('docman', $group_id, 'approve')) {
+ if (forge_check_perm('docman', $ndg->Group->getID(), 'approve')) {
echo '<div class="docman_div_include" id="editdocgroup" style="display:none;">';
- echo '<h4 class="docman_h4">'. _('Edit this directory') .'</h4>';
+ echo '<h4 class="docman_h4">'. _('Edit this folder') .'</h4>';
include ($gfcommon.'docman/views/editdocgroup.php');
echo '</div>';
+ }
+ if (forge_check_perm('docman', $ndg->Group->getID(), 'submit')) {
echo '<div class="docman_div_include" id="additem" style="display:none">';
echo '<h4 class="docman_h4">'. _('Add a new item') .'</h4>';
include ($gfcommon.'docman/views/additem.php');
}
if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
- $tabletop = array('<input id="checkall" type="checkbox" onchange="controllerListFile.checkAll()" />', '', _('Filename'), _('Title'), _('Description'), _('Author'), _('Last time'), _('Status'), _('Size'));
+ $tabletop = array('<input id="checkallactive" type="checkbox" title="'._('Select / Deselect all documents for massaction').'" class="tabtitle-w" onchange="controllerListFile.checkAll(\'checkeddocidactive\', \'active\')" />', '', _('Filename'), _('Title'), _('Description'), _('Author'), _('Last time'), _('Status'), _('Size'));
$classth = array('unsortable', 'unsortable', '', '', '', '', '', '', '');
- if (forge_check_perm('docman', $group_id, 'approve')) {
+ if (forge_check_perm('docman', $ndg->Group->getID(), 'approve')) {
$tabletop[] = _('Actions');
$classth[] = 'unsortable';
}
echo '<tr>';
echo '<td>';
if (!$d->getLocked() && !$d->getReserved()) {
- echo '<input type="checkbox" value="'.$d->getID().'" id="checkeddocid" class="checkeddocid" onchange="controllerListFile.checkgeneral()" />';
+ echo '<input type="checkbox" value="'.$d->getID().'" class="checkeddocidactive tabtitle-w" title="'._('Select / Deselect this document for massaction').'" onchange="controllerListFile.checkgeneral(\'active\')" />';
} else {
if (session_loggedin() && ($d->getReservedBy() != $u->getID())) {
echo '<input type="checkbox" name="disabled" disabled="disabled"';
} else {
- echo '<input type="checkbox" value="'.$d->getID().'" id="checkeddocid" class="checkeddocid" onchange="controllerListFile.checkgeneral()" />';
+ echo '<input type="checkbox" value="'.$d->getID().'" class="checkeddocidactive tabtitle-w" title="'._('Select / Deselect this document for massaction').'"" onchange="controllerListFile.checkgeneral(\'active\')" />';
}
}
echo '</td>';
break;
}
default: {
- $docurl = util_make_uri('/docman/view.php/'.$group_id.'/'.$d->getID().'/'.urlencode($d->getFileName()));
+ $docurl = util_make_uri('/docman/view.php/'.$d->Group->getID().'/'.$d->getID().'/'.urlencode($d->getFileName()));
}
}
- echo '<td><a href="'.$docurl.'" class="docman-viewfile"';
- if ($use_tooltips)
- echo ' title="'._('View this document').'"';
-
- echo ' >';
+ echo '<td><a href="'.$docurl.'" class="tabtitle-nw" title="'._('View this document').'" >';
echo html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType()));;
- echo '</a></td>';
+ echo '</a></td>'."\n";
echo '<td>';
if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
$html_image_attr = array();
$html_image_attr['alt'] = _('new');
- $html_image_attr['class'] = 'docman-newdocument';
- if ($use_tooltips)
- $html_image_attr['title'] = _('Created or updated since less than 7 days');
+ $html_image_attr['class'] = 'tabtitle-ne';
+ $html_image_attr['title'] = _('Created or updated since less than 7 days');
echo html_image('docman/new.png', '14', '14', $html_image_attr);
}
echo ' '.$d->getFileName();
if ($d->getReserved()) {
$html_image_attr = array();
$html_image_attr['alt'] = _('Reserved Document');
- $html_image_attr['class'] = 'docman-reserveddocument';
- if ($use_tooltips)
- $html_image_attr['title'] = _('Reserved Document');
-
+ $html_image_attr['class'] = 'tabtitle';
+ $html_image_attr['title'] = _('Reserved Document');
echo html_image('docman/document-reserved.png', '22', '22', $html_image_attr);
} else {
- echo $d->getStateName().'</td>';
+ echo $d->getStateName();
}
+ echo '</td>';
echo '<td>';
switch ($d->getFileType()) {
case "URL": {
break;
}
default: {
- $metric = 'B';
- $size = $d->getFileSize();
- if ($size > 1024 ) {
- $metric = 'KB';
- $size = floor($size/1024);
- if ($size > 1024 ) {
- $metric = 'MB';
- $size = floor($size/1024);
- }
- }
- echo $size . $metric;
- echo '</td>';
+ echo human_readable_bytes($d->getFileSize());
+ break;
}
}
+ echo '</td>';
if (forge_check_perm('docman', $group_id, 'approve')) {
echo '<td>';
}
}
if (!$d->getLocked() && !$d->getReserved()) {
- echo '<a class="docman-movetotrash" href="?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" ';
- if ($use_tooltips)
- echo ' title="'. _('Move this document to trash') .'"';
-
- echo ' >'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash this document'))). '</a>';
-
- echo '<a class="docman-editfile" href="#" onclick="javascript:controllerListFile.toggleEditFileView(\''.$d->getID().'\')" ';
- if ($use_tooltips)
- echo ' title="'. _('Edit this document') .'" ';
-
- echo '>'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '</a>';
-
- echo '<a class="docman-reservefile" href="?group_id='.$group_id.'&action=reservefile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" ';
- if ($use_tooltips)
- echo ' title="'. _('Reserve this document for later edition') .'" ';
-
- echo '>'.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve this document'))). '</a>';
+ echo '<a class="tabtitle-ne" href="'.$actionlistfileurl.'&action=trashfile&fileid='.$d->getID().'" title="'. _('Move this document to trash') .'" >'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash this document'))). '</a>';
+ if (session_loggedin()) {
+ echo '<a class="tabtitle-ne" href="#" onclick="javascript:controllerListFile.toggleEditFileView(\''.$d->getID().'\')" title="'. _('Edit this document') .'" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '</a>';
+ echo '<a class="tabtitle-ne" href="'.$actionlistfileurl.'&action=reservefile&fileid='.$d->getID().'" title="'. _('Reserve this document for later edition') .'" >'.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve this document'))). '</a>';
+ }
} else {
- if ($d->getReservedBy() != $u->getID()) {
- if (forge_check_perm('docman', $group_id, 'admin')) {
- echo '<a class="docman-enforcereservation" href="?group_id='.$group_id.'&action=enforcereserve&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" ';
- if ($use_tooltips)
- echo ' title="'. _('Enforce reservation') .'" ';
-
- echo '>'.html_image('docman/enforce-document.png',22,22,array('alt'=>_('Enforce reservation')));
+ if (session_loggedin() && $d->getReservedBy() != $u->getID()) {
+ if (forge_check_perm('docman', $ndg->Group->getID(), 'admin')) {
+ echo '<a class="docman-enforcereservation" href="'.$actionlistfileurl.'&action=enforcereserve&fileid='.$d->getID().'" title="'. _('Enforce reservation') .'" >'.html_image('docman/enforce-document.png',22,22,array('alt'=>_('Enforce reservation')));
}
} else {
- echo '<a class="docman-movetotrash" href="?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" ';
- if ($use_tooltips)
- echo ' title="'. _('Move this document to trash') .'" ';
-
- echo '>'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash this document'))). '</a>';
- echo '<a class="docman-editfile" href="#" onclick="javascript:controllerListFile.toggleEditFileView(\''.$d->getID().'\')" ';
- if ($use_tooltips)
- echo ' title="'. _('Edit this document') .'" ';
-
- echo '>'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '</a>';
- echo '<a class="docman-releasereservation" href="?group_id='.$group_id.'&action=releasefile&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" ';
- if ($use_tooltips)
- echo ' title="'. _('Release reservation') .'" ';
-
- echo '>'.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '</a>';
+ echo '<a class="tabtitle-ne" href="'.$actionlistfileurl.'&action=trashfile&fileid='.$d->getID().'" title="'. _('Move this document to trash') .'" >'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash this document'))). '</a>';
+ echo '<a class="tabtitle-ne" href="#" onclick="javascript:controllerListFile.toggleEditFileView(\''.$d->getID().'\')" title="'. _('Edit this document') .'" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '</a>';
+ echo '<a class="tabtitle-ne" href="'.$actionlistfileurl.'&action=releasefile&fileid='.$d->getID().'" title="'. _('Release reservation') .'" >'.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '</a>';
}
}
- if ($d->isMonitoredBy($u->getID())) {
- $option = 'remove';
- $titleMonitor = _('Stop monitoring this document');
- } else {
- $option = 'add';
- $titleMonitor = _('Start monitoring this document');
+ if (session_loggedin()) {
+ if ($d->isMonitoredBy($u->getID())) {
+ $option = 'remove';
+ $titleMonitor = _('Stop monitoring this document');
+ } else {
+ $option = 'add';
+ $titleMonitor = _('Start monitoring this document');
+ }
+ echo '<a class="tabtitle-ne" href="'.$actionlistfileurl.'&action=monitorfile&option='.$option.'&fileid='.$d->getID().'" title="'.$titleMonitor.'" >'.html_image('docman/monitor-'.$option.'document.png',22,22,array('alt'=>$titleMonitor)). '</a>';
}
- echo '<a class="docman-monitorfile" href="?group_id='.$group_id.'&action=monitorfile&option='.$option.'&view=listfile&dirid='.$dirid.'&fileid='.$d->getID().'" ';
- if ($use_tooltips)
- echo ' title="'.$titleMonitor.'" ';
-
- echo '>'.html_image('docman/monitor-'.$option.'document.png',22,22,array('alt'=>$titleMonitor)). '</a>';
echo '</td>';
}
- echo '</tr>';
+ echo '</tr>'."\n";
+ if (forge_check_perm('docman', $d->Group->getID(), 'approve')) {
+ echo '<tr id="docid'.$d->getID().'" class="docman_editfile_nodisplay" ><td colspan="10" >';
+ $d->editFile();
+ echo '</td></tr>';
+ }
}
echo $HTML->listTableBottom();
- echo '</div>';
- echo '<div class="docmanDiv"><p>';
- echo _('Mass Actions for selected files:');
- if (forge_check_perm('docman', $group_id, 'approve')) {
- echo '<a class="docman-movetotrash" href="#" onClick="window.location.href=\'?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox()" ';
- if ($use_tooltips)
- echo ' title="'. _('Move to trash') .'" ';
-
- echo '>'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash'))). '</a>';
- echo '<a class="docman-reservefile" href="#" onClick="window.location.href=\'?group_id='.$group_id.'&action=reservefile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox()" ';
- if ($use_tooltips)
- echo ' title="'. _('Reserve for later edition') .'" ';
-
- echo '>'.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve'))). '</a>';
- echo '<a class="docman-releasereservation" href="#" onClick="window.location.href=\'?group_id='.$group_id.'&action=releasefile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox()" ';
- if ($use_tooltips)
- echo ' title="'. _('Release reservation') .'" ';
-
- echo '>'.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '</a>';
- echo '<a class="docman-monitorfile" href="#" onClick="window.location.href=\'?group_id='.$group_id.'&action=monitorfile&option=add&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox()" ';
- if ($use_tooltips)
- echo ' title="'. _('Start monitoring') .'" ';
-
- echo '>'.html_image('docman/monitor-adddocument.png',22,22,array('alt'=>_('Start monitoring'))). '</a>';
- echo '<a class="docman-monitorfile" href="#" onClick="window.location.href=\'?group_id='.$group_id.'&action=monitorfile&option=remove&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox()" ';
- if ($use_tooltips)
- echo ' title="'. _('Stop monitoring') .'" ';
-
- echo '>'.html_image('docman/monitor-removedocument.png',22,22,array('alt'=>_('Stop monitoring'))). '</a>';
- }
- echo '<a class="docman-downloadaszip" href="#" onClick="window.location.href=\'/docman/view.php/'.$group_id.'/zip/selected/\'+controllerListFile.buildUrlByCheckbox()" ';
- if ($use_tooltips)
- echo ' title="'. _('Download as a zip') . '" ';
-
- echo '>' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>'Download as Zip')). '</a>';
- echo '</p></div>';
- if (forge_check_perm('docman', $group_id, 'approve')) {
- include ($gfcommon.'docman/views/editfile.php');
+ echo '<p>';
+ echo '<span class="tabtitle" id="docman-massactionmessage" title="'. _('Actions availables for selected documents, you need to check at least one document to get actions') . '" >';
+ echo _('Mass actions for selected documents:');
+ echo '</span>';
+ echo '<span id="massactionactive" style="display: none;" >';
+ if (forge_check_perm('docman', $ndg->Group->getID(), 'approve')) {
+ echo '<a class="tabtitle-ne" href="#" onclick="window.location.href=\'?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox(\'active\')" title="'. _('Move to trash') .'" >'.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash'))). '</a>';
+ if (session_loggedin()) {
+ echo '<a class="tabtitle-ne" href="#" onclick="window.location.href=\''.$actionlistfileurl.'&action=reservefile&fileid=\'+controllerListFile.buildUrlByCheckbox(\'active\')" title="'. _('Reserve for later edition') .'" >'.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve'))). '</a>';
+ echo '<a class="tabtitle-ne" href="#" onclick="window.location.href=\''.$actionlistfileurl.'&action=releasefile&fileid=\'+controllerListFile.buildUrlByCheckbox(\'active\')" title="'. _('Release reservation') .'">'.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '</a>';
+ echo '<a class="tabtitle-ne" href="#" onclick="window.location.href=\''.$actionlistfileurl.'&action=monitorfile&option=add&fileid=\'+controllerListFile.buildUrlByCheckbox(\'active\')" title="'. _('Start monitoring') .'" >'.html_image('docman/monitor-adddocument.png',22,22,array('alt'=>_('Start monitoring'))). '</a>';
+ echo '<a class="tabtitle-ne" href="#" onclick="window.location.href=\''.$actionlistfileurl.'&action=monitorfile&option=remove&fileid=\'+controllerListFile.buildUrlByCheckbox(\'active\')" title="'. _('Stop monitoring') .'" >'.html_image('docman/monitor-removedocument.png',22,22,array('alt'=>_('Stop monitoring'))). '</a>';
+ }
}
+ echo '<a class="tabtitle" href="#" onclick="window.location.href=\'/docman/view.php/'.$group_id.'/zip/selected/'.$dirid.'/\'+controllerListFile.buildUrlByCheckbox(\'active\')" title="'. _('Download as a zip') . '" >' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>'Download as Zip')). '</a>';
+ echo '</span>';
+ echo '</p>';
+ echo '</div>';
} else {
- echo '<p class="warning">'._('No documents to display').'</p>';
+ if ($dirid) {
+ echo '<p class="information">'._('No documents.').'</p>';
+ }
+}
+if (forge_check_perm('docman', $group_id, 'approve') && $DocGroupName) {
+ include ($gfcommon.'docman/views/pendingfiles.php');
}
echo '</div>';
-echo '<div style="clear:both"; />';
-?>
\ No newline at end of file
+echo '<div style="clear: both;" />';
+?>