mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
fix for recurring_invoice permissions (#2159)
This commit is contained in:
parent
f4db62cf51
commit
3c8b1791ca
@ -19,24 +19,24 @@
|
|||||||
{!! Former::text('action') !!}
|
{!! Former::text('action') !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">{!! trans('texts.user_details') !!}</h3>
|
<h3 class="panel-title">{!! trans('texts.user_details') !!}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body form-padding-right">
|
<div class="panel-body form-padding-right">
|
||||||
|
|
||||||
{!! Former::text('first_name') !!}
|
{!! Former::text('first_name') !!}
|
||||||
{!! Former::text('last_name') !!}
|
{!! Former::text('last_name') !!}
|
||||||
{!! Former::text('email') !!}
|
{!! Former::text('email') !!}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<h3 class="panel-title">{!! trans('texts.permissions') !!}</h3>
|
<h3 class="panel-title">{!! trans('texts.permissions') !!}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body form-padding-right">
|
<div class="panel-body form-padding-right">
|
||||||
|
|
||||||
@if ( ! Utils::hasFeature(FEATURE_USER_PERMISSIONS))
|
@if ( ! Utils::hasFeature(FEATURE_USER_PERMISSIONS))
|
||||||
<div class="alert alert-warning">{{ trans('texts.upgrade_for_permissions') }}</div>
|
<div class="alert alert-warning">{{ trans('texts.upgrade_for_permissions') }}</div>
|
||||||
@ -106,8 +106,8 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<center class="buttons">
|
<center class="buttons">
|
||||||
{!! Button::normal(trans('texts.cancel'))->asLinkTo(URL::to('/settings/user_management'))->appendIcon(Icon::create('remove-circle'))->large() !!}
|
{!! Button::normal(trans('texts.cancel'))->asLinkTo(URL::to('/settings/user_management'))->appendIcon(Icon::create('remove-circle'))->large() !!}
|
||||||
@ -130,20 +130,7 @@
|
|||||||
|
|
||||||
@section('onReady')
|
@section('onReady')
|
||||||
|
|
||||||
//start legacy
|
|
||||||
$('#first_name').focus();
|
$('#first_name').focus();
|
||||||
$('#is_admin, #permissions_view_all').change(fixCheckboxes);
|
|
||||||
function fixCheckboxes(){
|
|
||||||
var adminChecked = $('#is_admin').is(':checked');
|
|
||||||
var viewChecked = $('#permissions_view_all').is(':checked');
|
|
||||||
|
|
||||||
$('#permissions_view_all').prop('disabled', adminChecked);
|
|
||||||
$('#permissions_create_all').prop('disabled', adminChecked);
|
|
||||||
$('#permissions_edit_all').prop('disabled', adminChecked || !viewChecked);
|
|
||||||
if(!viewChecked)$('#permissions_edit_all').prop('checked',false)
|
|
||||||
}
|
|
||||||
fixCheckboxes();
|
|
||||||
//end legacy
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -154,7 +141,13 @@
|
|||||||
|
|
||||||
$("input[type='checkbox'][id^='view_']").each(function() {
|
$("input[type='checkbox'][id^='view_']").each(function() {
|
||||||
|
|
||||||
var entity = $(this).attr('id').split("_")[1].replace("]",""); //get entity name
|
var entity = $(this).attr('id')
|
||||||
|
.replace('create_',"")
|
||||||
|
.replace('view_',"")
|
||||||
|
.replace('edit_',"")
|
||||||
|
.replace(']',"")
|
||||||
|
.replace('[',""); //get entity name
|
||||||
|
|
||||||
$('#edit_' + entity).prop('disabled', !$('#view_' + entity).is(':checked')); //set state of edit checkbox
|
$('#edit_' + entity).prop('disabled', !$('#view_' + entity).is(':checked')); //set state of edit checkbox
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -168,7 +161,12 @@
|
|||||||
|
|
||||||
$("input[type='checkbox'][id^='view_']").change(function(){
|
$("input[type='checkbox'][id^='view_']").change(function(){
|
||||||
|
|
||||||
var entity = $(this).attr('id').split("_")[1].replace("]",""); //get entity name
|
var entity = $(this).attr('id')
|
||||||
|
.replace('create_',"")
|
||||||
|
.replace('view_',"")
|
||||||
|
.replace('edit_',"")
|
||||||
|
.replace(']',"")
|
||||||
|
.replace('[',""); //get entity name
|
||||||
|
|
||||||
$('#edit_' + entity).prop('disabled', !$('#view_' + entity).is(':checked')); //set state of edit checkbox
|
$('#edit_' + entity).prop('disabled', !$('#view_' + entity).is(':checked')); //set state of edit checkbox
|
||||||
|
|
||||||
@ -185,15 +183,25 @@
|
|||||||
|
|
||||||
$("input[type='checkbox'][id^=" + permission_type + "]").each(function() {
|
$("input[type='checkbox'][id^=" + permission_type + "]").each(function() {
|
||||||
|
|
||||||
var entity = $(this).attr('id').split("_")[1].replace("]",""); //get entity name
|
var entity = $(this).attr('id')
|
||||||
|
.replace('create_',"")
|
||||||
|
.replace('view_',"")
|
||||||
|
.replace('edit_',"")
|
||||||
|
.replace(']',"")
|
||||||
|
.replace('[',""); //get entity name
|
||||||
|
|
||||||
$('#' + permission_type + entity).prop('checked', checked); //set state of edit checkbox
|
$('#' + permission_type + entity).prop('checked', checked); //set state of edit checkbox
|
||||||
|
|
||||||
if(!$('#view_' + entity).is(':checked')) {
|
if(!$('#view_' + entity).is(':checked')) {
|
||||||
$('#edit_' + entity).prop('checked', false); //remove checkbox value from edit dependant on View state.
|
$('#edit_' + entity).prop('checked', false); //remove checkbox value from edit dependant on View state.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#edit_' + entity).prop('disabled', !$('#view_' + entity).is(':checked')); //set state of edit checkbox
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user