Files
luos/workflow/engine/methods/bpmn/proxyReportTables.php
Alexandre Rosenfeld 50bf854bee BUG 6400 Replacing json_encode|json_decode by their G implementations
This fixes the problem of some pages of ProcessMaker not working on
PHP 5.1, since there is no json_encode or json_decode native functions
on PHP 5.1.
2011-04-19 16:26:20 -04:00

46 lines
1.3 KiB
PHP
Executable File

<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if(isset($_GET['pid']) && !isset($_GET['type'])){
$rows = $oProcessMap->getExtReportTables($_GET['pid']);
}
else if(isset($_GET['pid']) && $_GET['type'] == 'NORMAL')
{
$aTheFields = array();
$aTheFields = getDynaformsVars($_GET['pid'], false);
foreach ($aTheFields as $aField) {
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
'FIELD_NAME' => $aField['sName']);
}
}
else if(isset($_GET['pid']) && $_GET['type'] == 'GRID'){
$aTheFields = array();
$aTheFields = getGridsVars($_GET['pid']);
foreach ($aTheFields as $aField) {
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
'FIELD_NAME' => $aField['sName']);
}
}
if(isset($_GET['tid']))
{
require_once 'classes/model/ReportTable.php';
$o = new ReportTable();
$rows = $o->load($_GET['tid']);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>