View | Details | Raw Unified | Return to bug 4857 | Differences between
and this patch

Collapse All | Expand All

(-)a/locale/en_US/admin.xml (-2 / +2 lines)
 Lines 56-63    Link Here 
56
	<message key="admin.mergeUsers">Merge Users</message>
56
	<message key="admin.mergeUsers">Merge Users</message>
57
	<message key="admin.mergeUsers.mergeUser">Merge User</message>
57
	<message key="admin.mergeUsers.mergeUser">Merge User</message>
58
	<message key="admin.mergeUsers.into.description">Select a user to whom to attribute the previous user's authorships, editing assignments, etc.</message>
58
	<message key="admin.mergeUsers.into.description">Select a user to whom to attribute the previous user's authorships, editing assignments, etc.</message>
59
	<message key="admin.mergeUsers.from.description">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.</message>
59
	<message key="admin.mergeUsers.from.description">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.</message>
60
	<message key="admin.mergeUsers.allUsers">All Enrolled Users</message>
60
	<message key="admin.mergeUsers.allUsers">All Enrolled Users</message>
61
	<message key="admin.mergeUsers.confirm">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.</message>
61
	<message key="admin.mergeUsers.confirm">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.</message>
62
	<message key="admin.mergerUsers.noneEnrolled">No enrolled users.</message>
62
	<message key="admin.mergerUsers.noneEnrolled">No enrolled users.</message>
63
</locale>
63
</locale>
(-)a/locale/en_US/manager.xml (-2 / +2 lines)
 Lines 85-92    Link Here 
85
	<message key="manager.people.emailUsers.selectTemplate">Select a template</message>
85
	<message key="manager.people.emailUsers.selectTemplate">Select a template</message>
86
	<message key="manager.people.enrollExistingUser">Enroll an Existing User</message>
86
	<message key="manager.people.enrollExistingUser">Enroll an Existing User</message>
87
	<message key="manager.people.enrollSyncJournal">With journal</message>
87
	<message key="manager.people.enrollSyncJournal">With journal</message>
88
	<message key="manager.people.mergeUsers.from.description">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.</message>
88
	<message key="manager.people.mergeUsers.from.description">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.</message>
89
	<message key="manager.people.mergeUsers.into.description">Select a user to whom to attribute the previous user's authorships, editing assignments, etc.</message>
89
	<message key="manager.people.mergeUsers.into.description">Select a user to whom to attribute the previous users' authorships, editing assignments, etc.</message>
90
	<message key="manager.people.roleEnrollment">{$role} Enrollment</message>
90
	<message key="manager.people.roleEnrollment">{$role} Enrollment</message>
91
	<message key="manager.people.syncUserDescription">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.</message>
91
	<message key="manager.people.syncUserDescription">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.</message>
92
	<message key="manager.plugins.description">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.</message>
92
	<message key="manager.plugins.description">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.</message>
(-)a/pages/admin/AdminPeopleHandler.inc.php (-12 / +6 lines)
 Lines 36-58   class AdminPeopleHandler extends AdminHandler { Link Here 
36
36
37
		$templateMgr =& TemplateManager::getManager();
37
		$templateMgr =& TemplateManager::getManager();
38
38
39
		$oldUserId = Request::getUserVar('oldUserId');
39
		$oldUserIds = (array) Request::getUserVar('oldUserIds');
40
		$newUserId = Request::getUserVar('newUserId');
40
		$newUserId = Request::getUserVar('newUserId');
41
41
42
		if (!empty($oldUserId) && !empty($newUserId)) {
42
		if (!empty($oldUserIds) && !empty($newUserId)) {
43
			// Both user IDs have been selected. Merge the accounts.
43
			// Both user IDs have been selected. Merge the accounts.
44
			import('user.UserAction');
44
			import('user.UserAction');
45
			UserAction::mergeUsers($oldUserId, $newUserId);
45
			foreach ($oldUserIds as $oldUserId) {
46
				UserAction::mergeUsers($oldUserId, $newUserId);
47
			}
46
			Request::redirect(null, 'admin', 'mergeUsers');
48
			Request::redirect(null, 'admin', 'mergeUsers');
47
		}
49
		}
48
50
49
		if (!empty($oldUserId)) {
50
			// Get the old username for the confirm prompt.
51
			$oldUser =& $userDao->getUser($oldUserId);
52
			$templateMgr->assign('oldUsername', $oldUser->getUsername());
53
			unset($oldUser);
54
		}
55
56
		// The administrator must select one or both IDs.
51
		// The administrator must select one or both IDs.
57
		if (Request::getUserVar('roleSymbolic')!=null) $roleSymbolic = Request::getUserVar('roleSymbolic');
52
		if (Request::getUserVar('roleSymbolic')!=null) $roleSymbolic = Request::getUserVar('roleSymbolic');
58
		else $roleSymbolic = isset($args[0])?$args[0]:'all';
53
		else $roleSymbolic = isset($args[0])?$args[0]:'all';
 Lines 116-127   class AdminPeopleHandler extends AdminHandler { Link Here 
116
			USER_FIELD_INTERESTS => 'user.interests'
111
			USER_FIELD_INTERESTS => 'user.interests'
117
		));
