Thread: [CS-Project-svn_notify] SF.net SVN: cs-project: [800] trunk/1.2/includes
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-07 07:10:07
|
Revision: 800 http://cs-project.svn.sourceforge.net/cs-project/?rev=800&view=rev Author: crazedsanity Date: 2008-02-06 23:10:01 -0800 (Wed, 06 Feb 2008) Log Message: ----------- Add special link for admin, clean code for doing admin/non-admin settings. Modified Paths: -------------- trunk/1.2/includes/content/settings.inc trunk/1.2/includes/content.inc Modified: trunk/1.2/includes/content/settings.inc =================================================================== --- trunk/1.2/includes/content/settings.inc 2008-02-07 07:00:16 UTC (rev 799) +++ trunk/1.2/includes/content/settings.inc 2008-02-07 07:10:01 UTC (rev 800) @@ -128,49 +128,7 @@ $x = $page->set_all_block_rows("content"); - //show 'em their preferences. - $allPrefs = $prefObj->list_all_prefs(); - $userPrefs = $prefObj->get_user_prefs(); - if(is_array($allPrefs)) { - $rowColor = "#D3D3D3"; - foreach($allPrefs as $index=>$data) { - $myOptions = $data['optionList']; - - //TODO: fix this... it's sloppy. - $myOptionList = array(); - $optionListRepArr = array(); - foreach($data['optionList'] as $x=>$y) { - $tKey = $y['pref_option_id']; - $tVal = $y['name']; - $myOptionList[$tKey] = $tVal; - - $optionListRepArr[$tKey] = $y; - } - - unset($data['optionList'], $data['optionList']); - - $checkThis = NULL; - if(strlen($userPrefs[$data['pref_type_id']])) { - $checkThis = $userPrefs[$data['pref_type_id']]; - $data['currentSetting'] = $myOptionList[$checkThis]; - } - else { - $data['currentSetting'] = '<font color="red"><b>Select something!</b></font>'; - } - - $data['row_optionList'] = array_as_option_list( - $myOptionList, $checkThis, 'select', $page->templateRows['pref_optionList'], $optionListRepArr - ); - - $rowColor = swapValue($rowColor, '#D3D3D3', '#C3C3C3'); - $data['rowColor'] = $rowColor; - - $prefRow .= mini_parser($page->templateRows['pref_row'], $data, '%%', '%%'); - } - $page->add_template_var('pref_row', $prefRow); - } - if(count($page->ftsSections) == 3 && $page->ftsSections[2] == 'admin') { if($user->is_admin() == 1) { //add the template to show various admin stuff. @@ -206,6 +164,50 @@ $page->set_message_wrapper($msg); } } + else { + //show 'em their preferences. + $allPrefs = $prefObj->list_all_prefs(); + $userPrefs = $prefObj->get_user_prefs(); + + if(is_array($allPrefs)) { + $rowColor = "#D3D3D3"; + foreach($allPrefs as $index=>$data) { + $myOptions = $data['optionList']; + + //TODO: fix this... it's sloppy. + $myOptionList = array(); + $optionListRepArr = array(); + foreach($data['optionList'] as $x=>$y) { + $tKey = $y['pref_option_id']; + $tVal = $y['name']; + $myOptionList[$tKey] = $tVal; + + $optionListRepArr[$tKey] = $y; + } + + unset($data['optionList'], $data['optionList']); + + $checkThis = NULL; + if(strlen($userPrefs[$data['pref_type_id']])) { + $checkThis = $userPrefs[$data['pref_type_id']]; + $data['currentSetting'] = $myOptionList[$checkThis]; + } + else { + $data['currentSetting'] = '<font color="red"><b>Select something!</b></font>'; + } + + $data['row_optionList'] = array_as_option_list( + $myOptionList, $checkThis, 'select', $page->templateRows['pref_optionList'], $optionListRepArr + ); + + $rowColor = swapValue($rowColor, '#D3D3D3', '#C3C3C3'); + $data['rowColor'] = $rowColor; + + $prefRow .= mini_parser($page->templateRows['pref_row'], $data, '%%', '%%'); + } + $page->add_template_var('pref_row', $prefRow); + } + } } Modified: trunk/1.2/includes/content.inc =================================================================== --- trunk/1.2/includes/content.inc 2008-02-07 07:00:16 UTC (rev 799) +++ trunk/1.2/includes/content.inc 2008-02-07 07:10:01 UTC (rev 800) @@ -133,7 +133,7 @@ ); if($user->is_admin()) { - $tabNames['settings'] = "Settings<BR>\n<b>[Admin]</b>"; + $tabNames['settings'] = "Settings</a><BR>\n<a href=\"/content/settings/admin\"><b>[Admin]</b>"; } #$page->add_template_var('tabs', $page->file_to_string('tabs.shared.tmpl')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-04-09 03:11:49
|
Revision: 873 http://cs-project.svn.sourceforge.net/cs-project/?rev=873&view=rev Author: crazedsanity Date: 2008-04-08 20:11:47 -0700 (Tue, 08 Apr 2008) Log Message: ----------- More renaming of "todo" to "task" (issue #151) Modified Paths: -------------- trunk/1.2/includes/content/helpdesk.inc trunk/1.2/includes/content/project.inc trunk/1.2/includes/content/shared.inc trunk/1.2/includes/setup/3.inc Modified: trunk/1.2/includes/content/helpdesk.inc =================================================================== --- trunk/1.2/includes/content/helpdesk.inc 2008-04-09 03:06:56 UTC (rev 872) +++ trunk/1.2/includes/content/helpdesk.inc 2008-04-09 03:11:47 UTC (rev 873) @@ -349,10 +349,10 @@ //now, rip all block rows that don't need to be there... $page->set_all_block_rows("content", $doNotRipRows); - $todoData = $proj->helpdeskObj->get_todos($helpdeskId); - $page->set_all_block_rows('related_todo'); - if(is_array($todoData)) { - parse_related_todo($todoData); + $taskData = $proj->helpdeskObj->get_tasks($helpdeskId); + $page->set_all_block_rows('related_task'); + if(is_array($taskData)) { + parse_related_task($taskData); } Modified: trunk/1.2/includes/content/project.inc =================================================================== --- trunk/1.2/includes/content/project.inc 2008-04-09 03:06:56 UTC (rev 872) +++ trunk/1.2/includes/content/project.inc 2008-04-09 03:11:47 UTC (rev 873) @@ -232,7 +232,7 @@ create_page_title($page, array('title' => "Project #". $_GET['ID'] .": \"". $detailsArr['name'] ."\"")); $page->add_template_var("note_readonly", "readonly"); $page->set_all_block_rows("content", array("related", "new_subproject_link", "status_section", "note_show")); - $page->set_all_block_rows("related_todo"); + $page->set_all_block_rows("related_task"); $page->set_all_block_rows("related_note"); $page->set_all_block_rows("related_issue"); @@ -305,11 +305,11 @@ unset($userList,$tSelected,$userListArr, $selLeader, $leaderSelect); //pull a couple of preferences, so we can say if they're getting the whole picture or not. - $todoPref = $proj->prefObj->get_pref_value_by_name('projectDetails_todoDisplayOnlyMine'); + $taskPref = $proj->prefObj->get_pref_value_by_name('projectDetails_taskDisplayOnlyMine'); $helpdeskPref = $proj->prefObj->get_pref_value_by_name('projectDetails_showCompletedIssues'); - if($todoPref !== 'all') { - $page->add_template_var("todoPrefWarning", $page->templateRows['todoPrefWarning']); + if($taskPref !== 'all') { + $page->add_template_var("taskPrefWarning", $page->templateRows['taskPrefWarning']); } if($helpdeskPref == 0) { @@ -317,10 +317,10 @@ } //SPECIAL PROCESSING FOR TODO's... - if(is_array($detailsArr['related']['todo'])) { - parse_related_todo($detailsArr['related']['todo']); + if(is_array($detailsArr['related']['task'])) { + parse_related_task($detailsArr['related']['task']); } - unset($detailsArr['related']['todo']); + unset($detailsArr['related']['task']); //parse-in everything under "related"... foreach($detailsArr['related'] as $type => $subArr) { @@ -352,7 +352,7 @@ } $repArr['font_weight'] = 'normal'; } - elseif($type == "todo") { + elseif($type == "task") { $changeFontColor=TRUE; //Making TODO stuff look purdy. Boy. if(!preg_match('/accepted/', strtolower($arr['status_text']))) { Modified: trunk/1.2/includes/content/shared.inc =================================================================== --- trunk/1.2/includes/content/shared.inc 2008-04-09 03:06:56 UTC (rev 872) +++ trunk/1.2/includes/content/shared.inc 2008-04-09 03:11:47 UTC (rev 873) @@ -55,12 +55,12 @@ $page->add_template_var('XAJAX_HEADERS', $xajaxHeaders); }//end addAjax() -function parse_related_todo(array $parseData) { +function parse_related_task(array $parseData) { $page = $GLOBALS['objects']['page']; $bgColor = NULL; $bgColor2 = NULL; - $rowName = 'related_todo_row'; + $rowName = 'related_task_row'; $baseRow = $page->templateRows[$rowName]; foreach($parseData as $id=>$arr) { @@ -136,7 +136,7 @@ $myRow .= mini_parser($baseRow, $repArr, "%%", "%%"); } $page->add_template_var($rowName, $myRow); -}//end parse_related_todo() +}//end parse_related_task() Modified: trunk/1.2/includes/setup/3.inc =================================================================== --- trunk/1.2/includes/setup/3.inc 2008-04-09 03:06:56 UTC (rev 872) +++ trunk/1.2/includes/setup/3.inc 2008-04-09 03:11:47 UTC (rev 873) @@ -476,7 +476,7 @@ // {record_type_id} => array({name}, {module}) $recordTypes = array( 1 => array('Project', 'project'), - 2 => array('Todo', 'todo'), + 2 => array('Todo', 'task'), 3 => array('Helpdesk', 'helpdesk') ); @@ -822,7 +822,7 @@ 1 => array('startModule', 'helpdesk', 'Starting on Module', 'Defines which section will be loaded upon login if nothing was selected.'), 5 => array('sorting_helpdesk', 'public_id|DESC', 'Helpdesk Sorting', 'Define the type of sorting for the helpdesk page.'), 6 => array('sorting_project', 'priority|ASC', 'Project Sorting', 'Define the type of sorting for the helpdesk page.'), - 7 => array('projectDetails_todoDisplayOnlyMine', 'all', 'Project Details: Todo display', 'Define what todos are displayed on a project\'s details page.'), + 7 => array('projectDetails_taskDisplayOnlyMine', 'all', 'Project Details: Todo display', 'Define what tasks are displayed on a project\'s details page.'), 8 => array('projectDetails_showCompletedIssues', '1', 'Project Details: Display completed issues', 'Should completed issues display in the details of a project?') ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |