-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.php
584 lines (467 loc) · 26.1 KB
/
index.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
<?php
/**
* Main script initializing Heurist layout and performing initial search of parameter q is defined
*
* @package Heurist academic knowledge management system
* @link https://HeuristNetwork.org
* @copyright (C) 2005-2023 University of Sydney, (C) 2024 onwards Heurist Network
* @author Artem Osmakov <[email protected]>
* @license https://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version 4.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at https://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
use hserv\utilities\USystem;
use hserv\utilities\USanitize;
use hserv\controller\FrontController;
require_once dirname(__FILE__).'/autoload.php';
$isLocalHost = isLocalHost();
//validate that instance is ok and database is accessible
if( @$_REQUEST['isalive']==1){
$system = new hserv\System();
$is_inited = $system->init(@$_REQUEST['db'], true, false);
if($is_inited){
$mysqli = $system->getMysqli();
$mysqli->close();
print 'ok';
}else{
$error = $system->getError();
print 'error: '.@$error['message'];
}
exit;
}elseif( @$_REQUEST['recID'] || @$_REQUEST['recid'] || array_key_exists('website', $_REQUEST) || array_key_exists('embed', $_REQUEST)){
//redirection for CMS
$recid = 0;
if(@$_REQUEST['recID']){
$recid = $_REQUEST['recID'];
}elseif(@$_REQUEST['recid']){
$recid = $_REQUEST['recid'];
}elseif(@$_REQUEST['id']){
$recid = $_REQUEST['id'];
}
if(strpos($recid, '-')>0){
list($database_id, $recid) = explode('-', $recid, 2);
$database_id = intval($database_id);
$recid = intval($database_id).'-'.intval($recid);
}else{
$recid = intval($recid);
}
if(@$_REQUEST['fmt']){
$format = filter_var($_REQUEST['fmt'], FILTER_SANITIZE_STRING);
}elseif(@$_REQUEST['format']){
$format = filter_var($_REQUEST['format'], FILTER_SANITIZE_STRING);
}elseif (array_key_exists('website', $_REQUEST) || array_key_exists('embed', $_REQUEST)
|| (array_key_exists('field', $_REQUEST) && $_REQUEST['field']>0) )
{
$format = 'website';
if(@$_REQUEST['ver']==3){
$controller = new FrontController(isset($params)?$params:null);
$controller->run();
}else{
//embed - when heurist is run on page on non-heurist server
if(array_key_exists('embed', $_REQUEST)){
//require_once dirname(__FILE__).'/hserv/System.php';
define('PDIR', HEURIST_INDEX_BASE_URL);
}else{
if(!defined('PDIR')) {define('PDIR','');}
}
include_once dirname(__FILE__).'/hclient/widgets/cms/websiteRecord.php';
}
exit;
// old way to retrieve the content of particular page
//if(intval(@$_REQUEST['field'])>0){
// $redirect = $redirect.'&field='.intval($_REQUEST['field']);
//}
}elseif (array_key_exists('field', $_REQUEST) && intval($_REQUEST['field'])>0) {
$format = 'web&field='.intval($_REQUEST['field']);
}else{
$format = 'xml';
}
redirectURL('redirects/resolver.php?db='.@$_REQUEST['db'].'&recID='.$recid.'&fmt='.$format
.(@$_REQUEST['noheader']?'&noheader=1':''));
return;
}elseif (@$_REQUEST['ent']){
//to avoid "Open Redirect" security warning
parse_str($_SERVER['QUERY_STRING'], $vars);
$query_string = http_build_query($vars);
redirectURL('hserv/controller/api.php?'.$query_string);
return;
}elseif (@$_REQUEST['rty'] || @$_REQUEST['dty'] || @$_REQUEST['trm']){
//download xml template for given db defintion
if(@$_REQUEST['rty']) {$s = 'rty='.$_REQUEST['rty'];}
elseif(@$_REQUEST['dty']) {$s = 'dty='.$_REQUEST['dty'];}
elseif(@$_REQUEST['trm']) {$s = 'trm='.$_REQUEST['trm'];}
redirectURL('redirects/resolver.php?db='.@$_REQUEST['db'].'&'.$s);
return;
}elseif (@$_REQUEST['controller']=='ReportController' || array_key_exists('template',$_REQUEST) || array_key_exists('template_id',$_REQUEST)
|| @$_REQUEST['controller']=='ImportAnnotations'){
//execute smarty template, $_REQUEST may be composed in resolver.php
$controller = new FrontController($_REQUEST);
$controller->run();
exit;
}elseif (array_key_exists('file',$_REQUEST) || array_key_exists('thumb',$_REQUEST) ||
array_key_exists('icon',$_REQUEST)){
if(array_key_exists('icon',$_REQUEST))
{
//download entity icon or thumbnail
$script_name = 'hserv/controller/fileGet.php';
}else {
//download file, thumb or remote url for recUploadedFiles
$script_name = 'hserv/controller/fileDownload.php';
}
//to avoid "Open Redirect" security warning
parse_str($_SERVER['QUERY_STRING'], $vars);
$query_string = http_build_query($vars);
header( 'Location: '.$script_name.'?'.$query_string );
return;
}elseif (@$_REQUEST['asset']){ //only from documentation/context_help - download localized help or documentation
$params = USanitize::sanitizeInputArray();
$name = $params['asset'];
$part = strstr($name,'#');
if($part){
$name = strstr($name,'#');
}
//default ext is html
$extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
if(!$extension){
$name = $name . '.htm';
}
$asset_folder = 'documentation/context_help/';
$locale = $params['lang'];//locale
if($locale && preg_match('/^[A-Za-z]{3}$/', $locale)){
$locale = strtolower($locale);
$locale = ($locale=='eng')?'' :($locale.'/');
}else{
$locale = '';
}
$asset = $asset_folder.$locale.basename($name);
if(!file_exists($asset)){
//without locale - default is English
$locale = '';
$asset = $asset_folder.basename($name);
}
if(file_exists($asset_folder.$name)){
//download
header( 'Location: '.$asset.' '.$part );
return;
}else{
exit('Asset not found: '.htmlspecialchars($name));
}
}elseif (@$_REQUEST['logo']){
list($host_logo, $host_url, $mime_type) = USystem::getHostLogoAndUrl(false);
if($host_logo!=null && file_exists($host_logo)){
header('Content-type: image/'.$mime_type);
readfile($host_logo);
return;
}
}elseif(@$_REQUEST['disclaimer']){
// disclaimers are stored in either parent/root directory or movetoparent (backup)
$params = USanitize::sanitizeInputArray();
$name = $_REQUEST['disclaimer'];
$extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
if(empty($extension)){
$name .= '.html';
}
$file = '../' . basename($name);
$backupFile = 'movetoparent/' . basename($name);
if(!file_exists($file)){
$file = $backupFile;
}
if(file_exists($file)){
header("Location: {$file}");
return;
}else{
exit('Document not found: ' . htmlspecialchars($name));
}
}
define('IS_INDEX_PAGE',true);
if(!defined('PDIR')) {define('PDIR','');}
require_once dirname(__FILE__).'/hclient/framecontent/initPage.php';
?>
<!-- it is needed in preference dialog -->
<script type="text/javascript" src="<?php echo PDIR;?>external/jquery.widgets/jquery.layout.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>external/jquery.widgets/jquery.ui-contextmenu.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>external/jquery.widgets/ui.tabs.paging.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>external/jquery.widgets/evol.colorpicker.js" charset="utf-8"></script>
<link href="<?php echo PDIR;?>external/jquery.widgets/evol.colorpicker.css" rel="stylesheet" type="text/css">
<!-- script type="text/javascript" src="ext/js/moment.min.js"></script
<script type="text/javascript" src="ext/js/date.format.js"></script>
-->
<!-- array of possible layouts -->
<script type="text/javascript" src="<?php echo PDIR;?>layout_default.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/baseAction.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/baseConfig.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/database/dbAction.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/record/recordAction.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/record/recordAccess.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/record/recordAdd.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/record/recordAddLink.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/record/recordExportCSV.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/record/recordTemplate.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/report/reportViewer.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/report/reportEditor.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/recordListExt.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/search_faceted.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/search_faceted_wiz.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/app_timemap.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/search.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/searchByEntity.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/searchBuilder.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/searchBuilderItem.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/searchBuilderSort.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/core/ActionHandler.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/cpanel/controlPanel.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/cpanel/buttonsMenu.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/cpanel/slidersMenu.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/cpanel/navigation.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/svs_edit.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/search/svs_list.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/resultList.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/resultListMenu.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/resultListCollection.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/resultListDataTable.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/staticPage.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/connections.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/profile/profile_login.js"></script>
<!-- edit entity -->
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/selectFile.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/selectMultiValues.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/selectFolders.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/editing_input.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/editing2.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/editing_exts.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/editTheme.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/cms/CmsManager.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/configEntity.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageEntity.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/searchEntity.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefGroups.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageRecords.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/searchRecords.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageRecUploadedFiles.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/searchRecUploadedFiles.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/viewers/mediaViewer.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageSysDashboard.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/searchSysDashboard.js"></script>
<!-- autoload
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefRecStructure.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefDetailTypes.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/searchDefDetailTypes.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefRecTypes.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/searchDefRecTypes.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefRecTypeGroups.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefTerms.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/entity/manageDefVocabularyGroups.js"></script>
-->
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/admin/importStructure.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>viewers/map/mapPublish.js"></script>
<script type="text/javascript" src="<?php echo PDIR;?>hclient/framecontent/publishDialog.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo PDIR;?>external/jquery.fancybox/jquery.fancybox.css" />
<script type="text/javascript" src="<?php echo PDIR;?>external/jquery.fancybox/jquery.fancybox.js"></script>
<!-- loaded dynamically in editing.js
<script type="text/javascript" src="<?php echo PDIR;?>external/tinymce5/tinymce.min.js"></script>
-->
<script type="text/javascript" src="<?php echo PDIR;?>hclient/widgets/editing/editorCodeMirror.js"></script>
<link rel="stylesheet" href="<?php echo PDIR;?>external/codemirror-5.61.0/lib/codemirror.css">
<!-- os, browser detector -->
<script type="text/javascript" src="<?php echo PDIR;?>external/js/platform.js"></script>
<?php
if(false && $isLocalHost){
?>
<link rel="stylesheet" type="text/css" href="<?php echo PDIR;?>external/js/datatable/datatables.min.css"/>
<script type="text/javascript" src="<?php echo PDIR;?>external/js/datatable/datatables.min.js"></script>
<?php
}else{
?>
<link href="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-2.1.6/b-3.1.2/b-html5-3.1.2/datatables.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js" integrity="sha384-VFQrHzqBh5qiJIU0uGU5CIW3+OWpdGGJM9LBnGbuIH2mkICcFZ7lPd/AAtI7SNf7" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js" integrity="sha384-/RlQG9uf0M2vcTw3CX7fbqgbj/h8wKxw7C3zu9/GxcBPRKOEcESxaxufwRXqzq6n" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-2.1.6/b-3.1.2/b-html5-3.1.2/datatables.min.js" integrity="sha384-naBmfwninIkPENReA9wreX7eukcSAc9xLJ8Kov28yBxFr8U5dzgoed1DHwFAef4y" crossorigin="anonymous"></script>
<?php
}
?>
<script src="<?php echo PDIR;?>hclient/widgets/admin/repositoryConfig.js"></script>
<script type="text/javascript">
function onPageInit(success){
if(!success) {return;}
$(document).on('focusin', function(e) {
if ($(e.target).closest(".mce-window, .moxman-window").length) {
e.stopImmediatePropagation();
}
});
<?php
/*
if(@$_SERVER['REQUEST_METHOD']=='POST'){
$req_params = filter_input_array(INPUT_POST);
print 'window.hWin.HAPI4.postparams='.json_encode($req_params).';';
print 'console.log(window.hWin.HAPI4.postparams)';
}
*/
?>
//
// cfg_widgets and cfg_layouts are defined in layout_default.js
//
window.hWin.HAPI4.LayoutMgr.init(cfg_widgets, cfg_layouts);
if($( "#heurist-about" ).dialog('instance')){
$( "#heurist-about" ).dialog("close");
}
<?php
//returns total records in db and counts of active entries in dashboard
list($db_total_records, $db_has_active_dashboard, $db_workset_count) = $system->getTotalRecordsAndDashboard();
echo 'window.hWin.HAPI4.sysinfo.db_total_records = '.$db_total_records.';';
echo 'window.hWin.HAPI4.sysinfo.db_has_active_dashboard = '.$db_has_active_dashboard.';';
echo 'window.hWin.HAPI4.sysinfo.db_workset_count = '.$db_workset_count.';';
?>
var lt = window.hWin.HAPI4.sysinfo['layout'];
window.hWin.HAPI4.is_publish_mode = (lt=='WebSearch'); //deprecated
//
// init layout
//
window.hWin.HAPI4.LayoutMgr.appInitAll( window.hWin.HAPI4.sysinfo['layout'], "#layout_panes");
//2024-12-08 const layout_cfg = window.hWin.HAPI4.LayoutMgr2.layoutGetById('H6Default2');
//2024-12-08 window.hWin.HAPI4.LayoutMgr2.layoutInit(layout_cfg, "#layout_panes" );
window.hWin.HAPI4.SystemMgr.matomoTrackInit('adm');
onInitCompleted_PerformSearch();
}
//
// init about dialog
//
function onAboutInit(){
//definition of ABOUT dialog, called from Help > About, see content below
$( "#heurist-about" ).dialog(
{
autoOpen: true,
height: 180,
width: 450,
modal: true,
resizable: false,
draggable: false,
create:function(){
$(this).parent().find('.ui-dialog-titlebar').addClass('fullmode').hide();
}
/*hide: {
effect: "puff",
duration: 500
}*/
}
);
}
//
// Performs inital search: parameters from request or from user preferences
//
function onInitCompleted_PerformSearch(){
if(!window.hWin.HAPI4.is_publish_mode)
{
if( window.hWin.HAPI4.SystemMgr.versionCheck() ) {
//version is old
return;
}
var editRecID = window.hWin.HEURIST4.util.getUrlParameter('edit_id', window.location.search);
if(editRecID>0){
//edit record
window.hWin.HEURIST4.ui.openRecordEdit(editRecID, null);
}else
if(window.hWin.HEURIST4.util.getUrlParameter('rec_rectype', window.location.search) ||
(window.hWin.HEURIST4.util.getUrlParameter('t', window.location.search) &&
window.hWin.HEURIST4.util.getUrlParameter('u', window.location.search)))
{
//add new record from bookmarklet - see recordEdit.php as alternative, it opens record editor in separate window
var url = window.hWin.HEURIST4.util.getUrlParameter('u', window.location.search);
var new_record_params = {
RecTypeID: window.hWin.HEURIST4.util.getUrlParameter('rec_rectype', window.location.search)
|| window.hWin.HEURIST4.util.getUrlParameter('rt', window.location.search),
OwnerUGrpID: window.hWin.HEURIST4.util.getUrlParameter('rec_owner', window.location.search),
NonOwnerVisibility: window.hWin.HEURIST4.util.getUrlParameter('rec_visibility', window.location.search),
tag: window.hWin.HEURIST4.util.getUrlParameter('tag', window.location.search)
||window.hWin.HEURIST4.util.getUrlParameter('k', window.location.search),
Title: window.hWin.HEURIST4.util.getUrlParameter('t', window.location.search),
URL: url,
ScratchPad: window.hWin.HEURIST4.util.getUrlParameter('d', window.location.search)
};
//default rectype for bookmarklet addition
if(url && !(new_record_params['RecTypeID']>0)){
if(window.hWin.HAPI4.sysinfo['dbconst']['RT_INTERNET_BOOKMARK']>0) {
new_record_params['RecTypeID'] = window.hWin.HAPI4.sysinfo['dbconst']['RT_INTERNET_BOOKMARK'];
}else if(window.hWin.HAPI4.sysinfo['dbconst']['RT_NOTE']>0) {
new_record_params['RecTypeID'] = window.hWin.HAPI4.sysinfo['dbconst']['RT_NOTE'];
}
}
//add new record
window.hWin.HEURIST4.ui.openRecordEdit(-1, null, {new_record_params:new_record_params});
}else if(window.hWin.HAPI4.sysinfo.db_has_active_dashboard>0) {
/*
var _supress_dashboard = (window.hWin.HEURIST4.util.getUrlParameter('cms', window.hWin.location.search)>0);
if(_supress_dashboard!==true){
//show dashboard (another place - _performInitialSearch in controlPanel)
var prefs = window.hWin.HAPI4.get_prefs_def('prefs_sysDashboard', {show_on_startup:1, show_as_ribbon:1});
if(prefs.show_on_startup==1 && prefs.show_as_ribbon!=1)
{
var _keep = window.hWin.HAPI4.sysinfo.db_has_active_dashboard;
window.hWin.HAPI4.sysinfo.db_has_active_dashboard=0;
$(window.hWin.document).trigger(window.hWin.HAPI4.Event.ON_PREFERENCES_CHANGE);//hide button
window.hWin.HEURIST4.ui.showEntityDialog('sysDashboard',
{onClose:function(){
$(window.hWin.document).trigger(window.hWin.HAPI4.Event.ON_PREFERENCES_CHANGE);
}});
setTimeout(function(){window.hWin.HAPI4.sysinfo.db_has_active_dashboard = _keep;},1000);
}
}
*/
}
$('body').css({'overflow':'hidden'});
}
$(document).trigger(window.hWin.HAPI4.Event.ON_SYSTEM_INITED, []);
var os = platform?platform.os.family.toLowerCase():'';
if(os.indexOf('android')>=0 || os.indexOf('ios')>=0){ //test || os.indexOf('win')>=0
window.hWin.HEURIST4.msg.showElementAsDialog(
{element:document.getElementById('heurist-platform-warning'),
width:480, height:220,
title: 'Welcome',
buttons:{'Close':function(){ $(this).dialog( 'close' )} } });
}else if (window.hWin.HEURIST4.util.isIE() ) {
window.hWin.HEURIST4.msg.showMsgDlg('Heurist is not fully supported in Internet Explorer. Please use Chrome, Firefox or Edge.');
}else if (platform.description.toLowerCase().indexOf('safari')>=0){
window.hWin.HEURIST4.msg.showElementAsDialog(
{element:document.getElementById('heurist-safari-warning'),
width:480, height:260,
title: 'Safari browser support',
buttons:{'Close':function(){ $(this).dialog( 'close' )} } });
}
} //onInitCompleted_PerformSearch
</script>
<?php
USystem::insertLogScript();
?>
</head>
<body style="background-color:#c9c9c9;">
<div id="layout_panes">
</div>
<div id="heurist-about" style="width:300px;display:none;">
<div class='logo'></div>
<h4>Heurist Academic Knowledge Management System</h4>
<p style="margin-top:1em;">version <?=HEURIST_VERSION?></p>
<p style="margin-top: 1em;">Copyright (C) 2005-2023 <a href="https://sydney.edu.au/arts/" style="outline:none;" target="_blank" rel="noopener">University of Sydney</a></p>
</div>
<div id="heurist-platform-warning" style="display:none;">
<p style="padding:10px">Heurist is designed primarily for use with a keyboard and mouse. Tablets are not fully supported at this time, except for data collection on Android (see FAIMS in the Help system).</p>
<p style="padding:10px">Please <?php echo CONTACT_HEURIST_TEAM;?> for further information or to express an interest in a tablet version</p>
</div>
<div id="heurist-safari-warning" style="display:none;">
<p style="padding:10px">
Heurist is not fully supported in Safari.
Sorry, we no longer support Apple's Safari browser which was discontinued on Windows over a decade ago due to the appearance of widely used free cross-platform browsers such as Chrome and Firefox.
</p>
<p style="padding:10px">
Please download Chrome or Firefox to use with Heurist (and perhaps with your other applications).
</p>
</div>
<div id="heurist-dialog">
</div>
</body>
</html>