Commit 004e9565 authored by Charlotte Bataille's avatar Charlotte Bataille
Browse files

feat/19663 : work in progress

parent b62e10e3
Pipeline #18469 failed with stages
in 36 seconds
......@@ -579,6 +579,7 @@
url: '/orgunitprofiles?orgRegNumber=' + originatorOrgRegNumber,
dataType: 'json',
contentType: 'application/json',
async: false,
success: function (response) {
$.each(response, function(index, profile){
addSelectProfiles(profile);
......
......@@ -589,14 +589,11 @@
$('#editMetadata').on('click', function(){
$("#documentForm").hide();
var profile = $(this).parent().text().trim();
var profileMetadata = FulltextSearchForm.loadArchivalProfile(profile);
originatingDateField = $("#archiveForm").find('[name="originatingDate"]');
originatingDateField.datepicker('setDate', $('#archiveInformation').find('.originatingDate').val());
archiveId = $(".archiveInformationId").val();
Metadata.isModification = true;
NewArchive.loadImportForm($(this), profileMetadata);
NewArchive.loadImportForm($(this));
Metadata.fillInMetadata(archiveId);
});
......
......@@ -915,6 +915,7 @@ input:invalid {
async : false,
success : function (response) {
Metadata.archive = response;
// console.log(response);
Metadata.checkAndFill(Metadata.archive, $("#importPanel"));
},
error : function (response) {
......@@ -953,6 +954,18 @@ input:invalid {
}
});
} else if ($.isPlainObject(data)) {
if (data.originatorOrgRegNumber) {
if (data.parentArchiveId) {
// console.log("je suis une sous-archive");
}
target.find("[name=originatorOrgRegNumber]").first().val(data.originatorOrgRegNumber).change();
console.log(target.find("[name=archivalProfileReference]").first());
$('#archivalProfile').find("option:selected").prop("selected",false);
$('#archivalProfile').val(data.archivalProfileReference).change();
console.log($('#archivalProfile'));
// target.find("[name=archivalProfileReference]").first().find("option[value='"+data.archivalProfileReference+"']");
// console.log(target.find("[name=archivalProfileReference]").first().find("option[value='NOTSER']"));
}
$.each(data, function(property, value) {
if (property == "description") {
if (value) {
......@@ -974,7 +987,7 @@ input:invalid {
}
});
}
} else if (property == "descriptionObject") {
} else if ((property == "descriptionObject") || (property == "archivalProfileReference") || (property == "originatorOrgRegNumber") || (property == "parentArchiveId")) {
return true;
} else {
objectTarget = target.find("[name="+property+"]").first();
......
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