';
echo $HTML->listTableTop($tabletop, false, 'sortable_docman_listfile', 'sortable', $classth);
$time_new = 604800;
foreach ($nested_docs[$dirid] as $d) {
echo '
';
switch ($d->getFileType()) {
case "URL": {
$docurl = $d->getFileName();
break;
}
default: {
$docurl = util_make_url('/docman/view.php/'.$group_id.'/'.$d->getID().'/'.urlencode($d->getFileName()));
}
}
echo '';
echo html_image($d->getFileTypeImage(), '22', '22', array('alt'=>$d->getFileType()));;
echo ' | ';
echo '';
if (($d->getUpdated() && $time_new > (time() - $d->getUpdated())) || $time_new > (time() - $d->getCreated())) {
echo html_image('docman/new.png', '14', '14', array('alt'=>'new'));
}
echo ' '.$d->getFileName();
echo ' | ';
echo ''.$d->getName().' | ';
echo ''.$d->getDescription().' | ';
echo ''.make_user_link($d->getCreatorUserName(), $d->getCreatorRealName()).' | ';
echo '';
if ( $d->getUpdated() ) {
echo date(_('Y-m-d H:i'), $d->getUpdated());
} else {
echo date(_('Y-m-d H:i'), $d->getCreated());
}
echo ' | ';
echo '';
if ($d->getReserved()) {
echo html_image('docman/document-reserved.png', '22', '22', array('alt'=>_('Reserved Document'),'title'=>_('Reserved Document'),'class'=>'docman-reserveddocument'));
} else {
echo $d->getStateName().' | ';
}
echo '';
switch ($d->getFileType()) {
case "URL": {
echo "--";
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 ' | ';
}
}
if (forge_check_perm('docman', $group_id, 'approve')) {
echo '';
/* should we steal the lock on file ? */
if ($d->getLocked()) {
if ($d->getLockedBy() == $LUSER->getID()) {
$d->setLock(0);
/* if you change the 60000 value above, please update here too */
} elseif ((time() - $d->getLockdate()) > 600) {
$d->setLock(0);
}
}
if (!$d->getLocked() && !$d->getReserved()) {
echo ''.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash this document'))). '';
echo ''.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '';
echo ''.html_image('docman/reserve-document.png',22,22,array('alt'=>_('Reserve this document'))). '';
} else {
if ($d->getReservedBy() != $LUSER->getID()) {
if (forge_check_perm('docman', $group_id, 'admin')) {
echo ''.html_image('docman/enforce-document.png',22,22,array('alt'=>_('Enforce reservation')));
}
} else {
echo ''.html_image('docman/trash-empty.png',22,22,array('alt'=>_('Move to trash this document'))). '';
echo ''.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '';
echo ''.html_image('docman/release-document.png',22,22,array('alt'=>_('Release reservation'))). '';
}
}
if ($d->isMonitoredBy($LUSER->getID())) {
$option = 'remove';
$titleMonitor = _('Stop monitoring this document');
} else {
$option = 'add';
$titleMonitor = _('Start monitoring this document');
}
echo ''.html_image('docman/monitor-'.$option.'document.png',22,22,array('alt'=>$titleMonitor)). '';
echo ' | ';
}
echo '