This is a useful change, but the strstr function used required PHP 5.3. My ISP provides PHP 5.2, so I had to work around the different built-in function.
//Replace base variables.
//BSK: Add first name
function replaceTemplateVars($text){
global $cfg;
$dept = $this->getDept();
$staff= $this->getStaff();
//GTS: Begin, extract firstname (or entire name if no first name)
// for PHP 5.2
$firstname = $this->getName();
$seperatorPos = strpos($firstname, ' ');
if ($seperatorPos !== FALSE)
$firstname = substr($firstname, 0, $seperatorPos);
$firstname = ucfirst($firstname);
//GTS: End
//
//ORIGINAL
//$search = array('/%id/','/%ticket/','/%email/','/%name/','/%subject/','/%topic/','/%phone/','/%status/','/%priority/',
// '/%dept/','/%assigned_staff/','/%createdate/','/%duedate/','/%closedate/','/%url/');
//ADDED
$search = array('/%id/','/%ticket/','/%email/','/%emailcc/','/%name/','/%firstname/','/%subject/','/%topic/','/%phone/','/%status/','/%priority/',
'/%dept/','/%assigned_staff/','/%createdate/','/%duedate/','/%closedate/','/%url/');
$replace = array($this->getId(),
$this->getExtId(),
$this->getEmail(),
$this->getEmailcc(), //ADDED
$this->getName(),
$firstname, //GTS: //BSK firstname
$this->getSubject(),
$this->getHelpTopic(),
$this->getPhoneNumber(),
$this->getStatus(),
$this->getPriority(),
($dept?$dept->getName():''),
($staff?$staff->getName():''),
Format:($this->getCreateDate()),
Format:($this->getDueDate()),
Format:($this->getCloseDate()),
$cfg->getBaseUrl());
return preg_replace($search,$replace,$text);
}