Example #1
0
 }
 print $body;
 print '</div>';
 if ($projinfo['numattachments'] > 0) {
     print "<br>\n";
     print "<b>attachments:</b><br>\n";
     list($rc, $err) = ff_listprojectattachments($projinfo['id']);
 }
 //display the list of history changes
 list($rc, $history) = ff_getreqmtshistory($id);
 if (!$rc && sizeof($history) > 0) {
     print "<br><b>Change History:</b><br>\n";
     print "<ul>\n";
     $historysize = sizeof($history);
     for ($i = $historysize - 1; $i >= 0; $i--) {
         list($rc, $historyarray) = ff_getpostinfo($history[$i]['postid']);
         $historyarray['ancestors'][] = $history[$i]['postid'];
         $ancestry = implode("/", $historyarray['ancestors']);
         if (!$history[$i]['subject']) {
             $history[$i]['subject'] = 'No subject';
         }
         print "<li>";
         print "<span class=postdate>";
         print date("Y-m-d H:i T", $history[$i]["time"]);
         print "</span> ";
         if ($history[$i]["action"] == 'accept') {
             print "<span class=accepted>[ACCEPTED]</span> ";
         } else {
             if ($history[$i]["action"] == 'reject') {
                 print "<span class=rejected>[REJECTED]</span> ";
             }
Example #2
0
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/>.
*/
$project = scrub($_REQUEST["project"]);
$post = scrub($_REQUEST["post"]);
$accept = intval($_REQUEST["accept"]);
function error($rc, $err)
{
    header("Location: " . projurl($GLOBALS["project"], "err=" . urlencode("{$rc} {$err}")));
    exit;
}
// Get the post info
list($rc, $postinfo) = ff_getpostinfo($post);
if ($rc) {
    error($rc, $postinfo);
}
$subject = $postinfo["subject"];
// Get the project info
list($rc, $projinfo) = ff_getprojectinfo($project);
if ($rc) {
    error($rc, $projinfo);
}
if ($accept) {
    // Get the old requirements
    $before = $projinfo["reqmts"];
    $oldseq = $projinfo["reqmts_seq"];
    // Get the diff
    $body = $postinfo["body"];
Example #3
0
function getduties($username)
{
    $username = scrub($username);
    list($rc, $duties) = ff_getduties($username);
    if ($rc) {
        return array($rc, $duties);
    }
    $result = array();
    foreach ($duties as $key => $duty) {
        list($rc, $projectinfo) = ff_getprojectinfo($duty["projectid"]);
        if ($rc) {
            return array($rc, $projectinfo);
        }
        $deadline = $duty["deadline"];
        $tag = $deadline ? "newduty2" : "newduty";
        if ($duty["type"] == 'dispute-plaintiff') {
            list($rc, $disputeinfo) = ff_getdisputeinfo($duty["id"]);
            if ($rc) {
                return array($rc, $disputeinfo);
            }
            $link = "dispute.php?id={$duty['id']}&requser={$username}";
            $macros = array("subject" => $disputeinfo["subject"], "projectname" => $projectinfo["name"]);
            $textid = "plaintiff";
        } else {
            if ($duty["type"] == 'dispute-defendant') {
                list($rc, $disputeinfo) = ff_getdisputeinfo($duty["id"]);
                if ($rc) {
                    return array($rc, $disputeinfo);
                }
                $link = "dispute.php?id={$duty['id']}&requser={$username}";
                $macros = array("subject" => $disputeinfo["subject"], "username" => $disputeinfo["plaintiff"], "projectname" => $projectinfo["name"], "deadline" => date("D F j, H:i:s T", $deadline));
                if (sizeof($disputeinfo["arguments"] == 1)) {
                    $textid = "{$tag}-newdispute";
                } else {
                    $textid = "{$tag}-dispute";
                }
            } else {
                if ($duty["type"] == 'new-subproject') {
                    list($rc, $pinfo) = ff_getprojectinfo($duty["id"]);
                    if ($rc) {
                        return array($rc, $pinfo);
                    }
                    $link = projurl($duty["projectid"], "tab=subprojects&requser={$username}");
                    $macros = array("projectname" => $pinfo["name"], "parentname" => $projectinfo["name"], "deadline" => date("D F j, H:i:s T", $deadline));
                    $textid = "{$tag}-newsubproject";
                } else {
                    if ($duty["type"] == 'code submission') {
                        // Hide code submission duties on accepted projects
                        if ($projectinfo["status"] == 'accept') {
                            continue;
                        }
                        list($rc, $sinfo) = ff_getsubmissioninfo($duty["id"]);
                        if ($rc) {
                            return array($rc, $sinfo);
                        }
                        $link = projurl($duty["projectid"], "tab=submissions&requser={$username}#submission{$duty['id']}");
                        $macros = array("projectname" => $projectinfo["name"], "submitter" => $sinfo["username"], "deadline" => date("D F j, H:i:s T", $deadline));
                        $textid = "{$tag}-submission";
                    } else {
                        if ($duty["type"] == 'change proposal') {
                            list($rc, $postinfo) = ff_getpostinfo($duty["id"]);
                            if ($rc) {
                                return array($rc, $postinfo);
                            }
                            $link = projurl($duty["projectid"], "requser={$username}&post={$duty['id']}");
                            $macros = array("projectname" => $projectinfo["name"], "submitter" => $postinfo["owner"], "deadline" => date("D F j, H:i:s T", $deadline));
                            $textid = "{$tag}-changeproposal";
                        }
                    }
                }
            }
        }
        list($rc, $subject) = ff_gettext("{$textid}-subject", $macros);
        if ($rc) {
            return array($rc, $subject);
        }
        list($rc, $body) = ff_gettext("{$textid}-body", $macros);
        if ($rc) {
            return array($rc, $body);
        }
        $duty["link"] = $link;
        $duty["subject"] = $subject;
        $duty["body"] = $body;
        $result[$key] = $duty;
    }
    return array(0, $result);
}