Unavailability list

Status
Not open for further replies.

jo-ka

Member
Hello.
I will need to create an unavailability list, something like a vacations or holiday map, and I can't find the best approach for this.

So I've created a list with some elements, where i register the user (J! user), the start and end date, something as simple as this.

But now I need to have a list which show me who is unavailable according to the filters, this is, daily or between dates.

I think I'll have to have multiple records for each user, according the number of days he is unavailable, but I'm not sure how to achieve this with Fabrik. Do I need some PHP programming with PHP form plugin, after saving the form?

Plus, on the filters, for better user experience I would like to filter by day, by week, by month, etc...

Is there a way to achieve this?

Thanks in advance.
 
You can do complex filtering with a "dynamic" prefilter.
You'll need a searchform to collect your filter params with a redirect plugin composing the URL pointing to your list with the additional URL params (...com_fabrik&view=list&listid=X&param1=whatever1&daydate=somedate...). The params don't need to be element names.

In the list prefilter add something like
id IN .... Type=eval (or - if it's not to complicated - query)
Then you can add php code (or a query) which can use the URL params (placeholder {param1},{daydate}...) to return the ids which match what you want to show.
 
You can do complex filtering with a "dynamic" prefilter.
You'll need a searchform to collect your filter params with a redirect plugin composing the URL pointing to your list with the additional URL params (...com_fabrik&view=list&listid=X&param1=whatever1&daydate=somedate...). The params don't need to be element names.

woooowwww :confused::confused:o_O

So, slowly please, as I'm a bit dummy...

I need to create a new form, where I'll have two date element fields, so this elements will work as filters. This form shouldn't record any data on the database, right?

I'm lost here on the parameters question. Is there any example of this on the wikis?

Sorry but I'm really lost here.
 
OK, I think I've been able to do this, with the help of an expert friend.

An additional question. Once I'm using Friendly URLs, is there a way to use the parameters (...&param1=whatever1&daydate=somedate...) on an URL like:

/index.php/home/dispensas&param1=whatever1&daydate=somedate

I'm trying and I'm not able to do it.
And I would need it because I need to have some modules on the right position, related to the page link.

Any help?

Thanks in advance
 
That first & needs to be a ?.

The query string always has to be separated from the URL itself with a ?. You only use & to separate multiple query string values.

-- hugh
 
OK, That's perfect, I was missing the ?. It's working with the Friendly URLs and the parameters are being correctly replaced.

index.php/lista-dispensas?&di=2018-05-10&df=2018-05-10

Now I'm having another problem.

When I click on the edit or view record, I get a message:

Error: It was impossible to find this record
. I've tested the list without any Pre-filters and it's working good.

Any clue?

View attachment 17113
 
It seems it's looking for a form, not a list.

BTW:
start the params with only ?, not ?&
You can also use a non-SEF URL (which is at least better for testing your custom links), append the menu item id to your URL to get your correct modules
...&Itemid=X (X = your menu id)
 
Dear troester,

I've made this suggestions, this is, I've set the Form redirect plugin to a non-SEF URL and then appended the Menu ID. It's working good, except that the edit and view icons are linked to a form and not to a list, I can't understand why.

Can this be because the origin is a Search Form?

I need help here please.
 
except that the edit and view icons are linked to a form and not to a list
?? edit and view icons are always linked to forms...
I assume you must add custom edit and view links which are "repeating" the URL params so that your prefilter is also working correctly in form and details view.
Or - if the prefilter is only for conveniece not for security - return all ids in case of missing df/di params in the URL.
 
OK, so let's see..
When I have no pre-filters at all, the link seems OK, and when I click the Edit button I can edit the record.
View attachment 17133

Here's the record...

View attachment 17134

When I have the Pre-Filter, with the values {di} and {df} coming from the form...

View attachment 17135

The link seems exactly the same:
View attachment 17136

But when I click on the edit button... No record found!

View attachment 17137

I tried with and without SEF URL. If I have the condition on the list, the result is exactly the same. I've tried to use custom URLs, like this

/index.php?option=com_fabrik&view=form&Itemid=745&formid=49&rowid=20&listid=49, even forcing the record id, but I've got exactly the same error message.

What kind of custom record shall I use here?

I'm lost. Need help please.

BR
 
You need to specify those query string args in your custom URL, like &di={whatever_element_that_is_on_the_form}

-- hugh
 
OK, damn, it was hard, but I think I've found it.

/index.php?option=com_fabrik&view=form&Itemid=734&formid=49&di={di}&df={df}

Thanks Hugh.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top