Merge branch 'master' of github.com:colosa/processmaker

This commit is contained in:
Erik Amaru Ortiz
2013-11-04 10:13:03 -04:00
8 changed files with 62 additions and 50 deletions

View File

@@ -5222,6 +5222,14 @@ class G
return $path;
}
public function isUserFunction($functionName) {
$allFunctions = get_defined_functions();
if (!isset($allFunctions['user'])) {
$allFunctions['user'] = array();
}
return in_array(strtolower($functionName), $allFunctions['user']);
}
}
/**

View File

@@ -412,6 +412,9 @@ class AdditionalTables extends BaseAdditionalTables
}
$stringOr .= ');';
eval($stringOr);
$oCriteriaCount = clone $oCriteria;
eval('$count = ' . $sClassPeerName . '::doCount($oCriteria);');
}
if (isset($_POST['sort'])) {

View File

@@ -422,7 +422,7 @@ class pmTablesProxy extends HttpProxyController
$table = $additionalTables->load( $httpData->id, true );
if ($filter != '') {
$result = $additionalTables::getAllData( $httpData->id, $start, $limit, true, $filter);
$result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter);
} else {
$result = $additionalTables->getAllData( $httpData->id, $start, $limit );
}

View File

@@ -20,7 +20,7 @@ if (! isset ($_REQUEST ['action'])) {
print G::json_encode ($res);
die ();
}
if (! function_exists ($_REQUEST ['action'])) {
if (! function_exists ($_REQUEST['action']) || !G::isUserFunction($_REQUEST['action'])) {
$res ['success'] = false;
$res ['message'] = 'The requested action does not exist';
print G::json_encode ($res);

View File

@@ -5,7 +5,7 @@ if (! isset( $_REQUEST['action'] )) {
print G::json_encode( $res );
die();
}
if (! function_exists( $_REQUEST['action'] )) {
if (! function_exists( $_REQUEST['action'] ) || !G::isUserFunction($_REQUEST['action'])) {
$res['success'] = 'failure';
$res['message'] = 'The requested action does not exist';
header( "Content-Type: application/json" );

View File

@@ -13,7 +13,7 @@ if (! isset( $_REQUEST['action'] )) {
print G::json_encode( $res );
die();
}
if (! function_exists( $_REQUEST['action'] )) {
if (! function_exists( $_REQUEST['action'] ) || !G::isUserFunction($_REQUEST['action'])) {
$res['success'] = 'failure';
$res['message'] = G::LoadTranslation( 'ID_REQUEST_ACTION_NOT_EXIST' );
print G::json_encode( $res );

View File

@@ -6,7 +6,7 @@ if (! isset( $_REQUEST['action'] )) {
print G::json_encode( $return );
die();
}
if (! function_exists( $_REQUEST['action'] )) {
if (! function_exists( $_REQUEST['action'] ) || !G::isUserFunction($_REQUEST['action'])) {
$return['success'] = 'failure';
$return['message'] = 'The requested action doesn\'t exists';
print G::json_encode( $return );

View File

@@ -463,14 +463,15 @@ onMessageContextMenu = function (grid, rowIndex, e) {
/////JS FUNCTIONS
//Do Search Function
DoSearch = function(){
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
infoGrid.store.load({params: {start : 0 , limit : pageSize }});
};
//Load Grid By Default
GridByDefault = function(){
searchText.reset();
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
infoGrid.store.load();
};