Commit 513dbb25 authored by mose's avatar mose

unfinished work on calendar evolution (sneaky preview ;)

parent 4a092b7d
This diff is collapsed.
// $Header: /cvsroot/tikiwiki/tiki/lib/tiki-js.js,v 1.29 2003-11-24 06:10:45 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/lib/tiki-js.js,v 1.30 2003-12-01 14:45:46 mose Exp $
function toggle_dynamic_var($name) {
name1 = 'dyn_'+$name+'_display';
......@@ -157,12 +157,14 @@ function setUserModuleFromCombo(id) {
//document.getElementById('usermoduledata').value='das';
}
function show(foo) {
function show(foo,f) {
document.getElementById(foo).style.display = "block";
if (f) { setCookie(foo, "o"); }
}
function hide(foo) {
function hide(foo,f) {
document.getElementById(foo).style.display = "none";
if (f) { setCookie(foo, "c"); }
}
function flip(foo) {
......@@ -184,13 +186,9 @@ function toggle(foo) {
setCookie(foo, "o");
} else {
if (document.getElementById(foo).style.display == "block") {
hide(foo);
setCookie(foo, "c");
hide(foo,1);
} else {
show(foo);
setCookie(foo, "o");
show(foo,1);
}
}
}
......
......@@ -1080,7 +1080,7 @@ div.messureadbody {
/* calendar styles */
#calendar
#caltable
{
width:100%;
}
......@@ -1161,7 +1161,7 @@ background-color: transparent;
div#tab, div#tabcal, div#tabnav
{
margin-top: 10px;
margin-left: 30px;
margin-left: 29px;
}
div#tab
{
......@@ -1172,9 +1172,26 @@ div.tabcal, div.tabnav
padding: 10px;
background-color: #ffffff;
border: 1px solid #666666;
border-bottom: 1px solid #aeaeae;
border-bottom: 0;
font-size: 11px;
}
div.tabrow {
margin-left: 29px;
background-color: #efefef;
border: 1px solid #787878;
border-bottom: 0;
font-size: 11px;
}
td.middle {
vertical-align: middle;
}
.daterow {
margin-left: 10px;
}
.mininotes {
font-size: 80%;
color:#666666;
}
/* checkboxes background is required for rollover display */
.calcheckbox
{
......@@ -1191,8 +1208,9 @@ background-color: #ffffff;
}
.calfocus
{
font-size:7px;
font-size: 8px;
background-color: transparent;
height: 32px;
}
.calfocus a
{
......@@ -1201,8 +1219,9 @@ color: #000000;
}
.calfocuson
{
font-size:7px;
font-size: 8px;
background-color: #f3e498;
height: 32px;
}
.calfocuson a
{
......@@ -1492,25 +1511,23 @@ font-family: monospace;
background-color: #ffffff;
}
.viewmodeon
a.viewmodeon
{
border: 1px solid #8CACBB;
background-color: #C7D0D9;
color: #000000;
font-weight: bold;
text-decoration: none;
padding-left: 10px;
padding-right: 10px;
margin: 0;
padding: 0;
}
.viewmodeoff
a.viewmodeoff
{
border: 1px solid #8CACBB;
background-color: #FFFFFF;
color: #000000;
text-decoration: none;
padding-left: 10px;
padding-right: 10px;
margin: 0;
padding: 0;
}
a.viewmodeon img {
margin: 0;
padding: 0;
}
a.viewmodeoff img {
margin: 0;
padding: 0;
}
.viewmodeoff:hover
......
<a class="pagetitle" href="tiki-admin_calendars.php">{tr}Admin Calendars{/tr}</a><br />
<h2>{tr}Create/edit Calendars{/tr}</h2>
<form action="tiki-admin_calendars.php" method="post">
<input type="hidden" name="calendarId" value="{$calendarId|escape}" />
<table class="normal">
<tr><td class="formcolor">{tr}Name{/tr}:</td><td class="formcolor"><input type="text" name="name" value="{$name|escape}" /></td></tr>
<tr><td class="formcolor">{tr}Description{/tr}:</td><td class="formcolor"><textarea name="description" rows="5" cols="80" wrap="virtual">{$description|escape}</textarea></td></tr>
<tr><td class="formcolor">{tr}Custom Locations{/tr}:</td><td class="formcolor">
<select name="customlocations">
<option value='y' {if $customlocations eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $customlocations eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Custom Categories{/tr}:</td><td class="formcolor">
<select name="customcategories">
<option value='y' {if $customcategories eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $customcategories eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Custom Languages{/tr}:</td><td class="formcolor">
<select name="customlanguages">
<option value='y' {if $customlanguages eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $customlanguages eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Custom Priorities{/tr}:</td><td class="formcolor">
<select name="custompriorities">
<option value='y' {if $custompriorities eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $custompriorities eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">&nbsp;</td><td class="formcolor"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr>
</table>
</form>
<a class="pagetitle" href="tiki-admin_calendars.php">{tr}Admin Calendars{/tr}</a>
<br /><br />
<div class="tabs">
<span id="tab1" class="tab tabActive">{tr}List Calendars{/tr}</span>
<span id="tab2" class="tab">{tr}Create/edit Calendars{/tr}</span>
</div>
{* --- tab with list --- *}
<div id="content1" class="content">
<h2>{tr}List of Calendars{/tr}</h2>
{if count($calendars) gt 0}
<div align="center">
......@@ -76,5 +49,66 @@
{/foreach}
</table>
<br />
<div class="mini">
{if $prev_offset >= 0}
[<a class="prevnext" href="tiki-admin_calendars.php?find={$find}&amp;offset={$prev_offset}&amp;sort_mode={$sort_mode}">{tr}prev{/tr}</a>]&nbsp;
{/if}
{tr}Page{/tr}: {$actual_page}/{$cant_pages}
{if $next_offset >= 0}
&nbsp;[<a class="prevnext" href="tiki-admin_calendars.php?find={$find}&amp;offset={$next_offset}&amp;sort_mode={$sort_mode}">{tr}next{/tr}</a>]
{/if}
{if $direct_pagination eq 'y'}
<br/>
{section loop=$cant_pages name=foo}
{assign var=selector_offset value=$smarty.section.foo.index|times:$maxRecords}
<a class="prevnext" href="tiki-admin_calendars.php?find={$find}&amp;offset={$selector_offset}&amp;sort_mode={$sort_mode}">
{$smarty.section.foo.index_next}</a>&nbsp;
{/section}
{/if}
</div>
</div>
{else}
<b>{tr}No records found{/tr}</b>
{/if}
</div>
{* --- tab with form --- *}
<div id="content2" class="content">
<h2>{tr}Create/edit Calendars{/tr}</h2>
<form action="tiki-admin_calendars.php" method="post">
<input type="hidden" name="calendarId" value="{$calendarId|escape}" />
<table class="normal">
<tr><td class="formcolor">{tr}Name{/tr}:</td><td class="formcolor"><input type="text" name="name" value="{$name|escape}" /></td></tr>
<tr><td class="formcolor">{tr}Description{/tr}:</td><td class="formcolor"><textarea name="description" rows="5" wrap="virtual" style="width:100%;">{$description|escape}</textarea></td></tr>
<tr><td class="formcolor">{tr}Custom Locations{/tr}:</td><td class="formcolor">
<select name="customlocations">
<option value='y' {if $customlocations eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $customlocations eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Custom Categories{/tr}:</td><td class="formcolor">
<select name="customcategories">
<option value='y' {if $customcategories eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $customcategories eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Custom Languages{/tr}:</td><td class="formcolor">
<select name="customlanguages">
<option value='y' {if $customlanguages eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $customlanguages eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Custom Priorities{/tr}:</td><td class="formcolor">
<select name="custompriorities">
<option value='y' {if $custompriorities eq 'y'}selected="selected"{/if}>{tr}yes{/tr}</option>
<option value='n' {if $custompriorities eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">&nbsp;</td><td class="formcolor"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr>
</table>
</form>
This diff is collapsed.
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-admin_calendars.php,v 1.8 2003-11-17 15:44:27 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-admin_calendars.php,v 1.9 2003-12-01 14:45:45 mose 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.
......@@ -75,7 +75,33 @@ if (isset($_REQUEST["find"])) {
$smarty->assign('find', $find);
$calendars = $calendarlib->list_calendars(0, -1, $sort_mode, $find, 0);
$smarty->assign_by_ref('calendars', $calendars);
if (!isset($_REQUEST["offset"])) {
$offset = 0;
} else {
$offset = $_REQUEST["offset"];
}
$smarty->assign_by_ref('offset', $offset);
$cant_pages = ceil($calendars["cant"] / $maxRecords);
$smarty->assign_by_ref('cant_pages', $cant_pages);
$smarty->assign('actual_page', 1 + ($offset / $maxRecords));
if ($calendars["cant"] > ($offset + $maxRecords)) {
$smarty->assign('next_offset', $offset + $maxRecords);
} else {
$smarty->assign('next_offset', -1);
}
// If offset is > 0 then prev_offset
if ($offset > 0) {
$smarty->assign('prev_offset', $offset - $maxRecords);
} else {
$smarty->assign('prev_offset', -1);
}
$smarty->assign_by_ref('calendars', $calendars["data"]);
$groups = $userlib->get_groups();
......@@ -84,6 +110,7 @@ $cat_objid = $_REQUEST["calendarId"];
include_once ("categorize_list.php");
// Display the template
$smarty->assign('uses_tabs', 'y');
$smarty->assign('mid', 'tiki-admin_calendars.tpl');
$smarty->display("tiki.tpl");
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-calendar.php,v 1.18 2003-11-17 15:44:28 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-calendar.php,v 1.19 2003-12-01 14:45:45 mose 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.
......@@ -29,30 +29,24 @@ if ($tiki_p_view_calendar != 'y') {
$infocals = array();
$infocals = $calendarlib->list_calendars();
$smarty->assign('infocals', $infocals);
$listcals = array_keys($infocals["data"]);
$listcals = array_keys($infocals);
$smarty->assign('listcals', $listcals);
/* that is for specific perms per calendar. TODO
$outsess = array();
foreach ($listcals as $grp) {
if($userlib->object_has_one_permission($grp,'calendar')) { # does that object has specific rights defined ?
$perms = $userlib->get_permissions(0,-1,'permName_desc','','calendar'); # yes, $perms is the list or permNames
foreach($perms["data"] as $perm) { # so we scan each perm ..
if (($tiki_p_admin == 'y') or $userlib->object_has_permission($user,$grp,'calendar',$permName)) {
$$permName = 'y'; # if that perm is present set $tiki_p_stuff to 'y'
$smarty->assign("$permName",array("$grp"=>'y'));
if($userlib->object_has_one_permission($grp,'calendar')) {
$perms = $userlib->get_permissions(0,-1,'permName_desc','','calendar');
foreach($perms["data"] as $perm) {
if ($userlib->object_has_permission($user,$grp,'calendar','tiki_p_view_calendar')) {
$outsess[] = $grp;
} else {
$$permName = 'n';
$smarty->assign("$permName",array("$grp"=>'n')); # if not it's set to 'n', value is overidden
}
}
}
}
$listcals = $outsess;
*/
$smarty->assign('infocals', $infocals["data"]);
$smarty->assign('listcals', $listcals);
function dropthat($value) {
global $match;
return ($value != $match);
......@@ -216,7 +210,6 @@ if (isset($_REQUEST["todate"]) && $_REQUEST['todate']) {
$_REQUEST["todate"] = $_SESSION['CalendarFocusDate'];
} else {
$_SESSION['CalendarFocusDate'] = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$_REQUEST["todate"] = $_SESSION['CalendarFocusDate'];
}
......@@ -227,18 +220,17 @@ list($focus_day, $focus_month, $focus_year) = array(
date("Y", $focusdate)
);
if (isset($_REQUEST["viewmode"])and $_REQUEST["viewmode"]) {
if (isset($_REQUEST["viewmode"]) and $_REQUEST["viewmode"]) {
$_SESSION['CalendarViewMode'] = $_REQUEST["viewmode"];
}
if (!isset($_SESSION['CalendarViewMode'])or !$_SESSION['CalendarViewMode'])
if (!isset($_SESSION['CalendarViewMode']) or !$_SESSION['CalendarViewMode']) {
$_SESSION['CalendarViewMode'] = 'week';
}
$smarty->assign('viewmode', $_SESSION['CalendarViewMode']);
if (isset($_REQUEST["delete"])and ($_REQUEST["delete"]) and isset($_REQUEST["calitemId"])) {
$calendarlib->drop_item($user, $_REQUEST["calitemId"]);
$_REQUEST["calitemId"] = 0;
}
......@@ -309,31 +301,25 @@ if (isset($_REQUEST["save"])and ($_REQUEST["save"])) {
"start" => $event_start,
"end" => $event_end,
"locationId" => $_REQUEST["locationId"],
"newloc" => addslashes($_REQUEST["newloc"] . ' '),
"newloc" => $_REQUEST["newloc"],
"categoryId" => $_REQUEST["categoryId"],
"newcat" => addslashes($_REQUEST["newcat"] . ' '),
"newcat" => $_REQUEST["newcat"],
"priority" => $_REQUEST["priority"],
"status" => $_REQUEST["status"],
"url" => $_REQUEST["url"],
"lang" => $_REQUEST["lang"],
"name" => addslashes($_REQUEST["name"]),
"description" => addslashes(@$_REQUEST["description"] . " ")
"name" => $_REQUEST["name"],
"description" => $_REQUEST["description"]
));
}
if (isset($_SESSION['CalendarViewGroups'][0])) {
$defaultcalId = $_SESSION['CalendarViewGroups'][0];
} else {
$defaultcalId = 0;
}
if ($_REQUEST["calitemId"]) {
$info = $calendarlib->get_item($_REQUEST["calitemId"]);
} else {
$info = array();
$info["calitemId"] = "";
$info["calendarId"] = $defaultcalId;
$info["calendarId"] = "";
$info["user"] = "";
$info["calname"] = "";
$info["organizers"] = $user . ",";
......@@ -384,10 +370,7 @@ $smarty->assign('lastModif', $info["lastModif"]);
$smarty->assign('lastUser', $info["user"]);
$smarty->assign('status', $info["status"]);
if (!isset($_REQUEST["editmode"]))
$_REQUEST["editmode"] = 0;
$smarty->assign('editmode', $_REQUEST["editmode"]);
if (!isset($_REQUEST["editmode"])) $_REQUEST["editmode"] = 0;
if ($_REQUEST["editmode"]) {
$thatcal = $calendarlib->get_calendar($_REQUEST["calendarId"]);
......@@ -410,17 +393,12 @@ if ($_REQUEST["editmode"]) {
$listloc = $calendarlib->list_locations($_REQUEST["calendarId"]);
}
if ($thatcal["customparticipants"] == 'y') {
$listpeople = $calendarlib->list_cal_users($_REQUEST["calendarId"]);
}
if ($thatcal["customlanguages"] == 'y') {
$languages = $tikilib->list_languages();
}
$smarty->assign('listcat', $listcat);
$smarty->assign('listloc', $listloc);
$smarty->assign('listpeople', $listpeople);
$smarty->assign_by_ref('languages', $languages);
}
......@@ -479,12 +457,10 @@ $wd = date('w', $focusdate);
// calculate timespan for sql query
if ($_SESSION['CalendarViewMode'] == 'month') {
$firstweek = date("W", mktime(0, 0, 0, $focus_month, 2, $focus_year)) - 1;
$lastweek = date("W", mktime(0, 0, 0, $focus_month + 1, 1, $focus_year)) - 1;
if ($lastweek < $firstweek) {
$lastweek += 52;
$currentweek += 52;
}
......@@ -493,14 +469,12 @@ if ($_SESSION['CalendarViewMode'] == 'month') {
$numberofweeks = $lastweek - $firstweek;
} elseif ($_SESSION['CalendarViewMode'] == 'week') {
$firstweek = $currentweek;
$lastweek = $currentweek;
$viewstart = $focusdate - ($wd * $d);
$viewend = $viewstart + ((7 * $d) - 1);
$numberofweeks = 0;
} else {
$firstweek = $currentweek;
$lastweek = $currentweek;
$viewstart = $focusdate;
$viewend = $focusdate + ($d - 1);
......@@ -601,6 +575,9 @@ $smarty->assign('daysnames', $daysnames);
$smarty->assign('cell', $cell);
$smarty->assign('var', '');
$section = 'calendar';
include_once ('tiki-section_options.php');
$smarty->assign('mid', 'tiki-calendar.tpl');
$smarty->display("tiki.tpl");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment