From b7f4452aea876cfc3b22a4cd8bcc2fe8e17660ff Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 20 Jul 2015 14:59:02 -0500 Subject: [PATCH] dept: Rename 'dept and group' to 'dept and extended members' --- include/ajax.admin.php | 2 +- include/class.dept.php | 11 ++++++++--- include/staff/department.inc.php | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/ajax.admin.php b/include/ajax.admin.php index e5139d8da..ddeb7c5db 100644 --- a/include/ajax.admin.php +++ b/include/ajax.admin.php @@ -34,7 +34,7 @@ class AdminAjaxAPI extends AjaxController { $errors = array(); $vars = $form->getClean(); $vars += array( - 'group_membership' => Dept::ALERTS_DEPT_AND_GROUPS, + 'group_membership' => Dept::ALERTS_DEPT_AND_EXTENDED, ); if ($dept->update($vars, $errors)) { Http::response(201, $this->encode(array( diff --git a/include/class.dept.php b/include/class.dept.php index 9723c8925..a483eecc6 100644 --- a/include/class.dept.php +++ b/include/class.dept.php @@ -58,7 +58,7 @@ implements TemplateVariable { var $autorespEmail; const ALERTS_DISABLED = 2; - const ALERTS_DEPT_AND_GROUPS = 1; + const ALERTS_DEPT_AND_EXTENDED = 1; const ALERTS_DEPT_ONLY = 0; const FLAG_ASSIGN_MEMBERS_ONLY = 0x0001; @@ -210,9 +210,14 @@ implements TemplateVariable { $rv = clone $this->getAvailableMembers(); $rv->filter(Q::any(array( // Ensure "Alerts" is enabled — must be a primary member or - // have alerts enabled on your membership. + // have alerts enabled on your membership and have alerts + // configured to extended to extended access members 'dept_id' => $this->getId(), - 'dept_access__flags__hasbit' => StaffDeptAccess::FLAG_ALERTS, + // NOTE: Manager is excluded here if not a member + Q::all(array( + 'group_membership' => self::ALERTS_DEPT_AND_EXTENDED, + 'dept_access__flags__hasbit' => StaffDeptAccess::FLAG_ALERTS, + )), ))); } return $rv; diff --git a/include/staff/department.inc.php b/include/staff/department.inc.php index 3a0896228..62882a14c 100644 --- a/include/staff/department.inc.php +++ b/include/staff/department.inc.php @@ -268,7 +268,7 @@ $info = Format::htmlchars(($errors && $_POST) ? $_POST : $info); <?php foreach (array( Dept::ALERTS_DISABLED => __("No one (disable Alerts and Notices)"), Dept::ALERTS_DEPT_ONLY => __("Department members only"), - Dept::ALERTS_DEPT_AND_GROUPS => __("Department and Group members"), + Dept::ALERTS_DEPT_AND_EXTENDED => __("Department and extended access members"), ) as $mode=>$desc) { ?> <option value="<?php echo $mode; ?>" <?php if ($info['group_membership'] == $mode) echo 'selected="selected"'; -- GitLab