Skip to main content

Popup

Two actions are available for managing popup. You can insert a php script before the query is made to load the data. In addition, it is possible to insert another php script before the data is shown, so you can edit this data or the result when the popup is closed. In the first case, the are two methods available:

SDK::setPopupQuery($type, $module, $param, $src, $hidden_rel_fields = '');

$type : “field” or “related” to indicate a standard field or popup opened from a related list
$module: the module in which the popup opens
$param : the name of the field that opens the popup (must be uitype 10) in the case type = "field", otherwise the name of the connected module
$src : the path of php file
$hidden_rel_fields : associative array of fields to pass in the popup request like array($urlvalue => $jscode)

To remove the customization:

SDK::unsetPopupQuery($type, $module, $param, $src);

Same parameters as before

The following variables are available within the php script:
$query : the query that takes the values to show
$sdk_show_all_button : if true it shows the button to cancel the SDK restrictions and show all records

In the second case there are the following methods:

SDK::setPopupReturnFunction($module, $fieldname, $src);

$module : ilthe modulomodule checontaining contienethe ilfield campothat cheopens apre ilthe popup
$fieldname : ilthe nomename delof campothe chefield aprethat ilopens the popup (soloonly uitype 10)
$src : ilthe php file php

PerTo de-registrareremove lathe funzionecustomization:

di popup usare il metodo:
SDK::unsetPopupReturnFunction($module, $fieldname = NULL, $src = NULL);

PerFor oranow glithe unicionly campifields supportatisupported sonoare quellithose conwith uitype 10 (a parte per le related list)10.

Hooks
Popup.php
include/utils/ListViewUtils.php
include/ListView/SimpleListView.php

Esempio

<?php

SDK::setPopupQuery('field', 'Contacts', 'account_name', 'modules/SDK/examples/PopupQuery1.php');
SDK::setPopupQuery('related', 'Contacts', 'Products', 'modules/SDK/examples/contacts/PopupRelQuery.php');
SDK::setPopupReturnFunction('Contacts', 'vendor_id', 'modules/SDK/examples/ReturnVendorToContact.php');