Skip to content

Commit

Permalink
Minor refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Jan 9, 2014
1 parent 64315bb commit 6559c0c
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,36 +654,34 @@ static public function override_conflict($forceShow = null) {
}

public function allowAdminister($prow) {
if ($prow && $prow->has_conflict($this)
&& $prow->managerContactId
&& $prow->managerContactId != $this->contactId)
$manager = $prow ? $prow->managerContactId : 0;
if ($manager && $manager != $this->contactId && $prow->has_conflict($this))
return false;
return $this->privChair
|| ($prow && $prow->managerContactId
&& $prow->managerContactId == $this->contactId);
return $this->privChair || $manager == $this->contactId;
}

public function canAdminister($prow, $forceShow = null) {
$manager = $prow ? $prow->managerContactId : 0;
$conflict = $prow && $prow->has_conflict($this);
if ($conflict && $prow->managerContactId
&& $prow->managerContactId != $this->contactId)
if ($manager && $manager != $this->contactId && $conflict)
return false;
else if (($this->privChair || $manager == $this->contactId)
&& (!$conflict || self::override_conflict($forceShow)))
return true;
else
return false;
return ($this->privChair
|| ($prow && $prow->managerContactId
&& $prow->managerContactId == $this->contactId))
&& (!$conflict || self::override_conflict($forceShow));
}

public function actPC($prow, $forceShow = null) {
$manager = $prow ? $prow->managerContactId : 0;
$conflict = $prow && $prow->has_conflict($this);
if ($conflict && $prow->managerContactId
&& $prow->managerContactId != $this->contactId)
if ($manager && $manager != $this->contactId && $conflict)
return false;
return $this->isPC
&& (!$conflict
|| (($this->privChair
|| $prow->managerContactId == $this->contactId)
&& self::override_conflict($forceShow)));
else if (($this->privChair || $manager == $this->contactId)
&& (!$conflict || self::override_conflict($forceShow)))
return true;
else
return $this->isPC && !$conflict;
}

public function actConflictType($prow) {
Expand Down

0 comments on commit 6559c0c

Please sign in to comment.