Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
maarchRM
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Maarch Labs
maarchRM
Commits
d076d315
Commit
d076d315
authored
Oct 20, 2017
by
Alexis Ragot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toggle to see only activated users
parent
64ce7951
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
4 deletions
+47
-4
userAccount.php
src/bundle/auth/Controller/userAccount.php
+7
-1
userAccountInterface.php
src/bundle/auth/userAccountInterface.php
+2
-1
messages.po
...resentation/maarchRM/Resources/locale/fr/auth/messages.po
+3
-0
index.html
...maarchRM/Resources/view/auth/userAccount/admin/index.html
+34
-1
adminUseraccountInterface.php
...aarchRM/UserStory/adminFunc/adminUseraccountInterface.php
+1
-1
No files found.
src/bundle/auth/Controller/userAccount.php
View file @
d076d315
...
...
@@ -78,17 +78,23 @@ class userAccount
/**
* List all users to display
* @param string $query
*
* @return array The array of stdClass
*/
public
function
userList
()
public
function
userList
(
$query
=
null
)
{
$accountId
=
\laabs
::
getToken
(
"AUTH"
)
->
accountId
;
$queryAssert
=
[];
$queryAssert
[]
=
"accountType='user'"
;
if
(
$query
)
{
$queryAssert
[]
=
"
$query
"
;
}
$account
=
$this
->
sdoFactory
->
read
(
"auth/account"
,
array
(
"accountId"
=>
$accountId
));
if
(
!
empty
(
$this
->
adminUsers
)
&&
!
in_array
(
$account
->
accountName
,
$this
->
adminUsers
))
{
$queryAssert
[]
=
"accountId!=['"
.
\laabs\implode
(
"','"
,
$this
->
adminUsers
)
.
"']"
;
}
...
...
src/bundle/auth/userAccountInterface.php
View file @
d076d315
...
...
@@ -36,10 +36,11 @@ interface userAccountInterface
/**
* List the user account
* @param string $query
*
* @action auth/userAccount/userList
*/
public
function
readUserlist
();
public
function
readUserlist
(
$query
=
null
);
/**
* List the user account detail
...
...
src/presentation/maarchRM/Resources/locale/fr/auth/messages.po
View file @
d076d315
...
...
@@ -695,3 +695,6 @@ msgstr "Le champs est vide"
msgid "Passwords are not the same"
msgstr "Les mots de passe sont pas identiques"
msgid "Display only activated users"
msgstr "Afficher uniquement les utilisateurs activés"
src/presentation/maarchRM/Resources/view/auth/userAccount/admin/index.html
View file @
d076d315
...
...
@@ -10,11 +10,18 @@
<div
class=
"container-fluid"
>
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<div
class=
"form-group"
>
<label
class=
"control-label"
>
Display only activated users
</label>
<input
type=
"checkbox"
name=
"activatedUsers"
id=
"activatedUsers"
data-toggle=
"toggle"
data-size=
"mini"
>
</div>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading clearfix"
>
<div
class=
"pull-left"
>
<h4>
Users
</h4>
</div>
<div
class=
"pull-left"
>
</div>
<div
class=
"pull-right"
>
<button
type=
"button"
class=
"btn btn-default btn-sm"
id=
"user_newUser"
title=
"Add"
><i
class=
"fa fa-plus"
>
</i>
Add
</button>
</div>
...
...
@@ -75,8 +82,34 @@
<?hinclude auth/userAccount/admin/modalsForDisabling.html ?>
</div>
</div>
<script
src=
"/public/dependency/html/js/bootstrap-toggle/bootstrap-toggle.js"
></script>
<script
type=
"application/javascript"
>
$
(
"#contain"
).
ready
(
function
()
{
/*$('#activatedUsers').bootstrapToggle({
size: 'mini',
on: 'Yes',
off: 'All'
});*/
var
url
=
new
URL
(
document
.
URL
);
var
deactivatedUsers
=
url
.
searchParams
.
get
(
"query"
);
if
(
deactivatedUsers
===
'enabled=true'
)
{
$
(
"#activatedUsers"
).
bootstrapToggle
(
'on'
);
}
});
$
(
"#contain"
).
on
(
'click'
,
'#activatedUsers'
,
function
()
{
let
value
=
$
(
this
).
prop
(
'checked'
);
if
(
value
)
{
let
param
=
encodeURIComponent
(
"enabled=true"
);
window
.
location
.
replace
(
"/userAccounts?query="
+
param
);
}
else
{
window
.
location
.
replace
(
"/userAccounts"
);
}
});
//add
$
(
"#user_newUser"
).
on
(
'click'
,
function
()
{
...
...
src/presentation/maarchRM/UserStory/adminFunc/adminUseraccountInterface.php
View file @
d076d315
...
...
@@ -31,7 +31,7 @@ interface adminUseraccountInterface
* @return auth/user/indexHtml
* @uses auth/userAccount/readUserlist
*/
public
function
readUseraccounts
();
public
function
readUseraccounts
(
$query
=
null
);
/**
* Prepare an empty user object
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment