2012-12-14 07:53:13 +00:00
< ? php
/**
* Implementation of SetExpires 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 SetExpires 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_SetExpires extends SeedDMS_Theme_Style {
2012-12-14 07:53:13 +00:00
2017-04-05 20:00:54 +00:00
function js () { /* {{{ */
2021-03-10 14:58:22 +00:00
header ( 'Content-Type: application/javascript; charset=UTF-8' );
2017-04-05 20:00:54 +00:00
?>
$ ( document ) . ready ( function () {
$ ( '#presetexpdate' ) . on ( 'change' , function ( ev ){
if ( $ ( this ) . val () == 'date' )
$ ( '#control_expdate' ) . show ();
else
$ ( '#control_expdate' ) . hide ();
});
});
< ? php
} /* }}} */
2012-12-14 07:53:13 +00:00
function show () { /* {{{ */
$dms = $this -> params [ 'dms' ];
$user = $this -> params [ 'user' ];
$folder = $this -> params [ 'folder' ];
$document = $this -> params [ 'document' ];
$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
$this -> contentHeading ( getMLText ( " set_expiry " ));
if ( $document -> expires ())
2020-12-17 10:44:19 +00:00
$expdate = getReadableDate ( $document -> getExpires ());
2012-12-14 07:53:13 +00:00
else
$expdate = '' ;
?>
2017-01-04 16:53:27 +00:00
< form class = " form-horizontal " action = " ../op/op.SetExpires.php " method = " post " >
2012-12-14 07:53:13 +00:00
< input type = " hidden " name = " documentid " value = " <?php print $document->getID ();?> " >
2021-01-25 09:00:20 +00:00
< ? php echo createHiddenFieldWithKey ( 'setexpires' ); ?>
2018-04-23 13:50:46 +00:00
< ? php
2021-05-01 12:08:50 +00:00
$this -> contentContainerStart ();
2023-09-29 12:31:35 +00:00
$df = ! empty ( $settings -> _datetimeformat ) ? $settings -> _datetimeformat : 'Y-m-d H:i:s' ;
2018-06-07 05:46:19 +00:00
$options = array ();
$options [] = array ( 'never' , getMLText ( 'does_not_expire' ));
$options [] = array ( 'date' , getMLText ( 'expire_by_date' ), $expdate != '' );
2024-05-13 08:08:36 +00:00
$options [] = array ( 'today' , getMLText ( 'expire_today' ) . ' (' . date ( $df , getTsByPeriod ( 'today' , 's' )) . ')' );
2023-09-29 12:31:35 +00:00
$options [] = array ( 'tomorrow' , getMLText ( 'expire_tomorrow' ) . ' (' . date ( $df , getTsByPeriod ( 'tomorrow' , 's' )) . ')' );
$options [] = array ( '1w' , getMLText ( 'expire_in_1w' ) . ' (' . date ( $df , getTsByPeriod ( '1w' , 's' )) . ')' );
$options [] = array ( '1m' , getMLText ( 'expire_in_1m' ) . ' (' . date ( $df , getTsByPeriod ( '1m' , 's' )) . ')' );
$options [] = array ( '1y' , getMLText ( 'expire_in_1y' ) . ' (' . date ( $df , getTsByPeriod ( '1y' , 's' )) . ')' );
$options [] = array ( '2y' , getMLText ( 'expire_in_2y' ) . ' (' . date ( $df , getTsByPeriod ( '2y' , 's' )) . ')' );
$options [] = array ( '3y' , getMLText ( 'expire_in_3y' ) . ' (' . date ( $df , getTsByPeriod ( '3y' , 's' )) . ')' );
2018-04-23 13:50:46 +00:00
$this -> formField (
getMLText ( " preset_expires " ),
2018-06-07 05:46:19 +00:00
array (
'element' => 'select' ,
'id' => 'presetexpdate' ,
'name' => 'presetexpdate' ,
'options' => $options
2023-09-29 12:32:27 +00:00
),
array (
'help' => getMLText ( 'set_expiration_date_help' )
2018-06-07 05:46:19 +00:00
)
2018-04-23 13:50:46 +00:00
);
$this -> formField (
getMLText ( " expires " ),
2024-05-13 08:08:36 +00:00
$this -> getDateChooser ( $expdate , " expdate " , $this -> params [ 'session' ] -> getLanguage (), '' , '' ) // set last parameter to '+1d' if dates in the past are not allowed
2018-04-23 13:50:46 +00:00
);
2021-05-01 12:08:50 +00:00
$this -> contentContainerEnd ();
2020-08-27 05:52:52 +00:00
$this -> formSubmit ( " <i class= \" fa fa-save \" ></i> " . getMLText ( 'save' ));
2018-04-23 13:50:46 +00:00
?>
2012-12-14 07:53:13 +00:00
</ form >
< ? php
2016-03-15 07:30:53 +00:00
$this -> contentEnd ();
2012-12-14 07:53:13 +00:00
$this -> htmlEndPage ();
} /* }}} */
}
?>