112
		));
118
		$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
113
		$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
119
		$templateMgr->assign('oldUserId', $oldUserId);
114
		$templateMgr->assign('oldUserIds', $oldUserIds);
120
		$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
115
		$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
121
		$templateMgr->assign('roleSymbolic', $roleSymbolic);
116
		$templateMgr->assign('roleSymbolic', $roleSymbolic);
122
		$templateMgr->display('admin/selectMergeUser.tpl');
117
		$templateMgr->display('admin/selectMergeUser.tpl');
123
	}
118
	}
124
125
}
119
}
126
120
127
?>
121
?>
(-)a/pages/manager/PeopleHandler.inc.php (-12 / +12 lines)
 Lines 437-448   class PeopleHandler extends ManagerHandler { Link Here 
437
		$journalId = $journal->getId();
437
		$journalId = $journal->getId();
438
		$templateMgr =& TemplateManager::getManager();
438
		$templateMgr =& TemplateManager::getManager();
439
439
440
		$oldUserId = Request::getUserVar('oldUserId');
440
		$oldUserIds = (array) Request::getUserVar('oldUserIds');
441
		$newUserId = Request::getUserVar('newUserId');
441
		$newUserId = Request::getUserVar('newUserId');
442
442
443
		// Ensure that we have administrative priveleges over the specified user(s).
443
		// Ensure that we have administrative priveleges over the specified user(s).
444
		$canAdministerAll = true;
445
		foreach ($oldUserIds as $oldUserId) {
446
			if (!Validation::canAdminister($journalId, $oldUserId)) $canAdministerAll = false;
447
		}
448
		
444
		if (
449
		if (
445
			(!empty($oldUserId) && !Validation::canAdminister($journalId, $oldUserId)) ||
450
			(!empty($oldUserIds) && !$canAdministerAll) ||
446
			(!empty($newUserId) && !Validation::canAdminister($journalId, $newUserId))
451
			(!empty($newUserId) && !Validation::canAdminister($journalId, $newUserId))
447
		) {
452
		) {
448
			$templateMgr->assign('pageTitle', 'manager.people');
453
			$templateMgr->assign('pageTitle', 'manager.people');
 Lines 452-470   class PeopleHandler extends ManagerHandler { Link Here 
452
			return $templateMgr->display('common/error.tpl');
457
			return $templateMgr->display('common/error.tpl');
453
		}
458
		}
454
459
455
		if (!empty($oldUserId) && !empty($newUserId)) {
460
		if (!empty($oldUserIds) && !empty($newUserId)) {
456
			import('user.UserAction');
461
			import('user.UserAction');
457
			UserAction::mergeUsers($oldUserId, $newUserId);
462
			foreach ($oldUserIds as $oldUserId) {
463
				UserAction::mergeUsers($oldUserId, $newUserId);
464
			}
458
			Request::redirect(null, 'manager');
465
			Request::redirect(null, 'manager');
459
		}
466
		}
460
467
461
		if (!empty($oldUserId)) {
462
			// Get the old username for the confirm prompt.
463
			$oldUser =& $userDao->getUser($oldUserId);
464
			$templateMgr->assign('oldUsername', $oldUser->getUsername());
465
			unset($oldUser);
466
		}
467
468
		// The manager must select one or both IDs.
468
		// The manager must select one or both IDs.
469
		if (Request::getUserVar('roleSymbolic')!=null) $roleSymbolic = Request::getUserVar('roleSymbolic');
469
		if (Request::getUserVar('roleSymbolic')!=null) $roleSymbolic = Request::getUserVar('roleSymbolic');
470
		else $roleSymbolic = isset($args[0])?$args[0]:'all';
470
		else $roleSymbolic = isset($args[0])?$args[0]:'all';
 Lines 534-540   class PeopleHandler extends ManagerHandler { Link Here 
534
			USER_FIELD_INTERESTS => 'user.interests'
534
			USER_FIELD_INTERESTS => 'user.interests'
535
		));
535
		));
