function expandvar_recipient($what, $isbool) { global $Conf; if ($what == "%NEWASSIGNMENTS%") { return $this->get_new_assignments($this->recipient); } // rest is only there if we have a real paper if (!$this->row || get($this->row, "paperId") <= 0) { return self::EXPANDVAR_CONTINUE; } if ($this->preparation) { ++$this->preparation->paper_expansions; } if ($what == "%TITLE%") { return $this->row->title; } if ($what == "%TITLEHINT%") { if ($tw = UnicodeHelper::utf8_abbreviate($this->row->title, 40)) { return "\"{$tw}\""; } else { return ""; } } if ($what == "%NUMBER%" || $what == "%PAPER%") { return $this->row->paperId; } if ($what == "%REVIEWNUMBER%") { return $this->reviewNumber; } if ($what == "%AUTHOR%" || $what == "%AUTHORS%") { if (!$this->permissionContact->is_site_contact && !$this->row->has_author($this->permissionContact) && !$this->permissionContact->can_view_authors($this->row, false)) { return $isbool ? false : "Hidden for blind review"; } return rtrim($this->row->pretty_text_author_list()); } if ($what == "%AUTHORVIEWCAPABILITY%" && isset($this->row->capVersion) && $this->permissionContact->act_author_view($this->row)) { return "cap=" . $Conf->capability_text($this->row, "a"); } if ($what == "%SHEPHERD%" || $what == "%SHEPHERDNAME%" || $what == "%SHEPHERDEMAIL%") { $pc = pcMembers(); if (defval($this->row, "shepherdContactId") <= 0 || !defval($pc, $this->row->shepherdContactId, null)) { if ($isbool) { return false; } else { if ($this->expansionType == self::EXPAND_EMAIL) { return "<none>"; } else { return "(no shepherd assigned)"; } } } $shep = $pc[$this->row->shepherdContactId]; if ($what == "%SHEPHERD%") { return $this->expand_user($shep, "CONTACT"); } else { if ($what == "%SHEPHERDNAME%") { return $this->expand_user($shep, "NAME"); } else { return $this->expand_user($shep, "EMAIL"); } } } if ($what == "%REVIEWAUTHOR%" && $this->contacts["reviewer"]) { return $this->_expand_reviewer("CONTACT", $isbool); } if ($what == "%REVIEWS%") { return $this->get_reviews(); } if ($what == "%COMMENTS%") { return $this->get_comments(null); } $len = strlen($what); if ($len > 12 && substr($what, 0, 10) == "%COMMENTS(" && substr($what, $len - 2) == ")%") { if ($t = $this->tagger()->check(substr($what, 10, $len - 12), Tagger::NOVALUE)) { return $this->get_comments($t); } } if ($len > 12 && substr($what, 0, 10) == "%TAGVALUE(" && substr($what, $len - 2) == ")%") { if ($t = $this->tagger()->check(substr($what, 10, $len - 12), Tagger::NOVALUE | Tagger::NOPRIVATE)) { if (!isset($this->_tags[$t])) { $this->_tags[$t] = array(); $result = Dbl::qe("select paperId, tagIndex from PaperTag where tag=?", $t); while ($row = edb_row($result)) { $this->_tags[$t][$row[0]] = $row[1]; } } $tv = defval($this->_tags[$t], $this->row->paperId); if ($isbool) { return $tv !== null; } else { if ($tv !== null) { return $tv; } else { $this->_tagless[$this->row->paperId] = true; return "(none)"; } } } } if ($this->preparation) { --$this->preparation->paper_expansions; } return self::EXPANDVAR_CONTINUE; }