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
e454500f
Commit
e454500f
authored
13 years ago
by
Peter Rotich
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/basic-search-revisisted' into develop
parents
c11868ce
2d261af2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/ajax.tickets.php
+28
-22
28 additions, 22 deletions
include/ajax.tickets.php
include/staff/header.inc.php
+6
-1
6 additions, 1 deletion
include/staff/header.inc.php
scp/js/scp.js
+0
-1
0 additions, 1 deletion
scp/js/scp.js
scp/tickets.php
+9
-3
9 additions, 3 deletions
scp/tickets.php
with
43 additions
and
27 deletions
include/ajax.tickets.php
+
28
−
22
View file @
e454500f
...
@@ -22,37 +22,43 @@ class TicketsAjaxAPI extends AjaxController {
...
@@ -22,37 +22,43 @@ class TicketsAjaxAPI extends AjaxController {
function
search
()
{
function
search
()
{
if
(
!
is_numeric
(
$_REQUEST
[
'q'
]))
return
self
::
searchByEmail
();
$limit
=
isset
(
$_REQUEST
[
'limit'
])
?
(
int
)
$_REQUEST
[
'limit'
]
:
25
;
$limit
=
isset
(
$_REQUEST
[
'limit'
])
?
(
int
)
$_REQUEST
[
'limit'
]
:
25
;
$
item
s
=
array
();
$
ticket
s
=
array
();
$sql
=
'SELECT DISTINCT ticketID, email'
$sql
=
'SELECT DISTINCT ticketID, email'
.
' FROM '
.
TICKET_TABLE
;
.
' FROM '
.
TICKET_TABLE
.
' WHERE ticketID LIKE \''
.
db_input
(
$_REQUEST
[
'q'
],
false
)
.
'%\''
$emailSearch
=
false
;
.
' ORDER BY created LIMIT '
.
$limit
;
if
(
is_numeric
(
$_REQUEST
[
'q'
]))
$sql
.
=
' WHERE ticketID LIKE \''
.
db_input
(
$_REQUEST
[
'q'
],
false
)
.
'%\''
;
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
{
else
{
while
(
list
(
$id
,
$email
)
=
db_fetch_row
(
$res
))
$emailSearch
=
true
;
$tickets
[]
=
array
(
'id'
=>
$id
,
'email'
=>
$email
,
'value'
=>
$id
,
'info'
=>
"
$id
-
$email
"
);
$sql
.
=
' WHERE email LIKE \'%'
.
db_input
(
strtolower
(
$_REQUEST
[
'q'
]),
false
)
.
'%\' '
;
}
}
$sql
.
=
' ORDER BY created LIMIT '
.
$limit
;
return
$this
->
json_encode
(
$tickets
);
}
function
searchByEmail
()
{
$limit
=
isset
(
$_REQUEST
[
'limit'
])
?
(
int
)
$_REQUEST
[
'limit'
]
:
25
;
$tickets
=
array
();
$sql
=
'SELECT email, count(ticket_id) as tickets '
.
' FROM '
.
TICKET_TABLE
.
' WHERE email LIKE \'%'
.
db_input
(
strtolower
(
$_REQUEST
[
'q'
]),
false
)
.
'%\' '
.
' GROUP BY email '
.
' ORDER BY created LIMIT '
.
$limit
;
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
{
if
((
$res
=
db_query
(
$sql
))
&&
db_num_rows
(
$res
))
{
while
(
list
(
$id
,
$email
,
$name
)
=
db_fetch_row
(
$res
))
{
while
(
list
(
$email
,
$count
)
=
db_fetch_row
(
$res
))
if
(
$emailSearch
)
{
$tickets
[]
=
array
(
'email'
=>
$email
,
'value'
=>
$email
,
'info'
=>
"
$email
(
$count
)"
);
$info
=
"
$email
-
$id
"
;
$value
=
$email
;
}
else
{
$info
=
"
$id
-
$email
"
;
$value
=
$id
;
}
$items
[]
=
array
(
'id'
=>
$id
,
'email'
=>
$email
,
'value'
=>
$value
,
'info'
=>
$info
);
}
}
}
return
$this
->
json_encode
(
$
item
s
);
return
$this
->
json_encode
(
$
ticket
s
);
}
}
function
acquireLock
(
$tid
)
{
function
acquireLock
(
$tid
)
{
...
...
This diff is collapsed.
Click to expand it.
include/staff/header.inc.php
+
6
−
1
View file @
e454500f
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<html>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"content-type"
content=
"text/html; charset=UTF-8"
>
<?php
if
(
defined
(
'AUTO_REFRESH'
)
&&
is_numeric
(
AUTO_REFRESH_RATE
)
&&
AUTO_REFRESH_RATE
>
0
){
//Refresh rate
echo
'<meta http-equiv="refresh" content="'
.
AUTO_REFRESH_RATE
.
'" />'
;
}
?>
<title>
osTicket Staff Control Panel
</title>
<title>
osTicket Staff Control Panel
</title>
<!--[if IE]>
<!--[if IE]>
<style type="text/css">
<style type="text/css">
...
...
This diff is collapsed.
Click to expand it.
scp/js/scp.js
+
0
−
1
View file @
e454500f
...
@@ -210,7 +210,6 @@ $(document).ready(function(){
...
@@ -210,7 +210,6 @@ $(document).ready(function(){
});
});
},
},
onselect
:
function
(
obj
)
{
onselect
:
function
(
obj
)
{
$
(
'
#basic-ticket-search
'
).
val
(
obj
.
id
);
/*overwriting email*/
$
(
'
#basic-ticket-search
'
).
closest
(
'
form
'
).
submit
();
$
(
'
#basic-ticket-search
'
).
closest
(
'
form
'
).
submit
();
},
},
property
:
"
value
"
property
:
"
value
"
...
...
This diff is collapsed.
Click to expand it.
scp/tickets.php
+
9
−
3
View file @
e454500f
...
@@ -456,7 +456,7 @@ if($ticket) {
...
@@ -456,7 +456,7 @@ if($ticket) {
$inc
=
'ticket-view.inc.php'
;
$inc
=
'ticket-view.inc.php'
;
if
(
$_REQUEST
[
'a'
]
==
'edit'
&&
$thisstaff
->
canEditTickets
())
if
(
$_REQUEST
[
'a'
]
==
'edit'
&&
$thisstaff
->
canEditTickets
())
$inc
=
'ticket-edit.inc.php'
;
$inc
=
'ticket-edit.inc.php'
;
}
else
{
}
else
{
$inc
=
'tickets.inc.php'
;
$inc
=
'tickets.inc.php'
;
if
(
$_REQUEST
[
'a'
]
==
'open'
&&
$thisstaff
->
canCreateTickets
())
if
(
$_REQUEST
[
'a'
]
==
'open'
&&
$thisstaff
->
canCreateTickets
())
$inc
=
'ticket-open.inc.php'
;
$inc
=
'ticket-open.inc.php'
;
...
@@ -470,8 +470,14 @@ if($ticket) {
...
@@ -470,8 +470,14 @@ if($ticket) {
elseif
(
!
Export
::
saveTickets
(
$query
,
"tickets-
$ts
.csv"
,
'csv'
))
elseif
(
!
Export
::
saveTickets
(
$query
,
"tickets-
$ts
.csv"
,
'csv'
))
$errors
[
'err'
]
=
'Internal error: Unable to dump query results'
;
$errors
[
'err'
]
=
'Internal error: Unable to dump query results'
;
}
}
elseif
(
!
$_POST
&&
$_REQUEST
[
'a'
]
!=
'search'
&&
(
$min
=
$thisstaff
->
getRefreshRate
()))
define
(
'AUTO_REFRESH'
,
1
);
//set refresh rate if the user has it configured
//Clear active submenu on search with no status
if
(
$_REQUEST
[
'a'
]
==
'search'
&&
!
$_REQUEST
[
'status'
])
$nav
->
setActiveSubMenu
(
-
1
);
//set refresh rate if the user has it configured
if
(
!
$_POST
&&
$_REQUEST
[
'a'
]
!=
'search'
&&
(
$min
=
$thisstaff
->
getRefreshRate
()))
define
(
'AUTO_REFRESH'
,
$min
*
60
);
}
}
require_once
(
STAFFINC_DIR
.
'header.inc.php'
);
require_once
(
STAFFINC_DIR
.
'header.inc.php'
);
...
...
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