Skip to content

Commit

Permalink
*8095* give section editors a distinct role id
Browse files Browse the repository at this point in the history
  • Loading branch information
jnugent committed Feb 28, 2013
1 parent 70f8aaf commit 9c7379a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
16 changes: 6 additions & 10 deletions classes/install/Upgrade.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1210,16 +1210,12 @@ function migrateUserRoles() {
}

// Section Editors.
$userGroups = $userGroupDao->getByRoleId($journal->getId(), ROLE_ID_MANAGER);
while ($group = $userGroups->next()) {
if ($group->getData('nameLocaleKey') == 'default.groups.name.sectionEditor') {
$userResult = $journalDao->retrieve('SELECT DISTINCT user_id FROM section_editors WHERE journal_id = ?', array((int) $journal->getId()));
while (!$userResult->EOF) {
$row = $userResult->GetRowAssoc(false);
$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());
$userResult->MoveNext();
}
}
$userGroups = $userGroupDao->getByRoleId($journal->getId(), ROLE_ID_SECTION_EDITOR);
$userResult = $journalDao->retrieve('SELECT DISTINCT user_id FROM section_editors WHERE journal_id = ?', array((int) $journal->getId()));;
while (!$userResult->EOF) {
$row = $userResult->GetRowAssoc(false);
$userGroupDao->assignUserToGroup($row['user_id'], $group->getId());
$userResult->MoveNext();
}

// Layout Editors. NOTE: this involves a role id change from 0x300 to 0x1001 (old OJS _LAYOUT_EDITOR to PKP-lib _ASSISTANT).
Expand Down
4 changes: 3 additions & 1 deletion registry/userGroups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
<!-- Managerial Role -->
<group roleId="0x00000010" name="default.groups.name.manager" plural="default.groups.plural.manager" abbrev="default.groups.abbrev.manager" />
<group roleId="0x00000010" stages="1,2,3,4,5" name="default.groups.name.editor" plural="default.groups.plural.editor" abbrev="default.groups.abbrev.editor" />
<group roleId="0x00000010" stages="1,2,3,4,5" name="default.groups.name.sectionEditor" plural="default.groups.plural.sectionEditor" abbrev="default.groups.abbrev.sectionEditor" />
<group roleId="0x00000010" stages="4,5" name="default.groups.name.productionEditor" plural="default.groups.plural.productionEditor" abbrev="default.groups.abbrev.productionEditor" />

<!-- Section Editor Role -->
<group roleId="0x00000011" stages="1,2,3,4,5" name="default.groups.name.sectionEditor" plural="default.groups.plural.sectionEditor" abbrev="default.groups.abbrev.sectionEditor" />

<!-- Guest editor role -->
<group roleId="0x00000201" stages="1,2,3,4,5" name="default.groups.name.guestEditor" plural="default.groups.plural.guestEditor" abbrev="default.groups.abbrev.guestEditor" />

Expand Down

0 comments on commit 9c7379a

Please sign in to comment.