|
@@ -62,22 +62,27 @@ $(document).ready(() => {
|
|
|
if (ptype === 'contract') {
|
|
|
const pvalue = $(this).attr('pvalue');
|
|
|
if (this.checked) {
|
|
|
- if ((pvalue === '1' || pvalue === '2') && !$('[ptype=contract][pvalue="3"]').prop('checked') && !$('[ptype=contract][pvalue="4"]').prop('checked')) {
|
|
|
- $('[ptype=contract][pvalue="5"]').prop('checked', true);
|
|
|
+ if ((pvalue === '1' || pvalue === '2') && !$(this).parents('.permission-parent').find('[ptype=contract][pvalue="3"]').prop('checked') && !$(this).parents('.permission-parent').find('[ptype=contract][pvalue="4"]').prop('checked')) {
|
|
|
+ $(this).parents('.permission-parent').find('[ptype=contract][pvalue="5"]').prop('checked', true);
|
|
|
}
|
|
|
if (pvalue === '3' || pvalue === '4') {
|
|
|
- $('[ptype=contract][pvalue="5"]').prop('checked', false);
|
|
|
+ $(this).parents('.permission-parent').find('[ptype=contract][pvalue="5"]').prop('checked', false);
|
|
|
} else if (pvalue === '5') {
|
|
|
- $('[ptype=contract][pvalue="3"]').prop('checked', false);
|
|
|
- $('[ptype=contract][pvalue="4"]').prop('checked', false);
|
|
|
+ $(this).parents('.permission-parent').find('[ptype=contract][pvalue="3"]').prop('checked', false);
|
|
|
+ $(this).parents('.permission-parent').find('[ptype=contract][pvalue="4"]').prop('checked', false);
|
|
|
}
|
|
|
} else if (!this.checked) {
|
|
|
if (pvalue === '3' || pvalue === '4') {
|
|
|
- if (!$('[ptype=contract][pvalue="3"]').prop('checked') && !$('[ptype=contract][pvalue="4"]').prop('checked')) {
|
|
|
- $('[ptype=contract][pvalue="5"]').prop('checked', true);
|
|
|
+ if (!$(this).parents('.permission-parent').find('[ptype=contract][pvalue="3"]').prop('checked') && !$(this).parents('.permission-parent').find('[ptype=contract][pvalue="4"]').prop('checked')) {
|
|
|
+ $(this).parents('.permission-parent').find('[ptype=contract][pvalue="5"]').prop('checked', true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } else if (ptype === 'payment') {
|
|
|
+ const pvalue = $(this).attr('pvalue');
|
|
|
+ if (this.checked && pvalue === '2') {
|
|
|
+ $(this).parents('.permission-parent').find('[ptype=payment][pvalue="3"]').prop('checked', true);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
$('[name=set-permission]').click(function() {
|