コード例 #1
0
ファイル: test-payout.php プロジェクト: lobolabs/fossfactory
}
list($rc, $C_info) = ff_getprojectinfo($C);
checkerr($rc, $C_info);
if (get_FFC($C_info["bounty"]) != 22250) {
    checkerr(1, "Bounty on C: {$C_info['bounty']}");
}
// Reject the submission
checkerr(ff_rejectsubmission($projectlead, $sub_B1, 'just testing'));
// Because the hold is still in place, the bounties should not change.
list($rc, $C_info) = ff_getprojectinfo($C);
checkerr($rc, $C_info);
if (get_FFC($C_info["bounty"]) != 22250) {
    checkerr(1, "Bounty on C: {$C_info['bounty']}");
}
// Reject the submission with prejudice
checkerr(ff_rejectsubmission($projectlead, $sub_B1, 'just testing', 1));
// Because we rejected with prejudice, the bounties should now balance out.
list($rc, $C_info) = ff_getprojectinfo($C);
checkerr($rc, $C_info);
if (get_FFC($C_info["bounty"]) != 23500) {
    checkerr(1, "Bounty on C: {$C_info['bounty']}");
}
// Accept the submission
checkerr(ff_acceptsubmission($projectlead, $sub_B1));
// Set the payout time to be immediately and execute the payout.
checkerr(admin_expedite_payout($B));
// Check that the bounties are what we expect
list($rc, $A_info) = ff_getprojectinfo($A);
checkerr($rc, $A_info);
if (get_FFC($A_info["bounty"]) != 37600) {
    checkerr(1, "Bounty on A: {$A_info['bounty']}");
コード例 #2
0
Copyright 2008 John-Paul Gignac

This file is part of Fossfactory-src.

Fossfactory-src is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Fossfactory-src is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Fossfactory-src.  If not, see <http://www.gnu.org/licenses/>.
*/
$id = scrub($_REQUEST['id']);
$submissionid = intval($_REQUEST['submissionid']);
$accept = scrub($_REQUEST['accept']);
if ($accept == 'true') {
    list($rc, $err) = ff_acceptsubmission($username, $submissionid);
} elseif ($accept == 'false') {
    list($rc, $err) = ff_rejectsubmission($username, $submissionid, $_REQUEST["rejectreason"], 0);
} elseif ($accept == 'prejudice') {
    list($rc, $err) = ff_rejectsubmission($username, $submissionid, '', 1);
}
header("Location: " . projurl($id, "tab=submissions"));
?>