Skip to content

Commit

Permalink
update first entry name of visibility select box
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasse committed Jun 18, 2024
1 parent a0cda50 commit e1c9080
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion adm_program/modules/categories/categories_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,24 @@ function showHideViewRightControl() {
$roleEditSet[] = '';
}

if ($gCurrentOrganization->countAllRecords() > 1) {
if ((int) $category->getValue('cat_org_id') === 0) {
$firstEntryName = $gL10n->get('SYS_ALL_ORGANIZATIONS');
} else {
$firstEntryName = $gL10n->get('SYS_ALL_THIS_ORGANIZATION');
}

if ($getType !== 'USF') {
$firstEntryName .= ' ('.$gL10n->get('SYS_ALSO_VISITORS').')';
}
} else {
if ($getType === 'USF') {
$firstEntryName = $gL10n->get('SYS_ALL_THIS_ORGANIZATION');
} else {
$firstEntryName = $gL10n->get('SYS_ALL').' ('.$gL10n->get('SYS_ALSO_VISITORS').')';
}
}

// show selectbox with all assigned roles
$form->addSelectBoxFromSql(
'adm_categories_view_right',
Expand All @@ -245,7 +263,7 @@ function showHideViewRightControl() {
'property' => HtmlForm::FIELD_REQUIRED,
'defaultValue' => $roleViewSet,
'multiselect' => true,
'firstEntry' => array('0', $gL10n->get('SYS_ALL') . ' (' . $gL10n->get('SYS_ALSO_VISITORS') . ')', null),
'firstEntry' => array('0', $firstEntryName, null),
'helpTextId' => $roleViewDescription
)
);
Expand Down

0 comments on commit e1c9080

Please sign in to comment.