コード例 #1
0
 private function _search_has($word, &$qt, $quoted)
 {
     global $Conf;
     $lword = strtolower($word);
     $lword = get(self::$_keywords, $lword) ?: $lword;
     if ($lword === "paper" || $lword === "sub" || $lword === "submission") {
         $qt[] = new SearchTerm("pf", 0, array("paperStorageId", "!=0"));
     } else {
         if ($lword === "final" || $lword === "finalcopy") {
             $qt[] = new SearchTerm("pf", 0, array("finalPaperStorageId", "!=0"));
         } else {
             if ($lword === "ab") {
                 $qt[] = new SearchTerm("pf", 0, array("abstract", "!=''"));
             } else {
                 if (preg_match('/\\A(?:(?:draft-?)?\\w*resp(?:onse)?|\\w*resp(?:onse)(?:-?draft)?|cmt|aucmt|anycmt)\\z/', $lword)) {
                     $this->_search_comment(">0", $lword, $qt, $quoted);
                 } else {
                     if ($lword === "manager" || $lword === "admin" || $lword === "administrator") {
                         $qt[] = new SearchTerm("pf", 0, array("managerContactId", "!=0"));
                     } else {
                         if (preg_match('/\\A[cip]?(?:re|pri|sec|ext)\\z/', $lword)) {
                             $this->_search_reviewer(">0", $lword, $qt);
                         } else {
                             if ($lword === "lead") {
                                 $qt[] = new SearchTerm("pf", self::F_XVIEW, array("leadContactId", "!=0"));
                             } else {
                                 if ($lword === "shep" || $lword === "shepherd") {
                                     $qt[] = new SearchTerm("pf", self::F_XVIEW, array("shepherdContactId", "!=0"));
                                 } else {
                                     if ($lword === "dec" || $lword === "decision") {
                                         $this->_search_status("yes", $qt, false, false);
                                     } else {
                                         if (preg_match('/\\A[\\w-]+\\z/', $lword) && $this->_search_options("{$lword}:yes", $qt, false)) {
                                             /* OK */
                                         } else {
                                             $x = array("“paper”", "“final”", "“abstract”", "“comment”", "“aucomment”", "“re”", "“extre”");
                                             foreach ($Conf->resp_round_list() as $i => $rname) {
                                                 if (!in_array("“response”", $x)) {
                                                     array_push($x, "“response”", "“draftresponse”");
                                                 }
                                                 if ($i) {
                                                     $x[] = "“{$rname}response”";
                                                 }
                                             }
                                             foreach (PaperOption::option_json_list() as $o) {
                                                 array_push($x, "“" . htmlspecialchars($o->abbr) . "”");
                                             }
                                             $this->warn("Unknown “has:” search. I understand " . commajoin($x) . ".");
                                             $qt[] = new SearchTerm("f");
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }