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

Bug correction on metadatas modification

parent 4aa09c6b
......@@ -297,14 +297,14 @@ class welcome
$descriptionHtml = '<table">';
if (isset($archive->descriptionObject)) {
if (isset($archivalProfile->archiveDescription)) {
/*if (isset($archivalProfile->archiveDescription)) {
foreach ($archivalProfile->archiveDescription as $archiveDescription) {
if (!array_key_exists($archiveDescription->fieldName, $archive->descriptionObject)) {
$archive->descriptionObject->{$archiveDescription->fieldName} = "";
unset($archive->descriptionObject->{$archiveDescription->fieldName};
}
}
}
}*/
//var_dump($archive->descriptionObject);
foreach ($archive->descriptionObject as $name => $value) {
$label = $type = $archivalProfileField = null;
if ($archivalProfile) {
......
......@@ -853,8 +853,8 @@ msgstr "Archive modifée"
msgid "Add field"
msgstr "Ajouter un champ"
msgid "A label is missing."
msgstr "Un libellé n'a pas été renseigné"
msgid "Metadatas are incomplete."
msgstr "Les metadonnées sont imcomplètes."
msgid "Label"
msgstr "Libellé"
......
......@@ -26,9 +26,9 @@
<th title="Name">Name</th>
<td title='[?merge archive.archiveName ?]'><?merge archive.archiveName ?></td>
</tr>
<tr class="archiveName">
<tr class="archiveId">
<th title="Name">Originator</th>
<td title='[?merge archive.archiveName ?]'><?merge archive.originatorOrgName ?></td>
<td title='[?merge archive.originatorOrgName ?]'><?merge archive.originatorOrgName ?></td>
</tr>
<tr class="archiveId">
<th title="Identifier">Identifier</th>
......@@ -162,7 +162,7 @@
<input id="inputOriginatorArchiveId" name="originatorArchiveId" type="text" class="col-xs-12"/>
<input id="inputCustomField" placeholder="Value" type="text" class="col-xs-12"/>
<input id="inputCustomLabel" placeholder="Label" type="text" class="col-xs-12" style="text-align: right"/>
<span id="customFieldError_txt">A label is missing.</span>
<span id="customFieldError_txt">Metadatas are incomplete.</span>
</div>
<style type="text/css">
......@@ -321,36 +321,36 @@
var customLabel = $("#inputCustomLabel").clone();
customLabel.val(label.html());
if ($(e).hasClass('archivalProfileField')) {
customLabel.prop("disabled", true);
}
customLabel.attr('name', label.attr('name'));
label.html('').append(customLabel);
var customField = $("#inputCustomField").clone();
customField.val(value.html());
value.html('').append(customField);
});
console.log($('#metadata').find('.archivalProfileField'));
$('#metadata').find('.archivalProfileField').find('th input').prop('disabled', true);
},
saveMetadata: function() {
var descriptionFields = {};
$('#metadata').find('tr').each(function(i, e) {
var label = $(e).find('th > input').val();
var name = $(e).find('th > input').attr('name');
var value = $(e).find('td > input').val();
if (label != '' && value != '') {
if ($(e).hasClass('archivalProfileField')) {
descriptionFields[name] = name;
} else if (label != '' && value != '') {
descriptionFields[label] = value;
} else if (label == '' && value != '') {
gritter.show($('#customFieldError_txt').text(), false);
descriptionFields = -1;
return;
} else {
//gritter.show($('#customFieldError_txt').text(), false);
//descriptionFields = -1;
//return;
}
});
if (descriptionFields == -1) {
return;
}
var parameters = {
archiveId : ArchiveInformation.archiveId,
originatorArchiveId : $('#archiveInformation').find('#inputOriginatorArchiveId').val(),
......
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