Unverified Commit 35f0d500 authored by Dylan's avatar Dylan
Browse files

#7528 fix translation

parent 7976bd6f
......@@ -54,10 +54,6 @@ class retentionRule
if ($retentionRule->duration == null) {
continue;
}
if ($retentionRule->duration->y == 999999999) {
$retentionRule->duration = null;
$retentionRule->durationUnit = "Illimité";
}
}
return $retentionRules;
......
......@@ -67,21 +67,25 @@ class retentionRule
$this->view->addContentFile('recordsManagement/retentionRule/index.html');
$this->view->translate();
$dataTable = $this->view->getElementById("rulesTable")->plugin['dataTable'];
$dataTable->setPaginationType("full_numbers");
$dataTable->setUnsortableColumns(5);
foreach ($retentionRule as $rule) {
if (!isset($rule->durationUnit)) {
$rule->durationUnit = substr($rule->duration, -1);
$rule->duration = substr($rule->duration, 1, -1);
$rule->durationUnit = substr($rule->duration, -1);
$rule->duration = substr($rule->duration, 1, -1);
if($rule->duration >= 9999 && $rule->durationUnit == 'Y' ){
$rule->durationText = $this->view->translator->getText('Unlimited', null, "recordsManagement/retentionRule");
} else {
$rule->durationUnit = $this->view->translator->getText($rule->durationUnit, "duration", "recordsManagement/retentionRule");
$rule->durationText = $rule->duration.' '. $rule->durationUnit;
}
$rule->finalDispositionTran = $this->view->translator->getText($rule->finalDisposition, false, "recordsManagement/retentionRule");
}
$this->view->setSource('retentionRule', $retentionRule);
$this->view->merge();
$dataTable = $this->view->getElementById("rulesTable")->plugin['dataTable'];
$dataTable->setPaginationType("full_numbers");
$dataTable->setUnsortableColumns(array(4));
return $this->view->saveHtml();
}
......@@ -96,20 +100,27 @@ class retentionRule
$this->view->addContentFile('recordsManagement/retentionRule/list.html');
$this->view->translate();
$dataTable = $this->view->getElementById("rulesTable")->plugin['dataTable'];
$dataTable->setPaginationType("full_numbers");
$dataTable->setUnsortableColumns(array(4));
foreach ($retentionRule as $rule) {
$rule->durationUnit = substr($rule->duration, -1);
$rule->duration = substr($rule->duration, 1, -1);
$rule->durationUnit = $this->view->translator->getText($rule->durationUnit, "duration", "recordsManagement/retentionRule");
if($rule->duration >= 9999 && $rule->durationUnit == 'Y' ){
$this->view->translator->getText('unlimited', null, "recordsManagement/retentionRule");
} else {
$rule->durationUnit = $this->view->translator->getText($rule->durationUnit, "duration", "recordsManagement/retentionRule");
}
$rule->durationText = $rule->duration.' '. $rule->durationUnit;
}
$this->view->setSource('retentionRule', $retentionRule);
$this->view->merge();
$dataTable = $this->view->getElementById("rulesTable")->plugin['dataTable'];
$dataTable->setPaginationType("full_numbers");
$dataTable->setUnsortableColumns(array(4));
return $this->view->saveHtml();
}
......
......@@ -351,7 +351,7 @@
var retentionRuleCode = $("#retentionRuleCode").find(':selected').data('json');
var retentionRules = "";
var retentionRuleTable = $('#retentionRuleTable');
console.log(retentionRuleCode)
if (retentionRuleCode) {
var retentionRuleDurationUnit = retentionRuleCode.duration.substr(retentionRuleCode.duration.length - 1, 1);
......
......@@ -352,6 +352,10 @@
$.each(object, function (key, value) {
$('[name="' + key + '"]').val(value);
});
if( $('[name="duration"]').val() >=9999 & $('#durationUnit').val()=='Y' ) {
$('#durationUnit').val('*');
$('[name="duration"]').val('').prop('disabled',true);
}
}
</script>
......@@ -27,7 +27,7 @@
<td><?merge .code ?></td>
<td><?merge .label ?></td>
<td><?merge .description ?></td>
<td><?merge .duration ?>&nbsp;<?merge .durationUnit ?></td>
<td><?merge .durationText ?></td>
<td><?merge .finalDispositionTran ?></td>
<td>
<div class="btn-group pull-right">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment