Hi,
I'm using custom queue to manage group reservations for a amateur theatre. Tour operators can post a ticket including a date-selection. As I wanted to force the visitors to select only dates when there is a show I setup a select/option field. Eg:

2019-07-12:Fri_12_July
2019-07-19:Fri_19_July
2019-07-20:Sat_20_July
2019-07-21:Sun_21_July

The indexes should be eg. 2019-07-12. I can setup a Custom queue that shows all neccessary columns and it would be great to filter just for a specific date. Unfortunately whenever I select any of the displayed options, I get no results (URL: scp/tickets.php?queue=16&filter=2019-07-19, should show currently 3 results).

Is there anything wrong with osticket or is it my fault??

regards, joky

Try using a list.
Admin panel -> Manage -> Lists

also Lists didn't work as expected. I digged a little into the code and found the line causing the trouble and did a quick (and dirty) fix for it:

@@ -1981,7 +1981,7 @@ class ChoiceField extends FormField {
  
    function applyQuickFilter($query, $qf_value, $name=false) {
        return $query->filter(array(
-            $name ?: $this->get('name') => $qf_value,
+            $name .'__like' ?: $this->get('name') . '__like' => "%$qf_value%",
         ));
   }
 }

Originally it results in a query for the value, eg A3.value = '2019-07-19'. In the database the corresponding entry is '{"2019-07-19":"19th July 2019"}'. The fix changes the query to value LIKE '%2019-07-19%' wich works but is, for sure, not the very best solution for it,.. I assume a permanent fix would require an additional column in ost_form_entry_values,..

regards

5 years later
Write a Reply...