From: <ax...@us...> - 2009-09-30 14:23:55
|
Revision: 21909 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=21909&view=rev Author: axold Date: 2009-09-30 14:23:37 +0000 (Wed, 30 Sep 2009) Log Message: ----------- [MOD] Fixed some ws perms in sql files Modified Paths: -------------- trunk/db/tiki-4.0-mysql.sql trunk/db/tiki-4.0-mysqli.sql trunk/db/tiki-4.0-pgsql.sql trunk/db/tiki-4.0-sqlite.sql trunk/db/tiki.sql trunk/lib/perspectivelib.php trunk/templates/tiki-adminusers.tpl trunk/templates/tiki-my-workspaces.tpl trunk/tiki-my-workspaces.php trunk/tiki-switch_perspective.php Modified: trunk/db/tiki-4.0-mysql.sql =================================================================== --- trunk/db/tiki-4.0-mysql.sql 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/db/tiki-4.0-mysql.sql 2009-09-30 14:23:37 UTC (rev 21909) @@ -2848,6 +2848,13 @@ INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_group_join', 'Can join or leave the group', 'admin', 'group', NULL, NULL); INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_trigger_transition', 'Can trigger the transition between two states', 'admin', 'transition', NULL, 'feature_group_transition,feature_category_transition'); +INSERT INTO users_permissions (permName, permDesc, level, type, admin) VALUES ('tiki_p_ws_admin', 'Can admin all ws', 'globaladmin', 'ws', 'y'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_addws', 'Can add ws', 'globaladmin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_removews', 'Can remove ws', 'globaladmin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_adminws', 'Can admin a single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_adminresources', 'Can admin resources into single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_admingroups', 'Can admin groups in a single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_view', 'Can view a single ws', 'registered', 'ws'); Modified: trunk/db/tiki-4.0-mysqli.sql =================================================================== --- trunk/db/tiki-4.0-mysqli.sql 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/db/tiki-4.0-mysqli.sql 2009-09-30 14:23:37 UTC (rev 21909) @@ -2848,6 +2848,13 @@ INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_group_join', 'Can join or leave the group', 'admin', 'group', NULL, NULL); INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_trigger_transition', 'Can trigger the transition between two states', 'admin', 'transition', NULL, 'feature_group_transition,feature_category_transition'); +INSERT INTO users_permissions (permName, permDesc, level, type, admin) VALUES ('tiki_p_ws_admin', 'Can admin all ws', 'globaladmin', 'ws', 'y'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_addws', 'Can add ws', 'globaladmin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_removews', 'Can remove ws', 'globaladmin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_adminws', 'Can admin a single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_adminresources', 'Can admin resources into single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_admingroups', 'Can admin groups in a single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_view', 'Can view a single ws', 'registered', 'ws'); Modified: trunk/db/tiki-4.0-pgsql.sql =================================================================== --- trunk/db/tiki-4.0-pgsql.sql 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/db/tiki-4.0-pgsql.sql 2009-09-30 14:23:37 UTC (rev 21909) @@ -3614,9 +3614,23 @@ INSERT INTO "users_permissions" ("permName","permDesc","level","type","admin","feature_check") VALUES ('tiki_p_trigger_transition', 'Can trigger the transition between two states', 'admin', 'transition', NULL, 'feature_group_transition,feature_category_transition'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type","admin") VALUES ('tiki_p_ws_admin', 'Can admin all ws', 'globaladmin', 'ws', 'y'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_addws', 'Can add ws', 'globaladmin', 'ws'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_removews', 'Can remove ws', 'globaladmin', 'ws'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_adminws', 'Can admin a single ws', 'admin', 'ws'); + +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_adminresources', 'Can admin resources into single ws', 'admin', 'ws'); + +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_admingroups', 'Can admin groups in a single ws', 'admin', 'ws'); + +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_view', 'Can view a single ws', 'registered', 'ws'); + + + + DROP TABLE IF EXISTS "users_usergroups"; CREATE TABLE "users_usergroups" ( Modified: trunk/db/tiki-4.0-sqlite.sql =================================================================== --- trunk/db/tiki-4.0-sqlite.sql 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/db/tiki-4.0-sqlite.sql 2009-09-30 14:23:37 UTC (rev 21909) @@ -3626,9 +3626,23 @@ INSERT INTO "," ("permName","permDesc","level","type","admin","feature_check") VALUES ('tiki_p_trigger_transition', 'Can trigger the transition between two states', 'admin', 'transition', NULL, 'feature_group_transition,feature_category_transition'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type","admin") VALUES ('tiki_p_ws_admin', 'Can admin all ws', 'globaladmin', 'ws', 'y'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_addws', 'Can add ws', 'globaladmin', 'ws'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_removews', 'Can remove ws', 'globaladmin', 'ws'); +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_adminws', 'Can admin a single ws', 'admin', 'ws'); + +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_adminresources', 'Can admin resources into single ws', 'admin', 'ws'); + +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_admingroups', 'Can admin groups in a single ws', 'admin', 'ws'); + +INSERT INTO "users_permissions" ("permName","permDesc","level","type") VALUES ('tiki_p_ws_view', 'Can view a single ws', 'registered', 'ws'); + + + + DROP TABLE IF EXISTS 'users_usergroups'; CREATE TABLE users_usergroups ( Modified: trunk/db/tiki.sql =================================================================== --- trunk/db/tiki.sql 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/db/tiki.sql 2009-09-30 14:23:37 UTC (rev 21909) @@ -2848,6 +2848,13 @@ INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_group_join', 'Can join or leave the group', 'admin', 'group', NULL, NULL); INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_trigger_transition', 'Can trigger the transition between two states', 'admin', 'transition', NULL, 'feature_group_transition,feature_category_transition'); +INSERT INTO users_permissions (permName, permDesc, level, type, admin) VALUES ('tiki_p_ws_admin', 'Can admin all ws', 'globaladmin', 'ws', 'y'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_addws', 'Can add ws', 'globaladmin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_removews', 'Can remove ws', 'globaladmin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_adminws', 'Can admin a single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_adminresources', 'Can admin resources into single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_admingroups', 'Can admin groups in a single ws', 'admin', 'ws'); +INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_ws_view', 'Can view a single ws', 'registered', 'ws'); Modified: trunk/lib/perspectivelib.php =================================================================== --- trunk/lib/perspectivelib.php 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/lib/perspectivelib.php 2009-09-30 14:23:37 UTC (rev 21909) @@ -90,9 +90,9 @@ function get_perspectives_with_given_name ( $name ) { $db = TikiDb::get(); - $list = $db->query( "SELECT perspectiveId, name FROM tiki_perspectives WHERE name = ?", array ( $name ) ); + $list = $db->getOne( "SELECT perspectiveId FROM tiki_perspectives WHERE name = ?", array ( $name ) ); - $list = Perms::filter( array ( 'type' => 'perspective'), 'object', $list, array( 'object' => 'perspectiveId' ), 'perspective_view' ); + //$list = Perms::filter( array ( 'type' => 'perspective'), 'object', $list, array( 'object' => 'perspectiveId' ), 'perspective_view' ); return $list; } Modified: trunk/templates/tiki-adminusers.tpl =================================================================== --- trunk/templates/tiki-adminusers.tpl 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/templates/tiki-adminusers.tpl 2009-09-30 14:23:37 UTC (rev 21909) @@ -375,7 +375,7 @@ </td> </tr> <tr class="formcolor"> - <td><label for="pass2">{tr}Repeat Password{/tr}:</lael></td> + <td><label for="pass2">{tr}Repeat Password{/tr}:</label></td> <td><input type="password" name="pass2" id="pass2" /></td> </tr> {if $userinfo.login neq 'admin'} Modified: trunk/templates/tiki-my-workspaces.tpl =================================================================== --- trunk/templates/tiki-my-workspaces.tpl 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/templates/tiki-my-workspaces.tpl 2009-09-30 14:23:37 UTC (rev 21909) @@ -1,18 +1,21 @@ -<h1>{tr}My Workspaces{/tr}</h1> +<h1>{$title}</h1> -{if not empty($listWS) } +{if $viewWS } + <a href="./tiki-my-workspaces.php" title="Back to My Workspaces" class="button">Back</a> + <a href="./tiki-switch_perspective.php?perspective={$switchPsp}" title="Enter in this Workspace" class="button">Enter in this Workspace</a> +{else} + {if not empty($listWS) } + <a href="./tiki-switch_perspective.php?perspective=0" title="Return to Tiki" class="button">Set Tiki as its normal status</a> <table class = admin> <tr> <th>{tr}Name{/tr}</th> <th>{tr}Description{/tr}</th> - <th>{tr}Path{/tr}</th> </tr> {cycle print=false values="even,odd"} {foreach from=$listWS item=data} <tr class="{cycle}"> - <td><a href="tiki-my-workspaces.php?showWS={$data.ws_id}" title="{$data.name}" >{$data.name}</a></td> - <td>{$data.description}</td> - <td>{$data.wspath}</td> + <td><a href="tiki-my-workspaces.php?viewWS={$data.categId}" title="{$data.name}" >{$data.name}</a></td> + <td>{$data.description}</td> </tr> {/foreach} </table> @@ -23,6 +26,7 @@ {if not empty($next_page)} <a class="button" href = {$next_page}>{tr}Next{/tr}</a> {/if} -{else} -{tr}You do not belong to any workspace.{/tr} + {else} + {tr}You do not belong to any workspace.{/tr} + {/if} {/if} Modified: trunk/tiki-my-workspaces.php =================================================================== --- trunk/tiki-my-workspaces.php 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/tiki-my-workspaces.php 2009-09-30 14:23:37 UTC (rev 21909) @@ -11,25 +11,43 @@ $maxRecord = $_REQUEST['maxRecord']; $offset = $_REQUEST['offset']; -// List the objects that the user has access within the WS -$listWS = $wslib->list_ws_that_user_have_access ($user, $maxRecord, $offset); -$smarty->assign('listWS',$listWS); -$numWSUser = $wslib->count_ws ($user); +if (!empty($_REQUEST['viewWS'])) +{ + $smarty->assign('viewWS', true); -if ($offset > 0) -{ - $offset_prev = (int) $offset - (int) $maxRecord; - $href_prev = "tiki-my-workspaces.php?maxRecord=".$maxRecord."&offset=".$offset_prev; + $ws = $wslib->get_ws_name($_REQUEST['viewWS']); + + $smarty->assign('title','Current Workspace: '. $ws); + + $id = $wslib->get_ws_associated_perspective_id($_REQUEST['viewWS']); + + var_dump($id); + + $smarty->assign('switchPsp', $id); } -if (((int) $offset + (int) $maxRecord) <= (int) $numWSUser) +else { - $offset_next = (int) $offset + (int) $maxRecord; - $href_next = "tiki-my-workspaces.php?maxRecord=".$maxRecord."&offset=".$offset_next; + $smarty->assign('title', 'My Workspaces'); + // List the objects that the user has access within the WS + $listWS = $wslib->list_ws_that_user_have_access ($user, $maxRecord, $offset); + $smarty->assign('listWS',$listWS); + $numWSUser = $wslib->count_ws ($user); } -$smarty->assign('prev_page',$href_prev); -$smarty->assign('next_page',$href_next); +//if ($offset > 0) +//{ + //$offset_prev = (int) $offset - (int) $maxRecord; + //$href_prev = "tiki-my-workspaces.php?maxRecord=".$maxRecord."&offset=".$offset_prev; +//} +//if (((int) $offset + (int) $maxRecord) <= (int) $numWSUser) +//{ + //$offset_next = (int) $offset + (int) $maxRecord; + //$href_next = "tiki-my-workspaces.php?maxRecord=".$maxRecord."&offset=".$offset_next; +//} +//$smarty->assign('prev_page',$href_prev); +//$smarty->assign('next_page',$href_next); + $smarty->assign('mid', 'tiki-my-workspaces.tpl'); $smarty->display('tiki.tpl'); ?> Modified: trunk/tiki-switch_perspective.php =================================================================== --- trunk/tiki-switch_perspective.php 2009-09-30 13:30:18 UTC (rev 21908) +++ trunk/tiki-switch_perspective.php 2009-09-30 14:23:37 UTC (rev 21909) @@ -11,7 +11,7 @@ if( isset($_REQUEST['perspective']) ) { $perspective = $_REQUEST['perspective']; - if( $perspectivelib->perspective_exists( $perspective ) ) { + if( $a = $perspectivelib->perspective_exists( $perspective ) ) { $_SESSION['current_perspective'] = $perspective; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |