コード例 #1
0
 public function prepare(PaperList $pl, $visible)
 {
     if (!$pl->contact->isPC) {
         return false;
     }
     $this->viewer_contact = $pl->contact;
     if (!$this->contact) {
         $this->contact = $pl->reviewer_contact();
     }
     $this->careful = $this->contact->contactId != $pl->contact->contactId;
     if (($this->careful || !$this->name) && !$pl->contact->is_manager()) {
         return false;
     }
     if ($visible) {
         $this->is_direct = $this->contact->contactId == $pl->reviewer_cid();
         if ($this->is_direct) {
             $pl->qopts["reviewer"] = $pl->reviewer_cid();
             $pl->qopts["reviewerPreference"] = 1;
         } else {
             $pl->qopts["allReviewerPreference"] = 1;
         }
         $pl->qopts["topics"] = 1;
     }
     if ($this->editable && $visible > 0 && ($tid = $pl->table_id())) {
         $reviewer_cid = 0;
         if ($pl->contact->privChair) {
             $reviewer_cid = $pl->reviewer_cid() ?: 0;
         }
         $pl->add_header_script("add_revpref_ajax(" . json_encode("#{$tid}") . ",{$reviewer_cid})", "revpref_ajax");
     }
     return true;
 }