Commit ced9ee62 authored by sylvieg's avatar sylvieg

Instant-Auto-Merge from BRANCH-1-9 to HEAD

parent 4308a85c
......@@ -1919,6 +1919,7 @@ tiki/doc/readme.txt -text
tiki/dump/.cvsignore -text
tiki/dump/index.php -text
tiki/favicon.png -text
tiki/files/index.php -text
tiki/fixperms.sh -text
tiki/freetag_apply.php -text
tiki/freetag_list.php -text
......@@ -2749,6 +2750,7 @@ tiki/img/tiki/tikibutton2.png -text
tiki/img/tiki/tikibutton3.png -text
tiki/img/tiki/tikibutton4.png -text
tiki/img/tiki/tikilogo.png -text
tiki/img/trackers/index.php -text
tiki/img/valid-xhtml10.png -text
tiki/img/webmail/attachment.gif -text
tiki/img/webmail/clip.gif -text
......@@ -3933,6 +3935,7 @@ tiki/lib/wiki-plugins-dist/index.php -text
tiki/lib/wiki-plugins-dist/wikiplugin_bloglist.php -text
tiki/lib/wiki-plugins-dist/wikiplugin_include.php -text
tiki/lib/wiki-plugins-dist/wikiplugin_lsdir.php -text
tiki/lib/wiki-plugins-dist/wikiplugin_regex.php -text
tiki/lib/wiki-plugins-dist/wikiplugin_snarf.php -text
tiki/lib/wiki-plugins/index.php -text
tiki/lib/wiki-plugins/wikiplugin_agentinfo.php -text
......@@ -3960,6 +3963,7 @@ tiki/lib/wiki-plugins/wikiplugin_fancytable.php -text
tiki/lib/wiki-plugins/wikiplugin_flash.php -text
tiki/lib/wiki-plugins/wikiplugin_formula.php -text
tiki/lib/wiki-plugins/wikiplugin_gauge.php -text
tiki/lib/wiki-plugins/wikiplugin_group.php -text
tiki/lib/wiki-plugins/wikiplugin_jabber.php -text
tiki/lib/wiki-plugins/wikiplugin_lang.php -text
tiki/lib/wiki-plugins/wikiplugin_map.php -text
......@@ -4110,6 +4114,7 @@ tiki/modules/mod-last_modif_pages.php -text
tiki/modules/mod-last_modif_tracker_items.php -text
tiki/modules/mod-last_modified_blogs.php -text
tiki/modules/mod-last_submissions.php -text
tiki/modules/mod-last_tracker_comments.php -text
tiki/modules/mod-last_tracker_items.php -text
tiki/modules/mod-last_visitors.php -text
tiki/modules/mod-live_support.php -text
......@@ -4119,6 +4124,7 @@ tiki/modules/mod-num_submissions.php -text
tiki/modules/mod-old_articles.php -text
tiki/modules/mod-online_users.php -text
tiki/modules/mod-quick_edit.php -text
tiki/modules/mod-random_images.php -text
tiki/modules/mod-random_pages.php -text
tiki/modules/mod-shoutbox.php -text
tiki/modules/mod-since_last_visit.php -text
......@@ -4323,6 +4329,7 @@ tiki/styles/olive.css -text svneol=unset#application/octet-stream
tiki/styles/simple.css -text
tiki/styles/simple/admin_move.gif -text
tiki/styles/simple/bg.png -text
tiki/styles/simple/button_bg.png -text
tiki/styles/simple/close.png -text
tiki/styles/simple/close_out.png -text
tiki/styles/simple/delete.gif -text
......@@ -4380,6 +4387,7 @@ tiki/styles/whitebluegrey.css -text
tiki/temp/.cvsignore -text
tiki/temp/README -text
tiki/temp/_htaccess -text
tiki/temp/cache/index.php -text
tiki/temp/index.php -text
tiki/temp/mail_attachs/README -text
tiki/temp/mail_attachs/index.php -text
......@@ -4425,6 +4433,8 @@ tiki/templates/mail/moderate_activation_mail.tpl -text
tiki/templates/mail/moderate_activation_mail_subject.tpl -text
tiki/templates/mail/moderate_validation_mail.tpl -text
tiki/templates/mail/moderate_validation_mail_subject.tpl -text
tiki/templates/mail/new_friend_invitation.tpl -text
tiki/templates/mail/new_friend_invitation_subject.tpl -text
tiki/templates/mail/new_user_notification.tpl -text
tiki/templates/mail/new_user_notification_subject.tpl -text
tiki/templates/mail/newsletter_byebye.tpl -text
......@@ -4438,6 +4448,7 @@ tiki/templates/mail/password_reminder_subject.tpl -text
tiki/templates/mail/submission_notification.tpl -text
tiki/templates/mail/submission_notification_subject.tpl -text
tiki/templates/mail/tracker_changed_notification.tpl -text
tiki/templates/mail/tracker_changed_notification_subject.tpl -text
tiki/templates/mail/user_validation_mail.tpl -text
tiki/templates/mail/user_validation_mail_subject.tpl -text
tiki/templates/mail/user_validation_msg.tpl -text
......@@ -4523,6 +4534,7 @@ tiki/templates/modules/mod-last_modif_pages.tpl -text
tiki/templates/modules/mod-last_modif_tracker_items.tpl -text
tiki/templates/modules/mod-last_modified_blogs.tpl -text
tiki/templates/modules/mod-last_submissions.tpl -text
tiki/templates/modules/mod-last_tracker_comments.tpl -text
tiki/templates/modules/mod-last_tracker_items.tpl -text
tiki/templates/modules/mod-last_visitors.tpl -text
tiki/templates/modules/mod-live_support.tpl -text
......@@ -4538,6 +4550,7 @@ tiki/templates/modules/mod-old_articles.tpl -text
tiki/templates/modules/mod-online_users.tpl -text
tiki/templates/modules/mod-online_users.tpl.nocache -text
tiki/templates/modules/mod-quick_edit.tpl -text
tiki/templates/modules/mod-random_images.tpl -text
tiki/templates/modules/mod-random_pages.tpl -text
tiki/templates/modules/mod-register.tpl -text
tiki/templates/modules/mod-search_box.tpl -text
......@@ -4646,6 +4659,7 @@ tiki/templates/styles/notheme/tiki-my_tiki.tpl -text
tiki/templates/styles/notheme/tiki-top_bar.tpl -text
tiki/templates/styles/notheme/tiki.tpl -text
tiki/templates/styles/simple/categpath.tpl -text
tiki/templates/styles/simple/confirm.tpl -text
tiki/templates/styles/simple/error.tpl -text
tiki/templates/styles/simple/header.tpl -text
tiki/templates/styles/simple/index.php -text
......@@ -4657,8 +4671,11 @@ tiki/templates/styles/simple/modules/mod-last_blog_posts.tpl -text
tiki/templates/styles/simple/modules/mod-last_files.tpl -text
tiki/templates/styles/simple/modules/mod-last_images_th.tpl -text
tiki/templates/styles/simple/modules/mod-last_modif_pages.tpl -text
tiki/templates/styles/simple/modules/mod-login_box.tpl -text
tiki/templates/styles/simple/modules/mod-quick_edit.tpl -text
tiki/templates/styles/simple/modules/mod-switch_lang.tpl -text
tiki/templates/styles/simple/modules/mod-switch_lang2.tpl -text
tiki/templates/styles/simple/modules/mod-switch_theme.tpl -text
tiki/templates/styles/simple/modules/mod-wiki_last_comments.tpl -text
tiki/templates/styles/simple/tiki-blog_post.tpl -text
tiki/templates/styles/simple/tiki-print_article.tpl -text
......@@ -4786,6 +4803,7 @@ tiki/templates/tiki-browse_gallery.tpl -text
tiki/templates/tiki-browse_image.tpl -text
tiki/templates/tiki-browse_users.tpl -text
tiki/templates/tiki-calendar.tpl -text
tiki/templates/tiki-calendar_add_event.tpl -text
tiki/templates/tiki-calendar_box.tpl -text
tiki/templates/tiki-calendar_import.tpl -text
tiki/templates/tiki-categpermissions.tpl -text
......@@ -5131,6 +5149,7 @@ tiki/tiki-browse_image.php -text
tiki/tiki-browse_users.php -text
tiki/tiki-calendar.php -text
tiki/tiki-calendar_import.php -text
tiki/tiki-calendars_rss.php -text
tiki/tiki-categpermissions.php -text
tiki/tiki-change_password.php -text
tiki/tiki-charts.php -text
......
<FilesMatch "\.(bak|inc|lib|sh|tpl|sql)$">
order deny,allow
deny from all
</FilesMatch>
\ No newline at end of file
</FilesMatch>
RewriteEngine On
# direct one-word access
RewriteRule ^calendar$ tiki-calendar.php [L]
RewriteRule ^articles$ tiki-view_articles.php [L]
RewriteRule ^blogs$ tiki-list_blogs.php [L]
RewriteRule ^categories$ tiki-browse_categories.php [L]
RewriteRule ^charts$ tiki-list_charts.php [L]
RewriteRule ^chat$ tiki-chat.php [L]
RewriteRule ^contact$ tiki-contact.php [L]
RewriteRule ^directories$ tiki-directory_browse.php [L]
RewriteRule ^eph$ tiki-eph.php [L]
RewriteRule ^faqs$ tiki-list_faqs.php [L]
RewriteRule ^files$ tiki-file_galleries.php [L]
RewriteRule ^forums$ tiki-forums.php [L]
RewriteRule ^images$ tiki-galleries.php [L]
RewriteRule ^galleries$ tiki-galleries.php [L]
RewriteRule ^games$ tiki-list_games.php [L]
RewriteRule ^login$ tiki-login.php [L]
RewriteRule ^my$ tiki-my_tiki.php [L]
RewriteRule ^newsletters$ tiki-newsletters.php [L]
RewriteRule ^quizzes$ tiki-list_quizzes.php [L]
RewriteRule ^stats$ tiki-stats.php [L]
RewriteRule ^surveys$ tiki-list_surveys.php [L]
RewriteRule ^trackers$ tiki-list_trackers.php [L]
RewriteRule ^irc$ tiki-irc_logs.php [L]
RewriteRule ^mobile$ tiki-mobile.php [L]
RewriteRule ^wml$ tiki-mobile.php [L]
# access any object by its numeric identifier
RewriteRule ^article([0-9]+) tiki-read_article.php?articleId=$1 [QSA,L]
RewriteRule ^art([0-9]+) tiki-read_article.php?articleId=$1 [QSA,L]
RewriteRule ^cat([0-9]+) tiki-browse_categories.php?parentId=$1 [QSA,L]
RewriteRule ^blog([0-9]+) tiki-view_blog.php?blogId=$1 [QSA,L]
RewriteRule ^blogpost([0-9]+) tiki-view_blog_post.php?postId=$1 [QSA,L]
RewriteRule ^chart([0-9]+) tiki-view_chart.php?chartId=$1 [QSA,L]
RewriteRule ^directory([0-9]+) tiki-directory_browse.php?parent=$1 [QSA,L]
RewriteRule ^eph([0-9]+) tiki-directory_browse.php?parent=$1 [QSA,L]
RewriteRule ^faq([0-9]+) tiki-view_faq.php?faqId=$1 [QSA,L]
RewriteRule ^file([0-9]+) tiki-list_file_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^dl([0-9]+) tiki-download_file.php?fileId=$1 [QSA,L]
RewriteRule ^forum([0-9]+) tiki-view_forum.php?forumId=$1 [QSA,L]
RewriteRule ^image([0-9]+) tiki-browse_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^gallery([0-9]+) tiki-browse_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^newsletter([0-9]+) tiki-newsletters.php?nlId=$1 [QSA,L]
RewriteRule ^quiz([0-9]+) tiki-take_quiz.php?quizId=$1 [QSA,L]
RewriteRule ^survey([0-9]+) tiki-take_survey.php?surveyId=$1 [QSA,L]
RewriteRule ^tracker([0-9]+) tiki-view_tracker.php?trackerId=$1 [QSA,L]
RewriteRule ^wiki-([A-Za-z0-9]+) tiki-index.php?page=$1 [QSA,L]
RewriteRule ^page-([A-Za-z0-9]+) tiki-index.php?page=$1 [QSA,L]
RewriteRule ^irc([0-9]+) tiki-irc_logs.php?focus=$1 [QSA,L]
# todo add support for all characters allowed in a Wiki name
# make sure this is the last rule!
RewriteRule ^([-_\+A-Za-z0-9]+)$ tiki-index.php?page=$1 [QSA,L]
#for multi-byte char support use
RewriteRule ^/([^a-z]+)([^\/]+)([^tki-]+)(.*[^.js]+)(~?)(.*)$ tiki-index.php?page=$1$2$3$4$5$6$7$8$9 [QSA,L]
......@@ -88,3 +88,7 @@ ALTER TABLE `users_objectpermissions` DROP PRIMARY KEY , ADD PRIMARY KEY ( `obje
# 2005-12-11 - amette - correct perm for submitting link - WYSIWYCA
UPDATE tiki_menu_options SET perm="tiki_p_submit_link" WHERE url="tiki-directory_add_site.php";
# fixed a missing alter
ALTER TABLE sessions ADD expireref varchar(64) after expiry;
......@@ -173,3 +173,7 @@ ALTER TABLE `users_objectpermissions` DROP PRIMARY KEY , ADD PRIMARY KEY ( `obje
# 2005-12-11 - amette - correct perm for submitting link - WYSIWYCA
UPDATE tiki_menu_options SET perm="tiki_p_submit_link" WHERE url="tiki-directory_add_site.php";
# fixed a missing alter
ALTER TABLE sessions ADD expireref varchar(64) after expiry;
<?php
// $Header: /cvsroot/tikiwiki/tiki/files/index.php,v 1.2 2006-02-17 15:10:32 sylvieg 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.
// This redirects to the sites root to prevent directory browsing
header ("location: ../tiki-index.php");
die;
?>
<?php
// $Header: /cvsroot/tikiwiki/tiki/img/trackers/index.php,v 1.2 2006-02-17 15:10:32 sylvieg 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.
// This redirects to the sites root to prevent directory browsing
header ("location: ../../tiki-index.php");
die;
?>
......@@ -70,33 +70,34 @@ if (!function_exists('galaxia_show_error')) {
// Specify how to execute a non-interactive activity (for use in src/API/Instance.php)
if (!function_exists('galaxia_execute_activity')) {
function galaxia_execute_activity($activityId = 0, $iid = 0, $auto = 1)
{
// Now execute the code for the activity but we are in a method!
// so just use an fopen with http mode
global $tikilib;
$parsed = parse_url($_SERVER["REQUEST_URI"]);
$URI = $tikilib->httpPrefix().$parsed["path"];
$parts = explode('/',$URI);
$parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&iid=$iid&auto=$auto";
$URI = implode('/',$parts);
$fp = fopen($URI,"r");
$data = '';
if (!$fp) {
trigger_error(tra("Fatal error: cannot execute automatic activity $activityId"),E_USER_WARNING);
die;
}
while (!feof($fp)) {
$data.=fread($fp,8192);
}
/*
if(!empty($data)) {
trigger_error(tra("Fatal error: automatic activity produced some output:$data"),E_USER_WARNING);
}
*/
fclose($fp);
function galaxia_execute_activity($activityId = 0, $iid = 0, $auto = 1) {
// Now execute the code for the activity but we are in a method!
// so just use an fopen with http mode
global $tikilib;
$parsed = parse_url($_SERVER["REQUEST_URI"]);
$URI = $tikilib->httpPrefix() . $parsed["path"];
$parts = explode('/', $URI);
$parts[count($parts) - 1] = "tiki-g-run_activity.php?activityId=$activityId&iid=$iid&auto=$auto";
$URI = implode('/', $parts);
$fp = fopen($URI, "r");
$data = '';
if (!$fp) {
trigger_error(tra("Fatal error: cannot execute automatic activity $activityId"), E_USER_WARNING);
die;
}
while (!feof($fp)) {
$data .= fread($fp, 8192);
}
/*
if(!empty($data)) {
trigger_error(tra("Fatal error: automatic activity produced some output:$data"), E_USER_WARNING);
}
*/
fclose($fp);
}
}
......
......@@ -70,33 +70,34 @@ if (!function_exists('galaxia_show_error')) {
// Specify how to execute a non-interactive activity (for use in src/API/Instance.php)
if (!function_exists('galaxia_execute_activity')) {
function galaxia_execute_activity($activityId = 0, $iid = 0, $auto = 1)
{
// Now execute the code for the activity but we are in a method!
// so just use an fopen with http mode
global $tikilib;
$parsed = parse_url($_SERVER["REQUEST_URI"]);
$URI = $tikilib->httpPrefix().$parsed["path"];
$parts = explode('/',$URI);
$parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&iid=$iid&auto=$auto";
$URI = implode('/',$parts);
$fp = fopen($URI,"r");
$data = '';
if (!$fp) {
trigger_error(tra("Fatal error: cannot execute automatic activity $activityId"),E_USER_WARNING);
die;
}
while (!feof($fp)) {
$data.=fread($fp,8192);
}
/*
if(!empty($data)) {
trigger_error(tra("Fatal error: automatic activity produced some output:$data"),E_USER_WARNING);
}
*/
fclose($fp);
function galaxia_execute_activity($activityId = 0, $iid = 0, $auto = 1) {
// Now execute the code for the activity but we are in a method!
// so just use an fopen with http mode
global $tikilib;
$parsed = parse_url($_SERVER["REQUEST_URI"]);
$URI = $tikilib->httpPrefix() . $parsed["path"];
$parts = explode('/', $URI);
$parts[count($parts) - 1] = "tiki-g-run_activity.php?activityId=$activityId&iid=$iid&auto=$auto";
$URI = implode('/', $parts);
$fp = fopen($URI, "r");
$data = '';
if (!$fp) {
trigger_error(tra("Fatal error: cannot execute automatic activity $activityId"), E_USER_WARNING);
die;
}
while (!feof($fp)) {
$data .= fread($fp, 8192);
}
/*
if(!empty($data)) {
trigger_error(tra("Fatal error: automatic activity produced some output:$data"), E_USER_WARNING);
}
*/
fclose($fp);
}
}
......
......@@ -425,27 +425,37 @@ class ActivityManager extends BaseManager {
/*!
Lists activities at a per-process level
*/
function list_activities($pId,$offset,$maxRecords,$sort_mode,$find,$where='')
function list_activities($pId, $offset, $maxRecords, $sort_mode, $find, $where = '')
{
$sort_mode = str_replace("_"," ",$sort_mode);
if($find) {
$sort_mode = str_replace("_", " ", $sort_mode);
if ($find) {
$findesc = '%'.$find.'%';
$mid=" where pId=? and ((name like ?) or (description like ?))";
$bindvars = array($pId,$findesc,$findesc);
$mid = " where pId=? and ((name like ?) or (description like ?))";
$bindvars = array($pId, $findesc, $findesc);
} else {
$mid=" where pId=? ";
$mid = " where pId=? ";
$bindvars = array($pId);
}
if($where) {
$mid.= " and ($where) ";
}
$query = "select * from ".GALAXIA_TABLE_PREFIX."activities $mid order by $sort_mode";
$query_cant = "select count(*) from ".GALAXIA_TABLE_PREFIX."activities $mid";
}
if ($where) {
$mid .= " and ($where) ";
}
$query = "select * from " . GALAXIA_TABLE_PREFIX . "activities $mid order by $sort_mode";
$query_cant = "select count(*) from " . GALAXIA_TABLE_PREFIX . "activities $mid";
$query_roles = "select gr.roleId, gr.name from " . GALAXIA_TABLE_PREFIX . "activity_roles gar inner join
" . GALAXIA_TABLE_PREFIX . "roles gr on gar.roleId = gr.roleId where gar.activityId = ?";
$result = $this->query($query,$bindvars,$maxRecords,$offset);
$cant = $this->getOne($query_cant,$bindvars);
$ret = Array();
while($res = $result->fetchRow()) {
$res['roles'] = $this->getOne("select count(*) from ".GALAXIA_TABLE_PREFIX."activity_roles where activityId=?",array($res['activityId']));
$res['rolecount'] = $this->getOne("select count(*) from ".GALAXIA_TABLE_PREFIX."activity_roles where activityId=?",array($res['activityId']));
$res['roles'] = array();
$resultroles = $this->query($query_roles, array($res['activityId']));
while($resroles = $resultroles->fetchRow()) {
array_push($res['roles'], $resroles);
}
$ret[] = $res;
}
$retval = Array();
......
......@@ -371,10 +371,17 @@ class ProcessMonitor extends Base {
$findesc = $this->qstr('%'.$find.'%');
$mid.=" and (`properties` like $findesc)";
}
// TODO: retrieve instance status as well
$query = "select `itemId`,`ended`-`started` as duration,ga.`isInteractive`, ga.`type`,gp.`name` as procname,gp.`version`,ga.`name` as actname,";
$query.= "ga.`activityId`,`instanceId`,`orderId`,`properties`,`started`,`ended`,`user` from `".GALAXIA_TABLE_PREFIX."workitems` gw,`".GALAXIA_TABLE_PREFIX."activities` ga,`".GALAXIA_TABLE_PREFIX."processes` gp ";
$query.= "where gw.`activityId`=ga.`activityId` and ga.`pId`=gp.`pId` $mid order by gp.`pId` desc,".$this->convert_sortmode($sort_mode);
$query = "SELECT `itemId`, DATEDIFF(FROM_UNIXTIME(gw.`ended`), FROM_UNIXTIME(gw.`started`)) AS duration, ";
$query .= "ga.`isInteractive`, ga.`type`, gp.`name` AS procname, gp.`version`, ga.`name` AS actname, ";
$query .= "ga.`activityId`, gw.`instanceId`, gi.`name` AS iname, `orderId`, gw.`properties`, gw.`started`, ";
$query .= "gi.`status`, gw.`ended`, `user` FROM ";
$query .= "`" . GALAXIA_TABLE_PREFIX . "workitems` gw, `" . GALAXIA_TABLE_PREFIX . "activities` ga, ";
$query .= "`" . GALAXIA_TABLE_PREFIX . "processes` gp, `" . GALAXIA_TABLE_PREFIX . "instances` gi ";
$query .= "WHERE gw.`activityId` = ga.`activityId` AND ga.`pId` = gp.`pId` ";
$query .= "AND gw.`instanceId` = gi.`instanceId` $mid ORDER BY gp.`pId` DESC, ";
$query .= $this->convert_sortmode($sort_mode);
$query_cant = "select count(*) from `".GALAXIA_TABLE_PREFIX."workitems` gw,`".GALAXIA_TABLE_PREFIX."activities` ga,`".GALAXIA_TABLE_PREFIX."processes` gp where gw.`activityId`=ga.`activityId` and ga.`pId`=gp.`pId` $mid";
$result = $this->query($query,$wherevars,$maxRecords,$offset);
$cant = $this->getOne($query_cant,$wherevars);
......
......@@ -45,11 +45,16 @@ class ArtLib extends TikiLib {
if (!$data["image_y"])
$data["image_y"] = 0;
$this->replace_article($data["title"], $data["authorName"], $data["topicId"], $data["useImage"], $data["image_name"],
$articleId = $this->replace_article($data["title"], $data["authorName"], $data["topicId"], $data["useImage"], $data["image_name"],
$data["image_size"], $data["image_type"], $data["image_data"], $data["heading"], $data["body"], $data["publishDate"], $data["expireDate"],
$data["author"], 0, $data["image_x"], $data["image_y"], $data["type"], $data["topline"], $data["subtitle"], $data["linkto"], $data["image_caption"],
$data["lang"], $data["rating"], $data['isfloat']);
$this->remove_submission($subId);
global $feature_categories;
if ($feature_categories == 'y') {
global $categlib; include_once('lib/categories/categlib.php');
$categlib->approve_submission($subId, $articleId);
}
}
function add_article_hit($articleId) {
......
......@@ -14,7 +14,7 @@ class CalendarLib extends TikiLib {
}
$this->db = $db;
}
function list_calendars($offset = 0, $maxRecords = -1, $sort_mode = 'name_asc', $find = '') {
$mid = '';
$res = array();
......@@ -103,19 +103,26 @@ class CalendarLib extends TikiLib {
function list_raw_items($calIds, $user, $tstart, $tstop, $offset, $maxRecords, $sort_mode='start_asc', $find='') {
global $user, $tikilib;
$dc = $tikilib->get_date_converter($user);
if (sizeOf($calIds) == 0) {
return array();
}
$tstart = $dc->getServerDateFromDisplayDate($tstart);/* user time -> server time */;
$tstop = $dc->getServerDateFromDisplayDate($tstop);
$where = array();
$bindvars=array();
$time = new timer;
$time->start();
foreach ($calIds as $calendarId) {
$where[] = "i.`calendarId`=?";
$bindvars[] = (int)$calendarId;
$where[] = "i.`calendarId`=?";
$bindvars[] = (int)$calendarId;
}
$cond = "(" . implode(" or ", $where). ")";
$cond .= " and ((i.`start` > ? and i.`end` < ?) or (i.`start` < ? and i.`end` > ?))";
$cond = "(" . implode(" or ", $where). ") and ";
$cond .= " ((i.`start` > ? and i.`end` < ?) or (i.`start` < ? and i.`end` > ?))";
$bindvars[] = (int)$tstart;
$bindvars[] = (int)$tstop;
$bindvars[] = (int)$tstop;
......@@ -774,12 +781,10 @@ class CalendarLib extends TikiLib {
if($maxDays > 0)
{
$maxSeconds = ($maxDays * 24 * 60 * 60);
$cond .= " and `start` < (unix_timestamp(now()) + ?)";
$bindvars += array($maxSeconds);
$cond .= " and `end` < (unix_timestamp(now())) +".$maxSeconds;
}
$query = "select `start`, `name`, `calitemId`, `calendarId`, `user`, `lastModif` from `tiki_calendar_items` where 1=1 ".$cond." order by ".$this->convert_sortmode($order);
$result = $this->query($query,$bindvars,$maxrows,0);
$ret = array();
......@@ -787,7 +792,7 @@ class CalendarLib extends TikiLib {
while ($res = $result->fetchRow()) {
$ret[] = $res;
}
return $ret;
}
}
......
<?php
/** \file
* $Header: /cvsroot/tikiwiki/tiki/lib/categories/categlib.php,v 1.75 2006-01-20 09:54:54 sylvieg Exp $
* $Header: /cvsroot/tikiwiki/tiki/lib/categories/categlib.php,v 1.76 2006-02-17 15:10:39 sylvieg Exp $
*
* \brief Categories support class
*
......@@ -277,7 +277,7 @@ class CategLib extends ObjectLib {
// by now they're not showing, list_category_objects needs support for ignoring permissions
// for a type.
'article' => 'tiki_p_read_article',
'image' => '',
'image' => 'tiki_p_view_image_gallery',
// newsletters can't be categorized, although there's some code in tiki-admin_newsletters.php
// 'newsletter' => ?,
......@@ -1036,6 +1036,11 @@ class CategLib extends ObjectLib {
}
return $forbidden;
}
function approve_submission($subId, $articleId) {
$query = "update `tiki_categorized_objects` set `type`= ?, `objId`= ?, `href`=? where `objId` = ?";
$this->query($query, array('article', (int)$articleId, "tiki-read_article.php?articleId=$articleId", (int)$subId));
}
}
......
......@@ -71,6 +71,7 @@ class ChatLib extends TikiLib {
}
function get_chat_users($channelId) {
global $tikilib;
$now = date("U") - (5 * 60);
$query = "delete from `tiki_chat_users` where `timestamp` < ?";
$result = $this->query($query,array((int)$now));
......@@ -78,12 +79,22 @@ class ChatLib extends TikiLib {
$result = $this->query($query,array((int)$channelId));
$ret = array();
while ($res = $result->fetchRow()) {
$realName = $tikilib->getOne( "select `value` from `tiki_user_preferences` where `user`=? and prefName = 'realName'", array( $res["nickname"] ) );
if( $realName )
{
$res["displayName"] = $realName;
} else {
# This is here so @ can be added to
# the names as displayed
$res["displayName"] = $res["nickname"];
}
$ret[] = $res;
}
return $ret;
}
function get_messages($channelId, $last, $from) {
global $tikilib;
$query = "select `messageId`, `poster`, `data` from `tiki_chat_messages` ";
$query.= " where `timestamp`>? and `channelId`=? and `messageId`>? order by ".$this->convert_sortmode("timestamp_asc");
$result = $this->query($query,array((int)$from,(int)$channelId,(int)$last));
......@@ -95,6 +106,11 @@ class ChatLib extends TikiLib {
$aux["posterName"] = $res["poster"];
$aux["data"] = $res["data"];
$aux["messageId"] = $res["messageId"];
$realName = $tikilib->getOne( "select `value` from `tiki_user_preferences` where `user`=? and prefName = 'realName'", array( $res["poster"] ) );
if( $realName )
{
$aux["posterName"] = $realName;
}
$ret[] = $aux;
}
......
......@@ -116,7 +116,7 @@ class Comments extends TikiLib {
return $this->getOne("select count(*) from `tiki_forum_reads` where `user`=? and `threadId`=?",array($user,$threadId));
}
function add_thread_attachment( $forum_info, $threadId, $fp = '', $data = '', $name, $type, $size )
function add_thread_attachment( $forum_info, $threadId, $fp = '', $data = '', $name, $type, $size, $inbound_mail = 0 )
{
global $smarty;
......@@ -125,7 +125,6 @@ class Comments extends TikiLib {
|| ($forum_info['att'] == 'att_admin' && $tiki_p_admin_forum == 'y')
|| ($forum_info['att'] == 'att_perm' && $tiki_p_forum_attach == 'y') )
{
print "In if.\n";
$fhash = '';
......@@ -141,7 +140,7 @@ class Comments extends TikiLib {
}
@$fw = fopen($forum_info['att_store_dir'] . $fhash, "wb");
if (!$fw) {
if (!$fw && ! $inbound_mail ) {
$smarty->assign('msg', tra('Cannot write to this file: '). $forum_info['att_store_dir'] . $fhash);
$smarty->display("error.tpl");
die;
......@@ -167,7 +166,7 @@ class Comments extends TikiLib {
$data = '';
}