Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
78a4d183
Commit
78a4d183
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary 'staff_id IS NOT NULL' and make sure is array in updateDeptAccess
parent
09a27654
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.group.php
+4
-3
4 additions, 3 deletions
include/class.group.php
with
4 additions
and
3 deletions
include/class.group.php
+
4
−
3
View file @
78a4d183
...
...
@@ -86,7 +86,7 @@ class Group {
if
(
!
$this
->
members
&&
$this
->
getNumUsers
())
{
$sql
=
'SELECT staff_id FROM '
.
STAFF_TABLE
.
' WHERE group_id='
.
db_input
(
$this
->
getId
())
.
' AND staff_id IS NOT NULL '
.
' WHERE group_id='
.
db_input
(
$this
->
getId
())
.
' ORDER BY lastname, firstname'
;
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
{
while
(
list
(
$id
)
=
db_fetch_row
(
$res
))
...
...
@@ -116,7 +116,8 @@ class Group {
function
updateDeptAccess
(
$depts
)
{
if
(
$depts
)
{
if
(
$depts
&&
is_array
(
$depts
))
{
foreach
(
$depts
as
$k
=>
$id
)
{
$sql
=
'INSERT IGNORE INTO '
.
GROUP_DEPT_TABLE
.
' SET group_id='
.
db_input
(
$this
->
getId
())
...
...
@@ -126,7 +127,7 @@ class Group {
}
$sql
=
'DELETE FROM '
.
GROUP_DEPT_TABLE
.
' WHERE group_id='
.
db_input
(
$this
->
getId
());
if
(
$depts
)
// just inserted departments IF any.
if
(
$depts
&&
is_array
(
$depts
)
)
// just inserted departments IF any.
$sql
.
=
' AND dept_id NOT IN('
.
implode
(
','
,
db_input
(
$depts
))
.
')'
;
db_query
(
$sql
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment