1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

update col plugin >> pre eval code

Discussion in 'Community' started by bea, Apr 16, 2019.

  1. bea

    bea Active Member

    Level: Community
    Hi,
    I am wondering, if I can limit the update col plugin with a pre eval code.
    With can edit row plugin only the last record can be edited:
    Code (Text):
    switch ('{fab_tour___status_raw}') {
       case '1':
          return true;
       case '2':
          return false;
    }
    I would like to give the user the possibility to update only the records of the last 12 hours, but I have no idea...

    Many thanks
    Bianka
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    I didn't test but maybe you can modify the arrays $ids and $data.
    An other possibility:
    An extra list with update col and a prefilter, showing only the "updatable" rows.
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Hmm, looking at the code, you'd also need to update the J! input array, as well as $ids ... so after modifying $ids, do ...

    Code (Text):

    $this->app->input->set('ids', $ids);
     
    ... because the method that calls the pre-eval calls other methods to do the actual updating, which also read the input array direct.

    The only other option is that I add a "check can edit" option to the plugin, and run that in the main _process() method. It wouldn't be entirely trivial, but not too difficult. Maybe an hour's work.

    -- hugh
     
  4. bea

    bea Active Member

    Level: Community
    Hi troester, hi Hugh,
    many thanks for your support. It would be great to get get some extra feature for the update col plugin.
    You can catch me on skype.

    Cheers and happy easter!
    Bianka
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Sorry I've been hard to catch on Skype. Been catching up after my road trip out West, and working on some hard deadlines.

    -- hugh
     
  6. bea

    bea Active Member

    Level: Community
    Hi Hugh,

    please let me know, when you can work on this feature.

    Cheers,
    Bianka
     
  7. bea

    bea Active Member

    Level: Community
    friendly bump
     
  8. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'll take a look some time today. I also need to add some tests to see if the field specified for the date is a date element, and if so, honor the 'local' setting.

    -- hugh
     
  9. bea

    bea Active Member

    Level: Community
    many thanks
     
  10. bea

    bea Active Member

    Level: Community
    friendly bump
     
  11. bea

    bea Active Member

    Level: Community
    friendly bump
     

Share This Page