summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-07-15 12:25:01 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-07-15 12:25:01 +0000
commit6e58dfd91f9da6606c3303fbfbae840d15ae0e2b (patch)
tree79d8e50c1669d7004d6c965608e84feea8cf4aaf /admin
downloadcalendar-6e58dfd91f9da6606c3303fbfbae840d15ae0e2b.tar.gz
calendar-6e58dfd91f9da6606c3303fbfbae840d15ae0e2b.tar.bz2
calendar-6e58dfd91f9da6606c3303fbfbae840d15ae0e2b.zip
IMPORT from TikiPro HEAD _p_tp_calendar
Diffstat (limited to 'admin')
-rw-r--r--admin/admin_calendar_inc.php55
-rw-r--r--admin/index.php4
-rw-r--r--admin/schema_inc.php107
3 files changed, 166 insertions, 0 deletions
diff --git a/admin/admin_calendar_inc.php b/admin/admin_calendar_inc.php
new file mode 100644
index 0000000..d2c9935
--- /dev/null
+++ b/admin/admin_calendar_inc.php
@@ -0,0 +1,55 @@
+<?php
+
+// $Header: /cvsroot/bitweaver/_bit_calendar/admin/admin_calendar_inc.php,v 1.1 2005/07/15 12:25:01 bitweaver 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.
+// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
+
+if (isset($_REQUEST["calendarset"]) && isset($_REQUEST["homeCalendar"])) {
+
+ $gBitSystem->storePreference("home_calendar", $_REQUEST["homeCalendar"]);
+ $smarty->assign('home_calendar', $_REQUEST["homeCalendar"]);
+}
+
+include_once( CALENDAR_PKG_PATH.'calendar_lib.php' );
+
+$formCalendarFeatures = array(
+ "calendar_blogs" => array(
+ 'label' => 'Display blog updates',
+ ),
+ "calendar_users" => array(
+ 'label' => 'Display user personal page updates',
+ ),
+ "calendar_wiki" => array(
+ 'label' => 'Display wiki page updates',
+ ),
+ "calendar_contact" => array(
+ 'label' => 'Display contact record updates',
+ ),
+ "feature_jscalendar" => array(
+ 'label' => 'Enable jscalendar popup',
+ ),
+);
+$smarty->assign( 'formCalendarFeatures',$formCalendarFeatures );
+
+if (isset($_REQUEST["calendarfeatures"])) {
+
+ foreach( $formCalendarFeatures as $item => $data ) {
+ simple_set_toggle( $item );
+ }
+
+ if ($gBitSystem->isPackageActive( 'categories' )) {
+ if (isset($_REQUEST["cal_categ"]) && $_REQUEST["cal_categ"] == "on") {
+ $gBitSystem->storePreference("cal_categ", 'y');
+ $smarty->assign("cal_categ", 'y');
+ } else {
+ $gBitSystem->storePreference("blog_categ", 'n');
+ $smarty->assign("blog_categ", 'n');
+ }
+ $gBitSystem->storePreference("cal_parent_categ", $_REQUEST["cal_parent_categ"]);
+ $smarty->assign('cal_parent_categ', $_REQUEST['cal_parent_categ']);
+ }
+}
+
+?>
diff --git a/admin/index.php b/admin/index.php
new file mode 100644
index 0000000..80f6d40
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,4 @@
+<?php
+ // This is not a package.
+ header ("location: ../index.php");
+?> \ No newline at end of file
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
new file mode 100644
index 0000000..2200cf1
--- /dev/null
+++ b/admin/schema_inc.php
@@ -0,0 +1,107 @@
+<?php
+
+$tables = array(
+
+'tiki_calendar_categories' => "
+ cal_cat_id I4 AUTO PRIMARY,
+ calendar_id I4 NOTNULL,
+ name C(160) NOTNULL
+",
+
+'tiki_calendar_items' => "
+ calitem_id I4 AUTO PRIMARY,
+ calendar_id I4 NOTNULL,
+ start_time I8 NOTNULL,
+ end_time I8 NOTNULL,
+ location_id I4,
+ category_id I4,
+ priority C(1) NOTNULL DEFAULT '1',
+ status C(1) NOTNULL DEFAULT '0',
+ url C(255),
+ lang C(2) NOTNULL default 'en',
+ name C(255) NOTNULL,
+ description B,
+ user_id I4,
+ created I8 NOTNULL,
+ lastmodif I8 NOTNULL
+",
+
+'tiki_calendar_locations' => "
+ calloc_id I4 AUTO PRIMARY,
+ calendar_id I4 NOTNULL,
+ name C(160) NOTNULL,
+ description X
+",
+
+'tiki_calendar_roles' => "
+ calitem_id I4 NOTNULL PRIMARY,
+ user_id I4 NOTNULL PRIMARY,
+ role C(1) NOTNULL DEFAULT '0'
+",
+
+'tiki_calendars' => "
+ calendar_id I4 AUTO PRIMARY,
+ name C(80) NOTNULL,
+ description C(255),
+ user_id I4 NOTNULL,
+ customlocations C(1) NOTNULL DEFAULT 'n',
+ customcategories C(1) NOTNULL DEFAULT 'n',
+ customlanguages C(1) NOTNULL DEFAULT 'n',
+ custompriorities C(1) NOTNULL DEFAULT 'n',
+ customparticipants C(1) NOTNULL DEFAULT 'n',
+ created I8 NOTNULL,
+ lastmodif I8 NOTNULL
+"
+
+);
+
+global $gBitInstaller;
+
+$gBitInstaller->makePackageHomeable('calendar');
+
+foreach( array_keys( $tables ) AS $tableName ) {
+ $gBitInstaller->registerSchemaTable( CALENDAR_PKG_DIR, $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 ),
+ 'tiki_calendar_items_idx' => array( 'table' => 'tiki_calendar_items', 'cols' => 'calendar_id', 'opts' => NULL ),
+ 'tiki_calendar_locations_idx' => array( 'table' => 'tiki_calendar_locations', 'cols' => 'name', 'opts' => NULL )
+);
+
+$gBitInstaller->registerSchemaIndexes( CALENDAR_PKG_DIR, $indices );
+
+// ### Defaults
+
+// ### 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','')
+) );
+
+// ### 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')
+) );
+
+// ### 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')
+) );
+
+?>