Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
b01842d2
Commit
b01842d2
authored
9 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
role: Add option to use primary role on assignment
parent
b33a0315
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/class.staff.php
+15
-4
15 additions, 4 deletions
include/class.staff.php
include/i18n/en_US/help/tips/staff.agent.yaml
+11
-1
11 additions, 1 deletion
include/i18n/en_US/help/tips/staff.agent.yaml
include/staff/staff.inc.php
+16
-3
16 additions, 3 deletions
include/staff/staff.inc.php
with
42 additions
and
8 deletions
include/class.staff.php
+
15
−
4
View file @
b01842d2
...
@@ -413,6 +413,10 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
...
@@ -413,6 +413,10 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
}
}
}
}
function
usePrimaryRoleOnAssignment
()
{
return
$this
->
getExtraAttr
(
'def_assn_role'
,
true
);
}
function
getLanguage
()
{
function
getLanguage
()
{
return
(
isset
(
$this
->
lang
))
?
$this
->
lang
:
false
;
return
(
isset
(
$this
->
lang
))
?
$this
->
lang
:
false
;
}
}
...
@@ -437,8 +441,11 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
...
@@ -437,8 +441,11 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
if
(
$access
=
$this
->
dept_access
->
findFirst
(
array
(
'dept_id'
=>
$deptId
)))
if
(
$access
=
$this
->
dept_access
->
findFirst
(
array
(
'dept_id'
=>
$deptId
)))
return
$this
->
_roles
[
$deptId
]
=
$access
->
role
;
return
$this
->
_roles
[
$deptId
]
=
$access
->
role
;
// View only access
if
(
!
$this
->
usePrimaryRoleOnAssignment
())
return
new
Role
(
array
());
// View only access
return
new
Role
(
array
());
// Fall through to primary role
}
}
// For the primary department, use the primary role
// For the primary department, use the primary role
return
$this
->
role
;
return
$this
->
role
;
...
@@ -563,15 +570,17 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
...
@@ -563,15 +570,17 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
if
(
!
isset
(
$this
->
_extra
)
&&
isset
(
$this
->
extra
))
if
(
!
isset
(
$this
->
_extra
)
&&
isset
(
$this
->
extra
))
$this
->
_extra
=
JsonDataParser
::
decode
(
$this
->
extra
);
$this
->
_extra
=
JsonDataParser
::
decode
(
$this
->
extra
);
return
$attr
?
(
@
$this
->
_extra
[
$attr
]
?:
$default
)
:
$this
->
_extra
;
return
$attr
?
(
isset
(
$this
->
_extra
[
$attr
])
?
$this
->
_extra
[
$attr
]
:
$default
)
:
$this
->
_extra
;
}
}
function
setExtraAttr
(
$attr
,
$value
,
$commit
=
true
)
{
function
setExtraAttr
(
$attr
,
$value
,
$commit
=
true
)
{
$this
->
getExtraAttr
();
$this
->
getExtraAttr
();
$this
->
_extra
[
$attr
]
=
$value
;
$this
->
_extra
[
$attr
]
=
$value
;
$this
->
extra
=
JsonDataEncoder
::
encode
(
$this
->
_extra
);
if
(
$commit
)
{
if
(
$commit
)
{
$this
->
extra
=
JsonDataEncoder
::
encode
(
$this
->
_extra
);
$this
->
save
();
$this
->
save
();
}
}
}
}
...
@@ -1011,6 +1020,8 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
...
@@ -1011,6 +1020,8 @@ implements AuthenticatedUser, EmailContact, TemplateVariable {
}
}
}
}
$this
->
updateAccess
(
$access
,
$errors
);
$this
->
updateAccess
(
$access
,
$errors
);
$this
->
setExtraAttr
(
'def_assn_role'
,
isset
(
$vars
[
'assign_use_pri_role'
]),
false
);
// Format team membership as [array(team_id, alerts?)]
// Format team membership as [array(team_id, alerts?)]
$teams
=
array
();
$teams
=
array
();
...
...
This diff is collapsed.
Click to expand it.
include/i18n/en_US/help/tips/staff.agent.yaml
+
11
−
1
View file @
b01842d2
...
@@ -73,12 +73,22 @@ assigned_group:
...
@@ -73,12 +73,22 @@ assigned_group:
primary_department
:
primary_department
:
title
:
Primary Department
title
:
Primary Department
content
:
>
content
:
>
Choose the primary <span class="doc-desc-title">department</span> to which this Agent belongs.
Choose the primary <span class="doc-desc-title">department</span> to
which this Agent belongs and an effective <span class="doc-desc-title">Role</span>.
links
:
links
:
-
title
:
Manage Departments
-
title
:
Manage Departments
href
:
/scp/departments.php
href
:
/scp/departments.php
primary_role_on_assign
:
title
:
Use Primary Role For Assignments
content
:
>
Enable this to fallback to the <span class="doc-desc-title">primary
role</span> when this agent is assigned tickets and tasks outside
of the <span class="doc-desc-title">primary department</span> and
<span class="doc-desc-title">extended access</span> departments.
Otherwise the agent will have view only access.
daylight_saving
:
daylight_saving
:
title
:
Daylight Saving
title
:
Daylight Saving
content
:
>
content
:
>
...
...
This diff is collapsed.
Click to expand it.
include/staff/staff.inc.php
+
16
−
3
View file @
b01842d2
...
@@ -213,7 +213,7 @@ if (count($bks) > 1) {
...
@@ -213,7 +213,7 @@ if (count($bks) > 1) {
<table
class=
"table two-column"
width=
"940"
border=
"0"
cellspacing=
"0"
cellpadding=
"2"
>
<table
class=
"table two-column"
width=
"940"
border=
"0"
cellspacing=
"0"
cellpadding=
"2"
>
<tbody>
<tbody>
<tr
class=
"header"
>
<tr
class=
"header"
>
<th
colspan=
"
2
"
>
<th
colspan=
"
3
"
>
<?php
echo
__
(
'Primary Department and Role'
);
?>
<?php
echo
__
(
'Primary Department and Role'
);
?>
<span
class=
"error"
>
*
</span>
<span
class=
"error"
>
*
</span>
<div><small>
<?php
echo
__
(
<div><small>
<?php
echo
__
(
...
@@ -249,6 +249,18 @@ if (count($bks) > 1) {
...
@@ -249,6 +249,18 @@ if (count($bks) > 1) {
<option
value=
"0"
data-quick-add
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
<option
value=
"0"
data-quick-add
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
</select>
</select>
<i
class=
"offset help-tip icon-question-sign"
href=
"#primary_role"
></i>
<i
class=
"offset help-tip icon-question-sign"
href=
"#primary_role"
></i>
</td>
<td>
<label
class=
"inline checkbox"
>
<input
type=
"checkbox"
name=
"assign_use_pri_role"
<?php
if
(
$staff
->
usePrimaryRoleOnAssignment
())
echo
'checked="checked"'
;
?>
/>
<?php
echo
__
(
'Fall back to primary role on assigned tickets'
);
?>
<i
class=
"icon-question-sign help-tip"
href=
"#primary_role_on_assign"
></i>
</label>
<div
class=
"error"
>
<?php
echo
$errors
[
'role_id'
];
?>
</div>
<div
class=
"error"
>
<?php
echo
$errors
[
'role_id'
];
?>
</div>
</td>
</td>
</tr>
</tr>
...
@@ -268,7 +280,8 @@ if (count($bks) > 1) {
...
@@ -268,7 +280,8 @@ if (count($bks) > 1) {
?>
?>
<option
value=
"0"
data-quick-add
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
<option
value=
"0"
data-quick-add
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
</select>
</select>
<span
style=
"display:inline-block;width:20px"
>
</span>
</td>
<td>
<label
class=
"inline checkbox"
>
<label
class=
"inline checkbox"
>
<input
type=
"checkbox"
data-name=
"dept_access_alerts"
value=
"1"
/>
<input
type=
"checkbox"
data-name=
"dept_access_alerts"
value=
"1"
/>
<?php
echo
__
(
'Alerts'
);
?>
<?php
echo
__
(
'Alerts'
);
?>
...
@@ -280,7 +293,7 @@ if (count($bks) > 1) {
...
@@ -280,7 +293,7 @@ if (count($bks) > 1) {
</tbody>
</tbody>
<tbody>
<tbody>
<tr
class=
"header"
>
<tr
class=
"header"
>
<th
colspan=
"
2
"
>
<th
colspan=
"
3
"
>
<?php
echo
__
(
'Extended Access'
);
?>
<?php
echo
__
(
'Extended Access'
);
?>
</th>
</th>
</tr>
</tr>
...
...
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