Take out item in filter list and have it display always

Ok.. Hopefully this doesn't get confusing..

I have a field called status for each record. There is a drop down to select one of three choices.. (Core, Union and NonUnion)... Core is essentially both Union and NonUnion... Meaning the person in that record can take union or non union work..

I have a filter based on this so you can filter the list accordingly, but i have a requirement that anyone with a status of core always displays and its removed from the dropdown filter list...

So if you pull up Union filter, Core will still display. If you select NonUnion, Core will still display. There will never be a reason for Core to be selected as a filter since it should "Always" display.

Is there a way to do this and if so how... Thank you
 
Ooops, I typed out a response yesterday, never hit send.

I can't actually think of a way to do this, although there probably is.

I guess my first question is ... does 'core' have to be a status, or could it be split into a separate element?

My experience is that when you run across a filtering issue which can't be done with Fabrik's various methods, that usually means you are trying to "overload" something, that the logic in your data structure isn't quite right.

In this case, I'm assuming that a 'core' person is still either union or non union? The 'core' part simply says whether they are willing /permitted to take union / non union work?

If 'core' and 'union_status' were separate, then it would all fal in to place, and you wouldn't have this issue - you could handle the 'core' part in a pre-filter, and the status filter would already just be union / non union.

-- hugh
 
you know ill have to ask the customer about that. Hmmm. I believe after talking to the customer again that core is Union that can take Non-union work or Union work. So if the filter says Union or Non-Union a person who is core needs to be displayed, so essentially they need to be displayed always no matter the filter.

So should I move the "core" designation to say a checkbox on the form that doesn't show up in the list display. So if its a core person its checked and can be filtered?

then they would have designation of union in the list so then there is only union and nonunion in the status field.

How would I got about using the pre-filter to ensure that anyone labeled core is always shown no matter what the status filter shows? hmmm

I will have to have another discussion with the client about this and about how they want it to display, but I think your onto something here....
 
Talked to the customer. They want the status to display core. That is how they want it. But they don't want to filter on core. They want to core to show up under "all" "Union" or "NonUnion".

So are you saying that its not really possible to do this? Only if its split? I think customer is looking for one of those impossible or nearly impossible things. hmmmm

Let me know if this is possible, if not I will have to explain to the customer it cannot happen and they will have to live with it.

so once again.. If you filter for "Union" the status field should show anyone with "Union" or "Core" for status. For "NonUnion" it should show anyone with "NonUnion" or "Core" for status.

Hopefully there is a way we can get this done.... Thanks for all the help once again.
 
I've devoted quite a lot of thought to this, and really can't think of a way of doing it that doesn't involve adding a fair amount of custom code - some JavaScript when loading the page to remove the 'core' from the filter dropdown, and PHP on the server side to modify the filters when they are applied, to add an "or ..." for the 'core'.

I'll talk to the Brain Trust, see if anyone can think of a way of doing it with Fabrik as-is I may have missed, which is always a possibility.

-- hugh
 
thanks i really appreciate it. I know this is a un-common logical way to do it as most things are with customers. I just need to know 100% its not possible before going back to them. i don't understand why they just can;t have core and make a note on the page saying what core is.. Doesn't make sense to me....
 
thought of something.. would it be possible to override the status with "core" if they have a core checkbox applied in the backend form? So for instance.. They have Union status, but in the display if they have core check box it rewrites the status to core in the list? just thinking out of the box but unsure if thats even possible.

Emailed the customer so going to see what they say. Like you said its logically pushing the boundaries of how the database stuff works... This customer is really pushing the limits, but don't they always... anyways thanks for all the help. So very close now..
 
OK, I think I may have come up with a way to do it, but it requires some changes to our code.

Here's the idea:

1) Use the eval'ed options setting, under the Advanced tab in the join element settings, to remove the 'Core' option. The tooltip doesn't actually spell it out, but if that code returns false for a given option, the option is removed.

2) Use the php_list plugin to run some code on the onFiltersGot hook, which gets called when we've finished building the main $filters array for the list rendering, to add an "OR status = 'core'" (or whatever) filter.

I've already hit a couple of snags, first being that we aren't actually called the eval'ed options code when building the filter dropdown, only when building the dropdown for the form. But technically we should call it when building filters as well - the dropdown element has a similar setting, which we do call when building the filters, so we should try and be consistent.

