Gazelle/sections/staffpm/user_inbox.php

119 lines
2.6 KiB
PHP
Raw Normal View History

2012-09-01 08:00:24 +00:00
<?
include(SERVER_ROOT.'/sections/staffpm/functions.php');
2013-06-27 08:01:06 +00:00
View::show_header('Staff PMs', 'staffpm');
2012-09-01 08:00:24 +00:00
// Get messages
$StaffPMs = $DB->query("
SELECT
2013-02-22 08:00:24 +00:00
ID,
Subject,
UserID,
Status,
Level,
AssignedToUser,
Date,
2012-09-01 08:00:24 +00:00
Unread
2013-02-22 08:00:24 +00:00
FROM staff_pm_conversations
2013-07-02 08:01:37 +00:00
WHERE UserID = ".$LoggedUser['ID']."
2012-09-01 08:00:24 +00:00
ORDER BY Status, Date DESC"
);
// Start page
?>
<div class="thin">
<div class="header">
<h2>Staff PMs</h2>
<div class="linkbox">
2013-06-17 08:01:02 +00:00
<a href="#" onclick="$('#compose').gtoggle();" class="brackets">Compose new</a>
2012-09-01 08:00:24 +00:00
</div>
</div>
<br />
<br />
2013-02-13 08:00:35 +00:00
<? View::parse('generic/reply/staffpm.php', array('Hidden' => true)); ?>
2012-09-01 08:00:24 +00:00
<div class="box pad" id="inbox">
<?
2013-07-10 00:08:53 +00:00
if (!$DB->has_results()) {
2012-09-01 08:00:24 +00:00
// No messages
?>
<h2>No messages</h2>
<?
} else {
// Messages, draw table
?>
2012-09-15 08:00:25 +00:00
<form class="manage_form" name="staff_messages" method="post" action="staffpm.php" id="messageform">
2012-09-01 08:00:24 +00:00
<input type="hidden" name="action" value="multiresolve" />
<h3>Open messages</h3>
<table class="message_table checkboxes">
<tr class="colhead">
<td width="10"><input type="checkbox" onclick="toggleChecks('messageform',this)" /></td>
<td width="50%">Subject</td>
<td>Date</td>
<td>Assigned to</td>
</tr>
<?
// List messages
$Row = 'a';
$ShowBox = 1;
2013-05-04 08:00:48 +00:00
while (list($ID, $Subject, $UserID, $Status, $Level, $AssignedToUser, $Date, $Unread, $Resolved) = $DB->next_record()) {
if ($Unread === '1') {
2012-09-01 08:00:24 +00:00
$RowClass = 'unreadpm';
} else {
2013-05-22 08:01:02 +00:00
$Row = (($Row === 'a') ? 'b' : 'a');
2012-09-01 08:00:24 +00:00
$RowClass = 'row'.$Row;
}
2013-05-22 08:01:02 +00:00
if ($Status == 'Resolved') {
$ShowBox++;
}
2012-09-01 08:00:24 +00:00
if ($ShowBox == 2) {
// First resolved PM
?>
</table>
<br />
<h3>Resolved messages</h3>
2013-02-22 08:00:24 +00:00
<table class="message_table checkboxes">
2012-09-01 08:00:24 +00:00
<tr class="colhead">
<td width="10"><input type="checkbox" onclick="toggleChecks('messageform',this)" /></td>
<td width="50%">Subject</td>
<td>Date</td>
<td>Assigned to</td>
</tr>
<?
}
// Get assigned
2013-05-04 08:00:48 +00:00
$Assigned = ($Level == 0) ? 'First Line Support' : $ClassLevels[$Level]['Name'];
2012-09-01 08:00:24 +00:00
// No + on Sysops
2013-05-22 08:01:02 +00:00
if ($Assigned != 'Sysop') {
$Assigned .= '+';
}
2013-02-22 08:00:24 +00:00
2012-09-01 08:00:24 +00:00
// Table row
?>
<tr class="<?=$RowClass?>">
<td class="center"><input type="checkbox" name="id[]" value="<?=$ID?>" /></td>
<td><a href="staffpm.php?action=viewconv&amp;id=<?=$ID?>"><?=display_str($Subject)?></a></td>
<td><?=time_diff($Date, 2, true)?></td>
<td><?=$Assigned?></td>
</tr>
<?
$DB->set_query_id($StaffPMs);
}
// Close table and multiresolve form
?>
</table>
2013-08-28 23:08:41 +00:00
<div class="submit_div">
<input type="submit" value="Resolve selected" />
</div>
2012-09-01 08:00:24 +00:00
</form>
<?
}
?>
</div>
</div>
2013-05-04 08:00:48 +00:00
<? View::show_footer(); ?>