const currentUser = $('.admin-name').text().trim();
const selectedStoreId = $('#writeoffserp-store_id').val();
const specialStoreIds = ['1', '9', '28'];
- const allowedCommentUsers = ['Емельянова Ольга', 'Яшенкова Алена', 'Цветкова Ольга'];
+ const allowedCommentUsers = ['Емельянова Ольга', 'Яшенкова Алёна', 'Ольга Цветкова'];
const isReadonly = specialStoreIds.includes(selectedStoreId) && !allowedCommentUsers.includes(currentUser);
$('#writeoffserp-comment').prop('readonly', isReadonly);
if (!errors['__common']) errors['__common'] = [];
errors['__common'].push('Пожалуйста, добавьте хотя бы одно фото к каждому списанию перед сохранением.');
}
-console.log(currentUser, allowedCommentUsers.includes(currentUser))
+
if (!allowedCommentUsers.includes(currentUser) && commentValue !== initialCommentValue) {
if (!errors['__common']) errors['__common'] = [];
errors['__common'].push('Вы не можете редактировать комментарий для данного магазина.');