mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: Fixed a couple of bugs in the multiple-subsites-per-group function. (from r89803)
This commit is contained in:
parent
60cc9f9650
commit
b99c2c62c4
@ -78,12 +78,15 @@ class GroupSubsites extends DataObjectDecorator implements PermissionProvider {
|
|||||||
$subsiteMap));
|
$subsiteMap));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (sizeof($subsiteMap) <= 1) $dropdown = $dropdown->transform(new ReadonlyTransformation()) ;
|
if (sizeof($subsiteMap) <= 1) {
|
||||||
$tab->push($dropdown);
|
$fields->addFieldToTab("Root.Subsites", new ReadonlyField("SubsitesHuman",
|
||||||
|
_t('GroupSubsites.ACCESSRADIOTITLE', 'Give this group access to'),
|
||||||
$fields->addFieldToTab("Root.Subsites", new CheckboxSetField("Subsites",
|
reset($subsiteMap)));
|
||||||
_t('GroupSubsites.ACCESSRADIOTITLE', 'Give this group access to'),
|
} else {
|
||||||
$subsiteMap));
|
$fields->addFieldToTab("Root.Subsites", new CheckboxSetField("Subsites",
|
||||||
|
_t('GroupSubsites.ACCESSRADIOTITLE', 'Give this group access to'),
|
||||||
|
$subsiteMap));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,6 +141,8 @@ class GroupSubsites extends DataObjectDecorator implements PermissionProvider {
|
|||||||
= {$q}Group{$q}.{$q}ID{$q} AND {$q}Group_Subsites{$q}.{$q}SubsiteID{$q} = $subsiteID");
|
= {$q}Group{$q}.{$q}ID{$q} AND {$q}Group_Subsites{$q}.{$q}SubsiteID{$q} = $subsiteID");
|
||||||
$query->where[] = "({$q}Group_Subsites{$q}.{$q}SubsiteID{$q} IS NOT NULL OR
|
$query->where[] = "({$q}Group_Subsites{$q}.{$q}SubsiteID{$q} IS NOT NULL OR
|
||||||
{$q}Group{$q}.{$q}AccessAllSubsites{$q} = 1)";
|
{$q}Group{$q}.{$q}AccessAllSubsites{$q} = 1)";
|
||||||
|
|
||||||
|
if(!$query->groupby) $query->groupby[] = "\"Group\".\"ID\"";
|
||||||
} else {
|
} else {
|
||||||
$query->where[] = "{$q}Group{$q}.{$q}AccessAllSubsites{$q} = 1";
|
$query->where[] = "{$q}Group{$q}.{$q}AccessAllSubsites{$q} = 1";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user