MT#60068 Add ¨force CLI¨ checkbox to csc add pbx seat form

Add a new "force CLI" checkbox to the add pbx seat form.
If the checkbox is ticked, "?create_primary_acli=false" is
added to the request URL params when creating a subscriber.
Removes customer_id params from createSubscriber() as it
seems to be a leftover from old code.

Change-Id: I58e287030bc740659415f888d8ed42f5ab6894d1
mr13.0
Debora Crescenzo 1 year ago
parent a66dff24a4
commit 35a4b263ea

@ -130,7 +130,7 @@ export function createGroup (group) {
pbx_hunt_timeout: group.huntTimeout,
pbx_hunt_cancel_mode: group.huntCancelMode,
pbx_groupmember_ids: group.seats
})
}, {})
}).then(($subscriberId) => {
subscriberId = $subscriberId
if (group.soundSet !== null && group.soundSet !== undefined) {

@ -155,7 +155,7 @@ export function createSeat (seat) {
is_pbx_group: false,
pbx_extension: seat.extension,
pbx_group_ids: seat.groups
})
}, { forceCli: seat.forceCli })
}).then(($subscriberId) => {
subscriberId = $subscriberId
setSeatIntraPbx(subscriberId, seat.clirIntrapbx)

@ -326,13 +326,16 @@ export function disablePrivacy (id) {
return setPrivacy(id, false)
}
export function createSubscriber (subscriber) {
export function createSubscriber (subscriber, config
) {
const params = {}
if (config.forceCli) {
params.create_primary_acli = false
}
return new Promise((resolve, reject) => {
httpApi.post('api/subscribers/', subscriber, {
params: {
customer_id: subscriber.customer_id
}
}).then((res) => {
httpApi.post('api/subscribers/', subscriber, { params }
).then((res) => {
resolve(_.last(res.headers.location.split('/')))
}).catch((err) => {
if (err.response.status >= 400) {

@ -48,6 +48,14 @@
/>
</template>
</csc-input>
<q-checkbox
v-model="data.forceCli"
emit-value
:disable="loading"
:readonly="loading"
:label="$t('Force CLI')"
:left-label="true"
/>
<q-select
v-model="data.aliasNumbers"
clearable
@ -194,9 +202,7 @@
</template>
<script>
import {
mapGetters
} from 'vuex'
import { mapGetters } from 'vuex'
import {
required,
maxLength,
@ -386,6 +392,7 @@ export default {
sipUsername: '',
webUsername: '',
extension: '',
forceCli: false,
password: {
password: '',
passwordRetype: ''
@ -409,6 +416,7 @@ export default {
sipUsername: this.data.sipUsername,
webUsername: this.data.webUsername,
extension: this.data.extension,
forceCli: this.data.forceCli,
webPassword: this.data.password.password,
sipPassword: this.data.sipPassword.password,
aliasNumbers: this.data.aliasNumbers,

@ -184,6 +184,7 @@
"Filter groups": "Filtergruppen",
"Fine": "Mittel",
"Folder : ": "Ordner : ",
"Force CLI": "Force CLI",
"Forgot password?": "Passwort vergessen?",
"Format": "Format",
"Forward": "Weiterleitung",

@ -184,6 +184,7 @@
"Filter groups": "Filtrar grupos",
"Fine": "Bien",
"Folder : ": "Folder : ",
"Force CLI": "Force CLI",
"Forgot password?": "¿Ha olvidado su contraseña?",
"Format": "Formato",
"Forward": "Forward",

@ -184,6 +184,7 @@
"Filter groups": "Groupes de filtres",
"Fine": "Fin",
"Folder : ": "Folder : ",
"Force CLI": "Force CLI",
"Forgot password?": "Mot de passe oublié ?",
"Format": "Format",
"Forward": "Forward",

@ -181,6 +181,7 @@
"Filter groups": "Filter groups",
"Fine": "Fine",
"Folder : ": "Folder : ",
"Force CLI": "Force CLI",
"Forgot password?": "Forgot password?",
"Format": "Format",
"Forward": "Forward",

@ -398,7 +398,7 @@ export default {
changes: null,
id: this.$route.params.id,
soundSet: null,
currentCli: '',
currentCli: {},
selectedTab: this.initialTab,
ncosOptions: [],
ncosSetOptions: [],

Loading…
Cancel
Save