536
		$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
536
		$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
537
		$templateMgr->assign('oldUserId', $oldUserId);
537
		$templateMgr->assign('oldUserIds', $oldUserIds);
538
		$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
538
		$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
539
		$templateMgr->assign('roleSymbolic', $roleSymbolic);
539
		$templateMgr->assign('roleSymbolic', $roleSymbolic);
540
		$templateMgr->assign('sort', $sort);
540
		$templateMgr->assign('sort', $sort);
(-)a/templates/admin/selectMergeUser.tpl (-27 / +45 lines)
 Lines 13-22    Link Here 
13
{include file="common/header.tpl"}
13
{include file="common/header.tpl"}
14
{/strip}
14
{/strip}
15
<div id="selectMergeUsers">
15
<div id="selectMergeUsers">
16
<p>{if $oldUserId != ''}{translate key="admin.mergeUsers.into.description"}{else}{translate key="admin.mergeUsers.from.description"}{/if}</p>
16
<p>{if !empty($oldUserIds)}{translate key="admin.mergeUsers.into.description"}{else}{translate key="admin.mergeUsers.from.description"}{/if}</p>
17
<div id="roles">
17
<div id="roles">
18
<h3>{translate key=$roleName}</h3>
18
<h3>{translate key=$roleName}</h3>
19
<form method="post" action="{url path=$roleSymbolic oldUserId=$oldUserId}">
19
<form method="post" action="{url path=$roleSymbolic oldUserIds=$oldUserIds}">
20
	<select name="roleSymbolic" class="selectMenu">
20
	<select name="roleSymbolic" class="selectMenu">
21
		<option {if $roleSymbolic=='all'}selected="selected" {/if}value="all">{translate key="admin.mergeUsers.allUsers"}</option>
21
		<option {if $roleSymbolic=='all'}selected="selected" {/if}value="all">{translate key="admin.mergeUsers.allUsers"}</option>
22
		<option {if $roleSymbolic=='managers'}selected="selected" {/if}value="managers">{translate key="user.role.managers"}</option>
22
		<option {if $roleSymbolic=='managers'}selected="selected" {/if}value="managers">{translate key="user.role.managers"}</option>
 Lines 41-84    Link Here 
41
	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
41
	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
42
</form>
42
</form>
43
43
44
<p>{foreach from=$alphaList item=letter}<a href="{url path=$roleSymbolic oldUserId=$oldUserId searchInitial=$letter}">{if $letter == $searchInitial}<strong>{$letter|escape}</strong>{else}{$letter|escape}{/if}</a> {/foreach}<a href="{url path=$roleSymbolic oldUserId=$oldUserId}">{if $searchInitial==''}<strong>{translate key="common.all"}</strong>{else}{translate key="common.all"}{/if}</a></p>
44
<p>{foreach from=$alphaList item=letter}<a href="{url path=$roleSymbolic oldUserIds=$oldUserIds searchInitial=$letter}">{if $letter == $searchInitial}<strong>{$letter|escape}</strong>{else}{$letter|escape}{/if}</a> {/foreach}<a href="{url path=$roleSymbolic oldUserIds=$oldUserIds}">{if $searchInitial==''}<strong>{translate key="common.all"}</strong>{else}{translate key="common.all"}{/if}</a></p>
45
45
46
{if not $roleId}
46
{if not $roleId}
47
<ul>
47
<ul>
48
	<li><a href="{url path="managers" oldUserId=$oldUserId}">{translate key="user.role.managers"}</a></li>
48
	<li><a href="{url path="managers" oldUserIds=$oldUserIds}">{translate key="user.role.managers"}</a></li>
49
	<li><a href="{url path="editors" oldUserId=$oldUserId}">{translate key="user.role.editors"}</a></li>
49
	<li><a href="{url path="editors" oldUserIds=$oldUserIds}">{translate key="user.role.editors"}</a></li>
50
	<li><a href="{url path="sectionEditors" oldUserId=$oldUserId}">{translate key="user.role.sectionEditors"}</a></li>
50
	<li><a href="{url path="sectionEditors" oldUserIds=$oldUserIds}">{translate key="user.role.sectionEditors"}</a></li>
51
	<li><a href="{url path="layoutEditors" oldUserId=$oldUserId}">{translate key="user.role.layoutEditors"}</a></li>
51
	<li><a href="{url path="layoutEditors" oldUserIds=$oldUserIds}">{translate key="user.role.layoutEditors"}</a></li>
52
	<li><a href="{url path="copyeditors" oldUserId=$oldUserId}">{translate key="user.role.copyeditors"}</a></li>
