summaryrefslogtreecommitdiff
path: root/includes/controller
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-11 14:59:25 +0100
committermsquare <msquare@notrademark.de>2016-11-11 14:59:25 +0100
commit82b9436c508fd9739555240991abda1b2fd63bd4 (patch)
treec8d5e5aeba23b93b5392bd39dbe8cefd6f324d14 /includes/controller
parent468a10774cee39d4f649e4e85906f228c8ed79a1 (diff)
rename coordinator to supporter
Diffstat (limited to 'includes/controller')
-rw-r--r--includes/controller/angeltypes_controller.php12
-rw-r--r--includes/controller/user_angeltypes_controller.php30
-rw-r--r--includes/controller/user_driver_licenses_controller.php13
3 files changed, 27 insertions, 28 deletions
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index 3476f3e6..548cf3e7 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -112,7 +112,7 @@ function angeltype_edit_controller() {
$description = $angeltype['description'];
$requires_driver_license = $angeltype['requires_driver_license'];
- if (! User_is_AngelType_coordinator($user, $angeltype)) {
+ if (! User_is_AngelType_supporter($user, $angeltype)) {
redirect(page_link_to('angeltypes'));
}
} else {
@@ -121,13 +121,13 @@ function angeltype_edit_controller() {
}
}
- // In coordinator mode only allow to modify description
- $coordinator_mode = ! in_array('admin_angel_types', $privileges);
+ // In supporter mode only allow to modify description
+ $supporter_mode = ! in_array('admin_angel_types', $privileges);
if (isset($_REQUEST['submit'])) {
$valid = true;
- if (! $coordinator_mode) {
+ if (! $supporter_mode) {
if (isset($_REQUEST['name'])) {
$result = AngelType_validate_name($_REQUEST['name'], $angeltype);
$name = $result->getValue();
@@ -168,7 +168,7 @@ function angeltype_edit_controller() {
return [
sprintf(_("Edit %s"), $name),
- AngelType_edit_view($name, $restricted, $description, $coordinator_mode, $requires_driver_license)
+ AngelType_edit_view($name, $restricted, $description, $supporter_mode, $requires_driver_license)
];
}
@@ -200,7 +200,7 @@ function angeltype_controller() {
return [
sprintf(_("Team %s"), $angeltype['name']),
- AngelType_view($angeltype, $members, $user_angeltype, in_array('admin_user_angeltypes', $privileges) || $user_angeltype['coordinator'], in_array('admin_angel_types', $privileges), $user_angeltype['coordinator'], $user_driver_license, $user)
+ AngelType_view($angeltype, $members, $user_angeltype, in_array('admin_user_angeltypes', $privileges) || $user_angeltype['supporter'], in_array('admin_angel_types', $privileges), $user_angeltype['supporter'], $user_driver_license, $user)
];
}
diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php
index 663f7826..f58187b2 100644
--- a/includes/controller/user_angeltypes_controller.php
+++ b/includes/controller/user_angeltypes_controller.php
@@ -1,7 +1,7 @@
<?php
/**
- * Display a hint for team/angeltype coordinators if there are unconfirmed users for his angeltype.
+ * Display a hint for team/angeltype supporters if there are unconfirmed users for his angeltype.
*/
function user_angeltypes_unconfirmed_hint() {
global $user;
@@ -36,7 +36,7 @@ function user_angeltypes_delete_all_controller() {
redirect(page_link_to('angeltypes'));
}
- if (! User_is_AngelType_coordinator($user, $angeltype)) {
+ if (! User_is_AngelType_supporter($user, $angeltype)) {
error(_("You are not allowed to delete all users for this angeltype."));
redirect(page_link_to('angeltypes'));
}
@@ -78,7 +78,7 @@ function user_angeltypes_confirm_all_controller() {
redirect(page_link_to('angeltypes'));
}
- if (! in_array('admin_user_angeltypes', $privileges) && ! $user_angeltype['coordinator']) {
+ if (! in_array('admin_user_angeltypes', $privileges) && ! $user_angeltype['supporter']) {
error(_("You are not allowed to confirm all users for this angeltype."));
redirect(page_link_to('angeltypes'));
}
@@ -120,7 +120,7 @@ function user_angeltype_confirm_controller() {
redirect(page_link_to('angeltypes'));
}
- if (! User_is_AngelType_coordinator($user, $angeltype)) {
+ if (! User_is_AngelType_supporter($user, $angeltype)) {
error(_("You are not allowed to confirm this users angeltype."));
redirect(page_link_to('angeltypes'));
}
@@ -177,7 +177,7 @@ function user_angeltype_delete_controller() {
redirect(page_link_to('angeltypes'));
}
- if ($user['UID'] != $user_angeltype['user_id'] && ! User_is_AngelType_coordinator($user, $angeltype)) {
+ if ($user['UID'] != $user_angeltype['user_id'] && ! User_is_AngelType_supporter($user, $angeltype)) {
error(_("You are not allowed to delete this users angeltype."));
redirect(page_link_to('angeltypes'));
}
@@ -208,7 +208,7 @@ function user_angeltype_update_controller() {
global $privileges;
if (! in_array('admin_angel_types', $privileges)) {
- error(_("You are not allowed to set coordinator rights."));
+ error(_("You are not allowed to set supporter rights."));
redirect(page_link_to('angeltypes'));
}
@@ -217,10 +217,10 @@ function user_angeltype_update_controller() {
redirect(page_link_to('angeltypes'));
}
- if (isset($_REQUEST['coordinator']) && preg_match("/^[01]$/", $_REQUEST['coordinator'])) {
- $coordinator = $_REQUEST['coordinator'] == "1";
+ if (isset($_REQUEST['supporter']) && preg_match("/^[01]$/", $_REQUEST['supporter'])) {
+ $supporter = $_REQUEST['supporter'] == "1";
} else {
- error(_("No coordinator update given."));
+ error(_("No supporter update given."));
redirect(page_link_to('angeltypes'));
}
@@ -243,9 +243,9 @@ function user_angeltype_update_controller() {
}
if (isset($_REQUEST['confirmed'])) {
- UserAngelType_update($user_angeltype['id'], $coordinator);
+ UserAngelType_update($user_angeltype['id'], $supporter);
- $success_message = sprintf($coordinator ? _("Added coordinator rights for %s to %s.") : _("Removed coordinator rights for %s from %s."), AngelType_name_render($angeltype), User_Nick_render($user_source));
+ $success_message = sprintf($supporter ? _("Added supporter rights for %s to %s.") : _("Removed supporter rights for %s from %s."), AngelType_name_render($angeltype), User_Nick_render($user_source));
engelsystem_log($success_message);
success($success_message);
@@ -253,13 +253,13 @@ function user_angeltype_update_controller() {
}
return [
- $coordinator ? _("Add coordinator rights") : _("Remove coordinator rights"),
- UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $coordinator)
+ $supporter ? _("Add supporter rights") : _("Remove supporter rights"),
+ UserAngelType_update_view($user_angeltype, $user_source, $angeltype, $supporter)
];
}
/**
- * User joining an Angeltype (Or Coordinator doing this for him).
+ * User joining an Angeltype (Or supporter doing this for him).
*/
function user_angeltype_add_controller() {
global $user;
@@ -267,7 +267,7 @@ function user_angeltype_add_controller() {
$angeltype = load_angeltype();
// User is joining by itself
- if (! User_is_AngelType_coordinator($user, $angeltype)) {
+ if (! User_is_AngelType_supporter($user, $angeltype)) {
return user_angeltype_join_controller($angeltype);
}
diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php
index 49f21d14..a76d5507 100644
--- a/includes/controller/user_driver_licenses_controller.php
+++ b/includes/controller/user_driver_licenses_controller.php
@@ -9,18 +9,17 @@ function user_driver_license_required_hint() {
$angeltypes = User_angeltypes($user);
$user_driver_license = UserDriverLicense($user['UID']);
- $driving_license_information_required = false;
+ // User has already entered data, no hint needed.
+ if ($user_driver_license != null) {
+ return '';
+ }
+
foreach ($angeltypes as $angeltype) {
if ($angeltype['requires_driver_license']) {
- $driving_license_information_required = true;
- break;
+ return info(sprintf(_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."), '<a href="' . user_driver_license_edit_link() . '">' . _("driving license information") . '</a>'), true);
}
}
- if ($driving_license_information_required && $user_driver_license == null) {
- return info(sprintf(_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."), '<a href="' . user_driver_license_edit_link() . '">' . _("driving license information") . '</a>'), true);
- }
-
return '';
}