Esempio n. 1
0
xassert(!$user_mgbaker->can_administer($paper18));
// author derivation works
xassert($user_mgbaker->act_author_view($paper18));
// simple search
$pl = new PaperList(new PaperSearch($user_shenker, "au:berkeley"));
$j = $pl->text_json("id title");
xassert_eqq(join(";", array_keys($j)), "1;6;13;15;24");
// sorting works
assert_search_papers($user_shenker, "au:berkeley sort:title", "24 15 13 1 6");
// correct conflict information returned
$pl = new PaperList(new PaperSearch($user_shenker, "1 2 3 4 5 15-18"), ["reviewer" => $user_mgbaker]);
$j = $pl->text_json("id selconf");
xassert_eqq(join(";", array_keys($j)), "1;2;3;4;5;15;16;17;18");
xassert(!@$j[1]->selconf && !@$j[2]->selconf && @$j[3]->selconf && !@$j[4]->selconf && !@$j[5]->selconf && !@$j[15]->selconf && !@$j[16]->selconf && !@$j[17]->selconf && @$j[18]->selconf);
$pl = new PaperList(new PaperSearch($user_shenker, "1 2 3 4 5 15-18"), ["reviewer" => $user_jon]);
$j = $pl->text_json("id selconf");
xassert_eqq(join(";", array_keys($j)), "1;2;3;4;5;15;16;17;18");
xassert(!@$j[1]->selconf && !@$j[2]->selconf && !@$j[3]->selconf && !@$j[4]->selconf && !@$j[5]->selconf && !@$j[15]->selconf && !@$j[16]->selconf && @$j[17]->selconf && !@$j[18]->selconf);
assert_search_papers($user_shenker, "re:estrin", "4 8 18");
// normals don't see conflicted reviews
assert_search_papers($user_mgbaker, "re:estrin", "4 8");
// make reviewer identity anonymous until review completion
$Conf->save_setting("rev_open", 1);
$Conf->save_setting("pc_seeblindrev", 1);
assert_search_papers($user_mgbaker, "re:varghese", "");
$revreq = array("overAllMerit" => 5, "reviewerQualification" => 4, "ready" => true);
save_review(1, $user_mgbaker, $revreq);
assert_search_papers($user_mgbaker, "re:varghese", "1");
// check comment identity
xassert($Conf->setting("au_seerev") == Conf::AUSEEREV_NO);
$comment1 = new CommentInfo(null, $paper1);
Esempio n. 2
0
function search_text_col($user, $text, $col = "id")
{
    $pl = new PaperList(new PaperSearch($user, $text));
    $x = array();
    foreach ($pl->text_json($col) as $pid => $p) {
        $x[] = $pid . " " . $p->{$col} . "\n";
    }
    return join("", $x);
}