52
	<li><a href="{url path="copyeditors" oldUserIds=$oldUserIds}">{translate key="user.role.copyeditors"}</a></li>
53
	<li><a href="{url path="proofreaders" oldUserId=$oldUserId}">{translate key="user.role.proofreaders"}</a></li>
53
	<li><a href="{url path="proofreaders" oldUserIds=$oldUserIds}">{translate key="user.role.proofreaders"}</a></li>
54
	<li><a href="{url path="reviewers" oldUserId=$oldUserId}">{translate key="user.role.reviewers"}</a></li>
54
	<li><a href="{url path="reviewers" oldUserIds=$oldUserIds}">{translate key="user.role.reviewers"}</a></li>
55
	<li><a href="{url path="authors" oldUserId=$oldUserId}">{translate key="user.role.authors"}</a></li>
55
	<li><a href="{url path="authors" oldUserIds=$oldUserIds}">{translate key="user.role.authors"}</a></li>
56
	<li><a href="{url path="readers" oldUserId=$oldUserId}">{translate key="user.role.readers"}</a></li>
56
	<li><a href="{url path="readers" oldUserIds=$oldUserIds}">{translate key="user.role.readers"}</a></li>
57
	<li><a href="{url path="subscriptionManagers" oldUserId=$oldUserId}">{translate key="user.role.subscriptionManagers"}</a></li>
57
	<li><a href="{url path="subscriptionManagers" oldUserIds=$oldUserIds}">{translate key="user.role.subscriptionManagers"}</a></li>
58
</ul>
58
</ul>
59
59
60
<br />
60
<br />
61
{else}
61
{else}
62
<p><a href="{url path="all" oldUserId=$oldUserId}" class="action">{translate key="admin.mergeUsers.allUsers"}</a></p>
62
<p><a href="{url path="all" oldUserIds=$oldUserIds}" class="action">{translate key="admin.mergeUsers.allUsers"}</a></p>
63
{/if}
63
{/if}
64
</div>
64
</div>
65
<div id="users">
65
<div id="users">
66
{if !empty($oldUserIds)}
67
	{* Selecting target user; do not include checkboxes on LHS *}
68
	{assign var="numCols" value=4}
69
{else}
70
	{* Selecting user(s) to merge; include checkboxes on LHS *}
71
	{assign var="numCols" value=5}
72
       <form method="post" action="{url}">
73
{/if}
66
<table width="100%" class="listing">
74
<table width="100%" class="listing">
67
	<tr>
75
	<tr>
68
		<td colspan="4" class="headseparator">&nbsp;</td>
76
		<td colspan="{$numCols}" class="headseparator">&nbsp;</td>
69
	</tr>
77
	</tr>
70
	<tr class="heading" valign="bottom">
78
	<tr class="heading" valign="bottom">
71
		<td width="29%">{translate key="user.username"}</td>
79
		{if empty($oldUserIds)}
80
			<td width="5%">&nbsp;</td>
81
		{/if}
82
		<td>{translate key="user.username"}</td>
72
		<td width="29%">{translate key="user.name"}</td>
83
		<td width="29%">{translate key="user.name"}</td>
73
		<td width="29%">{translate key="user.email"}</td>
84
		<td width="29%">{translate key="user.email"}</td>
74
		<td width="13%" align="right">{translate key="common.action"}</td>
85
		<td width="15%" align="right">{translate key="common.action"}</td>
75
	</tr>
86
	</tr>
76
	<tr>
87
	<tr>
77
		<td colspan="4" class="headseparator">&nbsp;</td>
88
		<td colspan="{$numCols}" class="headseparator">&nbsp;</td>
78
	</tr>
89
	</tr>
79
	{iterate from=users item=user}
90
	{iterate from=users item=user}
80
	{assign var=userExists value=1}
91
	{assign var=userExists value=1}
81
	<tr valign="top">
92
	<tr valign="top">
93
		{if empty($oldUserIds)}
94
			<td><input type="checkbox" name="oldUserIds[]" value="{$user->getId()|escape}" {if $thisUser->getId() == $user->getId()}disabled="disabled" {/if}/></td>
95
		{/if}
82
		<td>{$user->getUsername()|escape|wordwrap:15:" ":true}</td>
96
		<td>{$user->getUsername()|escape|wordwrap:15:" ":true}</td>
83
		<td>{$user->getFullName()|escape}</td>
97
		<td>{$user->getFullName()|escape}</td>
84
		<td class="nowrap">
98
		<td class="nowrap">
 Lines 88-120    Link Here 
