Skip to content

Commit

Permalink
Simplyfy the code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed May 25, 2012
1 parent e355f32 commit c8357aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Core/Libs/Controller/Component/MassActionComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,12 @@ public function copy($ids) {

foreach($ids as $id) {
$record = $this->Controller->{$this->Controller->modelClass}->read(null, $id);

unset($record[$this->Controller->modelClass]['id']);

if ($record[$this->Controller->modelClass][$this->Controller->{$this->Controller->modelClass}->displayField] != $this->Controller->{$this->Controller->modelClass}->primaryKey) {

$check = $record[$this->Controller->modelClass][$this->Controller->{$this->Controller->modelClass}->displayField] != $this->Controller->{$this->Controller->modelClass}->primaryKey;

if ($check) {
$record[$this->Controller->modelClass][$this->Controller->{$this->Controller->modelClass}->displayField] =
$record[$this->Controller->modelClass][$this->Controller->{$this->Controller->modelClass}->displayField] . $copyText;
}
Expand Down

0 comments on commit c8357aa

Please sign in to comment.