Example #1
0
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
set_include_path(dirname(dirname(__FILE__)) . '/include' . PATH_SEPARATOR . get_include_path());
// Get common settings.
require_once 'pear-prepend.php';
// Get the database class.
require_once 'DB.php';
$options = array('persistent' => false, 'portability' => DB_PORTABILITY_ALL);
$dbh =& DB::connect(PEAR_DATABASE_DSN, $options);
if (DB::isError($dbh)) {
    die("Failed to connect: {$dsn}\n");
}
// Obtain PEPr's common functions and classes.
require_once 'pepr/pepr.php';
$proposals =& proposal::getAll($dbh, 'vote');
// This checks if a proposal should automatically be finished
foreach ($proposals as $id => $proposal) {
    if ($proposal->getStatus() == 'vote') {
        $lastVoteDate = $proposal->longened_date > 0 ? $proposal->longened_date : $proposal->vote_date;
        if ($lastVoteDate + PROPOSAL_STATUS_VOTE_TIMELINE < time()) {
            if (ppVote::getCount($dbh, $proposal->id) > 4) {
                $proposals[$id]->status = 'finished';
                $proposal->sendActionEmail('change_status_finished', 'pearweb', null);
            } else {
                if ($proposal->longened_date > 0) {
                    $proposals[$id]->status = 'finished';
                    $proposal->sendActionEmail('change_status_finished', 'pearweb', null);
                } else {
                    $proposals[$id]->longened_date = time();
                    $proposal->sendActionEmail('longened_timeline_sys', 'pearweb', null);
Example #2
0
 * obtain it through the world-wide-web, please send a note to
 * license@php.net so we can mail you a copy immediately.
 *
 * @category  pearweb
 * @package   PEPr
 * @author    Tobias Schlitt <*****@*****.**>
 * @author    Daniel Convissor <*****@*****.**>
 * @copyright Copyright (c) 1997-2005 The PHP Group
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
/**
 * Obtain the common functions and classes.
 */
require_once 'pepr/pepr.php';
if (!($proposal = proposal::get($dbh, (int) @$_GET['id']))) {
    response_header('PEPr :: Comments :: Invalid Request');
    echo "<h1>Comments for</h1>\n";
    report_error('The requested proposal does not exist.');
    response_footer();
    exit;
}
$id = $proposal->id;
response_header('PEPr :: Comments :: ' . htmlspecialchars($proposal->pkg_name));
echo '<h1>Comments for &quot;' . htmlspecialchars($proposal->pkg_name) . "&quot;</h1>\n";
display_pepr_nav($proposal);
if ($auth_user && $proposal->getStatus() == 'proposal') {
    include_once 'HTML/QuickForm2.php';
    $form = new HTML_QuickForm2('comment', 'post', array('action' => 'pepr-comments-show.php?id=' . $id));
    $form->removeAttribute('name');
    $c = $form->addElement('textarea', 'comment', array('cols' => 70, 'rows' => 20, 'required' => 'required', 'placeholder' => 'Hi. Can I politely suggest that...', 'id' => 'comment_field'))->setLabel('Comments:');
Example #3
0
     $items = category::getRecent(10, $category);
     break;
 case 'pepr':
     if ($argument == 'pepr') {
         $channel_title = "PEPr: Latest proposals.";
         $channel_description = "The latest PEPr proposals.";
         $obj_items = proposal::getAll($dbh, NULL, 10);
     } elseif (isset($proposalStatiMap[$argument])) {
         $channel_title = "PEPr: Latest proposals with status " . $proposalStatiMap[$argument];
         $channel_description = "The latest PEPr proposals with status " . $proposalStatiMap[$argument];
         $obj_items = proposal::getAll($dbh, $argument, 10);
     } elseif (substr($argument, 0, 6) == 'search') {
         $searchString = substr($argument, 7);
         $channel_title = "PEPr: Latest proposals containing " . $searchString;
         $channel_description = "The latest PEPr proposals containing " . $searchString;
         $obj_items = proposal::search($searchString);
     } else {
         rss_bailout();
     }
     $items = array();
     foreach ($obj_items as $id => $item) {
         $item = $item->toRSSArray();
         $items[] = array('name' => $item['title'], 'link' => $item['link'], 'releasenotes' => $item['desc'], 'releasedate' => (int) $item['date'], 'version' => '');
     }
     break;
 case 'bugs':
     /* to be done, new bug system supports it */
     rss_bailout();
     break;
 default:
     rss_bailout();
Example #4
0
 * license@php.net so we can mail you a copy immediately.
 *
 * @category  pearweb
 * @package   PEPr
 * @author    Tobias Schlitt <*****@*****.**>
 * @author    Daniel Convissor <*****@*****.**>
 * @copyright Copyright (c) 1997-2005 The PHP Group
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
/**
 * Obtain the common functions and classes.
 */
require_once 'pepr/pepr.php';
require_once 'HTML/QuickForm2.php';
if (!isset($_GET['id']) || !($proposal = proposal::get($dbh, $_GET['id']))) {
    response_header('PEPr :: Votes :: Invalid Request');
    echo "<h1>Proposal Votes</h1>\n";
    report_error('The requested proposal does not exist.');
    response_footer();
    exit;
}
response_header('PEPr :: Votes :: ' . htmlspecialchars($proposal->pkg_name));
echo '<h1>Proposal Votes for "' . htmlspecialchars($proposal->pkg_name) . "\"</h1>\n";
if ($auth_user && $proposal->mayVote($dbh, $auth_user->handle)) {
    $form = new HTML_QuickForm2('vote', 'post', array('action' => 'pepr-votes-show.php?id=' . $proposal->id));
    $form->removeAttribute('name');
    $form->addDataSource(new HTML_QuickForm2_DataSource_Array(array('value' => 1)));
    $vote = $form->addElement('select', 'value', array('id' => 'vote_field', 'required' => 'required'));
    $vote->loadOptions(array(1 => '+1', 0 => '0', -1 => '-1'));
    $vote->setLabel("Vote:");
Example #5
0
 * license@php.net so we can mail you a copy immediately.
 *
 * @category  pearweb
 * @package   PEPr
 * @author    Tobias Schlitt <*****@*****.**>
 * @author    Daniel Convissor <*****@*****.**>
 * @copyright Copyright (c) 1997-2005 The PHP Group
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
/**
 * Obtain the common functions and classes.
 */
require_once 'pepr/pepr.php';
$handle = htmlspecialchars(@$_GET['handle']);
if (!($proposal =& proposal::get($dbh, @$_GET['id'])) || !$handle) {
    response_header('PEPr :: Vote Details :: Invalid Request');
    echo "<h1>Vote Details</h1>\n";
    report_error('The requested proposal or user does not exist.');
    response_footer();
    exit;
}
response_header('PEPr :: Vote Details :: ' . htmlspecialchars($proposal->pkg_name) . ' :: ' . $handle);
echo '<h1>Vote Details for "' . htmlspecialchars($proposal->pkg_name) . '" by ';
echo $handle . "</h1>\n";
display_pepr_nav($proposal);
?>

<table border="0" cellspacing="0" cellpadding="2" style="width: 100%">

 <tr>
Example #6
0
}
$popular = release::getPopular(5);
if (!empty($popular)) {
    $RSIDEBAR_DATA .= "<strong>Popular Packages*:</strong>\n";
    $RSIDEBAR_DATA .= '<table class="sidebar-releases">' . "\n";
    foreach ($popular as $package) {
        $RSIDEBAR_DATA .= "<tr><td>";
        $RSIDEBAR_DATA .= "<a href=\"/package/" . $package['name'] . "/\">";
        $RSIDEBAR_DATA .= wordwrap($package['name'], 25, "\n", 1) . ' ' . $package['version'] . '</a><br /> <small>(' . number_format($package['d'], 2) . ')</small></td></tr>';
    }
    $feed_link = '<a href="/feeds/" title="Information about XML feeds for the PEAR website"><img src="/gifs/feed.png" width="16" height="16" alt="" /></a>';
    $RSIDEBAR_DATA .= "<tr><td><small>* downloads per day</small></td></tr>\n";
    $RSIDEBAR_DATA .= '<tr><td style="text-align: right">' . $feed_link . "</td></tr>\n";
    $RSIDEBAR_DATA .= "</table>\n";
}
$proposals = proposal::getRecent($dbh, 5);
if (!empty($proposals)) {
    $RSIDEBAR_DATA .= "<strong>Recently Proposed:</strong>\n";
    $RSIDEBAR_DATA .= '<table class="sidebar-releases">' . "\n";
    foreach ($proposals as $proposal) {
        $RSIDEBAR_DATA .= "<tr><td>";
        $RSIDEBAR_DATA .= make_link('/pepr/pepr-proposal-show.php?id=' . $proposal->id, wordwrap($proposal->pkg_category . '::' . $proposal->pkg_name, 25, "\n", 1));
        $RSIDEBAR_DATA .= '<br />by ' . make_link('/user/' . htmlspecialchars($proposal->user_handle), $proposal->user_handle);
        $RSIDEBAR_DATA .= '</td></tr>';
    }
    $feed_link = '<a href="/pepr/" title="PEPR Proposals">See all</a>';
    $RSIDEBAR_DATA .= '<tr><td style="text-align: right">' . $feed_link . "</td></tr>\n";
    $RSIDEBAR_DATA .= "</table>\n";
}
$developers = user::listRecentUsersByKarma('pear.dev', 3);
if (!empty($developers)) {
Example #7
0
}
if (isset($_GET['filter']) && isset($proposalStatiMap[$_GET['filter']])) {
    $selectStatus = $_GET['filter'];
} else {
    $selectStatus = '';
}
if ($selectStatus != '') {
    $order = ' pkg_category ASC, pkg_name ASC';
}
if (isset($_GET['search'])) {
    $searchString = trim($_GET['search']);
    $searchString = preg_replace('/;/', '', $searchString);
    $proposals = proposal::search($searchString);
    $searchPostfix = '_search_' . urlencode($searchString);
} else {
    $proposals =& proposal::getAll($dbh, @$selectStatus, null, @$order);
    $searchPostfix = '';
}
response_header('PEPr :: Package Proposals');
echo '<h1>Package Proposals</h1>' . "\n";
if (empty($selectStatus)) {
    echo "<p>";
    echo "PEPr is PEAR's system for managing the process of submitting ";
    echo "new packages. If you would like to submit your own package, ";
    echo "please have a look at the <a href=\"/manual/en/developers-newmaint.php\">New Maintainers' Guide</a>.";
    echo "</p>";
    echo "<p>";
    echo "<a href=\"/feeds/pepr{$searchPostfix}.rss\"><img src=\"/gifs/feed.png\" width=\"16\" height=\"16\" alt=\"Aggregate this\" border=\"0\" /></a>";
    echo "</p>";
}
display_overview_nav();
Example #8
0
 * license@php.net so we can mail you a copy immediately.
 *
 * @category  pearweb
 * @package   PEPr
 * @author    Tobias Schlitt <*****@*****.**>
 * @author    Daniel Convissor <*****@*****.**>
 * @copyright Copyright (c) 1997-2005 The PHP Group
 * @license   http://www.php.net/license/3_0.txt  PHP License
 * @version   $Id$
 */
/**
 * Obtain the common functions and classes.
 */
require_once 'pepr/pepr.php';
$proposal_id = isset($_GET['id']) ? (int) $_GET['id'] : false;
if (!$proposal_id || !($proposal =& proposal::get($dbh, $proposal_id))) {
    response_header('PEPr :: Details :: Invalid Request');
    echo "<h1>Proposal for</h1>\n";
    report_error('The requested proposal does not exist.');
    response_footer();
    exit;
}
response_header('PEPr :: Details :: ' . htmlspecialchars($proposal->pkg_name));
echo '<h1>Proposal for &quot;' . htmlspecialchars($proposal->pkg_name) . "&quot;</h1>\n";
display_pepr_nav($proposal);
$description = $proposal->getParsedDescription();
?>

<table border="0" cellspacing="0" cellpadding="2" style="width: 100%">

 <tr>
Example #9
0
 } else {
     if (isset($proposal) && $proposal->status != 'draft') {
         if ($actionComment || $karma->has($auth_user->handle, "pear.pepr.admin") && $proposal->user_handle != $auth_user->handle) {
             if (!$actionComment) {
                 PEAR::raiseError('A changelog comment is required.');
             }
             $proposal->addComment($values['action_comment']);
             $proposal->sendActionEmail('edit_proposal', 'mixed', $auth_user->handle, $values['action_comment']);
         }
     }
 }
 $linksData = $values['link'];
 if (isset($proposal)) {
     $proposal->fromArray($values);
 } else {
     $proposal = new proposal($values);
     $proposal->user_handle = $auth_user->handle;
 }
 unset($proposal->links);
 for ($i = 0; $i < count($linksData); $i++) {
     $linkData = array();
     $linkData['type'] = $linksData[$i]['type'];
     $linkData['url'] = $linksData[$i]['url'];
     if ($linksData[$i]['url']) {
         $proposal->addLink($linkData);
     }
 }
 $proposal->store($dbh);
 if (isset($values['next_stage'])) {
     $nextStage = 1;
 }
Example #10
0
    echo "<h1>Delete Proposal</h1>\n";
    report_success('Proposal deleted successfully.');
    echo '<p>';
    echo make_link('/pepr/', 'Back to PEPr Home Page');
    echo "</p>\n";
    response_footer();
    exit;
}
if (empty($_GET['id'])) {
    response_header('PEPr :: Delete :: Invalid Request');
    echo "<h1>Delete Proposal</h1>\n";
    report_error('The requested proposal does not exist.');
    response_footer();
    exit;
}
$proposal = proposal::get($dbh, $_GET['id']);
if (!$proposal) {
    response_header('PEPr :: Delete :: Invalid Request');
    echo "<h1>Delete Proposal</h1>\n";
    report_error('The requested proposal does not exist.');
    response_footer();
    exit;
}
$karma = new Damblan_Karma($dbh);
$form = new HTML_QuickForm2('delete-proposal', 'post', array('action' => 'pepr-proposal-delete.php?id=' . $proposal->id));
ob_start();
response_header('PEPr :: Delete :: ' . htmlspecialchars($proposal->pkg_name));
echo '<h1>Delete Proposal &quot;' . htmlspecialchars($proposal->pkg_name) . "&quot;</h1>\n";
if (!$proposal->mayEdit($auth_user->handle)) {
    report_error('You are not allowed to delete this proposal,' . ' probably due to it having reached the "' . $proposal->getStatus(true) . '" phase.' . ' If this MUST be deleted, contact someone ELSE' . ' who has pear.pepr.admin karma.');
    response_footer();