Hello all,
Let me say, what great tutorials you guys have here. Very well done. I feel I was able to really understand the methods of the software almost immediately.
Unfortunately, I'm still having some trouble. I know the root of my problem stems in class.ticket.php while I'm also having some issues in the open.php as well.
Using OSticket 1.6rc4
When I upload the original class.ticket.php from the original code. I'm able to view the website. When I use my modified class.ticket.php, I recieve an error 500 (server error).
Here is a snapshot of my ost_ticket table structure
Field Type Null Default
ticket_id int(11) No
ticketID int(11) No 0
dept_id int(10) No 1
priority_id int(10) No 2
staff_id int(10) No 0
email varchar(120) No
address varchar(120) No
address2 varchar(120) Yes NULL
zip varchar(10) No
city varchar(120) No
name varchar(32) No
subject varchar(64) No
phone varchar(16) Yes NULL
ip_address varchar(16) No
status enum('open', 'closed') No open
source enum('Web', 'Email', 'Phone') Yes NULL
isoverdue tinyint(1) No 0
reopened datetime Yes NULL
closed datetime Yes NULL
created datetime No 0000-00-00 00
updated datetime No 0000-00-00 00
I've added fields
address
address2
zip
city
Ok, for class.ticket.php
added variables...
class Ticket{
var $id;
var $extid;
var $email;
var $address;
var $address2;
var $zip;
var $city;
var $status;
var $created;
var $updated;
var $priority;
var $priority_id;
var $fullname;
var $staff_id;
var $dept_id;
var $dept_name;
var $subject;
var $overdue;
var $lastMsgId;
var $dept; //Dept class
var $staff; //Staff class
var $tlock; //TicketLock class
function Ticket($id,$exid=false){
$this->load($id);
}
added to db query
if(($res=db_query($sql)) && db_num_rows($res)):
$row=db_fetch_array($res);
$this->id =$row;
$this->extid =$row;
$this->email =$row;
$this->address =$row;
$this->address2 =$row;
$this->zip =$row;
$this->city =$row;
$this->fullname =$row;
$this->status =$row;
$this->created =$row;
$this->updated =$row;
$this->lock_id =$row;
$this->priority_id=$row;
$this->priority=$row;
$this->staff_id =$row;
$this->dept_id =$row;
$this->dept_name =$row;
$this->subject =$row;
$this->overdue =$row;
$this->row=$row;
//Reset the sub classes (initiated ondemand)...good for reloads.
$this->staff=array();
$this->dept=array();
endif;
added my functions
function getAddress() {
return $this->address;
}
function getAddress2() {
return $this->address2;
}
function getZip() {
return $this->zip;
}
function getCity() {
return $this->city;
}
input command
function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
global $cfg,$thisclient,$_FILES;
$id=0;
$fields=array();
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Name required');
$fields = array('type'=>'email', 'required'=>1, 'error'=>'Valid email required');
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Valid address required');
$fields = array('type'=>'string' 'required'=>0, 'error'=>'Optional');
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Valid Zip required');
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Valid city required');
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
$fields = array('type'=>'text', 'required'=>1, 'error'=>'Message required');
Whatever this is...
',email='.db_input($var).
',address='.db_input(Format:($var)).
',address2='.db_input(Format:($var)).
',zip='.db_input(Format:($var)).
',city='.db_input(Format:($var)).
',name='.db_input(Format:($var)).
Now, i've tried the above code without striptags as well.
Using the original client.ticket.php I am able to access my website and view my form on open.inc.php.
I think if I can resolve the issues with class.ticket.php it will resolve all my further issues.