Skip to content

Commit

Permalink
Merge pull request #16 from jorisros/bugfix/issue-15
Browse files Browse the repository at this point in the history
[#15] Solve the problem in receiving the roles
  • Loading branch information
dpfaffenbauer authored Jan 23, 2019
2 parents c834e5f + 4a6ce40 commit e2e008e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/WorkflowGui/Controller/WorkflowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,27 +156,29 @@ public function searchRolesAction(Request $request)

$q = '%'.$request->get('query').'%';

$list = new User\Listing();
$list = new User\Role\Listing();
$list->setCondition('name LIKE ?', [$q]);
$list->setOrder('ASC');
$list->setOrderKey('name');
$list->load();

$users = [];
if (is_array($list->getUsers())) {
foreach ($list->getUsers() as $user) {
if ($user instanceof User\Role && $user->getId()) {
$users[] = [
'id' => $user->getId(),
'name' => $user->getName(),
$roles = [];
if (is_array($list->getRoles())) {

/** @var User\Role $role */
foreach ($list->getRoles() as $role) {
if ($role instanceof User\Role && $role->getId()) {
$roles[] = [
'id' => $role->getId(),
'name' => $role->getName(),
];
}
}
}

return $this->adminJson([
'success' => true,
'roles' => $users,
'roles' => $roles,
]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pimcore.plugin.workflow.transition_notification = Class.create({

return Ext.create('Ext.form.ComboBox', {
store: store,
name: 'notifyRules',
name: 'notifyRoles',
displayField: 'name',
valueField: 'id',
loadingText: t('searching'),
Expand Down

0 comments on commit e2e008e

Please sign in to comment.