-
Notifications
You must be signed in to change notification settings - Fork 0
/
autocomplete.php
59 lines (41 loc) · 1.66 KB
/
autocomplete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");
require_once("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
$shortTableName = postvalue("shortTName");
$table = GetTableByShort( $shortTableName );
if( !$table )
exit(0);
$field = postvalue("field");
$pageType = postvalue('pageType');
$pageName = postvalue('page');
if( !Security::userHasFieldPermissions( $table, $field, $pageType, $pageName, true ) )
return;
$cipherer = new RunnerCipherer( $table );
$pSet = new ProjectSettings( $table, $pageType, $pageName );
include_once getabspath("classes/controls/EditControlsContainer.php");
$editControls = new EditControlsContainer( null, $pSet, $pageType, $cipherer );
$control = $editControls->getControl( $field );
$contextParams = array();
$contextParams["data"] = my_json_decode( postvalue('data') );
$masterTable = postvalue('masterTable');
if ( $masterTable != "" && isset($_SESSION[ $masterTable . "_masterRecordData" ]) )
{
$masterData = $_SESSION[ $masterTable . "_masterRecordData" ];
$masterControlsData = my_json_decode( postvalue('masterData') );
foreach( $masterControlsData as $mField => $mValue )
{
$masterData[ $mField ] = $mValue;
}
$contextParams["masterData"] = $masterData;
}
RunnerContext::push( new RunnerContextItem( CONTEXT_ROW, $contextParams ) );
$parentCtrlsData = my_json_decode( postvalue('parentCtrlsData') );
$isExistParent = postvalue('isExistParent');
$mode = intval( postvalue('mode') );
$respObj = array( 'success' => true, 'data' => $control->getLookupContentToReload( $isExistParent === '1', $mode, $parentCtrlsData ) );
echo printJSON( $respObj );
RunnerContext::pop();
exit();
?>