88
			{$user->getEmail()|truncate:15:"..."|escape}&nbsp;{icon name="mail" url=$url}
102
			{$user->getEmail()|truncate:15:"..."|escape}&nbsp;{icon name="mail" url=$url}
89
		</td>
103
		</td>
90
		<td align="right">
104
		<td align="right">
91
			{if $oldUserId != ''}
105
			{if !empty($oldUserIds)}
92
				{if $oldUserId != $user->getId()}
106
				{if !in_array($user->getId(), $oldUserIds)}
93
					<a href="#" onclick="confirmAction('{url oldUserId=$oldUserId newUserId=$user->getId()}', '{translate|escape:"jsparam" key="admin.mergeUsers.confirm" oldUsername=$oldUsername newUsername=$user->getUsername()}')" class="action">{translate key="admin.mergeUsers.mergeUser"}</a>
107
					<a href="#" onclick="confirmAction('{url oldUserIds=$oldUserIds newUserId=$user->getId()}', '{translate|escape:"jsparam" key="admin.mergeUsers.confirm" oldAccountCount=$oldUserIds|@count newUsername=$user->getUsername()}')" class="action">{translate key="admin.mergeUsers.mergeUser"}</a>
94
				{/if}
108
				{/if}
95
			{elseif $thisUser->getId() != $user->getId()}
109
			{elseif $thisUser->getId() != $user->getId()}
96
				<a href="{url oldUserId=$user->getId()}" class="action">{translate key="admin.mergeUsers.mergeUser"}</a>
110
				<a href="{url oldUserIds=$user->getId()}" class="action">{translate key="admin.mergeUsers.mergeUser"}</a>
97
			{/if}
111
			{/if}
98
		</td>
112
		</td>
99
	</tr>
113
	</tr>
100
	<tr>
114
	<tr>
101
		<td colspan="4" class="{if $users->eof()}end{/if}separator">&nbsp;</td>
115
		<td colspan="{$numCols}" class="{if $users->eof()}end{/if}separator">&nbsp;</td>
102
	</tr>
116
	</tr>
103
{/iterate}
117
{/iterate}
104
{if $users->wasEmpty()}
118
{if $users->wasEmpty()}
105
	<tr>
119
	<tr>
106
		<td colspan="4" class="nodata">{translate key="admin.mergeUsers.noneEnrolled"}</td>
120
		<td colspan="{$numCols}" class="nodata">{translate key="admin.mergeUsers.noneEnrolled"}</td>
107
	</tr>
121
	</tr>
108
	<tr>
122
	<tr>
109
		<td colspan="4" class="endseparator">&nbsp;</td>
123
		<td colspan="{$numCols}" class="endseparator">&nbsp;</td>
110
	</tr>
124
	</tr>
111
{else}
125
{else}
112
	<tr>
126
	<tr>
113
		<td colspan="2" align="left">{page_info iterator=$users}</td>
127
		<td colspan="{math equation="floor(numCols / 2)" numCols=$numCols}" align="left">{page_info iterator=$users}</td>
114
		<td colspan="2" align="right">{page_links anchor="users" name="users" iterator=$users searchInitial=$searchInitial searchField=$searchField searchMatch=$searchMatch search=$search dateFromDay=$dateFromDay dateFromYear=$dateFromYear dateFromMonth=$dateFromMonth dateToDay=$dateToDay dateToYear=$dateToYear dateToMonth=$dateToMonth roleSymbolic=$roleSymbolic oldUserId=$oldUserId}</td>
128
		<td colspan="{math equation="ceil(numCols / 2)" numCols=$numCols}" align="right">{page_links anchor="users" name="users" iterator=$users searchInitial=$searchInitial searchField=$searchField searchMatch=$searchMatch search=$search dateFromDay=$dateFromDay dateFromYear=$dateFromYear dateFromMonth=$dateFromMonth dateToDay=$dateToDay dateToYear=$dateToYear dateToMonth=$dateToMonth roleSymbolic=$roleSymbolic oldUserIds=$oldUserIds}</td>
115
	</tr>
129
	</tr>
116
{/if}
130
{/if}
117
</table>
131
</table>
132
{if empty($oldUserIds)}
133
	<input type="submit" class="button defaultButton" value="{translate key="admin.mergeUsers"}" />
134
	</form>
135
{/if}
118
</div>
136
</div>
119
</div>
137
</div>
120
{include file="common/footer.tpl"}
138
{include file="common/footer.tpl"}
(-)a/templates/manager/people/selectMergeUser.tpl (-27 / +45 lines)
 Lines 13-22    Link Here 
