Index: admin.php =================================================================== RCS file: /cvsroot/phpgroupware/tts/admin.php,v retrieving revision 1.2.2.1 diff -u -r1.2.2.1 admin.php --- admin.php 25 Jan 2002 22:00:52 -0000 1.2.2.1 +++ admin.php 28 Feb 2002 00:14:33 -0000 @@ -24,9 +24,11 @@ include('../header.inc.php'); $option_names = array(lang('Disabled'), lang('Users choice'), lang('Force')); + $none_option_names = array(lang('Default'), lang('Group managers'), lang('Entire group')); $owner_selected = array (); $group_selected = array (); $assigned_selected = array (); + $none_selected = array (); $GLOBALS['phpgw']->config->read_repository(); @@ -68,6 +70,15 @@ unset($GLOBALS['phpgw']->config->config_data['assignednotification']); } + if ($HTTP_POST_VARS['nonenotification']) + { + $GLOBALS['phpgw']->config->config_data['nonenotification'] = $HTTP_POST_VARS['nonenotification']; + } + else + { + unset($GLOBALS['phpgw']->config->config_data['nonenotification']); + } + if ($HTTP_POST_VARS['useallgroups']) { $GLOBALS['phpgw']->config->config_data['allgroups'] = True; @@ -156,6 +177,20 @@ $GLOBALS['phpgw']->template->set_var('tts_optionvalue', $i); $GLOBALS['phpgw']->template->set_var('tts_optionselected', $assigned_selected[$i]); $GLOBALS['phpgw']->template->parse('tts_assignedoptions','tts_select_options',true); + } + + $GLOBALS['phpgw']->template->set_var('lang_nonenotification',lang('Mail for none to')); + if ($GLOBALS['phpgw']->config->config_data['nonenotification']) + { + $none_selected[$GLOBALS['phpgw']->config->config_data['nonenotification']]=' selected'; + } + + for ($i=0; $i<3; $i++) + { + $GLOBALS['phpgw']->template->set_var('tts_optionname', $none_option_names[$i]); + $GLOBALS['phpgw']->template->set_var('tts_optionvalue', $i); + $GLOBALS['phpgw']->template->set_var('tts_optionselected', $none_selected[$i]); + $GLOBALS['phpgw']->template->parse('tts_noneoptions','tts_select_options',true); } $GLOBALS['phpgw']->template->set_var('lang_allgroups',lang('Assign to all groups')); Index: inc/functions.inc.php =================================================================== RCS file: /cvsroot/phpgroupware/tts/inc/functions.inc.php,v retrieving revision 1.37.2.1 diff -u -r1.37.2.1 functions.inc.php --- inc/functions.inc.php 25 Jan 2002 22:00:52 -0000 1.37.2.1 +++ inc/functions.inc.php 28 Feb 2002 00:14:34 -0000 @@ -47,11 +47,12 @@ $body = ''; $body .= 'TTS #'.$ticket_id."\n"; $body .= 'Subject: '.$GLOBALS['phpgw']->db->f('ticket_subject')."\n"; - $body .= 'Assigned To: '.$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto'))."\n"; + $body .= 'Assigned To: '.($GLOBALS['phpgw']->db->f('ticket_assignedto')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto')):'None')."\n"; $body .= 'Priority: '.$GLOBALS['phpgw']->db->f('ticket_priority')."\n"; $body .= 'Group: '.$group_name."\n"; $body .= 'Opened By: '.$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_owner'))."\n\n"; $body .= "Latest Note Added:\n"; + /**************************************************************\ * Display latest note * \**************************************************************/ @@ -89,12 +90,33 @@ // do we need to email all the users in the group assigned to this ticket? - if ($GLOBALS['phpgw']->config->config_data['groupnotification']) + if ($GLOBALS['phpgw']->config->config_data['groupnotification']) { // select group recipients $members = $GLOBALS['phpgw']->accounts->member($group_id); } - + else + { + // is this ticket for 'None'? if so, who do we send e-mail to? + if ($GLOBALS['phpgw']->db->f('ticket_assignedto') == 0) + { + switch ($GLOBALS['phpgw']->config->config_data['nonenotification']) + { + case 1: + // add group managers to recipients + $manager_ids = $GLOBALS['phpgw']->acl->get_ids_for_location($group_id,PHPGW_ACL_GROUP_MANAGERS,'phpgw_group'); + while (list($key,$entry) = each($manager_ids)) + { + $members[] = array('account_id' => $entry, 'account_name' => $GLOBALS['phpgw']->accounts->id2name($entry)); + } + break; + case 2: + // add group members to recipients + $members = $GLOBALS['phpgw']->accounts->member($group_id); + break; + } + } + } // do we need to email the owner of this ticket? if ($GLOBALS['phpgw']->config->config_data['ownernotification']) Index: templates/default/admin.tpl =================================================================== RCS file: /cvsroot/phpgroupware/tts/templates/default/admin.tpl,v retrieving revision 1.3 diff -u -r1.3 admin.tpl --- templates/default/admin.tpl 26 Sep 2001 23:59:52 -0000 1.3 +++ templates/default/admin.tpl 28 Feb 2002 00:14:34 -0000 @@ -35,6 +35,14 @@ </select> </td> </tr> + <tr bgcolor="#EEEEEE"> + <td>{lang_nonenotification}</td> + <td> + <select size="1" name="nonenotification"> + {tts_noneoptions} + </select> + </td> + </tr> <tr bgcolor="#EEEEEE"> <td>{lang_allgroups}</td> <td><input type="checkbox" name="useallgroups"{allgroups}></td>