Exemple #1
0
/**
 * Render select ticket type
 *
 * @param string $selected type of ticket
 * @param array $attributes Additional attributes
 * @return string
 */
function select_ticket_type($name, $selected = null, $attributes = null)
{
    $types = get_ticket_types();
    $options = array();
    foreach ($types as $type) {
        $option_attributes = $type == $selected ? array('selected' => 'selected') : null;
        $options[] = option_tag(lang($type), $type, $option_attributes);
    }
    // foreach
    return select_box($name, $options, $attributes);
}
echo lang('priority');
?>
:</strong>
    <?php 
$this->assign('properties', get_ticket_priorities());
$this->assign('property_name', 'priority');
$this->includeTemplate(get_template_path('filter_links', 'tickets'));
?>
  </div>
  <div id="typeFilters">
    <strong><?php 
echo lang('type');
?>
:</strong>
    <?php 
$this->assign('properties', get_ticket_types());
$this->assign('property_name', 'type');
$this->includeTemplate(get_template_path('filter_links', 'tickets'));
?>
  </div>
  <div id="categoryFilters">
    <strong><?php 
echo lang('category');
?>
:</strong>
    <?php 
$property_name = 'category_id';
$property_in_url = isset($params[$property_name]) ? $params[$property_name] : "";
// TODO make filter_links template more flexible so that it can be used with Categories and not only text.
echo '<a href="' . get_url('tickets', 'index', array_merge($params, array($property_name => ''))) . '" ' . ($property_in_url == "" ? 'class="selected"' : '') . '>' . lang('all') . '</a> ';
if (is_array($categories)) {