-
Notifications
You must be signed in to change notification settings - Fork 1
/
Export_and_Import_Rooms_list.php
161 lines (130 loc) · 4.32 KB
/
Export_and_Import_Rooms_list.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");
$requestTable = "Export and Import Rooms";
$requestPage = "list";
require_once("include/dbcommon.php");
add_nocache_headers();
require_once('include/xtempl.php');
require_once("classes/searchpanel.php");
require_once("classes/searchcontrol.php");
require_once("classes/searchclause.php");
require_once("classes/panelsearchcontrol.php");
require_once("include/Export_and_Import_Rooms_variables.php");
require_once('classes/listpage.php');
require_once('include/lookuplinks.php');
// Check whether the page was called as a part of Lookup wizard - List page with search.
// Verify the eligibility of such a call.
InitLookupLinks();
if( !ListPage::processListPageSecurity( $strTableName ) )
return;
if( ListPage::processSaveParams( $strTableName ) )
return;
$options = array();
//array of params for classes
// Include necessary files in accordance with the page displaying mode
$mode = ListPage::readListModeFromRequest();
if( $mode == LIST_SIMPLE )
{
require_once('classes/listpage_simple.php');
require_once("classes/searchpanelsimple.php");
}
elseif( $mode == LIST_AJAX )
{
require_once('classes/listpage_simple.php');
require_once('classes/listpage_ajax.php');
require_once("classes/searchpanelsimple.php");
}
elseif( $mode == LIST_LOOKUP )
{
require_once('classes/listpage_embed.php');
require_once('classes/listpage_lookup.php');
require_once("classes/searchpanellookup.php");
$options["mainTable"] = postvalue("table");
$options["mainField"] = postvalue("field");
$options["mainPageType"] = postvalue("pageType");
$options["mainRecordData"] = my_json_decode( postvalue('data') );
$options["mainRecordMasterTable"] = postvalue('mainRecordMasterTable');
if( postvalue("parentsExist") )
$options["parentCtrlsData"] = my_json_decode( postvalue("parentCtrlsData") );
}
elseif( $mode == LIST_POPUPDETAILS )
{
require_once('classes/listpage_embed.php');
require_once('classes/listpage_dpinline.php');
require_once('classes/listpage_dppopup.php');
}
elseif( $mode == LIST_DETAILS )
{
require_once('classes/listpage_embed.php');
require_once('classes/listpage_dpinline.php');
require_once('classes/listpage_dplist.php');
}
elseif( $mode == LIST_DASHDETAILS )
{
require_once('classes/listpage_embed.php');
require_once('classes/listpage_dashboard.php');
require_once('classes/listpage_dpdash.php');
}
elseif( $mode == LIST_DASHBOARD )
{
require_once('classes/listpage_embed.php');
require_once('classes/listpage_dashboard.php');
}
elseif( $mode == MAP_DASHBOARD )
{
require_once('classes/listpage_embed.php');
require_once('classes/listpage_dashboard.php');
require_once('classes/map_dashboard.php');
}
$xt = new Xtempl( $mode != LIST_SIMPLE ); //#9607 1. Temporary fix
$options["pageName"] = postvalue("page");
$options["pageType"] = PAGE_LIST;
$options["id"] = postvalue_number("id") ? postvalue_number("id") : 1;
$options["flyId"] = postvalue("recordId") + 0;
$options["mode"] = $mode;
$options['xt'] = &$xt;
$options['masterPageType'] = postvalue("masterpagetype");
$options["masterTable"] = postvalue("mastertable");
$options["masterPage"] = postvalue("masterpage");
$options["masterId"] = postvalue("masterid");
$options["firstTime"] = postvalue("firsttime");
$options["sortBy"] = postvalue("sortby");
if( $mode == LIST_DASHBOARD && postvalue("nodata") && strlen($options["masterTable"]) )
$options["showNoData"] = true;
if( $mode != LIST_LOOKUP )
{
$options["dashElementName"] = postvalue("dashelement");
$options["dashTName"] = postvalue("table");
}
if( postvalue("mapRefresh") )
{
$options["mapRefresh"] = true;
$options["vpCoordinates"] = my_json_decode( postvalue("vpCoordinates") );
}
$i = 1;
while(isset($_REQUEST["masterkey".$i]))
{
if($i == 1)
{
$options["masterKeysReq"] = array();
}
$options["masterKeysReq"][$i] = $_REQUEST["masterkey".$i];
$i++;
}
// Create $pageObject
$pageObject = ListPage::createListPage($strTableName, $options);
if( $pageObject->processSaveSearch() )
exit();
$gQuery->ReplaceFieldsWithDummies( $pageObject->getNotListBlobFieldsIndices() );
if( $mode != LIST_DETAILS && $mode != MAP_DASHBOARD && $mode != LIST_DASHBOARD )
{
//maps
}
unset($_SESSION["message_add"]);
unset($_SESSION["message_edit"]);
// prepare code for build page
$pageObject->prepareForBuildPage();
// show page depends of mode
$pageObject->showPage();
?>