13
{include file="common/header.tpl"}
13
{include file="common/header.tpl"}
14
{/strip}
14
{/strip}
15
<div id="selectMergeUsers">
15
<div id="selectMergeUsers">
16
<p>{if $oldUserId != ''}{translate key="manager.people.mergeUsers.into.description"}{else}{translate key="manager.people.mergeUsers.from.description"}{/if}</p>
16
<p>{if !empty($oldUserIds)}{translate key="manager.people.mergeUsers.into.description"}{else}{translate key="manager.people.mergeUsers.from.description"}{/if}</p>
17
<div id="roles">
17
<div id="roles">
18
<h3>{translate key=$roleName}</h3>
18
<h3>{translate key=$roleName}</h3>
19
<form method="post" action="{url path=$roleSymbolic oldUserId=$oldUserId}">
19
<form method="post" action="{url path=$roleSymbolic oldUserIds=$oldUserIds}">
20
	<select name="roleSymbolic" class="selectMenu">
20
	<select name="roleSymbolic" class="selectMenu">
21
		<option {if $roleSymbolic=='all'}selected="selected" {/if}value="all">{translate key="manager.people.allUsers"}</option>
21
		<option {if $roleSymbolic=='all'}selected="selected" {/if}value="all">{translate key="manager.people.allUsers"}</option>
22
		<option {if $roleSymbolic=='managers'}selected="selected" {/if}value="managers">{translate key="user.role.managers"}</option>
22
		<option {if $roleSymbolic=='managers'}selected="selected" {/if}value="managers">{translate key="user.role.managers"}</option>
 Lines 47-96    Link Here 
47
	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
47
	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
48
</form>
48
</form>
49
49
50
<p>{foreach from=$alphaList item=letter}<a href="{url path=$roleSymbolic oldUserId=$oldUserId searchInitial=$letter}">{if $letter == $searchInitial}<strong>{$letter|escape}</strong>{else}{$letter|escape}{/if}</a> {/foreach}<a href="{url path=$roleSymbolic oldUserId=$oldUserId}">{if $searchInitial==''}<strong>{translate key="common.all"}</strong>{else}{translate key="common.all"}{/if}</a></p>
50
<p>{foreach from=$alphaList item=letter}<a href="{url path=$roleSymbolic oldUserIds=$oldUserIds searchInitial=$letter}">{if $letter == $searchInitial}<strong>{$letter|escape}</strong>{else}{$letter|escape}{/if}</a> {/foreach}<a href="{url path=$roleSymbolic oldUserIds=$oldUserIds}">{if $searchInitial==''}<strong>{translate key="common.all"}</strong>{else}{translate key="common.all"}{/if}</a></p>
51
51
52
{if not $roleId}
52
{if not $roleId}
53
<ul>
53
<ul>
54
	<li><a href="{url path="managers" oldUserId=$oldUserId}">{translate key="user.role.managers"}</a></li>
54
	<li><a href="{url path="managers" oldUserIds=$oldUserIds}">{translate key="user.role.managers"}</a></li>
55
	<li><a href="{url path="editors" oldUserId=$oldUserId}">{translate key="user.role.editors"}</a></li>
55
	<li><a href="{url path="editors" oldUserIds=$oldUserIds}">{translate key="user.role.editors"}</a></li>
56
	<li><a href="{url path="sectionEditors" oldUserId=$oldUserId}">{translate key="user.role.sectionEditors"}</a></li>
56
	<li><a href="{url path="sectionEditors" oldUserIds=$oldUserIds}">{translate key="user.role.sectionEditors"}</a></li>
57
	{if $roleSettings.useLayoutEditors}
57
	{if $roleSettings.useLayoutEditors}
58
		<li><a href="{url path="layoutEditors" oldUserId=$oldUserId}">{translate key="user.role.layoutEditors"}</a></li>
58
		<li><a href="{url path="layoutEditors" oldUserIds=$oldUserIds}">{translate key="user.role.layoutEditors"}</a></li>
59
	{/if}
59
	{/if}
60
	{if $roleSettings.useCopyeditors}
60
	{if $roleSettings.useCopyeditors}
61
		<li><a href="{url path="copyeditors" oldUserId=$oldUserId}">{translate key="user.role.copyeditors"}</a></li>
61
		<li><a href="{url path="copyeditors" oldUserIds=$oldUserIds}">{translate key="user.role.copyeditors"}</a></li>
62
	{/if}
62
	{/if}
63
	{if $roleSettings.useProofreaders}
63
	{if $roleSettings.useProofreaders}
