PMCORE-2564 User Extended Attributes roles are not working correctly

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-12-18 19:50:39 -04:00
parent e5099b1ff1
commit 8f4ceb1f36
2 changed files with 10 additions and 2 deletions

View File

@@ -75,8 +75,11 @@ try {
echo G::json_encode($result);
break;
case "userExtendedAttributesList":
$roleCode = empty($_REQUEST["roleCode"]) ? "" : $_REQUEST["roleCode"];
$userExtendedAttributes = UserExtendedAttributes::query()
->orderBy('UEA_NAME')
->where("UEA_ROLES", "like", "%\"{$roleCode}\"%")
->orWhere("UEA_OPTION", "=", "allUser")
->orderBy("UEA_NAME")
->get()
->toArray();
//change key names

View File

@@ -168,7 +168,8 @@
<b-col cols="3">
<b-form-group :label="$root.translation('ID_ROLE')">
<b-form-select v-model="form.USR_ROLE"
:options="rolesList"/>
:options="rolesList"
@change="changeRole"/>
</b-form-group>
</b-col>
</b-row>
@@ -862,6 +863,7 @@
getUserExtendedAttributesList() {
let formData = new FormData();
formData.append("option", "userExtendedAttributesList");
formData.append("roleCode", this.form.USR_ROLE);
return axios.post(this.$root.baseUrl() + "userExtendedAttributes/index", formData)
.then(response => {
response;
@@ -883,6 +885,9 @@
if (day.length < 2)
day = "0" + day;
return [year + 1, month, day].join("-");
},
changeRole() {
this.getUserExtendedAttributesList();
}
}
}