diff --git a/src/api/subscriber.js b/src/api/subscriber.js index 4305c99c..7fa34a74 100644 --- a/src/api/subscriber.js +++ b/src/api/subscriber.js @@ -779,6 +779,7 @@ export async function getSubscriberPhonebook (options) { delete options.order_by delete options.order_by_direction } + options.include = 'all' const list = await getList({ resource: 'subscriberphonebookentries', all, diff --git a/src/pages/CscPageSubscriberPhonebook.vue b/src/pages/CscPageSubscriberPhonebook.vue index f5ae3fbb..58e567b5 100644 --- a/src/pages/CscPageSubscriberPhonebook.vue +++ b/src/pages/CscPageSubscriberPhonebook.vue @@ -58,6 +58,7 @@ @@ -75,12 +76,14 @@ icon="fas fa-pen" color="primary" :label="$t('Edit')" + :disable="isLevelEntry(row.id)" @click="showPhonebookDetails(row)" /> @@ -126,18 +129,11 @@ export default { 'subscriberPhonebook' ]), ...mapGetters('user', [ - 'isPbxEnabled' + 'isPbxEnabled', + 'getSubscriberId' ]), columns () { return [ - { - name: 'id', - required: true, - label: this.$t('Id'), - align: 'left', - field: (row) => row.id, - sortable: true - }, { name: 'name', required: true, @@ -192,7 +188,8 @@ export default { page, rows: rowsPerPage, order_by: sortBy, - order_by_direction: descending ? 'desc' : 'asc' + order_by_direction: descending ? 'desc' : 'asc', + subscriber_id: this.getSubscriberId }) this.pagination = { ...props.pagination } this.pagination.rowsNumber = count @@ -230,6 +227,10 @@ export default { async toggleShared (row) { await this.updateValueShared(row) }, + isLevelEntry (id) { + // Entries with composite Ids are considered "level entries", must not be modified (no edit or delete allowed) + return /[a-z]/.test(id) + }, openSeatTable () { this.$router.push('/user/seats') }