[Phpbbproject-svn] SF.net SVN: phpbbproject: [271] trunk
phpBB download manager, mainly aimed at MOD authors
Status: Planning
Brought to you by:
lord_le_brand
From: <lor...@us...> - 2008-04-26 10:41:47
|
Revision: 271 http://phpbbproject.svn.sourceforge.net/phpbbproject/?rev=271&view=rev Author: lord_le_brand Date: 2008-04-26 03:41:49 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/develop/create_schema_files_phpbb3.php trunk/develop/modules.txt trunk/develop/permissions.txt trunk/develop/roles.txt trunk/phpbb3/root/includes/project/project_main.php trunk/phpbb3/root/includes/project/project_project.php trunk/phpbb3/root/includes/sources_project/extensions.php trunk/phpbb3/root/project.php Added Paths: ----------- trunk/develop/todo_list.txt trunk/phpbb3/root/includes/project/project_trackers.php Modified: trunk/develop/create_schema_files_phpbb3.php =================================================================== --- trunk/develop/create_schema_files_phpbb3.php 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/develop/create_schema_files_phpbb3.php 2008-04-26 10:41:49 UTC (rev 271) @@ -845,7 +845,7 @@ 'category_description' => array('STEXT_UNI', ''), 'category_projects' => array('UINT:11', '0'), 'last_update_id' => array('UINT', '0'), - 'last_update_time' => array('UINT:11', '0'), + 'last_update_time' => array('TIMESTAMP', '0'), 'forum_id' => array('UINT', '0'), ), 'PRIMARY_KEY' => 'category_id', @@ -880,9 +880,9 @@ 'project_logo_type' => array('TINT:2', '0'), 'project_logo_width' => array('USINT', '0'), 'project_logo_height' => array('USINT', '0'), - 'project_start_time' => array('UINT:11', '0'), + 'project_start_time' => array('TIMESTAMP', '0'), 'project_owner' => array('UINT', '0'), - 'project_last_update' => array('UINT:11', '0'), + 'project_last_update' => array('TIMESTAMP', '0'), 'project_status' => array('BOOL', '0'), 'file_only' => array('BOOL', '0'), 'project_downloads' => array('UINT:11', '0'), @@ -904,7 +904,7 @@ 'version_id' => array('UINT:11', NULL, 'auto_increment'), 'project_id' => array('UINT', '0'), 'previous_id' => array('UINT:11', '0'), - 'version_time' => array('UINT:11', '0'), + 'version_time' => array('TIMESTAMP', '0'), 'version_major' => array('TINT:3', '0'), 'version_minor' => array('TINT:3', '0'), 'version_revision' => array('TINT:3', '0'), @@ -923,7 +923,7 @@ 'action_id' => array('UINT:11', '0'), 'project_id' => array('UINT', '0'), 'version_id' => array('UINT:11', '0'), - 'version_time' => array('UINT:11', '0'), + 'version_time' => array('TIMESTAMP', '0'), 'action_order' => array('USINT', '0'), 'action_file' => array('VCHAR', ''), 'action_type' => array('TINT:2', '0'), @@ -995,19 +995,19 @@ ) ); - // Entries per category/tracker, end-users - $schema_data['phpbb_project_tracker_entries'] = array( + // Tickets per category/tracker, end-users + $schema_data['phpbb_project_tracker_tickets'] = array( 'COLUMNS' => array( - 'entry_id' => array('UINT:11', NULL, 'auto_increment'), - 'tracker_id' => array('UINT:11', '0'), - 'tracker_category' => array('UINT:11', '0'), - 'entry_title' => array('XSTEXT_UNI', ''), - 'entry_description' => array('MTEXT_UNI', ''), - 'entry_status' => array('USINT', '0'), - 'entry_author' => array('UINT', '0'), - 'entry_time' => array('UINT:11', '0'), + 'ticket_id' => array('UINT:11', NULL, 'auto_increment'), + 'tracker_id' => array('UINT:11', '0'), + 'tracker_category' => array('UINT:11', '0'), + 'ticket_title' => array('XSTEXT_UNI', ''), + 'ticket_description' => array('MTEXT_UNI', ''), + 'ticket_status' => array('USINT', '0'), + 'ticket_author' => array('UINT', '0'), + 'ticket_time' => array('TIMESTAMP', '0'), ), - 'PRIMARY_KEY' => 'entry_id', + 'PRIMARY_KEY' => 'ticket_id', 'KEYS' => array( 'tracker_id' => array('INDEX', 'tracker_id'), 'tracker_category' => array('INDEX', 'tracker_category'), @@ -1059,9 +1059,9 @@ 'project_id' => array('UINT', '0'), 'document_title' => array('XSTEXT_UNI', ''), 'document_content' => array('MTEXT_UNI', ''), - 'document_added' => array('UINT:11', '0'), + 'document_added' => array('TIMESTAMP', '0'), 'document_added_by' => array('UINT', '0'), - 'document_edit_time' => array('UINT:11', '0'), + 'document_edit_time' => array('TIMESTAMP', '0'), 'document_edit_user' => array('UINT', '0'), 'document_edit_count' => array('USINT', '0'), 'enable_bbcode' => array('BOOL', '1'), Modified: trunk/develop/modules.txt =================================================================== --- trunk/develop/modules.txt 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/develop/modules.txt 2008-04-26 10:41:49 UTC (rev 271) @@ -17,7 +17,6 @@ Overview View cat {category_id} - [Statistics]* Create project {category_id:0} Import project Modified: trunk/develop/permissions.txt =================================================================== --- trunk/develop/permissions.txt 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/develop/permissions.txt 2008-04-26 10:41:49 UTC (rev 271) @@ -1,24 +1,36 @@ Permissions for phpBB Project: -Assigned by authors: (All local) +We're gonna have to make one or more new tables for permission masks. +This is because, apparently, the forum_id really isn't supposed to be used for something else. >_> +New auth methods: + +- acl_getp($opt, $clean = false) + Like acl_getf($opt, $clean = false) but for projects +- acl_getc($opt, $clean = false) + Like acl_getf($opt, $clean = false) but for categories + +Extend or modify most others (when I understand them all some more...) + +Assigned by authors (All per project): + - View the mod - Edit mod - Delete the mod - Download the mod - Add authors - Remove authors -- Assign roles to authors -- Assign permissions to authors +- Manage project roles and permissions - View docs - Manage docs Assigned by admin: - Create a mod (global) -- View category (local) // How -- Manage category (global) -- Manage roles (global) +- View category (per category) // How (<< What's this about??) +- Add MODs to category (per category) +- Manage categories (global) +- Manage roles/permissions (global) - Approve mod creation (global) Modified: trunk/develop/roles.txt =================================================================== --- trunk/develop/roles.txt 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/develop/roles.txt 2008-04-26 10:41:49 UTC (rev 271) @@ -36,6 +36,8 @@ - Team: + - View anything + - Edit parts of a project (Will have edit-history and mandatory reason field to avoid abuse) - Manage category - Manage roles - Approve mod creation Added: trunk/develop/todo_list.txt =================================================================== --- trunk/develop/todo_list.txt (rev 0) +++ trunk/develop/todo_list.txt 2008-04-26 10:41:49 UTC (rev 271) @@ -0,0 +1,31 @@ +Todo list for phpBB Project + +- Make a TODO tracker!!! +- When at it make a bug tracker and feature tracker :) +- Extend auth class and create new permission tables +- Change the way authors are tied to projects (acl_roles or new equivalent) +- Add /languages and /templates support to download (and import) class +- Author ordering in MOD(X) file/project overview page +- Definitive decision on storing versioned files +- Generate filetree more efficiently (download class) +- Expand validate_project_title() +- Decide on what information will go on view category module +- Target version information +- Decide on better module structure +- Modules: + - Import project + - Manage project + - Diff generator + - Docs (perhaps wiki-style?) + - Trackers script++ (also needed for this todo list, so step on it! xD) + - Projects Team CP (maybe a new *CP?) + - Marx + - Search +- Logo support +- License handler +- phpbb.com MOD database sender +- Add language entries +- Add text and options to installer +- Add links to header (and index?) +- Make modx file... -_-' +- Package & Release! ^_^ Modified: trunk/phpbb3/root/includes/project/project_main.php =================================================================== --- trunk/phpbb3/root/includes/project/project_main.php 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/phpbb3/root/includes/project/project_main.php 2008-04-26 10:41:49 UTC (rev 271) @@ -16,6 +16,8 @@ class project_main { public $u_action; + public $tpl_name; + public $page_title; /** * Main method @@ -31,6 +33,7 @@ if ($mode == 'import' || $mode == 'create_project') { + include("{$phpbb_root_path}includes/sources_project/functions_create.$phpEx"); include("{$phpbb_root_path}includes/sources_project/create_project.$phpEx"); } @@ -121,8 +124,11 @@ if (($mode == 'viewcat' && $category_info['right_id'] != ($category_info['left_id'] + 1)) || $mode != 'viewcat') { // There are categories here, so display them - $acl_categories = array_keys($auth->acl_getf('p_view_category', true)); - $category_ids = $db->sql_in_set('category_id', $acl_categories, false, true); + $acl_categories = array(); + $category_ids = '1 = 1'; + // Rewrite next line when auth class is extended + // $acl_categories = array_keys($auth->acl_getf('p_view_category', true)); + //$category_ids = $db->sql_in_set('category_id', $acl_categories, false, true); $sql = 'SELECT * FROM ' . PROJECT_CATEGORIES_TABLE . " Modified: trunk/phpbb3/root/includes/project/project_project.php =================================================================== --- trunk/phpbb3/root/includes/project/project_project.php 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/phpbb3/root/includes/project/project_project.php 2008-04-26 10:41:49 UTC (rev 271) @@ -17,6 +17,7 @@ { public $u_action; public $tpl_name; + public $page_title; /** * Main method Added: trunk/phpbb3/root/includes/project/project_trackers.php =================================================================== --- trunk/phpbb3/root/includes/project/project_trackers.php (rev 0) +++ trunk/phpbb3/root/includes/project/project_trackers.php 2008-04-26 10:41:49 UTC (rev 271) @@ -0,0 +1,127 @@ +<?php +/** + * phpBB Project + * + * @package phpbbproject + * @version $Id:$ + * @copyright (c) 2008 phpBB Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ + +/** + * Trackers module + * + * @package phpbbproject + */ +class project_tracker +{ + public $u_action; + public $tpl_name; + public $page_title; + + /** + * Main method + * + * @param string|integer $id + * @param string $mode + */ + function main($id, $mode) + { + global $db, $user, $template; + global $phpbb_root_path, $phpEx; + global $project_id, $category_id; + + switch ($mode) + { + default: + case 'overview': + + // Get trackers for this project + $sql = 'SELECT t.*, types.*, COUNT(tc.*) AS tracker_categories, COUNT(tickets.*) AS tracker_tickets + FROM ' . PROJECT_TRACKERS_TABLE . ' t, ' . PROJECT_TRACKER_TYPES_TABLE . ' types, ' . PROJECT_TRACKER_CATEGORIES_TABLE . ' tc, ' . PROJECT_TRACKER_ENTRIES_TABLE . " tickets + WHERE t.project_id = $project_id + AND types.tracker_type_id = t.tracker_type + AND tickets.tracker_id = t.tracker_id + AND tc.tracker_id = t.tracker_id + GROUP BY t.tracker_id + ORDER BY types.tracker_type_title ASC"; + + $result = $db->sql_query($sql, 604800); + $trackers = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + for ($i = 0, $size = sizeof($trackers); $i < $size; $i++) + { + $template->assign_block_vars('tracker_row', array( + 'TRACKER_TITLE' => $trackers[$i]['tracker_type_title'], + 'TRACKER_DESCRIPTION' => $trackers[$i]['tracker_type_description'], + 'TRACKER_TICKETS' => $trackers[$i]['tracker_tickets'], + 'TRACKER_CATEGORIES' => $trackers[$i]['tracker_categories'], + + 'U_TRACKER' => append_sid("{$phpbb_root_path}project.$phpEx", "i=trackers&mode=tickets&tid={$trackers[$i]['tracker_id']}"), + )); + } + + break; + + case 'tickets': + + $tracker_id = request_var('tid', 0); + $tracker_category = request_var('tcat', 0); + + // Just redirect if $tracker_id is 0 + if (!$tracker_id) + { + redirect(append_sid("{$phpbb_root_path}project.$phpEx", "i=trackers&mode=overview")); + } + + if ($tracker_category) + { + $sql = 'SELECT * + FROM ' . PROJECT_TRACKER_CATEGORIES_TABLE . " + WHERE category_id = $tracker_category"; + $result = $db->sql_query($sql, 604800); + $category_info = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($category_info['is_private'] && !$is_author) + { + // @todo some error... + } + + $template->assign_vars(array( + // @todo stuff... + )); + } + + $sql = 'SELECT t.*, c.*, s.* + FROM ' . PROJECT_TRACKER_TICKETS_TABLE . ' t, ' . PROJECT_TRACKER_CATEGORIES_TABLE . ' c, ' . PROJECT_TRACKER_STATUS_TABLE . " s + WHERE t.tracker_id = $tracker_id + " . (($tracker_category) ? "AND t.tracker_category = $tracker_category" : '') . ' + AND c.category_id = t.tracker_category + AND s.tracker_status_id = t.ticket_status + ' . ((!$is_author) ? 'AND c.is_private = 0' : '') . ' + ORDER BY ticket.ticket_time DESC'; + $result = $db->sql_query($sql, 604800); + $tickets = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); + + for ($i = 0, $size = sizeof($tickets); $i < $size; $i++) + { + $template->assign_block_vars('ticket_row', array( + 'TICKET_TITLE' => $tickets[$i]['ticket_title'], + 'CATEGORY_TITLE' => $tickets[$i]['category_title'], + 'TICKET_STATUS' => $tickets[$i]['tracker_status_title'], + 'TICKET_AUTHOR' => get_username_string('full', $tickets[$i]['ticket_author'], project_get_author_name($tickets[$i]['ticket_author'])), + 'TICKET_TIME' => $user->format_date($tickets[$i]['ticket_time']), + + 'U_VIEW_TICKET' => append_sid("{$phpbb_root_path}project.$phpEx", "i=trackers&view_ticket&tid=$tracker_id&ticket={$trackers[$i]['ticket_id']}"), + )); + } + + break; + } + } +} + +?> \ No newline at end of file Property changes on: trunk/phpbb3/root/includes/project/project_trackers.php ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Modified: trunk/phpbb3/root/includes/sources_project/extensions.php =================================================================== --- trunk/phpbb3/root/includes/sources_project/extensions.php 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/phpbb3/root/includes/sources_project/extensions.php 2008-04-26 10:41:49 UTC (rev 271) @@ -15,7 +15,7 @@ */ class project_auth extends auth { - // I don't know why though :P + // Do stuff with extra tables... } /** Modified: trunk/phpbb3/root/project.php =================================================================== --- trunk/phpbb3/root/project.php 2008-04-24 15:16:16 UTC (rev 270) +++ trunk/phpbb3/root/project.php 2008-04-26 10:41:49 UTC (rev 271) @@ -64,6 +64,17 @@ if ($project_id) { $module->acl_project_id = $project_id; + + // Or do we want to overwrite it? + if (!$category_id) + { + $sql = 'SELECT category_id + FROM ' . PROJECT_PROJECTS_TABLE . " + WHERE project_id = $project_id"; + $result = $db->sql_query($sql, 604800); + $category_id = (int) $db->sql_fetchfield('category_id', false, $result); + $db->sql_freeresult($result); + } } if ($category_id) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |