Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit eefd6d7

Browse files
committed
ENH: refs #917. Add config option for temp scalar TTL
1 parent a032578 commit eefd6d7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

modules/tracker/controllers/ConfigController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ function indexAction()
3030
{
3131
$this->requireAdminPrivileges();
3232
$this->view->repoBrowserUrl = $this->Setting->getValueByName('repoBrowserUrl', $this->moduleName);
33+
$this->view->tempScalarTtl = $this->Setting->getValueByName('tempScalarTtl', $this->moduleName);
34+
if(!$this->view->tempScalarTtl)
35+
{
36+
$this->view->tempScalarTtl = 24; //default to 24 hours
37+
}
3338

3439
$breadcrumbs = array();
3540
$breadcrumbs[] = array('type' => 'moduleList');
@@ -49,7 +54,9 @@ function submitAction()
4954
$this->disableView();
5055

5156
$repoBrowserUrl = $this->_getParam('repoBrowserUrl');
52-
$this->Setting->setConfig('repoBrowserUrl', $repoBrowserUrl, $this->moduleName);
57+
$tempScalarTtl = $this->_getParam('tempScalarTtl');
58+
$this->Setting->setConfig('repoBrowserUrl', $repoBrowserUrl, $this->moduleName);
59+
$this->Setting->setConfig('tempScalarTtl', $tempScalarTtl, $this->moduleName);
5360

5461
echo JsonComponent::encode(array('message' => 'Changes saved', 'status' => 'ok'));
5562
}

modules/tracker/views/config/index.phtml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ $this->headScript()->appendFile($this->moduleWebroot.'/public/js/config/config.i
2727
<label for="repoBrowserUrl">Repository Browser URL</label>
2828
<input type="text" name="repoBrowserUrl" value="<?php echo $this->repoBrowserUrl;?>" />
2929
</div>
30+
<div class="explanation">
31+
<p>Set this field to the number of hours that unofficial submissions should be kept before being deleted automatically
32+
by the scheduler. The default value is 24 hours.</p>
33+
</div>
34+
<div>
35+
<label for="tempScalarTtl">Unofficial Scalar TTL</label>
36+
<input type="text" name="tempScalarTtl" value="<?php echo $this->tempScalarTtl;?>" />
37+
</div>
3038
<div>
3139
<input type="submit" value="Save" />
3240
</div>

0 commit comments

Comments
 (0)