diff --git a/locale/en_US/admin.xml b/locale/en_US/admin.xml
index 9484106..2417fe7 100644
--- a/locale/en_US/admin.xml
+++ b/locale/en_US/admin.xml
@@ -56,8 +56,8 @@
Merge Users
Merge User
Select a user to whom to attribute the previous user's authorships, editing assignments, etc.
- Select a user to merge into another user account (e.g., when someone has two user accounts). The account selected first will be deleted and its submissions, assignments, etc. will be attributed to the second account.
+ Select a user (or several) to merge into another user account (e.g., when someone has two user accounts). The account(s) selected first will be deleted and any submissions, assignments, etc. will be attributed to the second account.
All Enrolled Users
- Are you sure you wish to merge the account with the username "{$oldUsername}" into the account with the username "{$newUsername}"? The account with the username "{$oldUsername}" will not exist afterwards. This action is not reversible.
+ Are you sure you wish to merge the selected {$oldAccountCount} account(s) into the account with the username "{$newUsername}"? The selected {$oldAccountCount} accounts will not exist afterwards. This action is not reversible.
No enrolled users.
diff --git a/locale/en_US/manager.xml b/locale/en_US/manager.xml
index 3d3d135..1d5e562 100644
--- a/locale/en_US/manager.xml
+++ b/locale/en_US/manager.xml
@@ -85,8 +85,8 @@
Select a template
Enroll an Existing User
With journal
- Select a user to merge into another user account (e.g., when someone has two user accounts). The account selected first will be deleted and its submissions, assignments, etc. will be attributed to the second account.
- Select a user to whom to attribute the previous user's authorships, editing assignments, etc.
+ Select a user (or several) to merge into another user account (e.g., when someone has two user accounts). The account(s) selected first will be deleted and any submissions, assignments, etc. will be attributed to the second account.
+ Select a user to whom to attribute the previous users' authorships, editing assignments, etc.
{$role} Enrollment
Enrollment synchronization will enroll all users enrolled in the specified role in the specified journal into the same role in this journal. This function allows a common set of users (e.g., Reviewers) to be synchronized between journals.
This page allows the Journal Manager to review and potentially configure the plugins that are currently installed. Plugins are divided into categories, according to their function. The categories are listed below, and within each category, its current set of plugins.
diff --git a/pages/admin/AdminPeopleHandler.inc.php b/pages/admin/AdminPeopleHandler.inc.php
index b78de15..d0e916a 100644
--- a/pages/admin/AdminPeopleHandler.inc.php
+++ b/pages/admin/AdminPeopleHandler.inc.php
@@ -36,23 +36,18 @@ class AdminPeopleHandler extends AdminHandler {
$templateMgr =& TemplateManager::getManager();
- $oldUserId = Request::getUserVar('oldUserId');
+ $oldUserIds = (array) Request::getUserVar('oldUserIds');
$newUserId = Request::getUserVar('newUserId');
- if (!empty($oldUserId) && !empty($newUserId)) {
+ if (!empty($oldUserIds) && !empty($newUserId)) {
// Both user IDs have been selected. Merge the accounts.
import('user.UserAction');
- UserAction::mergeUsers($oldUserId, $newUserId);
+ foreach ($oldUserIds as $oldUserId) {
+ UserAction::mergeUsers($oldUserId, $newUserId);
+ }
Request::redirect(null, 'admin', 'mergeUsers');
}
- if (!empty($oldUserId)) {
- // Get the old username for the confirm prompt.
- $oldUser =& $userDao->getUser($oldUserId);
- $templateMgr->assign('oldUsername', $oldUser->getUsername());
- unset($oldUser);
- }
-
// The administrator must select one or both IDs.
if (Request::getUserVar('roleSymbolic')!=null) $roleSymbolic = Request::getUserVar('roleSymbolic');
else $roleSymbolic = isset($args[0])?$args[0]:'all';
@@ -116,12 +111,11 @@ class AdminPeopleHandler extends AdminHandler {
USER_FIELD_INTERESTS => 'user.interests'
));
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
- $templateMgr->assign('oldUserId', $oldUserId);
+ $templateMgr->assign('oldUserIds', $oldUserIds);
$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
$templateMgr->assign('roleSymbolic', $roleSymbolic);
$templateMgr->display('admin/selectMergeUser.tpl');
}
-
}
?>
diff --git a/pages/manager/PeopleHandler.inc.php b/pages/manager/PeopleHandler.inc.php
index de5c071..e715498 100644
--- a/pages/manager/PeopleHandler.inc.php
+++ b/pages/manager/PeopleHandler.inc.php
@@ -437,12 +437,17 @@ class PeopleHandler extends ManagerHandler {
$journalId = $journal->getId();
$templateMgr =& TemplateManager::getManager();
- $oldUserId = Request::getUserVar('oldUserId');
+ $oldUserIds = (array) Request::getUserVar('oldUserIds');
$newUserId = Request::getUserVar('newUserId');
// Ensure that we have administrative priveleges over the specified user(s).
+ $canAdministerAll = true;
+ foreach ($oldUserIds as $oldUserId) {
+ if (!Validation::canAdminister($journalId, $oldUserId)) $canAdministerAll = false;
+ }
+
if (
- (!empty($oldUserId) && !Validation::canAdminister($journalId, $oldUserId)) ||
+ (!empty($oldUserIds) && !$canAdministerAll) ||
(!empty($newUserId) && !Validation::canAdminister($journalId, $newUserId))
) {
$templateMgr->assign('pageTitle', 'manager.people');
@@ -452,19 +457,14 @@ class PeopleHandler extends ManagerHandler {
return $templateMgr->display('common/error.tpl');
}
- if (!empty($oldUserId) && !empty($newUserId)) {
+ if (!empty($oldUserIds) && !empty($newUserId)) {
import('user.UserAction');
- UserAction::mergeUsers($oldUserId, $newUserId);
+ foreach ($oldUserIds as $oldUserId) {
+ UserAction::mergeUsers($oldUserId, $newUserId);
+ }
Request::redirect(null, 'manager');
}
- if (!empty($oldUserId)) {
- // Get the old username for the confirm prompt.
- $oldUser =& $userDao->getUser($oldUserId);
- $templateMgr->assign('oldUsername', $oldUser->getUsername());
- unset($oldUser);
- }
-
// The manager must select one or both IDs.
if (Request::getUserVar('roleSymbolic')!=null) $roleSymbolic = Request::getUserVar('roleSymbolic');
else $roleSymbolic = isset($args[0])?$args[0]:'all';
@@ -534,7 +534,7 @@ class PeopleHandler extends ManagerHandler {
USER_FIELD_INTERESTS => 'user.interests'
));
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
- $templateMgr->assign('oldUserId', $oldUserId);
+ $templateMgr->assign('oldUserIds', $oldUserIds);
$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
$templateMgr->assign('roleSymbolic', $roleSymbolic);
$templateMgr->assign('sort', $sort);
diff --git a/templates/admin/selectMergeUser.tpl b/templates/admin/selectMergeUser.tpl
index 4acbaa0..d5be080 100644
--- a/templates/admin/selectMergeUser.tpl
+++ b/templates/admin/selectMergeUser.tpl
@@ -13,10 +13,10 @@
{include file="common/header.tpl"}
{/strip}
-
{if $oldUserId != ''}{translate key="admin.mergeUsers.into.description"}{else}{translate key="admin.mergeUsers.from.description"}{/if}
+
{if !empty($oldUserIds)}{translate key="admin.mergeUsers.into.description"}{else}{translate key="admin.mergeUsers.from.description"}{/if}
+{if !empty($oldUserIds)}
+ {* Selecting target user; do not include checkboxes on LHS *}
+ {assign var="numCols" value=4}
+{else}
+ {* Selecting user(s) to merge; include checkboxes on LHS *}
+ {assign var="numCols" value=5}
+
+{/if}
{include file="common/footer.tpl"}
diff --git a/templates/manager/people/selectMergeUser.tpl b/templates/manager/people/selectMergeUser.tpl
index c590f38..b5f74be 100644
--- a/templates/manager/people/selectMergeUser.tpl
+++ b/templates/manager/people/selectMergeUser.tpl
@@ -13,10 +13,10 @@
{include file="common/header.tpl"}
{/strip}
-
{if $oldUserId != ''}{translate key="manager.people.mergeUsers.into.description"}{else}{translate key="manager.people.mergeUsers.from.description"}{/if}
+
{if !empty($oldUserIds)}{translate key="manager.people.mergeUsers.into.description"}{else}{translate key="manager.people.mergeUsers.from.description"}{/if}
+{if !empty($oldUserIds)}
+ {* Selecting target user; do not include checkboxes on LHS *}
+ {assign var="numCols" value=4}
+{else}
+ {* Selecting user(s) to merge; include checkboxes on LHS *}
+ {assign var="numCols" value=5}
+
+{/if}
{include file="common/footer.tpl"}