Commit 03bcb37f authored by mose's avatar mose

removed the link beetween groups and calendars, it will be handled by the...

removed the link beetween groups and calendars, it will be handled by the permissions system (warning: db changed again)
parent c33420a8
......@@ -604,7 +604,6 @@ INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_edit
DROP TABLE IF EXISTS tiki_calendars;
CREATE TABLE tiki_calendars (
calendarId int(14) NOT NULL auto_increment,
groupname varchar(30) NOT NULL default '',
user varchar(40) NOT NULL default '',
name varchar(80) NOT NULL default '',
description varchar(255) default NULL,
......
......@@ -12,6 +12,7 @@ class CalendarLib extends TikiLib {
function list_calendars($offset=0,$maxRecords=-1,$sort_mode='created desc',$find='',$hide=1)
{
$res = array();
$vis = '';
$sort_mode = str_replace("_"," ",$sort_mode);
if ($find) {
......@@ -61,20 +62,20 @@ class CalendarLib extends TikiLib {
return $users;
}
function set_calendar($calendarId,$user,$group,$name,$description,$public,$visible)
function set_calendar($calendarId,$user,$name,$description,$public,$visible)
{
$name = addslashes(strip_tags($name));
$description = addslashes(strip_tags($description));
$now = time();
if ($calendarId > 0) {
// modification of a calendar
$query = "update tiki_calendars set name='$name', groupname='$group', description='$description', ";
$query = "update tiki_calendars set name='$name', user='$user', description='$description', ";
$query.= "lastmodif=$now, public='$public', visible='$visible' where calendarId=$calendarId";
$result = $this->query($query);
} else {
// create a new calendar
$query = "insert into tiki_calendars (name,groupname,description,created,lastmodif,public,visible) ";
$query.= "values ('$name','$group','$description',$now,$now,'$public','$visible')";
$query = "insert into tiki_calendars (name,user,description,created,lastmodif,public,visible) ";
$query.= "values ('$name','$user','$description',$now,$now,'$public','$visible')";
$result = $this->query($query);
$calendarId = mysql_insert_id();
}
......
......@@ -18,12 +18,6 @@
<option value='n' {if $visible eq 'n'}selected="selected"{/if}>{tr}no{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Group{/tr}:</td><td class="formcolor">
<select name="groupname">
{section name=ix loop=$groups}
<option value="{$groups[ix].groupName}" {if $groups[ix].groupName eq $groupname}selected="selected"{/if}>{$groups[ix].groupName}</option>
{/section}
</td></tr>
<tr><td class="formcolor">&nbsp;</td><td class="formcolor"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr>
</table>
</form>
......@@ -46,7 +40,6 @@
<tr>
<td class="heading"><a class="tableheading" href="tiki-admin_calendars.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'calendarId_desc'}calendarId_asc{else}calendarId_desc{/if}">{tr}ID{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-admin_calendars.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-admin_calendars.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'groupname_desc'}groupname_asc{else}groupname_desc{/if}">{tr}group{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-admin_calendars.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'public_desc'}public_asc{else}public_desc{/if}">{tr}public{/tr}</a></td>
<td class="heading"><a class="tableheading" href="tiki-admin_calendars.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'visible_desc'}visible_asc{else}visible_desc{/if}">{tr}visible{/tr}</a></td>
<td class="heading">{tr}action{/tr}</td>
......@@ -56,7 +49,6 @@
<tr>
<td class="{cycle advance=false}">{$calendars[cal].calendarId}</td>
<td class="{cycle advance=false}"><a class="tablename" href="tiki-calendar.php?calIds[]={$calendars[cal].calendarId}">{$calendars[cal].name}</a></td>
<td class="{cycle advance=false}">{$calendars[cal].groupname}</td>
<td class="{cycle advance=false}">{$calendars[cal].public}</td>
<td class="{cycle advance=false}">{$calendars[cal].visible}</td>
<td class="{cycle}">
......
......@@ -12,7 +12,16 @@ if($tiki_p_admin != 'y') {
if(!isset($_REQUEST["calendarId"])) {
$_REQUEST["calendarId"] = 0;
}
$smarty->assign('calendarId',$_REQUEST["calendarId"]);
if(isset($_REQUEST["drop"])) {
$calendarlib->drop_calendar($_REQUEST["drop"]);
$_REQUEST["calendarId"] = 0;
}
if(isset($_REQUEST["save"])) {
$_REQUEST["calendarId"] = $calendarlib->set_calendar($calendarId,$user,$_REQUEST["name"],$_REQUEST["description"],$_REQUEST["public"],$_REQUEST["visible"]);
}
if($_REQUEST["calendarId"]) {
......@@ -23,24 +32,14 @@ if($_REQUEST["calendarId"]) {
$info["description"]='';
$info["public"]='n';
$info["visible"]='y';
$info["groupname"]='';
$info["user"]="$user";
}
$smarty->assign('name',$info["name"]);
$smarty->assign('description',$info["description"]);
$smarty->assign('public',$info["public"]);
$smarty->assign('visible',$info["visible"]);
$smarty->assign('groupname',$info["groupname"]);
$smarty->assign('user',$info["user"]);
if(isset($_REQUEST["drop"])) {
$calendarlib->drop_calendar($_REQUEST["drop"]);
}
if(isset($_REQUEST["save"])) {
$calId = $calendarlib->set_calendar($calendarId,$user,$_REQUEST["groupname"],$_REQUEST["name"],$_REQUEST["description"],$_REQUEST["public"],$_REQUEST["visible"]);
}
$smarty->assign('calendarId',$_REQUEST["calendarId"]);
if(!isset($_REQUEST["sort_mode"])) {
$sort_mode = 'name_desc';
......@@ -62,9 +61,6 @@ $smarty->assign_by_ref('calendars',$calendars);
$groups = $userlib->get_groups();
$smarty->assign_by_ref('groups',$groups["data"]);
$cat_type='calendar';
$cat_objid = $_REQUEST["calendarId"];
include_once("categorize_list.php");
......
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