Commit 73ffeeae authored by Charlotte Bataille's avatar Charlotte Bataille
Browse files

feat/19663 : work in progress

parent 79f81f50
Pipeline #18491 failed with stages
in 33 seconds
......@@ -21,6 +21,7 @@
<div class="col-sm-9">
<select class="form-control archiveInput" name="archivalProfileReference" id="archivalProfile">
</select>
<input type="hidden" id="archivalProfileToEdit" />
</div>
</div>
<div class="form-group">
......@@ -568,13 +569,12 @@
}
}
$("#originatorOrgRegNumber").on('change', changeOriginator());
function changeOriginator() {
$("#originatorOrgRegNumber").on('change', function() {
var archivalProfile = $('#archivalProfile');
archivalProfile.empty();
var option = $('<option/>').val("").text("").appendTo(archivalProfile);
var originatorOrgRegNumber = $("#archiveForm").find("[name=originatorOrgRegNumber]").val();
var archivalProfileToEdit = $('#archivalProfileToEdit').val();
if (originatorOrgRegNumber && !$('#parentArchiveId').val()) {
$.ajax({
type: 'GET',
......@@ -586,10 +586,11 @@
$.each(response, function(index, profile){
addSelectProfiles(profile);
})
archivalProfile.val(archivalProfileToEdit).change();
}
});
}
}
};
});
function updateSelectProfilesFromArchivalProfileReference(archivalProfileReference) {
var archivalProfile = $('#archivalProfile');
......
......@@ -958,8 +958,10 @@ input:invalid {
if (data.parentArchiveId) {
// console.log("je suis une sous-archive");
}
$('#archivalProfileToEdit').val(data.archivalProfileReference);
target.find("[name=originatorOrgRegNumber]").first().val(data.originatorOrgRegNumber).change();
$('#archivalProfile').val(data.archivalProfileReference).change();
// $('#archivalProfile').val(data.archivalProfileReference).change();
}
$.each(data, function(property, value) {
if (property == "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