tiki-list_submissions.php 2.76 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3
// (c) Copyright 2002-2009 by authors of the Tiki Wiki/CMS/Groupware Project
// 
4 5
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
changi67's avatar
changi67 committed
6
// $Id: /cvsroot/tikiwiki/tiki/tiki-list_submissions.php,v 1.21 2007-10-12 07:55:28 nyloth Exp $
7
$section = 'cms';
8 9
require_once ('tiki-setup.php');
include_once ('lib/articles/artlib.php');
10
if ($prefs['feature_submissions'] != 'y') {
changi67's avatar
changi67 committed
11
	$smarty->assign('msg', tra("This feature is disabled") . ": feature_submissions");
12
	$smarty->display("error.tpl");
13
	die;
lrargerich's avatar
lrargerich committed
14
}
15 16
if (isset($_REQUEST["remove"])) {
	if ($tiki_p_remove_submission != 'y') {
17
		$smarty->assign('errortype', 401);
18
		$smarty->assign('msg', tra("Permission denied you cannot remove submissions"));
19
		$smarty->display("error.tpl");
20 21
		die;
	}
changi67's avatar
changi67 committed
22 23 24
	$area = 'delsubmission';
	if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
		key_check($area);
mose's avatar
mose committed
25
		$artlib->remove_submission($_REQUEST["remove"]);
changi67's avatar
changi67 committed
26 27 28
	} else {
		key_get($area);
	}
29
}
30
if (isset($_REQUEST["approve"])) {
31
	check_ticket('list-submissions');
32
	if ($tiki_p_approve_submission != 'y') {
33
		$smarty->assign('errortype', 401);
34
		$smarty->assign('msg', tra("Permission denied you cannot approve submissions"));
35
		$smarty->display("error.tpl");
36 37 38 39
		die;
	}
	$artlib->approve_submission($_REQUEST["approve"]);
}
40 41 42 43
// This script can receive the thresold
// for the information as the number of
// days to get in the log 1,3,4,etc
// it will default to 1 recovering information for today
44 45
if (!isset($_REQUEST["sort_mode"])) {
	$sort_mode = 'publishDate_desc';
46
} else {
47 48 49
	$sort_mode = $_REQUEST["sort_mode"];
}
$smarty->assign_by_ref('sort_mode', $sort_mode);
50 51 52
// If offset is set use it if not then use offset =0
// use the maxRecords php variable to set the limit
// if sortMode is not set then use lastModif_desc
53 54
if (!isset($_REQUEST["offset"])) {
	$offset = 0;
55
} else {
56
	$offset = $_REQUEST["offset"];
57
}
58
$smarty->assign_by_ref('offset', $offset);
changi67's avatar
changi67 committed
59 60 61 62 63 64 65 66
if (($tiki_p_admin == 'y') || ($tiki_p_admin_cms == 'y')) {
	$pdate = '';
} elseif (isset($_SESSION["thedate"])) {
	if ($_SESSION["thedate"] < $tikilib->now) {
		$pdate = $_SESSION["thedate"];
	} else {
		$pdate = $tikilib->now;
	}
67
} else {
changi67's avatar
changi67 committed
68
	$pdate = $tikilib->now;
69
}
70 71
if (isset($_REQUEST["find"])) {
	$find = $_REQUEST["find"];
72
} else {
73
	$find = '';
74
}
75 76
$smarty->assign('find', $find);
$listpages = $tikilib->list_submissions($offset, $maxRecords, $sort_mode, $find, $pdate);
77
$smarty->assign_by_ref('cant_pages', $listpages["cant"]);
78
include_once ('tiki-section_options.php');
79
$smarty->assign_by_ref('listpages', $listpages["data"]);
80
ask_ticket('list-submissions');
81
// Display the template
82
$smarty->assign('mid', 'tiki-list_submissions.tpl');
83
$smarty->display("tiki.tpl");