diff --git a/back/model-config.json b/back/model-config.json index da9feaa1f..f0032edab 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -76,12 +76,6 @@ }, "UserLog": { "dataSource": "vn" - }, - "WorkerTimeControlParams": { - "dataSource": "vn" - }, - "WorkerTimeControlMail": { - "dataSource": "vn" } } diff --git a/back/models/worker-time-control-params.js b/back/models/worker-time-control-params.js deleted file mode 100644 index c71d4c237..000000000 --- a/back/models/worker-time-control-params.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Self => { - require('../methods/imap-time-control/checkInbox')(Self); -}; diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index 01ff8577c..4fd10192f 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -52,7 +52,7 @@ icon="add" ui-sref="client.card.greuge.create" vn-tooltip="New greuge" - vn-acl="salesAssistant" + vn-acl="salesAssistant,claimManager" vn-acl-action="remove" vn-bind="+" fixed-bottom-right> diff --git a/modules/client/front/routes.json b/modules/client/front/routes.json index a3ee4dd86..a2d559645 100644 --- a/modules/client/front/routes.json +++ b/modules/client/front/routes.json @@ -185,7 +185,7 @@ "state": "client.card.greuge.create", "component": "vn-client-greuge-create", "description": "New greuge", - "acl": ["salesAssistant"], + "acl": ["salesAssistant", "claimManager"], "params": { "client": "$ctrl.client" } diff --git a/back/methods/imap-time-control/checkInbox.js b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js similarity index 97% rename from back/methods/imap-time-control/checkInbox.js rename to modules/worker/back/methods/worker-time-control-mail/checkInbox.js index 9411b95e5..fa42f8135 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js @@ -35,6 +35,10 @@ module.exports = Self => { imap.once('ready', function() { openInbox(function(err, box) { if (err) throw err; + const totalMessages = box.messages.total; + if (totalMessages == 0) + imap.end(); + let f = imap.seq.fetch('1:*', { bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], struct: true diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 7a498fce7..e35e39721 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -55,6 +55,12 @@ }, "WorkerLog": { "dataSource": "vn" + }, + "WorkerTimeControlParams": { + "dataSource": "vn" + }, + "WorkerTimeControlMail": { + "dataSource": "vn" } } diff --git a/modules/worker/back/models/worker-time-control-mail.js b/modules/worker/back/models/worker-time-control-mail.js new file mode 100644 index 000000000..36f3851b6 --- /dev/null +++ b/modules/worker/back/models/worker-time-control-mail.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/worker-time-control-mail/checkInbox')(Self); +}; diff --git a/back/models/worker-time-control-mail.json b/modules/worker/back/models/worker-time-control-mail.json similarity index 100% rename from back/models/worker-time-control-mail.json rename to modules/worker/back/models/worker-time-control-mail.json diff --git a/back/models/worker-time-control-params.json b/modules/worker/back/models/worker-time-control-params.json similarity index 100% rename from back/models/worker-time-control-params.json rename to modules/worker/back/models/worker-time-control-params.json