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
7828c08a
Commit
7828c08a
authored
13 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Change cancel link & input size
parent
92951ad4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.sla.php
+61
-39
61 additions, 39 deletions
include/class.sla.php
include/staff/ticket-open.inc.php
+6
-4
6 additions, 4 deletions
include/staff/ticket-open.inc.php
with
67 additions
and
43 deletions
include/class.sla.php
+
61
−
39
View file @
7828c08a
...
@@ -19,91 +19,113 @@ class SLA {
...
@@ -19,91 +19,113 @@ class SLA {
var
$info
;
var
$info
;
function
SLA
(
$id
){
function
SLA
(
$id
)
{
$this
->
id
=
0
;
$this
->
id
=
0
;
$this
->
load
(
$id
);
$this
->
load
(
$id
);
}
}
function
load
(
$id
)
{
function
load
(
$id
=
0
)
{
if
(
!
$id
&&
!
(
$id
=
$this
->
getId
()))
return
false
;
$sql
=
'SELECT * FROM '
.
SLA_TABLE
.
' WHERE id='
.
db_input
(
$id
);
$sql
=
'SELECT * FROM '
.
SLA_TABLE
.
' WHERE id='
.
db_input
(
$id
);
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
{
if
(
!
(
$res
=
db_query
(
$sql
))
||
!
db_num_rows
(
$res
))
$info
=
db_fetch_array
(
$res
);
return
false
;
$this
->
id
=
$info
[
'id'
];
$this
->
info
=
$info
;
$this
->
ht
=
db_fetch_array
(
$res
);
return
true
;
$this
->
id
=
$this
->
ht
[
'id'
];
}
return
true
;
return
false
;
}
}
function
reload
()
{
function
reload
()
{
return
$this
->
load
(
$this
->
getId
()
);
return
$this
->
load
();
}
}
function
getId
(){
function
getId
()
{
return
$this
->
id
;
return
$this
->
id
;
}
}
function
getName
(){
function
getName
()
{
return
$this
->
info
[
'name'
];
return
$this
->
ht
[
'name'
];
}
}
function
getGracePeriod
(){
function
getGracePeriod
()
{
return
$this
->
info
[
'grace_period'
];
return
$this
->
ht
[
'grace_period'
];
}
}
function
getNotes
(){
function
getNotes
()
{
return
$this
->
info
[
'notes'
];
return
$this
->
ht
[
'notes'
];
}
}
function
get
Info
(){
function
get
Hashtable
()
{
return
$this
->
info
;
return
$this
->
ht
;
}
}
function
isActive
(){
function
getInfo
()
{
return
(
$this
->
info
[
'isactive'
]
);
return
$this
->
getHashtable
(
);
}
}
function
sendAlerts
(){
function
isActive
()
{
return
(
!
$this
->
info
[
'
d
isa
ble_overdue_alerts
'
]);
return
(
$this
->
ht
[
'isa
ctive
'
]);
}
}
function
priorityEscalation
(){
function
sendAlerts
()
{
return
(
$this
->
info
[
'enable_priority_escalation
'
]);
return
(
!
$this
->
ht
[
'disable_overdue_alerts
'
]);
}
}
function
update
(
$vars
,
&
$errors
)
{
function
priorityEscalation
()
{
if
(
SLA
::
save
(
$this
->
getId
(),
$vars
,
$errors
)){
return
(
$this
->
ht
[
'enable_priority_escalation'
]);
$this
->
reload
();
}
return
true
;
}
function
update
(
$vars
,
&
$errors
)
{
return
false
;
if
(
!
SLA
::
save
(
$this
->
getId
(),
$vars
,
$errors
))
return
false
;
$this
->
reload
();
return
true
;
}
}
function
delete
(){
function
delete
()
{
global
$cfg
;
global
$cfg
;
if
(
$cfg
&&
$cfg
->
getDefaultSLAId
()
==
$this
->
getId
())
if
(
!
$cfg
||
$cfg
->
getDefaultSLAId
()
==
$this
->
getId
())
return
false
;
return
false
;
$id
=
$this
->
getId
();
$id
=
$this
->
getId
();
$sql
=
'DELETE FROM '
.
SLA_TABLE
.
' WHERE id='
.
db_input
(
$id
)
.
' LIMIT 1'
;
$sql
=
'DELETE FROM '
.
SLA_TABLE
.
' WHERE id='
.
db_input
(
$id
)
.
' LIMIT 1'
;
if
(
db_query
(
$sql
)
&&
(
$num
=
db_affected_rows
())){
if
(
db_query
(
$sql
)
&&
(
$num
=
db_affected_rows
()))
{
db_query
(
'UPDATE '
.
DEPT_TABLE
.
' SET sla_id=0 WHERE sla_id='
.
db_input
(
$id
));
db_query
(
'UPDATE '
.
DEPT_TABLE
.
' SET sla_id=0 WHERE sla_id='
.
db_input
(
$id
));
db_query
(
'UPDATE '
.
TOPIC_TABLE
.
' SET sla_id=0 WHERE sla_id='
.
db_input
(
$id
));
db_query
(
'UPDATE '
.
TOPIC_TABLE
.
' SET sla_id=0 WHERE sla_id='
.
db_input
(
$id
));
db_query
(
'UPDATE '
.
TICKET_TABLE
.
' SET sla_id=
0
WHERE sla_id='
.
db_input
(
$id
));
db_query
(
'UPDATE '
.
TICKET_TABLE
.
' SET sla_id=
'
.
db_input
(
$cfg
->
getDefaultSLAId
())
.
'
WHERE sla_id='
.
db_input
(
$id
));
}
}
return
$num
;
return
$num
;
}
}
/** static functions **/
/** static functions **/
function
create
(
$vars
,
&
$errors
){
function
create
(
$vars
,
&
$errors
)
{
return
SLA
::
save
(
0
,
$vars
,
$errors
);
return
SLA
::
save
(
0
,
$vars
,
$errors
);
}
}
function
getIdByName
(
$name
){
function
getSLAs
()
{
$slas
=
array
();
$sql
=
'SELECT id, name FROM '
.
SLA_TABLE
;
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
{
while
(
list
(
$id
,
$name
)
=
db_fetch_row
(
$res
))
$slas
[
$id
]
=
$name
;
}
return
$slas
;
}
function
getIdByName
(
$name
)
{
$sql
=
'SELECT id FROM '
.
SLA_TABLE
.
' WHERE name='
.
db_input
(
$name
);
$sql
=
'SELECT id FROM '
.
SLA_TABLE
.
' WHERE name='
.
db_input
(
$name
);
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
...
@@ -112,11 +134,11 @@ class SLA {
...
@@ -112,11 +134,11 @@ class SLA {
return
$id
;
return
$id
;
}
}
function
lookup
(
$id
){
function
lookup
(
$id
)
{
return
(
$id
&&
is_numeric
(
$id
)
&&
(
$sla
=
new
SLA
(
$id
))
&&
$sla
->
getId
()
==
$id
)
?
$sla
:
null
;
return
(
$id
&&
is_numeric
(
$id
)
&&
(
$sla
=
new
SLA
(
$id
))
&&
$sla
->
getId
()
==
$id
)
?
$sla
:
null
;
}
}
function
save
(
$id
,
$vars
,
&
$errors
){
function
save
(
$id
,
$vars
,
&
$errors
)
{
if
(
!
$vars
[
'grace_period'
])
if
(
!
$vars
[
'grace_period'
])
...
...
This diff is collapsed.
Click to expand it.
include/staff/ticket-open.inc.php
+
6
−
4
View file @
7828c08a
...
@@ -22,7 +22,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
...
@@ -22,7 +22,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Email Address:
Email Address:
</td>
</td>
<td>
<td>
<input
type=
"text"
size=
"45"
name=
"email"
value=
"
<?php
echo
$info
[
'email'
];
?>
"
>
<input
type=
"text"
size=
"45"
name=
"email"
id=
"email"
class=
"typeahead"
value=
"
<?php
echo
$info
[
'email'
];
?>
"
autocomplete=
"off"
autocorrect=
"off"
autocapitalize=
"off"
>
<span
class=
"error"
>
*
<?php
echo
$errors
[
'email'
];
?>
</span>
<span
class=
"error"
>
*
<?php
echo
$errors
[
'email'
];
?>
</span>
<?php
<?php
if
(
$cfg
->
notifyONNewStaffTicket
())
{
?>
if
(
$cfg
->
notifyONNewStaffTicket
())
{
?>
...
@@ -37,7 +39,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
...
@@ -37,7 +39,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Full Name:
Full Name:
</td>
</td>
<td>
<td>
<input
type=
"text"
size=
"45"
name=
"name"
value=
"
<?php
echo
$info
[
'name'
];
?>
"
>
<input
type=
"text"
size=
"45"
name=
"name"
id=
"name"
value=
"
<?php
echo
$info
[
'name'
];
?>
"
>
<span
class=
"error"
>
*
<?php
echo
$errors
[
'name'
];
?>
</span>
<span
class=
"error"
>
*
<?php
echo
$errors
[
'name'
];
?>
</span>
</td>
</td>
</tr>
</tr>
...
@@ -46,9 +48,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
...
@@ -46,9 +48,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
Phone Number:
Phone Number:
</td>
</td>
<td>
<td>
<input
type=
"text"
size=
"18"
name=
"phone"
value=
"
<?php
echo
$info
[
'phone'
];
?>
"
>
<input
type=
"text"
size=
"18"
name=
"phone"
id=
"phone"
value=
"
<?php
echo
$info
[
'phone'
];
?>
"
>
<span
class=
"error"
>
<?php
echo
$errors
[
'phone'
];
?>
</span>
<span
class=
"error"
>
<?php
echo
$errors
[
'phone'
];
?>
</span>
Ext
<input
type=
"text"
size=
"5"
name=
"phone_ext"
value=
"
<?php
echo
$info
[
'phone_ext'
];
?>
"
>
Ext
<input
type=
"text"
size=
"5"
name=
"phone_ext"
id=
"phone_ext"
value=
"
<?php
echo
$info
[
'phone_ext'
];
?>
"
>
<span
class=
"error"
>
<?php
echo
$errors
[
'phone_ext'
];
?>
</span>
<span
class=
"error"
>
<?php
echo
$errors
[
'phone_ext'
];
?>
</span>
</td>
</td>
</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