danube errorlogging, example admin module, small fixes
This commit is contained in:
parent
d91662da98
commit
24988bd00c
1
api.php
1
api.php
@ -3,6 +3,7 @@
|
|||||||
require_once '../system/autoload.inc.php'; //SYSTEM Classes
|
require_once '../system/autoload.inc.php'; //SYSTEM Classes
|
||||||
require_once 'danube/autoload.inc.php'; //Project Classes
|
require_once 'danube/autoload.inc.php'; //Project Classes
|
||||||
require_once '../system/log/register_exception_shortcut.php'; //allow ERROR() instead of \SYSTEM\LOG\ERROR()
|
require_once '../system/log/register_exception_shortcut.php'; //allow ERROR() instead of \SYSTEM\LOG\ERROR()
|
||||||
|
require_once '../system/log/register_errorhandler_dbwriter.php'; //write errors to db
|
||||||
require_once '../system/log/register_errorhandler_jsonoutput.php'; //print errors as json to caller
|
require_once '../system/log/register_errorhandler_jsonoutput.php'; //print errors as json to caller
|
||||||
|
|
||||||
require_once 'config.php';
|
require_once 'config.php';
|
||||||
|
|||||||
@ -44,8 +44,8 @@ class PageApi extends \SYSTEM\PAGE\PageClass {
|
|||||||
|
|
||||||
public static function action_developer(){
|
public static function action_developer(){
|
||||||
require_once '../system/sai/autoload.inc.php';
|
require_once '../system/sai/autoload.inc.php';
|
||||||
//require_once 'dasense/sai/autoload.inc.php';
|
require_once 'danube/sai/autoload.inc.php';
|
||||||
//require_once 'dasense/sai/register_modules.php';
|
require_once 'danube/sai/register_modules.php';
|
||||||
return new \SYSTEM\SAI\saigui();}
|
return new \SYSTEM\SAI\saigui();}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -4,7 +4,7 @@ class default_introduction extends SYSTEM\PAGE\Page {
|
|||||||
public function html(){
|
public function html(){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
|
|
||||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\DBD\locale_string::VALUE_CATEGORY_DASENSE));
|
$vars = array_merge($vars, \SYSTEM\locale::getStrings(\DBD\locale_string::VALUE_CATEGORY_DASENSE));
|
||||||
|
|
||||||
return SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_introduction/introduction.tpl'), $vars);
|
return SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PPAGE(),'default_introduction/introduction.tpl'), $vars);
|
||||||
}
|
}
|
||||||
|
|||||||
5
danube/sai/autoload.inc.php
Normal file
5
danube/sai/autoload.inc.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$autoload = SYSTEM\autoload::getInstance();
|
||||||
|
$autoload->registerFolder(dirname(__FILE__).'','');
|
||||||
|
$autoload->registerFolder(dirname(__FILE__).'/saimod_dasense_quality_management','');
|
||||||
2
danube/sai/register_modules.php
Normal file
2
danube/sai/register_modules.php
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\SAI\sai::getInstance()->register('saimod_dasense_quality_management');
|
||||||
35
danube/sai/saimod_dasense_quality_management/main.html
Normal file
35
danube/sai/saimod_dasense_quality_management/main.html
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<!--
|
||||||
|
To change this template, choose Tools | Templates
|
||||||
|
and open the template in the editor.
|
||||||
|
-->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>da_sense | Quality management</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="main">
|
||||||
|
<div class="masthead">
|
||||||
|
<h3 class="muted">Quality management</h3>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="tabbable tabs-left">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="active"><a href="#overview" data-toggle="tab">Locality</a></li>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="overview">
|
||||||
|
<form class="navbar-search pull-left">
|
||||||
|
<input type="text" class="search-query" placeholder="Search" data-provide="typeahead" id="search">
|
||||||
|
</form>
|
||||||
|
<iframe src="http://webtechdemo.de/PolygonTest/#" style="width: 100%; min-height: 800px; overflow:hidden; border: 0px; margin-top: 10px"></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
function init_saimod_dasense_quality_management(){
|
||||||
|
|
||||||
|
// auto-completion stuff
|
||||||
|
$('#search').typeahead({
|
||||||
|
source: function (query, process) {
|
||||||
|
return $.get('./api.php?call=analysis&action=data&get=locality&by=name', { query: query, limit: 8, options: {flag:0} }, function (data) {
|
||||||
|
//console.log(data);
|
||||||
|
var source = new Backbone.Collection(data.result).models;
|
||||||
|
|
||||||
|
// passing an array of objects
|
||||||
|
process( _.map(source, function (locality) {
|
||||||
|
return {
|
||||||
|
id: locality.get('localityid'),
|
||||||
|
full_name: locality.get('de_name') + ' (' + locality.get('en_name') + ')',
|
||||||
|
// these functions allows Bootstrap typehead to use this item in places where it was expecting a string
|
||||||
|
toString: function () {
|
||||||
|
return JSON.stringify(this);
|
||||||
|
},
|
||||||
|
toLowerCase: function () {
|
||||||
|
return this.full_name.toLowerCase();
|
||||||
|
},
|
||||||
|
indexOf: function () {
|
||||||
|
return String.prototype.indexOf.apply(this.full_name, arguments);
|
||||||
|
},
|
||||||
|
replace: function () {
|
||||||
|
return String.prototype.replace.apply(this.full_name, arguments);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
display: 'full_name',
|
||||||
|
updater: function(itemString){
|
||||||
|
var item = JSON.parse(itemString);
|
||||||
|
refreshMap(item.id);
|
||||||
|
return item.full_name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshMap(localityID){
|
||||||
|
$.get('./api.php?call=analysis&action=data&get=locality&by=id', { locality_id: localityID, include_geometry: 1, include_children: 1 }, function (data) {
|
||||||
|
console.log(data);
|
||||||
|
// @todo: refresh map -> current locality + children geometries
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function destroy(){}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
class saimod_dasense_quality_management extends \SYSTEM\SAI\SaiModule {
|
||||||
|
public static function html_content(){
|
||||||
|
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.html', array());}
|
||||||
|
public static function html_li_menu(){return '<li><a href="#" id="saimod_dasense_quality_management">Quality Management</a></li><li class="divider"></li>';}
|
||||||
|
public static function right_public(){return false;}
|
||||||
|
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||||
|
public static function src_js(){return \SYSTEM\LOG\JsonResult::toString(
|
||||||
|
array( \SYSTEM\WEBPATH(new \PSAI(),'saimod_dasense_quality_management/qualitymanagement.js')
|
||||||
|
));}
|
||||||
|
public static function src_css(){}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@
|
|||||||
require_once '../system/autoload.inc.php'; //SYSTEM Classes
|
require_once '../system/autoload.inc.php'; //SYSTEM Classes
|
||||||
require_once 'danube/autoload.inc.php'; //Project Classes
|
require_once 'danube/autoload.inc.php'; //Project Classes
|
||||||
require_once '../system/log/register_exception_shortcut.php'; //allow ERROR() instead of \SYSTEM\LOG\ERROR()
|
require_once '../system/log/register_exception_shortcut.php'; //allow ERROR() instead of \SYSTEM\LOG\ERROR()
|
||||||
|
require_once '../system/log/register_errorhandler_dbwriter.php'; //write errors to db
|
||||||
require_once '../system/log/register_errorhandler_jsonoutput.php'; //print errors as json to caller
|
require_once '../system/log/register_errorhandler_jsonoutput.php'; //print errors as json to caller
|
||||||
|
|
||||||
require_once 'config.php';
|
require_once 'config.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user