';
echo $HTML->listTableTop($tabletop, false, 'sortable_docman_listfile', 'sortable', $classth);
$time_new = 604800;
foreach ($nested_docs[$dirid] as $d) {
echo '
';
echo '';
if (!$d->getLocked() && !$d->getReserved()) {
echo ' ';
} else {
if (session_loggedin() && ($d->getReservedBy() != $u->getID())) {
echo ' ';
}
}
echo ' ';
switch ($d->getFileType()) {
case "URL": {
$docurl = $d->getFileName();
break;
}
default: {
$docurl = util_make_uri('/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())) {
$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');
echo html_image('docman/new.png', '14', '14', $html_image_attr);
}
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()) {
$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');
echo html_image('docman/document-reserved.png', '22', '22', $html_image_attr);
} 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() == $u->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() != $u->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($u->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 '