<?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
// 
// 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.
// $Id: tiki-old_polls.php 39467 2012-01-12 19:47:28Z changi67 $

require_once ('tiki-setup.php');
include_once ('lib/polls/polllib.php');
if (!isset($polllib)) {
	$polllib = new PollLib;
}
$access->check_feature('feature_polls');
$access->check_permission('tiki_p_view_poll_results');
// 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
if (!isset($_REQUEST["sort_mode"])) {
	$sort_mode = 'publishDate_desc';
} else {
	$sort_mode = $_REQUEST["sort_mode"];
}
$smarty->assign_by_ref('sort_mode', $sort_mode);
// 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
if (!isset($_REQUEST["offset"])) {
	$offset = 0;
} else {
	$offset = $_REQUEST["offset"];
<?php

// $Id: /cvsroot/tikiwiki/tiki/tiki-admin_polls.php,v 1.26.2.1 2007-12-06 13:46:07 nkoth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// 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.
// Initialization
require_once 'tiki-setup.php';
include_once 'lib/polls/polllib.php';
if (!isset($polllib)) {
    $polllib = new PollLib($dbTiki);
}
if ($prefs['feature_polls'] != 'y') {
    $smarty->assign('msg', tra("This feature is disabled") . ": feature_polls");
    $smarty->display("error.tpl");
    die;
}
if ($tiki_p_admin_polls != 'y') {
    $smarty->assign('errortype', 401);
    $smarty->assign('msg', tra("You do not have permission to use this feature"));
    $smarty->display("error.tpl");
    die;
}
if (!isset($_REQUEST["pollId"])) {
    $_REQUEST["pollId"] = 0;
}
$smarty->assign('pollId', $_REQUEST["pollId"]);
if (isset($_REQUEST["setlast"])) {
    check_ticket('admin-polls');
    $polllib->set_last_poll();
}
Beispiel #3
0
/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// 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.
// $Id: tiki-poll_form.php 44444 2013-01-05 21:24:24Z changi67 $
$section = 'poll';
require_once 'tiki-setup.php';
require_once 'lib/tikilib.php';
// httpScheme()
include_once 'lib/polls/polllib.php';
if (!isset($polllib)) {
    $polllib = new PollLib();
}
$access->check_feature('feature_polls');
$access->check_permission('tiki_p_vote_poll');
if (empty($_REQUEST["pollId"])) {
    $smarty->assign('msg', tra("No poll indicated"));
    $smarty->display("error.tpl");
    die;
}
$poll_info = $polllib->get_poll($_REQUEST["pollId"]);
if (empty($poll_info)) {
    $smarty->assign('msg', tra("No poll indicated"));
    $smarty->display("error.tpl");
    die;
}
$options = $polllib->list_poll_options($_REQUEST["pollId"]);
Beispiel #4
0
<?php

// $Header: /cvsroot/tikiwiki/tiki/tiki-poll_results.php,v 1.12.2.4 2005/01/01 00:11:26 damosoft Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// 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.
// Initialization
require_once 'tiki-setup.php';
include_once 'lib/polls/polllib.php';
if (!isset($polllib)) {
    $polllib = new PollLib($dbTiki);
}
if ($feature_polls != 'y') {
    $smarty->assign('msg', tra("This feature is disabled") . ": feature_polls");
    $smarty->display("error.tpl");
    die;
}
if (!isset($_REQUEST["pollId"])) {
    $smarty->assign('msg', tra("No poll indicated"));
    $smarty->display("error.tpl");
    die;
}
$poll_info = $polllib->get_poll($_REQUEST["pollId"]);
$polls = $polllib->list_active_polls(0, -1, 'publishDate_desc', '');
$options = $polllib->list_poll_options($_REQUEST["pollId"]);
$temp_max = count($options);
for ($i = 0; $i < $temp_max; $i++) {
    if ($poll_info["votes"] == 0) {
        $percent = 0;
    } else {
        $percent = number_format($options[$i]["votes"] * 100 / $poll_info["votes"], 2);
Beispiel #5
0
<?php

// $Header$
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// Copyright (c) 2006, Stephan Borg <*****@*****.**>
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once '../../kernel/setup_inc.php';
include_once POLLS_PKG_PATH . 'poll_lib.php';
$gBitSystem->verifyPackage('polls');
$gBitSystem->verifyPermission('bit_p_admin_polls');
if (!isset($polllib)) {
    $polllib = new PollLib();
}
if (!isset($_REQUEST["poll_id"])) {
    $gBitSystem->fatalError(tra("No poll indicated"));
}
$gBitSmarty->assign('poll_id', $_REQUEST["poll_id"]);
$poll_info = $polllib->get_poll($_REQUEST["poll_id"]);
$gBitSmarty->assign('poll_info', $poll_info);
if (!isset($_REQUEST["option_id"])) {
    $_REQUEST["option_id"] = 0;
}
$gBitSmarty->assign('option_id', $_REQUEST["option_id"]);
if ($_REQUEST["option_id"]) {
    $info = $polllib->get_poll_option($_REQUEST["option_id"]);
} else {
    $info = array();
    $info["title"] = '';
    $info["votes"] = 0;
<?php

// $Id: /cvsroot/tikiwiki/tiki/tiki-poll_results.php,v 1.21.2.4 2007-12-06 14:14:11 nkoth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// 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.
// Initialization
$section = 'poll';
require_once 'tiki-setup.php';
include_once 'lib/polls/polllib.php';
if (!isset($polllib)) {
    $polllib = new PollLib($dbTiki);
}
if ($prefs['feature_polls'] != 'y') {
    $smarty->assign('msg', tra("This feature is disabled") . ": feature_polls");
    $smarty->display("error.tpl");
    die;
}
// Now check permissions to access this page
if ($tiki_p_view_poll_results != 'y') {
    $smarty->assign('errortype', 401);
    $smarty->assign('msg', tra("Permission denied you cannot view this page"));
    $smarty->display("error.tpl");
    die;
}
if (!isset($_REQUEST["maxRecords"])) {
    $_REQUEST["maxRecords"] = 30;
    $smarty->assign('maxRecords', $_REQUEST['maxRecords']);
} elseif ($_REQUEST["maxRecords"] == '') {
    $_REQUEST["maxRecords"] = -1;
    $smarty->assign('maxRecords', '');
<?php

/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// 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.
// $Id: tiki-admin_poll_options.php 44444 2013-01-05 21:24:24Z changi67 $
require_once 'tiki-setup.php';
require_once 'lib/tikilib.php';
// httpScheme()
include_once 'lib/polls/polllib.php';
if (!isset($polllib)) {
    $polllib = new PollLib();
}
$access->check_feature('feature_polls');
$access->check_permission('tiki_p_admin_polls');
if (!isset($_REQUEST["pollId"])) {
    $smarty->assign('msg', tra("No poll indicated"));
    $smarty->display("error.tpl");
    die;
}
$smarty->assign('pollId', $_REQUEST["pollId"]);
$menu_info = $polllib->get_poll($_REQUEST["pollId"]);
$smarty->assign('menu_info', $menu_info);
if (!isset($_REQUEST["optionId"])) {
    $_REQUEST["optionId"] = 0;
}
if (isset($_REQUEST["remove"])) {
Beispiel #8
0
<?php

// $Header$
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// Copyright (c) 2006, Stephan Borg <*****@*****.**>
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once '../../kernel/setup_inc.php';
include_once POLLS_PKG_PATH . 'poll_lib.php';
$gBitSystem->verifyPackage('polls');
$gBitSystem->verifyPermission('bit_p_admin_polls');
if (!isset($polllib)) {
    $polllib = new PollLib();
}
if (!isset($_REQUEST["poll_id"])) {
    $_REQUEST["poll_id"] = 0;
}
$gBitSmarty->assign('poll_id', $_REQUEST["poll_id"]);
if (isset($_REQUEST["setlast"])) {
    $polllib->set_last_poll();
}
if (isset($_REQUEST["closeall"])) {
    $polllib->close_all_polls();
}
if (isset($_REQUEST["activeall"])) {
    $polllib->active_all_polls();
}
if ($_REQUEST["poll_id"]) {
    $info = $polllib->get_poll($_REQUEST["poll_id"]);
} else {
<?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
// 
// 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.
// $Id: tiki-admin_polls.php 39467 2012-01-12 19:47:28Z changi67 $

require_once ('tiki-setup.php');
include_once ('lib/polls/polllib.php');
if (!isset($polllib)) {
	$polllib = new PollLib;
}
$access->check_feature('feature_polls');
$access->check_permission('tiki_p_admin_polls');

$auto_query_args = array('pollId', 'sort_mode', 'offset', 'find');

//Use 12- or 24-hour clock for $publishDate time selector based on admin and user preferences
include_once ('lib/userprefs/userprefslib.php');
$smarty->assign('use_24hr_clock', $userprefslib->get_user_clock_pref($user));

if (!isset($_REQUEST["pollId"])) {
	$_REQUEST["pollId"] = 0;
}
$smarty->assign('pollId', $_REQUEST["pollId"]);
if (isset($_REQUEST["setlast"])) {
	check_ticket('admin-polls');
	$polllib->set_last_poll();
}
if (isset($_REQUEST["closeall"])) {
	check_ticket('admin-polls');
Beispiel #10
0
/**
 * @version $Header$
 *
 * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
 * Copyright (c) 2006, Stephan Borg <*****@*****.**>
 * All Rights Reserved. See below for details and a complete list of authors.
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
 *
 * @package polls
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
include_once POLLS_PKG_PATH . 'poll_lib.php';
$gBitSystem->verifyPackage('polls');
$gBitSystem->verifyPermission('bit_p_vote_poll');
if (!isset($polllib)) {
    $polllib = new PollLib();
}
if (!isset($_REQUEST["poll_id"])) {
    $gBitSystem->fatalError(tra("No poll indicated"));
}
$poll_info = $polllib->get_poll($_REQUEST["poll_id"]);
$options = $polllib->list_poll_options($_REQUEST["poll_id"], 0, -1, 'title_desc', '');
$gBitSmarty->assign_by_ref('poll_info', $poll_info);
$gBitSmarty->assign_by_ref('polls', $options["data"]);
// Display the template
$gBitSystem->display('bitpackage:polls/poll_form.tpl', tra('Poll Form'), array('display_mode' => 'display'));
include_once ('lib/structures/structlib.php');

if (!isset($dcslib)) {
	$dcslib = new DCSLib($dbTiki);
}

if (!isset($bannerlib)) {
	$bannerlib = new BannerLib($dbTiki);
}

if (!isset($rsslib)) {
	$rsslib = new RssLib($dbTiki);
}

if (!isset($polllib)) {
	$polllib = new PollLib($dbTiki);
}

if (!isset($structlib)) {
	$structlib = new StructLib($dbTiki);
}

$smarty->assign('wysiwyg', 'n');
if (isset($_REQUEST['wysiwyg']) && $_REQUEST['wysiwyg'] == 'y') {
	$smarty->assign('wysiwyg', 'y');
}

$access->check_permission(array('tiki_p_admin_modules'));
$auto_query_args = array('show_hidden_modules');

$access->check_feature(array('feature_jquery_ui'));
// $Header: /cvsroot/tikiwiki/tiki/tiki-admin_categories.php,v 1.27.2.10 2006/09/03 16:32:33 ohertel Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// 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.
// Initialization
require_once 'tiki-setup.php';
include_once 'lib/categories/categlib.php';
include_once 'lib/filegals/filegallib.php';
include_once 'lib/polls/polllib.php';
include_once 'lib/tree/categ_admin_tree.php';
include_once 'lib/directory/dirlib.php';
include_once 'lib/trackers/trackerlib.php';
include_once 'lib/commentslib.php';
if (!isset($polllib)) {
    $polllib = new PollLib($dbTiki);
}
if (!isset($commentslib)) {
    $commentslib = new Comments($dbTiki);
}
if ($feature_categories != 'y') {
    $smarty->assign('msg', tra("This feature is disabled") . ": feature_categories");
    $smarty->display("error.tpl");
    die;
}
if ($tiki_p_admin_categories != 'y') {
    $smarty->assign('msg', tra("You do not have permission to use this feature"));
    $smarty->display("error.tpl");
    die;
}
// Check for parent category or set to 0 if not present
Beispiel #13
0
include_once 'lib/polls/polllib.php';
include_once 'lib/banners/bannerlib.php';
include_once 'lib/dcs/dcslib.php';
include_once 'lib/modules/modlib.php';
include_once 'lib/structures/structlib.php';
if (!isset($dcslib)) {
    $dcslib = new DCSLib($dbTiki);
}
if (!isset($bannerlib)) {
    $bannerlib = new BannerLib($dbTiki);
}
if (!isset($rsslib)) {
    $rsslib = new RssLib($dbTiki);
}
if (!isset($polllib)) {
    $polllib = new PollLib($dbTiki);
}
if (!isset($structlib)) {
    $structlib = new StructLib($dbTiki);
}
$smarty->assign('wysiwyg', 'n');
if (isset($_REQUEST['wysiwyg']) && $_REQUEST['wysiwyg'] == 'y') {
    $smarty->assign('wysiwyg', 'y');
}
// PERMISSIONS: NEEDS p_admin
if ($user != 'admin') {
    if ($tiki_p_admin != 'y') {
        $smarty->assign('msg', tra("You do not have permission to use this feature"));
        $smarty->display("error.tpl");
        die;
    }