Merge pull request #3 from HackspaceJena/master

update
This commit is contained in:
Andi 2014-09-01 20:33:47 +02:00
commit a2f17074be
9 changed files with 299 additions and 164 deletions

View file

@ -602,6 +602,12 @@ class SymfonyRequirements extends RequirementCollection
'Install and enable the <strong>XML</strong> extension.'
);
$this->addRecommendation(
function_exists('filter_var'),
'filter_var() should be available',
'Install and enable the <strong>filter</strong> extension.'
);
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
$this->addRecommendation(
function_exists('posix_isatty'),
@ -662,7 +668,7 @@ class SymfonyRequirements extends RequirementCollection
$this->addRecommendation(
$accelerator,
'a PHP accelerator should be installed',
'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).'
'Install and/or enable a <strong>PHP accelerator</strong> (highly recommended).'
);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {

View file

@ -2,61 +2,141 @@
require_once dirname(__FILE__).'/SymfonyRequirements.php';
$lineSize = 70;
$symfonyRequirements = new SymfonyRequirements();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
echo "********************************\n";
echo "* *\n";
echo "* Symfony requirements check *\n";
echo "* *\n";
echo "********************************\n\n";
echo_title('Symfony2 Requirements Checker');
echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";
echo "** ATTENTION **\n";
echo "* The PHP CLI can use a different php.ini file\n";
echo "* than the one used with your web server.\n";
if ('\\' == DIRECTORY_SEPARATOR) {
echo "* (especially on the Windows platform)\n";
echo '> PHP is using the following php.ini file:'.PHP_EOL;
if ($iniPath) {
echo_style('green', ' '.$iniPath);
} else {
echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!');
}
echo "* To be on the safe side, please also launch the requirements check\n";
echo "* from your web server using the web/config.php script.\n";
echo_title('Mandatory requirements');
echo PHP_EOL.PHP_EOL;
$checkPassed = true;
echo '> Checking Symfony requirements:'.PHP_EOL.' ';
$messages = array();
foreach ($symfonyRequirements->getRequirements() as $req) {
/** @var $req Requirement */
echo_requirement($req);
if (!$req->isFulfilled()) {
$checkPassed = false;
if ($helpText = get_error_message($req, $lineSize)) {
echo_style('red', 'E');
$messages['error'][] = $helpText;
} else {
echo_style('green', '.');
}
}
echo_title('Optional recommendations');
$checkPassed = empty($messages['error']);
foreach ($symfonyRequirements->getRecommendations() as $req) {
echo_requirement($req);
if ($helpText = get_error_message($req, $lineSize)) {
echo_style('yellow', 'W');
$messages['warning'][] = $helpText;
} else {
echo_style('green', '.');
}
}
if ($checkPassed) {
echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects', true);
} else {
echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects', true);
echo_title('Fix the following mandatory requirements', 'red');
foreach ($messages['error'] as $helpText) {
echo ' * '.$helpText.PHP_EOL;
}
}
if (!empty($messages['warning'])) {
echo_title('Optional recommendations to improve your setup', 'yellow');
foreach ($messages['warning'] as $helpText) {
echo ' * '.$helpText.PHP_EOL;
}
}
echo PHP_EOL;
echo_style('title', 'Note');
echo ' The command console could use a different php.ini file'.PHP_EOL;
echo_style('title', '~~~~');
echo ' than the one used with your web server. To be on the'.PHP_EOL;
echo ' safe side, please check the requirements from your web'.PHP_EOL;
echo ' server using the ';
echo_style('yellow', 'web/config.php');
echo ' script.'.PHP_EOL;
echo PHP_EOL;
exit($checkPassed ? 0 : 1);
/**
* Prints a Requirement instance
*/
function echo_requirement(Requirement $requirement)
function get_error_message(Requirement $requirement, $lineSize)
{
$result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
echo ' ' . str_pad($result, 9);
echo $requirement->getTestMessage() . "\n";
if (!$requirement->isFulfilled()) {
echo sprintf(" %s\n\n", $requirement->getHelpText());
if ($requirement->isFulfilled()) {
return;
}
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
$errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;
return $errorMessage;
}
function echo_title($title)
function echo_title($title, $style = null)
{
echo "\n** $title **\n\n";
$style = $style ?: 'title';
echo PHP_EOL;
echo_style($style, $title.PHP_EOL);
echo_style($style, str_repeat('~', strlen($title)).PHP_EOL);
echo PHP_EOL;
}
function echo_style($style, $message)
{
// ANSI color codes
$styles = array(
'reset' => "\033[0m",
'red' => "\033[31m",
'green' => "\033[32m",
'yellow' => "\033[33m",
'error' => "\033[37;41m",
'success' => "\033[37;42m",
'title' => "\033[34m",
);
$supports = has_color_support();
echo ($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
}
function echo_block($style, $title, $message)
{
$message = ' '.trim($message).' ';
$width = strlen($message);
echo PHP_EOL.PHP_EOL;
echo_style($style, str_repeat(' ', $width).PHP_EOL);
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_repeat(' ', $width).PHP_EOL);
}
function has_color_support()
{
static $support;
if (null === $support) {
if (DIRECTORY_SEPARATOR == '\\') {
$support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
} else {
$support = function_exists('posix_isatty') && @posix_isatty(STDOUT);
}
}
return $support;
}

283
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "a72c02cc5e14c865991a846b5bac02fb",
"hash": "77745a3287830b815f677d20df33b385",
"packages": [
{
"name": "doctrine/annotations",
@ -444,12 +444,12 @@
"source": {
"type": "git",
"url": "https://github.com/doctrine/DoctrineMigrationsBundle.git",
"reference": "f7138381aa884c0f679da4de41e369b94ead9cd3"
"reference": "81575a4316951125ce408c70f30547c77d98f78a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/f7138381aa884c0f679da4de41e369b94ead9cd3",
"reference": "f7138381aa884c0f679da4de41e369b94ead9cd3",
"url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/81575a4316951125ce408c70f30547c77d98f78a",
"reference": "81575a4316951125ce408c70f30547c77d98f78a",
"shasum": ""
},
"require": {
@ -474,12 +474,6 @@
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
@ -487,6 +481,10 @@
{
"name": "Doctrine Project",
"homepage": "http://www.doctrine-project.org"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony DoctrineMigrationsBundle",
@ -496,7 +494,7 @@
"migrations",
"schema"
],
"time": "2014-03-20 14:48:55"
"time": "2014-08-17 07:53:47"
},
{
"name": "doctrine/inflector",
@ -620,12 +618,12 @@
"source": {
"type": "git",
"url": "https://github.com/doctrine/migrations.git",
"reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8"
"reference": "1a9dffa64e33fdc10f4b4c3f5d7230b74d4a1021"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
"reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/1a9dffa64e33fdc10f4b4c3f5d7230b74d4a1021",
"reference": "1a9dffa64e33fdc10f4b4c3f5d7230b74d4a1021",
"shasum": ""
},
"require": {
@ -655,15 +653,13 @@
"LGPL"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": "Creator"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Database Schema migrations using Doctrine DBAL",
@ -672,20 +668,20 @@
"database",
"migrations"
],
"time": "2014-07-09 07:58:02"
"time": "2014-08-18 18:03:07"
},
{
"name": "doctrine/orm",
"version": "v2.4.3",
"version": "v2.4.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/doctrine2.git",
"reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29"
"reference": "fc19c3b53dcd00e6584db40669fdd699c4671f97"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/8a13376d42b5ea467727ffe730aa0e14ca3c5e29",
"reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/fc19c3b53dcd00e6584db40669fdd699c4671f97",
"reference": "fc19c3b53dcd00e6584db40669fdd699c4671f97",
"shasum": ""
},
"require": {
@ -748,7 +744,59 @@
"database",
"orm"
],
"time": "2014-06-10 11:49:08"
"time": "2014-07-11 03:05:53"
},
{
"name": "enko/ics",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/enko/ICS.git",
"reference": "60416fc3842a7b4ee4f0938b8c35c96b402fee32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/enko/ICS/zipball/60416fc3842a7b4ee4f0938b8c35c96b402fee32",
"reference": "60416fc3842a7b4ee4f0938b8c35c96b402fee32",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.6.*"
},
"type": "library",
"autoload": {
"psr-0": {
"Jsvrcek\\ICS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Justin Svrcek",
"homepage": "https://github.com/jasvrcek"
},
{
"name": "Tim Schumacher",
"homepage": "https://github.com/enko"
}
],
"description": "abstraction layer for creating multi-byte safe RFC 5545 compliant .ics files",
"homepage": "https://github.com/enko/ICS",
"keywords": [
".ics",
"RFC 5545",
"calendar",
"export",
"ical",
"multi-byte safe"
],
"time": "2014-07-30 23:43:46"
},
{
"name": "incenteev/composer-parameter-handler",
@ -918,54 +966,6 @@
},
"type": "library"
},
{
"name": "jsvrcek/ics",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/jasvrcek/ICS.git",
"reference": "85e3e34214547a9981bd3be38633f9dce4f85094"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jasvrcek/ICS/zipball/85e3e34214547a9981bd3be38633f9dce4f85094",
"reference": "85e3e34214547a9981bd3be38633f9dce4f85094",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.6.*"
},
"type": "library",
"autoload": {
"psr-0": {
"Jsvrcek\\ICS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Justin Svrcek",
"homepage": "https://github.com/jasvrcek"
}
],
"description": "abstraction layer for creating multi-byte safe RFC 5545 compliant .ics files",
"homepage": "https://github.com/jasvrcek/ICS",
"keywords": [
".ics",
"RFC 5545",
"calendar",
"export",
"ical",
"multi-byte safe"
],
"time": "2013-10-28 17:21:17"
},
{
"name": "knplabs/knp-markdown-bundle",
"version": "1.3.2",
@ -1255,29 +1255,25 @@
},
{
"name": "sensio/distribution-bundle",
"version": "v3.0.1",
"version": "v3.0.5",
"target-dir": "Sensio/Bundle/DistributionBundle",
"source": {
"type": "git",
"url": "https://github.com/sensiolabs/SensioDistributionBundle.git",
"reference": "e9caa300faf95076c8e27693f3fdb0bb6e3148c0"
"reference": "ad10123f2532f6e311e583cce203ef368eedc469"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/e9caa300faf95076c8e27693f3fdb0bb6e3148c0",
"reference": "e9caa300faf95076c8e27693f3fdb0bb6e3148c0",
"url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/ad10123f2532f6e311e583cce203ef368eedc469",
"reference": "ad10123f2532f6e311e583cce203ef368eedc469",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sensiolabs/security-checker": "~2.0",
"symfony/class-loader": "~2.2",
"symfony/config": "~2.2",
"symfony/dependency-injection": "~2.2",
"symfony/filesystem": "~2.2",
"symfony/form": "~2.2",
"symfony/framework-bundle": "~2.2",
"symfony/http-foundation": "~2.2",
"symfony/http-kernel": "~2.2",
"symfony/framework-bundle": "~2.4",
"symfony/process": "~2.2",
"symfony/validator": "~2.2",
"symfony/yaml": "~2.2"
@ -1300,17 +1296,15 @@
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
"email": "fabien@symfony.com"
}
],
"description": "The base bundle for the Symfony Distributions",
"description": "Base bundle for Symfony Distributions",
"keywords": [
"configuration",
"distribution"
],
"time": "2014-06-06 02:53:20"
"time": "2014-08-26 13:14:47"
},
{
"name": "sensio/framework-extra-bundle",
@ -1369,6 +1363,51 @@
],
"time": "2014-05-22 23:27:44"
},
{
"name": "sensiolabs/security-checker",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sensiolabs/security-checker.git",
"reference": "5b4eb4743ebe68276c911c84101ecdf4a9ae76ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/5b4eb4743ebe68276c911c84101ecdf4a9ae76ee",
"reference": "5b4eb4743ebe68276c911c84101ecdf4a9ae76ee",
"shasum": ""
},
"require": {
"ext-curl": "*",
"symfony/console": "~2.0"
},
"bin": [
"security-checker"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-0": {
"SensioLabs\\Security": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien.potencier@gmail.com"
}
],
"description": "A security checker for your composer.lock",
"time": "2014-07-19 10:52:35"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v5.2.1",
@ -1488,20 +1527,21 @@
},
{
"name": "symfony/icu",
"version": "v1.2.1",
"version": "v1.2.2",
"target-dir": "Symfony/Component/Icu",
"source": {
"type": "git",
"url": "https://github.com/symfony/Icu.git",
"reference": "98e197da54df1f966dd5e8a4992135703569c987"
"reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Icu/zipball/98e197da54df1f966dd5e8a4992135703569c987",
"reference": "98e197da54df1f966dd5e8a4992135703569c987",
"url": "https://api.github.com/repos/symfony/Icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
"reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
"shasum": ""
},
"require": {
"ext-intl": "*",
"lib-icu": ">=4.4",
"php": ">=5.3.3",
"symfony/intl": "~2.3"
@ -1532,21 +1572,20 @@
"icu",
"intl"
],
"time": "2013-10-04 10:06:38"
"time": "2014-07-25 09:58:17"
},
{
"name": "symfony/monolog-bundle",
"version": "v2.6.0",
"target-dir": "Symfony/Bundle/MonologBundle",
"version": "v2.6.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/MonologBundle.git",
"reference": "e1d4aa99c7440b11e9dfbfef7ed63084401dbc6a"
"reference": "227bbeefe30f2d95e3fe5fbd1ccda414287a957a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/MonologBundle/zipball/e1d4aa99c7440b11e9dfbfef7ed63084401dbc6a",
"reference": "e1d4aa99c7440b11e9dfbfef7ed63084401dbc6a",
"url": "https://api.github.com/repos/symfony/MonologBundle/zipball/227bbeefe30f2d95e3fe5fbd1ccda414287a957a",
"reference": "227bbeefe30f2d95e3fe5fbd1ccda414287a957a",
"shasum": ""
},
"require": {
@ -1568,8 +1607,8 @@
}
},
"autoload": {
"psr-0": {
"Symfony\\Bundle\\MonologBundle": ""
"psr-4": {
"Symfony\\Bundle\\MonologBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@ -1577,15 +1616,13 @@
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony MonologBundle",
@ -1594,7 +1631,7 @@
"log",
"logging"
],
"time": "2014-06-04 16:49:13"
"time": "2014-07-21 00:36:06"
},
{
"name": "symfony/swiftmailer-bundle",
@ -1655,16 +1692,16 @@
},
{
"name": "symfony/symfony",
"version": "v2.5.1",
"version": "v2.5.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/symfony.git",
"reference": "e3d2844abc988bc467bb1593cd340700096b0ac0"
"reference": "f077a238c781f845487a7c81fea8033ccd0e6a02"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/symfony/zipball/e3d2844abc988bc467bb1593cd340700096b0ac0",
"reference": "e3d2844abc988bc467bb1593cd340700096b0ac0",
"url": "https://api.github.com/repos/symfony/symfony/zipball/f077a238c781f845487a7c81fea8033ccd0e6a02",
"reference": "f077a238c781f845487a7c81fea8033ccd0e6a02",
"shasum": ""
},
"require": {
@ -1751,15 +1788,13 @@
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "The Symfony PHP framework",
@ -1767,7 +1802,7 @@
"keywords": [
"framework"
],
"time": "2014-07-08 14:42:08"
"time": "2014-08-06 07:03:01"
},
{
"name": "twig/extensions",
@ -1927,19 +1962,15 @@
"time": "2014-04-28 14:01:06"
}
],
"aliases": [
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"jsvrcek/ics": 20,
"doctrine/migrations": 20,
"doctrine/doctrine-migrations-bundle": 20
},
"prefer-stable": false,
"platform": {
"php": ">=5.3.3"
},
"platform-dev": [
]
"platform-dev": []
}

