Skip to content

Commit

Permalink
Profiles. Added subscription control and privacy message (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyco97 authored Jun 10, 2024
1 parent ca69b10 commit bbea634
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ angular.module('nethvoiceWizardUiApp')
};

$scope.saveProfile = function (profile, obj_permissions, permission, macro) {
// show queueManager missing license error
if ( profile.macro_permissions.qmanager.value && !isLicenseActive){
$scope.showLicenseError = true;
$timeout(function() {
profile.macro_permissions.qmanager.value = false;
}, 1000);
}
// show privacy warning message
if ((permission.name === 'recording' && permission.value) || (permission.name === 'spy' && permission.value) || (permission.name === 'intrude' && permission.value) || (permission.name === 'ad_recording' && permission.value)) {
$scope.showPrivacyWarning = true;
}
//turn off all permissions in macro without the one selected
if (macro == "operator_panel") {
for (var p in obj_permissions.permissions) {
Expand Down Expand Up @@ -221,4 +232,31 @@ angular.module('nethvoiceWizardUiApp')
};

$scope.getAllProfiles(true);

//Retrieve information about user status
$scope.getInformationLicense = function () {
UserService.statusLicense().then(function (res) {
$scope.licenseInformation = res.data
if($scope.licenseInformation.limit !== false) {
$scope.isLicenseActive = false;
} else {
$scope.isLicenseActive = true;
}
} , function (err) {
if (err.status != 404) {
console.log(err)
}
})
}

$scope.resetLicenseErrorMessageQueueManager = function () {
$scope.showLicenseError = false;
}

$scope.resetPrivacyMessage = function () {
$scope.showPrivacyWarning = false;
}


$scope.getInformationLicense();
});
8 changes: 8 additions & 0 deletions freepbx/wizard-ui/app/scripts/controllers/routes/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ angular.module('nethvoiceWizardUiApp')
$scope.onSave = false;
$scope.getOutbounds(false);
$scope.wizard.nextState = true;
$scope.wizard.isNextDisabled = false
}, function (err) {
console.log(err);
$scope.onSaveSuccess = false;
$scope.onSaveError = true;
$scope.onSave = false;
$scope.wizard.isNextDisabled = true
});
};

Expand Down Expand Up @@ -128,4 +130,10 @@ angular.module('nethvoiceWizardUiApp')
console.log(err);
});

// User must select a language before go on the next step
$scope.resetNextStep = function () {
$scope.wizard.isNextDisabled = true
};

$scope.resetNextStep();
});
5 changes: 4 additions & 1 deletion freepbx/wizard-ui/app/scripts/i18n/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
"Incorrect username or password": "Incorrect username or password",
"Sign in to Nethvoice": "Sign in to Nethvoice",
"missing license error message": "License not present or invalid. Obtain a valid license to add multiple extensions.",
"missing license error message qmanager": "License not present or invalid. Obtain a valid license to activate Queue Manager.",
"extensions left": "extensions left",
"extension left": "extension left"
"extension left": "extension left",
"privacy message notification": "The recording, possession, reproduction, communication or dissemination of telephone conversations outside of the cases permitted by law represents an offense. It is advisable to check that all the protections provided for by the Workers' Statute and the Privacy Code and the relevant applicable regulations have been adopted before activating this functionality.",
"Warning": "Warning"
}
4 changes: 3 additions & 1 deletion freepbx/wizard-ui/app/scripts/i18n/locale-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,8 @@
"Incorrect username or password": "Nome utente o password errati",
"Sign in to Nethvoice": "Accedi a Nethvoice",
"missing license error message": "Licenza non presente o non valida. Ottieni una licenza valida per aggiungere più interni",
"missing license error message qmanager": "Licenza non presente o non valida. Ottieni una licenza valida per attivare il Queue Manager.",
"extensions left": "interni rimanenti",
"extension left": "interno rimanente"
"extension left": "interno rimanente",
"privacy message notification": "La registrazione, detenzione, riproduzione, comunicazione o diffusione di conversazioni telefoniche fuori dai casi consentiti dalla legge rappresenta un illecito. E' opportuno verificare che siano state adottate tutte le tutele previste dallo Statuto dei lavoratori e dal Codice privacy e dalle relative norme applicabili prima di attivare questa funzionalità."
}
6 changes: 6 additions & 0 deletions freepbx/wizard-ui/app/styles/trunks.css
Original file line number Diff line number Diff line change
Expand Up @@ -2396,6 +2396,9 @@ video {
.z-50 {
z-index: 50;
}
.z-1000 {
z-index: 1000;
}
.z-auto {
z-index: auto;
}
Expand Down Expand Up @@ -4908,6 +4911,9 @@ video {
.max-w-7xl {
max-width: 80rem;
}
.max-w-8xl {
max-width: 125rem;
}
.max-w-full {
max-width: 100%;
}
Expand Down
14 changes: 14 additions & 0 deletions freepbx/wizard-ui/app/views/configurations/profiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,20 @@ <h1 data-toggle="collapse" data-parent="#accordion-markup-{{$index}}" href="#col
<button data-toggle="modal" data-target="#newProfileModal" class="btn btn-primary btn-lg right-only">{{'Create new profile' | translate}}</button>
</div>
</div>
<div ng-if="showLicenseError" class="toast-pf alert alert-danger alert-dismissable generic-error">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
<span class="pficon pficon-close" ng-click="resetLicenseErrorMessageQueueManager()"></span>
</button>
<span class="pficon pficon-error-circle-o"></span>
<strong>{{'Error' | translate}}</strong>: {{'missing license error message qmanager' | translate}}
</div>
<div ng-if="showPrivacyWarning" class="toast-pf alert alert-warning alert-dismissable generic-error max-w-8xl z-1000">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
<span class="pficon pficon-close" ng-click="resetPrivacyMessage()"></span>
</button>
<span class="pficon pficon-warning-triangle-o"></span>
<strong>{{'Warning' | translate}}</strong>: {{'privacy message notification' | translate}}
</div>
<div ng-if="allProfiles | isEmpty" class="blank-slate-pf ">
<div class="blank-slate-pf-icon">
<span class="pficon pficon-users"></span>
Expand Down

0 comments on commit bbea634

Please sign in to comment.