HOR-61: new feature expiration date

This commit is contained in:
Paula V. Quispe
2016-06-02 10:23:09 -04:00
parent 005ee3ef2b
commit a922754d1a
7 changed files with 64 additions and 1 deletions

View File

@@ -57,6 +57,7 @@ class System
'wsdl_cache' => 1,
'memory_limit' => "256M",
'time_zone' => 'America/New_York',
'expiration_year' => '1',
'memcached' => 0,
'memcached_server' => '',
'default_skin' => 'neoclassic',

View File

@@ -64,6 +64,10 @@ class adminProxy extends HttpProxyController
$updatedConf['time_zone'] = $httpData->time_zone;
}
if ($sysConf['expiration_year'] != $httpData->expiration_year) {
$updatedConf['expiration_year'] = $httpData->expiration_year;
}
$httpData->memory_limit .= 'M';
if ($sysConf['memory_limit'] != $httpData->memory_limit) {
$updatedConf['memory_limit'] = $httpData->memory_limit;

View File

@@ -13,6 +13,16 @@ $uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ($postMaxSize < $uploadMaxSize) {
$uploadMaxSize = $postMaxSize;
}
//Add year by expiration date
$expirationDate = 1;
$envFile = PATH_CONFIG . 'env.ini';
if (file_exists($envFile) ) {
$sysConf = System::getSystemConfiguration($envFile);
if(isset($sysConf['expiration_year']) && $sysConf['expiration_year']>0){
$expirationDate = $sysConf['expiration_year'];
}
}
$languageManagement = 0;
/*----------------------------------********---------------------------------*/
$licensedFeatures = & PMLicensedFeatures::getSingleton();
@@ -31,6 +41,7 @@ $oHeadPublisher->assign( 'MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ' );
$oHeadPublisher->assign('SYSTEM_TIME_ZONE', $arraySystemConfiguration['time_zone']);
$oHeadPublisher->assign('TIME_ZONE_DATA', array_map(function ($value) { return [$value, $value]; }, DateTimeZone::listIdentifiers()));
$oHeadPublisher->assign('__SYSTEM_UTC_TIME_ZONE__', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__'])? 1 : 0);
$oHeadPublisher->assign('EXPIRATION_DATE', (int)$expirationDate);
$oHeadPublisher->assign('LANGUAGE_MANAGEMENT', $languageManagement);
G::RenderPage( 'publish', 'extJs' );

View File

@@ -28,6 +28,16 @@ $uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ($postMaxSize < $uploadMaxSize) {
$uploadMaxSize = $postMaxSize;
}
//Add year by expiration date
$expirationDate = 1;
$envFile = PATH_CONFIG . 'env.ini';
if (file_exists($envFile) ) {
$sysConf = System::getSystemConfiguration($envFile);
if(isset($sysConf['expiration_year']) && $sysConf['expiration_year']>0){
$expirationDate = $sysConf['expiration_year'];
}
}
$languageManagement = 0;
/*----------------------------------********---------------------------------*/
$licensedFeatures = & PMLicensedFeatures::getSingleton();
@@ -51,6 +61,7 @@ $oHeadPublisher->assign( 'MODE', '' );
$oHeadPublisher->assign('SYSTEM_TIME_ZONE', $arraySystemConfiguration['time_zone']);
$oHeadPublisher->assign('TIME_ZONE_DATA', array_map(function ($value) { return [$value, $value]; }, DateTimeZone::listIdentifiers()));
$oHeadPublisher->assign('__SYSTEM_UTC_TIME_ZONE__', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__'])? 1 : 0);
$oHeadPublisher->assign('EXPIRATION_DATE', (int)$expirationDate);
$oHeadPublisher->assign('LANGUAGE_MANAGEMENT', $languageManagement);
G::RenderPage( 'publish', 'extJs' );

View File

@@ -16,6 +16,15 @@ $uploadMaxSize = (int) $UPLOAD_MAX_SIZE * $mul;
if ($postMaxSize < $uploadMaxSize) {
$uploadMaxSize = $postMaxSize;
}
//Add year by expiration date
$expirationDate = 1;
$envFile = PATH_CONFIG . 'env.ini';
if (file_exists($envFile) ) {
$sysConf = System::getSystemConfiguration($envFile);
if(isset($sysConf['expiration_year']) && $sysConf['expiration_year']>0){
$expirationDate = $sysConf['expiration_year'];
}
}
$languageManagement = 0;
@@ -36,6 +45,7 @@ $oHeadPublisher->assign('MAX_FILES_SIZE', ' (' . $UPLOAD_MAX_SIZE . ') ');
$oHeadPublisher->assign('SYSTEM_TIME_ZONE', $arraySystemConfiguration['time_zone']);
$oHeadPublisher->assign('TIME_ZONE_DATA', array_map(function ($value) { return [$value, $value]; }, DateTimeZone::listIdentifiers()));
$oHeadPublisher->assign('__SYSTEM_UTC_TIME_ZONE__', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__'])? 1 : 0);
$oHeadPublisher->assign('EXPIRATION_DATE', (int)$expirationDate);
$oHeadPublisher->assign('LANGUAGE_MANAGEMENT', $languageManagement);
G::RenderPage( 'publish', 'extJs' );

View File

@@ -85,6 +85,31 @@ Ext.onReady(function(){
cmbTimeZone.setValue(sysConf.time_zone);
txtExpirationYear = new Ext.form.TextField({
xtype: 'numberfield',
id : 'expiration_year',
name : 'expiration_year',
fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'),
allowBlank: false,
allowNegative: false,
value: 1,
maxlength: 15,
minValue: 1,
validator: function(value){
if(value > 0) {
return true;
} else {
PMExt.error( _('ID_ERROR'), _('ERROR_ONLY_POSITIVE_NUMBER'));
}
},
listeners:{
change: function(){
changeSettings();
}
}
});
txtExpirationYear.setValue(sysConf.expiration_year);
saveButton = new Ext.Action({
text : _('ID_SAVE_SETTINGS'),
disabled : true,
@@ -122,6 +147,7 @@ Ext.onReady(function(){
}
}
}
,txtExpirationYear
]
});

View File

@@ -320,7 +320,7 @@ Ext.onReady(function () {
editable : false,
readOnly : readMode,
width : 120,
value : (new Date().add(Date.YEAR, 1)).format("Y-m-d")
value : (new Date().add(Date.YEAR, EXPIRATION_DATE)).format("Y-m-d")
});
storeCalendar = new Ext.data.Store({