OsTicket WINstall
OsTicket WINstall
I spent more time than I care to admit trying to setup and configure the latest version of osTicket during
the last week or so, having zero background experience with Apache, Mysql or PHP just made it all the
more challenging. So I thought I would create the following documentation to help Simplify the install
process for new users. I will be updating the Mods section as time allows to Detail my current MOD
setup. Please Let me know if you have any questions along the way!
Before we can begin installing osTicket, First we have to satisfy the following Pre-requisites:
Ive found the simplest way to accomplish this, Is by using Xampp. Essentially Xampp is our All-in-One
solution for satisfying all of the above Pre-requisites for osTicket.
* You may encounter installation issues if you are installing Xampp to a machine that has had or
currently has PHP or MySQL installed. I highly recommend un-installing any versions of MYSQL or PHP
before Starting your install.
* PHP in this package needs the Microsoft Visual C++ 2008 Redistributable package from
http://www.microsoft.com/en-us/download/details.aspx?id=5582.
Open up Command Prompt and Type netstat -aon . Take Note of the PID #.
Now Open Task Manager > Processes. Sort by PID #. ( If you dont see PID, You need to select it @ View
> Columns )
If you are able to safely disable it, You can do so by Going to Run and typing Services.msc. If Port 80 is
being used by a legitimate source, You can change the Port that Apache uses. ( Although I recommend
using Port 80 if possible! )
Once Open Find the Following Section of Code and Change the default Port #80
#Listen 0.0.0.0:80
#Listen [::] :80
Listen 82
Installing osTicket
4.) Now we have to Configure the Username & PW for MySQL ( default = root, no password ).
Browse to http://yourdomain.com/security/. You should See the Below Page.
Select your Language > Then Browse to http://localhost/security/xamppsecurity.php
Change the Password for MySQL & Set PHPMyadmin Authentication to http
Now Go Back to your Xampp Control Panel and Restart the MySQL service.
5.) Now Browse to http://yourdomain.com/osTicket. You should See the Below Page.
Follow the instructions on Screen to Finish the Install.
6.) While optional, I recommend running your Apache & MYSQL as Services. This will allow you to access
your ticketing system when logged off of the Host machine as well as give you the on failure options
for Services. (R-Click My Computer > Mange > Services R-Click Service > Properties > Recovery Tab )
Configuring osTicket
To Change the Default osTicket Images Replace The following .png files
Disable TAB Select on J-query Searches ( So Tab does what you would expect it to do!! )
*In scp\js\bsn.AutoSuggest_2.1.3.js
*Comment Out Line 98 = //var TAB = 9;
* This is purely a quality of Life change But It Means the difference between your users having to
remember & Type the following
*First You must setup a Forward Lookup Zone on your DNS Server.
*Modify your hosts.ini File to represent your server name. Your server name must match your DNS
entry from the previous step! ( C:\windows\system32\drivers\etc )
*Then you will need to Modify your httpd-vhosts.conf File by adding the following section of Code.
Located @ C:\xampp\apache\conf\extra\
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot C:\xampp\htdocs\osTICKET
ServerName Helpdesk
<Directory C:\xampp\htdocs\osTICKET>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
*Finally, You will need to Restart your Apache Service in the XAMP Control Panel for these changes to
take affect.
Extension=php_imap.dll
Additional Notes:
*You may need to enable the Microsoft Exchange Imap4 Service on your Exchange CasArray /
Exchange Servers for this service to work.
[/expand]
This modification no longer functions properly in the latest version of OS-ticket, the code below is for
reference only!!! Please see the forum link below!
PgSQL
ALTER TABLE `ost_config` ADD
PHP
function getHtmlEmailTemplate()
return $this->config['html_e
}
2 return $this->config['html_email_template'];
3 }
PHP
.',html_email_template='.db_inpu
include/class.email.php
Add after //do some cleanup
PHP
$htmlbody = str_replace('%mes
1 $htmlbody = str_replace('%message', str_replace("\n", '<br />', $body), $cfg-
>getHtmlEmailTemplate());
PHP
if (strpos($cfg->getHtmlEmailTe
$mime->setHTMLBody($h
include/staff/settings-emails.inc.php
PHP
<tr>
<th>HTML Email Template:</th><
<td><textarea row s="15" nam
</tr>
1 <tr>
</tr>
Open class.ticket.php and comment out the following lines of code: ( x5 total )
PHP
//if($cfg->stripQuotedReply() &&
// $msg['body'] ="\n$tag\n\n".$
2 // $msg['body'] ="\n$tag\n\n".$msg['body'];
This will Make sure that the Reply Separator does not get included twice on Replies.
*This is a EveryDay-Tech Original :). You can download the Modded Files HERE.
This MOD leverages the Canned responses system to automatically populate the subject & issue field
along with the already auto-Filled Response field on newly created staff tickets. This MOD adds a
subject & issue text field to the Canned response Area so you can quickly Populate these fields for
common issues!! ( autofill password resets anyone? )
Ive added the Changes below if you would like to modify the files yourself, otherwise you can find the
Altered Files in the Zip file Above. You can do a search for //RJS in the Modded Files to find out
exactly what was changed.
MyPHPAdmin
PgSQL
include/class.canned.php
Below ,response=.db_input($vars['response']).
PHP
',subject='.db_input($vars['subje
',issue='.db_input($vars['issue']
1 ',subject='.db_input($vars['subject']). //RJS
2 ',issue='.db_input($vars['issue']). //RJS
and add
PHP
function getSubject() {
return $this->ht['subject'];
} //RJS
1 function getSubject() {
2 return $this->ht['subject'];
3 } //RJS
5 function getIssue() {
6 return $this->ht['issue'];
7 } //RJS
PHP
<br><br><div><b>Subject</b><
<input type="text" size="70" nam
<br><br><div><b>Issue:</b> <f
PHP
//Canned response.
if(canned.response) {
if($('#append',fObj).is(':checked
1 //Canned response.
2 if(canned.response) {
5 $('#response',fObj).val($('#response',fObj).val()+"\n\n"+canned.response+"\n");
7 else
8 $('#response',fObj).val(canned.response);
9 $('#subject',fObj).val(canned.subject); // RJS
10 $('#issue',fObj).val(canned.issue); //RJS
PHP
id="issue"
id="subject"
1 id="issue"
2 id="subject"
*This is a EveryDay-Tech Original :). You can also download the Modded Files HERE.
This Mod Uses the Auto-fill Feature that is already present in the base install that populates Email &
User name. Our aim here is to Automatically pull in the users phone number and any additional user
related fields that you may have added to your install. You may notice that my install has an additional
field called pcname, if you are interested in adding any additional fields please see the MOD below by
Ntozier.
include/ajax.users.php
PHP
$limit = isset($_REQUEST['l
$users=array();
$sql='SELECT DISTINCT em
2 $users=array();
11 while(list($email,$name,$pcname,$phone)=db_fetch_row($res)) {
PHP
2 $('#email.typeahead').typeahead({
4 if(query.length > 2) {
5 $.ajax({
6 url: "ajax.php/users?q="+query,
7 dataType: 'json',
9 typeahead.process(data);
10 }
11 });
12 }
13 },
15 var fObj=$('#email.typeahead').closest('form');
16 if(obj.name)
17 $('#name', fObj).val(obj.name);
18 if(obj.pcname)
19 $('#pcname', fObj).val(obj.pcname);
20 if(obj.phone)
21 $('#phone', fObj).val(obj.phone);
22 },
Reporting MOD:
\include\staff\ticket-open.inc.php
PHP
1 /* This sets the default as the staff member that created the ticket.*/
2 <?
3 $default=$thisstaff->getId();
4 $defaultname=$thisstaff->getName();
5 ?>
6 <option value="<?=$default?>"
selected="selected"><?=$defaultname?></option>
This Mod essentially replicates the Search functionality that is already present in 1.7st for the e-mail
field for the Full name field. I have some pretty picky co-workers and they wanted to be able to search
by first and last name! ( our email format is [email protected], so the email field search wasnt
cutting it )
In any case Ive documented my changes below for those of you who want to MOD your files manually.
Ive commented all my changes with my initials RJS to make searching for Modded section of code
just a bit easier.
include\staff\ticket-open.inc.php
Search for Full Name: and Make the following changes.
PHP
scp\js\scp.js
Add the Following function
PHP
2 $('#name.typeahead').typeahead({
4 if(query.length > 1) {
5 $.ajax({
6 url: "ajax.php/names?q="+query,
7 dataType: 'json',
10 }
11 });
12 }
13 },
15 var fObj=$('#name.typeahead').closest('form');
16 if(obj.email)
17 $('#email', fObj).val(obj.email);
18 if(obj.pcname)
19 $('#pcname', fObj).val(obj.pcname);
20 if(obj.phone)
21 $('#phone', fObj).val(obj.phone);
22 },
23 property: "name"
24 });
scp\ajax.php
After Line 55 Add.
PHP
url_get('^/names$', array('ajax.n
PHP
<?php
/*************************************
ajax.names.php
1 <?php
2 /********************************************************************
*
3
ajax.names.php
4
5
AJAX interface for user names(based on submitted tickets)
6
XXX: osTicket doesn't support user accounts at the moment.
7
8
Peter Rotich <[email protected]>
9
Copyright (c) 2006-2013 osTicket
1
0 http://www.osticket.com
1
1
Released under the GNU General Public License WITHOUT ANY WARRANTY.
1
See LICENSE.TXT for details.
2
1
3 vim: expandtab sw=4 ts=4 sts=4:
1
4
Updated for Full Name Search by: Rionoskae
1
5 *********************************************************************
*/
1
6
1 if(!defined('INCLUDE_DIR')) die('403');
7
1 include_once(INCLUDE_DIR.'class.ticket.php');
8
1
9 class UsersAjaxAPI extends AjaxController {
2
0 /* Search by Full Name - RJS */
2 function search() {
1
2
if(!isset($_REQUEST['q'])) {
2
Http::response(400, 'Query argument is required');
2
3 }
2
4
$limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit']:20;
2
5 $users=array();
2
6 $sql='SELECT DISTINCT name, pcname, phone, email'
2 .' FROM '.TICKET_TABLE
7
.' WHERE name LIKE \'%'.db_input(strtolower($_REQUEST['q']), false).'%\' '
2
8 .' ORDER BY created DESC'
3 }
3
3
return $this->json_encode($names);
4
3
5 }
3 }
6
3
?>
7
3
8
3
9
4
0
4
1
4
2
4
3
4
4
4
5
4
6
4
7
4
8
4
9
5
0
5
1
5
2
5
3
Forum Link: http://osticket.com/forum/discussion/9807/mod-autocomplete-by-searching-full-name-
field-on-new-tickets#latest