File tree Expand file tree Collapse file tree 4 files changed +41
-22
lines changed
components/com_jtg/models Expand file tree Collapse file tree 4 files changed +41
-22
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,18 @@ protected function getListQuery(){
8383 ->join ('LEFT ' ,'#__users AS c ON a.uid=c.id ' );
8484
8585 // Filter company
86- $ trackcat = $ this ->getState ('filter.trackcat ' );
87- if (!empty ($ trackcat )) {
88- //error_log('Got category from state '.$trackcat);
89- $ query ->where ('a.catid LIKE ' .$ db ->quote ('% ' .$ trackcat .'% ' ));
86+ $ trackcats = $ this ->getState ('filter.trackcat ' );
87+ if (!empty ($ trackcats )) {
88+ $ iCount = 0 ;
89+ foreach ($ trackcats as $ trackcat ) {
90+ if ($ iCount == 0 ) {
91+ $ query ->where ('a.catid LIKE ' .$ db ->quote ('% ' .$ trackcat .'% ' ));
92+ }
93+ else {
94+ $ query ->orWhere ('a.catid LIKE ' .$ db ->quote ('% ' .$ trackcat .'% ' ));
95+ }
96+ $ iCount ++;
97+ }
9098 }
9199 else {
92100 $ trackcat = $ input ->get ('cat ' );
Original file line number Diff line number Diff line change 2828 onchange =" this.form.submit()"
2929 />
3030 <field
31- name =" trackcat"
32- type =" trackcategory"
33- onchange =" this.form.submit()"
31+ name=" trackcat"
32+ type=" trackcategory"
33+ multiple=" multiple"
34+ onchange=" this.form.submit()"
3435 />
3536 </fields >
3637 <fields name =" list" >
Original file line number Diff line number Diff line change 1616 onchange =" this.form.submit();"
1717 />
1818 <field
19- name =" maxdist"
20- type =" number"
21- label =" COM_JTG_DISTANCE"
22- hint =" COM_JTG_MAX_DISTANCE"
23- onchange =" this.form.submit()"
19+ name=" maxdist"
20+ type=" number"
21+ label=" COM_JTG_DISTANCE"
22+ hint=" COM_JTG_MAX_DISTANCE"
23+ onchange=" this.form.submit()"
2424 />
2525 <field
26- name =" tracklevel"
27- type =" tracklevel"
28- onchange =" this.form.submit()"
26+ name=" tracklevel"
27+ type=" tracklevel"
28+ onchange=" this.form.submit()"
2929 />
3030 <field
31- name =" trackcat"
32- type =" trackcategory"
33- onchange =" this.form.submit()"
31+ name=" trackcat"
32+ type=" trackcategory"
33+ multiple=" multiple"
34+ onchange=" this.form.submit()"
3435 />
3536 </fields >
3637</form >
Original file line number Diff line number Diff line change @@ -61,10 +61,19 @@ protected function getListQuery(){
6161 ->join ('LEFT ' ,'#__users AS c ON a.uid=c.id ' );
6262
6363 // Filter company
64- $ trackcat = $ this ->getState ('filter.trackcat ' );
65- if (!empty ($ trackcat )) {
66- $ query ->where ('a.catid LIKE ' .$ db ->quote ('% ' .$ trackcat .'% ' ));
67- }
64+ $ trackcats = $ this ->getState ('filter.trackcat ' );
65+ if (!empty ($ trackcats )) {
66+ $ iCount = 0 ;
67+ foreach ($ trackcats as $ trackcat ) {
68+ if ($ iCount == 0 ) {
69+ $ query ->where ('a.catid LIKE ' .$ db ->quote ('% ' .$ trackcat .'% ' ));
70+ }
71+ else {
72+ $ query ->orWhere ('a.catid LIKE ' .$ db ->quote ('% ' .$ trackcat .'% ' ));
73+ }
74+ $ iCount ++;
75+ }
76+ }
6877 else {
6978 $ trackcat = JFactory::getApplication ()->input ->get ('cat ' );
7079 if ($ trackcat !== null ) {
You can’t perform that action at this time.
0 commit comments