summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CalendarLib.php4
-rw-r--r--add_calendar.php4
-rw-r--r--admin/schema_inc.php43
-rw-r--r--index.php49
-rw-r--r--modules/mod_calendar.tpl12
-rw-r--r--templates/add_calendars.tpl4
-rw-r--r--templates/calendar.tpl20
-rw-r--r--templates/calendar_box.tpl2
8 files changed, 64 insertions, 74 deletions
diff --git a/CalendarLib.php b/CalendarLib.php
index 51a763b..0a25acb 100644
--- a/CalendarLib.php
+++ b/CalendarLib.php
@@ -164,12 +164,12 @@ class CalendarLib extends BitBase {
return $ret;
}
- function listTikiItems($tikiobj, $user_id, $tstart, $tstop, $offset, $maxRecords, $sort_mode, $find) {
+ function listTikiItems($bitobj, $user_id, $tstart, $tstop, $offset, $maxRecords, $sort_mode, $find) {
$ret = array();
$res = $dstart = '';
- foreach ($tikiobj as $tik) {
+ foreach ($bitobj as $tik) {
// $query = "select *, ( select page_id from `".BIT_DB_PREFIX."tiki_pages` where `content_id` = tc.`content_id` )" .
$query = "select * from `".BIT_DB_PREFIX."tiki_content` tc where (`last_modified`>? and `last_modified`<?) and `content_type_guid` = '".$tik."'";
$result = $this->query($query,array($tstart,$tstop));
diff --git a/add_calendar.php b/add_calendar.php
index 71a8dab..84b7797 100644
--- a/add_calendar.php
+++ b/add_calendar.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_calendar/Attic/add_calendar.php,v 1.2 2005/07/15 16:04:06 lsces Exp $
+// $Header: /cvsroot/bitweaver/_bit_calendar/Attic/add_calendar.php,v 1.3 2005/07/15 17:48:59 lsces Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -73,7 +73,7 @@ if (isset($_REQUEST["find"])) {
$find = '';
}
-$pagination_url = $tikilib->pagination_url($find, $sort_mode);
+$pagination_url = $gBitSystem->pagination_url($find, $sort_mode);
$smarty->assign_by_ref('pagination_url', $pagination_url);
$calendars = $calendarlib->listCalendars(0, -1, $sort_mode, $find, 0);
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 2200cf1..adad1e4 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -60,17 +60,9 @@ global $gBitInstaller;
$gBitInstaller->makePackageHomeable('calendar');
foreach( array_keys( $tables ) AS $tableName ) {
- $gBitInstaller->registerSchemaTable( CALENDAR_PKG_DIR, $tableName, $tables[$tableName] );
+ $gBitInstaller->registerSchemaTable( CALENDAR_PKG_NAME, $tableName, $tables[$tableName] );
}
-$gBitInstaller->registerPackageInfo( CALENDAR_PKG_DIR, array(
- 'description' => "Calendar package to display tiki entries by date, and set events",
- 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
- 'version' => '0.1',
- 'state' => 'beta',
- 'dependencies' => '',
-) );
-
// ### Indexes
$indices = array (
'tiki_calendar_categories_idx' => array( 'table' => 'tiki_calendar_categories', 'cols' => 'calendar_id,name', 'opts' => NULL ),
@@ -78,30 +70,29 @@ $indices = array (
'tiki_calendar_locations_idx' => array( 'table' => 'tiki_calendar_locations', 'cols' => 'name', 'opts' => NULL )
);
-$gBitInstaller->registerSchemaIndexes( CALENDAR_PKG_DIR, $indices );
-
-// ### Defaults
+$gBitInstaller->registerSchemaIndexes( CALENDAR_PKG_NAME, $indices );
-// ### Default Menu Options
-$gBitInstaller->registerMenuOptions( CALENDAR_PKG_DIR, array(
- array(42,'o','Calendar','tiki-calendar.php',0,'feature_calendar','bit_p_view_calendar',''),
- array(42,'o','Calendar','tiki-admin_calendars.php',1,'feature_calendar','bit_p_admin_calendar','')
+$gBitInstaller->registerPackageInfo( CALENDAR_PKG_NAME, array(
+ 'description' => "Calendar package to display bitweaver entries by date, and set events",
+ 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
) );
+// ### Defaults
+
// ### Default User Permissions
-$gBitInstaller->registerUserPermissions( CALENDAR_PKG_DIR, array(
- array('bit_p_view_calendar', 'Can browse the calendar', 'basic', 'calendar'),
- array('bit_p_change_events', 'Can change events in the calendar', 'registered', 'calendar'),
- array('bit_p_add_events', 'Can add events in the calendar', 'registered', 'calendar'),
- array('bit_p_admin_calendar', 'Can create/admin calendars', 'admin', 'calendar')
+$gBitInstaller->registerUserPermissions( CALENDAR_PKG_NAME, array(
+ array('bit_p_view_calendar', 'Can browse the calendar', 'basic', CALENDAR_PKG_NAME),
+ array('bit_p_change_events', 'Can change events in the calendar', 'registered', CALENDAR_PKG_NAME),
+ array('bit_p_add_events', 'Can add events in the calendar', 'registered', CALENDAR_PKG_NAME),
+ array('bit_p_admin_calendar', 'Can create/admin calendars', 'admin', CALENDAR_PKG_NAME)
) );
// ### Default Preferences
-$gBitInstaller->registerPreferences( CALENDAR_PKG_DIR, array(
- array ('kernel', 'feature_jscalendar', 'n'),
- array ('calendar', 'calendar_blogs', 'y'),
- array ('calendar', 'calendar_users', 'y'),
- array ('calendar', 'calendar_wiki', 'y')
+$gBitInstaller->registerPreferences( CALENDAR_PKG_NAME, array(
+// array ('kernel', 'feature_jscalendar', 'n'),
+ array (CALENDAR_PKG_NAME, 'calendar_blogs', 'y'),
+ array (CALENDAR_PKG_NAME, 'calendar_users', 'y'),
+ array (CALENDAR_PKG_NAME, 'calendar_wiki', 'y')
) );
?>
diff --git a/index.php b/index.php
index 05d16ac..4f341a7 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_calendar/index.php,v 1.2 2005/07/15 16:04:06 lsces Exp $
+// $Header: /cvsroot/bitweaver/_bit_calendar/index.php,v 1.3 2005/07/15 17:48:59 lsces Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -59,21 +59,21 @@ if (isset($_REQUEST["calIds"])and is_array($_REQUEST["calIds"])and count($_REQUE
$_SESSION['CalendarViewGroups'] = array();
}
-// setup list of tiki items displayed
-if (isset($_REQUEST["tikicals"])and is_array($_REQUEST["tikicals"])and count($_REQUEST["tikicals"])) {
- $_SESSION['CalendarViewTikiCals'] = $_REQUEST["tikicals"];
-} elseif (!isset($_SESSION['CalendarViewTikiCals'])) {
- $_SESSION['CalendarViewTikiCals'] = array();
-} elseif (isset($_REQUEST["refresh"])and !isset($_REQUEST["tikicals"])) {
- $_SESSION['CalendarViewTikiCals'] = array();
+// setup list of bit items displayed
+if (isset($_REQUEST["bitcals"])and is_array($_REQUEST["bitcals"])and count($_REQUEST["bitcals"])) {
+ $_SESSION['CalendarViewBitCals'] = $_REQUEST["bitcals"];
+} elseif (!isset($_SESSION['CalendarViewBitCals'])) {
+ $_SESSION['CalendarViewBitCals'] = array();
+} elseif (isset($_REQUEST["refresh"])and !isset($_REQUEST["bitcals"])) {
+ $_SESSION['CalendarViewBitCals'] = array();
}
// this should be a global array generated by the some object in the kernel
-$tikiItems = $calendarlib->gContentTypes;
-$smarty->assign('tikiItems', $tikiItems);
+$bitItems = $calendarlib->gContentTypes;
+$smarty->assign('bitItems', $bitItems);
$smarty->assign('displayedcals', $_SESSION['CalendarViewGroups']);
-$smarty->assign('displayedtikicals', $_SESSION['CalendarViewTikiCals']);
+$smarty->assign('displayedbitcals', $_SESSION['CalendarViewBitCals']);
$thiscal = array();
@@ -87,14 +87,14 @@ foreach ($listcals as $thatid) {
$smarty->assign('thiscal', $thiscal);
-$tikical = array();
+$bitcal = array();
-foreach ($_SESSION['CalendarViewTikiCals'] as $calt) {
- $tikical["$calt"] = 1;
+foreach ($_SESSION['CalendarViewBitCals'] as $calt) {
+ $bitcal["$calt"] = 1;
}
$trunc = "12"; // put in a pref, number of chars displayed in cal cells
-$smarty->assign('tikical', $tikical);
+$smarty->assign('bitcal', $bitcal);
if (isset($_REQUEST["todate"]) && $_REQUEST['todate']) {
$_SESSION['CalendarFocusDate'] = $_REQUEST['todate'];
@@ -293,7 +293,7 @@ if ($_REQUEST["editmode"]) {
}
if ($thatcal["customlanguages"] == 'y') {
- $languages = $tikilib->list_languages();
+ $languages = $gBitSystem->list_languages();
}
$smarty->assign('listcat', $listcat);
@@ -435,15 +435,13 @@ if ($_SESSION['CalendarViewGroups']) {
} else {
$listevents = array();
}
-
-if ($_SESSION['CalendarViewTikiCals']) {
- $listtikievents = $calendarlib->listTikiItems($_SESSION['CalendarViewTikiCals'], $gBitUser->mUserId, $viewstart, $viewend, 0, 50, 'name_desc', '');
+if ($_SESSION['CalendarViewBitCals']) {
+ $listbitevents = $calendarlib->listTikiItems($_SESSION['CalendarViewBitCals'], $gBitUser->mUserId, $viewstart, $viewend, 0, 50, 'name_desc', '');
} else {
- $listtikievents = array();
+ $listbitevents = array();
}
define("weekInSeconds", 604800);
-
// note that number of weeks starts at ZERO (i.e., zero = 1 week to display).
for ($i = 0; $i <= $numberofweeks; $i++) {
$wee = $firstweek + $i;
@@ -457,6 +455,7 @@ for ($i = 0; $i <= $numberofweeks; $i++) {
$leday = array();
$dday = $startOfWeek + $d * $w;
$cell[$i][$w]['day'] = $dday;
+
if (isset($listevents["$dday"])) {
$e = 0;
@@ -474,10 +473,10 @@ for ($i = 0; $i <= $numberofweeks; $i++) {
}
}
- if (isset($listtikievents["$dday"])) {
+ if (isset($listbitevents["$dday"])) {
$e = 0;
- foreach ($listtikievents["$dday"] as $lte) {
+ foreach ($listbitevents["$dday"] as $lte) {
$leday["{$lte['time']}$e"] = $lte;
$smarty->assign('cellextra', "");
@@ -509,8 +508,8 @@ if ($_SESSION['CalendarViewMode'] == 'day') {
$smarty->assign('hrows', $hrows);
$smarty->assign('trunc', $trunc);
-$smarty->assign('daformat', $tikilib->get_long_date_format()." ".tra("at")." %H:%M");
-$smarty->assign('daformat2', $tikilib->get_long_date_format());
+$smarty->assign('daformat', $gBitSystem->get_long_date_format()." ".tra("at")." %H:%M");
+$smarty->assign('daformat2', $gBitSystem->get_long_date_format());
$smarty->assign('currentweek', $currentweek);
$smarty->assign('firstweek', $firstweek);
$smarty->assign('lastweek', $lastweek);
diff --git a/modules/mod_calendar.tpl b/modules/mod_calendar.tpl
index 69a7fc4..fdfd79e 100644
--- a/modules/mod_calendar.tpl
+++ b/modules/mod_calendar.tpl
@@ -1,16 +1,16 @@
-{* $Header: /cvsroot/bitweaver/_bit_calendar/modules/mod_calendar.tpl,v 1.1 2005/07/15 12:25:01 bitweaver Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_calendar/modules/mod_calendar.tpl,v 1.2 2005/07/15 17:48:59 lsces Exp $ *}
{php}
include_once( CALENDAR_PKG_PATH."Calendar.php");
-global $dbTiki,$tikilib;
+global $gBitSystem;
if(isset($_SESSION["thedate"])) {
$day=date("d",$_SESSION["thedate"]);
$mon=date("m",$_SESSION["thedate"]);
$year=date("Y",$_SESSION["thedate"]);
} else {
- $day=date( "d", $tikilib->server_time_to_site_time( time() ) );
- $mon=date( "m", $tikilib->server_time_to_site_time( time() ) );
- $year=date( "Y", $tikilib->server_time_to_site_time( time() ) );
+ $day=date( "d", $gBitSystem->server_time_to_site_time( time() ) );
+ $mon=date( "m", $gBitSystem->server_time_to_site_time( time() ) );
+ $year=date( "Y", $gBitSystem->server_time_to_site_time( time() ) );
}
if(isset($_REQUEST["day"])) {
$day = $_REQUEST["day"];
@@ -67,7 +67,7 @@ if (!strstr($father,"?")) {
}
{/php}
-{bitmodule title="$moduleTitle" name="tikicalendar"}
+{bitmodule title="$moduleTitle" name="calendar"}
<!-- THIS ROW DISPLAYS THE YEAR AND MONTH -->
<div class="navigation">
{php}
diff --git a/templates/add_calendars.tpl b/templates/add_calendars.tpl
index c45bf3a..d775282 100644
--- a/templates/add_calendars.tpl
+++ b/templates/add_calendars.tpl
@@ -1,4 +1,4 @@
-<div class="display tikicalendar">
+<div class="display calendar">
<div class="header">
<h1><a href="{$gBitLoc.CALENDAR_PKG_URL}admin/index.php">{tr}Manage Calendars{/tr}</a></h1>
</div>
@@ -106,4 +106,4 @@
<div class="norecords">{tr}No records found{/tr}</div>
{/if}
-</div> {* end .tikicalendar *}
+</div> {* end .calendar *}
diff --git a/templates/calendar.tpl b/templates/calendar.tpl
index 6b4cbfd..1bc485f 100644
--- a/templates/calendar.tpl
+++ b/templates/calendar.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_calendar/templates/calendar.tpl,v 1.1 2005/07/15 12:25:01 bitweaver Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_calendar/templates/calendar.tpl,v 1.2 2005/07/15 17:48:59 lsces Exp $ *}
{popup_init src="`$gBitLoc.THEMES_PKG_URL`overlib.js"}
<div class="floaticon">
@@ -7,7 +7,7 @@
{/if}
</div>
-<div class="display tikicalendar">
+<div class="display calendar">
<div class="header">
<h1><a href="{$gBitLoc.CALENDAR_PKG_URL}index.php?view={$view}">{tr}Calendar{/tr}</a></h1>
</div>
@@ -36,7 +36,7 @@
<a href="javascript:hide('tabcal',1);{if $modifiable}hide('tabnav',1);{/if}show('tab',1);">{tr}Hide{/tr}</a>
</div>
- <div class="tikicalendar box">
+ <div class="calendar box">
<form method="get" action="{$gBitLoc.CALENDAR_PKG_URL}index.php" id="f">
<table class="panel">
<tr>
@@ -74,16 +74,16 @@
<div class="boxtitle">{tr}Tools Calendars{/tr}</div>
<div class="boxcontent">
<div
- onclick="document.getElementById('tikiswitch').click();document.getElementById('tikiswitch').checked=!document.getElementById('tikiswitch').checked;document.getElementById('tikiswitch').click();"
- ><input name="tikiswitch" id="tikiswitch" type="checkbox" onclick="switchCheckboxes(this.form.id,'tikicals[]','tikiswitch');this.checked=!this.checked;" /> {tr}check / uncheck all{/tr}
+ onclick="document.getElementById('calswitch').click();document.getElementById('calswitch').checked=!document.getElementById('calswitch').checked;document.getElementById('calswitch').click();"
+ ><input name="calswitch" id="calswitch" type="checkbox" onclick="switchCheckboxes(this.form.id,'bitcals[]','calswitch');this.checked=!this.checked;" /> {tr}check / uncheck all{/tr}
</div>
- {foreach from=$tikiItems key=ki item=vi}
+ {foreach from=$bitItems key=ki item=vi}
{if $vi.feature eq 'y' and $vi.right eq 'y'}
<div
- onclick="document.getElementById('tikical_{$ki}').checked=!document.getElementById('tikical_{$ki}').checked;"
+ onclick="document.getElementById('bitcal_{$ki}').checked=!document.getElementById('bitcal_{$ki}').checked;"
onmouseout="this.style.textDecoration='none';"
onmouseover="this.style.textDecoration='underline';"
- ><input type="checkbox" name="tikicals[]" value="{$ki|escape}" id="tikical_{$ki}" {if $tikical.$ki}checked="checked"{/if} onclick="this.checked=!this.checked;"/>
+ ><input type="checkbox" name="bitcals[]" value="{$ki|escape}" id="bitcal_{$ki}" {if $bitcal.$ki}checked="checked"{/if} onclick="this.checked=!this.checked;"/>
<span class="Cal{$ki}">{$vi.label}</span>
</div>
{/if}
@@ -110,7 +110,7 @@
<a href="javascript:hide('tabcal',1);hide('tabnav',1);show('tab',1);">{tr}Hide{/tr}</a>
</div>
- <div class="tikicalendar box">
+ <div class="calendar box">
{* ······························· *}
{if ($calitem_id > 0 and $bit_p_change_events eq 'y') or ($calendar_id > 0 and $bit_p_add_events eq 'y')}
@@ -377,7 +377,7 @@ onUpdate : gotocal
{* - Calendar Grid - *}
-<table class="tikicalendar">
+<table class="calendar">
<caption>{tr}selection{/tr}: {$focusdate|bit_long_date}</caption>
{if $viewmode eq 'day'}
{* - Single Day - *}
diff --git a/templates/calendar_box.tpl b/templates/calendar_box.tpl
index c149c43..d80bdc0 100644
--- a/templates/calendar_box.tpl
+++ b/templates/calendar_box.tpl
@@ -1,4 +1,4 @@
-<div class="tikicalendar popup box">
+<div class="calendar popup box">
<div class="boxtitle">{$cellhead}
{if $cellprio}
<span class="calprio{$cellprio}">{$cellprio}</span>