Merge pull request #40 from bechtoldt/ticket1044

Ticket Center: Link usernames with their user panel, fixes #1044
This commit is contained in:
Florian Aders
2012-08-22 03:04:57 -07:00
3 changed files with 20 additions and 11 deletions

View File

@@ -115,13 +115,17 @@ if($page == 'tickets'
if($_cid != $row['customerid'])
{
$cid = $row['customerid'];
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$cid . '"');
if(isset($usr['loginname'])) {
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')';
//$customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
} else {
if(isset($usr['loginname']))
{
$customer = getCorrectFullUserDetails($usr);
$customerloginname = $usr['loginname'];
$customerid = $usr['customerid'];
}
else
{
$customer = $lng['ticket']['nonexistingcustomer'];
}
eval("\$tickets.=\"" . getTemplate("tickets/tickets_customer") . "\";");
@@ -673,12 +677,17 @@ elseif($page == 'archive'
if($_cid != $ticket['customerid'])
{
$cid = $ticket['customerid'];
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$cid . '"');
if(isset($usr['loginname'])) {
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')';
} else {
if(isset($usr['loginname']))
{
$customer = getCorrectFullUserDetails($usr);
$customerloginname = $usr['loginname'];
$customerid = $usr['customerid'];
}
else
{
$customer = $lng['ticket']['nonexistingcustomer'];
}

View File

@@ -3,7 +3,7 @@
<td>{$ticket['ticket_answers']}</td>
<td>{$ticket['subject']}</td>
<td>{$ticket['lastreplier']}</td>
<td><span class="ticket_{$ticket['display']}">{$ticket['priority']}</span></td>
<td>{$ticket['priority']}</td>
<td>
<a href="{$linker->getLink(array('section' => 'tickets', 'page' => 'archive', 'action' => 'view', 'id' => $ticket['id']))}" style="text-decoration:none;">
<img src="templates/{$theme}/assets/img/icons/ticket_show.png" alt="{$lng['ticket']['show']}"/>

View File

@@ -1,3 +1,3 @@
<tr>
<td class="field_name_border_left" colspan="10"><strong>{$customer}</strong></td>
<td class="field_name_border_left" colspan="10"><strong>{$customer} (<a href="{$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $customerid))}" rel="external">{$customerloginname}</a>)</strong></td>
</tr>