From 74647e16d37fac9425a4561b49618b52cdc3e75c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20H=C3=A4usler?=
Date: Fri, 22 Aug 2014 22:34:13 +0200
Subject: [PATCH] add basic bootstrap theme
---
db/update.sql | 3 +
includes/controller/angeltypes_controller.php | 2 +-
includes/controller/users_controller.php | 48 +-
includes/helper/message_helper.php | 6 +-
includes/pages/admin_active.php | 2 +-
includes/pages/admin_arrive.php | 10 +-
includes/pages/admin_free.php | 45 +-
includes/pages/admin_log.php | 18 +-
includes/pages/admin_news.php | 124 +-
includes/pages/admin_questions.php | 90 +-
includes/pages/admin_rooms.php | 143 +-
includes/pages/admin_shifts.php | 238 +-
includes/pages/admin_user.php | 4 +-
includes/pages/guest_login.php | 12 +-
includes/pages/user_messages.php | 12 +-
includes/pages/user_myshifts.php | 2 +-
includes/pages/user_news.php | 205 +-
includes/pages/user_questions.php | 17 +-
includes/pages/user_settings.php | 4 +-
includes/pages/user_shifts.php | 55 +-
includes/sys_menu.php | 22 +-
includes/sys_template.php | 87 +-
includes/view/AngelTypes_view.php | 24 +-
includes/view/Questions_view.php | 2 +-
includes/view/ShiftEntry_view.php | 4 +-
includes/view/UserAngelTypes_view.php | 14 +-
includes/view/User_view.php | 11 +-
public/css/base.css | 26 -
public/index.php | 27 +-
public/vendor/bootstrap-3.2.0/css/theme0.css | 5296 ++++++++++++++++
public/vendor/bootstrap-3.2.0/css/theme1.css | 5393 +++++++++++++++++
.../fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20335 bytes
.../fonts/glyphicons-halflings-regular.svg | 229 +
.../fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 41280 bytes
.../fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23320 bytes
public/vendor/bootstrap-3.2.0/js/bootstrap.js | 2114 +++++++
.../bootstrap-3.2.0/js/bootstrap.min.js | 6 +
public/vendor/icomoon/fonts/icomoon.eot | Bin 0 -> 1300 bytes
public/vendor/icomoon/fonts/icomoon.svg | 11 +
public/vendor/icomoon/fonts/icomoon.ttf | Bin 0 -> 1136 bytes
public/vendor/icomoon/fonts/icomoon.woff | Bin 0 -> 1172 bytes
public/vendor/icomoon/selection.json | 74 +
public/vendor/icomoon/style.css | 28 +
public/vendor/jquery-2.1.1.min.js | 4 +
templates/admin_free.html | 36 +-
templates/admin_groups.html | 31 +-
templates/admin_groups_edit_form.html | 31 +-
templates/admin_question_unanswered.html | 26 +-
templates/admin_questions.html | 71 +-
templates/admin_shift_preview.html | 52 +-
templates/admin_shifts.html | 86 -
templates/admin_shifts_angel_types.html | 22 -
templates/layout.html | 80 +-
templates/user_messages.html | 77 +-
templates/user_shifts.html | 76 +-
themes/base.scss | 8 +
themes/theme0.scss | 1 +
themes/theme1.scss | 1013 ++++
.../_alerts.scssc | Bin 0 -> 2017 bytes
.../_background-variant.scssc | Bin 0 -> 1318 bytes
.../_border-radius.scssc | Bin 0 -> 2073 bytes
.../_buttons.scssc | Bin 0 -> 6482 bytes
.../_center-block.scssc | Bin 0 -> 768 bytes
.../_clearfix.scssc | Bin 0 -> 2388 bytes
.../_forms.scssc | Bin 0 -> 11483 bytes
.../_gradients.scssc | Bin 0 -> 19226 bytes
.../_grid-framework.scssc | Bin 0 -> 12694 bytes
.../_grid.scssc | Bin 0 -> 14389 bytes
.../_hide-text.scssc | Bin 0 -> 2286 bytes
.../_image.scssc | Bin 0 -> 5374 bytes
.../_labels.scssc | Bin 0 -> 1661 bytes
.../_list-group.scssc | Bin 0 -> 3497 bytes
.../_nav-divider.scssc | Bin 0 -> 1519 bytes
.../_nav-vertical-align.scssc | Bin 0 -> 1603 bytes
.../_opacity.scssc | Bin 0 -> 1403 bytes
.../_pagination.scssc | Bin 0 -> 3079 bytes
.../_panels.scssc | Bin 0 -> 3225 bytes
.../_progress-bar.scssc | Bin 0 -> 1320 bytes
.../_reset-filter.scssc | Bin 0 -> 909 bytes
.../_resize.scssc | Bin 0 -> 1027 bytes
.../_responsive-visibility.scssc | Bin 0 -> 2154 bytes
.../_size.scssc | Bin 0 -> 1026 bytes
.../_tab-focus.scssc | Bin 0 -> 908 bytes
.../_table-row.scssc | Bin 0 -> 3736 bytes
.../_text-emphasis.scssc | Bin 0 -> 1272 bytes
.../_text-overflow.scssc | Bin 0 -> 852 bytes
.../_vendor-prefixes.scssc | Bin 0 -> 25921 bytes
.../_alerts.scssc | Bin 0 -> 7081 bytes
.../_badges.scssc | Bin 0 -> 6155 bytes
.../_breadcrumbs.scssc | Bin 0 -> 3271 bytes
.../_button-groups.scssc | Bin 0 -> 29052 bytes
.../_buttons.scssc | Bin 0 -> 18048 bytes
.../_carousel.scssc | Bin 0 -> 23361 bytes
.../_close.scssc | Bin 0 -> 3810 bytes
.../_code.scssc | Bin 0 -> 7567 bytes
.../_component-animations.scssc | Bin 0 -> 3884 bytes
.../_dropdowns.scssc | Bin 0 -> 22235 bytes
.../_forms.scssc | Bin 0 -> 57062 bytes
.../_glyphicons.scssc | Bin 0 -> 100566 bytes
.../_grid.scssc | Bin 0 -> 5245 bytes
.../_input-groups.scssc | Bin 0 -> 21059 bytes
.../_jumbotron.scssc | Bin 0 -> 5524 bytes
.../_labels.scssc | Bin 0 -> 5940 bytes
.../_list-group.scssc | Bin 0 -> 13682 bytes
.../_media.scssc | Bin 0 -> 4353 bytes
.../_mixins.scssc | Bin 0 -> 2878 bytes
.../_modals.scssc | Bin 0 -> 17357 bytes
.../_navbar.scssc | Bin 0 -> 69119 bytes
.../_navs.scssc | Bin 0 -> 23704 bytes
.../_normalize.scssc | Bin 0 -> 30666 bytes
.../_pager.scssc | Bin 0 -> 5506 bytes
.../_pagination.scssc | Bin 0 -> 10927 bytes
.../_panels.scssc | Bin 0 -> 29965 bytes
.../_popovers.scssc | Bin 0 -> 17474 bytes
.../_print.scssc | Bin 0 -> 9142 bytes
.../_progress-bars.scssc | Bin 0 -> 10967 bytes
.../_responsive-embed.scssc | Bin 0 -> 3198 bytes
.../_responsive-utilities.scssc | Bin 0 -> 17316 bytes
.../_scaffolding.scssc | Bin 0 -> 12740 bytes
.../_tables.scssc | Bin 0 -> 22818 bytes
.../_thumbnails.scssc | Bin 0 -> 4701 bytes
.../_tooltip.scssc | Bin 0 -> 14126 bytes
.../_type.scssc | Bin 0 -> 32622 bytes
.../_utilities.scssc | Bin 0 -> 4223 bytes
.../_variables.scssc | Bin 0 -> 95885 bytes
.../_wells.scssc | Bin 0 -> 3638 bytes
.../bootstrap.scssc | Bin 0 -> 3038 bytes
vendor/bootstrap-3.2.0/LICENSE | 21 +
vendor/bootstrap-3.2.0/_alerts.scss | 68 +
vendor/bootstrap-3.2.0/_badges.scss | 57 +
vendor/bootstrap-3.2.0/_breadcrumbs.scss | 26 +
vendor/bootstrap-3.2.0/_button-groups.scss | 240 +
vendor/bootstrap-3.2.0/_buttons.scss | 157 +
vendor/bootstrap-3.2.0/_carousel.scss | 243 +
vendor/bootstrap-3.2.0/_close.scss | 35 +
vendor/bootstrap-3.2.0/_code.scss | 68 +
.../_component-animations.scss | 35 +
vendor/bootstrap-3.2.0/_dropdowns.scss | 215 +
vendor/bootstrap-3.2.0/_forms.scss | 538 ++
vendor/bootstrap-3.2.0/_glyphicons.scss | 237 +
vendor/bootstrap-3.2.0/_grid.scss | 84 +
vendor/bootstrap-3.2.0/_input-groups.scss | 166 +
vendor/bootstrap-3.2.0/_jumbotron.scss | 48 +
vendor/bootstrap-3.2.0/_labels.scss | 66 +
vendor/bootstrap-3.2.0/_list-group.scss | 131 +
vendor/bootstrap-3.2.0/_media.scss | 56 +
vendor/bootstrap-3.2.0/_mixins.scss | 39 +
vendor/bootstrap-3.2.0/_modals.scss | 150 +
vendor/bootstrap-3.2.0/_navbar.scss | 659 ++
vendor/bootstrap-3.2.0/_navs.scss | 242 +
vendor/bootstrap-3.2.0/_normalize.scss | 425 ++
vendor/bootstrap-3.2.0/_pager.scss | 55 +
vendor/bootstrap-3.2.0/_pagination.scss | 88 +
vendor/bootstrap-3.2.0/_panels.scss | 243 +
vendor/bootstrap-3.2.0/_popovers.scss | 133 +
vendor/bootstrap-3.2.0/_print.scss | 101 +
vendor/bootstrap-3.2.0/_progress-bars.scss | 105 +
vendor/bootstrap-3.2.0/_responsive-embed.scss | 34 +
.../_responsive-utilities.scss | 174 +
vendor/bootstrap-3.2.0/_scaffolding.scss | 150 +
vendor/bootstrap-3.2.0/_tables.scss | 233 +
vendor/bootstrap-3.2.0/_theme.scss | 258 +
vendor/bootstrap-3.2.0/_thumbnails.scss | 38 +
vendor/bootstrap-3.2.0/_tooltip.scss | 95 +
vendor/bootstrap-3.2.0/_type.scss | 304 +
vendor/bootstrap-3.2.0/_utilities.scss | 57 +
vendor/bootstrap-3.2.0/_variables.scss | 850 +++
vendor/bootstrap-3.2.0/_wells.scss | 29 +
vendor/bootstrap-3.2.0/bootstrap.scss | 50 +
vendor/bootstrap-3.2.0/mixins/_alerts.scss | 14 +
.../mixins/_background-variant.scss | 11 +
.../mixins/_border-radius.scss | 18 +
vendor/bootstrap-3.2.0/mixins/_buttons.scss | 50 +
.../bootstrap-3.2.0/mixins/_center-block.scss | 7 +
vendor/bootstrap-3.2.0/mixins/_clearfix.scss | 22 +
vendor/bootstrap-3.2.0/mixins/_forms.scss | 84 +
vendor/bootstrap-3.2.0/mixins/_gradients.scss | 58 +
.../mixins/_grid-framework.scss | 81 +
vendor/bootstrap-3.2.0/mixins/_grid.scss | 122 +
vendor/bootstrap-3.2.0/mixins/_hide-text.scss | 21 +
vendor/bootstrap-3.2.0/mixins/_image.scss | 34 +
vendor/bootstrap-3.2.0/mixins/_labels.scss | 12 +
.../bootstrap-3.2.0/mixins/_list-group.scss | 31 +
.../bootstrap-3.2.0/mixins/_nav-divider.scss | 10 +
.../mixins/_nav-vertical-align.scss | 9 +
vendor/bootstrap-3.2.0/mixins/_opacity.scss | 8 +
.../bootstrap-3.2.0/mixins/_pagination.scss | 23 +
vendor/bootstrap-3.2.0/mixins/_panels.scss | 24 +
.../bootstrap-3.2.0/mixins/_progress-bar.scss | 10 +
.../bootstrap-3.2.0/mixins/_reset-filter.scss | 8 +
vendor/bootstrap-3.2.0/mixins/_resize.scss | 6 +
.../mixins/_responsive-visibility.scss | 21 +
vendor/bootstrap-3.2.0/mixins/_size.scss | 10 +
vendor/bootstrap-3.2.0/mixins/_tab-focus.scss | 9 +
vendor/bootstrap-3.2.0/mixins/_table-row.scss | 28 +
.../mixins/_text-emphasis.scss | 11 +
.../mixins/_text-overflow.scss | 8 +
.../mixins/_vendor-prefixes.scss | 219 +
198 files changed, 23011 insertions(+), 983 deletions(-)
create mode 100644 public/vendor/bootstrap-3.2.0/css/theme0.css
create mode 100644 public/vendor/bootstrap-3.2.0/css/theme1.css
create mode 100755 public/vendor/bootstrap-3.2.0/fonts/glyphicons-halflings-regular.eot
create mode 100755 public/vendor/bootstrap-3.2.0/fonts/glyphicons-halflings-regular.svg
create mode 100755 public/vendor/bootstrap-3.2.0/fonts/glyphicons-halflings-regular.ttf
create mode 100755 public/vendor/bootstrap-3.2.0/fonts/glyphicons-halflings-regular.woff
create mode 100755 public/vendor/bootstrap-3.2.0/js/bootstrap.js
create mode 100755 public/vendor/bootstrap-3.2.0/js/bootstrap.min.js
create mode 100644 public/vendor/icomoon/fonts/icomoon.eot
create mode 100644 public/vendor/icomoon/fonts/icomoon.svg
create mode 100644 public/vendor/icomoon/fonts/icomoon.ttf
create mode 100644 public/vendor/icomoon/fonts/icomoon.woff
create mode 100644 public/vendor/icomoon/selection.json
create mode 100644 public/vendor/icomoon/style.css
create mode 100644 public/vendor/jquery-2.1.1.min.js
delete mode 100644 templates/admin_shifts.html
delete mode 100644 templates/admin_shifts_angel_types.html
create mode 100644 themes/base.scss
create mode 100644 themes/theme0.scss
create mode 100644 themes/theme1.scss
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_alerts.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_background-variant.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_border-radius.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_buttons.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_center-block.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_clearfix.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_forms.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_gradients.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_grid-framework.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_grid.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_hide-text.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_image.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_labels.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_list-group.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_nav-divider.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_nav-vertical-align.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_opacity.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_pagination.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_panels.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_progress-bar.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_reset-filter.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_resize.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_responsive-visibility.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_size.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_tab-focus.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_table-row.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_text-emphasis.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_text-overflow.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/70b04e4ef149635d6ef46caae8719cf33d74aa5e/_vendor-prefixes.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_alerts.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_badges.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_breadcrumbs.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_button-groups.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_buttons.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_carousel.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_close.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_code.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_component-animations.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_dropdowns.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_forms.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_glyphicons.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_grid.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_input-groups.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_jumbotron.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_labels.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_list-group.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_media.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_mixins.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_modals.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_navbar.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_navs.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_normalize.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_pager.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_pagination.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_panels.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_popovers.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_print.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_progress-bars.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_responsive-embed.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_responsive-utilities.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_scaffolding.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_tables.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_thumbnails.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_tooltip.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_type.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_utilities.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_variables.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/_wells.scssc
create mode 100644 vendor/bootstrap-3.2.0/.sass-cache/797c47d35b511f551f02e828c6075b322aebf94a/bootstrap.scssc
create mode 100644 vendor/bootstrap-3.2.0/LICENSE
create mode 100644 vendor/bootstrap-3.2.0/_alerts.scss
create mode 100644 vendor/bootstrap-3.2.0/_badges.scss
create mode 100644 vendor/bootstrap-3.2.0/_breadcrumbs.scss
create mode 100644 vendor/bootstrap-3.2.0/_button-groups.scss
create mode 100644 vendor/bootstrap-3.2.0/_buttons.scss
create mode 100644 vendor/bootstrap-3.2.0/_carousel.scss
create mode 100644 vendor/bootstrap-3.2.0/_close.scss
create mode 100644 vendor/bootstrap-3.2.0/_code.scss
create mode 100644 vendor/bootstrap-3.2.0/_component-animations.scss
create mode 100644 vendor/bootstrap-3.2.0/_dropdowns.scss
create mode 100644 vendor/bootstrap-3.2.0/_forms.scss
create mode 100644 vendor/bootstrap-3.2.0/_glyphicons.scss
create mode 100644 vendor/bootstrap-3.2.0/_grid.scss
create mode 100644 vendor/bootstrap-3.2.0/_input-groups.scss
create mode 100644 vendor/bootstrap-3.2.0/_jumbotron.scss
create mode 100644 vendor/bootstrap-3.2.0/_labels.scss
create mode 100644 vendor/bootstrap-3.2.0/_list-group.scss
create mode 100644 vendor/bootstrap-3.2.0/_media.scss
create mode 100644 vendor/bootstrap-3.2.0/_mixins.scss
create mode 100644 vendor/bootstrap-3.2.0/_modals.scss
create mode 100644 vendor/bootstrap-3.2.0/_navbar.scss
create mode 100644 vendor/bootstrap-3.2.0/_navs.scss
create mode 100644 vendor/bootstrap-3.2.0/_normalize.scss
create mode 100644 vendor/bootstrap-3.2.0/_pager.scss
create mode 100644 vendor/bootstrap-3.2.0/_pagination.scss
create mode 100644 vendor/bootstrap-3.2.0/_panels.scss
create mode 100644 vendor/bootstrap-3.2.0/_popovers.scss
create mode 100644 vendor/bootstrap-3.2.0/_print.scss
create mode 100644 vendor/bootstrap-3.2.0/_progress-bars.scss
create mode 100644 vendor/bootstrap-3.2.0/_responsive-embed.scss
create mode 100644 vendor/bootstrap-3.2.0/_responsive-utilities.scss
create mode 100644 vendor/bootstrap-3.2.0/_scaffolding.scss
create mode 100644 vendor/bootstrap-3.2.0/_tables.scss
create mode 100644 vendor/bootstrap-3.2.0/_theme.scss
create mode 100644 vendor/bootstrap-3.2.0/_thumbnails.scss
create mode 100644 vendor/bootstrap-3.2.0/_tooltip.scss
create mode 100644 vendor/bootstrap-3.2.0/_type.scss
create mode 100644 vendor/bootstrap-3.2.0/_utilities.scss
create mode 100644 vendor/bootstrap-3.2.0/_variables.scss
create mode 100644 vendor/bootstrap-3.2.0/_wells.scss
create mode 100644 vendor/bootstrap-3.2.0/bootstrap.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_alerts.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_background-variant.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_border-radius.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_buttons.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_center-block.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_clearfix.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_forms.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_gradients.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_grid-framework.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_grid.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_hide-text.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_image.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_labels.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_list-group.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_nav-divider.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_nav-vertical-align.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_opacity.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_pagination.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_panels.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_progress-bar.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_reset-filter.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_resize.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_responsive-visibility.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_size.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_tab-focus.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_table-row.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_text-emphasis.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_text-overflow.scss
create mode 100644 vendor/bootstrap-3.2.0/mixins/_vendor-prefixes.scss
diff --git a/db/update.sql b/db/update.sql
index 9457559a..9862c027 100644
--- a/db/update.sql
+++ b/db/update.sql
@@ -1,3 +1,6 @@
+/* fix questions */
+ALTER TABLE `Questions` CHANGE `AID` `AID` INT( 11 ) NULL DEFAULT NULL ;
+
/* teamcoordinators */
ALTER TABLE `UserAngelTypes` ADD `coordinator` BOOLEAN NOT NULL;
ALTER TABLE `UserAngelTypes` ADD INDEX ( `coordinator` );
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index 59e55a2d..ba0d65d9 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -149,7 +149,7 @@ function angeltype_edit_controller() {
}
return array(
- isset($angeltype) ? sprintf(_("Edit %s"), $name) : _("Add new angeltype"),
+ sprintf(_("Edit %s"), $name),
AngelType_edit_view($name, $restricted, $description, $coordinator_mode)
);
}
diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php
index bf83fa9e..f65f54e3 100644
--- a/includes/controller/users_controller.php
+++ b/includes/controller/users_controller.php
@@ -1,7 +1,53 @@
' . $msg . '
';
+ return '' . $msg . '
';
} else {
if (! isset($_SESSION['msg']))
$_SESSION['msg'] = "";
@@ -33,7 +33,7 @@ function error($msg, $immediatly = false) {
if ($immediatly) {
if ($msg == "")
return "";
- return '' . $msg . '
';
+ return '' . $msg . '
';
} else {
if (! isset($_SESSION['msg']))
$_SESSION['msg'] = "";
@@ -48,7 +48,7 @@ function success($msg, $immediatly = false) {
if ($immediatly) {
if ($msg == "")
return "";
- return '' . $msg . '
';
+ return '' . $msg . '
';
} else {
if (! isset($_SESSION['msg']))
$_SESSION['msg'] = "";
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index 805c8357..24628d0e 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -137,7 +137,7 @@ function admin_active() {
'count' => '' . sql_select_single_cell("SELECT count(*) FROM `User` WHERE `Tshirt`=1") . ' '
);
- return page(array(
+ return page_with_title(admin_active_title(), array(
form(array(
form_text('search', _("Search angel:"), $search),
form_submit('submit', _("Search"))
diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php
index 001da9ba..bec1ae56 100644
--- a/includes/pages/admin_arrive.php
+++ b/includes/pages/admin_arrive.php
@@ -15,18 +15,18 @@ function admin_arrive() {
if ($user_source != null) {
sql_query("UPDATE `User` SET `Gekommen`=0 WHERE `UID`=" . sql_escape($id) . " LIMIT 1");
engelsystem_log("User set to not arrived: " . User_Nick_render($user_source));
- $msg = success("Reset done. Angel has not arrived.", true);
+ $msg = success(_("Reset done. Angel has not arrived."), true);
} else
- $msg = error("Angel not found.", true);
+ $msg = error(_("Angel not found."), true);
} elseif (isset($_REQUEST['arrived']) && preg_match("/^[0-9]*$/", $_REQUEST['arrived'])) {
$id = $_REQUEST['arrived'];
$user_source = User($id);
if ($user_source != null) {
sql_query("UPDATE `User` SET `Gekommen`=1 WHERE `UID`=" . sql_escape($id) . " LIMIT 1");
engelsystem_log("User set has arrived: " . User_Nick_render($user_source));
- $msg = success("Angel has been marked as arrived.", true);
+ $msg = success(_("Angel has been marked as arrived."), true);
} else
- $msg = error("Angel not found.", true);
+ $msg = error(_("Angel not found."), true);
}
$users = sql_select("SELECT * FROM `User` ORDER BY `Nick`");
@@ -60,7 +60,7 @@ function admin_arrive() {
$table .= '';
$users_matched[] = $usr;
}
- return page(array(
+ return page_with_title(admin_arrive_title(), array(
msg(),
form(array(
form_text('search', _("Search"), $search),
diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php
index 86bd38a1..19a4c99f 100644
--- a/includes/pages/admin_free.php
+++ b/includes/pages/admin_free.php
@@ -5,31 +5,33 @@ function admin_free_title() {
function admin_free() {
global $privileges;
-
+
$search = "";
- if (isset ($_REQUEST['search']))
+ if (isset($_REQUEST['search']))
$search = strip_request_item('search');
-
+
$angeltypesearch = "";
- if (empty ($_REQUEST['angeltype']))
+ if (empty($_REQUEST['angeltype']))
$_REQUEST['angeltype'] = '';
else {
$angeltypesearch = " INNER JOIN `UserAngelTypes` ON (`UserAngelTypes`.`angeltype_id` = '" . sql_escape($_REQUEST['angeltype']) . "' AND `UserAngelTypes`.`user_id` = `User`.`UID`";
- if (isset ($_REQUEST['confirmed_only']))
+ if (isset($_REQUEST['confirmed_only']))
$angeltypesearch .= " AND `UserAngelTypes`.`confirm_user_id`";
$angeltypesearch .= ") ";
}
-
+
$angel_types_source = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `name`");
- $angel_types = array('' => 'alle Typen');
+ $angel_types = array(
+ '' => 'alle Typen'
+ );
foreach ($angel_types_source as $angel_type)
$angel_types[$angel_type['id']] = $angel_type['name'];
-
+
$users = sql_select("SELECT `User`.* FROM `User` ${angeltypesearch} LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` LEFT JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID` AND `Shifts`.`start` < " . sql_escape(time()) . " AND `Shifts`.`end` > " . sql_escape(time()) . ") WHERE `User`.`Gekommen` = 1 AND `Shifts`.`SID` IS NULL GROUP BY `User`.`UID` ORDER BY `Nick`");
-
+
$table = "";
if ($search == "")
- $tokens = array ();
+ $tokens = array();
else
$tokens = explode(" ", $search);
foreach ($users as $usr) {
@@ -38,10 +40,10 @@ function admin_free() {
$index = join("", $usr);
foreach ($tokens as $t)
if (stristr($index, trim($t))) {
- $match = true;
- break;
- }
- if (!$match)
+ $match = true;
+ break;
+ }
+ if (! $match)
continue;
}
$table .= '';
@@ -52,15 +54,16 @@ function admin_free() {
$table .= 'edit ';
else
$table .= '' . User_Nick_render($usr) . ' ';
-
+
$table .= ' ';
}
- return template_render('../templates/admin_free.html', array (
- 'search' => $search,
- 'angeltypes' => html_select_key('angeltype', 'angeltype', $angel_types, $_REQUEST['angeltype']),
- 'confirmed_only' => isset($_REQUEST['confirmed_only'])? 'checked' : '',
- 'table' => $table,
- 'link' => page_link_to('admin_free')
+ return template_render('../templates/admin_free.html', array(
+ 'title' => admin_free_title(),
+ 'search' => $search,
+ 'angeltypes' => html_select_key('angeltype', 'angeltype', $angel_types, $_REQUEST['angeltype']),
+ 'confirmed_only' => isset($_REQUEST['confirmed_only']) ? 'checked' : '',
+ 'table' => $table,
+ 'link' => page_link_to('admin_free')
));
}
?>
diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php
index 2dfc169a..b60a9fca 100644
--- a/includes/pages/admin_log.php
+++ b/includes/pages/admin_log.php
@@ -6,18 +6,18 @@ function admin_log_title() {
function admin_log() {
$log_entries_source = LogEntries();
$log_entries = array();
- foreach($log_entries_source as $log_entry) {
+ foreach ($log_entries_source as $log_entry) {
$log_entry['date'] = date("H:i", $log_entry['timestamp']);
$log_entries[] = $log_entry;
}
-
- return page(array(
- msg(),
- table(array(
- 'date' => "Time",
- 'nick' => "Angel",
- 'message' => "Log Entry"
- ), $log_entries)
+
+ return page_with_title(admin_log_title(), array(
+ msg(),
+ table(array(
+ 'date' => "Time",
+ 'nick' => "Angel",
+ 'message' => "Log Entry"
+ ), $log_entries)
));
}
?>
diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php
index 25807151..39b37068 100644
--- a/includes/pages/admin_news.php
+++ b/includes/pages/admin_news.php
@@ -1,93 +1,61 @@
0) {
- list ($news) = $news;
-
+ $html = '' . _("Edit news entry") . ' ';
+ if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
+ $id = $_REQUEST['id'];
+ else
+ return error("Incomplete call, missing News ID.", true);
+
+ $news = sql_select("SELECT * FROM `News` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
+ if (count($news) > 0) {
+ switch ($_REQUEST["action"]) {
+ default:
+ redirect(page_link_to('news'));
+ case 'edit':
+ list($news) = $news;
+
$user_source = User($news['UID']);
- if($user_source === false)
+ if ($user_source === false)
engelsystem_error("Unable to load user.");
-
- $html .= '
« Back ';
-
- $html .= "
";
-
- $html .= "
\n";
- $html .= " \n";
- $html .= " \n";
- $html .= " ";
- } else
- return error("No News found.", true);
- break;
-
- case 'save' :
- if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
- $id = $_REQUEST['id'];
- else
- return error("Incomplete call, missing News ID.", true);
-
- $news = sql_select("SELECT * FROM `News` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
- if (count($news) > 0) {
- list ($news) = $news;
-
- sql_query("UPDATE `News` SET `Datum`='" . sql_escape(time()) . "', `Betreff`='" . sql_escape($_POST["eBetreff"]) . "', `Text`='" . sql_escape($_POST["eText"]) . "', `UID`='" . sql_escape($user['UID']) .
- "', `Treffen`='" . sql_escape($_POST["eTreffen"]) . "' WHERE `ID`=".sql_escape($id)." LIMIT 1");
+
+ $html .= form(array(
+ form_info(_("Date"), date("Y-m-d H:i", $news['Datum'])),
+ form_info(_("Author"), User_Nick_render($user_source)),
+ form_text('eBetreff', _("Subject"), $news['Betreff']),
+ form_textarea('eText', _("Message"), $news['Text']),
+ form_checkbox('eTreffen', _("Meeting"), $news['Treffen'] == 1, 1),
+ form_submit('submit', _("Save"))
+ ), page_link_to('admin_news&action=save&id=' . $id));
+
+ $html .= '
' . _("Delete") . '';
+ break;
+
+ case 'save':
+ list($news) = $news;
+
+ sql_query("UPDATE `News` SET `Datum`='" . sql_escape(time()) . "', `Betreff`='" . sql_escape($_POST["eBetreff"]) . "', `Text`='" . sql_escape($_POST["eText"]) . "', `UID`='" . sql_escape($user['UID']) . "', `Treffen`='" . sql_escape($_POST["eTreffen"]) . "' WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
engelsystem_log("News updated: " . $_POST["eBetreff"]);
+ success(_("News entry updated."));
redirect(page_link_to("news"));
- } else
- return error("No News found.", true);
- break;
-
- case 'delete' :
- if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
- $id = $_REQUEST['id'];
- else
- return error("Incomplete call, missing News ID.", true);
-
- $news = sql_select("SELECT * FROM `News` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
- if (count($news) > 0) {
- list ($news) = $news;
-
+ break;
+
+ case 'delete':
+ list($news) = $news;
+
sql_query("DELETE FROM `News` WHERE `ID`=" . sql_escape($id) . " LIMIT 1");
engelsystem_log("News deleted: " . $news['Betreff']);
+ success(_("News entry deleted."));
redirect(page_link_to("news"));
- } else
- return error("No News found.", true);
- break;
- }
+ break;
+ }
+ } else
+ return error("No News found.", true);
}
- return $html;
+ return $html . '
';
}
?>
\ No newline at end of file
diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php
index b70495f6..5d4fbd61 100644
--- a/includes/pages/admin_questions.php
+++ b/includes/pages/admin_questions.php
@@ -5,77 +5,75 @@ function admin_questions_title() {
function admin_new_questions() {
global $user, $privileges;
-
+
if (in_array("admin_questions", $privileges)) {
- $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID`=0");
-
+ $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL");
+
if ($new_messages > 0)
- return 'Es gibt unbeantwortete Fragen!
';
+ return info('Es gibt unbeantwortete Fragen! ', true);
}
-
+
return "";
}
function admin_questions() {
global $user;
-
- if (!isset ($_REQUEST['action'])) {
+
+ if (! isset($_REQUEST['action'])) {
$open_questions = "";
- $questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0");
+ $questions = sql_select("SELECT * FROM `Questions` WHERE `AID` IS NULL");
foreach ($questions as $question) {
$user_source = User($question['UID']);
- if($user_source === false)
+ if ($user_source === false)
engelsystem_error("Unable to load user.");
-
- $open_questions .= template_render(
- '../templates/admin_question_unanswered.html', array (
- 'question_nick' => User_Nick_render($user_source),
- 'question_id' => $question['QID'],
- 'link' => page_link_to("admin_questions"),
- 'question' => str_replace("\n", ' ', $question['Question'])
- ));
+
+ $open_questions .= template_render('../templates/admin_question_unanswered.html', array(
+ 'question_nick' => User_Nick_render($user_source),
+ 'question_id' => $question['QID'],
+ 'link' => page_link_to("admin_questions"),
+ 'question' => str_replace("\n", ' ', $question['Question'])
+ ));
}
-
+
$answered_questions = "";
- $questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0");
-
+ $questions = sql_select("SELECT * FROM `Questions` WHERE NOT `AID` IS NULL");
+
foreach ($questions as $question) {
$user_source = User($question['UID']);
- if($user_source === false)
+ if ($user_source === false)
engelsystem_error("Unable to load user.");
-
+
$answer_user_source = User($question['AID']);
- if($answer_user_source === false)
+ if ($answer_user_source === false)
engelsystem_error("Unable to load user.");
-
- $answered_questions .= template_render(
- '../templates/admin_question_answered.html', array (
- 'question_id' => $question['QID'],
- 'question_nick' => User_Nick_render($user_source),
- 'question' => str_replace("\n", " ", $question['Question']),
- 'answer_nick' => User_Nick_render($answer_user_source),
- 'answer' => str_replace("\n", " ", $question['Answer']),
- 'link' => page_link_to("admin_questions"),
- ));
+
+ $answered_questions .= template_render('../templates/admin_question_answered.html', array(
+ 'question_id' => $question['QID'],
+ 'question_nick' => User_Nick_render($user_source),
+ 'question' => str_replace("\n", " ", $question['Question']),
+ 'answer_nick' => User_Nick_render($answer_user_source),
+ 'answer' => str_replace("\n", " ", $question['Answer']),
+ 'link' => page_link_to("admin_questions")
+ ));
}
-
- return template_render('../templates/admin_questions.html', array (
- 'link' => page_link_to("admin_questions"),
- 'open_questions' => $open_questions,
- 'answered_questions' => $answered_questions
+
+ return template_render('../templates/admin_questions.html', array(
+ 'link' => page_link_to("admin_questions"),
+ 'open_questions' => $open_questions,
+ 'answered_questions' => $answered_questions
));
} else {
switch ($_REQUEST['action']) {
- case 'answer' :
- if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
+ case 'answer':
+ if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
$id = $_REQUEST['id'];
else
return error("Incomplete call, missing Question ID.", true);
-
+
$question = sql_select("SELECT * FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1");
- if (count($question) > 0 && $question[0]['AID'] == "0") {
+ if (count($question) > 0 && $question[0]['AID'] == null) {
$answer = trim(preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['answer'])));
-
+
if ($answer != "") {
sql_query("UPDATE `Questions` SET `AID`=" . sql_escape($user['UID']) . ", `Answer`='" . sql_escape($answer) . "' WHERE `QID`=" . sql_escape($id) . " LIMIT 1");
engelsystem_log("Question " . $question[0]['Question'] . " answered: " . $answer);
@@ -85,12 +83,12 @@ function admin_questions() {
} else
return error("No question found.", true);
break;
- case 'delete' :
- if (isset ($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
+ case 'delete':
+ if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
$id = $_REQUEST['id'];
else
return error("Incomplete call, missing Question ID.", true);
-
+
$question = sql_select("SELECT * FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1");
if (count($question) > 0) {
sql_query("DELETE FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1");
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php
index 5e880adb..08d450b8 100644
--- a/includes/pages/admin_rooms.php
+++ b/includes/pages/admin_rooms.php
@@ -5,32 +5,32 @@ function admin_rooms_title() {
function admin_rooms() {
global $user;
-
+
$rooms_source = sql_select("SELECT * FROM `Room` ORDER BY `Name`");
- $rooms = array ();
+ $rooms = array();
foreach ($rooms_source as $room)
- $rooms[] = array (
- 'name' => $room['Name'],
- 'from_pentabarf' => $room['FromPentabarf'] == 'Y' ? '✓' : '',
- 'public' => $room['show'] == 'Y' ? '✓' : '',
- 'actions' => 'edit delete '
+ $rooms[] = array(
+ 'name' => $room['Name'],
+ 'from_pentabarf' => $room['FromPentabarf'] == 'Y' ? '✓' : '',
+ 'public' => $room['show'] == 'Y' ? '✓' : '',
+ 'actions' => 'edit delete '
);
-
- if (isset ($_REQUEST['show'])) {
+
+ if (isset($_REQUEST['show'])) {
$msg = "";
$name = "";
$from_pentabarf = "";
$public = 'Y';
$number = "";
-
+
$angeltypes_source = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
- $angeltypes = array ();
- $angeltypes_count = array ();
+ $angeltypes = array();
+ $angeltypes_count = array();
foreach ($angeltypes_source as $angeltype) {
$angeltypes[$angeltype['id']] = $angeltype['name'];
$angeltypes_count[$angeltype['id']] = 0;
}
-
+
if (test_request_int('id')) {
$room = sql_select("SELECT * FROM `Room` WHERE `RID`=" . sql_escape($_REQUEST['id']));
if (count($room) > 0) {
@@ -44,120 +44,119 @@ function admin_rooms() {
} else
redirect(page_link_to('admin_rooms'));
}
-
+
if ($_REQUEST['show'] == 'edit') {
- if (isset ($_REQUEST['submit'])) {
+ if (isset($_REQUEST['submit'])) {
$ok = true;
-
- if (isset ($_REQUEST['name']) && strlen(strip_request_item('name')) > 0)
+
+ if (isset($_REQUEST['name']) && strlen(strip_request_item('name')) > 0)
$name = strip_request_item('name');
else {
$ok = false;
$msg .= error("Please enter a name.", true);
}
-
- if (isset ($_REQUEST['from_pentabarf']))
+
+ if (isset($_REQUEST['from_pentabarf']))
$from_pentabarf = 'Y';
else
$from_pentabarf = '';
-
- if (isset ($_REQUEST['public']))
+
+ if (isset($_REQUEST['public']))
$public = 'Y';
else
$public = '';
-
- if (isset ($_REQUEST['number']))
+
+ if (isset($_REQUEST['number']))
$number = strip_request_item('number');
else
$ok = false;
-
+
foreach ($angeltypes as $angeltype_id => $angeltype) {
- if (isset ($_REQUEST['angeltype_count_' . $angeltype_id]) && preg_match("/^[0-9]{1,4}$/", $_REQUEST['angeltype_count_' . $angeltype_id]))
+ if (isset($_REQUEST['angeltype_count_' . $angeltype_id]) && preg_match("/^[0-9]{1,4}$/", $_REQUEST['angeltype_count_' . $angeltype_id]))
$angeltypes_count[$angeltype_id] = $_REQUEST['angeltype_count_' . $angeltype_id];
else {
$ok = false;
$msg .= error(sprintf("Please enter needed angels for type %s.", $angeltype), true);
}
}
-
+
if ($ok) {
- if(isset($id)) {
+ if (isset($id)) {
sql_query("UPDATE `Room` SET `Name`='" . sql_escape($name) . "', `FromPentabarf`='" . sql_escape($from_pentabarf) . "', `show`='" . sql_escape($public) . "', `Number`='" . sql_escape($number) . "' WHERE `RID`=" . sql_escape($id) . " LIMIT 1");
engelsystem_log("Room updated: " . $name . ", pentabarf import: " . $from_pentabarf . ", public: " . $public . ", number: " . $number);
} else {
- sql_query("INSERT INTO `Room` SET `Name`='" . sql_escape($name) . "', `FromPentabarf`='" . sql_escape($from_pentabarf) . "', `show`='" . sql_escape($public) . "', `Number`='" . sql_escape($number) . "'");
+ sql_query("INSERT INTO `Room` SET `Name`='" . sql_escape($name) . "', `FromPentabarf`='" . sql_escape($from_pentabarf) . "', `show`='" . sql_escape($public) . "', `Number`='" . sql_escape($number) . "'");
$id = sql_id();
engelsystem_log("Room created: " . $name . ", pentabarf import: " . $from_pentabarf . ", public: " . $public . ", number: " . $number);
}
-
+
sql_query("DELETE FROM `NeededAngelTypes` WHERE `room_id`=" . sql_escape($id));
$needed_angeltype_info = array();
foreach ($angeltypes_count as $angeltype_id => $angeltype_count) {
$angeltype_source = sql_select("SELECT * FROM `AngelTypes` WHERE `id`=" . sql_escape($angeltype_id) . " LIMIT 1");
- if(count($angeltype_source) > 0) {
+ if (count($angeltype_source) > 0) {
sql_query("INSERT INTO `NeededAngelTypes` SET `room_id`=" . sql_escape($id) . ", `angel_type_id`=" . sql_escape($angeltype_id) . ", `count`=" . sql_escape($angeltype_count));
$needed_angeltype_info[] = $angeltypes_source[0]['name'] . ": " . $angeltype_count;
}
}
-
+
engelsystem_log("Set needed angeltypes of room " . $name . " to: " . join(", ", $needed_angeltype_info));
success("Room saved.");
redirect(page_link_to("admin_rooms"));
}
}
- $angeltypes_count_form = array ();
+ $angeltypes_count_form = array();
foreach ($angeltypes as $angeltype_id => $angeltype)
$angeltypes_count_form[] = form_text('angeltype_count_' . $angeltype_id, $angeltype, $angeltypes_count[$angeltype_id]);
-
- return page(array (
- buttons(array (
- button(page_link_to('admin_rooms'), "Back", 'back')
- )),
- $msg,
- form(array (
- form_text('name', "Name", $name),
- form_checkbox('from_pentabarf', "Pentabarf-Import", $from_pentabarf),
- form_checkbox('public', "Public", $public),
- form_text('number', "Number", $number),
- form_info("Needed angels:", ""),
- join($angeltypes_count_form),
- form_submit('submit', 'Save')
- ))
+
+ return page_with_title(admin_rooms_title(), array(
+ buttons(array(
+ button(page_link_to('admin_rooms'), "Back", 'back')
+ )),
+ $msg,
+ form(array(
+ form_text('name', "Name", $name),
+ form_checkbox('from_pentabarf', "Pentabarf-Import", $from_pentabarf),
+ form_checkbox('public', "Public", $public),
+ form_text('number', "Number", $number),
+ form_info("Needed angels:", ""),
+ join($angeltypes_count_form),
+ form_submit('submit', 'Save')
+ ))
));
- }
- elseif ($_REQUEST['show'] == 'delete') {
- if (isset ($_REQUEST['ack'])) {
+ } elseif ($_REQUEST['show'] == 'delete') {
+ if (isset($_REQUEST['ack'])) {
sql_query("DELETE FROM `Room` WHERE `RID`=" . sql_escape($id) . " LIMIT 1");
sql_query("DELETE FROM `NeededAngelTypes` WHERE `room_id`=" . sql_escape($id) . " LIMIT 1");
-
+
engelsystem_log("Room deleted: " . $name);
success(sprintf("Room %s deleted.", $name));
redirect(page_link_to('admin_rooms'));
}
-
- return page(array (
- buttons(array (
- button(page_link_to('admin_rooms'), "Back", 'back')
- )),
- sprintf("Do you want to delete room %s?", $name),
- buttons(array (
- button(page_link_to('admin_rooms') . '&show=delete&id=' . $id . '&ack', "Delete", 'delete')
- ))
+
+ return page_with_title(admin_rooms_title(), array(
+ buttons(array(
+ button(page_link_to('admin_rooms'), "Back", 'back')
+ )),
+ sprintf("Do you want to delete room %s?", $name),
+ buttons(array(
+ button(page_link_to('admin_rooms') . '&show=delete&id=' . $id . '&ack', "Delete", 'delete')
+ ))
));
}
}
-
- return page(array (
- buttons(array (
- button(page_link_to('admin_rooms') . '&show=edit', "Add", 'add')
- )),
- msg(),
- table(array (
- 'name' => "Name",
- 'from_pentabarf' => "Pentabarf-Import",
- 'public' => "Public",
- 'actions' => ""
- ), $rooms)
+
+ return page_with_title(admin_rooms_title(), array(
+ buttons(array(
+ button(page_link_to('admin_rooms') . '&show=edit', "Add", 'add')
+ )),
+ msg(),
+ table(array(
+ 'name' => "Name",
+ 'from_pentabarf' => "Pentabarf-Import",
+ 'public' => "Public",
+ 'actions' => ""
+ ), $rooms)
));
}
?>
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index 1f17cf6e..7e3cc3b3 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -7,74 +7,73 @@ function admin_shifts_title() {
function admin_shifts() {
$msg = "";
$ok = true;
-
+
$rid = 0;
- $start = DateTime :: createFromFormat("Y-m-d H:i", date("Y-m-d") . " 00:00")->getTimestamp();
- $end = $start +24 * 60 * 60;
- $mode = '';
- $angelmode = '';
+ $start = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d") . " 00:00")->getTimestamp();
+ $end = $start + 24 * 60 * 60;
+ $mode = 'single';
+ $angelmode = 'location';
$length = '';
$change_hours = array();
-
+ $name = "";
+
// Locations laden (auch unsichtbare - fuer Erzengel ist das ok)
$rooms = sql_select("SELECT * FROM `Room` ORDER BY `Name`");
- $room_array = array ();
+ $room_array = array();
foreach ($rooms as $room)
$room_array[$room['RID']] = $room['Name'];
-
- // Engeltypen laden
+
+ // Engeltypen laden
$types = sql_select("SELECT * FROM `AngelTypes` ORDER BY `name`");
- $needed_angel_types = array ();
+ $needed_angel_types = array();
foreach ($types as $type)
$needed_angel_types[$type['id']] = 0;
-
- if (isset ($_REQUEST['preview']) || isset ($_REQUEST['back'])) {
+
+ if (isset($_REQUEST['preview']) || isset($_REQUEST['back'])) {
// Name/Bezeichnung der Schicht, darf leer sein
$name = strip_request_item('name');
-
+
// Auswahl der sichtbaren Locations für die Schichten
- if (isset ($_REQUEST['rid']) && preg_match("/^[0-9]+$/", $_REQUEST['rid']) && isset ($room_array[$_REQUEST['rid']]))
+ if (isset($_REQUEST['rid']) && preg_match("/^[0-9]+$/", $_REQUEST['rid']) && isset($room_array[$_REQUEST['rid']]))
$rid = $_REQUEST['rid'];
else {
$ok = false;
$rid = $rooms[0]['RID'];
$msg .= error("Wähle bitte einen Raum aus.", true);
}
-
- if (isset ($_REQUEST['start']) && $tmp = DateTime :: createFromFormat("Y-m-d H:i", trim($_REQUEST['start'])))
+
+ if (isset($_REQUEST['start']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['start'])))
$start = $tmp->getTimestamp();
else {
$ok = false;
$msg .= error("Bitte gib einen Startzeitpunkt für die Schichten an.", true);
}
-
- if (isset ($_REQUEST['end']) && $tmp = DateTime :: createFromFormat("Y-m-d H:i", trim($_REQUEST['end'])))
+
+ if (isset($_REQUEST['end']) && $tmp = DateTime::createFromFormat("Y-m-d H:i", trim($_REQUEST['end'])))
$end = $tmp->getTimestamp();
else {
$ok = false;
$msg .= error("Bitte gib einen Endzeitpunkt für die Schichten an.", true);
}
-
+
if ($start >= $end) {
$ok = false;
$msg .= error("Das Ende muss nach dem Startzeitpunkt liegen!", true);
}
-
- if (isset ($_REQUEST['mode'])) {
+
+ if (isset($_REQUEST['mode'])) {
if ($_REQUEST['mode'] == 'single') {
$mode = 'single';
- }
- elseif ($_REQUEST['mode'] == 'multi') {
- if (isset ($_REQUEST['length']) && preg_match("/^[0-9]+$/", trim($_REQUEST['length']))) {
+ } elseif ($_REQUEST['mode'] == 'multi') {
+ if (isset($_REQUEST['length']) && preg_match("/^[0-9]+$/", trim($_REQUEST['length']))) {
$mode = 'multi';
$length = trim($_REQUEST['length']);
} else {
$ok = false;
$msg .= error("Bitte gib eine Schichtlänge in Minuten an.", true);
}
- }
- elseif ($_REQUEST['mode'] == 'variable') {
- if (isset ($_REQUEST['change_hours']) && preg_match("/^([0-9]{2}(,|$))/", trim(str_replace(" ", "", $_REQUEST['change_hours'])))) {
+ } elseif ($_REQUEST['mode'] == 'variable') {
+ if (isset($_REQUEST['change_hours']) && preg_match("/^([0-9]{2}(,|$))/", trim(str_replace(" ", "", $_REQUEST['change_hours'])))) {
$mode = 'variable';
$change_hours = array_map('trim', explode(",", $_REQUEST['change_hours']));
} else {
@@ -86,15 +85,14 @@ function admin_shifts() {
$ok = false;
$msg .= error("Bitte wähle einen Modus.", true);
}
-
- if (isset ($_REQUEST['angelmode'])) {
+
+ if (isset($_REQUEST['angelmode'])) {
if ($_REQUEST['angelmode'] == 'location') {
$angelmode = 'location';
- }
- elseif ($_REQUEST['angelmode'] == 'manually') {
+ } elseif ($_REQUEST['angelmode'] == 'manually') {
$angelmode = 'manually';
foreach ($types as $type) {
- if (isset ($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
+ if (isset($_REQUEST['type_' . $type['id']]) && preg_match("/^[0-9]+$/", trim($_REQUEST['type_' . $type['id']]))) {
$needed_angel_types[$type['id']] = trim($_REQUEST['type_' . $type['id']]);
} else {
$ok = false;
@@ -113,51 +111,49 @@ function admin_shifts() {
$ok = false;
$msg .= error("Bitte wähle benötigte Engel.", true);
}
-
+
// Beim Zurück-Knopf das Formular zeigen
- if (isset ($_REQUEST['back']))
+ if (isset($_REQUEST['back']))
$ok = false;
-
- // Alle Eingaben in Ordnung
+
+ // Alle Eingaben in Ordnung
if ($ok) {
if ($angelmode == 'location') {
- $needed_angel_types = array ();
+ $needed_angel_types = array();
$needed_angel_types_location = sql_select("SELECT * FROM `NeededAngelTypes` WHERE `room_id`=" . sql_escape($rid));
foreach ($needed_angel_types_location as $type)
$needed_angel_types[$type['angel_type_id']] = $type['count'];
}
- $shifts = array ();
+ $shifts = array();
if ($mode == 'single') {
- $shifts[] = array (
- 'start' => $start,
- 'end' => $end,
- 'RID' => $rid,
- 'name' => $name
+ $shifts[] = array(
+ 'start' => $start,
+ 'end' => $end,
+ 'RID' => $rid,
+ 'name' => $name
);
- }
- elseif ($mode == 'multi') {
+ } elseif ($mode == 'multi') {
$shift_start = $start;
do {
$shift_end = $shift_start + $length * 60;
-
+
if ($shift_end > $end)
$shift_end = $end;
if ($shift_start >= $shift_end)
break;
-
- $shifts[] = array (
- 'start' => $shift_start,
- 'end' => $shift_end,
- 'RID' => $rid,
- 'name' => $name
+
+ $shifts[] = array(
+ 'start' => $shift_start,
+ 'end' => $shift_end,
+ 'RID' => $rid,
+ 'name' => $name
);
-
+
$shift_start = $shift_end;
} while ($shift_end < $end);
- }
- elseif ($mode == 'variable') {
+ } elseif ($mode == 'variable') {
rsort($change_hours);
- $day = DateTime :: createFromFormat("Y-m-d H:i", date("Y-m-d", $start) . " 00:00")->getTimestamp();
+ $day = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d", $start) . " 00:00")->getTimestamp();
$change_index = 0;
// Ersten/nächsten passenden Schichtwechsel suchen
foreach ($change_hours as $i => $change_hour) {
@@ -165,71 +161,70 @@ function admin_shifts() {
$change_index = $i;
elseif ($start == $day + $change_hour * 60 * 60) {
// Start trifft Schichtwechsel
- $change_index = ($i +count($change_hours) - 1) % count($change_hours);
+ $change_index = ($i + count($change_hours) - 1) % count($change_hours);
break;
} else
break;
}
-
+
$shift_start = $start;
do {
- $day = DateTime :: createFromFormat("Y-m-d H:i", date("Y-m-d", $shift_start) . " 00:00")->getTimestamp();
+ $day = DateTime::createFromFormat("Y-m-d H:i", date("Y-m-d", $shift_start) . " 00:00")->getTimestamp();
$shift_end = $day + $change_hours[$change_index] * 60 * 60;
-
+
if ($shift_end > $end)
$shift_end = $end;
if ($shift_start >= $shift_end)
$shift_end += 24 * 60 * 60;
-
- $shifts[] = array (
- 'start' => $shift_start,
- 'end' => $shift_end,
- 'RID' => $rid,
- 'name' => $name
+
+ $shifts[] = array(
+ 'start' => $shift_start,
+ 'end' => $shift_end,
+ 'RID' => $rid,
+ 'name' => $name
);
-
+
$shift_start = $shift_end;
- $change_index = ($change_index +count($change_hours) - 1) % count($change_hours);
+ $change_index = ($change_index + count($change_hours) - 1) % count($change_hours);
} while ($shift_end < $end);
}
-
+
$shifts_table = "";
foreach ($shifts as $shift) {
- $shifts_table .= '' . date("Y-m-d H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . ' ' . $room_array[$shift['RID']] . ' ';
+ $shifts_table .= ' ' . date("Y-m-d H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . ' ' . $room_array[$shift['RID']] . ' ';
$shifts_table .= '' . $shift['name'];
foreach ($types as $type) {
- if (isset ($needed_angel_types[$type['id']]) && $needed_angel_types[$type['id']] > 0)
- $shifts_table .= '' . $type['name'] . ': ' . $needed_angel_types[$type['id']] . ' missing';
+ if (isset($needed_angel_types[$type['id']]) && $needed_angel_types[$type['id']] > 0)
+ $shifts_table .= ' ' . $type['name'] . ': ' . $needed_angel_types[$type['id']] . ' missing';
}
$shifts_table .= ' ';
}
-
+
// Fürs Anlegen zwischenspeichern:
$_SESSION['admin_shifts_shifts'] = $shifts;
$_SESSION['admin_shifts_types'] = $needed_angel_types;
-
+
$hidden_types = "";
foreach ($needed_angel_types as $type_id => $count)
$hidden_types .= ' ';
- return template_render('../templates/admin_shift_preview.html', array (
- 'shifts_table' => $shifts_table,
- 'name' => $name,
- 'rid' => $rid,
- 'start' => date("Y-m-d H:i", $start),
- 'end' => date("Y-m-d H:i", $end),
- 'mode' => $mode,
- 'length' => $length,
- 'change_hours' => implode(', ', $change_hours),
- 'angelmode' => $angelmode,
- 'needed_angel_types' => $hidden_types
+ return template_render('../templates/admin_shift_preview.html', array(
+ 'shifts_table' => $shifts_table,
+ 'name' => $name,
+ 'rid' => $rid,
+ 'start' => date("Y-m-d H:i", $start),
+ 'end' => date("Y-m-d H:i", $end),
+ 'mode' => $mode,
+ 'length' => $length,
+ 'change_hours' => implode(', ', $change_hours),
+ 'angelmode' => $angelmode,
+ 'needed_angel_types' => $hidden_types
));
}
-
- }
- elseif (isset ($_REQUEST['submit'])) {
- if (!is_array($_SESSION['admin_shifts_shifts']) || !is_array($_SESSION['admin_shifts_types']))
+
+ } elseif (isset($_REQUEST['submit'])) {
+ if (! is_array($_SESSION['admin_shifts_shifts']) || ! is_array($_SESSION['admin_shifts_types']))
redirect(page_link_to('admin_shifts'));
-
+
foreach ($_SESSION['admin_shifts_shifts'] as $shift) {
sql_query("INSERT INTO `Shifts` SET `start`=" . sql_escape($shift['start']) . ", `end`=" . sql_escape($shift['end']) . ", `RID`=" . sql_escape($shift['RID']) . ", `name`='" . sql_escape($shift['name']) . "'");
$shift_id = sql_id();
@@ -237,43 +232,54 @@ function admin_shifts() {
$needed_angel_types_info = array();
foreach ($_SESSION['admin_shifts_types'] as $type_id => $count) {
$angel_type_source = sql_select("SELECT * FROM `AngelTypes` WHERE `id`=" . sql_escape($type_id) . " LIMIT 1");
- if(count($angel_type_source) > 0) {
+ if (count($angel_type_source) > 0) {
sql_query("INSERT INTO `NeededAngelTypes` SET `shift_id`=" . sql_escape($shift_id) . ", `angel_type_id`=" . sql_escape($type_id) . ", `count`=" . sql_escape($count));
$needed_angel_types_info[] = $angel_type_source[0]['name'] . ": " . $count;
}
}
}
-
+
engelsystem_log("Shift needs following angel types: " . join(", ", $needed_angel_types_info));
$msg = success("Schichten angelegt.", true);
} else {
- unset ($_SESSION['admin_shifts_shifts']);
- unset ($_SESSION['admin_shifts_types']);
+ unset($_SESSION['admin_shifts_shifts']);
+ unset($_SESSION['admin_shifts_types']);
}
-
+
+ if (! isset($_REQUEST['rid']))
+ $_REQUEST['rid'] = null;
$room_select = html_select_key('rid', 'rid', $room_array, $_REQUEST['rid']);
$angel_types = "";
- foreach ($types as $type) {
- $angel_types .= template_render('../templates/admin_shifts_angel_types.html', array (
- 'id' => $type['id'],
- 'type' => $type['name'],
- 'value' => $needed_angel_types[$type['id']]
- ));
- }
- return template_render('../templates/admin_shifts.html', array (
- 'angel_types' => $angel_types,
- 'room_select' => $room_select,
- 'msg' => $msg,
- 'name' => $name,
- 'start' => date("Y-m-d H:i", $start),
- 'end' => date("Y-m-d H:i", $end),
- 'mode_single_selected' => $_REQUEST['mode'] == 'single' ? 'checked="checked"' : '',
- 'mode_multi_selected' => $_REQUEST['mode'] == 'multi' ? 'checked="checked"' : '',
- 'mode_multi_length' => !empty ($_REQUEST['length']) ? $_REQUEST['length'] : '120',
- 'mode_variable_selected' => $_REQUEST['mode'] == 'variable' ? 'checked="checked"' : '',
- 'mode_variable_hours' => !empty ($_REQUEST['change_hours']) ? $_REQUEST['change_hours'] : '00, 04, 08, 10, 12, 14, 16, 18, 20, 22',
- 'angelmode_location_selected' => $_REQUEST['angelmode'] == 'location' ? 'checked="checked"' : '',
- 'angelmode_manually_selected' => $_REQUEST['angelmode'] == 'manually' ? 'checked="checked"' : ''
+ foreach ($types as $type)
+ $angel_types .= form_spinner('type_' . $type['id'], $type['name'], $needed_angel_types[$type['id']]);
+
+ return page_with_title(admin_shifts_title(), array(
+ msg(),
+ $msg,
+ form(array(
+ form_text('name', _("Name"), $name),
+ // TODO: form_textarea('description', _("Description"), ''),
+ form_select('rid', _("Room"), $room_array, $_REQUEST['rid']),
+ '',
+ '
',
+ form_text('start', _("Start"), date("Y-m-d H:i", $start)),
+ form_text('end', _("End"), date("Y-m-d H:i", $end)),
+ form_info(_("Mode"), ''),
+ form_radio('mode', _("Create one shift"), $mode == 'single', 'single'),
+ form_radio('mode', _("Create multiple shifts"), $mode == 'multi', 'multi'),
+ form_text('length', _("Length"), ! empty($_REQUEST['length']) ? $_REQUEST['length'] : '120'),
+ form_radio('mode', _("Create multiple shifts with variable length"), $mode == 'variable', 'variable'),
+ form_text('change_hours', _("Shift change hours"), ! empty($_REQUEST['change_hours']) ? $_REQUEST['change_hours'] : '00, 04, 08, 10, 12, 14, 16, 18, 20, 22'),
+ '
',
+ '
',
+ form_info(_("Needed angels"), ''),
+ form_radio('angelmode', _("Take needed angels from room settings"), $angelmode == 'location', 'location'),
+ form_radio('angelmode', _("The following angels are needed"), $angelmode == 'manually', 'manually'),
+ $angel_types,
+ '
',
+ '
',
+ form_submit('preview', _("Preview"))
+ ))
));
}
?>
diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php
index 67ec93f7..7df39d0d 100644
--- a/includes/pages/admin_user.php
+++ b/includes/pages/admin_user.php
@@ -6,7 +6,7 @@ function admin_user_title() {
function admin_user() {
global $user, $privileges, $tshirt_sizes, $privileges;
- $html = "";
+ $html = '';
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,}$/", $_REQUEST['id']) && sql_num_query("SELECT * FROM `User` WHERE `UID`=" . sql_escape($_REQUEST['id'])) > 0) {
$id = $_REQUEST['id'];
@@ -346,6 +346,6 @@ function admin_user() {
'edit' => ''
), $angels);
}
- return $html;
+ return $html . '
';
}
?>
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index e4188151..29487f99 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -135,7 +135,7 @@ function guest_register() {
}
}
- return page(array(
+ return page_with_title(register_title(), array(
_("By completing this form you're registering as a Chaos-Angel. This script will create you an account in the angel task sheduler."),
$msg,
msg(),
@@ -208,17 +208,20 @@ function guest_login() {
}
}
- return page(array(
+ return page_with_title(login_title(), array(
msg(),
+ '',
form(array(
form_text('nick', _("Nick"), $nick),
form_password('password', _("Password")),
+ form_submit('submit', _("Login")),
form_info("", buttons(array(
button(page_link_to('user_password_recovery'), _("I forgot my password"))
))),
- form_submit('submit', _("Login")),
info(_("Please note: You have to activate cookies!"), true)
)),
+ '
',
+ '
',
'
' . register_title() . ' ',
'
' . _("Please sign up, if you want to help us!") . '
',
buttons(array(
@@ -228,7 +231,8 @@ function guest_login() {
'
' . _("Please read about the jobs you can do to help us.") . '
',
buttons(array(
button(page_link_to('angeltypes') . '&action=about', _("Teams/Job description") . ' »')
- ))
+ )),
+ '
'
));
}
?>
diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php
index 7a05491c..a1b565ec 100644
--- a/includes/pages/user_messages.php
+++ b/includes/pages/user_messages.php
@@ -4,16 +4,13 @@ function messages_title() {
}
function user_unread_messages() {
- global $user, $privileges;
+ global $user;
- if (in_array("user_messages", $privileges)) {
+ if (isset($user)) {
$new_messages = sql_num_query("SELECT * FROM `Messages` WHERE isRead='N' AND `RUID`=" . sql_escape($user['UID']));
-
- if ($new_messages > 0)
- return sprintf('%s
', page_link_to("user_messages"), sprintf(ngettext("You have %s new message.", "You have %s new messages.", $new_messages), $new_messages));
+ return '' . $new_messages . ' ';
}
-
- return "";
+ return '';
}
function user_messages() {
@@ -54,6 +51,7 @@ function user_messages() {
}
return template_render('../templates/user_messages.html', array(
+ 'title' => messages_title(),
'link' => page_link_to("user_messages"),
'greeting' => sprintf(_("Hello %s, here can you leave messages for other angels"), User_Nick_render($user)) . ' ',
'messages' => $messages_html,
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index 1395d3bf..12ba5562 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -143,7 +143,7 @@ function user_myshifts() {
'actions' => ""
);
- return page(array(
+ return page_with_title(myshifts_title(), array(
msg(),
$id == $user['UID'] ? sprintf(_('These are your shifts. Please try to appear 15 minutes before your shift begins! You can remove yourself from a shift up to %d hours before it starts.'), $LETZTES_AUSTRAGEN) : '',
$id != $user['UID'] ? info(sprintf("You are viewing %s's shifts.", $shifts_user['Nick']), true) : '',
diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php
index c85a6243..b8879e62 100644
--- a/includes/pages/user_news.php
+++ b/includes/pages/user_news.php
@@ -13,182 +13,153 @@ function meetings_title() {
function user_meetings() {
global $DISPLAY_NEWS, $privileges, $user;
-
- $html = "";
-
- if (isset ($_REQUEST['page']) && preg_match("/^[0-9]{1,}$/", $_REQUEST['page']))
+
+ $html = '
' . meetings_title() . ' ';
+
+ if (isset($_REQUEST['page']) && preg_match("/^[0-9]{1,}$/", $_REQUEST['page']))
$page = $_REQUEST['page'];
else
$page = 0;
-
+
$news = sql_select("SELECT * FROM `News` WHERE `Treffen`=1 ORDER BY `ID` DESC LIMIT " . sql_escape($page * $DISPLAY_NEWS) . ", " . sql_escape($DISPLAY_NEWS));
foreach ($news as $entry)
$html .= display_news($entry);
-
- $html .= "';
+
return $html;
}
function display_news($news) {
global $privileges, $p;
-
- $html = "";
- $html .= '';
- $html .= '';
- $html .= date("Y-m-d H:i", $news['Datum']) . ', ';
-
+
+ $html = '';
+ $html .= '';
+ $html .= '
';
+ $html .= '
' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . ' ';
+ $html .= '';
+ $html .= '
' . ReplaceSmilies(nl2br($news['Text'])) . '
';
+
+ $html .= '';
+ $html .= '
';
return $html;
}
function user_news_comments() {
global $user;
-
- $html = "";
- if (isset ($_REQUEST["nid"]) && preg_match("/^[0-9]{1,}$/", $_REQUEST['nid']) && sql_num_query("SELECT * FROM `News` WHERE `ID`=" . sql_escape($_REQUEST['nid']) . " LIMIT 1") > 0) {
+
+ $html = '' . user_news_comments_title() . ' ';
+ if (isset($_REQUEST["nid"]) && preg_match("/^[0-9]{1,}$/", $_REQUEST['nid']) && sql_num_query("SELECT * FROM `News` WHERE `ID`=" . sql_escape($_REQUEST['nid']) . " LIMIT 1") > 0) {
$nid = $_REQUEST["nid"];
- list ($news) = sql_select("SELECT * FROM `News` WHERE `ID`=" . sql_escape($nid) . " LIMIT 1");
- if (isset ($_REQUEST["text"])) {
+ list($news) = sql_select("SELECT * FROM `News` WHERE `ID`=" . sql_escape($nid) . " LIMIT 1");
+ if (isset($_REQUEST["text"])) {
$text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($_REQUEST['text']));
sql_query("INSERT INTO `NewsComments` (`Refid`, `Datum`, `Text`, `UID`) VALUES ('" . sql_escape($nid) . "', '" . date("Y-m-d H:i:s") . "', '" . sql_escape($text) . "', '" . sql_escape($user["UID"]) . "')");
engelsystem_log("Created news_comment: " . $text);
$html .= success(_("Entry saved."), true);
}
-
- $html .= '
« ' . _("back") . ' ';
+
$html .= display_news($news);
-
- $html .= '
' . _("Comments") . ' ';
-
+
$comments = sql_select("SELECT * FROM `NewsComments` WHERE `Refid`='" . sql_escape($nid) . "' ORDER BY 'ID'");
foreach ($comments as $comment) {
$user_source = User($comment['UID']);
- if($user_source === false)
+ if ($user_source === false)
engelsystem_error(_("Unable to load user."));
-
- $html .= '
';
}
function user_news() {
global $DISPLAY_NEWS, $privileges, $user;
-
- $html = msg();
-
- if (isset ($_POST["text"]) && isset ($_POST["betreff"]) && in_array("admin_news", $privileges)) {
- if (!isset ($_POST["treffen"]) || !in_array("admin_news", $privileges))
+
+ $html = '' . news_title() . ' ' . msg();
+
+ if (isset($_POST["text"]) && isset($_POST["betreff"]) && in_array("admin_news", $privileges)) {
+ if (! isset($_POST["treffen"]) || ! in_array("admin_news", $privileges))
$_POST["treffen"] = 0;
- sql_query("INSERT INTO `News` (`Datum`, `Betreff`, `Text`, `UID`, `Treffen`) " .
- "VALUES ('" . sql_escape(time()) . "', '" . sql_escape($_POST["betreff"]) . "', '" . sql_escape($_POST["text"]) . "', '" . sql_escape($user['UID']) .
- "', '" . sql_escape($_POST["treffen"]) . "');");
+ sql_query("INSERT INTO `News` (`Datum`, `Betreff`, `Text`, `UID`, `Treffen`) " . "VALUES ('" . sql_escape(time()) . "', '" . sql_escape($_POST["betreff"]) . "', '" . sql_escape($_POST["text"]) . "', '" . sql_escape($user['UID']) . "', '" . sql_escape($_POST["treffen"]) . "');");
engelsystem_log("Created news: " . $_POST["betreff"] . ", treffen: " . $_POST["treffen"]);
success(_("Entry saved."));
redirect(page_link_to('news'));
}
-
- if (isset ($_REQUEST['page']) && preg_match("/^[0-9]{1,}$/", $_REQUEST['page']))
+
+ if (isset($_REQUEST['page']) && preg_match("/^[0-9]{1,}$/", $_REQUEST['page']))
$page = $_REQUEST['page'];
else
$page = 0;
-
+
$news = sql_select("SELECT * FROM `News` ORDER BY `ID` DESC LIMIT " . sql_escape($page * $DISPLAY_NEWS) . ", " . sql_escape($DISPLAY_NEWS));
foreach ($news as $entry)
$html .= display_news($entry);
-
- $html .= "';
+
if (in_array("admin_news", $privileges)) {
- $html .= '
-
' . _("Create news:") . '
-
-
-
-
-
-
- ';
+ $html .= '
';
+ $html .= '
' . _("Create news:") . ' ';
+
+ $html .= form(array(
+ form_text('betreff', _("Subject"), ''),
+ form_textarea('text', _("Message"), ''),
+ form_checkbox('treffen', _("Meeting"), false, 1),
+ form_submit('submit', _("Save"))
+ ));
}
- return $html;
+ return $html . '
';
}
?>
\ No newline at end of file
diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php
index 0ed1339c..be7f9930 100644
--- a/includes/pages/user_questions.php
+++ b/includes/pages/user_questions.php
@@ -7,9 +7,9 @@ function user_questions() {
global $user;
if (! isset($_REQUEST['action'])) {
- $open_questions = sql_select("SELECT * FROM `Questions` WHERE `AID`=0 AND `UID`=" . sql_escape($user['UID']));
+ $open_questions = sql_select("SELECT * FROM `Questions` WHERE `AID` IS NULL AND `UID`=" . sql_escape($user['UID']));
- $answered_questions = sql_select("SELECT * FROM `Questions` WHERE `AID`>0 AND `UID`=" . sql_escape($user['UID']));
+ $answered_questions = sql_select("SELECT * FROM `Questions` WHERE NOT `AID` IS NULL AND `UID`=" . sql_escape($user['UID']));
foreach ($answered_questions as &$question) {
$answer_user_source = User($question['AID']);
if ($answer_user_source === false)
@@ -23,10 +23,15 @@ function user_questions() {
case 'ask':
$question = strip_request_item_nl('question');
if ($question != "") {
- sql_query("INSERT INTO `Questions` SET `UID`=" . sql_escape($user['UID']) . ", `Question`='" . sql_escape($question) . "'");
+ $result = sql_query("INSERT INTO `Questions` SET `UID`=" . sql_escape($user['UID']) . ", `Question`='" . sql_escape($question) . "'");
+ if ($result === false)
+ engelsystem_error(_("Unable to save question."));
+ success(_("You question was saved."));
redirect(page_link_to("user_questions"));
} else
- return error(_("Please enter a question!"), true);
+ return page_with_title(questions_title(), array(
+ error(_("Please enter a question!"), true)
+ ));
break;
case 'delete':
if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id']))
@@ -39,7 +44,9 @@ function user_questions() {
sql_query("DELETE FROM `Questions` WHERE `QID`=" . sql_escape($id) . " LIMIT 1");
redirect(page_link_to("user_questions"));
} else
- return error(_("No question found."), true);
+ return page_with_title(questions_title(), array(
+ error(_("No question found."), true)
+ ));
break;
}
}
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php
index 2a54a485..da671b0b 100644
--- a/includes/pages/user_settings.php
+++ b/includes/pages/user_settings.php
@@ -162,7 +162,7 @@ function user_settings() {
}
}
- return page(array(
+ return page_with_title(settings_title(), array(
sprintf(_("Hello %s, here you can change your personal settings i.e. password, color settings etc."), User_Nick_render($user)),
$msg,
msg(),
@@ -180,7 +180,7 @@ function user_settings() {
form_text('jabber', _("Jabber"), $jabber),
form_text('hometown', _("Hometown"), $hometown),
$enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '',
- form_checkboxes('angel_types', _("What do you want to do?") . sprintf(" (%s )", page_link_to('angeltypes') . '&action=about', _("Description of job types")), $angel_types, $selected_angel_types),
+ form_checkboxes('angel_types', _("What do you want to do?") . sprintf(" (%s )", page_link_to('angeltypes') . '&action=about', _("Description of job types")), $angel_types, $selected_angel_types),
form_submit('submit', _("Save"))
)),
form(array(
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 1e94b99f..2adce0d5 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -138,15 +138,10 @@ function user_shifts() {
$room_select = html_select_key('rid', 'rid', $room_array, $rid);
$angel_types = "";
- foreach ($types as $type) {
- $angel_types .= template_render('../templates/admin_shifts_angel_types.html', array(
- 'id' => $type['id'],
- 'type' => $type['name'],
- 'value' => $needed_angel_types[$type['id']]
- ));
- }
+ foreach ($types as $type)
+ $angel_types .= form_spinner('type_' . $type['id'], $type['name'], $needed_angel_types[$type['id']]);
- return page(array(
+ return page_with_title(shifts_title(), array(
msg(),
'' . info(_("This page is much more comfortable with javascript."), true) . ' ',
form(array(
@@ -182,7 +177,7 @@ function user_shifts() {
redirect(page_link_to('user_shifts'));
}
- return page(array(
+ return page_with_title(shifts_title(), array(
error(sprintf(_("Do you want to delete the shift %s from %s to %s?"), $shift['name'], date("Y-m-d H:i", $shift['start']), date("H:i", $shift['end'])), true),
'' . _("delete") . ' '
));
@@ -457,7 +452,7 @@ function view_user_shifts() {
$shifts[$k]['own'] = in_array($shift['SID'], array_keys($ownshifts));
}
- $shifts_table = '