Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream-development
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jun 21, 2015
2 parents 42bb0f8 + aae12d7 commit e71f79c
Show file tree
Hide file tree
Showing 53 changed files with 382 additions and 961 deletions.
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -15,7 +15,8 @@
"doctrine/dbal": "2.5.*",
"andig/dbcopy": "dev-master",
"symfony/console": "2.6.*",
"symfony/http-kernel": "2.6.*"
"symfony/http-kernel": "2.6.*",
"symfony/http-foundation": "2.6.*"
},
"require-dev": {
"phpunit/phpunit": "4.4.*"
Expand Down
Binary file added htdocs/frontend/icons/android-chrome-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/android-chrome-192x192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/android-chrome-36x36.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/android-chrome-48x48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/android-chrome-72x72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/android-chrome-96x96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/apple-touch-icon-57x57.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/apple-touch-icon-60x60.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/apple-touch-icon-72x72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/apple-touch-icon-76x76.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions htdocs/frontend/icons/browserconfig.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/mstile-70x70.png"/>
<square150x150logo src="/mstile-150x150.png"/>
<square310x310logo src="/mstile-310x310.png"/>
<wide310x150logo src="/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added htdocs/frontend/icons/favicon-16x16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/favicon-32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/favicon-96x96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions htdocs/frontend/icons/manifest.json
@@ -0,0 +1,41 @@
{
"name": "Volkszaehler",
"icons": [
{
"src": "\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added htdocs/frontend/icons/mstile-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/mstile-150x150.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/mstile-310x150.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/mstile-310x310.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added htdocs/frontend/icons/mstile-70x70.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 22 additions & 5 deletions htdocs/frontend/index.html
Expand Up @@ -6,10 +6,27 @@
<title>volkszaehler.org - web frontend</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico" />
<link rel="apple-touch-icon-precomposed" href="../favicon.ico" />
<!-- to support android versions newer than 2.3 -->
<link rel="apple-touch-icon" href="../favicon.ico" />
<!-- icons courtesy to http://realfavicongenerator.net -->
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="icons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="icons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="icons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="icons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="icons/manifest.json">
<link rel="shortcut icon" href="icons/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="icons/mstile-144x144.png">
<meta name="msapplication-config" content="icons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- to support IE 9+ in intranet environments -->
Expand Down Expand Up @@ -73,7 +90,7 @@ <h2 id="title"></h2>
<select class="icons">
<option value="default" selected="selected" class="icon-export">Export...</option>
<option value="permalink" class="icon-link">Permalink</option>
<option value="png" class="icon-image" disabled="disabled">Snapshot</option>
<option value="png" class="icon-image">Snapshot</option>
<option value="csv" class="icon-table">CSV</option>
<option value="xml" class="icon-xml">XML</option>
<option value="json" class="icon-json">JSON</option>
Expand Down
4 changes: 2 additions & 2 deletions htdocs/frontend/javascripts/functions.js
Expand Up @@ -187,7 +187,7 @@ vz.parseUrlParams = function() {

case 'from':
case 'to':
// disabled automatic refresh
// disable automatic refresh
vz.options.refresh = false;
// ms or speaking timestamp
var ts = (/^-?[0-9]+$/.test(vars[key])) ? parseInt(vars[key]) : new Date(vars[key]).getTime();
Expand All @@ -201,7 +201,7 @@ vz.parseUrlParams = function() {
vz.options[key] = vars[key];
break;

case 'options':
case 'options': // data load options
vz.options.options = vars[key];
break;
}
Expand Down
4 changes: 0 additions & 4 deletions htdocs/frontend/javascripts/init.js
Expand Up @@ -123,10 +123,6 @@ $(document).ready(function() {

// chaining ajax request with jquery deferred object
vz.capabilities.load().done(function() {
if (vz.capabilities.formats.contains('png')) {
$('#export option[value=png]').removeAttr('disabled');
}

vz.entities.loadDetails().done(function() {
if (vz.entities.length === 0) {
vz.wui.dialogs.init();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/frontend/javascripts/options.js
Expand Up @@ -28,7 +28,7 @@ vz.options = {
language: 'de',
precision: 2, // TODO update from middleware capabilities?
tuples: null, // automatically determined by plot size
refresh: false,
refresh: true, // update chart if zoomed to current timestamp
totalsInterval: 300, // update interval for consumption is retrieved for each channel where initialconsumption > 0
shortenLongTypes: false, // show shorter type names in table
minTimeout: 2000, // minimum refresh time in ms
Expand Down
2 changes: 1 addition & 1 deletion htdocs/frontend/javascripts/wui.js
Expand Up @@ -96,8 +96,8 @@ vz.wui.init = function() {
$('#controls').buttonset();

// auto refresh
$('#refresh').prop('checked', vz.options.refresh);
if (vz.options.refresh) {
$('#refresh').prop('checked', true);
vz.wui.tmaxnow = true;
vz.wui.setTimeout();
}
Expand Down
12 changes: 7 additions & 5 deletions lib/Volkszaehler/Controller/CapabilitiesController.php
Expand Up @@ -23,6 +23,7 @@

namespace Volkszaehler\Controller;

use Volkszaehler\Router;
use Volkszaehler\Model;
use Volkszaehler\Util;
use Volkszaehler\View;
Expand Down Expand Up @@ -94,17 +95,18 @@ public function get($section = NULL) {
}

if (is_null($section) || $section == 'formats') {
$capabilities['formats'] = array_keys(\Volkszaehler\Router::$viewMapping);
$capabilities['formats'] = array_keys(Router::$viewMapping);
}

if (is_null($section) || $section == 'contexts') {
$capabilities['contexts'] = array_keys(\Volkszaehler\Router::$controllerMapping);
$capabilities['contexts'] = array_keys(Router::$controllerMapping);
}

if (is_null($section) || $section == 'definitions') {
if (!is_null($section)) { // only caching when we don't request dynamic informations
$this->view->setCaching('expires', time()+2*7*24*60*60); // cache for 2 weeks
}
// unresolved artifact from Symfony migration
// if (!is_null($section)) { // only caching when we don't request dynamic informations
// $this->view->setCaching('expires', time()+2*7*24*60*60); // cache for 2 weeks
// }

$capabilities['definitions']['entities'] = Definition\EntityDefinition::get();
$capabilities['definitions']['properties'] = Definition\PropertyDefinition::get();
Expand Down
3 changes: 3 additions & 0 deletions lib/Volkszaehler/Controller/Controller.php
Expand Up @@ -30,7 +30,10 @@
* Controller superclass for all controllers
*
* @author Steffen Vogel <info@steffenvogel.de>
* @author Andreas Goetz <cpuidle@gmx.de>
* @package default
*
* @todo Check how controllers can modify the response/headers
*/
abstract class Controller {

Expand Down
6 changes: 4 additions & 2 deletions lib/Volkszaehler/Router.php
Expand Up @@ -102,8 +102,10 @@ public function __construct() {
ErrorHandler::register();

// views
foreach (array('png', 'jpeg', 'jpg', 'gif') as $format) {
self::$viewMapping[$format] = 'Volkszaehler\View\JpGraph';
if (class_exists('\JpGraph\JpGraph')) {
foreach (array('png', 'jpeg', 'jpg', 'gif') as $format) {
self::$viewMapping[$format] = 'Volkszaehler\View\JpGraph';
}
}
}

Expand Down
9 changes: 5 additions & 4 deletions lib/Volkszaehler/View/JSON.php
Expand Up @@ -166,10 +166,11 @@ protected function addDebug(Util\Debug $debug) {

// SQL statements
$this->getSQLTimes($debug->getQueries());
$jsonDebug['sqlTotalTime'] = $this->sqlTotalTime;
$jsonDebug['sqlWorstTime'] = $this->sqlWorstTime;

$jsonDebug['queries'] = array_values($debug->getQueries());
$jsonDebug['sql'] = array(
'totalTime' => $this->sqlTotalTime,
'worstTime' => $this->sqlWorstTime,
'queries' => array_values($debug->getQueries())
);

$this->json['debug'] = $jsonDebug;
}
Expand Down
3 changes: 3 additions & 0 deletions lib/Volkszaehler/View/View.php
Expand Up @@ -102,6 +102,9 @@ public function send() {
* @param integer $value timestamp in seconds or offset in seconds
*/
public function setCaching($mode, $value) {
// unresolved artifact from Symfony migration
throw new \LogicException('Cannot set caching in view without access to response');

switch ($mode) {
case 'modified': // Last-modified
$this->response->setHeader('Last-Modified', gmdate('D, d M Y H:i:s', $value) . ' GMT');
Expand Down
4 changes: 4 additions & 0 deletions lib/bootstrap.php
Expand Up @@ -34,6 +34,10 @@
}
define('VZ_VERSION', '0.3');

if (!file_exists(VZ_DIR . '/vendor/autoload.php')) {
die('Could not find autoloader. Check that dependencies have been installed via `composer install`.');
}

require_once VZ_DIR . '/vendor/autoload.php';

// load configuration
Expand Down
3 changes: 0 additions & 3 deletions misc/tests/README

This file was deleted.

90 changes: 0 additions & 90 deletions misc/tests/ajax.php

This file was deleted.

0 comments on commit e71f79c

Please sign in to comment.