This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Calendar Issue : "Only allow each date to be selected (x) times"


  1. sndfx69
    Member

    Help! Please

    I'm having a problem when I add a Calendar and in the field propriety I select " Only allow each date to be selected (x) times"

    Here is the case:

    - (X) days where 3 days only for each day in the Calendar
    - Users have no problem at all filling the form.

    Now let's say three users filled the form and selected the same date; so that means the that day is locked.
    until now everything is working great.

    Now here comes the problem:

    I want to edit one of the three entries so I logon to my panel as an admin, select an entire and do some changes and hit SAVE.
    guess what happens? " Yes, your correct" it refuses to save because it's assuming it's a forth entry.

    I don't know if this issue has been raised but I really need your help on this issue.

    Thank You All.

    Posted 11 years ago #
  2. sndfx69
    Member

    yuniar is their anyway around this problem?

    Thanks

    Posted 11 years ago #
  3. yuniar

    I think you've just found a bug. Thank you for reporting this.
    I'll investigate this further and get back soon.


    MachForm Founder

    Posted 11 years ago #
  4. yuniar

    Ok, here's how to fix it. You need to edit the "includes/post-functions.php" file.
    Search around line 1268 for this code:

    status=1 and element_{$element_id} is not null

    change it to become:

    status=1 and element_{$element_id} is not null {$disabled_date_where_clause}

    then search around line 1257 for this code:

    if(!empty($element_info[$element_id]['date_enable_selection_limit']) && !empty($element_info[$element_id]['date_selection_max'])){

    exactly below that line, add this block of code:

    $disabled_date_where_clause = '';
    if(!empty($edit_id) && ($_SESSION['mf_logged_in'] === true)){
    	$disabled_date_where_clause = "AND (backtick)id(backtick) <> {$edit_id}";
    }

    this forum can't display backtick character, so make sure to replace (backtick) with a real backtick character.

    that should fix the issue.
    If you are having difficulty, please contact us directly and we'll send you the file for this.


    MachForm Founder

    Posted 11 years ago #
  5. sndfx69
    Member

    Thanks Ynniar, I'll give it try and get back to you.

    Posted 11 years ago #
  6. sndfx69
    Member

    Thank you SO MUCH (yuniar) it worked like a charm. :)

    Will this fix be included in future venison ?

    Regards,
    SNDFX69

    Posted 11 years ago #
  7. yuniar

    Yes, this will be included within the next update


    MachForm Founder

    Posted 11 years ago #

RSS feed for this topic

Reply