Fields Visibility
You can change the visibility of the various fields (value of $readonly) and other variables in the different modes (ListView, EditView, …)and so on). To register a new "view" use the method:
SDK::addView($module, $src, $mode, $success);
$module : the module name to apply the view
$src : the php file path
$mode : how the rule is applied (see below)
$success: what to do after applying the rule (see below)
The views defined for each module are applied in the order in which they are registered. When they register, they are added to the queue of views for that module. The $mode variable only makes sense if you change the $readonly variable and it admits the following values:
“constrain” : forces the value of $readonly to take the new value given in the script
“restrict” : changes the value of $readonly only for a more restrictive value (from 1 to 99 or 100, from 99 to 100, not vice versa)
The $success variable instead can be:
“continue” : after applying the view, continue with the next
“stop” : if the view returns $success = true, no other rules are executed
The following variables are available within the scripts:
$sdk_mode : unoone traof “” (create), “edit”, “detail”, “popup_query”, “list_related_query”, “popup”, “related”, “list”, “mass_edit”
$readonly : il valore dithe readonly pervalue ilfor campothe checurrent si sta per scriverefield (1, 99, 100)
$col_fields: valorivalues deiof campi,fields, soloonly perfor $sdk_mode = “edit”, “detail” e “”
$fieldname oor $fieldName: nomethe delname campoof correntethe current field
$current_user: l’utentethe correntecurrent user
EdAnd èyou possibilecan restituireset la variabilethe $success convariable with true oor false.ADepending secondaon dellathe modalitàmode (ListView, EditView, …)and ciso sonoon) diversithere modiare perdifferent modificareways leto queryedit ethe diversequeries variabiliand disponibili.different variables available.
CreateView | "" |
$col_fields $current_user $fieldname $readonly $success |
1 |
EditView | "edit" | ||
DetailView | "detail" | ||
MassEdit | "mass_edit" | ||
PopupQuery | "popup_query" |
$sdk_columns $success |
2 |
List/RelatedQuery | "list_related_query" |
$sdk_columns $success |
|
Popup | "popup" |
$current_user $fieldname $sdk_columnnames $sdk_columnvalues $readonly $success |
3 |
Related | "related" | 4 | |
List | "list" |
Note:Notes:
- In
questethesemodalitàmodesithevalorivaluesdeiofcampithesonofields are in $col_fields[nomi-dei-campi ]nameOfTheField] QuesteThesemodalitàmodesservonoareperusedmodificaretolamodify the queryinsomodothatdaadditionalpoterfieldsprelevarecancampibeaggiuntivi.picked up. In $sdk_columnscivariablesonotherelearecolonnethedeldatabasedbcolumnsdatoaggiungereaddallato the query.IncludereIncludepoi il filethen “modules/SDK/AddColumnsToQueryView.php”PerToprelevaregetvalorivaluesdifromaltriothercampi,fields,specificatispecifiednelleinmodalitàthe PopupQueryeandListRelatedQuery,ListRelatedQueryscriverlimodes,nell’arraywrite them in the $sdk_columnnames,sdk_columnnamesincluderevariable,ilinclude the file “modules/SDK/GetFieldsFromQueryView.php”eandprenderlithenpoitakedathem from $sdk_columnvaluesNelIncasothedellacase of the related“Storico"Activityattività”history",sonoonlydisponibilithesolo le variabilivariables $recordIdeand $readonlyearesiavailableapplicanoandall'interaapplyriga,tononthealentiresingolorow,campo.not to the single field.
PerTo de-registrareremove lathe vista usare:view:
$module : HooksSDK::deleteView($module, $src);
ilthe modulomodule associatoname
$src : ilthe php file php
include/ListView/ListViewController.php
include/utils/DetailViewUtils.php
include/utils/EditViewUtils.php
include/utils/ListViewUtils.php
include/QueryGenerator/QueryGenerator.php
Popup.php