Gazelle/sections/staffpm/common_responses.php

96 lines
2.9 KiB
PHP
Raw Normal View History

2012-09-01 08:00:24 +00:00
<?
if (!($IsFLS)) {
// Logged in user is not FLS or Staff
error(403);
}
2012-10-11 08:00:15 +00:00
View::show_header('Staff PMs', 'staffpm');
2012-09-01 08:00:24 +00:00
?>
<div class="thin">
<div class="header">
<h2>Staff PMs - Manage common responses</h2>
<div class="linkbox">
<? if ($IsStaff) { ?>
2013-08-28 23:08:41 +00:00
<a href="staffpm.php" class="brackets">View your unanswered</a>
2012-09-01 08:00:24 +00:00
<? } ?>
2013-08-28 23:08:41 +00:00
<a href="staffpm.php?view=unanswered" class="brackets">View all unanswered</a>
<a href="staffpm.php?view=open" class="brackets">View unresolved</a>
<a href="staffpm.php?view=resolved" class="brackets">View resolved</a>
2012-09-01 08:00:24 +00:00
<? if ($ConvID = (int)$_GET['convid']) { ?>
2013-02-09 08:01:01 +00:00
<a href="staffpm.php?action=viewconv&amp;id=<?=$ConvID?>" class="brackets">Back to conversation</a>
2012-09-01 08:00:24 +00:00
<? } ?>
</div>
</div>
<br />
<br />
<div id="commonresponses" class="center">
<br />
<div id="ajax_message_0" class="hidden center alertbar"></div>
<br />
<div class="center">
<h3>Create new response:</h3>
</div>
<div id="response_new" class="box">
2012-09-15 08:00:25 +00:00
<form class="send_form" name="response" id="response_form_0" action="">
2012-09-01 08:00:24 +00:00
<div class="head">
2013-02-22 08:00:24 +00:00
<strong>Name:</strong>
2013-08-28 23:08:41 +00:00
<input onfocus="if (this.value == 'New name') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'New name'; }"
2013-04-17 08:00:58 +00:00
type="text" id="response_name_0" size="87" value="New name"
2012-09-01 08:00:24 +00:00
/>
</div>
<div class="pad">
2013-08-28 23:08:41 +00:00
<textarea onfocus="if (this.value == 'New message') { this.value = ''; }"
onblur="if (this.value == '') { this.value = 'New message'; }"
2013-04-17 08:00:58 +00:00
rows="10" cols="87"
id="response_message_0">New message</textarea>
2012-09-01 08:00:24 +00:00
<br />
2012-09-09 08:00:26 +00:00
<input type="button" value="Save" id="save_0" onclick="SaveMessage(0);" />
2012-09-01 08:00:24 +00:00
</div>
</form>
</div>
<br />
<br />
<div class="center">
<h3>Edit old responses:</h3>
</div>
<?
// List common responses
2013-07-02 08:01:37 +00:00
$DB->query("
SELECT ID, Message, Name
FROM staff_pm_responses
ORDER BY ID DESC");
2013-04-17 08:00:58 +00:00
while (list($ID, $Message, $Name) = $DB->next_record()) {
2013-02-22 08:00:24 +00:00
2012-09-01 08:00:24 +00:00
?>
<br />
<div id="ajax_message_<?=$ID?>" class="hidden center alertbar"></div>
<br />
<div id="response_<?=$ID?>" class="box">
2012-09-15 08:00:25 +00:00
<form class="send_form" name="response" id="response_form_<?=$ID?>" action="">
2012-09-01 08:00:24 +00:00
<div class="head">
2013-02-22 08:00:24 +00:00
<strong>Name:</strong>
2012-09-01 08:00:24 +00:00
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="text" name="name" id="response_name_<?=$ID?>" size="87" value="<?=display_str($Name)?>" />
</div>
<div class="pad">
<div class="box pad hidden" id="response_div_<?=$ID?>">
2013-12-12 08:01:01 +00:00
<?=Text::full_format($Message)?>
2012-09-01 08:00:24 +00:00
</div>
<textarea rows="10" cols="87" id="response_message_<?=$ID?>" name="message"><?=display_str($Message)?></textarea>
<br />
2012-09-09 08:00:26 +00:00
<input type="button" value="Toggle preview" onclick="PreviewResponse(<?=$ID?>);" />
<input type="button" value="Delete" onclick="DeleteMessage(<?=$ID?>);" />
<input type="button" value="Save" id="save_<?=$ID?>" onclick="SaveMessage(<?=$ID?>);" />
2012-09-01 08:00:24 +00:00
</div>
</form>
</div>
<?
}
?>
</div>
</div>
2013-02-09 08:01:01 +00:00
<? View::show_footer(); ?>