View file

@ -204,6 +204,8 @@ class EventController extends Controller
if (strlen($enddate) > 0) {
$enddate = new \DateTime($enddate);
$entity->enddate = $enddate;
} else {
$entity->enddate = null;
}
$location = $request->get('location');

View file

@ -104,4 +104,17 @@ class Event extends BaseEntity
public function isValid() {
return true;
}
public function getFormatedDate() {
$retval = $this->startdate->format('Y-m-d H:i');
if (!is_null($this->enddate)) {
$retval .= "";
if ($this->startdate->format('Y-m-d') == $this->enddate->format('Y-m-d')) {
$retval .= $this->enddate->format('H:i');
} else {
$retval .= $this->enddate->format('Y-m-d H:i');
}
}
return $retval;
}
}

View file

@ -11,7 +11,7 @@
<p class="startdate ">
<i class="circular icon calendar green inverted link" title="Wann?"
data-content="Wann?"></i>{{ entity.startdate.format('Y-m-d H:i') }}
data-content="Wann?"></i>{{ entity.getFormatedDate() }}
</p>
{% if entity.location is not null %}

View file

@ -9,7 +9,7 @@
name="startdate"
required="required"
value="{{ entity.startdate.format('Y-m-d H:i')|default('') }}"
placeholder="{{ "now"|date('d.m.Y H:i') }}"
placeholder="{{ "now"|date('Y-m-d H:i') }}"
class="form-control">
<i class="icon calendar"></i>
@ -27,7 +27,7 @@
id="event_enddate"
name="enddate"
value="{{ entity.enddate.format('Y-m-d H:i')|default('') }}"
placeholder="{{ "now"|date('d.m.Y H:i') }}"
placeholder="{{ "now"|date('Y-m-d H:i') }}"
class="form-control">
<i class="icon calendar"></i>

View file

@ -5,6 +5,7 @@
<title>{% block title %}Terminverwaltung Calcifer{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="shortcut icon" href="/favicon.png" />
<link href='//fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
{% stylesheets filter="compass"
"@CalciferBundle/Resources/assets/css/main.scss"

2
web/css/semantic.scss Normal file → Executable file
View file

@ -1,3 +1,5 @@
@charset "UTF-8";
/*
* # Semantic - Breadcrumb
* http://github.com/jlukic/semantic-ui/