Commit cb5a4a69 authored by Prosper De Laure's avatar Prosper De Laure
Browse files

Bug : date modification on archive metadata

parent 3bc17ea5
......@@ -34,6 +34,6 @@ conversionServices = "[
clamScan = "C:\Program Files (x86)\ClamWin\bin\clamscan.exe"
clamDb = "C:\ProgramData\.clamwin\db"
tikaJarFile = "%laabsDirectory%/dependency/fileSystem/plugins/tika/tika-app-1.11.jar"
tikaJarFile = "%laabsDirectory%/dependency/fileSystem/plugins/tika/tika-app-1.16.jar"
;zipExecutable = "C:\Program Files\7-Zip\7z.exe"
\ No newline at end of file
......@@ -249,8 +249,8 @@ interface archivesInterface
* @param string $archiveId
* @param string $originatorArchiveId
* @param string $archiveName
* @param date $originatingDate
* @param string $description
* @param string $originatingDate
*
* @action recordsManagement/archive/modifyMetadata
*/
......
......@@ -157,7 +157,7 @@ class welcome
$archive->depositDate = $archive->depositDate->format('Y-m-d H:i:s');
if ($archive->originatingDate) {
$archive->originatingDate = $archive->originatingDate->format('Y-m-d');
$archive->originatingDate = $archive->originatingDate->format('d/m/Y');
}
// Retention
......@@ -392,7 +392,13 @@ class welcome
}
$descriptionHtml .= '<th title="'.$label.'" name="'.$name.'" data-type="'.$type.'">'.$label.'</th>';
$textValue = $value;
if ($type == "date") {
$textValue = \laabs::newDate($value);
$textValue = $textValue->format("d/m/Y");
} else {
$textValue = $value;
}
if ($type == 'boolean') {
$textValue = $value ? '<i class="fa fa-check" data-value="1"/>' : '<i class="fa fa-times" data-value="0"/>';
}
......@@ -400,8 +406,8 @@ class welcome
$descriptionHtml .= '</tr>';
}
$descriptionHtml .= '</table>';
}
$descriptionHtml .= '</table>';
}
if ($descriptionHtml) {
......
......@@ -352,7 +352,7 @@
archiveInformation.find('.originatingDate')
.children('td')
.html('')
.append($('#inputOriginatingDate').val($('#archiveInformation').find('.originatingDate').val()));
.append($('#inputOriginatingDate').datepicker('setDate', $('#archiveInformation').find('.originatingDate').val()));
$('#metadata').find('tr').each(function(i, e) {
var label = $(e).children('th');
......@@ -379,7 +379,7 @@
customField.datepicker({
language:$('#wrapper').attr('lang'),
autoclose:true
}).val(value.html());
}).datepicker('setDate', value.html());
break;
default :
customField = $("#inputCustomField").clone();
......@@ -401,20 +401,29 @@
var descriptionFields = {};
$('#metadata').find('tr').each(function(i, e) {
var input = $(e).find('th > input');
var valueInput = $(e).find('td > input');
var valueInput = $(e).find('td input');
var label = input.val();
var name = input.attr('name');
var type = $(e).find('th').data('type');
console.log(type);
switch (valueInput.attr("type")) {
case "name" :
case "text" :
value = valueInput.val();
break;
case "date" :
value = valueInput.datepicker({ dateFormat: 'yy-mm-dd'}).val();
break;
case "number" :
value = parseInt(valueInput.val());
break;
default:
case "number" :
inputValue = valueInput.parent('.active').find('input').val();
value = valueInput == 1 ? true : false;
break;
default:
}
if ($(e).hasClass('archivalProfileField')) {
......@@ -432,7 +441,7 @@
archiveId : ArchiveInformation.archiveId,
originatorArchiveId : $('#inputOriginatorArchiveId').val(),
archiveName : $('#inputArchiveName').val(),
originatingDate : $('#inputOriginatingDate').val(),
originatingDate : $('#inputOriginatingDate').datepicker({ dateFormat: 'yy-mm-dd' }).val(),
description : JSON.stringify(descriptionFields)
};
......
......@@ -29,7 +29,7 @@ interface modifyDescriptionInterface
* @param string $archiveId
* @param string $originatorArchiveId
* @param string $archiveName
* @param string $originatingDate
* @param date $originatingDate
* @param string $description
*
*
......
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