Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Joan Sanchez 2018-08-30 07:09:09 +02:00
commit 3c954f13f3
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,6 @@
translate-attr="{title: 'Clear'}"
ng-show="!$ctrl.disabled
&& $ctrl.hasValue
&& ($ctrl.hasFocus)
&& !$ctrl.unclearable"
ng-click="$ctrl.clear()">
clear

View File

@ -20,9 +20,10 @@ module.exports = Self => {
});
Self.isEditable = async ticketFk => {
let state = await Self.app.models.TicketState.findOne({where: {ticketFk: ticketFk}, fields: 'alertLevel'});
let state = await Self.app.models.TicketState.findOne({where: {ticketFk: ticketFk}});
let alertLevel = state ? state.alertLevel : null;
let exists = await Self.app.models.Ticket.findOne({where: {id: ticketFk}, fields: 'isDeleted'});
if (!exists || exists.isDeleted == 1 || state.alertLevel > 0)
if (!exists || exists.isDeleted == 1 || (alertLevel && alertLevel > 0))
return false;
return true;