예제 #1
0
 function perm_change_tag(PaperInfo $prow, $tag, $previndex, $index, $forceShow = null)
 {
     global $Conf;
     if ($this->can_change_tag($prow, $tag, $previndex, $index, $forceShow)) {
         return null;
     }
     $rights = $this->rights($prow, $forceShow);
     $whyNot = $prow->initial_whynot();
     $whyNot["tag"] = $tag;
     if (!$this->isPC) {
         $whyNot["permission"] = true;
     } else {
         if ($rights->conflict_type > 0) {
             $whyNot["conflict"] = true;
             if ($rights->allow_administer) {
                 $whyNot["forceShow"] = true;
             }
         } else {
             if (!$Conf->timePCViewPaper($prow, false)) {
                 if ($prow->timeWithdrawn > 0) {
                     $whyNot["withdrawn"] = true;
                 } else {
                     $whyNot["notSubmitted"] = true;
                 }
             } else {
                 $tag = TagInfo::base($tag);
                 $twiddle = strpos($tag, "~");
                 if ($twiddle === 0 && $tag[1] === "~" || $twiddle > 0 && substr($tag, 0, $twiddle) != $this->contactId) {
                     $whyNot["otherTwiddleTag"] = true;
                 } else {
                     if ($twiddle !== false) {
                         $whyNot["voteTagNegative"] = true;
                     } else {
                         $t = TagInfo::defined_tag($tag);
                         if ($t && $t->vote) {
                             $whyNot["voteTag"] = true;
                         } else {
                             $whyNot["chairTag"] = true;
                         }
                     }
                 }
             }
         }
     }
     return $whyNot;
 }
 public function prepare(PaperList $pl, $visible)
 {
     if (!$pl->contact->can_view_any_peruser_tags($this->tag)) {
         return false;
     }
     if ($visible) {
         $pl->qopts["tags"] = 1;
     }
     $dt = TagInfo::defined_tag($this->tag);
     if (!$dt || $dt->rank || !$dt->vote && !$dt->approval) {
         $this->viewtype = 0;
     } else {
         $this->viewtype = $dt->approval ? 1 : 2;
     }
     return true;
 }