64
		<li><a href="{url path="proofreaders" oldUserId=$oldUserId}">{translate key="user.role.proofreaders"}</a></li>
64
		<li><a href="{url path="proofreaders" oldUserIds=$oldUserIds}">{translate key="user.role.proofreaders"}</a></li>
65
	{/if}
65
	{/if}
66
	<li><a href="{url path="reviewers" oldUserId=$oldUserId}">{translate key="user.role.reviewers"}</a></li>
66
	<li><a href="{url path="reviewers" oldUserIds=$oldUserIds}">{translate key="user.role.reviewers"}</a></li>
67
	<li><a href="{url path="authors" oldUserId=$oldUserId}">{translate key="user.role.authors"}</a></li>
67
	<li><a href="{url path="authors" oldUserIds=$oldUserIds}">{translate key="user.role.authors"}</a></li>
68
	<li><a href="{url path="readers" oldUserId=$oldUserId}">{translate key="user.role.readers"}</a></li>
68
	<li><a href="{url path="readers" oldUserIds=$oldUserIds}">{translate key="user.role.readers"}</a></li>
69
	<li><a href="{url path="subscriptionManagers" oldUserId=$oldUserId}">{translate key="user.role.subscriptionManagers"}</a></li>
69
	<li><a href="{url path="subscriptionManagers" oldUserIds=$oldUserIds}">{translate key="user.role.subscriptionManagers"}</a></li>
70
</ul>
70
</ul>
71
71
72
<br />
72
<br />
73
{else}
73
{else}
74
<p><a href="{url path="all" oldUserId=$oldUserId}" class="action">{translate key="manager.people.allUsers"}</a></p>
74
<p><a href="{url path="all" oldUserIds=$oldUserIds}" class="action">{translate key="manager.people.allUsers"}</a></p>
75
{/if}
75
{/if}
76
</div>
76
</div>
77
<div id="users">
77
<div id="users">
78
{if !empty($oldUserIds)}
79
	{* Selecting target user; do not include checkboxes on LHS *}
80
	{assign var="numCols" value=4}
81
{else}
82
	{* Selecting user(s) to merge; include checkboxes on LHS *}
83
	{assign var="numCols" value=5}
84
	<form method="post" action="{url}">
85
{/if}
78
<table width="100%" class="listing">
86
<table width="100%" class="listing">
79
	<tr>
87
	<tr>
80
		<td colspan="4" class="headseparator">&nbsp;</td>
88
		<td colspan="{$numCols}" class="headseparator">&nbsp;</td>
81
	</tr>
89
	</tr>
82
	<tr class="heading" valign="bottom">
90
	<tr class="heading" valign="bottom">
83
		<td width="29%">{sort_heading key="user.username" sort="username"}</td>
91
		{if empty($oldUserIds)}
92
			<td width="5%">&nbsp;</td>
93
		{/if}
94
		<td>{sort_heading key="user.username" sort="username"}</td>
84
		<td width="29%">{sort_heading key="user.name" sort="name"}</td>
95
		<td width="29%">{sort_heading key="user.name" sort="name"}</td>
85
		<td width="29%">{sort_heading key="user.email" sort="email"}</td>
96
		<td width="29%">{sort_heading key="user.email" sort="email"}</td>
86
		<td width="13%" align="right">{translate key="common.action"}</td>
97
		<td width="15%" align="right">{translate key="common.action"}</td>
87
	</tr>
98
	</tr>
88
	<tr>
99
	<tr>
89
		<td colspan="4" class="headseparator">&nbsp;</td>
100
		<td colspan="{$numCols}" class="headseparator">&nbsp;</td>
90
	</tr>
101
	</tr>
91
	{iterate from=users item=user}
102
	{iterate from=users item=user}
92
	{assign var=userExists value=1}
103
	{assign var=userExists value=1}
93
	<tr valign="top">
104
	<tr valign="top">
105
		{if empty($oldUserIds)}
106
			<td><input type="checkbox" name="oldUserIds[]" value="{$user->getId()|escape}" {if $thisUser->getId() == $user->getId()}disabled="disabled" {/if}/></td>
107
		{/if}
94
		<td><a class="action" href="{url op="userProfile" path=$user->getId()}">{$user->getUsername()|escape|wordwrap:15:" ":true}</a></td>
108
		<td><a class="action" href="{url op="userProfile" path=$user->getId()}">{$user->getUsername()|escape|wordwrap:15:" ":true}</a></td>
95
		<td>{$user->getFullName()|escape}</td>
109
		<td>{$user->getFullName()|escape}</td>
96
		<td class="nowrap">
