Thread: [Cs-project-svn_notify] SF.net SVN: cs-project: [625] trunk/lib/helpdeskClass.php
Brought to you by:
crazedsanity
From: <cra...@us...> - 2007-11-15 17:02:53
|
Revision: 625 http://cs-project.svn.sourceforge.net/cs-project/?rev=625&view=rev Author: crazedsanity Date: 2007-11-15 09:02:49 -0800 (Thu, 15 Nov 2007) Log Message: ----------- Standardization of notice messages. /lib/helpdeskClass.php: * remark(): -- don't send the alert unless the constant HELPDESK_ISSUE_ANNOUNCE_EMAIL appears to be set/valid. * create_record(): -- set subject line when creating normal emails -- send alert with given subject line (prepending "[ALERT] "). Modified Paths: -------------- trunk/lib/helpdeskClass.php Modified: trunk/lib/helpdeskClass.php =================================================================== --- trunk/lib/helpdeskClass.php 2007-11-15 16:09:20 UTC (rev 624) +++ trunk/lib/helpdeskClass.php 2007-11-15 17:02:49 UTC (rev 625) @@ -205,7 +205,7 @@ $details = 'Sent notification(s) of for [helpdesk_id='. $helpdeskId .'] remark to: '. $sendEmailRes; $this->logsObj->log_by_class($details, 'information', NULL, $this->recordTypeId, $helpdeskId); - if($isSolution) { + if($isSolution && strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { $subject = '[ALERT] Helpdesk Issue #'. $helpdeskId .' was SOLVED'; if(strlen($_SESSION['login_username'])) { $subject .= ' by '. $_SESSION['login_username']; @@ -326,24 +326,22 @@ $normalEmailExtra = NULL; $emailAddressList = $linkObj->get_record_email_list($newRecord); + if((strlen($_SESSION['login_email'])) && ($_SESSION['login_email'] != $parseArr['email'])) { - send_email( - $emailAddressList, - "Helpdesk Issue #$retval Created [for ".$parseArr['email'] ."]", - $emailTemplate, - $parseArr - ); + $subject = "Created Helpdesk Issue #$retval Created [for ".$parseArr['email'] ."] -- ". $parseArr['name']; + send_email($emailAddressList, $subject, $emailTemplate, $parseArr); $normalEmailExtra = " [registered by ". $_SESSION['login_loginname'] .": uid=". $_SESSION['login_id'] ."]"; } else { - send_email( - $emailAddressList, - "Helpdesk Issue #$retval Created". $normalEmailExtra, - $emailTemplate, - $parseArr - ); + $subject = "Created Helpdesk Issue #$retval Created". $normalEmailExtra ." -- ". $parseArr['name']; + send_email($emailAddressList, $subject, $emailTemplate, $parseArr); } + if(strlen(constant('HELPDESK_ISSUE_ANNOUNCE_EMAIL'))) { + //send the alert!!! + send_email(HELPDESK_ISSUE_ANNOUNCE_EMAIL, '[ALERT] '. $subject, $emailTemplate, $parseArr); + } + //log that it was created. $details = "Helpdesk Issue #". $retval ." ([helpdesk_id=". $retval ."]) Created by (". $dataArr['email'] ."): ". $dataArr['name']; $this->logsObj->log_by_class($details, 'create'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-11-21 16:56:23
|
Revision: 653 http://cs-project.svn.sourceforge.net/cs-project/?rev=653&view=rev Author: crazedsanity Date: 2007-11-21 08:56:20 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Colorized tag list w/modifiers, set initial priority based on selected tag mods. /lib/helpdeskClass.php: * create_record(): -- get list of tags & update priority based on the modifiers of the selected tags. -- add each of the selected tags to the record. * get_category_list(): -- special magic to colorize the list. -- NOTE: there's no reason to reference categories in place of tags anymore; this should be updated. Modified Paths: -------------- trunk/lib/helpdeskClass.php Modified: trunk/lib/helpdeskClass.php =================================================================== --- trunk/lib/helpdeskClass.php 2007-11-21 16:51:23 UTC (rev 652) +++ trunk/lib/helpdeskClass.php 2007-11-21 16:56:20 UTC (rev 653) @@ -292,6 +292,25 @@ if(!is_numeric($dataArr['priority'])) { $dataArr['priority'] = 9; } + + $tagObj = new tagClass($this->db); + if(is_array($dataArr['initialTag']) && count($dataArr['initialTag'])) { + + //get the list of tags, so we know what the total modifier is. + $allTags = $tagObj->get_tag_list(); + + foreach($dataArr['initialTag'] as $id) { + $dataArr['priority'] += $allTags[$id]['modifier']; + } + + if($dataArr['priority'] > 9) { + $dataArr['priority'] = 9; + } + elseif($dataArr['priority'] < 0) { + $dataArr['priority'] = 0; + } + + } $dataArr['is_helpdesk_issue'] = 't'; $newRecord = parent::create_record($dataArr, TRUE); @@ -311,9 +330,10 @@ $linkObj->add_link($newRecord, $myNewRecordArr[$retval]['creator_contact_id']); //now, let's tag it. - if(isset($dataArr['initialTag']) && is_numeric($dataArr['initialTag'])) { - $tagObj = new tagClass($this->db); - $tagObj->add_tag($newRecord, $dataArr['initialTag']); + if(is_array($dataArr['initialTag']) && count($dataArr['initialTag'])) { + foreach($dataArr['initialTag'] as $id) { + $tagObj->add_tag($newRecord, $id); + } } //determine what to do next... @@ -393,10 +413,43 @@ function get_category_list($selectThis=NULL) { //create a list of tags. $object = new tagClass($this->db); - $tagList = $object->get_tag_list(); + $mainTagList = $object->get_tag_list(); + //create the "replacement array" and such. + $tagList = array(); + foreach($mainTagList as $tagNameId => $subData) { + $tagList[$tagNameId] = $subData['name']; + $mod = $subData['modifier']; + if($mod > 0) { + if($mod == 1) { + $mainTagList[$tagNameId]['bgcolor'] = '#CCC'; + } + elseif($mod == 2) { + $mainTagList[$tagNameId]['bgcolor'] = '#BBB'; + } + else { + $mainTagList[$tagNameId]['bgcolor'] = '#AAA'; + } + } + elseif($mod < 0) { + if($mod == -1) { + $mainTagList[$tagNameId]['bgcolor'] = 'yellow'; + } + elseif($mod == -2) { + $mainTagList[$tagNameId]['bgcolor'] = 'orange'; + } + else { + $mainTagList[$tagNameId]['bgcolor'] = 'red'; + } + } + else { + $mainTagList[$tagNameId]['bgcolor'] = 'white'; + } + } + //now create the list. - $retval = array_as_option_list($tagList); + $templateString = "\t\t<option value='%%value%%' %%selectedString%% style=\"background-color:%%bgcolor%%\">%%display%% (%%modifier%%)</option>"; + $retval = array_as_option_list($tagList, $selectThis, 'select', $templateString, $mainTagList); return($retval); }//end get_category_list() //================================================================================================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2007-12-18 22:09:29
|
Revision: 703 http://cs-project.svn.sourceforge.net/cs-project/?rev=703&view=rev Author: crazedsanity Date: 2007-12-18 14:09:28 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Fix initial priority based on tag modifier (#77). /lib/helpdeskClass.php: * create_record(): -- pass TRUE as arg #1 to tagClass::get_tag_list() so "modifier" is available (to change priority). Modified Paths: -------------- trunk/lib/helpdeskClass.php Modified: trunk/lib/helpdeskClass.php =================================================================== --- trunk/lib/helpdeskClass.php 2007-12-18 22:04:15 UTC (rev 702) +++ trunk/lib/helpdeskClass.php 2007-12-18 22:09:28 UTC (rev 703) @@ -297,7 +297,7 @@ if(is_array($dataArr['initialTag']) && count($dataArr['initialTag'])) { //get the list of tags, so we know what the total modifier is. - $allTags = $tagObj->get_tag_list(); + $allTags = $tagObj->get_tag_list(TRUE); foreach($dataArr['initialTag'] as $id) { $dataArr['priority'] += $allTags[$id]['modifier']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |