update col plugin >> pre eval code

bea

Active Member
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:
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
 
I didn't test but maybe you can modify the arrays $ids and $data.
OPTIONAL - PHP code to run before updates happen. Return false to abort updates, set $this->msg to return a response to user. Ids are in $ids, data is in $data

An other possibility:
An extra list with update col and a prefilter, showing only the "updatable" rows.
 
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:
$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
 
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
 
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
 
Hi Hugh,

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

Cheers,
Bianka
 
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
 
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
friendly bump
 
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

Hi Hugh,
please let me know, if you can add "check can edit"
Cheers,
Bianka
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top