110
		<td class="nowrap">
 Lines 100-132    Link Here 
100
			{$user->getEmail()|truncate:15:"..."|escape}&nbsp;{icon name="mail" url=$url}
114
			{$user->getEmail()|truncate:15:"..."|escape}&nbsp;{icon name="mail" url=$url}
101
		</td>
115
		</td>
102
		<td align="right">
116
		<td align="right">
103
			{if $oldUserId != ''}
117
			{if !empty($oldUserIds)}
104
				{if $oldUserId != $user->getId()}
118
				{if !in_array($user->getId(), $oldUserIds)}
105
					<a href="#" onclick="confirmAction('{url oldUserId=$oldUserId newUserId=$user->getId()}', '{translate|escape:"jsparam" key="manager.people.mergeUsers.confirm" oldUsername=$oldUsername newUsername=$user->getUsername()}')" class="action">{translate key="manager.people.mergeUser"}</a>
119
					<a href="#" onclick="confirmAction('{url oldUserIds=$oldUserIds newUserId=$user->getId()}', '{translate|escape:"jsparam" key="manager.people.mergeUsers.confirm" oldAccountCount=$oldUserIds|@count newUsername=$user->getUsername()}')" class="action">{translate key="manager.people.mergeUser"}</a>
106
				{/if}
120
				{/if}
107
			{elseif $thisUser->getId() != $user->getId()}
121
			{elseif $thisUser->getId() != $user->getId()}
108
				<a href="{url oldUserId=$user->getId()}" class="action">{translate key="manager.people.mergeUser"}</a>
122
				<a href="{url oldUserIds=$user->getId()}" class="action">{translate key="manager.people.mergeUser"}</a>
109
			{/if}
123
			{/if}
110
		</td>
124
		</td>
111
	</tr>
125
	</tr>
112
	<tr>
126
	<tr>
113
		<td colspan="4" class="{if $users->eof()}end{/if}separator">&nbsp;</td>
127
		<td colspan="{$numCols}" class="{if $users->eof()}end{/if}separator">&nbsp;</td>
114
	</tr>
128
	</tr>
115
{/iterate}
129
{/iterate}
116
{if $users->wasEmpty()}
130
{if $users->wasEmpty()}
117
	<tr>
131
	<tr>
118
		<td colspan="4" class="nodata">{translate key="manager.people.noneEnrolled"}</td>
132
		<td colspan="{$numCols}" class="nodata">{translate key="manager.people.noneEnrolled"}</td>
119
	</tr>
133
	</tr>
120
	<tr>
134
	<tr>
121
		<td colspan="4" class="endseparator">&nbsp;</td>
135
		<td colspan="{$numCols}" class="endseparator">&nbsp;</td>
122
	</tr>
136
	</tr>
123
{else}
137
{else}
124
	<tr>
138
	<tr>
125
		<td colspan="2" align="left">{page_info iterator=$users}</td>
139
		<td colspan="{math equation="floor(numCols / 2)" numCols=$numCols}" align="left">{page_info iterator=$users}</td>
126
		<td colspan="2" align="right">{page_links anchor="users" name="users" iterator=$users searchInitial=$searchInitial searchField=$searchField searchMatch=$searchMatch search=$search dateFromDay=$dateFromDay dateFromYear=$dateFromYear dateFromMonth=$dateFromMonth dateToDay=$dateToDay dateToYear=$dateToYear dateToMonth=$dateToMonth roleSymbolic=$roleSymbolic oldUserId=$oldUserId sort=$sort sortDirection=$sortDirection}</td>
140
		<td colspan="{math equation="ceil(numCols / 2)" numCols=$numCols}" align="right">{page_links anchor="users" name="users" iterator=$users searchInitial=$searchInitial searchField=$searchField searchMatch=$searchMatch search=$search dateFromDay=$dateFromDay dateFromYear=$dateFromYear dateFromMonth=$dateFromMonth dateToDay=$dateToDay dateToYear=$dateToYear dateToMonth=$dateToMonth roleSymbolic=$roleSymbolic oldUserIds=$oldUserIds sort=$sort sortDirection=$sortDirection}</td>
127
	</tr>
141
	</tr>
128
{/if}
142
{/if}
129
</table>
143
</table>
144
{if empty($oldUserIds)}
145
	<input type="submit" class="button defaultButton" value="{translate key="manager.people.mergeUsers"}" />
146
	</form>
147
{/if}
130
</div>
148
</div>
131
</div>
149
</div>
132
{include file="common/footer.tpl"}
150
{include file="common/footer.tpl"}

Return to bug 4857