Funzione da utilizzare nella Ric che richiama il programma.
static function PREFISSORicNOME($returnModel, $returnEvent) {
$sql = "SELECT ROWID, CAMPOCOD, CAMPODES FROM NOMETABELLA";
$model = 'utiRicDiag';
$gridOptions = array(
"Caption" => 'Titolo dell'elenco',
"width" => '330',
"height" => '400',
"sortname" => 'CAMPOCOD/CAMPODES',
"rowNum" => '20',
"rowList" => '[]',
"colNames" => array(
"Codice",
"Descrizione"
),
"colModel" => array(
array("name" => 'CAMPOCOD', "width" => 60),
array("name" => 'CAMPODES', "width" => 260)
),
"dataSource" => array(
'sqlDB' => 'DB',
'sqlQuery' => $sql
)
);
$_POST = array();
$_POST['event'] = 'openform';
$_POST['gridOptions'] = $gridOptions;
$_POST['returnModel'] = $returnModel;
$_POST['returnEvent'] = $returnEvent;
$_POST['retid'] = $returnId;
$_POST['returnKey'] = 'retKey';
itaLib::openForm($model, true, true, 'desktopBody', $returnModel);
$appRoute = App::getPath('appRoute.' . substr($model, 0, 3));
require_once App::getConf('modelBackEnd.php') . '/' . $appRoute . '/' . $model . '.php';
$model();
}
Dove:
Nota. Se è un DB Unico, che non fa riferimento all'ente che lo sta utilizzando(non è quindi del tipo DB Gafiere dell'ente 01: GAFIERE01 o dell'ente 02 GAFIERE02) ed è quindi un DB come ad esempio i COMUNI, che sono sempre quelli, bisogna aggiungere tra le opzioni “dataSource” ⇒ array( il 'dbSuffix' ⇒ “”) Esempio:
"dataSource" => array(
'sqlDB' => 'DBUNICO',
'sqlQuery' => $sql,
'dbSuffix' => ""
)
65 visualizzazioni.