2012-12-14 07:53:13 +00:00
< ? php
/**
* Implementation of ViewDocument view
*
* @ category DMS
2013-02-14 11:10:53 +00:00
* @ package SeedDMS
2012-12-14 07:53:13 +00:00
* @ license GPL 2
* @ version @ version @
* @ author Uwe Steinmann < uwe @ steinmann . cx >
* @ copyright Copyright ( C ) 2002 - 2005 Markus Westphal ,
* 2006 - 2008 Malcolm Cowe , 2010 Matteo Lucarelli ,
* 2010 - 2012 Uwe Steinmann
* @ version Release : @ package_version @
*/
/**
* Include parent class
*/
2021-04-18 05:08:00 +00:00
//require_once("class.Bootstrap.php");
2012-12-14 07:53:13 +00:00
/**
* Class which outputs the html page for ViewDocument view
*
* @ category DMS
2013-02-14 11:10:53 +00:00
* @ package SeedDMS
2012-12-14 07:53:13 +00:00
* @ author Markus Westphal , Malcolm Cowe , Uwe Steinmann < uwe @ steinmann . cx >
* @ copyright Copyright ( C ) 2002 - 2005 Markus Westphal ,
* 2006 - 2008 Malcolm Cowe , 2010 Matteo Lucarelli ,
* 2010 - 2012 Uwe Steinmann
* @ version Release : @ package_version @
*/
2021-04-18 05:08:00 +00:00
class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
2012-12-14 07:53:13 +00:00
2015-04-14 17:38:50 +00:00
protected function getAccessModeText ( $defMode ) { /* {{{ */
2013-02-06 13:58:15 +00:00
switch ( $defMode ) {
case M_NONE :
return getMLText ( " access_mode_none " );
break ;
case M_READ :
return getMLText ( " access_mode_read " );
break ;
case M_READWRITE :
return getMLText ( " access_mode_readwrite " );
break ;
case M_ALL :
return getMLText ( " access_mode_all " );
break ;
}
} /* }}} */
2015-04-14 17:38:50 +00:00
protected function printAccessList ( $obj ) { /* {{{ */
2013-02-06 13:58:15 +00:00
$accessList = $obj -> getAccessList ();
if ( count ( $accessList [ " users " ]) == 0 && count ( $accessList [ " groups " ]) == 0 )
return ;
2017-01-26 13:44:07 +00:00
$content = '' ;
2013-02-06 13:58:15 +00:00
for ( $i = 0 ; $i < count ( $accessList [ " groups " ]); $i ++ )
{
$group = $accessList [ " groups " ][ $i ] -> getGroup ();
$accesstext = $this -> getAccessModeText ( $accessList [ " groups " ][ $i ] -> getMode ());
2017-01-26 13:44:07 +00:00
$content .= $accesstext . " : " . htmlspecialchars ( $group -> getName ());
2013-02-06 13:58:15 +00:00
if ( $i + 1 < count ( $accessList [ " groups " ]) || count ( $accessList [ " users " ]) > 0 )
2017-01-26 13:44:07 +00:00
$content .= " <br /> " ;
2013-02-06 13:58:15 +00:00
}
for ( $i = 0 ; $i < count ( $accessList [ " users " ]); $i ++ )
{
$user = $accessList [ " users " ][ $i ] -> getUser ();
$accesstext = $this -> getAccessModeText ( $accessList [ " users " ][ $i ] -> getMode ());
2017-01-26 13:44:07 +00:00
$content .= $accesstext . " : " . htmlspecialchars ( $user -> getFullName ());
2013-02-06 13:58:15 +00:00
if ( $i + 1 < count ( $accessList [ " users " ]))
2017-01-26 13:44:07 +00:00
$content .= " <br /> " ;
}
if ( count ( $accessList [ " groups " ]) + count ( $accessList [ " users " ]) > 3 ) {
$this -> printPopupBox ( getMLText ( 'list_access_rights' ), $content );
} else {
echo $content ;
2013-02-06 13:58:15 +00:00
}
} /* }}} */
2021-07-12 17:47:34 +00:00
/**
* Output a single attribute in the document info section
*
* @ param object $attribute attribute
*/
protected function printAttribute ( $attribute ) { /* {{{ */
$attrdef = $attribute -> getAttributeDefinition ();
?>
< tr >
< td >< ? php echo htmlspecialchars ( $attrdef -> getName ()); ?> :</td>
< td >< ? php echo $this -> getAttributeValue ( $attribute ); ?> </td>
</ tr >
< ? php
} /* }}} */
2020-03-19 09:13:12 +00:00
protected function printVersionAttributes ( $folder , $version ) { /* {{{ */
$attributes = $version -> getAttributes ();
if ( $attributes ) {
foreach ( $attributes as $attribute ) {
$arr = $this -> callHook ( 'showDocumentContentAttribute' , $version , $attribute );
if ( is_array ( $arr )) {
print " <li> " . $arr [ 0 ] . " : " . $arr [ 1 ] . " </li> \n " ;
} else {
$attrdef = $attribute -> getAttributeDefinition ();
print " <li> " . htmlspecialchars ( $attrdef -> getName ()) . " : " ;
$this -> printAttributeValue ( $attribute );
echo " </li> \n " ;
}
}
}
2022-05-06 10:54:11 +00:00
$arrarr = $this -> callHook ( 'additionalDocumentContentInfo' , $version );
if ( is_array ( $arrarr )) {
foreach ( $arrarr as $arr ) {
print " <li> " . $arr [ 0 ] . " : " . $arr [ 1 ] . " </li> \n " ;
}
} elseif ( is_string ( $arrarr )) {
echo $arrarr ;
}
2020-03-19 09:13:12 +00:00
} /* }}} */
2017-03-10 19:08:01 +00:00
function documentListItem () { /* {{{ */
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$previewwidth = $this -> params [ 'previewWidthList' ];
$cachedir = $this -> params [ 'cachedir' ];
2021-10-06 13:03:03 +00:00
$conversionmgr = $this -> params [ 'conversionmgr' ];
$previewconverters = $this -> params [ 'previewConverters' ];
2022-09-07 15:09:57 +00:00
$previewwidthlist = $this -> params [ 'previewWidthList' ];
$previewwidthdetail = $this -> params [ 'previewWidthDetail' ];
2021-10-06 13:03:03 +00:00
$timeout = $this -> params [ 'timeout' ];
$xsendfile = $this -> params [ 'xsendfile' ];
2017-03-10 19:08:01 +00:00
$document = $this -> params [ 'document' ];
2021-10-06 13:03:03 +00:00
2017-03-10 19:08:01 +00:00
if ( $document ) {
if ( $document -> getAccessMode ( $user ) >= M_READ ) {
2021-10-06 13:03:03 +00:00
$previewer = new SeedDMS_Preview_Previewer ( $cachedir , $previewwidth , $timeout , $xsendfile );
if ( $conversionmgr )
$previewer -> setConversionMgr ( $conversionmgr );
else
$previewer -> setConverters ( $previewconverters );
2018-08-08 04:55:56 +00:00
$txt = $this -> callHook ( 'documentListItem' , $document , $previewer , false , 'viewitem' );
2017-03-10 19:08:01 +00:00
if ( is_string ( $txt ))
$content = $txt ;
2023-12-13 07:07:38 +00:00
else
2017-03-10 19:08:01 +00:00
$content = $this -> documentListRow ( $document , $previewer , true );
echo $content ;
}
}
} /* }}} */
2015-10-19 11:15:20 +00:00
function timelinedata () { /* {{{ */
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$document = $this -> params [ 'document' ];
$jsondata = array ();
if ( $user -> isAdmin ()) {
2023-05-11 14:57:24 +00:00
if ( $data = $document -> getTimeline ()) {
2015-10-19 11:15:20 +00:00
2015-10-20 16:36:24 +00:00
foreach ( $data as $i => $item ) {
2015-10-19 11:15:20 +00:00
switch ( $item [ 'type' ]) {
case 'add_version' :
$msg = getMLText ( 'timeline_' . $item [ 'type' ], array ( 'document' => htmlspecialchars ( $item [ 'document' ] -> getName ()), 'version' => $item [ 'version' ]));
break ;
case 'add_file' :
$msg = getMLText ( 'timeline_' . $item [ 'type' ], array ( 'document' => htmlspecialchars ( $item [ 'document' ] -> getName ())));
break ;
case 'status_change' :
$msg = getMLText ( 'timeline_' . $item [ 'type' ], array ( 'document' => htmlspecialchars ( $item [ 'document' ] -> getName ()), 'version' => $item [ 'version' ], 'status' => getOverallStatusText ( $item [ 'status' ])));
break ;
2018-01-18 16:29:10 +00:00
case 'scheduled_revision' :
2018-03-20 10:06:38 +00:00
$msg = getMLText ( 'timeline_' . $item [ 'type' ], array ( 'document' => htmlspecialchars ( $item [ 'document' ] -> getName ()), 'version' => $item [ 'version' ]));
2018-01-18 16:29:10 +00:00
break ;
2015-10-19 11:15:20 +00:00
default :
$msg = '???' ;
}
2015-10-20 16:36:24 +00:00
$data [ $i ][ 'msg' ] = $msg ;
2015-10-19 11:15:20 +00:00
}
foreach ( $data as $item ) {
if ( $item [ 'type' ] == 'status_change' )
$classname = $item [ 'type' ] . " _ " . $item [ 'status' ];
else
$classname = $item [ 'type' ];
$d = makeTsFromLongDate ( $item [ 'date' ]);
$jsondata [] = array ( 'start' => date ( 'c' , $d ) /*$item['date']*/ , 'content' => $item [ 'msg' ], 'className' => $classname );
}
2023-05-11 14:57:24 +00:00
}
2015-10-19 11:15:20 +00:00
}
header ( 'Content-Type: application/json' );
echo json_encode ( $jsondata );
} /* }}} */
2022-09-15 11:08:56 +00:00
protected function iptcdata ( $arr ) { /* {{{ */
$iptcHeaderArray = array (
'2#005' => 'DocumentTitle' ,
'2#010' => 'Urgency' ,
'2#015' => 'Category' ,
'2#025' => 'Keywords' ,
'2#020' => 'Subcategories' ,
'2#040' => 'SpecialInstructions' ,
'2#055' => 'CreationDate' ,
2022-10-10 18:14:00 +00:00
'2#060' => 'CreationTime' ,
2022-09-15 11:08:56 +00:00
'2#080' => 'AuthorByline' ,
'2#085' => 'AuthorTitle' ,
'2#090' => 'City' ,
'2#095' => 'State' ,
'2#101' => 'Country' ,
'2#103' => 'OTR' ,
'2#105' => 'Headline' ,
'2#110' => 'Source' ,
'2#115' => 'PhotoSource' ,
'2#116' => 'Copyright' ,
'2#120' => 'Caption' ,
'2#122' => 'CaptionWriter'
);
2022-10-10 18:14:00 +00:00
$retStr = '<table class="table table-sm table-condensed">' ;
2022-09-15 11:08:56 +00:00
if ( is_array ( $arr )) {
foreach ( $arr as $key => $val ) {
2022-09-15 18:24:51 +00:00
if ( isset ( $iptcHeaderArray [ $key ]))
$retStr .= '<tr><td>' . $iptcHeaderArray [ $key ] . '</td><td>' . htmlspecialchars ( implode ( '; ' , $val )) . '</td></tr>' ;
2022-10-10 18:14:00 +00:00
elseif ( $key == '1#090' ) {
$retStr .= '<tr><td>Encoding</td><td>' . (( $val [ 0 ] == " \x1B %G " ) ? 'UTF-8' : '' ) . '</td></tr>' ;
} elseif ( $key == '2#000' ) {
$retStr .= '<tr><td>RecordVersion</td><td>' . ord ( $val [ 0 ]) . '</td></tr>' ;
} else
2022-09-15 18:24:51 +00:00
$retStr .= '<tr><td>' . $key . '</td><td>' . htmlspecialchars ( implode ( '; ' , $val )) . '</td></tr>' ;
2022-09-15 11:08:56 +00:00
}
}
$retStr .= '</table>' ;
return $retStr ;
} /* }}} */
2015-12-11 19:29:52 +00:00
function js () { /* {{{ */
2016-03-21 07:33:41 +00:00
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
2015-12-11 19:29:52 +00:00
$document = $this -> params [ 'document' ];
2021-07-16 14:03:34 +00:00
$enableDropUpload = $this -> params [ 'enableDropUpload' ];
$maxuploadsize = $this -> params [ 'maxuploadsize' ];
2015-12-11 19:29:52 +00:00
2021-03-10 14:58:22 +00:00
header ( 'Content-Type: application/javascript; charset=UTF-8' );
2021-05-27 19:53:49 +00:00
parent :: jsTranslations ( array ( 'js_form_error' , 'js_form_errors' , 'cancel' , 'splash_move_document' , 'confirm_move_document' , 'move_document' , 'confirm_transfer_link_document' , 'transfer_content' , 'link_document' , 'splash_move_folder' , 'confirm_move_folder' , 'move_folder' ));
2021-04-30 07:25:11 +00:00
?>
$ ( document ) . ready ( function (){
$ ( " #filterRecipientsInput " ) . on ( " keyup " , function () {
var value = $ ( this ) . val () . toLowerCase ();
$ ( " #filterRecipientsTable tbody tr " ) . filter ( function () {
$ ( this ) . toggle ( $ ( this ) . text () . toLowerCase () . indexOf ( value ) > - 1 )
});
});
});
< ? php
2016-03-21 07:33:41 +00:00
if ( $user -> isAdmin ()) {
2019-02-06 12:22:52 +00:00
$latestContent = $this -> callHook ( 'documentLatestContent' , $document );
if ( $latestContent === null )
$latestContent = $document -> getLatestContent ();
$this -> printTimelineJs ( 'out.ViewDocument.php?action=timelinedata&documentid=' . $latestContent -> getDocument () -> getID (), 300 , '' , date ( 'Y-m-d' ));
2016-03-21 07:33:41 +00:00
}
2018-01-26 17:51:59 +00:00
$this -> printDeleteDocumentButtonJs ();
2020-02-28 08:48:43 +00:00
/* Add js for catching click on document in one page mode */
$this -> printClickDocumentJs ();
2021-07-16 14:03:34 +00:00
if ( $enableDropUpload && $document -> getAccessMode ( $user ) >= M_READWRITE ) {
echo " SeedDMSUpload.setUrl(' " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Ajax.php'); " ;
echo " SeedDMSUpload.setAbortBtnLabel(' " . getMLText ( " cancel " ) . " '); " ;
echo " SeedDMSUpload.setEditBtnLabel(''); " ;
2022-04-29 16:30:46 +00:00
echo " SeedDMSUpload.setMaxFileSize( $maxuploadsize ); \n " ;
2021-07-16 14:03:34 +00:00
echo " SeedDMSUpload.setMaxFileSizeMsg(' " . getMLText ( " uploading_maxsize " ) . " '); " ;
}
2021-05-27 19:53:49 +00:00
?>
$ ( document ) . ready ( function () {
$ ( " #form1 " ) . validate ({
ignore : [],
rules : {
docid : {
required : true
},
},
messages : {
docid : " <?php printMLText( " js_no_document " );?> " ,
},
});
});
< ? php
2015-12-11 19:29:52 +00:00
} /* }}} */
2021-07-16 14:03:34 +00:00
function documentFiles () { /* {{{ */
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$document = $this -> params [ 'document' ];
$accessobject = $this -> params [ 'accessobject' ];
$viewonlinefiletypes = $this -> params [ 'viewonlinefiletypes' ];
$cachedir = $this -> params [ 'cachedir' ];
2021-10-06 13:03:03 +00:00
$conversionmgr = $this -> params [ 'conversionmgr' ];
2021-07-16 14:03:34 +00:00
$previewwidthdetail = $this -> params [ 'previewWidthDetail' ];
$previewconverters = $this -> params [ 'previewConverters' ];
$timeout = $this -> params [ 'timeout' ];
$xsendfile = $this -> params [ 'xsendfile' ];
$documentid = $document -> getId ();
$previewer = new SeedDMS_Preview_Previewer ( $cachedir , $previewwidthdetail , $timeout , $xsendfile );
2021-10-06 13:03:03 +00:00
if ( $conversionmgr )
$previewer -> setConversionMgr ( $conversionmgr );
else
$previewer -> setConverters ( $previewconverters );
2021-07-16 14:03:34 +00:00
$latestContent = $this -> callHook ( 'documentLatestContent' , $document );
if ( $latestContent === null )
$latestContent = $document -> getLatestContent ();
$files = $document -> getDocumentFiles ( $latestContent -> getVersion ());
$files = SeedDMS_Core_DMS :: filterDocumentFiles ( $user , $files );
if ( count ( $files ) > 0 ) {
2022-10-11 16:14:52 +00:00
print " <table class= \" table table-condensed table-sm \" > " ;
2021-07-16 14:03:34 +00:00
print " <thead> \n <tr> \n " ;
print " <th width='20%'></th> \n " ;
print " <th width='20%'> " . getMLText ( " file " ) . " </th> \n " ;
print " <th width='40%'> " . getMLText ( " comment " ) . " </th> \n " ;
print " <th width='20%'></th> \n " ;
print " </tr> \n </thead> \n <tbody> \n " ;
foreach ( $files as $file ) {
$file_exists = file_exists ( $dms -> contentDir . $file -> getPath ());
$responsibleUser = $file -> getUser ();
print " <tr> " ;
print " <td> " ;
$previewer -> createPreview ( $file , $previewwidthdetail );
if ( $file_exists ) {
if ( $viewonlinefiletypes && ( in_array ( strtolower ( $file -> getFileType ()), $viewonlinefiletypes ) || in_array ( strtolower ( $file -> getMimeType ()), $viewonlinefiletypes ))) {
if ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' ))) {
print " <a target= \" _blank \" href= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.ViewOnline.php?documentid= " . $documentid . " &file= " . $file -> getID () . " \" > " ;
}
} else {
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'file' ))) {
print " <a href= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Download.php?documentid= " . $documentid . " &file= " . $file -> getID () . " \" > " ;
}
}
}
if ( $previewer -> hasPreview ( $file )) {
print ( " <img class= \" mimeicon \" width= \" " . $previewwidthdetail . " \" src= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Preview.php?documentid= " . $document -> getID () . " &file= " . $file -> getID () . " &width= " . $previewwidthdetail . " \" title= \" " . htmlspecialchars ( $file -> getMimeType ()) . " \" > " );
} else {
print " <img class= \" mimeicon \" width= \" " . $previewwidthdetail . " \" src= \" " . $this -> getMimeIcon ( $file -> getFileType ()) . " \" title= \" " . htmlspecialchars ( $file -> getMimeType ()) . " \" > " ;
}
if ( $file_exists ) {
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'run' )) || $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' )))
print " </a> " ;
}
print " </td> " ;
2023-12-13 07:07:38 +00:00
print " <td> " ;
print " <ul class= \" actions unstyled \" > \n " ;
2021-07-16 14:03:34 +00:00
print " <li> " . htmlspecialchars ( $file -> getName ()) . " </li> \n " ;
if ( $file -> getName () != $file -> getOriginalFileName ())
print " <li> " . htmlspecialchars ( $file -> getOriginalFileName ()) . " </li> \n " ;
2022-11-15 15:05:53 +00:00
if ( $file_exists ) {
2022-11-17 10:35:34 +00:00
$realmimetype = SeedDMS_Core_File :: mimetype ( $dms -> contentDir . $file -> getPath ());
2021-07-16 14:03:34 +00:00
print " <li> " . SeedDMS_Core_File :: format_filesize ( filesize ( $dms -> contentDir . $file -> getPath ())) . " bytes, " . htmlspecialchars ( $file -> getMimeType ()) . " </li> " ;
2022-11-15 15:05:53 +00:00
} else print " <li> " . htmlspecialchars ( $file -> getMimeType ()) . " - <span class= \" warning \" > " . getMLText ( " document_deleted " ) . " </span></li> " ;
2021-07-16 14:03:34 +00:00
print " <li> " . getMLText ( " uploaded_by " ) . " <a href= \" mailto: " . htmlspecialchars ( $responsibleUser -> getEmail ()) . " \" > " . htmlspecialchars ( $responsibleUser -> getFullName ()) . " </a></li> " ;
print " <li> " . getLongReadableDate ( $file -> getDate ()) . " </li> " ;
if ( $file -> getVersion ())
print " <li> " . getMLText ( 'linked_to_current_version' ) . " </li> " ;
else
print " <li> " . getMLText ( 'linked_to_document' ) . " </li> " ;
print " </ul></td> " ;
print " <td> " . htmlspecialchars ( $file -> getComment ()) . " </td> " ;
2023-12-13 07:07:38 +00:00
print " <td> " ;
$items = [];
2021-07-16 14:03:34 +00:00
if ( $file_exists ) {
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'file' ))) {
2023-12-13 07:07:38 +00:00
$items [] = array ( 'link' => $this -> params [ 'settings' ] -> _httpRoot . " op/op.Download.php?documentid= " . $documentid . " &file= " . $file -> getID (), 'icon' => 'download' , 'label' => 'download' );
2021-07-16 14:03:34 +00:00
}
if ( $viewonlinefiletypes && ( in_array ( strtolower ( $file -> getFileType ()), $viewonlinefiletypes ) || in_array ( strtolower ( $file -> getMimeType ()), $viewonlinefiletypes ))) {
if ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' ))) {
2023-12-13 07:07:38 +00:00
$items [] = array ( 'link' => $this -> params [ 'settings' ] -> _httpRoot . " op/op.ViewOnline.php?documentid= " . $documentid . " &file= " . $file -> getID (), 'icon' => 'star' , 'label' => 'view_online' );
2021-07-16 14:03:34 +00:00
}
}
2021-07-16 14:20:11 +00:00
} else print " <li><img class= \" mimeicon \" src= \" images/icons/ " . $this -> getMimeIcon ( $file -> getFileType ()) . " \" title= \" " . htmlspecialchars ( $file -> getMimeType ()) . " \" > " ;
2023-12-13 07:07:38 +00:00
$this -> showActions ( $items );
$items = [];
2021-07-16 14:03:34 +00:00
if (( $document -> getAccessMode ( $user ) == M_ALL ) || ( $file -> getUserID () == $user -> getID ())) {
2023-12-13 07:07:38 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'RemoveDocumentFile' , array ( 'documentid' => $document -> getID (), 'fileid' => $file -> getID ())), 'icon' => 'remove' , 'label' => 'delete' );
$items [] = array ( 'link' => $this -> html_url ( 'EditDocumentFile' , array ( 'documentid' => $document -> getID (), 'fileid' => $file -> getID ())), 'icon' => 'edit' , 'label' => 'edit' );
2021-07-16 14:03:34 +00:00
}
2023-12-13 07:07:38 +00:00
$this -> showActions ( $items );
print " </td> " ;
2021-07-16 14:03:34 +00:00
print " </tr> " ;
}
print " </tbody> \n </table> \n " ;
}
else $this -> infoMsg ( getMLText ( " no_attached_files " ));
} /* }}} */
2016-12-22 08:31:46 +00:00
function documentInfos () { /* {{{ */
2012-12-14 07:53:13 +00:00
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
2023-04-04 15:46:08 +00:00
$settings = $this -> params [ 'settings' ];
2012-12-14 07:53:13 +00:00
$document = $this -> params [ 'document' ];
2015-05-29 18:48:27 +00:00
$checkoutdir = $this -> params [ 'checkOutDir' ];
2012-12-14 07:53:13 +00:00
2020-11-13 10:23:04 +00:00
$txt = $this -> callHook ( 'documentInfos' , $document );
if ( is_string ( $txt ))
echo $txt ;
else {
2022-09-15 11:08:56 +00:00
$this -> contentHeading ( htmlspecialchars ( $document -> getName ()));
2020-02-06 16:01:26 +00:00
$txt = $this -> callHook ( 'checkOutInfo' , $document );
if ( is_string ( $txt )) {
echo $txt ;
2020-11-24 07:04:44 +00:00
} elseif ( $infos = $document -> getCheckOutInfo ()) {
2024-04-23 10:18:34 +00:00
foreach ( $infos as $i => $info ) {
2021-04-15 04:34:56 +00:00
$checkoutuser = $dms -> getUser ( $info [ 'userID' ]);
2024-04-23 10:18:34 +00:00
$checkoutpath = sprintf ( $checkoutdir , preg_replace ( '/[^A-Za-z0-9_-]/' , '' , $checkoutuser -> getLogin ()));
$checkoutstatus = $document -> checkOutStatus ( $i );
2020-11-24 07:04:44 +00:00
echo " <div class= \" alert alert-info \" > " ;
2021-04-20 06:38:52 +00:00
echo " <a href= \" file:// " . $info [ 'filename' ] . " \" > " . getMLText ( 'copied_to_checkout_as' , array ( 'date' => getLongReadableDate ( makeTsFromLongDate ( $info [ 'date' ])), 'filename' => substr ( $info [ 'filename' ], strlen ( $checkoutpath ) + 1 ), 'username' => ( $checkoutuser ? $checkoutuser -> getFullName () : '' ))) . " </a> " ;
2020-11-24 07:04:44 +00:00
echo " </div> " ;
}
2015-05-29 18:48:27 +00:00
}
2015-08-07 08:13:47 +00:00
$txt = $this -> callHook ( 'preDocumentInfos' , $document );
if ( is_string ( $txt ))
echo $txt ;
2012-12-14 07:53:13 +00:00
?>
2021-04-18 05:08:00 +00:00
< table class = " table table-condensed table-sm " >
2013-02-07 21:40:46 +00:00
< ? php
if ( $user -> isAdmin ()) {
echo " <tr> " ;
echo " <td> " . getMLText ( " id " ) . " :</td> \n " ;
echo " <td> " . htmlspecialchars ( $document -> getID ()) . " </td> \n " ;
echo " </tr> " ;
}
?>
2012-12-14 07:53:13 +00:00
< tr >
2013-01-28 10:44:53 +00:00
< td >< ? php printMLText ( " name " ); ?> :</td>
2020-09-07 14:20:37 +00:00
< td >< ? php $this -> printInlineEdit ( htmlspecialchars ( $document -> getName ()), $document ); ?> </td>
2013-01-28 10:44:53 +00:00
</ tr >
< tr >
2012-12-14 07:53:13 +00:00
< td >< ? php printMLText ( " owner " ); ?> :</td>
< td >
2013-02-06 13:58:15 +00:00
< ? php
2012-12-14 07:53:13 +00:00
$owner = $document -> getOwner ();
2021-01-11 06:59:32 +00:00
print " <a class= \" infos \" href= \" mailto: " . htmlspecialchars ( $owner -> getEmail ()) . " \" > " . htmlspecialchars ( $owner -> getFullName ()) . " </a> " ;
2013-02-06 13:58:15 +00:00
?>
2012-12-14 07:53:13 +00:00
</ td >
</ tr >
2013-02-06 13:58:15 +00:00
< ? php
if ( $document -> getComment ()) {
2023-04-04 15:46:08 +00:00
if ( $settings -> _markdownComments ) {
$Parsedown = new Parsedown ();
2023-04-22 17:41:41 +00:00
$comment = $Parsedown -> text ( htmlspecialchars ( $document -> getComment ()));
2023-04-04 15:46:08 +00:00
} else {
$comment = htmlspecialchars ( $document -> getComment ());
}
2013-02-06 13:58:15 +00:00
?>
2012-12-14 07:53:13 +00:00
< tr >
< td >< ? php printMLText ( " comment " ); ?> :</td>
2023-04-04 15:46:08 +00:00
< td >< div class = " document-comment " >< ? php print $comment ; ?> </div></td>
2012-12-14 07:53:13 +00:00
</ tr >
2013-02-06 13:58:15 +00:00
< ? php
}
2023-04-05 12:55:28 +00:00
if ( $document -> getAccessMode ( $user ) == M_ALL ) {
2016-04-22 14:36:47 +00:00
echo " <tr> " ;
echo " <td> " . getMLText ( 'default_access' ) . " :</td> " ;
echo " <td> " . $this -> getAccessModeText ( $document -> getDefaultAccess ()) . " </td> " ;
echo " </tr> " ;
2013-02-06 13:58:15 +00:00
if ( $document -> inheritsAccess ()) {
echo " <tr> " ;
echo " <td> " . getMLText ( " access_mode " ) . " :</td> \n " ;
echo " <td> " ;
2016-04-22 14:36:47 +00:00
echo getMLText ( " inherited " ) . " <br /> " ;
$this -> printAccessList ( $document );
2013-02-06 13:58:15 +00:00
echo " </tr> " ;
} else {
echo " <tr> " ;
2013-02-16 18:43:39 +00:00
echo " <td> " . getMLText ( 'access_mode' ) . " :</td> " ;
2013-02-06 13:58:15 +00:00
echo " <td> " ;
$this -> printAccessList ( $document );
echo " </td> " ;
echo " </tr> " ;
}
}
?>
< tr >
< td >< ? php printMLText ( " used_discspace " ); ?> :</td>
2013-02-14 11:10:53 +00:00
< td >< ? php print SeedDMS_Core_File :: format_filesize ( $document -> getUsedDiskSpace ()); ?> </td>
2013-02-06 13:58:15 +00:00
</ tr >
2012-12-14 07:53:13 +00:00
< tr >
< td >< ? php printMLText ( " creation_date " ); ?> :</td>
< td >< ? php print getLongReadableDate ( $document -> getDate ()); ?> </td>
</ tr >
2013-02-06 13:58:15 +00:00
< ? php
2013-04-30 06:36:53 +00:00
if ( $document -> expires ()) {
?>
< tr >
< td >< ? php printMLText ( " expires " ); ?> :</td>
< td >< ? php print getReadableDate ( $document -> getExpires ()); ?> </td>
</ tr >
< ? php
}
2013-02-06 13:58:15 +00:00
if ( $document -> getKeywords ()) {
2020-08-12 05:26:28 +00:00
$arr = $this -> callHook ( 'showDocumentKeywords' , $document );
if ( is_array ( $arr )) {
echo " <tr> " ;
echo " <td> " . $arr [ 0 ] . " :</td> " ;
echo " <td> " . $arr [ 1 ] . " </td> " ;
echo " </tr> " ;
} elseif ( is_string ( $arr )) {
echo $arr ;
} else {
2013-02-06 13:58:15 +00:00
?>
2012-12-14 07:53:13 +00:00
< tr >
< td >< ? php printMLText ( " keywords " ); ?> :</td>
< td >< ? php print htmlspecialchars ( $document -> getKeywords ()); ?> </td>
</ tr >
2013-02-06 13:58:15 +00:00
< ? php
2020-08-12 05:26:28 +00:00
}
2013-02-06 13:58:15 +00:00
}
if ( $cats = $document -> getCategories ()) {
2020-08-12 05:26:28 +00:00
$arr = $this -> callHook ( 'showDocumentCategories' , $document );
if ( is_array ( $arr )) {
echo " <tr> " ;
echo " <td> " . $arr [ 0 ] . " :</td> " ;
echo " <td> " . $arr [ 1 ] . " </td> " ;
echo " </tr> " ;
} elseif ( is_string ( $arr )) {
echo $arr ;
} else {
2013-02-06 13:58:15 +00:00
?>
2012-12-14 07:53:13 +00:00
< tr >
< td >< ? php printMLText ( " categories " ); ?> :</td>
< td >
2020-08-12 05:26:28 +00:00
< ? php
$ct = array ();
foreach ( $cats as $cat )
$ct [] = htmlspecialchars ( $cat -> getName ());
echo implode ( ', ' , $ct );
?>
2012-12-14 07:53:13 +00:00
</ td >
</ tr >
2013-02-06 13:58:15 +00:00
< ? php
2020-08-12 05:26:28 +00:00
}
2013-02-06 13:58:15 +00:00
}
2012-12-14 07:53:13 +00:00
$attributes = $document -> getAttributes ();
if ( $attributes ) {
foreach ( $attributes as $attribute ) {
2015-04-27 06:27:19 +00:00
$arr = $this -> callHook ( 'showDocumentAttribute' , $document , $attribute );
if ( is_array ( $arr )) {
echo " <tr> " ;
echo " <td> " . $arr [ 0 ] . " :</td> " ;
echo " <td> " . $arr [ 1 ] . " </td> " ;
echo " </tr> " ;
2019-10-19 07:17:49 +00:00
} elseif ( is_string ( $arr )) {
echo $arr ;
2015-04-27 06:27:19 +00:00
} else {
2021-07-12 17:47:34 +00:00
$this -> printAttribute ( $attribute );
2015-04-27 06:27:19 +00:00
}
2012-12-14 07:53:13 +00:00
}
}
2020-11-13 10:23:04 +00:00
$arrarr = $this -> callHook ( 'additionalDocumentInfos' , $document );
if ( is_array ( $arrarr )) {
foreach ( $arrarr as $arr ) {
echo " <tr> " ;
echo " <td> " . $arr [ 0 ] . " :</td> " ;
echo " <td> " . $arr [ 1 ] . " </td> " ;
echo " </tr> " ;
}
} elseif ( is_string ( $arrarr )) {
echo $arrarr ;
}
2012-12-14 07:53:13 +00:00
?>
</ table >
< ? php
2015-08-07 08:13:47 +00:00
$txt = $this -> callHook ( 'postDocumentInfos' , $document );
if ( is_string ( $txt ))
echo $txt ;
2021-04-18 05:08:00 +00:00
// $this->contentContainerEnd();
2020-11-13 10:23:04 +00:00
}
2016-12-22 08:31:46 +00:00
} /* }}} */
2016-05-09 06:21:21 +00:00
function preview () { /* {{{ */
2017-01-04 16:14:45 +00:00
$dms = $this -> params [ 'dms' ];
2021-07-05 14:30:26 +00:00
$settings = $this -> params [ 'settings' ];
2016-05-09 06:21:21 +00:00
$document = $this -> params [ 'document' ];
2016-11-07 08:25:55 +00:00
$timeout = $this -> params [ 'timeout' ];
2019-01-18 12:07:39 +00:00
$xsendfile = $this -> params [ 'xsendfile' ];
2016-11-07 08:25:55 +00:00
$showfullpreview = $this -> params [ 'showFullPreview' ];
$converttopdf = $this -> params [ 'convertToPdf' ];
2017-11-22 12:53:30 +00:00
$pdfconverters = $this -> params [ 'pdfConverters' ];
2016-11-07 08:25:55 +00:00
$cachedir = $this -> params [ 'cachedir' ];
2021-10-06 13:03:03 +00:00
$conversionmgr = $this -> params [ 'conversionmgr' ];
2016-11-07 08:25:55 +00:00
if ( ! $showfullpreview )
return ;
2019-11-20 12:47:57 +00:00
$accessobject = $this -> params [ 'accessobject' ];
if ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'version' ))) {
2019-02-07 14:03:43 +00:00
$latestContent = $this -> callHook ( 'documentLatestContent' , $document );
if ( $latestContent === null )
$latestContent = $document -> getLatestContent ();
2017-01-04 16:23:59 +00:00
$txt = $this -> callHook ( 'preDocumentPreview' , $latestContent );
2017-02-13 11:12:07 +00:00
if ( is_string ( $txt ))
echo $txt ;
$txt = $this -> callHook ( 'documentPreview' , $latestContent );
2017-01-04 16:23:59 +00:00
if ( is_string ( $txt ))
echo $txt ;
else {
switch ( $latestContent -> getMimeType ()) {
case 'audio/mpeg' :
case 'audio/mp3' :
case 'audio/ogg' :
case 'audio/wav' :
$this -> contentHeading ( getMLText ( " preview " ));
2017-01-04 16:11:39 +00:00
?>
2020-12-07 19:45:32 +00:00
< audio controls style = " width: 100%; " preload = " false " >
2021-07-05 15:22:04 +00:00
< source src = " <?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument ()->getID(); ?>&version=<?php echo $latestContent->getVersion (); ?> " type = " audio/mpeg " >
2017-01-04 16:11:39 +00:00
</ audio >
2017-11-24 08:30:22 +00:00
< ? php
break ;
2018-01-09 14:37:40 +00:00
case 'video/webm' :
2017-11-24 08:30:22 +00:00
case 'video/mp4' :
2018-02-08 13:26:36 +00:00
case 'video/avi' :
case 'video/msvideo' :
2018-01-30 07:05:00 +00:00
case 'video/x-msvideo' :
2019-12-15 07:03:36 +00:00
case 'video/x-matroska' :
2017-11-24 08:30:22 +00:00
$this -> contentHeading ( getMLText ( " preview " ));
?>
2017-11-22 14:28:09 +00:00
< video controls style = " width: 100%; " >
2021-07-05 14:30:26 +00:00
< source src = " <?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument ()->getID(); ?>&version=<?php echo $latestContent->getVersion (); ?> " type = " video/mp4 " >
2017-11-22 14:28:09 +00:00
</ video >
2017-01-04 16:11:39 +00:00
< ? php
2017-01-04 16:23:59 +00:00
break ;
case 'application/pdf' :
$this -> contentHeading ( getMLText ( " preview " ));
2017-01-04 16:11:39 +00:00
?>
2022-05-01 13:08:35 +00:00
< div style = " width:100%; height: 0; position:relative; padding-top: 141%; " >
< iframe src = " <?= $settings->_httpRoot ?>pdfviewer/web/viewer.html?file=<?php echo urlencode( $settings->_httpRoot .'op/op.ViewOnline.php?documentid='. $latestContent->getDocument ()->getID().'&version='. $latestContent->getVersion ()); ?> " _width = " 100% " _height = " 100% " style = " position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100% " ></ iframe >
</ div >
2017-01-04 16:11:39 +00:00
< ? php
2017-01-04 16:23:59 +00:00
break ;
case 'image/svg+xml' :
2019-11-19 06:28:13 +00:00
case 'image/jpg' :
case 'image/jpeg' :
case 'image/png' :
case 'image/gif' :
2017-01-04 16:23:59 +00:00
$this -> contentHeading ( getMLText ( " preview " ));
2017-01-04 16:11:39 +00:00
?>
2021-07-05 15:22:04 +00:00
< img src = " <?= $settings->_httpRoot ?>op/op.ViewOnline.php?documentid=<?php echo $latestContent->getDocument ()->getID(); ?>&version=<?php echo $latestContent->getVersion (); ?> " width = " 100% " >
2017-01-04 16:11:39 +00:00
< ? php
2017-01-04 16:23:59 +00:00
break ;
default :
$txt = $this -> callHook ( 'additionalDocumentPreview' , $latestContent );
2021-12-17 20:46:28 +00:00
if ( is_string ( $txt )) {
$this -> contentHeading ( getMLText ( " preview " ));
2017-01-04 16:23:59 +00:00
echo $txt ;
2021-12-17 20:46:28 +00:00
}
2017-01-04 16:23:59 +00:00
break ;
}
2016-12-22 08:11:40 +00:00
}
2017-01-04 16:23:59 +00:00
$txt = $this -> callHook ( 'postDocumentPreview' , $latestContent );
if ( is_string ( $txt ))
echo $txt ;
2017-01-04 16:11:39 +00:00
if ( $converttopdf ) {
2019-02-01 08:30:32 +00:00
$pdfpreviewer = new SeedDMS_Preview_PdfPreviewer ( $cachedir , $timeout , $xsendfile );
2021-10-06 13:03:03 +00:00
if ( $conversionmgr )
$pdfpreviewer -> setConversionMgr ( $conversionmgr );
else
$pdfpreviewer -> setConverters ( $pdfconverters );
2017-01-04 16:11:39 +00:00
if ( $pdfpreviewer -> hasConverter ( $latestContent -> getMimeType ())) {
2017-11-24 08:30:22 +00:00
$this -> contentHeading ( getMLText ( " preview_pdf " ));
2016-11-07 08:25:55 +00:00
?>
2022-05-01 13:08:35 +00:00
< div style = " width:100%; height: 0; position:relative; padding-top: 141%; " >
< iframe src = " <?= $settings->_httpRoot ?>pdfviewer/web/viewer.html?file=<?php echo urlencode( $settings->_httpRoot .'op/op.PdfPreview.php?documentid='. $latestContent->getDocument ()->getID().'&version='. $latestContent->getVersion ()); ?> " _width = " 100% " _height = " 700px " style = " position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100% " ></ iframe >
</ div >
2016-11-07 08:25:55 +00:00
< ? php
2017-01-04 16:11:39 +00:00
}
2016-11-07 08:25:55 +00:00
}
2016-05-09 06:21:21 +00:00
}
} /* }}} */
2021-05-06 09:02:20 +00:00
protected function showActions ( $items ) { /* {{{ */
2021-05-12 13:32:25 +00:00
print " <ul class= \" action-list nav nav-pills mb-4 \" > " ;
2021-05-06 09:02:20 +00:00
foreach ( $items as $item ) {
if ( is_string ( $item ))
echo " <li class= \" nav-item \" > " . $item . " </li> " ;
elseif ( is_array ( $item )) {
2023-05-12 07:09:01 +00:00
echo " <li class= \" nav-item m-1 \" ><a class= \" _nav-link btn btn-mini btn-outline-primary btn-sm " . ( ! empty ( $item [ 'class' ]) ? ' ' . $item [ 'class' ] : '' ) . " \" " . ( isset ( $item [ 'link' ]) ? " href= \" " . $item [ 'link' ] . " \" " : '' ) . ( ! empty ( $item [ 'target' ]) ? ' target="' . $item [ 'target' ] . '"' : '' ) . ( ! empty ( $item [ 'title' ]) ? ' title="' . getMLText ( $item [ 'title' ]) . '"' : '' );
2021-05-06 09:02:20 +00:00
if ( ! empty ( $item [ 'attributes' ])) {
foreach ( $item [ 'attributes' ] as $attr ) {
echo ' ' . $attr [ 0 ] . '="' . $attr [ 1 ] . '"' ;
}
}
2021-05-06 10:17:32 +00:00
echo " > " . ( ! empty ( $item [ 'icon' ]) ? " <i class= \" fa fa- " . $item [ 'icon' ] . " \" ></i> " : " " ) . '<span class="d-none d-lg-inline">' . getMLText ( $item [ 'label' ]) . " </span></a></li> " ;
2021-05-06 09:02:20 +00:00
}
}
print " </ul> " ;
return ;
print " <ul class= \" unstyled actions \" > " ;
foreach ( $items as $item ) {
if ( is_string ( $item ))
echo " <li> " . $item . " </li> " ;
elseif ( is_array ( $item )) {
echo " <li><a href= \" " . $item [ 'link' ] . " \" " . ( ! empty ( $item [ 'target' ]) ? ' target="' . $item [ 'target' ] . '"' : '' );
if ( ! empty ( $item [ 'attributes' ])) {
foreach ( $item [ 'attributes' ] as $attr ) {
echo ' ' . $attr [ 0 ] . '="' . $attr [ 1 ] . '"' ;
}
}
echo " > " . ( ! empty ( $item [ 'icon' ]) ? " <i class= \" fa fa- " . $item [ 'icon' ] . " \" ></i> " : " " ) . getMLText ( $item [ 'label' ]) . " </a></li> " ;
}
}
print " </ul> " ;
} /* }}} */
2021-05-06 11:42:18 +00:00
protected function showVersionDetails ( $latestContent , $previewer , $islatest = false ) { /* {{{ */
2021-05-06 10:17:32 +00:00
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$folder = $this -> params [ 'folder' ];
2021-05-06 11:09:45 +00:00
$accessobject = $this -> params [ 'accessobject' ];
2021-05-06 10:17:32 +00:00
$viewonlinefiletypes = $this -> params [ 'viewonlinefiletypes' ];
$enableownerrevapp = $this -> params [ 'enableownerrevapp' ];
2021-05-06 11:09:45 +00:00
$enablereceiptworkflow = $this -> params [ 'enablereceiptworkflow' ];
$enablereceiptreject = $this -> params [ 'enablereceiptreject' ];
$enablerevisionworkflow = $this -> params [ 'enablerevisionworkflow' ];
2021-05-06 10:17:32 +00:00
$workflowmode = $this -> params [ 'workflowmode' ];
2021-05-06 11:09:45 +00:00
$previewwidthdetail = $this -> params [ 'previewWidthDetail' ];
2021-05-06 10:17:32 +00:00
// verify if file exists
$file_exists = file_exists ( $dms -> contentDir . $latestContent -> getPath ());
$status = $latestContent -> getStatus ();
// print "<table class=\"table\">";
// print "<thead>\n<tr>\n";
// print "<th colspan=\"2\">".htmlspecialchars($latestContent->getOriginalFileName())."</th>\n";
// print "</tr></thead><tbody>\n";
// print "<tr>\n";
// print "<td style=\"width:".$previewwidthdetail."px; text-align: center;\">";
2022-09-15 18:04:30 +00:00
// $this->contentHeading(htmlspecialchars($latestContent->getOriginalFileName()));
2021-05-06 10:17:32 +00:00
$this -> rowStart ();
2022-09-15 18:04:30 +00:00
$this -> columnStart ( 3 );
2021-05-06 10:17:32 +00:00
if ( $file_exists ) {
if ( $viewonlinefiletypes && ( in_array ( strtolower ( $latestContent -> getFileType ()), $viewonlinefiletypes ) || in_array ( strtolower ( $latestContent -> getMimeType ()), $viewonlinefiletypes ))) {
2021-05-31 19:53:08 +00:00
if ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' )))
2021-07-05 14:30:26 +00:00
print " <a target= \" _blank \" href= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.ViewOnline.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion () . " \" > " ;
2021-05-06 10:17:32 +00:00
} else {
2021-05-31 19:53:08 +00:00
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'version' )))
2021-07-05 14:30:26 +00:00
print " <a href= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Download.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion () . " \" > " ;
2021-05-06 10:17:32 +00:00
}
}
2021-05-06 10:52:24 +00:00
$previewer -> createPreview ( $latestContent );
2021-05-06 10:17:32 +00:00
if ( $previewer -> hasPreview ( $latestContent )) {
2021-07-05 14:30:26 +00:00
print ( " <img class= \" mimeicon \" width= \" " . $previewwidthdetail . " \" src= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Preview.php?documentid= " . $latestContent -> getDocument () -> getID () . " &version= " . $latestContent -> getVersion () . " &width= " . $previewwidthdetail . " \" title= \" " . htmlspecialchars ( $latestContent -> getMimeType ()) . " \" > " );
2021-05-06 10:17:32 +00:00
} else {
print " <img class= \" mimeicon \" width= \" " . $previewwidthdetail . " \" src= \" " . $this -> getMimeIcon ( $latestContent -> getFileType ()) . " \" title= \" " . htmlspecialchars ( $latestContent -> getMimeType ()) . " \" > " ;
}
2021-05-31 19:53:08 +00:00
if ( $file_exists && ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' )) || $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'version' )))) {
2021-05-06 10:17:32 +00:00
print " </a> " ;
}
// print "</td>\n";
// print "<td>";
$this -> columnEnd ();
2022-09-15 18:04:30 +00:00
$this -> columnStart ( 5 );
2021-05-06 10:17:32 +00:00
print " <ul class= \" actions unstyled \" > \n " ;
2022-09-15 11:08:56 +00:00
print " <li> " . htmlspecialchars ( $latestContent -> getOriginalFileName ()) . " </li> \n " ;
2021-05-06 10:17:32 +00:00
print " <li> " . getMLText ( 'version' ) . " : " . $latestContent -> getVersion () . " </li> \n " ;
2022-09-15 11:08:56 +00:00
if ( $file_exists ) {
print " <li> " . SeedDMS_Core_File :: format_filesize ( $latestContent -> getFileSize ()) . " , " ;
print htmlspecialchars ( $latestContent -> getMimeType ());
2022-11-15 15:05:53 +00:00
if ( $user -> isAdmin ()) {
2022-11-17 10:35:34 +00:00
$realmimetype = SeedDMS_Core_File :: mimetype ( $dms -> contentDir . $latestContent -> getPath ());
2022-11-15 15:05:53 +00:00
if ( $realmimetype != $latestContent -> getMimeType ())
echo " <i class= \" fa fa-exclamation-triangle ajax-click \" data-param1= \" command=setmimetype \" data-param2= \" contentid= " . $latestContent -> getId () . " \" data-param3= \" formtoken= " . createFormKey ( 'setmimetype' ) . " \" title= \" " . htmlspecialchars ( $realmimetype ) . " \" ></i> " ;
}
2022-09-15 11:08:56 +00:00
if ( in_array ( $latestContent -> getMimeType (), [ 'image/jpeg' , 'image/jpg' , 'image/png' , 'image/bmp' ])) {
$imsize = getimagesize ( $dms -> contentDir . $latestContent -> getPath (), $moreinfo );
if ( ! empty ( $moreinfo [ 'APP13' ])) {
echo ', ' . $this -> printPopupBox ( getMLText ( 'iptc_metadata' ), $this -> iptcdata ( iptcparse ( $moreinfo [ 'APP13' ])), true );
}
if ( $imsize [ 0 ] && $imsize [ 1 ])
print ', ' . $imsize [ 0 ] . '× ' . $imsize [ 1 ] . ' px' ;
}
print " </li> " ;
} else print " <li><span class= \" warning \" > " . getMLText ( " document_deleted " ) . " </span></li> " ;
2021-05-06 10:17:32 +00:00
$updatingUser = $latestContent -> getUser ();
print " <li> " . getMLText ( " uploaded_by " ) . " <a href= \" mailto: " . htmlspecialchars ( $updatingUser -> getEmail ()) . " \" > " . htmlspecialchars ( $updatingUser -> getFullName ()) . " </a></li> " ;
print " <li> " . getLongReadableDate ( $latestContent -> getDate ()) . " </li> " ;
print " <li> " . getMLText ( 'status' ) . " : " . getOverallStatusText ( $status [ " status " ]);
if ( $status [ " status " ] == S_DRAFT_REV || $status [ " status " ] == S_DRAFT_APP || $status [ " status " ] == S_IN_WORKFLOW || $status [ " status " ] == S_EXPIRED ){
print " <br><span " . ( $latestContent -> getDocument () -> hasExpired () ? " class= \" warning \" " : " " ) . " > " . ( ! $latestContent -> getDocument () -> getExpires () ? getMLText ( " does_not_expire " ) : getMLText ( " expires " ) . " : " . getReadableDate ( $latestContent -> getDocument () -> getExpires ())) . " </span> " ;
}
print " </li> " ;
print " </ul> \n " ;
$txt = $this -> callHook ( 'showVersionComment' , $latestContent );
if ( $txt ) {
echo $txt ;
} else {
if ( $latestContent -> getComment ())
2023-04-28 09:22:14 +00:00
if ( $this -> params [ 'settings' ] -> _markdownComments ) {
2023-04-04 15:46:08 +00:00
$Parsedown = new Parsedown ();
2023-04-22 17:41:41 +00:00
$comment = $Parsedown -> text ( htmlspecialchars ( $latestContent -> getComment ()));
2023-04-04 15:46:08 +00:00
print " <div class= \" content-comment \" > " . $comment . " </div> " ;
} else {
$comment = htmlspecialchars ( $latestContent -> getComment ());
print " <p style= \" font-style: italic; \" > " . $comment . " </p> " ;
}
2021-05-06 10:17:32 +00:00
}
print " <ul class= \" actions unstyled \" > \n " ;
$this -> printVersionAttributes ( $folder , $latestContent );
print " </ul> " ;
// print "</td>\n";
// print "<td>";
$this -> columnEnd ();
$this -> columnStart ( 4 );
if ( $file_exists ){
$items = array ();
2021-05-31 19:53:08 +00:00
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'version' )))
2021-07-05 14:30:26 +00:00
$items [] = array ( 'link' => $this -> params [ 'settings' ] -> _httpRoot . " op/op.Download.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion (), 'icon' => 'download' , 'label' => 'download' );
2021-05-31 19:53:08 +00:00
if ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' )))
2021-05-31 17:32:39 +00:00
if ( $viewonlinefiletypes && ( in_array ( strtolower ( $latestContent -> getFileType ()), $viewonlinefiletypes ) || in_array ( strtolower ( $latestContent -> getMimeType ()), $viewonlinefiletypes )))
2021-07-05 14:30:26 +00:00
$items [] = array ( 'link' => $this -> params [ 'settings' ] -> _httpRoot . " op/op.ViewOnline.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion (), 'icon' => 'eye' , 'label' => 'view_online' , 'target' => '_blank' );
2021-05-06 10:17:32 +00:00
if ( $newitems = $this -> callHook ( 'extraVersionViews' , $latestContent ))
$items = array_merge ( $items , $newitems );
2021-10-02 05:35:02 +00:00
if ( $items ) {
2021-05-06 10:17:32 +00:00
$this -> showActions ( $items );
}
}
$items = array ();
if ( $file_exists ){
2021-05-06 11:46:15 +00:00
if ( $islatest && $accessobject -> mayEditVersion ( $latestContent -> getDocument ())) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'EditOnline' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'edit' , 'label' => 'edit_version' );
2021-05-06 10:17:32 +00:00
}
}
/* Only admin has the right to remove version in any case or a regular
* user if enableVersionDeletion is on
*/
2021-05-06 11:09:45 +00:00
if ( $accessobject -> mayRemoveVersion ( $latestContent -> getDocument ())) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'RemoveVersion' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'remove' , 'label' => 'rm_version' );
2021-05-06 10:17:32 +00:00
}
2021-05-06 11:46:15 +00:00
if ( $islatest && $accessobject -> mayOverrideStatus ( $latestContent -> getDocument ())) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'OverrideContentStatus' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'align-justify' , 'label' => 'change_status' );
2021-05-06 10:17:32 +00:00
}
2021-05-06 11:46:15 +00:00
if ( $islatest && $enablereceiptworkflow && $accessobject -> check_controller_access ( 'SetRecipients' ))
2021-05-06 11:09:45 +00:00
if ( $accessobject -> maySetRecipients ( $latestContent -> getDocument ())) {
$items [] = array ( 'link' => " ../out/out.SetRecipients.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion (), 'icon' => 'check' , 'label' => 'change_recipients' );
}
2021-05-06 11:46:15 +00:00
if ( $islatest && $enablerevisionworkflow && $accessobject -> check_controller_access ( 'SetRevisors' ))
2021-05-06 11:09:45 +00:00
if ( $accessobject -> maySetRevisors ( $latestContent -> getDocument ())) {
2021-07-05 15:22:04 +00:00
$items [] = array ( 'link' => $this -> params [ 'settings' ] -> _httpRoot . " out/out.SetRevisors.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion (), 'icon' => 'refresh' , 'label' => 'change_revisors' );
2021-05-06 11:09:45 +00:00
}
2024-02-02 15:07:17 +00:00
if ( $islatest ) {
2021-05-06 10:17:32 +00:00
if ( $workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval' ) {
// Allow changing reviewers/approvals only if not reviewed
2021-05-06 11:09:45 +00:00
if ( $accessobject -> maySetReviewersApprovers ( $latestContent -> getDocument ())) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'SetReviewersApprovers' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'edit' , 'label' => 'change_assignments' );
2021-05-06 10:17:32 +00:00
}
} elseif ( $workflowmode == 'advanced' ) {
2021-05-06 11:09:45 +00:00
if ( $accessobject -> maySetWorkflow ( $latestContent -> getDocument ())) {
2021-05-31 19:54:16 +00:00
$workflow = $latestContent -> getWorkflow ();
2021-05-06 10:17:32 +00:00
if ( ! $workflow ) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'SetWorkflow' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'random' , 'label' => 'set_workflow' );
2021-05-06 10:17:32 +00:00
}
}
}
2021-05-06 11:09:45 +00:00
if ( $accessobject -> check_controller_access ( 'AddToTransmittal' ))
if ( $dms -> getAllTransmittals ( $user )) {
if ( $accessobject -> check_view_access ( 'AddToTransmittal' ))
$items [] = array ( 'link' => " out.AddToTransmittal.php?documentid= " . $latestContent -> getDocument () -> getId () . " &version= " . $latestContent -> getVersion (), 'icon' => 'list' , 'label' => 'add_to_transmittal' );
}
2023-11-12 18:05:54 +00:00
}
2021-06-22 09:33:54 +00:00
if ( $accessobject -> check_view_access ( 'EditComment' ))
if ( $accessobject -> mayEditComment ( $latestContent -> getDocument ())) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'EditComment' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'comment' , 'label' => 'edit_comment' );
2021-06-22 09:33:54 +00:00
}
if ( $accessobject -> check_view_access ( 'EditAttributes' ))
if ( $accessobject -> mayEditAttributes ( $latestContent -> getDocument ())) {
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'EditAttributes' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'edit' , 'label' => 'edit_attributes' );
2021-06-22 09:33:54 +00:00
}
2021-05-06 11:42:18 +00:00
if ( ! $islatest )
2021-07-07 06:26:13 +00:00
$items [] = array ( 'link' => $this -> html_url ( 'DocumentVersionDetail' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion ())), 'icon' => 'info' , 'label' => 'details' );
2021-05-06 10:17:32 +00:00
if ( $newitems = $this -> callHook ( 'extraVersionActions' , $latestContent ))
$items = array_merge ( $items , $newitems );
if ( $items ) {
$this -> showActions ( $items );
}
// echo "</td>";
// print "</tr></tbody>\n</table>\n";
$this -> columnEnd ();
$this -> rowEnd ();
} /* }}} */
2012-12-14 07:53:13 +00:00
function show () { /* {{{ */
2013-04-18 20:20:28 +00:00
parent :: show ();
2019-03-14 06:48:20 +00:00
$this -> callHook ( 'preViewDocument' );
2012-12-14 07:53:13 +00:00
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$folder = $this -> params [ 'folder' ];
$document = $this -> params [ 'document' ];
2019-11-20 12:47:57 +00:00
$accessobject = $this -> params [ 'accessobject' ];
2012-12-14 07:53:13 +00:00
$viewonlinefiletypes = $this -> params [ 'viewonlinefiletypes' ];
2021-07-16 14:03:34 +00:00
$enableDropUpload = $this -> params [ 'enableDropUpload' ];
2013-09-19 12:27:09 +00:00
$enableownerrevapp = $this -> params [ 'enableownerrevapp' ];
2021-07-01 10:17:04 +00:00
$enableremoverevapp = $this -> params [ 'enableremoverevapp' ];
2017-01-04 16:11:39 +00:00
$enableownerreceipt = $this -> params [ 'enableownerreceipt' ];
2018-04-03 07:32:36 +00:00
$enablereceiptworkflow = $this -> params [ 'enablereceiptworkflow' ];
2019-04-12 06:54:25 +00:00
$enablereceiptreject = $this -> params [ 'enablereceiptreject' ];
2018-04-03 07:32:36 +00:00
$enablerevisionworkflow = $this -> params [ 'enablerevisionworkflow' ];
2013-01-24 09:39:14 +00:00
$workflowmode = $this -> params [ 'workflowmode' ];
2012-12-19 10:28:36 +00:00
$cachedir = $this -> params [ 'cachedir' ];
2021-10-06 13:03:03 +00:00
$conversionmgr = $this -> params [ 'conversionmgr' ];
2014-03-18 09:55:24 +00:00
$previewwidthlist = $this -> params [ 'previewWidthList' ];
$previewwidthdetail = $this -> params [ 'previewWidthDetail' ];
2017-01-04 16:11:39 +00:00
$previewconverters = $this -> params [ 'previewConverters' ];
2017-11-22 12:53:30 +00:00
$pdfconverters = $this -> params [ 'pdfConverters' ];
2012-12-14 07:53:13 +00:00
$documentid = $document -> getId ();
2015-06-09 07:18:29 +00:00
$currenttab = $this -> params [ 'currenttab' ];
2016-02-15 09:57:37 +00:00
$timeout = $this -> params [ 'timeout' ];
2019-01-18 12:07:39 +00:00
$xsendfile = $this -> params [ 'xsendfile' ];
2012-12-14 07:53:13 +00:00
2019-02-06 12:22:52 +00:00
$versions = $this -> callHook ( 'documentVersions' , $document );
if ( $versions === null )
$versions = $document -> getContent ();
2012-12-14 07:53:13 +00:00
2021-07-05 14:30:26 +00:00
$this -> htmlAddHeader ( '<link href="' . $this -> params [ 'settings' ] -> _httpRoot . 'styles/bootstrap/timeline/timeline.css" rel="stylesheet">' . " \n " , 'css' );
$this -> htmlAddHeader ( '<script type="text/javascript" src="' . $this -> params [ 'settings' ] -> _httpRoot . 'styles/bootstrap/timeline/timeline-min.js"></script>' . " \n " , 'js' );
$this -> htmlAddHeader ( '<script type="text/javascript" src="' . $this -> params [ 'settings' ] -> _httpRoot . 'styles/bootstrap/timeline/timeline-locales.js"></script>' . " \n " , 'js' );
$this -> htmlAddHeader ( '<script type="text/javascript" src="' . $this -> params [ 'settings' ] -> _httpRoot . 'views/' . $this -> theme . '/vendors/jquery-validation/jquery.validate.js"></script>' . " \n " , 'js' );
$this -> htmlAddHeader ( '<script type="text/javascript" src="' . $this -> params [ 'settings' ] -> _httpRoot . 'views/' . $this -> theme . '/styles/validation-default.js"></script>' . " \n " , 'js' );
2015-09-16 19:19:46 +00:00
2012-12-14 07:53:13 +00:00
$this -> htmlStartPage ( getMLText ( " document_title " , array ( " documentname " => htmlspecialchars ( $document -> getName ()))));
$this -> globalNavigation ( $folder );
$this -> contentStart ();
2013-03-08 16:55:14 +00:00
$this -> pageNavigation ( $this -> getFolderPathHTML ( $folder , true , $document ), " view_document " , $document );
2012-12-14 07:53:13 +00:00
2019-10-18 09:06:42 +00:00
echo $this -> callHook ( 'preContent' );
2012-12-14 07:53:13 +00:00
if ( $document -> isLocked ()) {
$lockingUser = $document -> getLockingUser ();
2015-04-14 17:38:50 +00:00
$txt = $this -> callHook ( 'documentIsLocked' , $document , $lockingUser );
if ( is_string ( $txt ))
echo $txt ;
else {
2021-07-15 15:43:50 +00:00
$this -> warningMsg ( getMLText ( " lock_message " , array ( " email " => $lockingUser -> getEmail (), " username " => htmlspecialchars ( $lockingUser -> getFullName ()))));
2015-04-14 17:38:50 +00:00
}
2012-12-14 07:53:13 +00:00
}
2013-03-28 09:18:49 +00:00
2017-10-16 07:07:04 +00:00
/* Retrieve latest content and attacheѕ files */
2019-02-06 12:22:52 +00:00
$latestContent = $this -> callHook ( 'documentLatestContent' , $document );
if ( $latestContent === null )
$latestContent = $document -> getLatestContent ();
2016-11-24 10:42:53 +00:00
$files = $document -> getDocumentFiles ( $latestContent -> getVersion ());
$files = SeedDMS_Core_DMS :: filterDocumentFiles ( $user , $files );
2013-03-28 09:18:49 +00:00
/* Retrieve linked documents */
$links = $document -> getDocumentLinks ();
2017-01-16 12:01:09 +00:00
$links = SeedDMS_Core_DMS :: filterDocumentLinks ( $user , $links , 'target' );
2013-03-28 09:18:49 +00:00
2014-03-18 06:07:12 +00:00
/* Retrieve reverse linked documents */
$reverselinks = $document -> getReverseDocumentLinks ();
2017-01-16 12:01:09 +00:00
$reverselinks = SeedDMS_Core_DMS :: filterDocumentLinks ( $user , $reverselinks , 'source' );
2014-03-18 06:07:12 +00:00
2013-04-18 11:38:02 +00:00
$needwkflaction = false ;
2021-06-01 08:54:06 +00:00
$transitions = array ();
2015-03-16 07:58:10 +00:00
if ( $workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval' ) {
2019-12-19 15:08:10 +00:00
} elseif ( $workflowmode == 'advanced' ) {
2013-04-18 11:38:02 +00:00
$workflow = $latestContent -> getWorkflow ();
if ( $workflow ) {
2021-06-01 08:54:06 +00:00
if ( $workflowstate = $latestContent -> getWorkflowState ()) {
$transitions = $workflow -> getNextTransitions ( $workflowstate );
$needwkflaction = $latestContent -> needsWorkflowAction ( $user );
} else {
$this -> warningMsg ( getMLText ( 'workflow_in_unknown_state' ));
}
2013-04-18 11:38:02 +00:00
}
}
if ( $needwkflaction ) {
$this -> infoMsg ( getMLText ( 'needs_workflow_action' ));
}
2013-04-30 16:14:05 +00:00
$reviewStatus = $latestContent -> getReviewStatus ();
2014-05-22 04:46:44 +00:00
$approvalStatus = $latestContent -> getApprovalStatus ();
2017-01-04 16:11:39 +00:00
$receiptStatus = $latestContent -> getReceiptStatus ();
$revisionStatus = $latestContent -> getRevisionStatus ();
2012-12-14 07:53:13 +00:00
2020-10-08 05:57:23 +00:00
$this -> rowStart ();
$this -> columnStart ( 4 );
2018-12-13 14:46:25 +00:00
$txt = $this -> callHook ( 'startLeftColumn' , $document );
if ( is_string ( $txt ))
echo $txt ;
2016-12-22 08:31:46 +00:00
$this -> documentInfos ();
2019-11-20 12:47:57 +00:00
if ( $accessobject -> check_controller_access ( 'ViewOnline' , array ( 'action' => 'run' ))) {
2016-11-09 18:54:00 +00:00
$this -> preview ();
}
2020-10-08 05:57:23 +00:00
$this -> columnEnd ();
$this -> columnStart ( 8 );
2020-09-18 17:11:25 +00:00
$txt = $this -> callHook ( 'startRightColumn' , $document );
if ( is_string ( $txt ))
echo $txt ;
?>
2021-05-04 07:57:23 +00:00
< ul class = " nav nav-pills " id = " docinfotab " role = " tablist " >
2022-06-22 14:45:37 +00:00
< li class = " nav-item <?php if(! $currenttab || $currenttab == 'docinfo') echo 'active'; ?> " >< a class = " nav-link <?php if(! $currenttab || $currenttab == 'docinfo') echo 'active'; ?> " data - target = " #docinfo " data - toggle = " tab " role = " button " >< ? php printMLText ( 'current_version' ); ?> </a></li>
2023-04-20 11:28:03 +00:00
< ? php if ( count ( $versions ) > 1 && $accessobject -> check_view_access ( $this , array ( 'action' => 'previous' ))) { ?>
2022-06-22 14:45:37 +00:00
< li class = " nav-item <?php if( $currenttab == 'previous') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'previous') echo 'active'; ?> " data - target = " #previous " data - toggle = " tab " role = " button " >< ? php printMLText ( 'previous_versions' ); ?> </a></li>
2013-04-30 17:26:33 +00:00
< ? php
}
2015-03-16 07:58:10 +00:00
if ( $workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval' ) {
2013-04-30 17:26:33 +00:00
if (( is_array ( $reviewStatus ) && count ( $reviewStatus ) > 0 ) ||
( is_array ( $approvalStatus ) && count ( $approvalStatus ) > 0 )) {
?>
2022-06-22 14:45:37 +00:00
< li class = " nav-item <?php if( $currenttab == 'revapp') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'revapp') echo 'active'; ?> " data - target = " #revapp " data - toggle = " tab " role = " button " >< ? php if ( $workflowmode == 'traditional' ) echo getMLText ( 'reviewers' ) . " / " ; echo getMLText ( 'approvers' ); ?> </a></li>
2013-04-30 17:26:33 +00:00
< ? php
}
2019-12-19 15:08:10 +00:00
} elseif ( $workflowmode == 'advanced' ) {
2013-04-30 17:26:33 +00:00
if ( $workflow ) {
?>
2022-06-22 14:45:37 +00:00
< li class = " nav-item <?php if( $currenttab == 'workflow') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'workflow') echo 'active'; ?> " data - target = " #workflow " data - toggle = " tab " role = " button " >< ? php echo getMLText ( 'workflow' ); ?> </a></li>
2013-04-30 17:26:33 +00:00
< ? php
}
}
2023-04-20 11:28:03 +00:00
if ( is_array ( $receiptStatus ) && count ( $receiptStatus ) > 0 && $accessobject -> check_view_access ( $this , array ( 'action' => 'recipients' ))) {
2015-04-28 10:18:35 +00:00
?>
2022-06-22 14:48:26 +00:00
< li class = " nav-item <?php if( $currenttab == 'recipients') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'recipients') echo 'active'; ?> " data - target = " #recipients " data - toggle = " tab " role = " button " >< ? php echo getMLText ( 'recipients' ); ?> </a></li>
2015-05-11 07:30:13 +00:00
< ? php
}
2023-04-20 11:28:03 +00:00
if ( is_array ( $revisionStatus ) && count ( $revisionStatus ) > 0 && $accessobject -> check_view_access ( $this , array ( 'action' => 'revision' ))) {
2015-05-11 07:30:13 +00:00
?>
2022-06-22 14:48:26 +00:00
< li class = " nav-item <?php if( $currenttab == 'revision') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'revision') echo 'active'; ?> " data - target = " #revision " data - toggle = " tab " role = " button " >< ? php echo getMLText ( 'revise_document' ); ?> </a></li>
2015-04-28 10:18:35 +00:00
< ? php
}
2023-04-20 11:28:03 +00:00
if ( $accessobject -> check_view_access ( $this , array ( 'action' => 'attachments' ))) {
2013-04-30 17:26:33 +00:00
?>
2022-06-22 14:45:37 +00:00
< li class = " nav-item <?php if( $currenttab == 'attachments') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'attachments') echo 'active'; ?> " data - target = " #attachments " data - toggle = " tab " role = " button " >< ? php printMLText ( 'linked_files' ); echo ( count ( $files )) ? " ( " . count ( $files ) . " ) " : " " ; ?> </a></li>
2023-04-20 11:28:03 +00:00
< ? php
}
if ( $accessobject -> check_view_access ( $this , array ( 'action' => 'links' ))) {
?>
2022-06-22 14:45:37 +00:00
< li class = " nav-item <?php if( $currenttab == 'links') echo 'active'; ?> " >< a class = " nav-link <?php if( $currenttab == 'links') echo 'active'; ?> " data - target = " #links " data - toggle = " tab " role = " button " >< ? php printMLText ( 'linked_documents' ); echo ( count ( $links ) || count ( $reverselinks )) ? " ( " . count ( $links ) . " / " . count ( $reverselinks ) . " ) " : " " ; ?> </a></li>
2018-04-13 12:53:06 +00:00
< ? php
2023-04-20 11:28:03 +00:00
}
2018-04-13 12:53:06 +00:00
$tabs = $this -> callHook ( 'extraTabs' , $document );
if ( $tabs ) {
foreach ( $tabs as $tabid => $tab ) {
2022-06-22 14:45:37 +00:00
echo '<li class="nav-item ' . ( $currenttab == $tabid ? 'active' : '' ) . '"><a class="nav-link ' . ( $currenttab == $tabid ? 'active' : '' ) . '" data-target="#' . $tabid . '" data-toggle="tab" role="button">' . $tab [ 'title' ] . '</a></li>' ;
2018-04-13 12:53:06 +00:00
}
}
?>
2013-04-30 17:26:33 +00:00
</ ul >
< div class = " tab-content " >
2021-05-04 07:57:23 +00:00
< div class = " tab-pane <?php if(! $currenttab || $currenttab == 'docinfo') echo 'active'; ?> " id = " docinfo " role = " tabpanel " >
2012-12-14 07:53:13 +00:00
< ? php
2013-04-18 11:38:02 +00:00
if ( ! $latestContent ) {
2012-12-14 07:53:13 +00:00
$this -> contentContainerStart ();
print getMLText ( 'document_content_missing' );
$this -> contentContainerEnd ();
2016-03-15 07:30:53 +00:00
$this -> contentEnd ();
2012-12-14 07:53:13 +00:00
$this -> htmlEndPage ();
exit ;
}
2021-01-26 17:06:17 +00:00
$checksum = SeedDMS_Core_File :: checksum ( $dms -> contentDir . $latestContent -> getPath ());
2021-01-26 12:30:15 +00:00
if ( $checksum != $latestContent -> getChecksum ()) {
$this -> errorMsg ( getMLText ( 'wrong_checksum' ));
}
2020-09-18 17:24:18 +00:00
$txt = $this -> callHook ( 'preLatestVersionTab' , $latestContent );
if ( is_string ( $txt ))
echo $txt ;
2012-12-14 07:53:13 +00:00
$this -> contentContainerStart ();
2019-01-18 12:07:39 +00:00
$previewer = new SeedDMS_Preview_Previewer ( $cachedir , $previewwidthdetail , $timeout , $xsendfile );
2021-10-06 13:03:03 +00:00
if ( $conversionmgr )
$previewer -> setConversionMgr ( $conversionmgr );
else
$previewer -> setConverters ( $previewconverters );
2021-05-06 11:42:18 +00:00
$this -> showVersionDetails ( $latestContent , $previewer , true );
2013-01-28 10:44:53 +00:00
$this -> contentContainerEnd ();
2013-01-24 09:39:14 +00:00
2023-07-19 04:43:47 +00:00
if ( $accessobject -> check_view_access ( $this , array ( 'action' => 'statuslog' ))) {
2013-01-28 10:44:53 +00:00
$this -> contentHeading ( getMLText ( " status " ));
$this -> contentContainerStart ();
2013-05-17 07:27:15 +00:00
$statuslog = $latestContent -> getStatusLog ();
2021-04-18 05:08:00 +00:00
echo " <table class= \" table table-condensed table-sm \" ><thead> " ;
2021-05-03 06:04:54 +00:00
echo " <th> " . getMLText ( 'date' ) . " / " . getMLText ( 'user' ) . " </th><th> " . getMLText ( 'status' ) . " </th><th> " . getMLText ( 'comment' ) . " </th></tr> \n " ;
2013-01-24 09:39:14 +00:00
echo " </thead><tbody> " ;
2013-05-17 07:27:15 +00:00
foreach ( $statuslog as $entry ) {
2013-03-26 19:30:39 +00:00
if ( $suser = $dms -> getUser ( $entry [ 'userID' ]))
2019-06-28 09:02:10 +00:00
$fullname = htmlspecialchars ( $suser -> getFullName ());
2013-03-26 19:30:39 +00:00
else
$fullname = " -- " ;
2021-05-03 06:04:54 +00:00
echo " <tr><td> " . getLongReadableDate ( $entry [ 'date' ]) . " <br /> " . $fullname . " </td><td> " . getOverallStatusText ( $entry [ 'status' ]) . " </td><td> " . htmlspecialchars ( $entry [ 'comment' ]) . " </td></tr> \n " ;
2013-01-24 09:39:14 +00:00
}
print " </tbody> \n </table> \n " ;
2013-01-28 10:44:53 +00:00
$this -> contentContainerEnd ();
2013-01-24 09:39:14 +00:00
}
2023-11-12 16:36:01 +00:00
2024-01-31 06:37:54 +00:00
if ( $workflowmode == 'advanced' && ! $workflow ) {
2023-11-12 16:36:01 +00:00
if ( $accessobject -> check_view_access ( $this , array ( 'action' => 'finished_workflowlog' ))) {
$wkfalllogs = $latestContent -> getWorkflowLog ();
if ( $wkfalllogs ) {
$this -> contentHeading ( getMLText ( " finished_workflow_log " ));
foreach ( $wkfalllogs as $wkflogs ) {
$this -> rowStart ();
$this -> columnStart ( 12 );
$this -> printWorkflowLog ( $wkflogs );
$this -> columnEnd ();
$this -> rowEnd ();
}
}
}
}
2012-12-14 07:53:13 +00:00
?>
2013-01-28 10:44:53 +00:00
</ div >
2013-01-24 09:39:14 +00:00
< ? php
2015-03-16 07:58:10 +00:00
if ( $workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval' ) {
2013-04-30 16:14:05 +00:00
if (( is_array ( $reviewStatus ) && count ( $reviewStatus ) > 0 ) ||
( is_array ( $approvalStatus ) && count ( $approvalStatus ) > 0 )) {
2013-01-24 09:39:14 +00:00
?>
2021-05-04 07:57:23 +00:00
< div class = " tab-pane <?php if( $currenttab == 'revapp') echo 'active'; ?> " id = " revapp " role = " tabpanel " >
2012-12-14 07:53:13 +00:00
< ? php
2021-05-27 19:53:49 +00:00
if ( $document -> hasExpired ())
$this -> warningMsg ( getMLText ( 'cannot_revapp_expired_docs' ));
2020-10-08 05:57:23 +00:00
$this -> rowStart ();
2015-06-02 08:18:37 +00:00
/* Just check fo an exting reviewStatus , even workflow mode is set
* to traditional_only_approval . There may be old documents which
* are still in S_DRAFT_REV .
*/
if ( /*$workflowmode != 'traditional_only_approval' &&*/ is_array ( $reviewStatus ) && count ( $reviewStatus ) > 0 ) {
2012-12-14 07:53:13 +00:00
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 6 );
2019-09-10 15:42:58 +00:00
// $this->contentContainerStart();
print " <legend> " . getMLText ( 'reviewers' ) . " </legend> " ;
2021-04-18 05:08:00 +00:00
print " <table class= \" table table-condensed table-sm \" > \n " ;
2019-09-10 15:42:58 +00:00
2012-12-14 07:53:13 +00:00
print " <tr> \n " ;
2018-06-27 20:14:34 +00:00
print " <th> " . getMLText ( " name " ) . " </th> \n " ;
print " <th> " . getMLText ( " last_update " ) . " , " . getMLText ( " comment " ) . " </th> \n " ;
2018-06-27 16:55:14 +00:00
// print "<td width='25%'><b>".getMLText("comment")."</b></td>";
2018-06-27 20:14:34 +00:00
print " <th> " . getMLText ( " status " ) . " </th> \n " ;
print " <th></th> \n " ;
2012-12-14 07:53:13 +00:00
print " </tr> \n " ;
foreach ( $reviewStatus as $r ) {
2020-09-23 05:25:31 +00:00
$class = '' ;
switch ( $r [ 'status' ]) {
case '-1' :
$class = 'error' ;
break ;
case '1' :
$class = 'success' ;
break ;
}
2012-12-14 07:53:13 +00:00
$required = null ;
$is_reviewer = false ;
2017-07-21 11:52:57 +00:00
$accesserr = '' ;
2012-12-14 07:53:13 +00:00
switch ( $r [ " type " ]) {
case 0 : // Reviewer is an individual.
$required = $dms -> getUser ( $r [ " required " ]);
if ( ! is_object ( $required )) {
$reqName = getMLText ( " unknown_user " ) . " ' " . $r [ " required " ] . " ' " ;
}
else {
2020-08-27 05:52:52 +00:00
$reqName = " <i class= \" fa fa-user \" ></i> " . htmlspecialchars ( $required -> getFullName () . " ( " . $required -> getLogin () . " ) " );
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
if ( $document -> getAccessMode ( $required ) < M_READ || $latestContent -> getAccessMode ( $required ) < M_READ )
$accesserr = getMLText ( " access_denied " );
elseif ( is_object ( $required ) && $required -> isDisabled ())
$accesserr = getMLText ( " login_disabled_title " );
}
2016-10-27 12:23:26 +00:00
if ( $required -> getId () == $user -> getId () /* && ($user->getId() != $owner->getId() || $enableownerrevapp == 1)*/ )
2016-03-08 15:07:42 +00:00
$is_reviewer = true ;
2012-12-14 07:53:13 +00:00
}
break ;
case 1 : // Reviewer is a group.
$required = $dms -> getGroup ( $r [ " required " ]);
if ( ! is_object ( $required )) {
$reqName = getMLText ( " unknown_group " ) . " ' " . $r [ " required " ] . " ' " ;
}
else {
2020-08-27 05:52:52 +00:00
$reqName = " <i class= \" fa fa-group \" ></i> " . htmlspecialchars ( $required -> getName ());
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
$grpusers = $required -> getUsers ();
if ( ! $grpusers )
$accesserr = getMLText ( " no_group_members " );
}
2016-10-27 12:23:26 +00:00
if ( $required -> isMember ( $user ) /* && ($user->getId() != $owner->getId() || $enableownerrevapp == 1)*/ )
2013-03-28 09:18:49 +00:00
$is_reviewer = true ;
2012-12-14 07:53:13 +00:00
}
break ;
}
2017-12-18 12:20:33 +00:00
if ( $user -> isAdmin () || $r [ " status " ] > - 2 ) {
2020-09-23 05:25:31 +00:00
print " <tr> \n " ;
2017-12-18 12:20:33 +00:00
print " <td> " . $reqName . " </td> \n " ;
2020-12-01 20:43:10 +00:00
print " <td><i style= \" font-size: 80%; \" > " . getLongReadableDate ( $r [ " date " ]) . " - " ;
2017-12-18 12:20:33 +00:00
/* $updateUser is the user who has done the review */
$updateUser = $dms -> getUser ( $r [ " userID " ]);
2018-07-03 08:54:26 +00:00
print ( is_object ( $updateUser ) ? htmlspecialchars ( $updateUser -> getFullName () . " ( " . $updateUser -> getLogin () . " ) " ) : " unknown user id ' " . $r [ " userID " ] . " ' " ) . " </i><br /> " ;
print htmlspecialchars ( $r [ " comment " ]);
2017-12-18 12:20:33 +00:00
if ( $r [ 'file' ]) {
echo " <br /> " ;
2019-11-20 12:47:57 +00:00
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'run' ))) {
2021-07-05 15:22:04 +00:00
echo " <a href= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Download.php?documentid= " . $latestContent -> getDocument () -> getId () . " &reviewlogid= " . $r [ 'reviewLogID' ] . " \" class= \" btn btn-secondary btn-mini \" ><i class= \" fa fa-download \" ></i> " . getMLText ( 'download' ) . " </a> " ;
2017-12-18 12:20:33 +00:00
}
2016-08-11 10:05:36 +00:00
}
2017-12-18 12:20:33 +00:00
print " </td> \n " ;
2020-09-23 05:25:31 +00:00
print " <td> " ;
if ( $class )
echo " <i class= \" fa fa-circle text- " . $class . " \" ></i> " ;
print getReviewStatusText ( $r [ " status " ]) . " </td> \n " ;
2021-04-18 05:08:00 +00:00
print " <td><ul class= \" actions unstyled \" > " ;
2017-12-18 12:20:33 +00:00
if ( $accesserr )
2024-02-07 08:41:40 +00:00
echo " <li><span class= \" text-error text-danger \" > " . $accesserr . " </span></li> " ;
2017-12-18 12:20:33 +00:00
2020-04-14 15:44:27 +00:00
if ( $accessobject -> mayReview ( $latestContent -> getDocument ())) {
2017-12-18 12:20:33 +00:00
if ( $is_reviewer ) {
if ( $r [ " status " ] == 0 ) {
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ReviewDocument' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion (), 'reviewid' => $r [ 'reviewID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " add_review " ), false , true , array ( '<li>' , '</li>' ));
2020-04-14 15:44:27 +00:00
} elseif ( $accessobject -> mayUpdateReview ( $latestContent -> getDocument (), $updateUser ) && (( $r [ " status " ] == 1 ) || ( $r [ " status " ] ==- 1 ))){
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ReviewDocument' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion (), 'reviewid' => $r [ 'reviewID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " edit " ), false , true , array ( '<li>' , '</li>' ));
2017-12-18 12:20:33 +00:00
}
2017-01-16 12:02:15 +00:00
}
2012-12-14 07:53:13 +00:00
}
2021-07-01 10:25:19 +00:00
if ( $enableremoverevapp && $user -> isAdmin () && ( $r [ 'status' ] == 1 || $r [ 'status' ] == - 1 ))
2021-07-07 06:26:13 +00:00
echo '<li><a href="' . $this -> html_url ( 'RemoveReviewLog' , array ( 'documentid' => $document -> getID (), 'version' => $latestContent -> getVersion (), 'reviewid' => $r [ 'reviewID' ])) . '" title="' . getMLText ( 'remove_review_log' ) . '"><i class="fa fa-remove"></i></a></li>' ;
2020-09-23 06:53:05 +00:00
2017-12-18 12:20:33 +00:00
print " </ul></td> \n " ;
print " </tr> \n " ;
}
2012-12-14 07:53:13 +00:00
}
2019-09-10 15:42:58 +00:00
print " </table> " ;
2018-06-27 16:55:14 +00:00
// $this->contentContainerEnd();
2012-12-14 07:53:13 +00:00
2020-10-08 05:57:23 +00:00
$this -> columnEnd ();
2019-09-10 15:42:58 +00:00
}
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 6 );
2018-06-27 16:55:14 +00:00
// $this->contentContainerStart();
print " <legend> " . getMLText ( 'approvers' ) . " </legend> " ;
2021-04-18 05:08:00 +00:00
print " <table class= \" table table-condensed table-sm \" > \n " ;
2012-12-14 07:53:13 +00:00
if ( is_array ( $approvalStatus ) && count ( $approvalStatus ) > 0 ) {
print " <tr> \n " ;
2018-06-27 20:14:34 +00:00
print " <th> " . getMLText ( " name " ) . " </th> \n " ;
print " <th> " . getMLText ( " last_update " ) . " , " . getMLText ( " comment " ) . " </th> \n " ;
2018-06-27 16:55:14 +00:00
// print "<td width='25%'><b>".getMLText("comment")."</b></td>";
2018-06-27 20:14:34 +00:00
print " <th> " . getMLText ( " status " ) . " </th> \n " ;
print " <th></th> \n " ;
2012-12-14 07:53:13 +00:00
print " </tr> \n " ;
foreach ( $approvalStatus as $a ) {
2020-09-23 05:25:31 +00:00
$class = '' ;
switch ( $a [ 'status' ]) {
case '-1' :
$class = 'error' ;
break ;
case '1' :
$class = 'success' ;
break ;
}
2012-12-14 07:53:13 +00:00
$required = null ;
$is_approver = false ;
2017-07-21 11:52:57 +00:00
$accesserr = '' ;
2012-12-14 07:53:13 +00:00
switch ( $a [ " type " ]) {
case 0 : // Approver is an individual.
$required = $dms -> getUser ( $a [ " required " ]);
if ( ! is_object ( $required )) {
2013-04-08 07:12:56 +00:00
$reqName = getMLText ( " unknown_user " ) . " ' " . $a [ " required " ] . " ' " ;
2012-12-14 07:53:13 +00:00
}
else {
2020-08-27 05:52:52 +00:00
$reqName = " <i class= \" fa fa-user \" ></i> " . htmlspecialchars ( $required -> getFullName () . " ( " . $required -> getLogin () . " ) " );
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
if ( $document -> getAccessMode ( $required ) < M_READ || $latestContent -> getAccessMode ( $required ) < M_READ )
$accesserr = getMLText ( " access_denied " );
elseif ( is_object ( $required ) && $required -> isDisabled ())
$accesserr = getMLText ( " login_disabled_title " );
}
2016-03-08 15:07:42 +00:00
if ( $required -> getId () == $user -> getId ())
$is_approver = true ;
2012-12-14 07:53:13 +00:00
}
break ;
case 1 : // Approver is a group.
$required = $dms -> getGroup ( $a [ " required " ]);
if ( ! is_object ( $required )) {
2013-04-08 07:12:56 +00:00
$reqName = getMLText ( " unknown_group " ) . " ' " . $a [ " required " ] . " ' " ;
2012-12-14 07:53:13 +00:00
}
else {
2020-08-27 05:52:52 +00:00
$reqName = " <i class= \" fa fa-group \" ></i> " . htmlspecialchars ( $required -> getName ());
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
$grpusers = $required -> getUsers ();
if ( ! $grpusers )
$accesserr = getMLText ( " no_group_members " );
}
2016-10-27 12:23:26 +00:00
if ( $required -> isMember ( $user ) /* && ($user->getId() != $owner->getId() || $enableownerrevapp == 1)*/ )
2016-03-08 15:07:42 +00:00
$is_approver = true ;
2012-12-14 07:53:13 +00:00
}
break ;
}
2018-02-05 13:10:18 +00:00
if ( $user -> isAdmin () || $a [ " status " ] > - 2 ) {
2020-09-23 05:25:31 +00:00
print " <tr> \n " ;
2017-12-18 12:20:33 +00:00
print " <td> " . $reqName . " </td> \n " ;
2020-12-01 20:43:10 +00:00
print " <td><i style= \" font-size: 80%; \" > " . getLongReadableDate ( $a [ " date " ]) . " - " ;
2017-12-18 12:20:33 +00:00
/* $updateUser is the user who has done the approval */
$updateUser = $dms -> getUser ( $a [ " userID " ]);
2018-07-03 08:54:26 +00:00
print ( is_object ( $updateUser ) ? htmlspecialchars ( $updateUser -> getFullName () . " ( " . $updateUser -> getLogin () . " ) " ) : " unknown user id ' " . $a [ " userID " ] . " ' " ) . " </i><br /> " ;
print htmlspecialchars ( $a [ " comment " ]);
2017-12-18 12:20:33 +00:00
if ( $a [ 'file' ]) {
echo " <br /> " ;
2019-11-20 12:47:57 +00:00
if ( $accessobject -> check_controller_access ( 'Download' , array ( 'action' => 'run' ))) {
2021-07-05 15:22:04 +00:00
echo " <a href= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.Download.php?documentid= " . $latestContent -> getDocument () -> getId () . " &approvelogid= " . $a [ 'approveLogID' ] . " \" class= \" btn btn-secondary btn-mini \" ><i class= \" fa fa-download \" ></i> " . getMLText ( 'download' ) . " </a> " ;
2017-12-18 12:20:33 +00:00
}
2016-08-11 10:05:36 +00:00
}
2017-12-18 12:20:33 +00:00
echo " </td> \n " ;
2020-09-23 05:25:31 +00:00
print " <td> " ;
if ( $class )
echo " <i class= \" fa fa-circle text- " . $class . " \" ></i> " ;
print getApprovalStatusText ( $a [ " status " ]) . " </td> \n " ;
2021-04-18 05:08:00 +00:00
print " <td><ul class= \" actions unstyled \" > " ;
2017-12-18 12:20:33 +00:00
if ( $accesserr )
2024-02-07 08:41:40 +00:00
echo " <li><span class= \" text-error text-danger \" > " . $accesserr . " </span></li> " ;
2017-12-18 12:20:33 +00:00
2020-04-14 15:44:27 +00:00
if ( $accessobject -> mayApprove ( $latestContent -> getDocument ())) {
2017-12-18 12:20:33 +00:00
if ( $is_approver ) {
if ( $a [ 'status' ] == 0 ) {
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ApproveDocument' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion (), 'approveid' => $a [ 'approveID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " add_approval " ), false , true , array ( '<li>' , '</li>' ));
2020-04-14 15:44:27 +00:00
} elseif ( $accessobject -> mayUpdateApproval ( $latestContent -> getDocument (), $updateUser ) && (( $a [ " status " ] == 1 ) || ( $a [ " status " ] ==- 1 ))){
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ApproveDocument' , array ( 'documentid' => $latestContent -> getDocument () -> getId (), 'version' => $latestContent -> getVersion (), 'approveid' => $a [ 'approveID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " edit " ), false , true , array ( '<li>' , '</li>' ));
2017-12-18 12:20:33 +00:00
}
2017-01-16 12:02:15 +00:00
}
2012-12-14 07:53:13 +00:00
}
2021-07-02 06:34:06 +00:00
if ( $enableremoverevapp && $user -> isAdmin () && ( $a [ 'status' ] == 1 || $a [ 'status' ] == - 1 ))
2021-07-07 06:26:13 +00:00
echo '<li><a href="' . $this -> html_url ( 'RemoveApprovalLog' , array ( 'documentid' => $document -> getID (), 'version' => $latestContent -> getVersion (), 'approveid' => $a [ 'approveID' ])) . '" title="' . getMLText ( 'remove_approval_log' ) . '"><i class="fa fa-remove"></i></a></li>' ;
2013-05-17 07:27:15 +00:00
2017-12-18 12:20:33 +00:00
print " </ul> " ;
2020-09-23 06:53:05 +00:00
print " </td> \n " ;
2017-12-18 12:20:33 +00:00
print " </tr> \n " ;
}
2012-12-14 07:53:13 +00:00
}
}
print " </table> \n " ;
2018-06-27 16:55:14 +00:00
// $this->contentContainerEnd();
2020-10-08 05:57:23 +00:00
$this -> columnEnd ();
$this -> rowEnd ();
2015-05-12 17:14:25 +00:00
2017-07-31 13:37:05 +00:00
if ( $user -> isAdmin () || $user -> getId () == $document -> getOwner () -> getId ()) {
2020-10-08 05:57:23 +00:00
$this -> rowStart ();
2015-06-02 08:18:37 +00:00
/* Check for an existing review log , even if the workflowmode
* is set to traditional_only_approval . There may be old documents
* that still have a review log if the workflow mode has been
* changed afterwards .
*/
if ( $latestContent -> getReviewStatus ( 10 ) /*$workflowmode != 'traditional_only_approval'*/ ) {
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 6 );
$this -> printProtocol ( $latestContent , 'review' );
$this -> columnEnd ();
2015-05-12 17:14:25 +00:00
}
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 6 );
$this -> printProtocol ( $latestContent , 'approval' );
$this -> columnEnd ();
$this -> rowEnd ();
2015-05-12 17:14:25 +00:00
}
2012-12-14 07:53:13 +00:00
?>
</ div >
< ? php
2013-04-30 16:14:05 +00:00
}
2019-12-19 15:08:10 +00:00
} elseif ( $workflowmode == 'advanced' ) {
2013-01-24 09:39:14 +00:00
if ( $workflow ) {
2016-09-06 06:21:44 +00:00
/* Check if user is involved in workflow */
$user_is_involved = false ;
foreach ( $transitions as $transition ) {
if ( $latestContent -> triggerWorkflowTransitionIsAllowed ( $user , $transition )) {
$user_is_involved = true ;
}
}
2013-01-24 09:39:14 +00:00
?>
2021-05-04 07:57:23 +00:00
< div class = " tab-pane <?php if( $currenttab == 'workflow') echo 'active'; ?> " id = " workflow " role = " tabpanel " >
2013-01-24 09:39:14 +00:00
< ? php
2020-10-08 05:57:23 +00:00
$this -> rowStart ();
2019-11-20 12:47:57 +00:00
if ( $user_is_involved && $accessobject -> check_view_access ( 'WorkflowGraph' ))
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 6 );
2016-09-05 08:05:54 +00:00
else
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 12 );
2013-01-24 09:39:14 +00:00
$this -> contentContainerStart ();
2013-02-02 16:00:37 +00:00
if ( $user -> isAdmin ()) {
2021-06-01 08:54:06 +00:00
if ( ! $workflowstate || SeedDMS_Core_DMS :: checkIfEqual ( $workflow -> getInitState (), $workflowstate )) {
2021-07-07 06:26:13 +00:00
print " <form action= \" " . $this -> html_url ( " RemoveWorkflowFromDocument " ) . " \" method= \" get \" ><input type= \" hidden \" name= \" documentid \" value= \" " . $latestContent -> getDocument () -> getId () . " \" /><input type= \" hidden \" name= \" version \" value= \" " . $latestContent -> getVersion () . " \" /><button type= \" submit \" class= \" btn btn-danger \" ><i class= \" fa fa-remove \" ></i> " . getMLText ( 'rm_workflow' ) . " </button></form> " ;
2013-02-02 16:00:37 +00:00
} else {
2021-07-07 06:26:13 +00:00
print " <form action= \" " . $this -> html_url ( " RewindWorkflow " ) . " \" method= \" get \" ><input type= \" hidden \" name= \" documentid \" value= \" " . $latestContent -> getDocument () -> getId () . " \" /><input type= \" hidden \" name= \" version \" value= \" " . $latestContent -> getVersion () . " \" /><button type= \" submit \" class= \" btn btn-danger \" ><i class= \" fa fa-refresh \" ></i> " . getMLText ( 'rewind_workflow' ) . " </button></form> " ;
2013-02-02 16:00:37 +00:00
}
2013-01-24 09:39:14 +00:00
}
2020-02-28 17:20:44 +00:00
echo " <h4> " . htmlspecialchars ( $workflow -> getName ()) . " </h4> " ;
2013-01-24 09:39:14 +00:00
if ( $parentworkflow = $latestContent -> getParentWorkflow ()) {
2020-02-28 17:20:44 +00:00
echo " <p>Sub workflow of ' " . htmlspecialchars ( $parentworkflow -> getName ()) . " '</p> " ;
2013-01-24 09:39:14 +00:00
}
2021-06-01 08:54:06 +00:00
echo " <h5> " . getMLText ( 'current_state' ) . " : " . ( $workflowstate ? htmlspecialchars ( $workflowstate -> getName ()) : htmlspecialchars ( getMLText ( 'workflow_in_unknown_state' ))) . " </h5> " ;
2021-04-18 05:08:00 +00:00
echo " <table class= \" table table-condensed table-sm \" > \n " ;
2013-01-24 09:39:14 +00:00
echo " <tr> " ;
2013-09-20 19:05:46 +00:00
echo " <td> " . getMLText ( 'next_state' ) . " :</td> " ;
2013-01-24 09:39:14 +00:00
foreach ( $transitions as $transition ) {
$nextstate = $transition -> getNextState ();
2016-09-05 04:39:20 +00:00
$docstatus = $nextstate -> getDocumentStatus ();
2020-08-27 05:52:52 +00:00
echo " <td><i class= \" fa fa-circle " . ( $docstatus == S_RELEASED ? " released " : ( $docstatus == S_REJECTED ? " rejected " : " in-workflow " )) . " \" ></i> " . htmlspecialchars ( $nextstate -> getName ()) . " </td> " ;
2013-01-24 09:39:14 +00:00
}
echo " </tr> " ;
echo " <tr> " ;
2013-09-20 19:05:46 +00:00
echo " <td> " . getMLText ( 'action' ) . " :</td> " ;
2013-01-24 09:39:14 +00:00
foreach ( $transitions as $transition ) {
$action = $transition -> getAction ();
2020-03-26 07:03:58 +00:00
echo " <td> " . getMLText ( 'action_' . strtolower ( $action -> getName ()), array (), htmlspecialchars ( $action -> getName ())) . " </td> " ;
2013-01-24 09:39:14 +00:00
}
echo " </tr> " ;
echo " <tr> " ;
2013-09-20 18:56:46 +00:00
echo " <td> " . getMLText ( 'users' ) . " :</td> " ;
2013-01-24 09:39:14 +00:00
foreach ( $transitions as $transition ) {
$transusers = $transition -> getUsers ();
echo " <td> " ;
foreach ( $transusers as $transuser ) {
$u = $transuser -> getUser ();
2020-02-28 17:20:44 +00:00
echo htmlspecialchars ( $u -> getFullName ());
2013-01-24 09:39:14 +00:00
if ( $document -> getAccessMode ( $u ) < M_READ ) {
echo " (no access) " ;
}
echo " <br /> " ;
}
echo " </td> " ;
}
echo " </tr> " ;
echo " <tr> " ;
2013-09-20 18:56:46 +00:00
echo " <td> " . getMLText ( 'groups' ) . " :</td> " ;
2013-01-24 09:39:14 +00:00
foreach ( $transitions as $transition ) {
$transgroups = $transition -> getGroups ();
echo " <td> " ;
foreach ( $transgroups as $transgroup ) {
$g = $transgroup -> getGroup ();
2013-09-20 18:56:46 +00:00
echo getMLText ( 'at_least_n_users_of_group' ,
array ( " number_of_users " => $transgroup -> getNumOfUsers (),
2020-02-28 17:20:44 +00:00
" group " => htmlspecialchars ( $g -> getName ())));
2013-01-24 09:39:14 +00:00
if ( $document -> getGroupAccessMode ( $g ) < M_READ ) {
echo " (no access) " ;
}
echo " <br /> " ;
}
echo " </td> " ;
}
echo " </tr> " ;
echo " <tr class= \" success \" > " ;
2013-09-20 19:05:46 +00:00
echo " <td> " . getMLText ( 'users_done_work' ) . " :</td> " ;
2013-01-24 09:39:14 +00:00
foreach ( $transitions as $transition ) {
echo " <td> " ;
if ( $latestContent -> executeWorkflowTransitionIsAllowed ( $transition )) {
2016-11-18 07:42:56 +00:00
/* If this is reached , then the transition should have been executed
* but for some reason the next state hasn ' t been reached . This can
2021-12-03 09:49:59 +00:00
* be caused , if a transition which was previously already executed
2016-11-18 07:42:56 +00:00
* is about to be executed again . E . g . there was already a transition
* T1 from state S1 to S2 triggered by user U1 .
* Then there was a second transition T2 from
* S2 back to S1 . If the state S1 has been reached again , then
* executeWorkflowTransitionIsAllowed () will think that T1 could be
* executed because there is already a log entry saying , that U1
* has triggered the workflow .
*/
echo " Done " ;
2013-01-24 09:39:14 +00:00
}
$wkflogs = $latestContent -> getWorkflowLog ( $transition );
foreach ( $wkflogs as $wkflog ) {
$loguser = $wkflog -> getUser ();
2021-12-03 09:49:59 +00:00
echo htmlspecialchars ( $loguser -> getFullName ());
2013-01-24 09:39:14 +00:00
$names = array ();
foreach ( $loguser -> getGroups () as $loggroup ) {
2020-02-28 17:20:44 +00:00
$names [] = htmlspecialchars ( $loggroup -> getName ());
2013-01-24 09:39:14 +00:00
}
2021-12-03 09:49:59 +00:00
if ( $names )
echo " ( " . implode ( " , " , $names ) . " ) " ;
echo " - " ;
echo getLongReadableDate ( $wkflog -> getDate ());
2016-01-27 05:49:19 +00:00
echo " <br /> " ;
2013-01-24 09:39:14 +00:00
}
echo " </td> " ;
}
echo " </tr> " ;
echo " <tr> " ;
echo " <td></td> " ;
2016-09-05 04:39:20 +00:00
$allowedtransitions = array ();
2013-01-24 09:39:14 +00:00
foreach ( $transitions as $transition ) {
echo " <td> " ;
if ( $latestContent -> triggerWorkflowTransitionIsAllowed ( $user , $transition )) {
$action = $transition -> getAction ();
2021-07-07 06:26:13 +00:00
print " <form action= \" " . $this -> html_url ( " TriggerWorkflow " ) . " \" method= \" get \" ><input type= \" hidden \" name= \" documentid \" value= \" " . $latestContent -> getDocument () -> getId () . " \" /><input type= \" hidden \" name= \" version \" value= \" " . $latestContent -> getVersion () . " \" /><input type= \" hidden \" name= \" transition \" value= \" " . $transition -> getID () . " \" /><input type= \" submit \" class= \" btn btn-primary \" value= \" " . getMLText ( 'action_' . strtolower ( $action -> getName ()), array (), htmlspecialchars ( $action -> getName ())) . " \" /></form> " ;
2016-09-05 04:39:20 +00:00
$allowedtransitions [] = $transition ;
2013-01-24 09:39:14 +00:00
}
echo " </td> " ;
}
echo " </tr> " ;
echo " </table> " ;
$workflows = $dms -> getAllWorkflows ();
if ( $workflows ) {
$subworkflows = array ();
foreach ( $workflows as $wkf ) {
2021-06-01 08:54:06 +00:00
if ( $workflowstate && ( $wkf -> getInitState () -> getID () == $workflowstate -> getID ())) {
2013-01-24 09:39:14 +00:00
if ( $workflow -> getID () != $wkf -> getID ()) {
$subworkflows [] = $wkf ;
}
}
}
if ( $subworkflows ) {
2021-07-07 06:26:13 +00:00
echo " <form class= \" form-inline \" action= \" " . $this -> html_url ( " RunSubWorkflow " ) . " \" method= \" get \" ><input type= \" hidden \" name= \" documentid \" value= \" " . $latestContent -> getDocument () -> getId () . " \" /><input type= \" hidden \" name= \" version \" value= \" " . $latestContent -> getVersion () . " \" /> " ;
2021-04-18 05:08:00 +00:00
echo " <select name= \" subworkflow \" class= \" form-control \" > " ;
2013-01-24 09:39:14 +00:00
foreach ( $subworkflows as $subworkflow ) {
2021-04-30 07:27:59 +00:00
echo " <option value= \" " . $subworkflow -> getID () . " \" > " . htmlspecialchars ( $subworkflow -> getName ()) . " </option> " ;
2013-01-24 09:39:14 +00:00
}
echo " </select> " ;
echo " <label class= \" inline \" > " ;
2020-10-08 20:25:51 +00:00
echo " <input type= \" submit \" class= \" btn btn-primary \" value= \" " . getMLText ( 'run_subworkflow' ) . " \" /> " ;
2021-04-18 05:08:00 +00:00
echo " </label> " ;
2013-01-24 09:39:14 +00:00
echo " </form> " ;
}
}
/* If in a sub workflow , the check if return the parent workflow
* is possible .
*/
if ( $parentworkflow = $latestContent -> getParentWorkflow ()) {
$states = $parentworkflow -> getStates ();
foreach ( $states as $state ) {
/* Check if the current workflow state is also a state in the
* parent workflow
*/
if ( $latestContent -> getWorkflowState () -> getID () == $state -> getID ()) {
2021-04-30 07:27:59 +00:00
echo " Switching from sub workflow ' " . htmlspecialchars ( $workflow -> getName ()) . " ' into state " . $state -> getName () . " of parent workflow ' " . htmlspecialchars ( $parentworkflow -> getName ()) . " ' is possible<br /> " ;
2013-01-24 09:39:14 +00:00
/* Check if the transition from the state where the sub workflow
* starts into the current state is also allowed in the parent
* workflow . Checking at this point is actually too late , because
* the sub workflow shouldn ' t be entered in the first place ,
* but that is difficult to check .
*/
/* If the init state has not been left, return is always possible */
if ( $workflow -> getInitState () -> getID () == $latestContent -> getWorkflowState () -> getID ()) {
echo " Initial state of sub workflow has not been left. Return to parent workflow is possible<br /> " ;
2021-07-07 06:26:13 +00:00
echo " <form action= \" " . $this -> html_url ( " ReturnFromSubWorkflow " ) . " \" method= \" get \" ><input type= \" hidden \" name= \" documentid \" value= \" " . $latestContent -> getDocument () -> getId () . " \" /><input type= \" hidden \" name= \" version \" value= \" " . $latestContent -> getVersion () . " \" /> " ;
2020-10-08 20:25:51 +00:00
echo " <input type= \" submit \" class= \" btn btn-primary \" value= \" " . getMLText ( 'return_from_subworkflow' ) . " \" /> " ;
2013-01-24 09:39:14 +00:00
echo " </form> " ;
} else {
/* Get a transition from the last state in the parent workflow
* ( which is the initial state of the sub workflow ) into
* current state .
*/
echo " Check for transition from " . $workflow -> getInitState () -> getName () . " into " . $latestContent -> getWorkflowState () -> getName () . " is possible in parentworkflow " . $parentworkflow -> getID () . " <br /> " ;
$transitions = $parentworkflow -> getTransitionsByStates ( $workflow -> getInitState (), $latestContent -> getWorkflowState ());
if ( $transitions ) {
echo " Found transitions in workflow " . $parentworkflow -> getID () . " <br /> " ;
foreach ( $transitions as $transition ) {
if ( $latestContent -> triggerWorkflowTransitionIsAllowed ( $user , $transition )) {
echo " Triggering transition is allowed<br /> " ;
2021-07-07 06:26:13 +00:00
echo " <form action= \" " . $this -> html_url ( " ReturnFromSubWorkflow " ) . " \" method= \" get \" ><input type= \" hidden \" name= \" documentid \" value= \" " . $latestContent -> getDocument () -> getId () . " \" /><input type= \" hidden \" name= \" version \" value= \" " . $latestContent -> getVersion () . " \" /><input type= \" hidden \" name= \" transition \" value= \" " . $transition -> getID () . " \" /> " ;
2020-10-08 20:25:51 +00:00
echo " <input type= \" submit \" class= \" btn btn-primary \" value= \" " . getMLText ( 'return_from_subworkflow' ) . " \" /> " ;
2013-01-24 09:39:14 +00:00
echo " </form> " ;
}
}
}
}
}
}
}
2016-09-05 04:39:20 +00:00
$this -> contentContainerEnd ();
2020-10-08 05:57:23 +00:00
$this -> columnEnd ();
2019-11-20 12:47:57 +00:00
if ( $user_is_involved && $accessobject -> check_view_access ( 'WorkflowGraph' )) {
2020-10-08 05:57:23 +00:00
$this -> columnStart ( 6 );
2016-09-05 04:39:20 +00:00
?>
< iframe src = " out.WorkflowGraph.php?workflow=<?php echo $workflow->getID (); ?><?php if( $allowedtransitions ) foreach( $allowedtransitions as $tr ) { echo " & transitions [] = " . $tr->getID ();} ?> " width = " 99% " height = " 661 " style = " border: 1px solid #AAA; " ></ iframe >
< ? php
2020-10-08 05:57:23 +00:00
$this -> columnEnd ();
2016-09-05 08:05:54 +00:00
}
2020-10-08 05:57:23 +00:00
$this -> rowEnd ();
2022-04-02 09:07:31 +00:00
$wkflogs = $latestContent -> getWorkflowLog ();
if ( $wkflogs ) {
$this -> rowStart ();
$this -> columnStart ( 12 );
$this -> contentHeading ( getMLText ( " workflow_log " ));
2023-11-12 16:36:01 +00:00
$this -> printWorkflowLog ( $wkflogs );
2022-04-02 09:07:31 +00:00
$this -> columnEnd ();
$this -> rowEnd ();
}
2013-01-24 09:39:14 +00:00
?>
</ div >
< ? php
}
}
2023-04-20 11:28:03 +00:00
if ( is_array ( $receiptStatus ) && count ( $receiptStatus ) > 0 && $accessobject -> check_view_access ( $this , array ( 'action' => 'recipients' ))) {
2015-04-28 10:18:35 +00:00
?>
2015-06-09 07:00:22 +00:00
< div class = " tab-pane <?php if( $currenttab == 'recipients') echo 'active'; ?> " id = " recipients " >
2015-04-28 10:18:35 +00:00
< ? php
2021-05-11 17:06:52 +00:00
$status = $latestContent -> getStatus ();
2018-01-16 17:13:41 +00:00
if ( $status [ " status " ] != S_RELEASED )
echo " <div class= \" alert alert-warning \" > " . getMLText ( 'info_recipients_tab_not_released' ) . " </div> " ;
2020-12-16 09:41:52 +00:00
$txt = $this -> callHook ( 'preRecipientsTab' , $receiptStatus );
if ( is_string ( $txt ))
echo $txt ;
2021-04-30 07:25:11 +00:00
print " <table id= \" filterRecipientsTable \" class= \" table table-condensed table-sm \" > \n " ;
2015-04-28 10:18:35 +00:00
2021-04-30 07:25:11 +00:00
print " <thead> \n " ;
2015-04-28 10:18:35 +00:00
print " <tr> \n " ;
2024-02-07 08:41:40 +00:00
print " <th width='20%'> " . (( count ( $receiptStatus ) > 10 ) ? '<input class="form-control" type="text" id="filterRecipientsInput" placeholder="' . getMLText ( 'type_to_filter' ) . '">' : getMLText ( 'name' )) . " </th> \n " ;
2021-04-30 07:25:11 +00:00
print " <th width='20%'> " . getMLText ( " last_update " ) . " </th> \n " ;
print " <th width='25%'> " . getMLText ( " comment " ) . " </th> " ;
print " <th width='15%'> " . getMLText ( " status " ) . " </th> \n " ;
print " <th width='20%'></th> \n " ;
2015-04-28 10:18:35 +00:00
print " </tr> \n " ;
2021-04-30 07:25:11 +00:00
print " </thead> \n " ;
print " <tbody> \n " ;
2015-04-28 10:18:35 +00:00
2016-10-05 10:05:19 +00:00
$stat = array ( '-1' => 0 , '0' => 0 , '1' => 0 , '-2' => 0 );
2024-02-07 08:41:40 +00:00
$disabledcount = 0 ;
$removedusers = '' ;
2015-04-28 10:18:35 +00:00
foreach ( $receiptStatus as $r ) {
$required = null ;
$is_recipient = false ;
2016-03-24 14:42:18 +00:00
$stat [ '' . $r [ 'status' ]] ++ ;
2017-07-05 08:49:39 +00:00
$accesserr = '' ;
2015-04-28 10:18:35 +00:00
switch ( $r [ " type " ]) {
2016-10-27 10:17:04 +00:00
case 0 : // Recipient is an individual.
2015-04-28 10:18:35 +00:00
$required = $dms -> getUser ( $r [ " required " ]);
if ( ! is_object ( $required )) {
$reqName = getMLText ( " unknown_user " ) . " ' " . $r [ " required " ] . " ' " ;
2017-07-21 11:52:57 +00:00
} else {
2020-08-27 06:48:43 +00:00
$reqName = " <i class= \" fa fa-user \" ></i> " . htmlspecialchars ( $required -> getFullName () . " ( " . $required -> getLogin () . " ) " );
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
if ( $document -> getAccessMode ( $required ) < M_READ || $latestContent -> getAccessMode ( $required ) < M_READ )
$accesserr = getMLText ( " access_denied " );
2024-02-07 08:41:40 +00:00
elseif ( is_object ( $required ) && $required -> isDisabled ()) {
$disabledcount ++ ;
2017-07-21 11:52:57 +00:00
$accesserr = getMLText ( " login_disabled_title " );
2024-02-07 08:41:40 +00:00
}
2017-07-21 11:52:57 +00:00
}
2015-04-28 10:18:35 +00:00
}
2016-10-27 12:23:26 +00:00
if ( $r [ " required " ] == $user -> getId () /* && ($user->getId() != $owner->getId() || $enableownerreceipt == 1)*/ )
2015-04-28 10:18:35 +00:00
$is_recipient = true ;
break ;
2016-10-27 10:17:04 +00:00
case 1 : // Recipient is a group.
2015-04-28 10:18:35 +00:00
$required = $dms -> getGroup ( $r [ " required " ]);
if ( ! is_object ( $required )) {
$reqName = getMLText ( " unknown_group " ) . " ' " . $r [ " required " ] . " ' " ;
}
else {
2020-08-27 06:48:43 +00:00
$reqName = " <i class= \" fa fa-group \" ></i> " . htmlspecialchars ( $required -> getName ());
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
$grpusers = $required -> getUsers ();
if ( ! $grpusers )
$accesserr = getMLText ( " no_group_members " );
}
2016-10-27 12:23:26 +00:00
if ( $required -> isMember ( $user ) /* && ($user->getId() != $owner->getId() || $enableownerreceipt == 1)*/ )
2015-04-28 10:18:35 +00:00
$is_recipient = true ;
}
break ;
}
2024-02-07 08:41:40 +00:00
/* Do not list users that have been removed from the list of recipients
2016-10-05 10:05:19 +00:00
* unless admin is logged in .
*/
if ( $user -> isAdmin () || $r [ " status " ] > - 2 ) {
2020-09-23 05:25:31 +00:00
$class = '' ;
switch ( $r [ 'status' ]) {
case '-1' :
$class = 'error' ;
break ;
case '1' :
$class = 'success' ;
break ;
}
2016-10-05 10:05:19 +00:00
print " <tr> \n " ;
print " <td> " . $reqName . " </td> \n " ;
2021-04-30 07:25:11 +00:00
print " <td> " . getLongReadableDate ( $r [ " date " ]) . " <br /> " ;
2016-10-05 10:05:19 +00:00
/* $updateUser is the user who has done the receipt */
$updateUser = $dms -> getUser ( $r [ " userID " ]);
2021-04-30 07:25:11 +00:00
print ( is_object ( $updateUser ) ? htmlspecialchars ( $updateUser -> getFullName () . " ( " . $updateUser -> getLogin () . " ) " ) : " unknown user id ' " . $r [ " userID " ] . " ' " );
print " </td> " ;
2016-10-05 10:05:19 +00:00
print " <td> " . htmlspecialchars ( $r [ " comment " ]) . " </td> \n " ;
2020-09-23 05:25:31 +00:00
print " <td> " ;
if ( $class )
echo " <i class= \" fa fa-circle text- " . $class . " \" ></i> " ;
print getReceiptStatusText ( $r [ " status " ]) . " </td> \n " ;
2021-04-19 17:54:24 +00:00
print " <td><ul class= \" actions unstyled \" > " ;
2017-07-05 08:49:39 +00:00
if ( $accesserr )
2024-02-07 08:41:40 +00:00
echo " <li><span class= \" text-error text-danger \" > " . $accesserr . " </span></li> " ;
2019-11-20 12:47:57 +00:00
if ( $accessobject -> mayReceipt ( $document )) {
2017-01-17 13:20:33 +00:00
if ( $is_recipient ) {
if ( $r [ " status " ] == 0 ) {
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ReceiptDocument' , array ( 'documentid' => $documentid , 'version' => $latestContent -> getVersion (), 'receiptid' => $r [ 'receiptID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " add_receipt " ), false , true , array ( '<li>' , '</li>' ));
2019-11-20 12:47:57 +00:00
} elseif ( $accessobject -> mayUpdateReceipt ( $document , $updateUser ) && (( $r [ " status " ] == 1 && $enablereceiptreject ) || ( $r [ " status " ] ==- 1 ))) {
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ReceiptDocument' , array ( 'documentid' => $documentid , 'version' => $latestContent -> getVersion (), 'receiptid' => $r [ 'receiptID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " edit " ), false , true , array ( '<li>' , '</li>' ));
2017-01-17 13:20:33 +00:00
}
2016-10-05 10:05:19 +00:00
}
2015-04-28 10:18:35 +00:00
}
2016-10-05 10:05:19 +00:00
print " </ul></td> \n " ;
print " </tr> \n " ;
}
2015-04-28 10:18:35 +00:00
}
?>
2021-04-30 07:25:11 +00:00
< tbody >
2015-04-28 10:18:35 +00:00
</ table >
< ? php
2024-02-07 08:41:40 +00:00
if ( $disabledcount ) {
$this -> warningMsg ( getMLText ( 'list_of_recipients_has_disabled_users' ));
}
2020-09-23 05:25:31 +00:00
// $this->contentContainerEnd();
2019-11-20 12:47:57 +00:00
if ( $accessobject -> check_view_access ( 'ViewDocument' , array ( 'action' => 'receptionBar' )) /* $user->isAdmin() || $user->getId() == $document->getOwner()->getId()*/ ) {
2016-10-05 10:05:19 +00:00
/* Do not count entries '-2' as they are removed userѕ */
2016-10-05 09:16:26 +00:00
$totalreceipts = $stat [ '-1' ] + $stat [ '0' ] + $stat [ '1' ];
2015-05-12 17:14:25 +00:00
?>
< div class = " row-fluid " >
< div class = " span12 " >
2016-03-24 14:42:18 +00:00
< div class = " progress " >
2022-06-17 18:10:34 +00:00
< div class = " progress-bar bar bar-success bg-success " style = " width: <?= $totalreceipts ? round( $stat['1'] / $totalreceipts *100) : 0 ?>%; " >< ? php echo ( $stat [ '1' ] ? $stat [ '1' ] . " / " . $totalreceipts : '' ); ?> </div>
<!-- div class = " bar bar-warning " style = " width: <?= $totalreceipts ? round( $stat['0'] / $totalreceipts *100) : 0 ?>%; " ></ div -->
< div class = " progress-bar bar bar-danger bg-danger " style = " width: <?= $totalreceipts ? round( $stat['-1'] / $totalreceipts *100) : 0 ?>%; " >< ? php echo ( $stat [ '-1' ] ? $stat [ '-1' ] . " / " . $totalreceipts : '' ); ?> </div>
2016-03-24 14:42:18 +00:00
</ div >
</ div >
</ div >
< div class = " row-fluid " >
< div class = " span12 " >
2015-05-12 17:14:25 +00:00
< ? php
$this -> printProtocol ( $latestContent , 'receipt' );
?>
</ div >
</ div >
< ? php
}
2015-04-28 10:18:35 +00:00
?>
</ div >
2015-05-11 07:30:13 +00:00
< ? php
}
2023-04-20 11:28:03 +00:00
if ( is_array ( $revisionStatus ) && count ( $revisionStatus ) > 0 && $accessobject -> check_view_access ( $this , array ( 'action' => 'revision' ))) {
2015-05-11 07:30:13 +00:00
?>
2015-06-09 07:00:22 +00:00
< div class = " tab-pane <?php if( $currenttab == 'revision') echo 'active'; ?> " id = " revision " >
2015-05-12 17:14:25 +00:00
< ? php
2021-05-22 11:12:38 +00:00
$status = $latestContent -> getStatus ();
2022-09-20 05:09:13 +00:00
if ( in_array ( $status [ 'status' ], [ S_RELEASED , S_EXPIRED ])) {
2015-05-12 17:14:25 +00:00
if ( $latestContent -> getRevisionDate ()) {
2022-09-18 10:53:05 +00:00
$this -> warningMsg ( getMLText ( 'revise_document_on' , array ( 'date' => getReadableDate ( $latestContent -> getRevisionDate ()))));
} else {
$this -> errorMsg ( getMLText ( 'no_revision_date' ));
2015-05-12 17:14:25 +00:00
}
2022-09-18 10:53:05 +00:00
} elseif ( $status [ 'status' ] != S_IN_REVISION ) {
$this -> infoMsg ( getMLText ( 'no_revision_planed' ));
}
2020-09-23 05:25:31 +00:00
// $this->contentContainerStart();
2021-04-30 07:25:11 +00:00
print " <table class= \" table table-condensed table-sm \" > \n " ;
2015-05-11 07:30:13 +00:00
print " <tr> \n " ;
print " <td width='20%'><b> " . getMLText ( " name " ) . " </b></td> \n " ;
print " <td width='20%'><b> " . getMLText ( " last_update " ) . " </b></td> \n " ;
print " <td width='25%'><b> " . getMLText ( " comment " ) . " </b></td> " ;
print " <td width='15%'><b> " . getMLText ( " status " ) . " </b></td> \n " ;
print " <td width='20%'></td> \n " ;
print " </tr> \n " ;
foreach ( $revisionStatus as $r ) {
2020-09-23 05:25:31 +00:00
$class = '' ;
switch ( $r [ 'status' ]) {
case '-1' :
$class = 'error' ;
break ;
case '1' :
$class = 'success' ;
break ;
}
2015-05-11 07:30:13 +00:00
$required = null ;
$is_recipient = false ;
2017-07-20 15:02:09 +00:00
$accesserr = '' ;
2015-05-11 07:30:13 +00:00
switch ( $r [ " type " ]) {
case 0 : // Reviewer is an individual.
$required = $dms -> getUser ( $r [ " required " ]);
if ( ! is_object ( $required )) {
$reqName = getMLText ( " unknown_user " ) . " ' " . $r [ " required " ] . " ' " ;
2017-07-21 11:52:57 +00:00
} else {
2020-08-27 06:48:43 +00:00
$reqName = " <i class= \" fa fa-user \" ></i> " . htmlspecialchars ( $required -> getFullName () . " ( " . $required -> getLogin () . " ) " );
2017-07-21 11:52:57 +00:00
if ( $user -> isAdmin ()) {
if ( $document -> getAccessMode ( $required ) < M_READ || $latestContent -> getAccessMode ( $required ) < M_READ )
$accesserr = getMLText ( " access_denied " );
elseif ( is_object ( $required ) && $required -> isDisabled ())
$accesserr = getMLText ( " login_disabled_title " );
}
2015-05-11 07:30:13 +00:00
}
2016-10-27 12:23:26 +00:00
if ( $r [ " required " ] == $user -> getId () /* && ($user->getId() != $owner->getId() || $enableownerrevapp == 1)*/ )
2015-05-11 07:30:13 +00:00
$is_recipient = true ;
break ;
case 1 : // Reviewer is a group.
$required = $dms -> getGroup ( $r [ " required " ]);
if ( ! is_object ( $required )) {
$reqName = getMLText ( " unknown_group " ) . " ' " . $r [ " required " ] . " ' " ;
}
else {
2020-08-27 06:48:43 +00:00
$reqName = " <i class= \" fa fa-group \" ></i> " . htmlspecialchars ( $required -> getName ());
2016-10-27 12:23:26 +00:00
if ( $required -> isMember ( $user ) /* && ($user->getId() != $owner->getId() || $enableownerrevapp == 1)*/ )
2015-05-11 07:30:13 +00:00
$is_recipient = true ;
}
break ;
}
2017-12-18 12:20:33 +00:00
if ( $user -> isAdmin () || $r [ " status " ] != - 2 ) {
print " <tr> \n " ;
print " <td> " . $reqName . " </td> \n " ;
2021-04-19 17:54:24 +00:00
print " <td><ul class= \" actions unstyled \" ><li> " . getLongReadableDate ( $r [ " date " ]) . " </li> " ;
2017-12-18 12:20:33 +00:00
/* $updateUser is the user who has done the revision */
2021-04-08 08:55:33 +00:00
$updateUser = null ;
2019-04-05 11:23:38 +00:00
if ( $r [ 'status' ] != 0 ) {
$updateUser = $dms -> getUser ( $r [ " userID " ]);
print " <li> " . ( is_object ( $updateUser ) ? htmlspecialchars ( $updateUser -> getFullName () . " ( " . $updateUser -> getLogin () . " ) " ) : " unknown user id ' " . $r [ " userID " ] . " ' " ) . " </li> " ;
}
print " </ul></td> " ;
2017-12-18 12:20:33 +00:00
print " <td> " . htmlspecialchars ( $r [ " comment " ]) . " </td> \n " ;
2020-09-23 05:25:31 +00:00
print " <td> " ;
if ( $class )
echo " <i class= \" fa fa-circle text- " . $class . " \" ></i> " ;
print getRevisionStatusText ( $r [ " status " ]) . " </td> \n " ;
2021-04-19 17:54:24 +00:00
print " <td><ul class= \" actions unstyled \" > " ;
2017-12-18 12:20:33 +00:00
if ( $accesserr )
2024-02-07 08:41:40 +00:00
echo " <li><span class= \" text-error text-danger \" > " . $accesserr . " </span></li> " ;
2019-11-20 12:47:57 +00:00
if ( $accessobject -> mayRevise ( $document )) {
2017-12-18 12:20:33 +00:00
if ( $is_recipient && $r [ " status " ] == 0 ) {
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ReviseDocument' , array ( 'documentid' => $documentid , 'version' => $latestContent -> getVersion (), 'revisionid' => $r [ 'revisionID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " add_revision " ), false , true , array ( '<li>' , '</li>' ));
2017-12-18 12:20:33 +00:00
} elseif (( $updateUser == $user ) && (( $r [ " status " ] == 1 ) || ( $r [ " status " ] ==- 1 )) && ( ! $document -> hasExpired ())){
2021-07-06 05:35:00 +00:00
print $this -> html_link ( 'ReviseDocument' , array ( 'documentid' => $documentid , 'version' => $latestContent -> getVersion (), 'revisionid' => $r [ 'revisionID' ]), array ( 'class' => 'btn btn-mini btn-primary' ), getMLText ( " edit " ), false , true , array ( '<li>' , '</li>' ));
2017-12-18 12:20:33 +00:00
}
2015-05-11 07:30:13 +00:00
}
2017-12-18 12:20:33 +00:00
print " </ul></td> \n " ;
print " </tr> \n " ;
}
2015-05-11 07:30:13 +00:00
}
?>
</ table >
< ? php
2020-09-23 05:25:31 +00:00
// $this->contentContainerEnd();
2017-07-31 13:37:05 +00:00
if ( $user -> isAdmin () || $user -> getId () == $document -> getOwner () -> getId ()) {
2015-05-11 07:30:13 +00:00
?>
2015-05-12 17:14:25 +00:00
< div class = " row-fluid " >
< div class = " span12 " >
< ? php
$this -> printProtocol ( $latestContent , 'revision' );
?>
</ div >
</ div >
< ? php
}
?>
</ div >
2015-04-28 10:18:35 +00:00
< ? php
}
2023-04-20 11:28:03 +00:00
if ( count ( $versions ) > 1 && $accessobject -> check_view_access ( $this , array ( 'action' => 'previous' ))) {
2012-12-14 07:53:13 +00:00
?>
2021-05-04 07:57:23 +00:00
< div class = " tab-pane <?php if( $currenttab == 'previous') echo 'active'; ?> " id = " previous " role = " tabpanel " >
2012-12-14 07:53:13 +00:00
< ? php
2020-09-18 17:24:18 +00:00
$txt = $this -> callHook ( 'prePreviousVersionsTab' , $versions );
if ( is_string ( $txt ))
echo $txt ;
2012-12-14 07:53:13 +00:00
for ( $i = count ( $versions ) - 2 ; $i >= 0 ; $i -- ) {
$version = $versions [ $i ];
2021-05-06 11:42:18 +00:00
$this -> contentContainerStart ();
$this -> showVersionDetails ( $version , $previewer , false );
$this -> contentContainerEnd ();
2012-12-14 07:53:13 +00:00
}
?>
</ div >
< ? php
}
2023-04-20 11:28:03 +00:00
if ( $accessobject -> check_view_access ( $this , array ( 'action' => 'attachments' ))) {
2012-12-14 07:53:13 +00:00
?>
2021-07-16 14:03:34 +00:00
< div class = " tab-pane <?php if( $currenttab == 'attachments') echo 'active'; ?> " id = " attachments " role = " tabpanel " >
2012-12-14 07:53:13 +00:00
< ? php
2021-07-16 14:03:34 +00:00
$this -> rowStart ();
$this -> columnStart ( 9 );
?>
< div class = " ajax " data - view = " ViewDocument " data - action = " documentFiles " data - no - spinner = " true " < ? php echo ( $document ? " data-query= \" documentid= " . $document -> getID () . " \" " : " " ) ?> ></div>
< ? php
$this -> columnEnd ();
$this -> columnStart ( 3 );
2019-11-20 12:47:57 +00:00
if ( $accessobject -> check_controller_access ( 'AddFile' )) {
2017-03-03 13:10:03 +00:00
if ( $document -> getAccessMode ( $user ) >= M_READWRITE ){
2021-07-16 14:03:34 +00:00
if ( $enableDropUpload ){
2021-03-03 14:38:04 +00:00
?>
2023-02-10 09:17:16 +00:00
< div id = " draganddrophandler " class = " well alert alert-warning " data - droptarget = " attachment_<?= $document->getID (); ?> " data - target = " <?= $document->getID (); ?> " data - uploadformtoken = " <?= createFormKey('addfile'); ?> " >< ? php echo $this -> html_link ( 'AddFile' , array ( 'documentid' => $documentid ), array (), getMLText ( 'drop_files_here_or_click' ), false , true ); ?> </div>
2021-03-03 14:38:04 +00:00
< ? php
2021-07-16 14:03:34 +00:00
} else {
print $this -> html_link ( 'AddFile' , array ( 'documentid' => $documentid ), array ( 'class' => 'btn btn-primary' ), getMLText ( " add " ), false , true ) . " \n " ;
2021-03-05 06:24:26 +00:00
}
2017-03-03 13:10:03 +00:00
}
2012-12-14 07:53:13 +00:00
}
2021-07-16 14:03:34 +00:00
$this -> columnEnd ();
$this -> rowEnd ();
2012-12-14 07:53:13 +00:00
?>
2023-04-20 11:28:03 +00:00
</ div >
< ? php
}
if ( $accessobject -> check_view_access ( $this , array ( 'action' => 'links' ))) {
?>
2021-05-04 07:57:23 +00:00
< div class = " tab-pane <?php if( $currenttab == 'links') echo 'active'; ?> " id = " links " role = " tabpanel " >
2012-12-14 07:53:13 +00:00
< ? php
if ( count ( $links ) > 0 ) {
2021-04-18 05:08:00 +00:00
print " <table id= \" viewfolder-table \" class= \" table table-condensed table-sm table-hover \" > " ;
2012-12-14 07:53:13 +00:00
print " <thead> \n <tr> \n " ;
2018-01-26 17:51:59 +00:00
print " <th></th> \n " ;
print " <th> " . getMLText ( " name " ) . " </th> \n " ;
print " <th> " . getMLText ( " status " ) . " </th> \n " ;
print " <th> " . getMLText ( " action " ) . " </th> \n " ;
2013-01-24 09:39:14 +00:00
print " <th></th> \n " ;
2012-12-14 07:53:13 +00:00
print " </tr> \n </thead> \n <tbody> \n " ;
foreach ( $links as $link ) {
$responsibleUser = $link -> getUser ();
$targetDoc = $link -> getTarget ();
2016-08-11 10:05:36 +00:00
2020-05-13 07:28:39 +00:00
echo $this -> documentListRowStart ( $targetDoc );
2018-01-26 17:51:59 +00:00
$targetDoc -> verifyLastestContentExpriry ();
2018-08-08 04:55:56 +00:00
$txt = $this -> callHook ( 'documentListItem' , $targetDoc , $previewer , false , 'reverselinks' );
2018-01-26 17:51:59 +00:00
if ( is_string ( $txt ))
echo $txt ;
else {
2024-03-18 09:38:33 +00:00
$extracontent = array ();
$extracontent [ 'below_title' ] = $this -> getListRowPath ( $targetDoc );
echo $this -> documentListRow ( $targetDoc , $previewer , true , 0 , $extracontent );
2013-01-24 09:39:14 +00:00
}
2018-01-26 17:51:59 +00:00
print " <td><span class= \" actions \" > " ;
print getMLText ( " document_link_by " ) . " " . htmlspecialchars ( $responsibleUser -> getFullName ());
2021-07-11 18:08:13 +00:00
if (( $user -> getID () == $responsibleUser -> getID ()) || ( $document -> getAccessMode ( $user ) == M_ALL )) {
2013-04-23 17:03:56 +00:00
print " <br /> " . getMLText ( " document_link_public " ) . " : " . (( $link -> isPublic ()) ? getMLText ( " yes " ) : getMLText ( " no " ));
2021-07-05 14:30:26 +00:00
print " <form action= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.RemoveDocumentLink.php \" method= \" post \" > " . createHiddenFieldWithKey ( 'removedocumentlink' ) . " <input type= \" hidden \" name= \" documentid \" value= \" " . $documentid . " \" /><input type= \" hidden \" name= \" linkid \" value= \" " . $link -> getID () . " \" /><button type= \" submit \" class= \" btn btn-danger btn-mini btn-sm \" ><i class= \" fa fa-remove \" ></i> " . getMLText ( " delete " ) . " </button></form> " ;
2021-07-11 18:08:13 +00:00
}
2012-12-14 07:53:13 +00:00
print " </span></td> " ;
2020-05-13 07:28:39 +00:00
echo $this -> documentListRowEnd ( $targetDoc );
2012-12-14 07:53:13 +00:00
}
print " </tbody> \n </table> \n " ;
}
2019-11-25 08:35:59 +00:00
else $this -> infoMsg ( getMLText ( " no_linked_files " ));
2012-12-14 07:53:13 +00:00
2019-11-25 08:35:59 +00:00
if ( $accessobject -> check_view_access ( 'AddDocumentLink' )){
2012-12-14 07:53:13 +00:00
?>
< br >
2021-07-05 14:30:26 +00:00
< form action = " <?= $this->params ['settings']->_httpRoot ?>op/op.AddDocumentLink.php " id = " form1 " name = " form1 " class = " form-horizontal " >
2012-12-14 07:53:13 +00:00
< input type = " hidden " name = " documentid " value = " <?php print $documentid ;?> " >
2021-01-25 09:04:45 +00:00
< ? php echo createHiddenFieldWithKey ( 'adddocumentlink' ); ?>
2021-04-18 05:08:00 +00:00
< ? php $this -> contentContainerStart (); ?>
2018-06-21 09:56:05 +00:00
< ? php $this -> formField ( getMLText ( " add_document_link " ), $this -> getDocumentChooserHtml ( " form1 " )); ?>
2012-12-14 07:53:13 +00:00
< ? php
if ( $document -> getAccessMode ( $user ) >= M_READWRITE ) {
2018-06-21 09:56:05 +00:00
$this -> formField (
getMLText ( " document_link_public " ),
array (
'element' => 'input' ,
'type' => 'checkbox' ,
'name' => 'public' ,
'value' => 'true' ,
'checked' => true
)
);
2012-12-14 07:53:13 +00:00
}
2021-04-18 05:08:00 +00:00
$this -> contentContainerEnd ();
2020-08-27 05:52:52 +00:00
$this -> formSubmit ( " <i class= \" fa fa-save \" ></i> " . getMLText ( 'save' ));
2012-12-14 07:53:13 +00:00
?>
</ form >
< ? php
}
2014-03-18 06:07:12 +00:00
if ( count ( $reverselinks ) > 0 ) {
$this -> contentHeading ( getMLText ( " reverse_links " ));
2018-01-26 17:51:59 +00:00
// $this->contentContainerStart();
2014-03-18 06:07:12 +00:00
2021-04-18 05:08:00 +00:00
print " <table id= \" viewfolder-table \" class= \" table table-condensed table-sm table-hover \" > " ;
2014-03-18 06:07:12 +00:00
print " <thead> \n <tr> \n " ;
2018-01-26 17:51:59 +00:00
print " <th></th> \n " ;
print " <th> " . getMLText ( " name " ) . " </th> \n " ;
print " <th> " . getMLText ( " status " ) . " </th> \n " ;
print " <th> " . getMLText ( " action " ) . " </th> \n " ;
2014-03-18 06:07:12 +00:00
print " <th></th> \n " ;
print " </tr> \n </thead> \n <tbody> \n " ;
foreach ( $reverselinks as $link ) {
$responsibleUser = $link -> getUser ();
$sourceDoc = $link -> getDocument ();
2020-05-13 07:28:39 +00:00
echo $this -> documentListRowStart ( $sourceDoc );
2018-01-26 17:51:59 +00:00
$sourceDoc -> verifyLastestContentExpriry ();
2018-08-08 04:55:56 +00:00
$txt = $this -> callHook ( 'documentListItem' , $sourceDoc , $previewer , false , 'reverselinks' );
2018-01-26 17:51:59 +00:00
if ( is_string ( $txt ))
echo $txt ;
else {
2024-03-18 09:38:33 +00:00
$extracontent = array ();
$extracontent [ 'below_title' ] = $this -> getListRowPath ( $sourceDoc );
echo $this -> documentListRow ( $sourceDoc , $previewer , true , 0 , $extracontent );
2014-03-18 06:07:12 +00:00
}
print " <td><span class= \" actions \" > " ;
if (( $user -> getID () == $responsibleUser -> getID ()) || ( $document -> getAccessMode ( $user ) == M_ALL ))
2018-01-26 17:51:59 +00:00
print getMLText ( " document_link_by " ) . " " . htmlspecialchars ( $responsibleUser -> getFullName ());
2021-07-11 18:08:13 +00:00
if (( $user -> getID () == $responsibleUser -> getID ()) || ( $document -> getAccessMode ( $user ) == M_ALL )) {
2018-01-26 17:51:59 +00:00
print " <br /> " . getMLText ( " document_link_public " ) . " : " . (( $link -> isPublic ()) ? getMLText ( " yes " ) : getMLText ( " no " ));
2022-05-01 13:08:58 +00:00
print " <form action= \" " . $this -> params [ 'settings' ] -> _httpRoot . " op/op.RemoveDocumentLink.php \" method= \" post \" > " . createHiddenFieldWithKey ( 'removedocumentlink' ) . " <input type= \" hidden \" name= \" documentid \" value= \" " . $sourceDoc -> getId () . " \" /><input type= \" hidden \" name= \" linkid \" value= \" " . $link -> getID () . " \" /><button type= \" submit \" class= \" btn btn-danger btn-mini btn-sm \" ><i class= \" fa fa-remove \" ></i> " . getMLText ( " delete " ) . " </button></form> " ;
2021-07-11 18:08:13 +00:00
}
2014-03-18 06:07:12 +00:00
print " </span></td> " ;
2020-05-13 07:28:39 +00:00
echo $this -> documentListRowEnd ( $sourceDoc );
2014-03-18 06:07:12 +00:00
}
print " </tbody> \n </table> \n " ;
2018-01-26 17:51:59 +00:00
// $this->contentContainerEnd();
2014-03-18 06:07:12 +00:00
}
2012-12-14 07:53:13 +00:00
?>
2016-11-07 08:25:55 +00:00
</ div >
2018-04-13 12:53:06 +00:00
< ? php
2023-04-20 11:28:03 +00:00
}
2018-04-13 12:53:06 +00:00
if ( $tabs ) {
foreach ( $tabs as $tabid => $tab ) {
2021-05-04 07:57:23 +00:00
echo '<div class="tab-pane ' . ( $currenttab == $tabid ? 'active' : '' ) . '" id="' . $tabid . '" role="tabpanel">' ;
2018-04-13 12:53:06 +00:00
echo $tab [ 'content' ];
echo " </div> \n " ;
}
}
?>
2012-12-14 07:53:13 +00:00
</ div >
2015-09-18 05:55:24 +00:00
< ? php
if ( $user -> isAdmin ()) {
2020-09-23 06:44:47 +00:00
$this -> contentHeading ( getMLText ( " timeline " ));
$this -> printTimelineHtml ( 300 );
2015-09-18 05:55:24 +00:00
}
2020-10-08 05:57:23 +00:00
$this -> columnEnd ();
$this -> rowEnd ();
2019-10-18 09:06:42 +00:00
echo $this -> callHook ( 'postContent' );
2016-03-15 07:30:53 +00:00
$this -> contentEnd ();
2012-12-14 07:53:13 +00:00
$this -> htmlEndPage ();
} /* }}} */
}
?>