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_timeout: group.huntTimeout,
pbx_hunt_cancel_mode: group.huntCancelMode, pbx_hunt_cancel_mode: group.huntCancelMode,
pbx_groupmember_ids: group.seats pbx_groupmember_ids: group.seats
}) }, {})
}).then(($subscriberId) => { }).then(($subscriberId) => {
subscriberId = $subscriberId subscriberId = $subscriberId
if (group.soundSet !== null && group.soundSet !== undefined) { if (group.soundSet !== null && group.soundSet !== undefined) {

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

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

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

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

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

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

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

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

Loading…
Cancel
Save