Merge pull request 'ticket create now takes clientFk from params' (#643) from 2946-ticket_create_from_client_tickets into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #643
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2021-06-09 09:42:50 +00:00
commit e3484750ba
4 changed files with 11 additions and 3 deletions

View File

@ -474,7 +474,7 @@ export default {
advancedSearchDaysOnward: 'vn-ticket-search-panel vn-input-number[ng-model="filter.scopeDays"]', advancedSearchDaysOnward: 'vn-ticket-search-panel vn-input-number[ng-model="filter.scopeDays"]',
advancedSearchClient: 'vn-ticket-search-panel vn-textfield[ng-model="filter.clientFk"]', advancedSearchClient: 'vn-ticket-search-panel vn-textfield[ng-model="filter.clientFk"]',
advancedSearchButton: 'vn-ticket-search-panel button[type=submit]', advancedSearchButton: 'vn-ticket-search-panel button[type=submit]',
newTicketButton: 'vn-ticket-index a[ui-sref="ticket.create"]', newTicketButton: 'vn-ticket-index vn-button[icon="add"]',
searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr', searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
firstTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(1) > vn-td:nth-child(1) > vn-check', firstTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(1) > vn-td:nth-child(1) > vn-check',
secondTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(2) > vn-td:nth-child(1) > vn-check', secondTicketCheckbox: 'vn-ticket-index vn-tbody > a:nth-child(2) > vn-td:nth-child(1) > vn-check',

View File

@ -166,7 +166,7 @@
vn-tooltip="Payment on account..." vn-tooltip="Payment on account..."
tooltip-position="left"> tooltip-position="left">
</vn-button> </vn-button>
<a ui-sref="ticket.create" vn-bind="+"> <a ui-sref="ticket.create($ctrl.clientParams())" vn-bind="+">
<vn-button class="round md vn-mb-sm" <vn-button class="round md vn-mb-sm"
icon="add" icon="add"
vn-tooltip="New ticket" vn-tooltip="New ticket"

View File

@ -151,6 +151,14 @@ export default class Controller extends Section {
return [minHour, maxHour]; return [minHour, maxHour];
} }
clientParams() {
if (this.$params.q) {
const params = JSON.parse(this.$params.q);
if (params.clientFk) return {clientFk: params.clientFk};
}
return {};
}
} }
Controller.$inject = ['$element', '$scope', 'vnReport']; Controller.$inject = ['$element', '$scope', 'vnReport'];