date field pre filled in search mask

More
5 years 5 months ago #76877 by mkoepf
Hi,

It wolud be great, if there will be an option, that a date field in all the search masks can be populated with the actual date or some other possibilities, not only with concrete date values.
That would help, if a date field is a criteria, that only items should be found with the date bigger or equal than the actual date for example.

Because I needed that feature, I made a small "hack":
I entered a fixed old date out of the past and use this as default value( 2016-10-06 for example).
Than I changed the code in components/com_flexicontent/classes/flexicontent.fields.php:
...
// CASE: range values: value01---value02
if (strpos($filter_value, '---') !== false) {
$filter_value = explode('---', $filter_value);
$filter_value[2] = $filter_value[1];
$filter_value[1] = $filter_value[0];
if ($filter_value[1]=="2016-10-06"){$filter_value[1]=date("Y-m-d");}
unset($filter_value[0]);
}
...
It works (certainly not, if a user searches exactly for that date ;) ), but as it is a hack, I have to do it again after each update of FC.
Is ist possible to integrate this in the code?
I think it should be only a smal change...

Hope to hear from you.

Best regards
Matthias

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #76878 by micker
hello you can create a fork of flexicontent and after propose your modification via a PR
github.com/FLEXIcontent/flexicontent-cck
we will check this with pleasure

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #76881 by mkoepf
Oh!
I have never done that before...
Could you do that for me...?
I think, it's only a very small change...

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #76883 by micker
no i can't need to do more with this code
because 2016-10-06 can be used ... (not generic code)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #76885 by mkoepf
you mean I should change the code in a way, that you can include it with no further changes?
I thought you would like to do that yourself to have the full control about the code and the quality and style of programming...

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #76889 by ggppdk
Hello

i really see the usefulness of a specific parameter
but you can do it now yourself

2 general parameter exists for this already
- initial filter values
- locaked filter values

in your case you need the initial filter values
see the picture


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.399 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline