Commit a977f7d6 authored by changi67's avatar changi67
parent 533bc78a
......@@ -28,8 +28,6 @@ if (!empty($_REQUEST['feed']) && !empty($_REQUEST['name'])) {
} else {
$htmlFeed = new HtmlFeed();
print_r(json_encode(
$htmlFeed->feed()
));
print_r(json_encode($htmlFeed->feed()));
}
\ No newline at end of file
}
......@@ -17,12 +17,12 @@ if (!empty($_POST['importerClassName'])) {
switch ($importerClassName) {
case 'TikiImporter_Wiki_Mediawiki':
require_once('lib/importer/tikiimporter_wiki_mediawiki.php');
break;
break;
case 'TikiImporter_Blog_Wordpress':
require_once('lib/importer/tikiimporter_blog_wordpress.php');
break;
break;
case 'default':
break;
break;
}
$importer = new $importerClassName();
......
......@@ -20,13 +20,13 @@ $cwflashVars["close"] = "onContributionWizardClose";
$cwflashVars["showCloseButton"] = false;
$cwflashVars["Permissions"] = 1; // 1=public, 2=private, 3=group, 4=friends
$smarty->assign_by_ref('cwflashVars',json_encode($cwflashVars));
$smarty->assign_by_ref('cwflashVars', json_encode($cwflashVars));
$count = 0;
if ($_REQUEST['kcw']){
if ($_REQUEST['kcw']) {
$count = count($_REQUEST['entryId']);
$smarty->assign_by_ref('count',$count);
$smarty->assign_by_ref('count', $count);
}
// Display the template
$smarty->assign('mid','tiki-kaltura_upload.tpl');
$smarty->assign('mid', 'tiki-kaltura_upload.tpl');
$smarty->display("tiki.tpl");
......@@ -22,7 +22,7 @@ if (isset($_REQUEST["mapview"]) && $_REQUEST["mapview"] == 'n' && !isset($_REQUE
$smarty->assign('mapview', false);
}
if (isset($_REQUEST["remove"])) {
$artperms = Perms::get( array( 'type' => 'article', 'object' => $_REQUEST['remove'] ) );
$artperms = Perms::get(array( 'type' => 'article', 'object' => $_REQUEST['remove'] ));
if ($artperms->remove_article != 'y') {
$smarty->assign('errortype', 401);
......@@ -36,7 +36,7 @@ if (isset($_REQUEST["remove"])) {
if (isset($_REQUEST['submit_mult'])) {
if ($_REQUEST['submit_mult'] === 'remove_articles' && count($_REQUEST["checked"]) > 0) {
foreach ($_REQUEST["checked"] as $aId) {
$artperms = Perms::get( array( 'type' => 'article', 'object' => $aId ) );
$artperms = Perms::get(array( 'type' => 'article', 'object' => $aId ));
if ($artperms->remove_article != 'y') {
$smarty->assign('errortype', 401);
......
......@@ -55,10 +55,10 @@ if (isset($_REQUEST["find"])) {
$smarty->assign('find', $find);
// Get a list of last changes to the Wiki database
$listpages = $bloglib->list_blogs($offset, $maxRecords, $sort_mode, $find);
Perms::bulk( array( 'type' => 'blog' ), 'object', $listpages['data'], 'blogId' );
Perms::bulk(array( 'type' => 'blog' ), 'object', $listpages['data'], 'blogId');
$temp_max = count($listpages["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$blogperms = Perms::get( array( 'type' => 'blog', 'object' => $listpages['data'][$i]['blogId'] ) );
$blogperms = Perms::get(array( 'type' => 'blog', 'object' => $listpages['data'][$i]['blogId'] ));
$listpages["data"][$i]["individual_tiki_p_read_blog"] = $blogperms->read_blog ? 'y' : 'n';
$listpages["data"][$i]["individual_tiki_p_blog_post"] = $blogperms->blog_post ? 'y' : 'n';
$listpages["data"][$i]["individual_tiki_p_create_blogs"] = $blogperms->create_blogs ? 'y' : 'n';
......
......@@ -30,10 +30,10 @@ if (isset($_REQUEST["find"])) {
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $quizlib->list_quizzes($offset, $maxRecords, $sort_mode, $find);
Perms::bulk( array( 'type' => 'quiz' ), 'object', $channels['data'], 'quizId' );
Perms::bulk(array( 'type' => 'quiz' ), 'object', $channels['data'], 'quizId');
$temp_max = count($channels["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$quizperms = Perms::get( array( 'type' => 'quiz', 'object' => $channels['data'][$i]['quizId'] ) );
$quizperms = Perms::get(array( 'type' => 'quiz', 'object' => $channels['data'][$i]['quizId'] ));
$channels["data"][$i]["individual_tiki_p_take_quiz"] = $quizperms->take_quiz ? 'y' : 'n';
$channels["data"][$i]["individual_tiki_p_view_quiz_stats"] = $quizperms->view_quiz_stats ? 'y' : 'n';
$channels["data"][$i]["individual_tiki_p_view_user_stats"] = $quizperms->view_user_stats ? 'y' : 'n';
......
......@@ -30,10 +30,10 @@ if (isset($_REQUEST["find"])) {
$smarty->assign('find', $find);
$smarty->assign_by_ref('sort_mode', $sort_mode);
$channels = $srvlib->list_surveys($offset, $maxRecords, $sort_mode, $find);
Perms::bulk( array( 'type' => 'survey' ), 'object', $channels['data'], 'surveyId' );
Perms::bulk(array( 'type' => 'survey' ), 'object', $channels['data'], 'surveyId');
$temp_max = count($channels["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$survperms = Perms::get( array( 'type' => 'survey', 'object' => $channels['data'][$i]['surveyId'] ) );
$survperms = Perms::get(array( 'type' => 'survey', 'object' => $channels['data'][$i]['surveyId'] ));
$channels["data"][$i]["individual_tiki_p_take_survey"] = $survperms->take_survey ? 'y' : 'n';
$channels["data"][$i]["individual_tiki_p_view_survey_stats"] = $survperms->view_survey_stats ? 'y' : 'n';
$channels["data"][$i]["individual_tiki_p_admin_surveys"] = $survperms->admin_surveys ? 'y' : 'n';
......
......@@ -47,7 +47,7 @@ $smarty->assign('nlId', $_REQUEST["nlId"]);
$smarty->assign('subscribe', 'n');
$smarty->assign('subscribed', 'n');
$foo = parse_url($_SERVER["REQUEST_URI"]);
$smarty->assign('url_subscribe', $tikilib->httpPrefix( true ) . $foo["path"]);
$smarty->assign('url_subscribe', $tikilib->httpPrefix(true) . $foo["path"]);
if (isset($_REQUEST["nlId"])) {
$tikilib->get_perm_object($_REQUEST["nlId"], 'newsletter');
}
......@@ -71,7 +71,7 @@ if ($tiki_p_subscribe_newsletters == 'y') {
}
// Save the ip at the log for email subscriptions from anonymous
if (empty($user)) {
$logslib->add_log('newsletter','subscribed email '.$_REQUEST["email"].' to newsletter '.$_REQUEST["nlId"]);
$logslib->add_log('newsletter', 'subscribed email '.$_REQUEST["email"].' to newsletter '.$_REQUEST["nlId"]);
$smarty->assign('subscribed', 'y'); // will receive en email
}
// Now subscribe the email address to the newsletter
......
......@@ -54,8 +54,7 @@ if (isset($_REQUEST['assign'])) {
check_ticket('object_watches');
foreach ($all_groups as $g) {
if (in_array($g, $_REQUEST['checked']) && !in_array($g, $old_watches)) {
$tikilib->add_group_watch($g, $_REQUEST['watch_event'], $_REQUEST['objectId'], $objectType,
$objectName, $objectHref);
$tikilib->add_group_watch($g, $_REQUEST['watch_event'], $_REQUEST['objectId'], $objectType, $objectName, $objectHref);
$addedGroups[] = $g;
} elseif (!in_array($g, $_REQUEST['checked']) && in_array($g, $old_watches)) {
$tikilib->remove_group_watch($g, $_REQUEST['watch_event'], $_REQUEST['objectId'], $objectType);
......@@ -65,7 +64,7 @@ if (isset($_REQUEST['assign'])) {
$smarty->assign_by_ref('deletedGroups', $deletedGroups);
$group_watches = $_REQUEST['checked'];
}
if ($objectType == 'Category') {
if ($objectType == 'Category') {
$addedGroupsDesc = array();
$deletedGroupsDesc = array();
$catTreeNodes = array();
......
......@@ -30,7 +30,7 @@ if (!isset($_REQUEST["page"])) {
$auto_query_args = array('page', 'oldver', 'newver', 'compare', 'diff_style', 'show_translation_history', 'show_all_versions', 'history_offset', 'paginate', 'history_pagesize');
$tikilib->get_perm_object( $_REQUEST['page'], 'wiki page' );
$tikilib->get_perm_object($_REQUEST['page'], 'wiki page');
// Now check permissions to access this page
if (!isset($_REQUEST["source"])) {
......@@ -138,7 +138,7 @@ if (count($history) > 0) {
$lastuser = ''; // calculate edit session info
$lasttime = 0; // secs
$idletime = 1800; // max gap between edits in sessions 30 mins? Maybe should use a pref?
for($i = 0, $cnt = count($history); $i < $cnt; $i++) {
for ($i = 0, $cnt = count($history); $i < $cnt; $i++) {
if ($history[$i]['user'] != $lastuser || $lasttime - $history[$i]['lastModif'] > $idletime) {
$sessions[] = $history[$i];
......@@ -161,7 +161,7 @@ if (count($history) > 0) {
}
}
if ($_REQUEST['show_all_versions'] == "n") {
for($i = 0, $cnt = count($history); $i < $cnt; $i++) { // remove versions inside sessions
for ($i = 0, $cnt = count($history); $i < $cnt; $i++) { // remove versions inside sessions
if (!empty($history[$i]['session']) && $i < $cnt - 1) {
$seshend = $history[$i]['session'];
$i++;
......@@ -391,7 +391,8 @@ if ($prefs['feature_multilingual'] == 'y') {
$current_version = $info["version"];
$not_comparing = empty($_REQUEST['compare']) ? 'true' : 'false';
$headerlib->add_jq_onready(<<<JS
$headerlib->add_jq_onready(
<<<JS
\$("input[name=oldver], input[name=newver]").change(function () {
var ver = parseInt(\$(this).val(), 10), ver2;
if (ver == 0) { ver = $current_version; }
......
......@@ -9,7 +9,7 @@ $section_class="tiki_wiki_page print";
require_once ('tiki-setup.php');
include_once ('lib/wiki/wikilib.php');
$access->check_feature( array('feature_wiki', 'feature_wiki_print') );
$access->check_feature(array('feature_wiki', 'feature_wiki_print'));
// Create the HomePage if it doesn't exist
if (!$tikilib->page_exists($prefs['wikiHomePage'])) {
......@@ -81,7 +81,7 @@ $smarty->assign('display', isset($_REQUEST['display']) ? $_REQUEST['display'] :
if (isset($_REQUEST['display']) && $_REQUEST['display'] == 'pdf') {
require_once 'lib/pdflib.php';
$generator = new PdfGenerator();
$pdf = $generator->getPdf( 'tiki-print.php', array('page' => $page) );
$pdf = $generator->getPdf('tiki-print.php', array('page' => $page));
header('Cache-Control: private, must-revalidate');
header('Pragma: private');
......
......@@ -57,7 +57,7 @@ if (isset($_REQUEST["print"]) || isset($_REQUEST["display"])) {
$page_info = $tikilib->get_page_print_info($struct_page['pageName']);
// Use the alias as the display name, if an alias is defined
if( isset($struct_page['page_alias']) ) {
if ( isset($struct_page['page_alias']) ) {
$page_info['pageName'] = $struct_page['page_alias'];
}
......@@ -97,11 +97,11 @@ if (isset($_REQUEST['display']) && $_REQUEST['display'] == 'pdf') {
$pdf = $pdfname = '';
if (!empty($printpages)) {
$pdf = $generator->getPdf( 'tiki-print_multi_pages.php', array('print' => 'print', 'printpages' => $_REQUEST['printpages'] ) );
$pdf = $generator->getPdf('tiki-print_multi_pages.php', array('print' => 'print', 'printpages' => $_REQUEST['printpages'] ));
$pdfname = implode(', ', $printpages);
} else if (!empty($printstructures)) {
$pdf = $generator->getPdf( 'tiki-print_multi_pages.php', array('print' => 'print', 'printstructures' => $_REQUEST['printstructures'] ) );
$pdf = $generator->getPdf('tiki-print_multi_pages.php', array('print' => 'print', 'printstructures' => $_REQUEST['printstructures'] ));
$pdfname = implode(', ', $printstructures);
} else {
......
......@@ -60,7 +60,7 @@ if (isset($_REQUEST['register'])) {
$smarty->assign('errortype', 'no_redirect_login');
$result=$registrationlib->register_new_user($_REQUEST);
if (is_a($result,"RegistrationError")) {
if (is_a($result, "RegistrationError")) {
if ($result->field == 'email') // i'm not sure why email is a special case..
$email_valid='n';
else
......@@ -76,7 +76,7 @@ if (isset($_REQUEST['register'])) {
}
$outputtowiki='';
$outputwiki='';
if($prefs['user_register_prettytracker_output'] == 'y'){
if ($prefs['user_register_prettytracker_output'] == 'y') {
$outputtowiki=$prefs["user_register_prettytracker_outputtowiki"];
$outputwiki=$prefs["user_register_prettytracker_outputwiki"];
}
......@@ -129,7 +129,8 @@ $smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
// $ajaxlib->registerTemplate('tiki-register.tpl');
//}
function register_error($msg) {
function register_error($msg)
{
global $smarty;
$smarty->assign('msg', $msg);
$smarty->assign('errortype', 0);
......
......@@ -64,7 +64,7 @@ if (isset($_REQUEST["remind"])) {
$languageEmail = $tikilib->get_user_preference($name, "language", $prefs['site_language']);
// Now check if the user should be notified by email
$foo = parse_url($_SERVER["REQUEST_URI"]);
$machine = $tikilib->httpPrefix( true ) . dirname($foo["path"]);
$machine = $tikilib->httpPrefix(true) . dirname($foo["path"]);
$machine = preg_replace("!/$!", "", $machine); // just incase
$smarty->assign('mail_machine', $machine);
$smarty->assign('mail_site', $_SERVER["SERVER_NAME"]);
......@@ -79,7 +79,7 @@ if (isset($_REQUEST["remind"])) {
$mail->setText(stripslashes($smarty->fetchLang($languageEmail, 'mail/password_reminder.tpl')));
// grab remote IP through forwarded-for header when served by cache
$mail->setHeader( 'X-Password-Reset-From', $tikilib->get_ip_address() );
$mail->setHeader('X-Password-Reset-From', $tikilib->get_ip_address());
if (!$mail->send(array($_REQUEST['email']))) {
$smarty->assign('msg', tra("The mail can't be sent. Contact the administrator"));
......
......@@ -30,7 +30,7 @@ if (!($info = $tikilib->get_page_info($page))) {
}
// Now check permissions to rename this page
$tikilib->get_perm_object($page, 'wiki page', $info);
$access->check_permission( array('tiki_p_view', 'tiki_p_rename') );
$access->check_permission(array('tiki_p_view', 'tiki_p_rename'));
if (isset($_REQUEST["rename"]) || isset($_REQUEST["confirm"])) {
check_ticket('rename-page');
......@@ -53,10 +53,10 @@ if (isset($_REQUEST["rename"]) || isset($_REQUEST["confirm"])) {
switch($e->getCode()) {
case 1:
$smarty->assign('page_badchars_display', $wikilib->get_badchars());
break;
break;
case 2:
$smarty->assign('msg', tra("Page already exists"));
break;
break;
default:
throw $e;
}
......@@ -65,7 +65,7 @@ if (isset($_REQUEST["rename"]) || isset($_REQUEST["confirm"])) {
if ($result) {
global $perspectivelib; require_once 'lib/perspectivelib.php';
$perspectivelib->replace_preference ('wsHomepage', $page, $newName ) ;
$perspectivelib->replace_preference('wsHomepage', $page, $newName);
if ($prefs['feature_sefurl'] == 'y') {
include_once('tiki-sefurl.php');
header('location: '. urlencode(filter_out_sefurl("tiki-index.php?page=$newName", 'wiki')));
......
......@@ -102,13 +102,13 @@ if (isset($_REQUEST['search']) && $searchtext) {
$beforeSnippet = substr($r["data"], $snippetStart, $leftpartLength) . $lefthash . $foundtext . $righthash . substr($r["data"], $rightpartStart, $rightpartLength);
$beforeSnippet = htmlentities($beforeSnippet);
$beforeSnippet = str_replace($lefthash,'<strong>',$beforeSnippet);
$beforeSnippet = str_replace($righthash,'</strong>',$beforeSnippet);
$beforeSnippet = str_replace($lefthash, '<strong>', $beforeSnippet);
$beforeSnippet = str_replace($righthash, '</strong>', $beforeSnippet);
$afterSnippet = substr($r["data"], $snippetStart, $leftpartLength) . $lefthash . $replacetext . $righthash . substr($r["data"], $rightpartStart, $rightpartLength);
$afterSnippet = htmlentities($afterSnippet);
$afterSnippet = str_replace($lefthash,'<strong>',$afterSnippet);
$afterSnippet = str_replace($righthash,'</strong>',$afterSnippet);
$afterSnippet = str_replace($lefthash, '<strong>', $afterSnippet);
$afterSnippet = str_replace($righthash, '</strong>', $afterSnippet);
$r["beforeSnippet"][] = $beforeSnippet;
$r["afterSnippet"][] = $afterSnippet;
......
......@@ -74,10 +74,11 @@ if (isset($_REQUEST["get"])) {
$get=0;
}
/* additions for ajax (formerly shoutjax) */
function processShout($formValues, $destDiv = 'mod-shoutbox') { // AJAX_TODO
function processShout($formValues, $destDiv = 'mod-shoutbox')
{ // AJAX_TODO
global $shoutboxlib, $user, $smarty, $prefs, $tiki_p_admin_shoutbox;
$smarty->assign('tweet',$formValues['tweet']);
$smarty->assign('facebook',$formValues['facebook']);
$smarty->assign('tweet', $formValues['tweet']);
$smarty->assign('facebook', $formValues['facebook']);
if (array_key_exists('shout_msg', $formValues) && strlen($formValues['shout_msg']) > 2) {
if (empty($user) && $prefs['feature_antibot'] == 'y' && !$captchalib->validate()) {
$smarty->assign('shout_error', $captchalib->getErrors());
......
......@@ -9,7 +9,7 @@ $section = 'mytiki';
require_once ('tiki-setup.php');
require_once ('lib/socialnetworkslib.php');
$access->check_feature('feature_socialnetworks');
$access->check_permission('tiki_p_socialnetworks',tra('Social networks'));
$access->check_permission('tiki_p_socialnetworks', tra('Social networks'));
if (isset($_REQUEST['request_twitter'])) {
$access->check_user($user);
......@@ -27,8 +27,8 @@ if (isset($_REQUEST['request_twitter'])) {
if (isset($_REQUEST['remove_twitter'])) {
$access->check_user($user);
// remove user token from tiki
$tikilib->set_user_preference($user, 'twitter_token','');
$smarty->assign('show_removal',true);
$tikilib->set_user_preference($user, 'twitter_token', '');
$smarty->assign('show_removal', true);
}
if ($user) {
$token=$tikilib->get_user_preference($user, 'twitter_token', '');
......@@ -58,26 +58,26 @@ if (isset($_REQUEST['request_facebook'])) {
if (isset($_REQUEST['remove_facebook'])) {
$access->check_user($user);
// remove user token from tiki
$tikilib->set_user_preference($user, 'facebook_token','');
$smarty->assign('show_removal',true);
$tikilib->set_user_preference($user, 'facebook_token', '');
$smarty->assign('show_removal', true);
}
if (isset($_REQUEST['accounts'])) {
$access->check_user($user);
$tikilib->set_user_preference($user, 'bitly_login', $_REQUEST['bitly_login']);
$smarty->assign('bitly_login',$_REQUEST['bitly_login']);
$smarty->assign('bitly_login', $_REQUEST['bitly_login']);
$tikilib->set_user_preference($user, 'bitly_key', $_REQUEST['bitly_key']);
$smarty->assign('bitly_key',$_REQUEST['bitly_key']);
$smarty->assign('bitly_key', $_REQUEST['bitly_key']);
} else {
$smarty->assign('bitly_login',$tikilib->get_user_preference($user, 'bitly_login',''));
$smarty->assign('bitly_key',$tikilib->get_user_preference($user, 'bitly_key',''));
$smarty->assign('bitly_login', $tikilib->get_user_preference($user, 'bitly_login', ''));
$smarty->assign('bitly_key', $tikilib->get_user_preference($user, 'bitly_key', ''));
}
if ($user) {
$token=$tikilib->get_user_preference($user, 'facebook_token', '');
$smarty->assign('facebook', ($token!=''));
}
$smarty->assign('twitterRegistered',$socialnetworkslib->twitterRegistered());
$smarty->assign('facebookRegistered',$socialnetworkslib->facebookRegistered());
$smarty->assign('twitterRegistered', $socialnetworkslib->twitterRegistered());
$smarty->assign('facebookRegistered', $socialnetworkslib->facebookRegistered());
ask_ticket('socialnetworks');
$smarty->assign('mid', 'tiki-socialnetworks.tpl');
......
......@@ -8,7 +8,7 @@
require_once 'tiki-setup.php';
require_once 'lib/perspectivelib.php';
$access->check_feature( 'feature_perspective' );
$access->check_feature('feature_perspective');
$_SESSION['current_perspective'] = 0;
......@@ -18,9 +18,9 @@ if ( isset($_REQUEST['perspective']) ) {
}
if ( isset($_REQUEST['back']) && isset($_SERVER['HTTP_REFERER']) ) {
header( 'Location: ' . $_SERVER['HTTP_REFERER'] );
header('Location: ' . $_SERVER['HTTP_REFERER']);
} else {
header( 'Location: tiki-index.php' );
header('Location: tiki-index.php');
}
// EOF
......@@ -65,14 +65,14 @@ if ($prefs['feature_theme_control'] == 'y') {
if ($tc_theme) {
if ($old_tc_theme) {
$headerlib->drop_cssfile($tikilib->get_style_path('', '', $old_tc_theme));
$headerlib->drop_cssfile($tikilib->get_style_path( $old_tc_theme, $old_tc_theme_option, $old_tc_theme_option));
$headerlib->drop_cssfile($tikilib->get_style_path($old_tc_theme, $old_tc_theme_option, $old_tc_theme_option));
}
$headerlib->drop_cssfile($tikilib->get_style_path('', '', $prefs['style']));
$headerlib->add_cssfile($tikilib->get_style_path('', '', $tc_theme), 51);
$headerlib->drop_cssfile($tikilib->get_style_path( $prefs['style'], $prefs['style_option'], $prefs['style_option']));
$headerlib->drop_cssfile($tikilib->get_style_path($prefs['style'], $prefs['style_option'], $prefs['style_option']));
if (!empty($tc_theme_option)) { // special handling for 'None' case
$headerlib->add_cssfile($tikilib->get_style_path( $tc_theme, $tc_theme_option, $tc_theme_option), 52);
$headerlib->add_cssfile($tikilib->get_style_path($tc_theme, $tc_theme_option, $tc_theme_option), 52);
}
// Reset IE specific CSS
global $style_ie6_css, $style_ie7_css, $style_ie8_css, $style_base;
......
......@@ -38,9 +38,9 @@ if (strstr($_REQUEST['url'], 'tiki-tell_a_friend.php')) {
$_REQUEST['url'] = preg_replace('/.*tiki-tell_a_friend.php\?url=/', '', $_REQUEST['url']);
header('location: tiki-tell_a_friend.php?url=' . $_REQUEST['url']);
}
$url_for_friend = $tikilib->httpPrefix( true ) . $_REQUEST['url'];
$url_for_friend = $tikilib->httpPrefix(true) . $_REQUEST['url'];
$smarty->assign('url', $_REQUEST['url']);
$smarty->assign('prefix', $tikilib->httpPrefix( true ));
$smarty->assign('prefix', $tikilib->httpPrefix(true));
$errors = array();
if (isset($_REQUEST['send'])) {
check_ticket('tell-a-friend');
......@@ -98,9 +98,9 @@ if (isset($_REQUEST['send'])) {
if ( $prefs['auth_token_tellafriend'] == 'y' && $prefs['auth_token_access'] == 'y' && isset($_POST['share_access']) ) {
require_once 'lib/auth/tokens.php';
$tokenlib = AuthTokens::build( $prefs );
$tokenlib = AuthTokens::build($prefs);
$url_for_friend = $tokenlib->includeToken( $url_for_friend, $globalperms->getGroups() );
$url_for_friend = $tokenlib->includeToken($url_for_friend, $globalperms->getGroups());
}
$smarty->assign('url_for_friend', $url_for_friend);
......@@ -113,7 +113,7 @@ if (isset($_REQUEST['send'])) {
$ok = $ok && $mail->send(array($email));
}
if ($ok) {
$access->redirect( $_REQUEST['url'], tra('Your link was sent.') );
$access->redirect($_REQUEST['url'], tra('Your link was sent.'));
} else {
$errors = tra("The mail can't be sent. Contact the administrator");
}
......
......@@ -10,7 +10,8 @@ include_once ('lib/themecontrol/tcontrol.php');
include_once ('lib/categories/categlib.php');
include_once ('lib/filegals/filegallib.php');
include_once ('lib/htmlpages/htmlpageslib.php');
function correct_array(&$arr, $id, $name) {
function correct_array(&$arr, $id, $name)
{
$temp_max = count($arr);
for ($i = 0; $i < $temp_max; $i++) {
$arr[$i]['objId'] = $arr[$i][$id];
......@@ -36,14 +37,14 @@ switch ($_REQUEST['type']) {
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'galleryId', 'name');
break;
break;
case 'file gallery':
$objects = $filegallib->list_file_galleries(0, -1, 'name_desc', 'admin', $find_objects, $prefs['fgal_root_id']);
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'galleryId', 'name');
break;
break;
case 'forum':
require_once ('lib/comments/commentslib.php');
......@@ -54,7 +55,7 @@ switch ($_REQUEST['type']) {
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'forumId', 'name');
break;
break;
case 'blog':
require_once('lib/blogs/bloglib.php');
......@@ -62,21 +63,21 @@ switch ($_REQUEST['type']) {
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'blogId', 'title');
break;
break;
case 'wiki page':
$objects = $tikilib->list_pageNames(0, -1, 'pageName_asc', $find_objects);
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'pageName', 'pageName');
break;
break;
case 'html page':
$objects = $htmlpageslib->list_html_pages(0, -1, 'pageName_asc', $find_objects);
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'pageName', 'pageName');
break;
break;
case 'faq':
$faqlib = TikiLib::lib('faq');
......@@ -84,14 +85,14 @@ switch ($_REQUEST['type']) {
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'faqId', 'title');
break;
break;
case 'quiz':
$objects = TikiLib::lib('quiz')->list_quizzes(0, -1, 'name_asc', $find_objects);
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'quizId', 'name');
break;
break;
case 'article':
global $artlib; require_once 'lib/articles/artlib.php';
......@@ -99,10 +100,10 @@ switch ($_REQUEST['type']) {
$smarty->assign_by_ref('objects', $objects["data"]);
$objects = $objects['data'];
correct_array($objects, 'articleId', 'title');
break;
break;
default:
break;
break;
}
$smarty->assign_by_ref('objects', $objects);
if (isset($_REQUEST['assign'])) {
......
......@@ -7,7 +7,7 @@
require_once('tiki-setup.php');
$access->check_feature(array('feature_time_sheet','feature_trackers'));
$access->check_permission_either( array('tiki_p_view_trackers', 'tiki_p_create_tracker_items') );
$access->check_permission_either(array('tiki_p_view_trackers', 'tiki_p_create_tracker_items'));
global $user;
$auto_query_args = array(
......@@ -36,16 +36,20 @@ if (isset($_REQUEST['all'])) { //all views all sheet items
->query();
}
if(isset($projectList)) {
if (isset($projectList)) {
if (isset($_REQUEST['save'])) {
$_REQUEST['Done_by'] = $user;
TikiLib::lib("trk")->replaceItemFromRequestValuesByName("Time sheet", array(
"Summary",
"Associated project",
"Description",
"Amount of time spent",
"Done by"
), $_REQUEST);
TikiLib::lib("trk")->replaceItemFromRequestValuesByName(
"Time sheet",
array(
"Summary",
"Associated project",
"Description",
"Amount of time spent",
"Done by"
),
$_REQUEST
);
die;
}
......@@ -61,7 +65,8 @@ $headerlib = TikiLib::lib("header");
$headerlib->add_cssfile("lib/jquery/jtrack/css/jtrack.css");
$headerlib->add_jsfile("lib/jquery/jtrack/js/domcached-0.1-jquery.js");
$headerlib->add_jsfile("lib/jquery/jtrack/js/jtrack.js");
$headerlib->add_jq_onready("
$headerlib->add_jq_onready(
"
jTask.init();
$.timesheetSpreadsheet = function() {
......@@ -141,7 +146,8 @@ $headerlib->add_jq_onready("
$('#timeSheetTabs')
.width($('#timeSheetTabs').parent().width())
.tabs();
");
"
);
$smarty->assign('mid', 'tiki-timesheet.tpl');
// use tiki_full to include include CSS and JavaScript
$smarty->display("tiki.tpl");
<?php
// (c) Copyright 2002-2011 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$
if (isset($_REQUEST['time']) == true) {
$starttime = microtime();
......@@ -16,7 +21,8 @@ $trklib = TikiLib::lib("trk");
$trkqrylib = TikiLib::lib("trkqry");
//TODO: This needs rewritten to match tiki
function dateFormat($fieldIds, $tracker) {
function dateFormat($fieldIds, $tracker)
{
foreach ($tracker as $key => $item) {
foreach ($fieldIds as $fieldId) {
if (isset($item[$fieldId]) == true && is_numeric($item[$fieldId])) {
......@@ -28,7 +34,8 @@ function dateFormat($fieldIds, $tracker) {
}
//TODO: Find alternative for obtaining querystring/form data
function defVal($name, $default = null) {
function defVal($name, $default = null)
{
if (isset($_GET[$name]) == true) {
$_REQUEST[$name] = $_GET[$name];
}
......@@ -60,7 +67,8 @@ defVal('start');
defVal('end');
//TODO: integrate into tracker query lib
function splitToTracker($param) {
function splitToTracker($param)
{
if (isset($_REQUEST[$param])) {
$_REQUEST[$param] = explode("|", $_REQUEST[$param]);
foreach ($_REQUEST[$param] as $key => $field) {
......@@ -103,17 +111,17 @@ if (isset($_REQUEST['trackerIds']) == true) {
$joinVars = explode('|', $joinVars);
$trackerPrimary = $trkqrylib->join_trackers(
$trackerPrimary,
TrackerQueryLib::tracker($trackerId)
->start($_REQUEST['start'][$key])
->end($_REQUEST['end'][$key])
->equals($_REQUEST['q'][$key])
->search($_REQUEST['search'][$key])
->fields($_REQUEST['fields'][$key])
->status($_REQUEST['status'][$key])
->query(),
$joinVars[0],
$joinVars[1]
$trackerPrimary,
TrackerQueryLib::tracker($trackerId)
->start($_REQUEST['start'][$key])
->end($_REQUEST['end'][$key])
->equals($_REQUEST['q'][$key])
->search($_REQUEST['search'][$key])
->fields($_REQUEST['fields'][$key])
->status($_REQUEST['status'][$key])
->query(),
$joinVars[0],
$joinVars[1]
);
}
$i++;
......@@ -142,7 +150,7 @@ if (isset($_REQUEST['time']) == true) {
$endarray = explode(" ", $endtime);
$endtime = $endarray[1] + $endarray[0];
$totaltime = $endtime - $starttime;
$totaltime = round($totaltime,5);
$totaltime = round($totaltime, 5);
echo "This page loaded in $totaltime seconds.\n\n\n";
}
......
......@@ -27,11 +27,11 @@ $arrayStatus = explode(',', $_GET["status"]);