ContributionService::delete_contribution($contribution);
    redirect(HOST . DIR . url('/member/contribution_panel.php', '', '&'));
} else {
    $Bread_crumb->add($LANG['member_area'], url('member.php?id=' . $User->get_attribute('user_id') . '&view=1', 'member-' . $User->get_attribute('user_id') . '.php?view=1'));
    $Bread_crumb->add($LANG['contribution_panel'], url('contribution_panel.php'));
    define('TITLE', $LANG['contribution_panel']);
}
require_once '../kernel/header.php';
$template = new Template('member/contribution_panel.tpl');
if ($contribution_id > 0) {
    $template->assign_vars(array('C_CONSULT_CONTRIBUTION' => true));
    import('content/comments');
    $comments = new Comments('events', $contribution_id, url('contribution_panel.php?id=' . $contribution_id . '&com=%s'), 'member', KERNEL_SCRIPT);
    $contribution_creation_date = $contribution->get_creation_date();
    $contribution_fixing_date = $contribution->get_fixing_date();
    $template->assign_vars(array('C_WRITE_AUTH' => $User->check_auth($contribution->get_auth(), CONTRIBUTION_AUTH_BIT), 'C_UNPROCESSED_CONTRIBUTION' => $contribution->get_status() != EVENT_STATUS_PROCESSED, 'ENTITLED' => $contribution->get_entitled(), 'DESCRIPTION' => second_parse($contribution->get_description()), 'STATUS' => $contribution->get_status_name(), 'CONTRIBUTER' => $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $contribution->get_poster_id() . "'", __LINE__, __FILE__), 'COMMENTS' => $comments->display(), 'CREATION_DATE' => $contribution_creation_date->format(DATE_FORMAT_SHORT), 'MODULE' => $contribution->get_module_name(), 'U_CONTRIBUTOR_PROFILE' => url('member.php?id=' . $contribution->get_poster_id(), 'member-' . $contribution->get_poster_id() . '.php'), 'FIXING_URL' => url(PATH_TO_ROOT . $contribution->get_fixing_url())));
    if ($contribution->get_status() == EVENT_STATUS_PROCESSED) {
        $template->assign_vars(array('C_CONTRIBUTION_FIXED' => true, 'FIXER' => $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $contribution->get_fixer_id() . "'", __LINE__, __FILE__), 'FIXING_DATE' => $contribution_fixing_date->format(DATE_FORMAT_SHORT), 'U_FIXER_PROFILE' => url('member.php?id=' . $contribution->get_poster_id(), 'member-' . $contribution->get_poster_id() . '.php')));
    }
    $template->assign_vars(array('L_CONTRIBUTION' => $LANG['contribution'], 'L_ENTITLED' => $LANG['contribution_entitled'], 'L_DESCRIPTION' => $LANG['contribution_description'], 'L_STATUS' => $LANG['contribution_status'], 'L_CONTRIBUTOR' => $LANG['contributor'], 'L_CREATION_DATE' => $LANG['contribution_creation_date'], 'L_FIXER' => $LANG['contribution_fixer'], 'L_FIXING_DATE' => $LANG['contribution_fixing_date'], 'L_MODULE' => $LANG['contribution_module'], 'L_PROCESS_CONTRIBUTION' => $LANG['process_contribution'], 'L_CONFIRM_DELETE_CONTRIBUTION' => $LANG['confirm_delete_contribution'], 'L_DELETE' => $LANG['delete'], 'L_UPDATE' => $LANG['update'], 'U_UPDATE' => url('contribution_panel.php?edit=' . $contribution_id), 'U_DELETE' => url('contribution_panel.php?del=' . $contribution_id . '&token=' . $Session->get_token())));
} elseif ($id_update > 0) {
    $template->assign_vars(array('C_EDIT_CONTRIBUTION' => true, 'EDITOR' => display_editor(), 'ENTITLED' => $contribution->get_entitled(), 'DESCRIPTION' => unparse($contribution->get_description()), 'CONTRIBUTION_ID' => $contribution->get_id(), 'EVENT_STATUS_UNREAD_SELECTED' => $contribution->get_status() == EVENT_STATUS_UNREAD ? ' selected="selected"' : '', 'EVENT_STATUS_BEING_PROCESSED_SELECTED' => $contribution->get_status() == EVENT_STATUS_BEING_PROCESSED ? ' selected="selected"' : '', 'EVENT_STATUS_PROCESSED_SELECTED' => $contribution->get_status() == EVENT_STATUS_PROCESSED ? ' selected="selected"' : '', 'L_CONTRIBUTION_STATUS_UNREAD' => $LANG['contribution_status_unread'], 'L_CONTRIBUTION_STATUS_BEING_PROCESSED' => $LANG['contribution_status_being_processed'], 'L_CONTRIBUTION_STATUS_PROCESSED' => $LANG['contribution_status_processed'], 'L_CONTRIBUTION' => $LANG['contribution'], 'L_DESCRIPTION' => $LANG['contribution_description'], 'L_STATUS' => $LANG['contribution_status'], 'L_ENTITLED' => $LANG['contribution_entitled'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'U_TARGET' => url('contribution_panel.php?token=' . $Session->get_token())));
} else {
    import('util/pagination');
    $pagination = new Pagination();
    $template->assign_vars(array('C_CONTRIBUTION_LIST' => true));
    $num_contributions = 1;
    define('CONTRIBUTIONS_PER_PAGE', 20);
    $criteria = retrieve(GET, 'criteria', 'current_status');
    $order = retrieve(GET, 'order', 'asc');
    if (!in_array($criteria, array('entitled', 'module', 'status', 'creation_date', 'fixing_date', 'poster_id', 'fixer_id'))) {
Esempio n. 2
0
<p class="proposal"><?=content2html($proposal->content)?></p>
<?
if ($is_proponent and $proposal->allowed_edit_reason_only()) {
?>
<div class="add"><a href="proposal_edit.php?id=<?=$proposal->id?>" class="icontextlink"><img src="img/edit.png" width="16" height="16" alt="<?=_("edit")?>"><?=_("Edit reason")?></a></div>
<?
}
?>
<h2><?=_("Reason")?></h2>
<p class="proposal"><?=content2html($proposal->reason)?></p>
</section>

<div class="clearfix"></div>

<?
Comments::display($proposal);

help("timebar");

// time bar
if ($proposal->submitted or $proposal->revoke) {
	$times = array();
	// proposal dates
	if ($proposal->submitted) {
		$times[] = array($proposal->submitted, _("Submitted"), _("Submitted at %s."));
	}
	if ($proposal->admitted) {
		$times[] = array($proposal->admitted, _("Admitted"), _("Admitted at %s."));
	}
	if ($proposal->revoke) {
		$times[] = array($proposal->revoke, _("Revoke"),
Esempio n. 3
0
<?php

define('PATH_TO_ROOT', '../../..');
require_once PATH_TO_ROOT . '/kernel/begin.php';
define('TITLE', $LANG['title_com']);
require_once PATH_TO_ROOT . '/kernel/header_no_display.php';
if (!empty($_GET['com'])) {
    if (!preg_match('`([0-9]+)([a-z]+)([0-9]*)`', trim($_GET['com']), $array_get)) {
        $array_get = array('', '', '', '');
    }
    $idcom = empty($array_get[3]) && !empty($_POST['idcom']) ? numeric($_POST['idcom']) : $array_get[3];
    import('content/comments');
    $Comments = new Comments($array_get[2], $array_get[1], url('?com=' . $array_get[1] . $array_get[2] . '%s', ''), $array_get[2]);
    $Comments->set_arg($idcom, HOST . DIR . '/kernel/framework/ajax/pop_up_comments.php');
    echo $Comments->display(POP_UP_WINDOW, null, '');
}
include_once PATH_TO_ROOT . '/kernel/footer_no_display.php';
Esempio n. 4
0
function display_comments($script, $idprov, $vars, $module_folder = '')
{
    import('content/comments');
    $comments = new Comments($script, $idprov, $vars, $module_folder);
    return $comments->display();
}