During create we were passing the wrong objectlcasses to the ajax call when adding a new attribute.

This commit is contained in:
Deon George 2025-04-11 15:37:20 +10:00
parent 3fad9770a3
commit b501dfe824

View File

@ -70,8 +70,8 @@
@endsection @endsection
@section('page-scripts') @section('page-scripts')
<script type="text/javascript"> <script type="text/javascript">
var oc = {!! $oo->getObject('objectclass')->values !!};
var rdn_attr; var rdn_attr;
function editmode() { function editmode() {
@ -100,31 +100,35 @@
} }
$(document).ready(function() { $(document).ready(function() {
$('#newattr').on('change',function(item) { @if($step === 2)
$.ajax({ var oc = {!! $o->getObject('objectclass')->values !!};
type: 'POST',
beforeSend: function() {}, $('#newattr').on('change',function(item) {
success: function(data) { $.ajax({
$('#newattrs').append(data); type: 'POST',
}, url: '{{ url('entry/attr/add') }}/'+item.target.value,
error: function(e) { data: {
if (e.status != 412) objectclasses: oc,
alert('That didnt work? Please try again....'); },
}, cache: false,
url: '{{ url('entry/attr/add') }}/'+item.target.value, beforeSend: function() {},
data: { success: function(data) {
objectclasses: oc, $('#newattrs').append(data);
}, },
cache: false error: function(e) {
if (e.status != 412)
alert('That didnt work? Please try again....');
},
});
// Remove the option from the list
$(this).find('[value="'+item.target.value+'"]').remove()
// If there are no more options
if ($(this).find("option").length === 1)
$('#newattr-select').remove();
}); });
@endif
// Remove the option from the list
$(this).find('[value="'+item.target.value+'"]').remove()
// If there are no more options
if ($(this).find("option").length === 1)
$('#newattr-select').remove();
});
editmode(); editmode();
}); });