- Edited
the one downloaded.. still same ...
after some changes, got it working errr... after some changes still...
will go back home and reedit some and posted the said files as well :)
thanks
the one downloaded.. still same ...
after some changes, got it working errr... after some changes still...
will go back home and reedit some and posted the said files as well :)
thanks
Clients can not view ticket status after mod
I just realized my clients can not view ticket status after this mod. I have combed through the files and can't seem to figure out whats wrong. Please help!! They can log in but nothing shows up expect the the client information. None of the added notes show up or the information in the field that I added.
Thanks
Fatal Error: Contact system adminstrator.
There have been a lot of questions about how to add a new field to the ticket and rightly so, the more info a user can provide the better. For our purposes we wanted to add a Company field so we knew exactly who we were dealing with.We added the field successfully and this thread explains the process. As a favor, can someone help us with adding that new field to the "tickets.inc.php" page?!?! It would be greatly appreciated. We'd like to be able to see Company in that table as a column where you see the ticket id, date, department, priority etc.
To add a new field there are 6 places you have to go to accomplish your goal.
MySQL Database: manually add a field to ost_Ticket
support/include/class.ticket.php
support/include/client/open.inc.php
support/include/client/viewticket.inc.php
include/staff/viewticket.inc.php
include/staff/newticket.inc.php
2.) class.ticket.php
Add your variable here:
class Ticket{
var $id;
var $extid;
var $email;
var $status;
var $created;
var $updated;
var $priority;
and here: like so ($this->newvar=$row;)
if(($res=db_query($sql)) && db_num_rows($res)):
$row=db_fetch_array($res);
$this->id =$row;
$this->extid =$row;
$this->email =$row;
$this->fullname =$row;
and here:
//GET
function getId(){
return $this->id;
}
function getExtId(){
return $this->extid;
}
function getEmail(){
return $this->email;
}
function getNewvar(){
return $this->newvar;
}
and here:
function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
global $cfg,$thisclient,$_FILES;
$id=0;
$fields=array();
$fields = array('type'=>'string', 'required'=>1, 'error'=>'newvar required');
and finally:
$extId=Ticket:();
$sql= 'INSERT INTO '.TICKET_TABLE.' SET created=NOW() '.
',ticketID='.db_input($extId).
',dept_id='.db_input($deptId).
',priority_id='.db_input($priorityId).
',email='.db_input($var).
',name='.db_input(Format:($var)).
',newvar='.db_input(Format:($var)).
3.) open.inc.php Copy info from other the other fields, just make sure the new field php scripts are different.
4.) viewticket.inc.php Repeat Step 3
5.) staff/viewticket.inc.php Repeat Step 4
4.) staff/newticket.inc.php Repeat Step 5
Hi I recently installed osticket onto a linux box and have managed a couple of mods to display in the user panel. But after making the mySQL chances suggested I now just get the message Fatal Error: Contact system adminstrator. why i try to access osticket.
Any suggestions would be great because I'm totally new to linux php mysql and osticket :(
Problem resolved, someone changed the root mysql password.
do you have a site i can look at? if you send me a private message i'll give you the link to my site and you can tell me if that is what you're looking for.
Hi contentpig and others
Can you help me with this?
I've added fields like company and address to osticket successfully
Now I want to get the fields filled in when a user is logged in (like name and email)
thanks
You can see here: www.knxcontrol.NL/support(www.knxcontrol.NL/support)
fileds
you want the fields to be autocomplete? once the user logs in, the name and email address on the ticket creation page that info is auto-filled in. Is that what you're looking for?
yes, but in this case for the additional fields that have been added.
email and name is allready working.
Got it all working... thank you.
My line numbers might be a little off as I have other mods but...class.ticket.php Step 1: approx line 27
class.ticket.php Step 2: approx line 62
class.ticket.php Step 3: approx line 111
class.ticket.php Step 4: approx line 820
class.ticket.php Step 5: approx line 913
Say you were adding a confirm email address field, just copy:
$fields = array('type'=>'email', 'required'=>1, 'error'=>'Valid email required');
Paste, then change it to:
$fields = array('type'=>'confirm_email', 'required'=>1, 'error'=>'Email addresses must match');
I changed the elements so they would have different names.
***NOTE:
the 'type' refers to the type of data on the form. confirm_email is not a default type. Here is a list of the types supported for validation by default.
'integer':
'int':
'double':
'text':
'string':
'array':
'radio':
'date':
'time':
'phone':
'fax':
'email':
'url':
'password':
'username':
'zipcode'
Hope this helps you apply the mod.
Also I have not followed these steps yet, I plan on adding fields later today or tomorrow. I will follow up with success or failure.
Got the whole mod working. Added new fiield, new drop down and also enable editticket to edit the field.
Can share with ya all if want.
Thank you all for the support.
sorry all, i've just solved my problem.
just read thru the thread and saw that i've missed the client.inc.php bit.
works great now!
Add New Field - Company
To add a new field "company" to osTicket v1.6.0
Remember to: Backup, Backup, Backup & Backup.
Database & Files/Folders...before you Install any mods and/or hacks!
Let's Begin...
------------------------------------------------
1. Download the "osticket_fields.zip" file and unzip.
2. Upload the "include" folder to your hosting server. (8 files total)
3. Login to your phpMyAdmin database and click the tab "SQL".
Copy & Paste the statement below in the "Run SQL query" big box.
-------------------------------------------------------------------------
ALTER TABLE ost_ticket ADD COLUMN company varchar(50) DEFAULT NULL;
-------------------------------------------------------------------------
Note: If you want to make the Company field required:
Change ( 'required'=>0 to 'required'=>1 )
Located In the: "client.ticket.php" file, on/or around lines (1175).
That's It!
Enjoy ;)
Best Regards,
Michael B
Small correction
After adding the files to new install of osTicket v1.6.0 I realized that there is a function missing for the Ticket update - company name is ignored by the update function. It is an easy fix, just modify the class.ticket.php from the zip file included by bobath as follow:
Find this code (starts at line 1129):
$sql='UPDATE '.TICKET_TABLE.' SET updated=NOW() '.
',email='.db_input($var).
',name='.db_input(Format:($var)).
',subject='.db_input(Format:($var)).
... and replace with:
$sql='UPDATE '.TICKET_TABLE.' SET updated=NOW() '.
',email='.db_input($var).
',name='.db_input(Format:($var)).
',company='.db_input(Format:($var)).
',subject='.db_input(Format:($var)).
Upload the changed file to your server. All done, the Ticket update function will work as expected.
Cheers,
Greg
so, how do i make the editticket.inc.php work?
ive added the fields, they all give the info i need, but when i update i get an error...
thanks,
Got the whole mod working. Added new fiield, new drop down and also enable editticket to edit the field.Can share with ya all if want.
Thank you all for the support.
please share
Musa,How well do you know HTML?
All you would need to do is follow the same instructions but instead of creating an input field just create a select drop down field. Everything should be able the same. Give it a shot and let me know how it goes. If you want to see what all I changed just open the files that I attached here and do a search for company. You'll see the HTML and PHP changes I made. Then you would need to create a column that matches the drop down list name and add it to the mysql queries inside the php files.
I've got everything working now. I want to add a drop down. By looking at the help topic drop down menu I kinda get the idea how to make it. However I dont know what to do inside of the mysql database to link to specific 'companies' in this case. "Then you would need to create a column that matches the drop down list name and add it to the mysql queries inside the php files"
<error> on my "updated" ticket field
The issue ocurred right after a join a new field to my Ticket table (the Project field). I run all the instructions and it works fine. I can create and edit new tickets, including my very new Project field.
Looking at my DB i found out that, when creating a new ticket as a client user, the "updated" field on my Ticket table, is storing the "" string. If i edit/close/reply the ticket, it updates the record perfectly.
It does not occur when i create the ticket as a staff member.
so... what do you people think??
Is there anyone with this kind of problem ??
Do no to instantly refresh
Hi there,
I got a new issue.
When i edit my ticket's new field (custom field i mean), it updates to the database ok. But right after i perform the update operation clicking on the "Update Ticket" button, it sends me back to the "ViewTicket.php" page. But it does not show the new value of the field recently updated. I must hit on the "refresh" icon, in order to force the right visualization of the value field.
Looking into the code i suspect, i must edit the tickets.inc.php file, but i haven't found, where to do the changes.
Can somebody give some light please??
Thanks in advance...
P.S: Does somebody else look at this forum besides me??
take a look at the image attached, you just want a simple dropdown correct?
I need to add a dropdown field called sector, can someone help me? Exactly this way.
adding a new field
Hey all,I have successfully created the company field per the original poster's instructions and was able to get it to add the company field to the staff ticket list. All you have to do is add the column named company to your ost_ticket table.
I currently have a base os ticket install so if you to have a base install the attached files will add this field for you. The zip file has 6 files in it. When you unzip it it should create two directories one is clients the other is staff. One file should be outside these two directories.
This should make it a lot easier for anyone else trying to do this. If you want to see what i did just open the files and do a search for company and you will find my changes. The files go in the following locations:
Loose File
class.ticket.php /include
Client Folder in Zip
open.inc.php /include/client
viewticket.inc.php /include/client
Staff Folder in Zip
newticket.inc.php /include/staff
tickets.inc.php /incllude/staff
viewticket.inc.php /include/staff
I hope this helps everyone out there.
J
the instructions and information from this user helped me create several new fields for our support site. thanks jkisner
I need to add a dropdown field called sector, can someone help me? Exactly this way.
Sure!
1. Create a new table in your database called sector. From PHPMyAdmin you'll run this query.
ALTER TABLE ost_ticket ADD COLUMN sector VARCHAR(50);
2. Next, in client/open.inc.php, you'll need to create an array with all of your options in it. Give it a name that is easy to remember.
$planit_arr = array('not on contract'=>"not on contract",'Planit 500'=>"Planit 500",'Planit 1000'=>"Planit 1000",'Planit 2000'=>"Planit 2000");
3. Lets whoop that messy array into the shape of a nice, neat select dropdown. This function is re-usable for any select!
function showOptionsDrop($array){
$string = '';
foreach($array as $k => $v){
$string .= '<option value="'.$k.'"'.$s.'>'.$v.'</option>'."\n";
}
return $string;
}
4. Now create a select just like you would in HTML, but use the ShowOptionsDrop function in place of the list of options.
Select One
<?php echo showOptionsDrop($planit_arr); ?>
Done and done.
Thanks for the mod on page 1, works just as it should.