Skip to content

Commit e1585fb

Browse files
author
filip
committed
Added ability to reply support messages
Simple threaded support messages (via RE: in subject)
1 parent f612f1e commit e1585fb

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

interface/web/help/form/support_message.tform.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,28 @@
3232
//* be set to yes in most cases
3333
$form["auth"] = 'yes'; // yes / no
3434

35-
//* Authentocation presets. The defaults below does not need to be changed in most cases.
35+
//* Authentication presets. The defaults below does not need to be changed in most cases.
3636
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
3737
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
3838
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
3939
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
4040
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
4141

4242

43+
//* Maybe we're writing in a response to another message
44+
$sm_default_recipient_id = '';
45+
$sm_default_subject = '';
46+
if(isset($_GET['reply']))
47+
{
48+
$sm_msg_id = preg_replace("/[^0-9]/","",$_GET['reply']);
49+
$res = $app->db->queryOneRecord("SELECT sender_id, subject FROM support_message WHERE support_message_id=$sm_msg_id");
50+
if($res['sender_id'])
51+
{
52+
$sm_default_recipient_id = $res['sender_id'];
53+
$sm_default_subject = (preg_match("/^Re:/",$res['subject'])?"":"Re: ") . $res['subject'];
54+
}
55+
}
56+
4357
//* Begin of the form definition of the first tab. The name of the tab is called "message". We refer
4458
//* to this name in the $form["tab_default"] setting above.
4559
$form["tabs"]['message'] = array (
@@ -53,7 +67,7 @@
5367
'recipient_id' => array (
5468
'datatype' => 'INTEGER',
5569
'formtype' => 'SELECT',
56-
'default' => '',
70+
'default' => $sm_default_recipient_id,
5771
'datasource' => array ( 'type' => 'SQL',
5872
'querystring' => 'SELECT userid,username FROM sys_user WHERE userid != 1 AND {AUTHSQL} ORDER BY username',
5973
'keyfield' => 'userid',
@@ -84,7 +98,7 @@
8498
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
8599
'errmsg'=> 'subject_is_empty'),
86100
),
87-
'default' => '',
101+
'default' => $sm_default_subject,
88102
'value' => '',
89103
'width' => '30',
90104
'maxlength' => '255'
@@ -117,4 +131,4 @@
117131

118132

119133

120-
?>
134+
?>

interface/web/help/lib/lang/cz_support_message.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ $wb['sender_id_txt'] = 'ID Odesílatele';
44
$wb['subject_txt'] = 'Předmět';
55
$wb['message_txt'] = 'Zpráva';
66
$wb['tstamp_txt'] = 'Časové razítko';
7+
$wb['reply_txt'] = 'Odpovědět';
78
?>

interface/web/help/lib/lang/en_support_message.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ $wb['sender_id_txt'] = 'Sender ID';
44
$wb['subject_txt'] = 'Subject';
55
$wb['message_txt'] = 'Message';
66
$wb['tstamp_txt'] = 'Timestamp';
7+
$wb['reply_txt'] = 'Reply';
78
?>

interface/web/help/templates/support_message_view.htm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ <h2><tmpl_var name="list_head_txt"></h2>
1414
<p>{tmpl_var name='message'}</p>
1515
</div>
1616
</fieldset>
17+
<div class="buttonHolder buttons">
18+
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='reply_txt'}" onClick="loadContent('help/support_message_edit.php?reply={tmpl_var name='id'}');"><span>{tmpl_var name='reply_txt'}</span></button>
19+
</div>
20+
</div>
21+
1722
</div>
1823

1924
</div>

0 commit comments

Comments
 (0)