/
inc_ajax_details.php
122 lines (93 loc) · 3.88 KB
/
inc_ajax_details.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
// to be included into ajax_actiondetails.php (ajax_details.php for older versions)
if ($_SERVER["REQUEST_METHOD"]=="POST")
$arrIn = $_POST;
else
$arrIn = $_GET;
$DataAction = $arrIn[$intra->conf['dataReadKey']];
switch ($DataAction){
case 'getSessionData':
$intra->json('ok', '', array('session'=>$_SESSION, 'conf'=>$intra->conf, 'arrUsrData'=>$intra->arrUsrData));
case 'getCurrentUserInfo':
echo $intra->getCurrentUserInfo();
die();
case 'getMenu':
header("Content-Type: text/html; charset=UTF-8");
echo $intra->menu();
die();
case 'getTopLevelMenu':
echo $intra->topLevelMenu($eiseIntraTopLevelMenu);
die();
case 'getBookmarks':
include eiseIntraAbsolutePath."inc_entity_item_form.php";
try {
eiseEntityItemForm::getBookmarks();
} catch (Exception $e){}
die();
case 'getMessages':
include eiseIntraAbsolutePath."inc_entity_item_form.php";
try {
$o = new eiseEntityItemForm($oSQL, $intra, $arrIn['entID'], $arrIn['entItemID']);
$arrMsg = $o->getMessages();
$intra->json('ok', $intra->translate('Messages: ').count($arrMsg), $arrMsg);
} catch (Exception $e){
$intra->json('error', $e->getMessage());
}
case 'getFiles':
include eiseIntraAbsolutePath."inc_entity_item_form.php";
try {
$o = new eiseEntityItemForm($oSQL, $intra, $arrIn['entID'], $arrIn['entItemID']);
$arrFIL = $o->getFiles();
$intra->json('ok', $intra->translate('Files: ').count($arrFIL), $arrFIL);
} catch (Exception $e){
$intra->json('error', $e->getMessage());
}
case 'getActionLog':
include eiseIntraAbsolutePath."inc_item_traceable.php";
try {
$o = new eiseItemTraceable($arrIn['entItemID'], ['entID'=>$arrIn['entID']]);
$arrACL = $o->getActionLog();
$intra->json('ok', $intra->translate('Events: ').count($arrACL), $arrACL);
} catch (Exception $e){
$intra->json('error', $e->getMessage());
}
case 'getActionLog_':
include eiseIntraAbsolutePath."inc_entity_item_form.php";
try {
$o = new eiseEntityItemForm($oSQL, $intra, $arrIn['entID'], $arrIn['entItemID']);
$arrACL = $o->getActionLog();
$intra->json('ok', $intra->translate('Events: ').count($arrACL), $arrACL);
} catch (Exception $e){
$intra->json('error', $e->getMessage());
}
case 'getActionDetails':
default: // default is for backward-compatibility
include eiseIntraAbsolutePath."inc_entity.php";
$arrRet = Array();
// get action details
if (isset($arrIn["actID"])){
$sqlAct = "SELECT * FROM stbl_action WHERE actID=".$oSQL->e($arrIn["actID"]);
} else
if (isset($arrIn["aclGUID"])){
$sqlAct = "SELECT * FROM stbl_action_log INNER JOIN stbl_action ON aclActionID = actID WHERE aclGUID=".$oSQL->e($arrIn["aclGUID"]);
}
if (!$sqlAct){
echo json_encode(Array("ERROR"=>"No criteria"));
die();
}
try {
$rsAct = $oSQL->q($sqlAct);
$rwAct = $oSQL->f($rsAct);
} catch(Exception $e){
echo json_encode(Array("ERROR"=>$e->getMessage));
die();
}
$entID = $rwAct['actEntityID'] ? $rwAct['actEntityID'] : $arrIn['entID'];
$oEnt = new eiseEntity($oSQL, $intra, $entID);
echo json_encode(Array("acl"=>$rwAct
, 'act'=>$oEnt->conf['ACT'][$rwAct['actID']]
, 'atr'=>$oEnt->conf['ATR']
));
die();
}
?>