TT#149351 Seats - As PBXAdmin, I can update the Music on hold preference of all PBXSeats

Change-Id: Ieb32097c589b92dae6154ac410c45322d48620f0
pull/9/head
Carlo Venusino 4 years ago committed by Hans-Peter Herzog
parent 07b0e28761
commit ea9f43b108

@ -9,6 +9,7 @@ import {
setPbxGroupIds, setPbxGroupIds,
setSubscriberNumbers, setSubscriberNumbers,
setPreferenceIntraPbx, setPreferenceIntraPbx,
setPreferenceMusicOnHold,
getPreferences, getPreferences,
setPbxSIPPassword setPbxSIPPassword
} from './subscriber' } from './subscriber'
@ -262,6 +263,14 @@ export function setSeatIntraPbx (seatId, clirIntrapbx) {
return setPreferenceIntraPbx(seatId, clirIntrapbx) return setPreferenceIntraPbx(seatId, clirIntrapbx)
} }
/**
* @param seatId
* @param musicOnHold
*/
export function setSeatMusicOnHold (seatId, musicOnHold) {
return setPreferenceMusicOnHold(seatId, musicOnHold)
}
/** /**
* @param options * @param options
* @param options.seatId * @param options.seatId

@ -329,6 +329,10 @@ export function setPreferenceIntraPbx (id, value) {
return setPreference(id, 'clir_intrapbx', value) return setPreference(id, 'clir_intrapbx', value)
} }
export function setPreferenceMusicOnHold (id, value) {
return setPreference(id, 'music_on_hold', value)
}
export function getSubscribers (options) { export function getSubscribers (options) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
options = options || {} options = options || {}

@ -99,6 +99,19 @@
/> />
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item
class="no-padding"
>
<q-item-section>
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
:label="$t('Music on hold')"
:disable="loading"
@input="changeMusicOnHold"
/>
</q-item-section>
</q-item>
</csc-more-menu> </csc-more-menu>
</q-item-section> </q-item-section>
</template> </template>
@ -243,6 +256,13 @@
:disable="loading" :disable="loading"
@click="jumpToCallQueue" @click="jumpToCallQueue"
/> />
<q-toggle
v-model="changes.musicOnHold"
class="q-pa-sm"
:label="$t('Music on hold')"
:disable="loading"
@input="changeMusicOnHold"
/>
</div> </div>
</q-expansion-item> </q-expansion-item>
</template> </template>
@ -318,6 +338,10 @@ export default {
hasCallQueue: { hasCallQueue: {
type: Boolean, type: Boolean,
default: undefined default: undefined
},
musicOnHold: {
type: Boolean,
default: undefined
} }
}, },
data () { data () {
@ -398,6 +422,7 @@ export default {
aliasNumbers: this.getAliasNumberIds(), aliasNumbers: this.getAliasNumberIds(),
webPassword: this.seat.webpassword, webPassword: this.seat.webpassword,
clirIntrapbx: this.intraPbx, clirIntrapbx: this.intraPbx,
musicOnHold: this.musicOnHold,
groups: this.getGroupIds(), groups: this.getGroupIds(),
soundSet: this.getSoundSetId() soundSet: this.getSoundSetId()
} }
@ -511,6 +536,12 @@ export default {
seatId: this.seat.id, seatId: this.seat.id,
intraPbx: this.changes.clirIntrapbx intraPbx: this.changes.clirIntrapbx
}) })
},
changeMusicOnHold () {
this.$emit('save-music-on-hold', {
seatId: this.seat.id,
musicOnHold: this.changes.musicOnHold
})
} }
} }
} }

@ -246,6 +246,7 @@
"Monday": "Monday", "Monday": "Monday",
"Monthly": "Monthly", "Monthly": "Monthly",
"Music on Hold": "Music on Hold", "Music on Hold": "Music on Hold",
"Music on hold": "Music on hold",
"Mute": "Mute", "Mute": "Mute",
"Mute all": "Mute all", "Mute all": "Mute all",
"MyNumberList": "MyNumberList", "MyNumberList": "MyNumberList",
@ -529,6 +530,7 @@
"forwarded to": "forwarded to", "forwarded to": "forwarded to",
"from": "from", "from": "from",
"minutes": "minutes", "minutes": "minutes",
"music on hold of the seat": "music on hold of the seat",
"name": "name", "name": "name",
"office hours are": "office hours are", "office hours are": "office hours are",
"office hours are ...": "office hours are ...", "office hours are ...": "office hours are ...",

@ -77,6 +77,7 @@
:class="'col-xs-12 col-md-6 col-lg-4 csc-item-' + ((index % 2 === 0)?'odd':'even')" :class="'col-xs-12 col-md-6 col-lg-4 csc-item-' + ((index % 2 === 0)?'odd':'even')"
:seat="seat" :seat="seat"
:intra-pbx="getIntraPbx(seat.id)" :intra-pbx="getIntraPbx(seat.id)"
:music-on-hold="getMusicOnHold(seat.id)"
:groups="groupMapById" :groups="groupMapById"
:expanded="isSeatExpanded(seat.id)" :expanded="isSeatExpanded(seat.id)"
:loading="isSeatLoading(seat.id)" :loading="isSeatLoading(seat.id)"
@ -95,6 +96,7 @@
@save-groups="setSeatGroups" @save-groups="setSeatGroups"
@save-sound-set="setSeatSoundSet" @save-sound-set="setSeatSoundSet"
@save-intra-pbx="setIntraPbx" @save-intra-pbx="setIntraPbx"
@save-music-on-hold="setMusicOnHold"
@jump-to-call-queue="jumpToCallQueue" @jump-to-call-queue="jumpToCallQueue"
/> />
</q-list> </q-list>
@ -189,6 +191,7 @@ export default {
'isSeatExpanded', 'isSeatExpanded',
'isSeatLoading', 'isSeatLoading',
'getIntraPbx', 'getIntraPbx',
'getMusicOnHold',
'getSoundSetBySeatId', 'getSoundSetBySeatId',
'getSeatCreatingName', 'getSeatCreatingName',
'getSeatUpdatingField', 'getSeatUpdatingField',
@ -241,7 +244,8 @@ export default {
'setSeatGroups', 'setSeatGroups',
'setSeatNumbers', 'setSeatNumbers',
'setSeatSoundSet', 'setSeatSoundSet',
'setIntraPbx' 'setIntraPbx',
'setMusicOnHold'
]), ]),
...mapMutations('pbxSeats', [ ...mapMutations('pbxSeats', [
'enableSeatAddForm', 'enableSeatAddForm',

@ -19,6 +19,7 @@ import {
setSeatNumbers, setSeatNumbers,
setSeatSoundSet, setSeatSoundSet,
setSeatIntraPbx, setSeatIntraPbx,
setSeatMusicOnHold,
setSeatWebPassword, setSeatWebPassword,
getSeatPreferences, getSeatPreferences,
setSeatSIPPassword setSeatSIPPassword
@ -98,6 +99,11 @@ export default {
return seatPreferences && seatPreferences.clir_intrapbx ? state.preferenceMapById[id].clir_intrapbx : false return seatPreferences && seatPreferences.clir_intrapbx ? state.preferenceMapById[id].clir_intrapbx : false
} }
}, },
getMusicOnHold (state) {
return (id) => {
return state?.preferenceMapById[id]?.music_on_hold || false
}
},
getSeatCreatingName (state) { getSeatCreatingName (state) {
return _.get(state, 'seatCreating.name', '') return _.get(state, 'seatCreating.name', '')
}, },
@ -431,6 +437,18 @@ export default {
} catch (err) { } catch (err) {
context.commit('seatUpdateFailed', err.message) context.commit('seatUpdateFailed', err.message)
} }
},
async setMusicOnHold (context, options) {
context.commit('seatUpdateRequesting', {
seatId: options.seatId,
seatField: options.message || i18n.t('music on hold of the seat')
})
try {
const result = await setSeatMusicOnHold(options.seatId, options.musicOnHold)
context.commit('seatUpdateSucceeded', result)
} catch (err) {
context.commit('seatUpdateFailed', err.message)
}
} }
} }
} }

Loading…
Cancel
Save