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); echo G::json_encode($result);
break; break;
case "userExtendedAttributesList": case "userExtendedAttributesList":
$roleCode = empty($_REQUEST["roleCode"]) ? "" : $_REQUEST["roleCode"];
$userExtendedAttributes = UserExtendedAttributes::query() $userExtendedAttributes = UserExtendedAttributes::query()
->orderBy('UEA_NAME') ->where("UEA_ROLES", "like", "%\"{$roleCode}\"%")
->orWhere("UEA_OPTION", "=", "allUser")
->orderBy("UEA_NAME")
->get() ->get()
->toArray(); ->toArray();
//change key names //change key names

View File

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