-
Jared Hancock authored
Moved to an initial form which specifies the ticket's priority and issue and changed the rendering to render things properly. Now the user can decide where priority shows on the client side, and the priority privacy setting is placed in the dynamic form wizard. The standard form is added to every ticket without option. Extra forms can be defined and associated with help topics which can additionally be added to tickets upon creation. This allows for standardization of the dynamic data location for searches and filtering. Implemented advanced search for dynamic data. Along with reinstating the basic ticket search on keywords Implemented ticket filtering on dynamic data for both keyword searches as well as searches for special fields (drop-down lists, etc.) Phone number for users is now completely optional
43b74f4a
filter.inc.php 14.59 KiB
<?php
if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access Denied');
$matches=Filter::getSupportedMatches();
$match_types=Filter::getSupportedMatchTypes();
$info=array();
$qstr='';
if($filter && $_REQUEST['a']!='add'){
$title='Update Filter';
$action='update';
$submit_text='Save Changes';
$info=array_merge($filter->getInfo(),$filter->getFlatRules());
$info['id']=$filter->getId();
$qstr.='&id='.$filter->getId();
}else {
$title='Add New Filter';
$action='add';
$submit_text='Add Filter';
$info['isactive']=isset($info['isactive'])?$info['isactive']:0;
$qstr.='&a='.urlencode($_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="filters.php?<?php echo $qstr; ?>" method="post" id="save">
<?php csrf_token(); ?>
<input type="hidden" name="do" value="<?php echo $action; ?>">
<input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
<input type="hidden" name="id" value="<?php echo $info['id']; ?>">
<h2>Ticket Filter</h2>
<table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
<thead>
<tr>
<th colspan="2">
<h4><?php echo $title; ?></h4>
<em>Filters are executed based on execution order. Filter can target specific ticket source.</em>
</th>
</tr>
</thead>
<tbody>
<tr>
<td width="180" class="required">
Filter Name:
</td>
<td>
<input type="text" size="30" name="name" value="<?php echo $info['name']; ?>">
<span class="error">* <?php echo $errors['name']; ?></span>
</td>
</tr>
<tr>
<td width="180" class="required">
Execution Order:
</td>
<td>
<input type="text" size="6" name="execorder" value="<?php echo $info['execorder']; ?>">
<em>(1...99 )</em>
<span class="error">* <?php echo $errors['execorder']; ?></span>
<input type="checkbox" name="stop_onmatch" value="1" <?php echo $info['stop_onmatch']?'checked="checked"':''; ?> >
<strong>Stop</strong> processing further on match!
</td>
</tr>
<tr>
<td width="180" class="required">
Filter Status:
</td>
<td>
<input type="radio" name="isactive" value="1" <?php echo $info['isactive']?'checked="checked"':''; ?>><strong>Active</strong>
<input type="radio" name="isactive" value="0" <?php echo !$info['isactive']?'checked="checked"':''; ?>>Disabled
<span class="error">* </span>