Hi cyid
I have added a field called company and I have made the following changes which also allows me to edit the field. So have a look and check that you have done the same:
include/staff/editticket.inc.php
at about line 11 add:
'company' =>$ticket->getCompany(),
at about line 52 add:
Company:
">
* <?=$errors?>
include/staff/tickets.inc.php
At around line 199 include company in the $qselect = statement as follows:
$qselect = 'SELECT DISTINCT ticket.ticket_id,lock_id,ticketID,ticket.dept_id,ticket.staff_id,subject,name,company,email,dept_name '.
',ticket.status,ticket.source,isoverdue,isanswered,ticket.created,pri.* ,count(attach.attach_id) as attachments ';
At around line 383 add another column for the tickets table as follows:
Company
Also adjust the column widths of all the columns here so your new column fits in niceley, I have done mine like this:
<?if($canDelete || $canClose) {?>
<?}?>
<?=$qstr?>" title="Sort By Ticket ID <?=$negorder?>">Ticket
<?=$qstr?>" title="Sort By Date <?=$negorder?>">Date
Subject
<?=$qstr?>" title="Sort By Category <?=$negorder?>">Dept
<?=$qstr?>" title="Sort By Priority <?=$negorder?>">Priority
From
Company
At around line 422 add to the last column (the last td statement):
<?=Format:($row,19,strpos($row,'@'))?>
Again adjust the truncate numbers so that it looks ok on your web page - I set mine at 19.
tickets.php:
At around line 39 add a variable to the existing ones:
var $company; //mod090727_new_ticket_field
At around line 72 add:
$this->company =$row;
At around line 138 add:
function getCompany(){
return $this->company;
}
Because my field is a Comapany field I try to add it after the name or fullname each time.
At around line 406 add company to the list of $search = array...:
$search = array('/%id/','/%ticket/','/%email/','/%name/','/%company/','/%subject/','/%topic/','/%phone/','/%status/','/%priority/', '/%dept/','/%assigned_staff/','/%createdate/','/%duedate/','/%closedate/','/%url/');
At around line 412 add (after name):
$this->getCompany(),
At around line 984 add (after name):
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Enter Private if not a Company');
At around line 1022 add (after name):
',company='.db_input(Format:($var)).
At around line 1071 add:
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Use Private if not a Company');
At around line 1197 add (after name):
',company='.db_input(Format:($var)).
And that seems to be it. Hopefully I have covered some things not already covered in this forum.
Note: I cannot seem to make the field Company a non required field even though I have set the required value to 0. Hence the error response "Use Private if not a Company". This seems to work OK.