Gazelle/sections/staffpm/common_responses.php

98 lines
3.0 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
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
?>
<div class="thin">
<div class="header">
<h2>Staff PMs - Manage common responses</h2>
<div class="linkbox">
<? if ($IsStaff) { ?>
2013-02-09 08:01:01 +00:00
<a href="staffpm.php" class="brackets">My unanswered</a>
2012-09-01 08:00:24 +00:00
<? } ?>
2013-02-09 08:01:01 +00:00
<a href="staffpm.php?view=unanswered" class="brackets">All unanswered</a>
<a href="staffpm.php?view=open" class="brackets">Open</a>
<a href="staffpm.php?view=resolved" class="brackets">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">
<strong>Name:</strong>
<input onfocus="if (this.value == 'New name') this.value='';"
onblur="if (this.value == '') this.value='New name';"
type="text" id="response_name_0" size="87" value="New name"
/>
</div>
<div class="pad">
<textarea onfocus="if (this.value == 'New message') this.value='';"
onblur="if (this.value == '') this.value='New message';"
rows="10" cols="87"
id="response_message_0">New message</textarea>
<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
$DB->query("SELECT ID, Message, Name FROM staff_pm_responses ORDER BY ID DESC");
while(list($ID, $Message, $Name) = $DB->next_record()) {
?>
<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">
<strong>Name:</strong>
<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?>">
<?=$Text->full_format($Message)?>
</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(); ?>