Next snag may be that modifying the $filters list on list rendering may mean we try and show an extra filter on the visible list of filters, I'm not sure ... I haven't gotten that far yet.

However ... I've already spent about an hour playing aorund with this stuff, and I need to get on with some other support. So it'll be tomorrow before I can take another look.

-- hugh
 
thanks. i am talking with the customer to see what we can do to make it easier and quicker. they would like the app up and running by thursday so i may just have to force them to leave as is. they were already talking about some different methods to do it... They feel core their users won't know what it is (its more of an internal designation). So they are thinking about using letters.

U - union N - nonunion UN - Union and NonUnion

but the question is. Can i have the status display the letter U, N or UN and the filter list display the full word? Such as Core (UN), Union (U), and NonUnion (N). is that possible or does the filter have to be the same and the display? Or i guess i could separate it into two drop downs. I could potentially do a cascaded dropdown so when you change the first of Core (UN) it changes the second one (that displays on the list) to the proper abbreviation?

Does that sound like a logical way to do this?

Thanks again for all your help. you guys have been great...
 
Well, the problem isn't with the wording ... it's with the actual filtering behavior. The "always show core" thing. That just breaks the paradigm of how filters work. And we can't solve it with the a cascading dropdown, because unless you enable "boolean mode" for the filtering (so the user has to select "and" or "or", etc), the individual filters are joined with AND. So for instance, when you filter on both 'status' and 'category', the WHERE clause is going to be "WHERE status = 'foo' AND category = 'bar'. So even if we had 'core' as a separate element, we'd end up with "WHERE status = 'union' AND core = 'yes'" (or whatever), instead of "WHERE status = 'union' OR core = 'yes'".

I've put a lot of thought in to this, and so far the way I outlined above is the only way i can think of doing it. I've started coding the part that needs fixing in the join element, so we run that eval'ed code when building the list filter dropdown, to remove the 'core' option. Should have that done soon.

Then it's a case of making the second part work, of manually adding a $filter ... where I *can* create it to be joined to the others with an OR, so it become "status = 'union' OR status = 'core'".

I can't absolutely guarantee we can get this going by Thursday ... we simply can't commit to deadlines, as there is always the chance of hitting unforeseen snags ... but I can't think of any other way to achieve what you want, and I'll do my best.

-- hugh
 
actually i thought i wrote more then i did up there. I got the customer to forget the show all core thing.. so its back to a normal filtering mechanism.

I mentioned the above as a work around.....

So the new way would be to use abbreviations where core = U + N (union and nonunion). they seem to be ok with that for now. obviously the old way would be the prime way they want it but they are pestering me to get the app up and running. so i can always add that feature in later on...

So cascading will work for my proposed solution then to get the proper wording and look/feel? and can you force the second dropdown based on the first to a specific value?

So it would look like this:

Status Filter (first dropdown and controls status)

- Core (UN)
- Union (U)
- NonUnion (N)

Status (cascade from above dropdown)

- UN (selected automatically when Core is selected in first)
- U (selected automatically when Union is selected in first)
- N (selected automatically when NonUnion is selected in first)

This will get me through the first launch of the app... so i can appease the customer and get this running for them. does this sound feasible and is somewhat simple to do? Cascading i watched the tutorial so it seems simple enough, but I am unsure of how i can force the second dropdown to specific values.. That i still have to research a bit.
 
was that other post up there meant for my other thread?

and by the way thank you guys so much. You have truly gone above and beyond for me..
 
Yes, that other post with the commit URL was for your other thread. I think I posted it there as well. I had several of yoru threads open last night, thought I'd forgotten to post the commit link.

I'm really not understanding what you are getting at with the whole UN/U/N thing.

Can you hit me up on live chat so we can talk through it? I've reread both your posts on it, and still don't get what you are trying to do as the workaround.

-- hugh
 
On the home page, click the Fabrik icon top left, you should see it.

One Of These Days I'll add a live chat link on the forum sidebar. We used to have one, but for gory details it was causing problems due to the way it loads.

-- hugh
 
I haven't been logged in for the weekend ... usually I stay logged in, but I really needed some Quiet Time this weekend ... I'll be logging back in when I wake up tomorrow (Monday).

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top