Skip to content
Snippets Groups Projects
Commit 694221d2 authored by Jared Hancock's avatar Jared Hancock
Browse files

Drop `subject` and `body` from filters

They are only available for tickets arriving via the email channel. All
other channel (including email) use the new ticket form to record the
subject and body, which are mapped to the 'Issue Summary' and 'Issue
Details' fields respectively

Structure the drop-down list for the `what` column to be future-minded
concerning custom user data matching.
parent 584465c9
No related branches found
No related tags found
No related merge requests found
...@@ -271,7 +271,7 @@ class TicketForm extends DynamicForm { ...@@ -271,7 +271,7 @@ class TicketForm extends DynamicForm {
} }
} }
// Add fields from the standard ticket form to the ticket filterable fields // Add fields from the standard ticket form to the ticket filterable fields
Filter::addSupportedMatches('Custom Fields', function() { Filter::addSupportedMatches('Ticket Data', function() {
$matches = array(); $matches = array();
foreach (TicketForm::getInstance()->getFields() as $f) { foreach (TicketForm::getInstance()->getFields() as $f) {
if (!$f->hasData()) if (!$f->hasData())
......
...@@ -19,11 +19,11 @@ class Filter { ...@@ -19,11 +19,11 @@ class Filter {
var $ht; var $ht;
static $match_types = array( static $match_types = array(
'Basic Fields' => array( 'User Information' => array(
'name' => 'Name', 'name' => 'Name',
'email' => 'Email', 'email' => 'Email',
'subject' => 'Subject', ),
'body' => 'Body/Text', 'Email Meta-Data' => array(
'reply-to' => 'Reply-To Email', 'reply-to' => 'Reply-To Email',
'reply-to-name' => 'Reply-To Name', 'reply-to-name' => 'Reply-To Name',
), ),
......
...@@ -121,7 +121,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -121,7 +121,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
for($i=1; $i<=$n; $i++){ ?> for($i=1; $i<=$n; $i++){ ?>
<tr id="r<?php echo $i; ?>"> <tr id="r<?php echo $i; ?>">
<td colspan="2"> <td colspan="2">
<div style="width:700px; float:left;"> <div>
<select name="rule_w<?php echo $i; ?>"> <select name="rule_w<?php echo $i; ?>">
<option value="">&mdash; Select One &dash;</option> <option value="">&mdash; Select One &dash;</option>
<?php <?php
...@@ -143,15 +143,14 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -143,15 +143,14 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
} }
?> ?>
</select> </select>
<input type="text" size="30" name="rule_v<?php echo $i; ?>" value="<?php echo $info["rule_v$i"]; ?>"> <input type="text" size="60" name="rule_v<?php echo $i; ?>" value="<?php echo $info["rule_v$i"]; ?>">
&nbsp;<span class="error">&nbsp;<?php echo $errors["rule_$i"]; ?></span> &nbsp;<span class="error">&nbsp;<?php echo $errors["rule_$i"]; ?></span>
</div>
<?php <?php
if($info["rule_w$i"] || $info["rule_h$i"] || $info["rule_v$i"]){ ?> if($info["rule_w$i"] || $info["rule_h$i"] || $info["rule_v$i"]){ ?>
<div style="float:right;text-align:right;padding-right:20px;"><a href="#" class="clearrule">(clear)</a></div> <div style="float:right;text-align:right;padding-right:20px;"><a href="#" class="clearrule">(clear)</a></div>
<?php <?php
} ?> } ?>
<div class="clear"></div> </div>
</td> </td>
</tr> </tr>
<?php <?php
......
...@@ -22,6 +22,24 @@ ALTER TABLE `%TABLE_PREFIX%filter_rule` ...@@ -22,6 +22,24 @@ ALTER TABLE `%TABLE_PREFIX%filter_rule`
ALTER TABLE `%TABLE_PREFIX%ticket_collaborator` ALTER TABLE `%TABLE_PREFIX%ticket_collaborator`
CHANGE `isactive` `isactive` tinyint(1) NOT NULL DEFAULT '1'; CHANGE `isactive` `isactive` tinyint(1) NOT NULL DEFAULT '1';
-- There is no `subject` available in the filter::apply method for anything but email
UPDATE `%TABLE_PREFIX%filter_rule`
SET `what` = CONCAT('field.', (
SELECT field.`id` FROM `%TABLE_PREFIX%form_field` field
JOIN `%TABLE_PREFIX%form` form ON (field.form_id = form.id)
WHERE field.`name` = 'subject' AND form.`type` = 'T'
))
WHERE `what` = 'subject';
-- There is no `body` available in the filter::apply method for anything but emails
UPDATE `%TABLE_PREFIX%filter_rule`
SET `what` = CONCAT('field.', (
SELECT field.`id` FROM `%TABLE_PREFIX%form_field` field
JOIN `%TABLE_PREFIX%form` form ON (field.form_id = form.id)
WHERE field.`name` = 'message' AND form.`type` = 'T'
))
WHERE `what` = 'body';
-- Finished with patch -- Finished with patch
UPDATE `%TABLE_PREFIX%config` UPDATE `%TABLE_PREFIX%config`
SET `value` = 'f5692e24c7afba7ab6168dde0b3bb3c8' SET `value` = 'f5692e24c7afba7ab6168dde0b3bb3c8'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment