Thread: [CS-Project-svn_notify] SF.net SVN: cs-project: [771] trunk (Page 2)
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-01 05:29:56
|
Revision: 771 http://cs-project.svn.sourceforge.net/cs-project/?rev=771&view=rev Author: crazedsanity Date: 2008-01-31 21:29:53 -0800 (Thu, 31 Jan 2008) Log Message: ----------- Fix to allow note creation, remove some unneeded code. Modified Paths: -------------- trunk/includes/content/notes.inc trunk/templates/content/notes/view.content.tmpl Added Paths: ----------- trunk/templates/content/notes/create.content.tmpl Modified: trunk/includes/content/notes.inc =================================================================== --- trunk/includes/content/notes.inc 2008-02-01 05:15:24 UTC (rev 770) +++ trunk/includes/content/notes.inc 2008-02-01 05:29:53 UTC (rev 771) @@ -2,10 +2,10 @@ /* * SVN INFORMATION::: * ------------------ - * Last Author: $Author$ - * Current Revision: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated: $Date$ + * Last Author: $Author:crazedsanity $ + * Current Revision: $Revision:637 $ + * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/notes.inc $ + * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ */ if($_POST) { @@ -105,7 +105,6 @@ exit; } else { - $page->rip_all_block_rows('content', array('owner_options')); $projectData = $proj->get_details($projectId, FALSE); if(is_array($projectData)) { Copied: trunk/templates/content/notes/create.content.tmpl (from rev 765, trunk/templates/content/notes/view.content.tmpl) =================================================================== --- trunk/templates/content/notes/create.content.tmpl (rev 0) +++ trunk/templates/content/notes/create.content.tmpl 2008-02-01 05:29:53 UTC (rev 771) @@ -0,0 +1,35 @@ +<form action='' method='POST'> +<input type="hidden" name="note_id" value={note_id}> +<input type="hidden" name="module" value="notes"> + +<table border=0 cellpadding=0 cellspacing=0><tr><td> +<table border=0 bgcolor=#D5D5D5> +<tr> + <td><a href="javascript:void();"><b>Notes</b></a></td> + +<tr> + <td></td> +</tr> +<tr> + <td colspan=2>Title:<input type='text' name='updates[subject]' size='92' value="{note_subject}" {note_name_readonly}></td> +</tr> +<tr> + <td> + <textarea rows=20 cols=95 name="updates[body]" wrap=physical>{note_body}</textarea> + </td> +<tr> +</table> + +<table align="center"> +<tr> + <td align="center"> + <input type="HIDDEN" name="updates[record_id]" value="{record_id}"> + <input type="submit" name="{submit_name}" value="{submit_value}"> + </td> +</tr> +<tr> + <td align="center"><a href='{goBackLink}'><b>GO BACK</b></a></td> +</tr> +</table> + +</td></tr></table> Modified: trunk/templates/content/notes/view.content.tmpl =================================================================== --- trunk/templates/content/notes/view.content.tmpl 2008-02-01 05:15:24 UTC (rev 770) +++ trunk/templates/content/notes/view.content.tmpl 2008-02-01 05:29:53 UTC (rev 771) @@ -2,44 +2,20 @@ <input type="hidden" name="note_id" value={note_id}> <input type="hidden" name="module" value="notes"> -<table border=0 cellpadding=0 cellspacing=0><tr><td> -<table border=0 bgcolor=#D5D5D5> +<table border=0 bgcolor=#D5D5D5 width="50%"> <tr> <td><a href="javascript:void();"><b>Notes</b></a></td> <tr> <td></td> </tr> -<!-- BEGIN nonowner_options --> <tr> <td style="border-bottom:solid #000 1px;">Title: <b>{note_subject}</b></td> </tr> <tr> - <td><div>{note_body}</div></td> + <td style="border-bottom:solid #000 1px;"><div>{note_body}</div></td> </tr> -<!-- END nonowner_options --> -<!-- BEGIN owner_options --> <tr> - <td colspan=2>Title:<input type='text' name='updates[subject]' size='92' value="{note_subject}" {note_name_readonly}></td> -</tr> -<tr> - <td> - <textarea rows=20 cols=95 name="updates[body]" wrap=physical>{note_body}</textarea> - </td> -<tr> -</table> - -<table align="center"> -<tr> - <td align="center"> - <input type="HIDDEN" name="updates[record_id]" value="{record_id}"> - <input type="submit" name="{submit_name}" value="{submit_value}"> - </td> -</tr> -<!-- END owner_options --> -<tr> <td align="center"><a href='{goBackLink}'><b>GO BACK</b></a></td> </tr> </table> - -</td></tr></table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-01 07:46:28
|
Revision: 773 http://cs-project.svn.sourceforge.net/cs-project/?rev=773&view=rev Author: crazedsanity Date: 2008-01-31 23:46:26 -0800 (Thu, 31 Jan 2008) Log Message: ----------- Add todo's to helpdesk issues. AFFECTS ISSUE::: #14: Tasks for Helpdesk Issues /includes/content/helpdesk.inc: * use new function for parsing related todos, if available. /includes/content/project.inc: * use new function for parsing related todos, if available. * remove "todo" index from related items array. /includes/content/shared.inc: * parse_related_todo() [NEW]: -- copied from project.inc -- should be easy to port into something useful for ajax calls. /includes/content/todo.inc: * deal with retrieving helpdesk vs. project details. * NOTE: the array name is a bit misleading ($projectDetails) /lib/helpdeskClass.php: * get_todos() [NEW]: -- copied from projectClass::get_todos() -- used to retrieve related todo records. /templates/content/related_todo.shared.tmpl: * create link now contains module variable. /templates/content/helpdesk/view.content.tmpl: * section to display related_todo records. Modified Paths: -------------- trunk/includes/content/helpdesk.inc trunk/includes/content/project.inc trunk/includes/content/shared.inc trunk/includes/content/todo.inc trunk/lib/helpdeskClass.php trunk/templates/content/helpdesk/view.content.tmpl trunk/templates/content/related_todo.shared.tmpl Modified: trunk/includes/content/helpdesk.inc =================================================================== --- trunk/includes/content/helpdesk.inc 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/includes/content/helpdesk.inc 2008-02-01 07:46:26 UTC (rev 773) @@ -349,8 +349,14 @@ //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); + } + $useTextTags = FALSE; if($helpdeskData['status_id'] == 4) { $useTextTags = TRUE; Modified: trunk/includes/content/project.inc =================================================================== --- trunk/includes/content/project.inc 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/includes/content/project.inc 2008-02-01 07:46:26 UTC (rev 773) @@ -316,6 +316,12 @@ $page->add_template_var("helpdeskPrefWarning", $page->templateRows['helpdeskPrefWarning']); } + //SPECIAL PROCESSING FOR TODO's... + if(is_array($detailsArr['related']['todo'])) { + parse_related_todo($detailsArr['related']['todo']); + } + unset($detailsArr['related']['todo']); + //parse-in everything under "related"... foreach($detailsArr['related'] as $type => $subArr) { $rowName = "related_". $type ."_row"; Modified: trunk/includes/content/shared.inc =================================================================== --- trunk/includes/content/shared.inc 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/includes/content/shared.inc 2008-02-01 07:46:26 UTC (rev 773) @@ -54,4 +54,89 @@ $page->add_template_var('XAJAX_HEADERS', $xajaxHeaders); }//end addAjax() +function parse_related_todo(array $parseData) { + $page = $GLOBALS['objects']['page']; + $bgColor = NULL; + $bgColor2 = NULL; + + $rowName = 'related_todo_row'; + $baseRow = $page->templateRows[$rowName]; + + foreach($parseData as $id=>$arr) { + swapValue($bgColor, "rgb(213, 213, 213)", "rgb(194, 194, 194)"); + swapValue($bgColor2, "#d5d5d5", "#c2c2c2"); + $repArr = array( + "id" => $id, + "bgColor" => $bgColor, + "bgColor2" => $bgColor2 + ); + $changeFontColor=TRUE; + //Making TODO stuff look purdy. Boy. + if(!preg_match('/accepted/', strtolower($arr['status_text']))) { + $repArr['bgColor'] = "e0e0e0"; + $repArr['bgColor2'] = "e0e0e0"; + } + + //Add dashes to fields that don't have any information in them. + if(strlen($arr['deadline']) <6) { + $changeFontColor = FALSE; + $arr['deadline'] = "————"; + } + if(strlen($arr['begin_date']) <6) { + $changeFontColor = FALSE; + $arr['begin_date'] = "————"; + } + if(strlen($arr['assigned_user']) == 0) { + //put some dashes in if nobody is assigned. + $arr['assigned_user'] = "——"; + } + + //cross-out all items that are ended. + if(preg_match('/ended/', strtolower($arr['status_text']))) { + $changeFontColor = FALSE; + $strikeThroughArr = array( + "creator", "creator", "assigned", "status_text", "remark", "begin_date", "deadline" + ); + foreach($strikeThroughArr as $myField) { + $arr[$myField] = '<del> '. $arr[$myField] .' </del>'; + } + unset($strikeThroughArr); + } + + if(strlen($arr['deadline']) && preg_match('/ended/', strtolower($arr['status_text']))) { + //make the deadline look nice. + $today = date("Ymd"); + $myDeadline = str_replace("-", "", $arr['deadline']); + settype($myDeadline, "int"); + settype($today, "int"); + + if(!$changeFontColor) { + //do nothing. + } + elseif($myDeadline <= $today) { + $arr['deadline'] = '<font color="red"><b>'. $arr['deadline'] .'</b></font>'; + } + else { + $arr['deadline'] = '<font color="green">'. $arr['deadline'] .'</font>'; + } + } + + if($arr['status_id'] == 2) { + $repArr['font_weight'] = "bold"; + } + else { + $repArr['font_weight'] = "normal"; + } + + //put every item in our array into the replacement array. + foreach($arr as $x=>$y) { + $repArr[$x] = $y; + } + $myRow .= mini_parser($baseRow, $repArr, "%%", "%%"); + } + $page->add_template_var($rowName, $myRow); +}//end parse_related_todo() + + + ?> Modified: trunk/includes/content/todo.inc =================================================================== --- trunk/includes/content/todo.inc 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/includes/content/todo.inc 2008-02-01 07:46:26 UTC (rev 773) @@ -2,10 +2,10 @@ /* * SVN INFORMATION::: * ------------------ - * Last Author: $Author$ - * Current Revision: $Revision$ - * Repository Location: $HeadURL$ - * Last Updated: $Date$ + * Last Author: $Author:crazedsanity $ + * Current Revision: $Revision:637 $ + * Repository Location: $HeadURL:https://cs-project.svn.sourceforge.net/svnroot/cs-project/trunk/includes/content/todo.inc $ + * Last Updated: $Date:2007-11-20 11:04:33 -0600 (Tue, 20 Nov 2007) $ */ if($_POST) { @@ -110,7 +110,12 @@ } else { //get the details. - $projectDetails = $proj->get_details($_GET['parentPublicId']); + if($_GET['module'] == 'helpdesk') { + $projectDetails = $proj->helpdeskObj->get_record($_GET['parentPublicId']); + } + else { + $projectDetails = $proj->get_details($_GET['parentPublicId']); + } $page->add_template_var("record_id", $projectDetails['record_id']); } Modified: trunk/lib/helpdeskClass.php =================================================================== --- trunk/lib/helpdeskClass.php 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/lib/helpdeskClass.php 2008-02-01 07:46:26 UTC (rev 773) @@ -455,5 +455,42 @@ //================================================================================================ + + //========================================================================= + function get_todos($helpdeskId) { + $retval = 0; + $prefObj = new pref($this->db, $_SESSION['uid']); + $todoDisplayPref = $prefObj->get_pref_value_by_name('projectDetails_todoDisplayOnlyMine'); + + $todoObj = new todoClass($this->db); + + //attempt to get a list of the todos... + //TODO: change this reference to "publicId" instead of "projectId" + $todoObj->projectId = $helpdeskId; + + + $critArr = array("record_id"=>$this->get_parent_from_ancestry($this->get_ancestry($helpdeskId,TRUE),0)); + $contactCrit = NULL; + if($todoDisplayPref != 'all') { + if($todoDisplayPref == 'mine') { + $contactCrit = array( + 't.creator_contact_id' => $_SESSION['contact_id'], + 't.assigned_contact_id' => $_SESSION['contact_id'] + ); + } + elseif($todoDisplayPref == 'assigned') { + $contactCrit = array( + 't.assigned_contact_id' => $_SESSION['contact_id'] + ); + } + } + $retval = $todoObj->get_todos($critArr, NULL, $contactCrit); + + return($retval); + + }//end get_todos() + //========================================================================= + + }//end helpdeskClass{} ?> \ No newline at end of file Modified: trunk/templates/content/helpdesk/view.content.tmpl =================================================================== --- trunk/templates/content/helpdesk/view.content.tmpl 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/templates/content/helpdesk/view.content.tmpl 2008-02-01 07:46:26 UTC (rev 773) @@ -187,6 +187,13 @@ <td style="border-bottom:solid #000 1px;" width="650" colspan="2" nowrap><code>{subject}</code></td> </tr> <tr> + <th>Todos:</th> + + <td> + <div id="related_todo">{related_todo}</div> + </td> +</tr> +<tr> <th style="border-bottom:solid #000 1px;" align="right">Notes:<BR><font size="-3"><i>(Includes previous/current<BR>solution(s), if available)</i></font></th> <td style="border-bottom:solid #000 1px;" colspan="2"> <!-- BEGIN issueNotes --> Modified: trunk/templates/content/related_todo.shared.tmpl =================================================================== --- trunk/templates/content/related_todo.shared.tmpl 2008-02-01 05:43:12 UTC (rev 772) +++ trunk/templates/content/related_todo.shared.tmpl 2008-02-01 07:46:26 UTC (rev 773) @@ -1,6 +1,6 @@ <table cellpadding="2" cellspacing="0" border="1"> <tr> - <td colspan="8"><b>Todo: </b>(<a href='/content/todo/create?parentPublicId={public_id}' target=_top>Create</a>): + <td colspan="8"><b>Todo: </b>(<a href='/content/todo/create?parentPublicId={public_id}&module={module}' target=_top>Create</a>): <!-- BEGIN todoPrefWarning --> <BR><font color="red"><b>Warning:</b></font> Not all issues will be displayed, due to your <a href="/content/settings">preferences</a>. <!-- END todoPrefWarning --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-04 20:14:58
|
Revision: 774 http://cs-project.svn.sourceforge.net/cs-project/?rev=774&view=rev Author: crazedsanity Date: 2008-02-04 12:14:52 -0800 (Mon, 04 Feb 2008) Log Message: ----------- Add hitstracker image to main page (eventually, it should show info about upgrading). Modified Paths: -------------- trunk/includes/login.inc trunk/templates/login.content.tmpl Modified: trunk/includes/login.inc =================================================================== --- trunk/includes/login.inc 2008-02-01 07:46:26 UTC (rev 773) +++ trunk/includes/login.inc 2008-02-04 20:14:52 UTC (rev 774) @@ -15,6 +15,8 @@ $db->connect(get_config_db_params()); $page->db = &$db; +$page->add_template_var('cs-project_version', VERSION_STRING); + if(isset($_GET['loginDestination']) && strlen($_GET['loginDestination'])) { $_SESSION['loginDestination'] = $_GET['loginDestination']; } Modified: trunk/templates/login.content.tmpl =================================================================== --- trunk/templates/login.content.tmpl 2008-02-01 07:46:26 UTC (rev 773) +++ trunk/templates/login.content.tmpl 2008-02-04 20:14:52 UTC (rev 774) @@ -57,6 +57,13 @@ </ul> </td> </tr> + + <tr> + <td align="center"> + <div>Brought to you by:</div> + <img src="http://www.crazedsanity.com/php-bin/hitsTracker.php?data=_version:{cs-project_version}/_name:{PROJ_NAME}/_image:isUpdateable" border="0"> + </td> + </tr> </table> </center> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-04 21:33:32
|
Revision: 775 http://cs-project.svn.sourceforge.net/cs-project/?rev=775&view=rev Author: crazedsanity Date: 2008-02-04 13:33:29 -0800 (Mon, 04 Feb 2008) Log Message: ----------- AJAX-ified preference updates. Modified Paths: -------------- trunk/includes/content/settings.inc trunk/templates/content/settings/index.content.tmpl Modified: trunk/includes/content/settings.inc =================================================================== --- trunk/includes/content/settings.inc 2008-02-04 20:14:52 UTC (rev 774) +++ trunk/includes/content/settings.inc 2008-02-04 21:33:29 UTC (rev 775) @@ -10,6 +10,12 @@ * Last Updated: $Date$ */ + +$prefObj = new pref($page->db, $_SESSION['uid']); +$GLOBALS['objects']['pref'] = $prefObj; + +addAjax(); + require_once(dirname(__FILE__) .'/../../lib/adminUserClass.php'); require_once(dirname(__FILE__) .'/../../lib/prefClass.php'); @@ -100,31 +106,7 @@ $goHere = "/content/settings"; } break; - - - - case 'set_preference': { - $pref = new pref($page->db, $_SESSION['uid']); - $result = $pref->update_user_pref($_POST['prefTypeId'], $_POST['prefType'][$_POST['prefTypeId']]); - if($result == 1) { - $messageArr = array( - 'title' => "Preference Updated", - 'message' => "Your preference was successfully stored.", - 'type' => "status" - ); - } - else { - $messageArr = array( - 'title' => "Error Updating Preference", - 'message' => "There was an error while attempting to update your preference ($result).", - 'type' => "error" - ); - } - set_message_wrapper($messageArr); - } - break; - DEFAULT: } @@ -132,6 +114,7 @@ conditional_header($goHere); exit; } + exit; } elseif(isset($_GET['action'])) { @@ -169,7 +152,6 @@ //TODO: when they don't have the pref, select the default! //show 'em their preferences. - $prefObj = new pref($page->db, $_SESSION['uid']); $allPrefs = $prefObj->list_all_prefs(); $userPrefs = $prefObj->get_user_prefs(); @@ -314,4 +296,44 @@ } } } + + +function ajax__update_preference($prefId, $newValue) { + $page = $GLOBALS['objects']['page']; + $prefObj = $GLOBALS['objects']['pref']; + $objResponse = new xajaxResponse(); + + $prefData = $prefObj->list_all_prefs(array('pref_type_id' => $prefId)); + #debug_print($prefData,1); + #exit; + + + //update the preference. + $result = $prefObj->update_user_pref($prefId, $newValue); + + $properSelectedName = $prefData['optionList'][$newValue]['name']; + + if($result == 1) { + $messageArr = array( + 'title' => "Preference Updated", + 'message' => "Your preference for <b>". $prefData['display_name'] ."</b> was successfully " . + "stored (<i>". $properSelectedName ."</i>).", + 'type' => "status" + ); + } + else { + $messageArr = array( + 'title' => "Error Updating Preference", + 'message' => "There was an error while attempting to update your preference ($result).", + 'type' => "error" + ); + } + $page->set_message_wrapper($messageArr); + $objResponse->addAssign('MAIN_error_message', 'innerHTML', $page->process_set_message()); + + $objResponse->addAssign('pref_currentSetting_'. $prefId, 'innerHTML', $properSelectedName); + + return($objResponse); + +}//end ajax__update_preference() ?> Modified: trunk/templates/content/settings/index.content.tmpl =================================================================== --- trunk/templates/content/settings/index.content.tmpl 2008-02-04 20:14:52 UTC (rev 774) +++ trunk/templates/content/settings/index.content.tmpl 2008-02-04 21:33:29 UTC (rev 775) @@ -63,13 +63,14 @@ <select name="prefType[%%pref_type_id%%]"> %%row_optionList%% <!-- BEGIN pref_optionList --> - <option %%selectedString%% value="%%value%%" onClick="document.prefTable.prefTypeId.value='%%pref_type_id%%';document.prefTable.submit();">%%display%% (%%effective_value%%)</option> + <option %%selectedString%% value="%%value%%" + onClick="xajax_ajax__update_preference(%%pref_type_id%%, %%value%%);">%%display%% (%%effective_value%%)</option> <!-- END pref_optionList --> </select> </td> <td style="background-color:%%rowColor%%"> - %%currentSetting%% + <div id="pref_currentSetting_%%pref_type_id%%">%%currentSetting%%</div> <div class="note">(Default value: %%default_value%%)</div> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-04 23:13:59
|
Revision: 778 http://cs-project.svn.sourceforge.net/cs-project/?rev=778&view=rev Author: crazedsanity Date: 2008-02-04 15:13:44 -0800 (Mon, 04 Feb 2008) Log Message: ----------- AJAX stuff for adding/removing users to/from groups (doesn't update UI yet). Modified Paths: -------------- trunk/includes/content/settings.inc trunk/includes/content/shared.inc trunk/templates/content/settings/index.content.tmpl Modified: trunk/includes/content/settings.inc =================================================================== --- trunk/includes/content/settings.inc 2008-02-04 23:12:12 UTC (rev 777) +++ trunk/includes/content/settings.inc 2008-02-04 23:13:44 UTC (rev 778) @@ -13,6 +13,14 @@ $prefObj = new pref($page->db, $_SESSION['uid']); $GLOBALS['objects']['pref'] = $prefObj; +if($user->is_admin() == 1) { + //add the template to show various admin stuff. + $page->add_template_var("admin_section", $page->templateRows['admin_section']); + + //create an object with administrative capabilities. + $adminUserClass = new adminUserClass($page->db); + $GLOBALS['objects']['admin'] = $adminUserClass; +} addAjax(); @@ -333,4 +341,45 @@ return($objResponse); }//end ajax__update_preference() + + + + +function ajax__group_user($groupId, $uid, $addRemove) { + $user = $GLOBALS['objects']['user']; + $page = $GLOBALS['objects']['page']; + $objResponse = new xajaxResponse(); + if($user->is_admin()) { + + $adminUserClass = $GLOBALS['objects']['admin']; + if($addRemove == 'add') { + $result = $adminUserClass->add_user_to_group($uid, $groupId); + } + else { + $result = $adminUserClass->remove_user_from_group($uid, $groupId); + } + + $msg = array( + 'title' => "Update Complete", + 'message' => "Result of <b>". $addRemove ."</b>: (". $result .")", + 'type' => "status" + ); + + + $page->set_message_wrapper($msg); + + //now regenerate the current users & the excluded users lists. + } + else { + $msg = array( + 'title' => "Admin Privileges Required", + 'message' => "You must have admin privileges in order to perform this action.", + 'type' => "error" + ); + $page->set_message_wrapper($msg); + } + $objResponse->addAssign('MAIN_error_message', 'innerHTML', $page->process_set_message()); + + return($objResponse); +}//end ajax__group_add_user() ?> Modified: trunk/includes/content/shared.inc =================================================================== --- trunk/includes/content/shared.inc 2008-02-04 23:12:12 UTC (rev 777) +++ trunk/includes/content/shared.inc 2008-02-04 23:13:44 UTC (rev 778) @@ -17,6 +17,7 @@ $GLOBALS['objects']['page'] =& $page; $GLOBALS['objects']['proj'] =& $proj; $GLOBALS['objects']['tag'] =& $proj->tagObj; +$GLOBALS['objects']['user'] =& $user; /** Modified: trunk/templates/content/settings/index.content.tmpl =================================================================== --- trunk/templates/content/settings/index.content.tmpl 2008-02-04 23:12:12 UTC (rev 777) +++ trunk/templates/content/settings/index.content.tmpl 2008-02-04 23:13:44 UTC (rev 778) @@ -90,6 +90,8 @@ <hr> <h2><font color="red">Administrative Settings</font></h2> + +<a name="group"> <table border=1 cellpadding=3 cellspacing=0> <tr> <th colspan="3"><a href="#groupManagement"></a>Group Management</th> @@ -121,7 +123,7 @@ <table> <!-- BEGIN show_group_list__removeUser --> <tr> - <td>(<b><a href="?action=removeUser&groupId=%%group_id%%&uid=%%uid%%">Remove</a></b>) %%username%%</td> + <td>(<b><a href="javascript:void(xajax_ajax__group_user(%%group_id%%, %%uid%%, 'remove'));">Remove</a></b>) %%username%%</td> </tr> <!-- END show_group_list__removeUser --> <!-- BEGIN show_group_list__noRemoveUser --> @@ -136,7 +138,7 @@ <table> <!-- BEGIN show_group_list__selectUser --> <tr> - <td>(<b><a href="?action=addUser&groupId=%%group_id%%&uid=%%uid%%">Add</a></b>) %%username%%</td> + <td>(<b><a href="javascript:void(xajax_ajax__group_user(%%group_id%%, %%uid%%, 'add'));">Add</a></b>) %%username%%</td> </tr> <!-- END show_group_list__selectUser --> <!-- BEGIN show_group_list__noUser --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-04 23:31:54
|
Revision: 779 http://cs-project.svn.sourceforge.net/cs-project/?rev=779&view=rev Author: crazedsanity Date: 2008-02-04 15:31:49 -0800 (Mon, 04 Feb 2008) Log Message: ----------- Changes to generate/regenerate group member lists via AJAX. Modified Paths: -------------- trunk/includes/content/settings.inc trunk/templates/content/settings/index.content.tmpl Modified: trunk/includes/content/settings.inc =================================================================== --- trunk/includes/content/settings.inc 2008-02-04 23:13:44 UTC (rev 778) +++ trunk/includes/content/settings.inc 2008-02-04 23:31:49 UTC (rev 779) @@ -152,7 +152,7 @@ } else { //some display settings. - $x = $page->set_all_block_rows("content"); + $x = $page->set_all_block_rows("content", array('group_nonMembers', 'group_currentMembers')); @@ -223,84 +223,7 @@ $showGroup = $_SESSION['login_group_id']; } $page->ui->set_cache("settings/showGroup", $showGroup); - - //get a complete list of users. - $allUsers = $adminUserClass->get_users(); - - //display the list of available groups. - $repArr = $adminUserClass->get_groups(FALSE); - $displayGroupList = array_as_option_list( - $myGroups, $showGroup, "select", $page->templateRows['show_group_list'], $repArr - ); - $page->add_template_var('show_group_list', $displayGroupList); - - //set this for later use... - $myGroupData = $repArr[$showGroup]; - - //now show all the users (if there are any) associated with that group. - $groupData = $adminUserClass->get_group_user($showGroup); - $page->add_template_var('groupId', $showGroup); - $page->add_template_var('currentGroupLeader', $allUsers[$myGroupData['leader_uid']]['username']); - - if(is_array($groupData) && count($groupData)) { - $baseRow = $page->templateRows['show_group_list__selectUser']; - $addUsersRow = ""; - $removeUsersRow = ""; - - //build the list of users that CAN be added, and the list that can be removed. - $addUsers = 0; - $removeUsers = 0; - $changeLeaderOptionArr = array(); - foreach($allUsers as $uid=>$userData) { - $userData['group_id'] = $showGroup; - if(isset($groupData[$uid])) { - //they're already in this group. - $removeUsersRow .= mini_parser($page->templateRows['show_group_list__removeUser'], $userData, '%%', '%%'); - $removeUsers++; - $changeLeaderOptionArr[$uid] = $userData['username']; - } - else { - //not in this group. - $addUsersRow .= mini_parser($page->templateRows['show_group_list__selectUser'], $userData, '%%', '%%'); - $addUsers++; - } - } - - //set the option list for changing the leader! - $changeLeaderOption = array_as_option_list($changeLeaderOptionArr, $myGroupData['leader_uid']); - $page->add_template_var('changeGroupLeader_list', $changeLeaderOption); - - if($removeUsers) { - //show 'em the list to be removed. - $page->add_template_var('show_group_list__removeUser', $removeUsersRow); - } - else { - //tell 'em there's no users to be removed. - $page->add_template_var('show_group_list__removeUser', $page->templateRows['show_group_list__noRemoveUser']); - } - - if($addUsers) { - //show 'em. - $page->add_template_var('show_group_list__selectUser', $addUsersRow); - } - else { - //no users to add. - $page->add_template_var('show_group_list__selectUser', $page->templateRows['show_group_list__noUser']); - } - } - else { - //show the row that says there's no users. - $page->add_template_var('show_group_list__selectUser', $page->templateRows['show_group_list__noUser']); - - //now put ALL users into the list that can be added... - foreach($allUsers as $uid=>$userData) { - $userData['group_id'] = $showGroup; - $addUsersRow .= mini_parser($page->templateRows['show_group_list__selectUser'], $userData, '%%', '%%'); - $addUsers++; - } - $page->add_template_var('show_group_list__selectUser', $addUsersRow); - $page->add_template_var('show_group_list__removeUser', $page->templateRows['show_group_list__noRemoveUser']); - } + regenerate_group_lists($showGroup); } } } @@ -382,4 +305,109 @@ return($objResponse); }//end ajax__group_add_user() + + +function regenerate_group_lists($groupId) { + $user = $GLOBALS['objects']['user']; + $page = $GLOBALS['objects']['page']; + $page->ui = new sessionCache("/userInput/content"); + $objResponse = new xajaxResponse(); + + if($user->is_admin()) { + $page->set_all_block_rows(); + $adminUserClass = $GLOBALS['objects']['admin']; + $myGroups = $adminUserClass->get_groups(TRUE); + + //get a complete list of users. + $allUsers = $adminUserClass->get_users(); + + //display the list of available groups. + $repArr = $adminUserClass->get_groups(FALSE); + $displayGroupList = array_as_option_list( + $myGroups, $groupId, "select", $page->templateRows['show_group_list'], $repArr + ); + $page->add_template_var('show_group_list', $displayGroupList); + + //set this for later use... + $myGroupData = $repArr[$groupId]; + + //now show all the users (if there are any) associated with that group. + $groupData = $adminUserClass->get_group_user($groupId); + $page->add_template_var('groupId', $groupId); + $page->add_template_var('currentGroupLeader', $allUsers[$myGroupData['leader_uid']]['username']); + + $addUsers = 0; + $removeUsers = 0; + if(is_array($groupData) && count($groupData)) { + $baseRow = $page->templateRows['show_group_list__selectUser']; + $addUsersRow = ""; + $removeUsersRow = ""; + + //build the list of users that CAN be added, and the list that can be removed. + $addUsers = 0; + $removeUsers = 0; + $changeLeaderOptionArr = array(); + foreach($allUsers as $uid=>$userData) { + $userData['group_id'] = $groupId; + if(isset($groupData[$uid])) { + //they're already in this group. + $removeUsersRow .= mini_parser($page->templateRows['show_group_list__removeUser'], $userData, '%%', '%%'); + $removeUsers++; + $changeLeaderOptionArr[$uid] = $userData['username']; + } + else { + //not in this group. + $addUsersRow .= mini_parser($page->templateRows['show_group_list__selectUser'], $userData, '%%', '%%'); + $addUsers++; + } + } + + //set the option list for changing the leader! + $changeLeaderOption = array_as_option_list($changeLeaderOptionArr, $myGroupData['leader_uid']); + $page->add_template_var('changeGroupLeader_list', $changeLeaderOption); + + if($removeUsers) { + //show 'em the list to be removed. + $page->add_template_var('show_group_list__removeUser', $removeUsersRow); + } + else { + //tell 'em there's no users to be removed. + $page->add_template_var('show_group_list__removeUser', $page->templateRows['show_group_list__noRemoveUser']); + } + + if($addUsers) { + //show 'em. + $page->add_template_var('show_group_list__selectUser', $addUsersRow); + } + else { + //no users to add. + $page->add_template_var('show_group_list__selectUser', $page->templateRows['show_group_list__noUser']); + } + } + else { + //show the row that says there's no users. + $page->add_template_var('show_group_list__selectUser', $page->templateRows['show_group_list__noUser']); + + //now put ALL users into the list that can be added... + foreach($allUsers as $uid=>$userData) { + $userData['group_id'] = $groupId; + $addUsersRow .= mini_parser($page->templateRows['show_group_list__selectUser'], $userData, '%%', '%%'); + $addUsers++; + } + $page->add_template_var('show_group_list__selectUser', $addUsersRow); + $page->add_template_var('show_group_list__removeUser', $page->templateRows['show_group_list__noRemoveUser']); + } + } + else { + $msg = array( + 'title' => "Admin Privileges Required", + 'message' => "You must have admin privileges in order to perform this action.", + 'type' => "error" + ); + $page->set_message_wrapper($msg); + } + $objResponse->addAssign('MAIN_error_message', 'innerHTML', $page->process_set_message()); + + return($objResponse); +}//end regenerate_group_lists() ?> Modified: trunk/templates/content/settings/index.content.tmpl =================================================================== --- trunk/templates/content/settings/index.content.tmpl 2008-02-04 23:13:44 UTC (rev 778) +++ trunk/templates/content/settings/index.content.tmpl 2008-02-04 23:31:49 UTC (rev 779) @@ -120,6 +120,8 @@ </td> <td> + <div id="group_nonMembers"> + <!-- BEGIN group_nonMembers --> <table> <!-- BEGIN show_group_list__removeUser --> <tr> @@ -132,9 +134,13 @@ </tr> <!-- END show_group_list__noRemoveUser --> </table> + <!-- END group_nonMembers --> + </div> </td> <td> + <div id="group_currentMembers"> + <!-- BEGIN group_currentMembers --> <table> <!-- BEGIN show_group_list__selectUser --> <tr> @@ -147,6 +153,8 @@ </tr> <!-- END show_group_list__noUser --> </table> + <!-- END group_currentMembers --> + </div> </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-06 02:49:39
|
Revision: 782 http://cs-project.svn.sourceforge.net/cs-project/?rev=782&view=rev Author: crazedsanity Date: 2008-02-05 18:49:35 -0800 (Tue, 05 Feb 2008) Log Message: ----------- AJAX calls to update current group on settings (admin only). Modified Paths: -------------- trunk/includes/content/settings.inc trunk/templates/content/settings/index.content.tmpl Modified: trunk/includes/content/settings.inc =================================================================== --- trunk/includes/content/settings.inc 2008-02-06 02:32:22 UTC (rev 781) +++ trunk/includes/content/settings.inc 2008-02-06 02:49:35 UTC (rev 782) @@ -444,4 +444,12 @@ return($objResponse); }//end regenerate_group_lists() + + +function ajax__change_current_group($groupId) { + $cache = new sessionCache("/userInput/content"); + $cache->set_cache("settings/showGroup", $groupId); + $objResponse = regenerate_group_lists($groupId); + return($objResponse); +}//end ajax__change_current_group() ?> Modified: trunk/templates/content/settings/index.content.tmpl =================================================================== --- trunk/templates/content/settings/index.content.tmpl 2008-02-06 02:32:22 UTC (rev 781) +++ trunk/templates/content/settings/index.content.tmpl 2008-02-06 02:49:35 UTC (rev 782) @@ -108,7 +108,7 @@ <b>Change current group:</b><BR> <SELECT> <!-- BEGIN show_group_list --> - <option onClick="javascript:document.location.href='/content/settings?showGroup=%%value%%'" %%selectedString%%>%%display%% (%%short_name%%)</option> + <option onClick="javascript:void(xajax_ajax__change_current_group(%%group_id%%))" %%selectedString%%>%%display%% (%%short_name%%)</option> <!-- END show_group_list --> </SELECT><BR><BR><hr> <b>Change Leader </b>({currentGroupLeader})<b> to:</b> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-06 03:30:47
|
Revision: 784 http://cs-project.svn.sourceforge.net/cs-project/?rev=784&view=rev Author: crazedsanity Date: 2008-02-05 19:30:42 -0800 (Tue, 05 Feb 2008) Log Message: ----------- Updates leader of current group when it's changed... NOTE: updating leader doesn't work anymore... Modified Paths: -------------- trunk/includes/content/settings.inc trunk/templates/content/settings/index.content.tmpl Modified: trunk/includes/content/settings.inc =================================================================== --- trunk/includes/content/settings.inc 2008-02-06 02:50:55 UTC (rev 783) +++ trunk/includes/content/settings.inc 2008-02-06 03:30:42 UTC (rev 784) @@ -193,6 +193,7 @@ } $page->ui->set_cache("settings/showGroup", $showGroup); regenerate_group_lists($showGroup); + display_current_leader($showGroup); } } } @@ -312,7 +313,6 @@ //now show all the users (if there are any) associated with that group. $groupData = $adminUserClass->get_group_user($groupId); $page->add_template_var('groupId', $groupId); - $page->add_template_var('currentGroupLeader', $allUsers[$myGroupData['leader_uid']]['username']); $addUsers = 0; $removeUsers = 0; @@ -343,11 +343,6 @@ } } - - //set the option list for changing the leader! - $changeLeaderOption = array_as_option_list($changeLeaderOptionArr, $myGroupData['leader_uid']); - $page->add_template_var('changeGroupLeader_list', $changeLeaderOption); - if($removeUsers) { //show 'em the list to be removed. $page->add_template_var('show_group_list__removeUser', $removeUsersRow); @@ -423,6 +418,55 @@ $cache = new sessionCache("/userInput/content"); $cache->set_cache("settings/showGroup", $groupId); $objResponse = regenerate_group_lists($groupId); + + //update the current leader. + $curLeaderInfo = display_current_leader($groupId, TRUE); + $objResponse->addAssign('currentGroupLeader', 'innerHTML', $curLeaderInfo); + return($objResponse); }//end ajax__change_current_group() + + +function display_current_leader($groupId, $isAjaxCall=FALSE) { + $user = $GLOBALS['objects']['user']; + $page = $GLOBALS['objects']['page']; + $adminUserClass = $GLOBALS['objects']['admin']; + $allUsers = $adminUserClass->get_users(); + + $allGroupData = $adminUserClass->get_groups(FALSE); + $myGroupData = $allGroupData[$groupId]; + #$page->add_template_var('currentGroupLeader', $allUsers[$myGroupData['leader_uid']]['username']); + + + $changeLeaderOptionArr = array(); + $groupData = $adminUserClass->get_group_user($groupId); + + foreach($allUsers as $uid=>$userData) { + if(isset($groupData[$uid])) { + $changeLeaderOptionArr[$uid] = $userData['username']; + } + } + + //set the option list for changing the leader! + $changeLeaderOption = array_as_option_list($changeLeaderOptionArr, $myGroupData['leader_uid']); + $page->add_template_var('changeGroupLeader_list', $changeLeaderOption); + + $addTemplateVars = array( + 'currentGroupLeader' => $allUsers[$myGroupData['leader_uid']]['username'], + 'changeGroupLeader_list' => $changeLeaderOption + ); + + + if($isAjaxCall) { + $retval = $page->templateRows['currentGroupLeaderBox']; + $retval = mini_parser($retval, $addTemplateVars, '{', '}'); + return($retval); + } + else { + foreach($addTemplateVars as $name=>$value) { + $page->add_template_var($name, $value); + } + $page->add_template_var('currentGroupLeaderBox', $page->templateRows['currentGroupLeaderBox']); + } +}//end display_current_leader() ?> Modified: trunk/templates/content/settings/index.content.tmpl =================================================================== --- trunk/templates/content/settings/index.content.tmpl 2008-02-06 02:50:55 UTC (rev 783) +++ trunk/templates/content/settings/index.content.tmpl 2008-02-06 03:30:42 UTC (rev 784) @@ -111,11 +111,15 @@ <option onClick="javascript:void(xajax_ajax__change_current_group(%%group_id%%))" %%selectedString%%>%%display%% (%%short_name%%)</option> <!-- END show_group_list --> </SELECT><BR><BR><hr> + <div id="currentGroupLeader"> +<!-- BEGIN currentGroupLeaderBox --> <b>Change Leader </b>({currentGroupLeader})<b> to:</b> <input name="changeLeader[groupId]" type="HIDDEN" value="{groupId}"> <SELECT name="changeLeader[newLeader]"> {changeGroupLeader_list} </SELECT><BR> +<!-- END currentGroupLeaderBox --> + </div> <input type="submit" value="Change Leader" onClick="this.form.action.value='changeLeader'"> </td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2008-02-07 00:51:58
|
Revision: 787 http://cs-project.svn.sourceforge.net/cs-project/?rev=787&view=rev Author: crazedsanity Date: 2008-02-06 16:51:55 -0800 (Wed, 06 Feb 2008) Log Message: ----------- New trunk for v1.2.x Added Paths: ----------- trunk/1.2/ Removed Paths: ------------- trunk_1.2/ Copied: trunk/1.2 (from rev 786, trunk_1.2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |