From d71e7bbfad2f07f82df0c515608996d250fd4182 Mon Sep 17 00:00:00 2001 From: Bot Date: Mon, 2 Jan 2017 15:43:36 +0100 Subject: Formatting --- templates/guest_credits.html | 58 +++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'templates/guest_credits.html') diff --git a/templates/guest_credits.html b/templates/guest_credits.html index 472676db..ffde2fba 100644 --- a/templates/guest_credits.html +++ b/templates/guest_credits.html @@ -1,27 +1,35 @@
-

Credits

-
-
-

Source code

-

- The original system was written by cookie. It was then completely rewritten and greatly enhanced by msquare and mortzu of planet - cyborg, jplitza and gnomus. -

-

- Please look at the contributor list on github for a more complete version. -

+

Credits

+
+
+

Source code

+

+ The original system was written by cookie. + It was then completely rewritten and greatly enhanced by msquare + and MyIgel, + mortzu of planet cyborg, + jplitza and gnomus. +

+

+ Please look at the contributor + list on github for a more complete version. +

+
+
+

Hosting

+

+ Webspace, development platform and domain is currently provided by + would you buy this? (ichdasich)
+ and adminstrated by mortzu, + derf + and ichdasich. +

+
+
+

Translation

+

+ Many thanks for the german translation: e7p +

+
-
-

Hosting

-

- Webspace, development platform and domain is currently provided by would you buy this? (ichdasich)
and adminstrated by mortzu, derf and ichdasich. -

-
-
-

Translation

-

- Many thanks for the german translation: e7p -

-
-
-
\ No newline at end of file +
-- cgit v1.2.3-70-g09d2 From 20e0765f571ed60aa21c07502ee7efcbe9995a6e Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 16 Jul 2017 18:41:57 +0200 Subject: remove german readme and add development readme #269 --- README-ENG.md | 27 ------------------------ README.md | 50 +++++++++++++++++++++++++++----------------- templates/guest_credits.html | 14 +++++++------ 3 files changed, 39 insertions(+), 52 deletions(-) delete mode 100644 README-ENG.md (limited to 'templates/guest_credits.html') diff --git a/README-ENG.md b/README-ENG.md deleted file mode 100644 index 0c39ba45..00000000 --- a/README-ENG.md +++ /dev/null @@ -1,27 +0,0 @@ -# Installation of Engelsystem - -## Requirements: - * PHP 5.4.x (cgi-fcgi) - * MySQL-Server 5.5.x - * Webserver, i.e. lighttpd, nginx, or Apache - -## Directions: - * Clone the master branch: `git clone https://github.com/engelsystem/engelsystem.git` - * Install [Composer](https://getcomposer.org/download/) - * Install project dependencies: `composer install` - * Webserver must have write access to the 'import' directory and read access for all other directories - * Webserver must be public. - - * Recommended: Directory Listing should be disabled. - * There must a be MySQL database created with a user who has full rights to that database. - * It must be created by the db/install.sql and db/update.sql files. - * If necessary, create a config/config.php to override values from config/config.default.php. - * In the browser, login with credentials admin:asdfasdf and change the password. - -Engelsystem can now be used. - -## Session Settings: - * Make sure the config allows for sessions. - * Both Apache and Nginx allow for different VirtualHost configurations. - -Report Bugs: https://github.com/engelsystem/engelsystem/issues diff --git a/README.md b/README.md index 1bb0f694..aa418e4f 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,42 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/20b3b0b4e93344a29da6bec77f329e7a)](https://www.codacy.com/app/engelsystem/engelsystem) [![GPL](https://img.shields.io/github/license/engelsystem/engelsystem.svg?maxAge=2592000)]() -# Installation eines frischen Engelsystems +# Engelsystem -## Mindestvorrausetzungen (bzw. getestet unter): +Please visit https://engelsystem.de for a feature list. + +## Installation + +### Requirements: * PHP 5.4.x (cgi-fcgi) * MySQL-Server 5.5.x - * Webserver mit PHP-Anbindung, z.B. lighttpd, nginx oder Apache + * Webserver, i.e. lighttpd, nginx, or Apache + +### Directions: + * Clone the master branch: `git clone https://github.com/engelsystem/engelsystem.git` + * Install [Composer](https://getcomposer.org/download/) + * Install project dependencies: `composer install` + * Webserver must have write access to the 'import' directory and read access for all other directories + * Webserver must be public. + + * Recommended: Directory Listing should be disabled. + * There must a be MySQL database created with a user who has full rights to that database. + * It must be created by the db/install.sql and db/update.sql files. + * If necessary, create a config/config.php to override values from config/config.default.php. + * In the browser, login with credentials admin:asdfasdf and change the password. + +Engelsystem can now be used. -## Vorgehen: - * Klonen des `master` in lokales Verzeichnis: `git clone https://github.com/engelsystem/engelsystem.git` - * [Composer](https://getcomposer.org/download/) installieren - * Abhängigkeiten installieren: `composer install` - * Der Webserver muss Schreibrechte auf das Verzeichnis `import` bekommen, für alle anderen Dateien reichen Leserechte. - * Der Webserver muss auf `public` als http-root zeigen. +### Session Settings: + * Make sure the config allows for sessions. + * Both Apache and Nginx allow for different VirtualHost configurations. - * Empfehlung: Dirlisting sollte deaktiviert sein. - * Es muss eine MySQL-Datenbank angelegt werden und ein User existieren, der alle Rechte auf dieser Datenbank besitzt. - * Es muss die db/install.sql und die db/update.sql importiert/ausgeführt werden. - * Erstelle bei Bedarf eine config/config.php, die die Werte (z.B. DB-Zugang) aus der config/config.default.php überschreibt. - * Engelsystem im Browser aufrufen, Anmeldung mit admin:asdfasdf vornehmen und Admin-Passwort ändern. +Report Bugs: https://github.com/engelsystem/engelsystem/issues -Das Engelsystem ist jetzt einsatzbereit. +## Development +Since the engelsystem is open source, you can help to improve the system. We really love to get pull requests containing fixes or implementations of our Github issues. -## Session Einstellungen: - * Einstellungen für Cookies und Sessions bitte in der PHP Config des Servers vornehmen. - * Sowohl Apache als auch nginx bieten Möglichkeiten für verschiedene Konfigurationen pro VirtualHost an +Please create single pull requests for every feature instead of creating one big monster of pull request containing a complete rewrite. -Fehler bitte auf Github melden: https://github.com/engelsystem/engelsystem/issues +### Codestyle +Please ensure that your pull requests follow [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://www.php-fig.org/psr/psr-4/). diff --git a/templates/guest_credits.html b/templates/guest_credits.html index ffde2fba..ba746d6a 100644 --- a/templates/guest_credits.html +++ b/templates/guest_credits.html @@ -5,10 +5,12 @@

Source code

The original system was written by cookie. - It was then completely rewritten and greatly enhanced by msquare - and MyIgel, - mortzu of planet cyborg, - jplitza and gnomus. + It was then completely rewritten and enhanced by + msquare (maintainer), + MyIgel, + mortzu, + jplitza and + gnomus.

Please look at the contributor @@ -18,8 +20,8 @@

Hosting

