@@ -22,12 +22,12 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function updateCMSFields(FieldList $fields) { |
| 24 | 24 | |
| 25 | - if (Permission::check('ADMIN')) { |
|
| 26 | - $memberField = new DropdownField('CreatorID', 'Creator', Member::get()->map('ID', 'Username', '-- Please select --')); |
|
| 27 | - $fields->addFieldToTab( "Root.Creator", $memberField ); |
|
| 28 | - } |
|
| 25 | + if (Permission::check('ADMIN')) { |
|
| 26 | + $memberField = new DropdownField('CreatorID', 'Creator', Member::get()->map('ID', 'Username', '-- Please select --')); |
|
| 27 | + $fields->addFieldToTab( "Root.Creator", $memberField ); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - return $fields; |
|
| 30 | + return $fields; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | } |
| 34 | 34 | \ No newline at end of file |
@@ -23,8 +23,8 @@ |
||
| 23 | 23 | public function updateCMSFields(FieldList $fields) { |
| 24 | 24 | |
| 25 | 25 | if (Permission::check('ADMIN')) { |
| 26 | - $memberField = new DropdownField('CreatorID', 'Creator', Member::get()->map('ID', 'Username', '-- Please select --')); |
|
| 27 | - $fields->addFieldToTab( "Root.Creator", $memberField ); |
|
| 26 | + $memberField = new DropdownField('CreatorID', 'Creator', Member::get()->map('ID', 'Username', '-- Please select --')); |
|
| 27 | + $fields->addFieldToTab("Root.Creator", $memberField); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | return $fields; |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | /* |
| 4 | 4 | Only allow editing when the current user is the same as the creator for each of cycling route, cycling exploration and cycling short |
| 5 | 5 | */ |
| 6 | - public function canEdit($member = null){ |
|
| 6 | + public function canEdit($member = null) { |
|
| 7 | 7 | //return in_array($this->owner->ClassName, array('RideFolder','Ride','CyclingShort','CyclingRoute','CyclingExploration')); |
| 8 | 8 | $caneditasowner = true; |
| 9 | - if (in_array($this->owner->ClassName, array('CyclingShort','CyclingRoute','CyclingExploration'))) { |
|
| 9 | + if (in_array($this->owner->ClassName, array('CyclingShort', 'CyclingRoute', 'CyclingExploration'))) { |
|
| 10 | 10 | if ($this->owner->CreatorID != Member::currentUserID()) { |
| 11 | 11 | $caneditasowner = false; |
| 12 | 12 | } |