[SOLVED] list php plugin

Status
Not open for further replies.
Hi,
i have two list, one with objects (named pand_inventario) and one with note belongs to objects (pand_inventario_note).
i'd like to create a button on the pand_inventario list to open a new pand_inventario form with one filed pre-compiled with the pand_inventario id.

this is the php code
// get current selected ids and take only the first
$app = JFactory::getApplication();
$ids = $app->input->get('ids', array(), 'array');
//..and take only the first (just in case people select more than one single row)
$ids = is_array($ids) ? $ids[0] : $ids;

//Updating pand_inventario_note___id_inventory's value before showing the form
$formModel->data['pand_inventario_note___id_inventory(raw)'] = $ids;


can someone help me find where i'm wrong?

thanks
alberto
 
You can do this with the "related data" feature on the pand_inventorio list, under the "Data" tab. Assuming pand_inventario_note___id_inventory is a join element, under the Related Data tab should be an option to add a new form to it, from the inventorio list.

-- hugh
 
Perfect.
Thank you very much.

One more question, please:
I need a button in pand_inventario_note list, to set a checkbox on the same tuple.
the checkbox has only one subfield with value 1 and label archived.

i found this pieces of code, but it returns only a blanck page.
$formModel->updateFormData('pand_inventario_note___note[0]', '1', true);

can you please told me the error?

Thanks
alberto
 
Use the update_col plugin.

This list plug-in allows your users to select multiple rows and update the values in one or two columns.

Settings​


updatecol-options.png

  • Access - Which user group can see the update column buttons
  • Button label - The text for the update column button
  • Button image - Image to use for button. Looks for the file in the image overrides locations
  • Allow user selection - If set to yes then this allows the user to select via a pop up window which Elements and values to update
updatecol-update.png

  • Update - If Allow user selection set to no, then you can define a set of element/values which will automatically be used to update records when the plugin button is pressed
    • To access the row data when "Eval = Yes", you first need to call: $data = $model->getData(); after which the $data can be addressed as in the preEval and postEval.
  • Update message - Status message after update. You can optionally use %d in your message, first occurrence will be replaced with number of rows updated, second occurrence will be replaced with number of emails sent.
  • Update date - Optional, select the Date element to update to the current date
  • Update user - Optional, select the User element to update with the current logged on user's id
updatecol-emal.png

  • Email address - Optional, select either a User element, or a simple text element which contains and email address. If selected, the plugin will send a notification email to the email associated with each updated row. The plugin will automatically detect whether you have selected a User element (in which case it will look up the email from jos_users) or a simple element containing the literal email as text.
  • Or email to - alternatively enter an email address here - takes precedence over the 'Email address' option
  • Email subject - Optional, if you selected an Email Address above, you must specify the subject for the notification email. You can use normal {tablename___elementname} Placeholders.
  • Email Message - Optional, if you selected an Email Address above, you must specify the message body for the notification email. You can use normal {tablename___elementname} Placeholders.
  • Eval - Should the message be evaluated as PHP . If so the 'Email message' should 'return' the message to send.

Example​


The UI when "Allow user selection" is set to yes:
updatecol-example.png


-- hugh
 
Sorry but on the list plug-ins i can select only the copy and php plugin
i've downloaded the fabrik plugin from thhe site, not from github.
have i missed some post activity steps?

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

Thank you.

Members online

Back
Top