- Webspace, development platform and domain is currently provided by - would you buy this? (ichdasich)
+ Webspace, development platform and domain on engelsystem.de is currently provided by + would you buy this? (ichdasich) and adminstrated by mortzu, derf and ichdasich. -- cgit v1.2.3-70-g09d2 From a473a56f1dbf568dc66cd6fcffe6b638308c542e Mon Sep 17 00:00:00 2001 From: Bot Date: Wed, 30 Aug 2017 00:07:01 +0200 Subject: Formatting --- includes/model/Shifts_model.php | 3 +- includes/model/User_model.php | 2 +- includes/pages/admin_import.php | 2 +- includes/view/Rooms_view.php | 1 + includes/view/ShiftCalendarRenderer.php | 76 +++++++++++++++------------------ src/Database/Db.php | 9 ++-- templates/guest_credits.html | 7 ++- templates/layout.html | 4 +- 8 files changed, 50 insertions(+), 54 deletions(-) (limited to 'templates/guest_credits.html') diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index 88b28998..1589939d 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -45,7 +45,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter) AND NOT `Shifts`.`PSID` IS NULL) AS tmp_shifts ORDER BY `start`'; - + return DB::select( $sql, [ @@ -444,6 +444,7 @@ function Shift_update($shift) * * @param array $shift * @return bool|null + * @throws Exception */ function Shift_update_by_psid($shift) { diff --git a/includes/model/User_model.php b/includes/model/User_model.php index 4757ed3c..0ed602e0 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -241,7 +241,7 @@ function Users_by_angeltype($angeltype) `UserAngelTypes`.`id` AS `user_angeltype_id`, `UserAngelTypes`.`confirm_user_id`, `UserAngelTypes`.`supporter`, - (`UserDriverLicenses`.`user_id` IS NOT NULL) as `wants_to_drive`, + (`UserDriverLicenses`.`user_id` IS NOT NULL) AS `wants_to_drive`, `UserDriverLicenses`.* FROM `User` JOIN `UserAngelTypes` ON `User`.`UID`=`UserAngelTypes`.`user_id` diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php index bda5ba93..bf8c498c 100644 --- a/includes/pages/admin_import.php +++ b/includes/pages/admin_import.php @@ -248,7 +248,7 @@ function admin_import() list($rooms_new, $rooms_deleted) = prepare_rooms($import_file); foreach ($rooms_new as $room) { $result = Room_create($room, true, true); - + $rooms_import[trim($room)] = $result; } foreach ($rooms_deleted as $room) { diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php index 802b4c8e..76ce33a5 100644 --- a/includes/view/Rooms_view.php +++ b/includes/view/Rooms_view.php @@ -1,4 +1,5 @@ $room_id, + 'RID' => $room_id, 'Name' => $shift['room_name'] ]); - if (! isset($lanes[$room_id])) { + if (!isset($lanes[$room_id])) { // initialize room with one lane $lanes[$room_id] = [ new ShiftCalendarLane($header, $this->getFirstBlockStartTime(), $this->getBlocksPerSlot()) @@ -95,7 +91,7 @@ class ShiftCalendarRenderer $shift_added = false; foreach ($lanes[$room_id] as $lane) { /** @var ShiftCalendarLane $lane */ - if($lane->shiftFits($shift)) { + if ($lane->shiftFits($shift)) { $lane->addShift($shift); $shift_added = true; break; @@ -108,12 +104,11 @@ class ShiftCalendarRenderer $lanes[$room_id][] = $newLane; } } - + return $lanes; } /** - * * @return int */ public function getFirstBlockStartTime() @@ -122,7 +117,6 @@ class ShiftCalendarRenderer } /** - * * @return int */ public function getLastBlockEndTime() @@ -131,7 +125,6 @@ class ShiftCalendarRenderer } /** - * * @return float */ public function getBlocksPerSlot() @@ -153,9 +146,9 @@ class ShiftCalendarRenderer return ''; } return div('shift-calendar', [ - $this->renderTimeLane(), - $this->renderShiftLanes() - ]) . $this->renderLegend(); + $this->renderTimeLane(), + $this->renderShiftLanes() + ]) . $this->renderLegend(); } /** @@ -171,41 +164,45 @@ class ShiftCalendarRenderer $html .= $this->renderLane($lane); } } - + return $html; } /** * Renders a single lane * - * @param ShiftCalendarLane $lane - * The lane to render + * @param ShiftCalendarLane $lane The lane to render * @return string */ private function renderLane(ShiftCalendarLane $lane) { global $user; - + $shift_renderer = new ShiftCalendarShiftRenderer(); $html = ''; $rendered_until = $this->getFirstBlockStartTime(); - + foreach ($lane->getShifts() as $shift) { while ($rendered_until + ShiftCalendarRenderer::SECONDS_PER_ROW <= $shift['start']) { $html .= $this->renderTick($rendered_until); $rendered_until += ShiftCalendarRenderer::SECONDS_PER_ROW; } - - list ($shift_height, $shift_html) = $shift_renderer->render($shift, $this->needed_angeltypes[$shift['SID']], $this->shift_entries[$shift['SID']], $user); + + list ($shift_height, $shift_html) = $shift_renderer->render( + $shift, + $this->needed_angeltypes[$shift['SID']], + $this->shift_entries[$shift['SID']], + $user + ); $html .= $shift_html; $rendered_until += $shift_height * ShiftCalendarRenderer::SECONDS_PER_ROW; } - + while ($rendered_until < $this->getLastBlockEndTime()) { $html .= $this->renderTick($rendered_until); $rendered_until += ShiftCalendarRenderer::SECONDS_PER_ROW; } - + return div('lane', [ div('header', $lane->getHeader()), $html @@ -215,23 +212,21 @@ class ShiftCalendarRenderer /** * Renders a tick/block for given time * - * @param int $time - * unix timestamp - * @param boolean $label - * Should time labels be generated? + * @param int $time unix timestamp + * @param boolean $label Should time labels be generated? * @return string rendered tick html */ private function renderTick($time, $label = false) { if ($time % (24 * 60 * 60) == 23 * 60 * 60) { - if (! $label) { + if (!$label) { return div('tick day'); } return div('tick day', [ date('m-dH:i', $time) ]); } elseif ($time % (60 * 60) == 0) { - if (! $label) { + if (!$label) { return div('tick hour'); } return div('tick hour', [ @@ -253,7 +248,7 @@ class ShiftCalendarRenderer _('Time') ]) ]; - for ($block = 0; $block < $this->getBlocksPerSlot(); $block ++) { + for ($block = 0; $block < $this->getBlocksPerSlot(); $block++) { $thistime = $this->getFirstBlockStartTime() + ($block * ShiftCalendarRenderer::SECONDS_PER_ROW); $time_slot[] = $this->renderTick($thistime, true); } @@ -261,8 +256,7 @@ class ShiftCalendarRenderer } /** - * - * @param array[] $shifts + * @param array[] $shifts * @return int */ private function calcFirstBlockStartTime($shifts) @@ -277,8 +271,7 @@ class ShiftCalendarRenderer } /** - * - * @param array[] $shifts + * @param array[] $shifts * @return int */ private function calcLastBlockEndTime($shifts) @@ -293,7 +286,6 @@ class ShiftCalendarRenderer } /** - * * @return int */ private function calcBlocksPerSlot() diff --git a/src/Database/Db.php b/src/Database/Db.php index 777b16a2..7042998f 100644 --- a/src/Database/Db.php +++ b/src/Database/Db.php @@ -79,9 +79,10 @@ class Db return self::$stm->fetchAll(PDO::FETCH_ASSOC); } - + /** * Run a select query and return only the first result or null if no result is found. + * * @param string $query * @param array $bindings * @return array|null @@ -89,11 +90,11 @@ class Db public static function selectOne($query, array $bindings = []) { $result = self::select($query, $bindings); - - if(empty($result)) { + + if (empty($result)) { return null; } - + return array_shift($result); } diff --git a/templates/guest_credits.html b/templates/guest_credits.html index ba746d6a..db7fac57 100644 --- a/templates/guest_credits.html +++ b/templates/guest_credits.html @@ -20,11 +20,10 @@

Hosting

- Webspace, development platform and domain on engelsystem.de is currently provided by - would you buy this? (ichdasich) + Webspace, development platform and domain on engelsystem.de + is currently provided by would you buy this? (ichdasich) and adminstrated by mortzu, - derf - and ichdasich. + derf and ichdasich.

diff --git a/templates/layout.html b/templates/layout.html index 1923124c..4b9aa06e 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -22,7 +22,9 @@ - ENGELSYSTEM + + ENGELSYSTEM +
-- cgit v1.2.3-70-g09d2