phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] tts README, NONE, 1.1.2.1 test.php, NONE, 1.1.2.1 adm


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] tts README, NONE, 1.1.2.1 test.php, NONE, 1.1.2.1 admin.php, 1.2.2.1, 1.2.2.1.4.1 index.php, 1.43.2.7.2.2, 1.43.2.7.2.2.2.1 newticket.php, 1.31.2.3, 1.31.2.3.4.1 viewticket_details.php, 1.42.2.6, 1.42.2.6.4.1
Date: Fri, 31 Oct 2003 07:07:01 +0000

Update of /cvsroot/phpgroupware/tts
In directory subversions:/tmp/cvs-serv19647

Modified Files:
      Tag: Version-0_9_16-branch
        admin.php index.php newticket.php viewticket_details.php 
Added Files:
      Tag: Version-0_9_16-branch
        README test.php 
Log Message:
probiz updates from lars - untested

--- NEW FILE: test.php ---
<?php

$GLOBALS['phpgw_info']['flags'] = array
(
        'currentapp'    => 'tts',
        'noheader'      => True,
        'nofooter'      => True,
        'enable_vfs_class'      => True,
        'enable_browser_class'  => True
);

include ('../header.inc.php');

echo ($GLOBALS['phpgw_info']['user']['preferences']['common']['currency']);

$GLOBALS['phpgw']->common->phpgw_footer();

?>
Index: newticket.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/newticket.php,v
retrieving revision 1.31.2.3
retrieving revision 1.31.2.3.4.1
diff -C2 -d -r1.31.2.3 -r1.31.2.3.4.1
*** newticket.php       17 May 2002 12:59:17 -0000      1.31.2.3
--- newticket.php       31 Oct 2003 07:06:58 -0000      1.31.2.3.4.1
***************
*** 1,177 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Trouble Ticket System                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       // $Id$
!       // $Source$
! 
!       $submit = $HTTP_POST_VARS['submit'];
!       $cancel = $HTTP_POST_VARS['cancel'];
!       if($submit || $cancel)
!       {
!               $GLOBALS['phpgw_info']['flags'] = array(
!                       'noheader' => True,
!                       'nonavbar' => True
!               );
!       }
! 
!       $GLOBALS['phpgw_info']['flags']['currentapp']          = 'tts';
!       $GLOBALS['phpgw_info']['flags']['enable_send_class']   = True;
!       $GLOBALS['phpgw_info']['flags']['enable_config_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_categories_class'] = True;
! 
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->config->read_repository();
! 
!       if($cancel)
!       {
!               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/tts/index.php'));
!       }
! 
!       if($submit)
!       {
!               $GLOBALS['phpgw']->db->query("insert into phpgw_tts_tickets 
(ticket_group,ticket_priority,ticket_owner,"
!                       . 
"ticket_assignedto,ticket_subject,ticket_category,ticket_billable_hours,"
!                       . "ticket_billable_rate,ticket_status,ticket_details) 
values ('"
!                         . $ticket['group'] . "','"
!                       . $ticket['priority'] . "','"
!                       . $GLOBALS['phpgw_info']['user']['account_id'] . "','"
!                       . $ticket['assignedto'] . "','"
!                       . $ticket['subject'] . "','"
!                       . $ticket['category'] . "','"
!                       . $ticket['billable_hours'] . "','"
!                       . $ticket['billable_rate'] . "','O','"
!                       . addslashes($ticket['details']) . 
"')",__LINE__,__FILE__);
! 
!               $ticket_id = 
$GLOBALS['phpgw']->db->get_last_insert_id('phpgw_tts_tickets','ticket_id');
! 
!               $historylog = createobject('phpgwapi.historylog','tts');
!               $historylog->add('O',$ticket_id,' ','');
! 
!               if($GLOBALS['phpgw']->config->config_data['mailnotification'])
!               {
!                       mail_ticket($ticket_id);
!               }
! 
!               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/tts/viewticket_details.php','&ticket_id='
 . $ticket_id));
!       }
! 
!       $account_selected  = array();
!       $entry_selected    = array();
!       $priority_selected = array();
!       $priority_comment  = array();
! 
!       if(!$submit)
!       {
!               $GLOBALS['phpgw']->preferences->read_repository();
!               
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault'])
!               {
!                       
$entry_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault']]
 = ' selected';
!               }
! 
!               
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['assigntodefault'])
!               {
!                       
$account_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['assigntodefault']]
 = ' selected';
!               }
! 
!               
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault'])
!               {
!                       
$priority_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault']]
 = ' selected';
!               }
! 
!               $GLOBALS['phpgw']->template->set_file(array(
!                       'newticket'   => 'newticket.tpl'
!               ));
!               
$GLOBALS['phpgw']->template->set_block('newticket','options_select');
!               $GLOBALS['phpgw']->template->set_block('newticket','form');
! 
!               
$GLOBALS['phpgw']->template->set_var('lang_create_new_ticket',lang('Create new 
ticket'));
!               $GLOBALS['phpgw']->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/tts/newticket.php'));
! 
!               
$GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
!               $GLOBALS['phpgw']->template->set_var('lang_group', 
lang('Group'));
!               $GLOBALS['phpgw']->template->set_var('lang_subject', 
lang('Subject') );
!               $GLOBALS['phpgw']->template->set_var('lang_nosubject', lang('No 
subject'));
!               $GLOBALS['phpgw']->template->set_var('lang_details', 
lang('Details'));
!               $GLOBALS['phpgw']->template->set_var('lang_priority', 
lang('Priority'));
!               $GLOBALS['phpgw']->template->set_var('lang_lowest', 
lang('Lowest'));
!               $GLOBALS['phpgw']->template->set_var('lang_medium', 
lang('Medium'));
!               $GLOBALS['phpgw']->template->set_var('lang_highest', 
lang('Highest'));
!               $GLOBALS['phpgw']->template->set_var('lang_addticket', 
lang('Add Ticket'));
!               $GLOBALS['phpgw']->template->set_var('lang_clearform', 
lang('Clear Form'));
!               
$GLOBALS['phpgw']->template->set_var('lang_assignedto',lang('Assign to'));
!               
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
!               
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
! 
!               
$GLOBALS['phpgw']->template->set_var('lang_billable_hours',lang('Billable 
hours'));
!               
$GLOBALS['phpgw']->template->set_var('lang_billable_hours_rate',lang('Billable 
hours rate'));
! 
!               $GLOBALS['phpgw']->template->set_var('row_off', 
$GLOBALS['phpgw_info']['theme']['row_off']);
!               $GLOBALS['phpgw']->template->set_var('row_on', 
$GLOBALS['phpgw_info']['theme']['row_on']);
!               $GLOBALS['phpgw']->template->set_var('th_bg', 
$GLOBALS['phpgw_info']['theme']['th_bg']);
! 
!               
$GLOBALS['phpgw']->template->set_var('value_details',$ticket['details']);
!               
$GLOBALS['phpgw']->template->set_var('value_subject',$ticket['details']);
!               
$GLOBALS['phpgw']->template->set_var('value_billable_hours',($ticket['billable_hours']?$ticket['billable_hours']:'0.00'));
!               
$GLOBALS['phpgw']->template->set_var('value_billable_hours_rate',($ticket['billable_rate']?$ticket['billable_rate']:'0.00'));
! 
!               unset($s);
!               $groups = CreateObject('phpgwapi.accounts');
!               $group_list = array();
!               $group_list = 
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
! 
!               while(list($key,$entry) = each($group_list))
!               {
!                       $GLOBALS['phpgw']->template->set_var('optionname', 
$entry['account_name']);
!                       $GLOBALS['phpgw']->template->set_var('optionvalue', 
$entry['account_id']);
!                       $GLOBALS['phpgw']->template->set_var('optionselected', 
$tag);
!                       
$GLOBALS['phpgw']->template->parse('options_group','options_select',true);
!               }
! 
!               $s = '<select name="ticket[category]">' . 
$GLOBALS['phpgw']->categories->formated_list('select','',$group,True) . 
'</select>';
!               $GLOBALS['phpgw']->template->set_var('value_category',$s);
! 
!               unset($s);
!               $accounts = $groups;
!               $accounts->account_id = $group_id;
!               $account_list = $accounts->get_list('accounts');
!               while(list($key,$entry) = each($account_list))
!               {
!                       $s .= '<option value="' . $entry['account_id'] . '" ' . 
$account_selected[$entry['account_lid']]
!                               . '>' . $entry['account_lid'] . '</option>';
!               }
!               
$GLOBALS['phpgw']->template->set_var('value_assignedto','<select 
name="ticket[assignedto]">' . $s . '</select>');
! 
!               //$GLOBALS['phpgw']->template->set_var('tts_account_lid','0');
!               
//$GLOBALS['phpgw']->template->set_var('tts_account_name',lang('None'));
! 
!               // Choose the correct priority to display
!               $prority_selected[$ticket['priority']] = ' selected';
!               $priority_comment[1]  = ' - '.lang('Lowest');
!               $priority_comment[5]  = ' - '.lang('Medium');
!               $priority_comment[10] = ' - '.lang('Highest');
!               for($i=1; $i<=10; $i++)
!               {
!                       $priority_select .= '<option value="' . $i . '">' . $i 
. $priority_comment[$i] . '</option>';
!               }
!               $GLOBALS['phpgw']->template->set_var('value_priority','<select 
name="ticket[priority]">' . $priority_select . '</select>');
! 
!               $GLOBALS['phpgw']->template->set_var('tts_select_options','');
!               $GLOBALS['phpgw']->template->set_var('tts_new_lstcategory','');
!               $GLOBALS['phpgw']->template->set_var('tts_new_lstassignto','');
! 
!               $GLOBALS['phpgw']->template->pfp('out','form');
!               $GLOBALS['phpgw']->common->phpgw_footer();
!       }
!       else
!       {
!       }
! ?>
--- 1,248 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Trouble Ticket System                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       // $Id$
!       // $Source$
! 
!       $submit = $_POST['submit'];
!       $cancel = $_POST['cancel'];
!       if($submit || $cancel)
!       {
!               $GLOBALS['phpgw_info']['flags'] = array(
!                       'noheader' => True,
!                       'nonavbar' => True
!               );
!       }
! 
!       $GLOBALS['phpgw_info']['flags']['currentapp']          = 'tts';
!       $GLOBALS['phpgw_info']['flags']['enable_send_class']   = True;
!       $GLOBALS['phpgw_info']['flags']['enable_config_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_categories_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_vfs_class'] = True;
! 
!       include('../header.inc.php');
!  
!       $GLOBALS['phpgw']->config->read_repository();
! 
!       if($cancel)
!       {
!               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/tts/index.php'));
!       }
! 
!       if($submit)
!       {       
!               //File-Upload
!               if ($HTTP_POST_FILES['attachment']['name'] != '')
!               {
!                       //Check if home/groupdirectory exists. If not, we 
create it
!                       if (!file_exists($GLOBALS['basedir'] . "/home/tts"))
!                       {
!                               $GLOBALS['phpgw']->vfs->mkdir (array (
!                                               'string' => $GLOBALS['basedir'] 
. "/home/tts",
!                                               'relatives' => array 
(RELATIVE_ALL)));
!                       }                       
!                       
!                       $tid = $ticket_id = 
$phpgw->db->get_last_insert_id('phpgw_tts_tickets','ticket_id');
!                       $attdir = "home/tts/t" . $tid;                  
! 
!                       $GLOBALS['phpgw']->vfs->mkdir (array (
!                                               'string' => $attdir,
!                                               'relatives' => array 
(RELATIVE_ALL)));
!               
!                       $GLOBALS['phpgw']->vfs->cp(array (
!                                               'from'  => 
$HTTP_POST_FILES['attachment']['tmp_name'],
!                                               'to'    => $attdir . '/' . 
$HTTP_POST_FILES['attachment']['name'],
!                                               'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)));
!                       
!                       $GLOBALS['phpgw']->db->query("SELECT max(file_id) from 
phpgw_vfs",__LINE__,__FILE__);
!                       $GLOBALS['phpgw']->db->next_record();
!                       $file_id = $GLOBALS['phpgw']->db->f('max(file_id)');
!               }
!                       
!               $GLOBALS['phpgw']->db->query("insert into phpgw_tts_tickets 
(ticket_group,ticket_priority,ticket_owner,"
!                       . 
"ticket_assignedto,ticket_subject,ticket_category,ticket_billable_hours,"
!                       . 
"ticket_billable_rate,ticket_status,ticket_deadline,ticket_effort,ticket_type,ticket_platform,ticket_attachment,ticket_details)
 values ('"
!                         . $_POST['ticket']['group'] . "','"
!                       . $_POST['ticket']['priority'] . "','"
!                       . $GLOBALS['phpgw_info']['user']['account_id'] . "','"
!                       . $_POST['ticket']['assignedto'] . "','"
!                       . $_POST['ticket']['subject'] . "','"
!                       . $_POST['ticket']['category'] . "','"
!                       . $_POST['ticket']['billable_hours'] . "','"
!                       . $_POST['ticket']['billable_rate'] . "','O','"
!                       . $_POST['ticket']['deadline']['year'] . "-" . 
$_POST['ticket']['deadline']['month'] . "-" . 
$_POST['ticket']['deadline']['day'] . "','"
!                       . $_POST['ticket']['effort'] . "','"
!                       . $_POST['ticket']['type'] . "','"
!                       . $_POST['ticket']['platform'] . "','"
!                       . $file_id . "','"
!                       . addslashes($ticket['details']) . 
"')",__LINE__,__FILE__);
! 
!               $ticket_id = 
$GLOBALS['phpgw']->db->get_last_insert_id('phpgw_tts_tickets','ticket_id');
! 
!               $historylog = createobject('phpgwapi.historylog','tts');
!               $historylog->add('O',$ticket_id,' ','');
! 
!               if($GLOBALS['phpgw']->config->config_data['mailnotification'])
!               {
!                       mail_ticket($ticket_id);
!               }
! 
!               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/tts/viewticket_details.php','&ticket_id='
 . $ticket_id));
!       }
! 
!       $account_selected  = array();
!       $entry_selected    = array();
!       $priority_selected = array();
!       $priority_comment  = array();
! 
!       if(!$submit)
!       {
!               $GLOBALS['phpgw']->preferences->read_repository();
!               
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault'])
!               {
!                       
$entry_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['groupdefault']]
 = ' selected';
!               }
! 
!               
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['assigntodefault'])
!               {
!                       
$account_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['assigntodefault']]
 = ' selected';
!               }
! 
!               
if($GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault'])
!               {
!                       
$priority_selected[$GLOBALS['phpgw_info']['user']['preferences']['tts']['prioritydefault']]
 = ' selected';
!               }
! 
!               $GLOBALS['phpgw']->template->set_file(array(
!                       'newticket'   => 'newticket.tpl'
!               ));
!               
$GLOBALS['phpgw']->template->set_block('newticket','options_select');
!               $GLOBALS['phpgw']->template->set_block('newticket','form');
! 
!               
$GLOBALS['phpgw']->template->set_var('lang_create_new_ticket',lang('Create new 
ticket'));
!               $GLOBALS['phpgw']->template->set_var('form_action', 
$GLOBALS['phpgw']->link('/tts/newticket.php'));
! 
!               
$GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
!               $GLOBALS['phpgw']->template->set_var('lang_group', 
lang('Group'));
!               $GLOBALS['phpgw']->template->set_var('lang_subject', 
lang('Subject') );
!               $GLOBALS['phpgw']->template->set_var('lang_nosubject', lang('No 
subject'));
!               $GLOBALS['phpgw']->template->set_var('lang_details', 
lang('Details'));
!               $GLOBALS['phpgw']->template->set_var('lang_priority', 
lang('Priority'));
!               $GLOBALS['phpgw']->template->set_var('lang_lowest', 
lang('Lowest'));
!               $GLOBALS['phpgw']->template->set_var('lang_medium', 
lang('Medium'));
!               $GLOBALS['phpgw']->template->set_var('lang_highest', 
lang('Highest'));
!               $GLOBALS['phpgw']->template->set_var('lang_addticket', 
lang('Add Ticket'));
!               $GLOBALS['phpgw']->template->set_var('lang_clearform', 
lang('Clear Form'));
!               
$GLOBALS['phpgw']->template->set_var('lang_assignedto',lang('Assign to'));
!               
$GLOBALS['phpgw']->template->set_var('lang_submit',lang('Submit'));
!               
$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
! 
!               
$GLOBALS['phpgw']->template->set_var('lang_billable_hours',lang('Billable 
hours'));
!               
$GLOBALS['phpgw']->template->set_var('lang_billable_hours_rate',lang('Billable 
hours rate'));
! 
!               $GLOBALS['phpgw']->template->set_var('row_off', 
$GLOBALS['phpgw_info']['theme']['row_off']);
!               $GLOBALS['phpgw']->template->set_var('row_on', 
$GLOBALS['phpgw_info']['theme']['row_on']);
!               $GLOBALS['phpgw']->template->set_var('th_bg', 
$GLOBALS['phpgw_info']['theme']['th_bg']);
! 
!               
$GLOBALS['phpgw']->template->set_var('value_details',$ticket['details']);
!               
$GLOBALS['phpgw']->template->set_var('value_subject',$ticket['details']);
!               
$GLOBALS['phpgw']->template->set_var('value_billable_hours',($ticket['billable_hours']?$ticket['billable_hours']:'0.00'));
!               
$GLOBALS['phpgw']->template->set_var('value_billable_hours_rate',($ticket['billable_rate']?$ticket['billable_rate']:'0.00'));
!               
$GLOBALS['phpgw']->template->set_var('currency',$GLOBALS['phpgw_info']['user']['preferences']['common']['currency']);
! 
!               $GLOBALS['phpgw']->template->set_var('lang_type',lang('Type'));
!               
$GLOBALS['phpgw']->template->set_var('lang_deadline',lang('Deadline'));
!               
$GLOBALS['phpgw']->template->set_var('lang_effort',lang('Effort'));
!               
$GLOBALS['phpgw']->template->set_var('lang_platform',lang('Platform'));
!               
$GLOBALS['phpgw']->template->set_var('lang_attachment',lang('Attachment'));
!               
!               unset($s);
!               $groups = CreateObject('phpgwapi.accounts');
!               $group_list = array();
!               $group_list = 
$GLOBALS['phpgw']->accounts->membership($GLOBALS['phpgw_info']['user']['account_id']);
! 
!               while(list($key,$entry) = each($group_list))
!               {
!                       $GLOBALS['phpgw']->template->set_var('optionname', 
$entry['account_name']);
!                       $GLOBALS['phpgw']->template->set_var('optionvalue', 
$entry['account_id']);
!                       $GLOBALS['phpgw']->template->set_var('optionselected', 
$tag);
!                       
$GLOBALS['phpgw']->template->parse('options_group','options_select',true);
!               }
! 
!               $s = '<select name="ticket[category]">' . 
$GLOBALS['phpgw']->categories->formated_list('select','',$group,False) . 
'</select>';
!               $GLOBALS['phpgw']->template->set_var('value_category',$s);
! 
!               unset($s);
!               for($i=1; $i<=31; $i++)
!               {
!                       $i < 10 ? $y = '0' . $i : $y = $i;
!                       $s .= '<option>' . $y . '</option>';
!               }
!               $GLOBALS['phpgw']->template->set_var('option_day','<select 
name="ticket[deadline][day]"><option selected></option>' . $s . '</select>');
!               
!               unset($s);
!               for($i=1; $i<=12; $i++)
!               {
!                       $i < 10 ? $y = '0' . $i : $y = $i;
!                       $s .= '<option>' . $y . '</option>';
!               }
!               $GLOBALS['phpgw']->template->set_var('option_month','<select 
name="ticket[deadline][month]"><option selected></option>' . $s . '</select>');
!               
!               unset($s);
!               $accounts = $groups;
!               $accounts->account_id = $group_id;
!               $account_list = $accounts->get_list('accounts');
!               while(list($key,$entry) = each($account_list))
!               {
!                       $s .= '<option value="' . $entry['account_id'] . '" ' . 
$account_selected[$entry['account_lid']]
!                               . '>' . $entry['account_lid'] . '</option>';
!               }
!               
$GLOBALS['phpgw']->template->set_var('value_assignedto','<select 
name="ticket[assignedto]">' . $s . '</select>');
! 
!               //auswahlfelder type und platform
! 
! 
!         $platform = 
CreateObject('tts.subcategories',$GLOBALS['phpgw_info']['user']['account_id'],'tts');
!               unset($s);
!               $s = '<select name="ticket[platform]">' . 
$platform->formated_list('select','appandplatform','',False) . '</select>';
!               $GLOBALS['phpgw']->template->set_var('value_platform',$s);
!               
!               
!               $type = 
CreateObject('tts.subcategories',$GLOBALS['phpgw_info']['user']['account_id'],'tts');
!               unset($s);
!               $s = '<select name="ticket[type]">' . 
$type->formated_list('select','appandtype','',False) . '</select>';
!               $GLOBALS['phpgw']->template->set_var('value_type',$s);
!               
!               //$GLOBALS['phpgw']->template->set_var('tts_account_lid','0');
!               
//$GLOBALS['phpgw']->template->set_var('tts_account_name',lang('None'));
! 
!               // Choose the correct priority to display
!               $prority_selected[$ticket['priority']] = ' selected';
!               $priority_comment[1]  = ' - '.lang('Lowest');
!               $priority_comment[5]  = ' - '.lang('Medium');
!               $priority_comment[10] = ' - '.lang('Highest');
!               for($i=1; $i<=10; $i++)
!               {
!                       $priority_select .= '<option value="' . $i . '">' . $i 
. $priority_comment[$i] . '</option>';
!               }
!               $GLOBALS['phpgw']->template->set_var('value_priority','<select 
name="ticket[priority]">' . $priority_select . '</select>');
! 
!               $GLOBALS['phpgw']->template->set_var('tts_select_options','');
!               $GLOBALS['phpgw']->template->set_var('tts_new_lstcategory','');
!               $GLOBALS['phpgw']->template->set_var('tts_new_lstassignto','');
! 
!               $GLOBALS['phpgw']->template->pfp('out','form');
!               $GLOBALS['phpgw']->common->phpgw_footer();
!       }
!       else
!       {
!       }
! ?>

--- NEW FILE: README ---
New functions for TroubleTicketSystem

- Attachments
To add an attachment to a ticket, a group tts has to be created and every user,
who works with tts has to be in that group.

- New field "Type"
If Setup works correctly, the subcategories needed schould be created. If not,
create a global (under admin->admin, not admin->tts) category called "tts" and
a subcategory called "type". Every
subcategory added under "type" will then appear in the field.

- New field "Platform"
Same as "Type", with "platform" being a subcategory of "tts".

- New field "Effort"
It's just a string ;-)

- Auto-Filters
There are dropdown-boxes for "category", "assigned to", "created by" and 
"priority".
Choose any entry from the boxes and the list of tickets will be filtered.


Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/index.php,v
retrieving revision 1.43.2.7.2.2
retrieving revision 1.43.2.7.2.2.2.1
diff -C2 -d -r1.43.2.7.2.2 -r1.43.2.7.2.2.2.1
*** index.php   5 Mar 2003 22:34:55 -0000       1.43.2.7.2.2
--- index.php   31 Oct 2003 07:06:58 -0000      1.43.2.7.2.2.2.1
***************
*** 1,272 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Trouble Ticket System                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       /* Note to self:
!       ** Self ... heres the query to use when limiting access to entrys 
within a group
!       ** The acl class *might* handle this instead .... not sure
!       ** select distinct group_ticket_id, phpgw_tts_groups.group_ticket_id, 
phpgw_tts_tickets.*
!       ** from phpgw_tts_tickets, phpgw_tts_groups where ticket_id = 
group_ticket_id and group_id in (14,15);
!       */
! 
!       /* ACL levels
!       ** 1 - Read ticket within your group only
!       ** 2 - Close ticket
!       ** 4 - Allow to make changes to priority, billing hours, billing rate, 
category, and assigned to
!       */
! 
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'tts';
!       $GLOBALS['phpgw_info']['flags']['enable_contacts_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_categories_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_nextmatchs_class'] = True;
!       include('../header.inc.php');
! 
!       $GLOBALS['phpgw']->historylog = 
createobject('phpgwapi.historylog','tts');
! 
!       $GLOBALS['phpgw']->template->set_file('index','index.tpl');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_title', 
'tts_title');
! //    $GLOBALS['phpgw']->template->set_block('index', 'tts_links', 
'tts_links');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_search', 
'tts_search');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_list', 'tts_list');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_row', 'tts_row');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_col_ifviewall', 
'tts_col_ifviewall');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_head_ifviewall', 
'tts_head_ifviewall');
! //    $GLOBALS['phpgw']->template->set_block('index', 'tts_ticket_id_read', 
'tts_ticket_id_read');
! //    $GLOBALS['phpgw']->template->set_block('index', 'tts_ticket_id_unread', 
'tts_ticket_id_unread');
! 
!       $GLOBALS['phpgw']->template->set_var('lang_appname', lang('Trouble 
Ticket System'));
!       $GLOBALS['phpgw']->template->set_var('tts_newticket_link', 
$GLOBALS['phpgw']->link('/tts/newticket.php'));
!       $GLOBALS['phpgw']->template->set_var('tts_search_link', 
$GLOBALS['phpgw']->link('/tts/index.php'));
!       $GLOBALS['phpgw']->template->set_var('tts_prefs_link', 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=tts'));
!       $GLOBALS['phpgw']->template->set_var('lang_preferences', 
lang('Preferences'));
!       $GLOBALS['phpgw']->template->set_var('lang_search', lang('search'));
!       $GLOBALS['phpgw']->template->set_var('tts_newticket', lang('New 
ticket'));
!       $GLOBALS['phpgw']->template->set_var('tts_head_status','');
!       $GLOBALS['phpgw']->template->set_var('tts_notickets','');
!       $GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
! 
!       // select what tickets to view
!       $filter = $HTTP_GET_VARS['filter'];
!       $start  = $HTTP_GET_VARS['start'];
!       $sort   = $HTTP_GET_VARS['sort'];
!       $order  = $HTTP_GET_VARS['order'];
! 
!       if (!$filter)
!       {
!               $filter='viewopen';
!       }
!       if ($filter == 'viewopen') 
!       {
!               $filtermethod = "where ticket_status='O'";
! 
!               $GLOBALS['phpgw']->preferences->read_repository();
!               if 
($GLOBALS['phpgw_info']['user']['preferences']['tts']['refreshinterval'])
!               {
!                       
$GLOBALS['phpgw']->template->set_var('autorefresh','<META HTTP-EQUIV="Refresh" 
CONTENT="'.$GLOBALS['phpgw_info']['user']['preferences']['tts']['refreshinterval'].';
 URL='.$GLOBALS['phpgw']->link('/tts/index.php').'">');
!               }
!               else
!               {
!                       $GLOBALS['phpgw']->template->set_var('autorefresh','');
!               }
!       }
!       if ($filter == 'search') 
!       {
!               $filtermethod = "where ticket_details like 
'%".addslashes($searchfilter)."%'";
!               
$GLOBALS['phpgw']->template->set_var('tts_searchfilter',addslashes($searchfilter));
!       }
! 
!       if (!$sort)
!       {
!               $sortmethod = 'order by ticket_priority desc';
!       }
!       else
!       {
!               $sortmethod = "order by $order $sort";
!       }
! 
!       $GLOBALS['phpgw']->db->query("select count(*) from 
phpgw_tts_tickets",__LINE__,__FILE__);
!       $GLOBALS['phpgw']->db->next_record();
!       $numtotal = $GLOBALS['phpgw']->db->f('0') ;
! 
!       $GLOBALS['phpgw']->db->query("select count(*) from phpgw_tts_tickets 
where ticket_status='O'",__LINE__,__FILE__);
!       $GLOBALS['phpgw']->db->next_record();
!       $numopen = $GLOBALS['phpgw']->db->f('0') ;
! 
!       $GLOBALS['phpgw']->template->set_var('tts_numtotal',lang('Tickets total 
%1',$numtotal));
!       $GLOBALS['phpgw']->template->set_var('tts_numopen',lang('Tickets open 
%1',$numopen));
! 
! 
!       $db2 = $GLOBALS['phpgw']->db;
!       $GLOBALS['phpgw']->db->query("select * from phpgw_tts_tickets 
$filtermethod $sortmethod",__LINE__,__FILE__);
!       $numfound = $GLOBALS['phpgw']->db->num_rows();
! 
!       if ($filter == 'search')
!       {
!               $filtermethod = "where ticket_details like 
'%".addslashes($searchfilter)."%'";
!               
$GLOBALS['phpgw']->template->set_var('tts_searchfilter',addslashes($searchfilter));
!               
$GLOBALS['phpgw']->template->set_var('tts_numfound',lang('Tickets found 
%1',$numfound));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_searchfilter','');
!               $GLOBALS['phpgw']->template->set_var('tts_numfound','');
!       }
! 
!       if ($filter != 'viewopen')
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_changeview_link', 
$GLOBALS['phpgw']->link('/tts/index.php'));
!               $GLOBALS['phpgw']->template->set_var('tts_changeview', 
lang('View only open tickets'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_changeview_link', 
$GLOBALS['phpgw']->link('/tts/index.php','filter=viewall'));
!               $GLOBALS['phpgw']->template->set_var('tts_changeview', 
lang('View all tickets'));
!       }
! 
!       $GLOBALS['phpgw']->template->set_var('tts_ticketstotal', lang('Tickets 
total %1',$numtotal));
!       $GLOBALS['phpgw']->template->set_var('tts_ticketsopen', lang('Tickets 
open %1',$numopen));
!       
!       // fill header
!       
$GLOBALS['phpgw']->template->set_var('tts_head_bgcolor',$GLOBALS['phpgw_info']['theme']['th_bg']
 );
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']
 );
!       $GLOBALS['phpgw']->template->set_var('tts_head_ticket', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_id',$order,'/tts/index.php',lang('Ticket').'
 #'));
!       $GLOBALS['phpgw']->template->set_var('tts_head_prio', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_priority',$order,'/tts/index.php',lang('Prio')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_group',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_group',$order,'/tts/index.php',lang('Group')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_category',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_category',$order,'/tts/index.php',lang('Category')));
!       $GLOBALS['phpgw']->template->set_var('tts_head_assignedto', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_assignedto',$order,'/tts/index.php',lang('Assigned
 to')));
!       $GLOBALS['phpgw']->template->set_var('tts_head_openedby', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_owner',$order,'/tts/index.php',lang('Opened
 by')));
! 
!       // I am not sure how the sorting will work for this, if at all. (jengo)
!       $GLOBALS['phpgw']->template->set_var('tts_head_dateopened',lang('Date 
opened'));
! //    $GLOBALS['phpgw']->template->set_var('tts_head_dateopened', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'',$order,'/tts/index.php',lang('Date
 opened')));
!       if ($filter != 'viewopen')
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_head_dateclosed', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_status',$order,'/tts/index.php',lang('Status/Date
 closed')));
!               
$GLOBALS['phpgw']->template->parse('tts_head_status','tts_head_ifviewall',false);
!       }
!       $GLOBALS['phpgw']->template->set_var('tts_head_subject', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_subject',$order,'/tts/index.php',lang('Subject')));
! 
!       if ($GLOBALS['phpgw']->db->num_rows() == 0)
!       {
!               $GLOBALS['phpgw']->template->set_var('rows', 
'<p><center>'.lang('No tickets found').'</center>');
!       }
!       else
!       {
!               while ($GLOBALS['phpgw']->db->next_record())
!               {
!                       
$GLOBALS['phpgw']->template->set_var('tts_col_status','');
!                       $priority = $GLOBALS['phpgw']->db->f('ticket_priority');
!                       switch ($priority)
!                       {
!                               case 1:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg01']; break;
!                               case 2:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg02']; break;
!                               case 3:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg03']; break;
!                               case 4:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg04']; break;
!                               case 5:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg05']; break;
!                               case 6:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg06']; break;
!                               case 7:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg07']; break;
!                               case 8:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg08']; break;
!                               case 9:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg09']; break;
!                               case 10: $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg10']; break;
!                               default: $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg_color'];
!                       }
! 
!                       if ($filter!="viewopen" && 
$GLOBALS['phpgw']->db->f('t_timestamp_closed'))
!                       {
!                               $tr_color = 
$GLOBALS['phpgw_info']['theme']['th_bg']; /*"#CCCCCC";*/
!                       }
! 
!                       $db2->query("select count(*) from phpgw_tts_views where 
view_id='" . $GLOBALS['phpgw']->db->f('ticket_id')
!                               . "' and view_account_id='" . 
$GLOBALS['phpgw_info']['user']['account_id'] . "'",__LINE__,__FILE__);
!                       $db2->next_record();
! 
!                       if ($db2->f(0))
!                       {
!                               $ticket_read = True;
!                       }
!                       else
!                       {
!                               $ticket_read = False;
!                       }
! 
!                       $GLOBALS['phpgw']->template->set_var('tts_row_color', 
$tr_color );
!                       
$GLOBALS['phpgw']->template->set_var('tts_ticketdetails_link', 
$GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=' . 
$GLOBALS['phpgw']->db->f('ticket_id')));
! 
!                       
$GLOBALS['phpgw']->template->set_var('row_ticket_id','<a href="' . 
$GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=' . 
$GLOBALS['phpgw']->db->f('ticket_id')) . '">' . 
$GLOBALS['phpgw']->db->f('ticket_id') . '</a>');
! 
!                       if (! $ticket_read)
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('row_status','<img 
src="templates/default/images/updated.gif">');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('row_status','&nbsp;');
!                       }
! 
!                       $priostr = '';
!                       while ($priority > 0)
!                       {
!                               $priostr = $priostr . "||";
!                               $priority--;
!                       }
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_priostr',$priostr );
! 
!                       $cat_name   = 
$GLOBALS['phpgw']->categories->id2name($GLOBALS['phpgw']->db->f('ticket_category'));
!                       
$GLOBALS['phpgw']->template->set_var('row_category',$cat_name);
! 
!                       $group_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_group'));
!                       $group_name = ($group_name ? $group_name : '--');
!                       
$GLOBALS['phpgw']->template->set_var('row_group',$group_name);
! 
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_assignedto', 
$GLOBALS['phpgw']->db->f('ticket_assignedto')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto')):lang('None'));
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_user',$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_owner')));
! 
!                       $history_values = 
$GLOBALS['phpgw']->historylog->return_array(array(),array('O'),'history_timestamp','ASC',$GLOBALS['phpgw']->db->f('ticket_id'));
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_timestampopened',$GLOBALS['phpgw']->common->show_date($history_values[0]['datetime']
 - ((60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])));
! 
!                       if ($GLOBALS['phpgw']->db->f('ticket_status') == 'X')
!                       {
!                               $history_values = 
$GLOBALS['phpgw']->historylog->return_array(array(),array('X'),'history_timestamp','DESC',$GLOBALS['phpgw']->db->f('ticket_id'));
!                               
$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',$GLOBALS['phpgw']->common->show_date($history_values[0]['datetime']
 - ((60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])));
!                               
$GLOBALS['phpgw']->template->parse('tts_col_status','tts_col_ifviewall',False);
!                       }
!                       elseif ($filter != 'viewopen')
!                       {
! //                            if 
($GLOBALS['phpgw']->db->f('ticket_assignedto') != -1)
! //                            {
! //                                    $assigned_to = lang('Not assigned');
! //                            }
! //                            else
! //                            {
! //                                    $assigned_to = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto'));
! //                            }
! //                            
$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',$assigned_to);
!                               
$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',lang('Open'));
!                               
$GLOBALS['phpgw']->template->parse('tts_col_status','tts_col_ifviewall',False);
!                       }
!                       $GLOBALS['phpgw']->template->set_var('tts_t_subject', 
$GLOBALS['phpgw']->db->f('ticket_subject'));
! 
!                       
$GLOBALS['phpgw']->template->parse('rows','tts_row',True);
!               }
!       }
! 
!       // this is a workaround to clear the subblocks autogenerated vars
!       $GLOBALS['phpgw']->template->set_var('tts_row','');
!       $GLOBALS['phpgw']->template->set_var('tts_col_ifviewall','');
!       $GLOBALS['phpgw']->template->set_var('tts_head_ifviewall','');
!       $GLOBALS['phpgw']->template->set_var('tts_ticket_id_read','');
!       $GLOBALS['phpgw']->template->set_var('tts_ticket_id_unread','');
! 
!       $GLOBALS['phpgw']->template->pfp('out','index');
! 
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,418 ----
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Trouble Ticket System                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
! 
!       /* $Id$ */
! 
!       /* Note to self:
!       ** Self ... heres the query to use when limiting access to entrys 
within a group
!       ** The acl class *might* handle this instead .... not sure
!       ** select distinct group_ticket_id, phpgw_tts_groups.group_ticket_id, 
phpgw_tts_tickets.*
!       ** from phpgw_tts_tickets, phpgw_tts_groups where ticket_id = 
group_ticket_id and group_id in (14,15);
!       */
! 
!       /* ACL levels
!       ** 1 - Read ticket within your group only
!       ** 2 - Close ticket
!       ** 4 - Allow to make changes to priority, billing hours, billing rate, 
category, and assigned to
!       */
! 
!       $GLOBALS['phpgw_info']['flags']['currentapp'] = 'tts';
!       $GLOBALS['phpgw_info']['flags']['enable_contacts_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_categories_class'] = True;
!       $GLOBALS['phpgw_info']['flags']['enable_nextmatchs_class'] = True;
!       include('../header.inc.php');
!       
!       $GLOBALS['phpgw']->historylog = 
createobject('phpgwapi.historylog','tts');
! 
!       $GLOBALS['phpgw']->template->set_file('index','index.tpl');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_title', 
'tts_title');
! //    $GLOBALS['phpgw']->template->set_block('index', 'tts_links', 
'tts_links');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_search', 
'tts_search');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_list', 'tts_list');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_row', 'tts_row');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_col_ifviewall', 
'tts_col_ifviewall');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_head_ifviewall', 
'tts_head_ifviewall');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_ticket_id_read', 
'tts_ticket_id_read');
!       $GLOBALS['phpgw']->template->set_block('index', 'tts_ticket_id_unread', 
'tts_ticket_id_unread');
! 
!       $GLOBALS['phpgw']->template->set_var('lang_appname', lang('Trouble 
Ticket System'));
!       $GLOBALS['phpgw']->template->set_var('tts_newticket_link', 
$GLOBALS['phpgw']->link('/tts/newticket.php'));
!       $GLOBALS['phpgw']->template->set_var('tts_search_link', 
$GLOBALS['phpgw']->link('/tts/index.php'));
!       $GLOBALS['phpgw']->template->set_var('tts_prefs_link', 
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=tts'));
!       $GLOBALS['phpgw']->template->set_var('lang_preferences', 
lang('Preferences'));
!       $GLOBALS['phpgw']->template->set_var('lang_search', lang('search'));
!       $GLOBALS['phpgw']->template->set_var('tts_newticket', lang('New 
ticket'));
!       $GLOBALS['phpgw']->template->set_var('tts_head_status','');
!       $GLOBALS['phpgw']->template->set_var('tts_notickets','');
!       $GLOBALS['phpgw']->template->set_var('lang_category',lang('Category'));
!       $GLOBALS['phpgw']->template->set_var('tts_autofilter_link', 
$GLOBALS['phpgw']->link('/tts/index.php'));
!       $GLOBALS['phpgw']->template->set_var('lang_filter', lang('filter'));
!       
!       
!       // select what tickets to view
!       $filter = $_POST['searchfilter'];
!       $start  = $_GET['start'];
!       $sort   = $_GET['sort'];
!       $order  = $_GET['order'];
! 
!       if (!$filter)
!       {
!               $filter='viewopen';
!       }
!       if ($filter == 'viewopen') 
!       {
!               $filtermethod = "where ticket_status='O'";
! 
!               $GLOBALS['phpgw']->preferences->read_repository();
!               if 
($GLOBALS['phpgw_info']['user']['preferences']['tts']['refreshinterval'])
!               {
!                       
$GLOBALS['phpgw']->template->set_var('autorefresh','<META HTTP-EQUIV="Refresh" 
CONTENT="'.$GLOBALS['phpgw_info']['user']['preferences']['tts']['refreshinterval'].';
 URL='.$GLOBALS['phpgw']->link('/tts/index.php').'">');
!               }
!               else
!               {
!                       $GLOBALS['phpgw']->template->set_var('autorefresh','');
!               }
!       }
! 
!       if ($filter != 'viewopen') 
!       {               
!               $filtermethod = "where ticket_details like 
'".addslashes($searchfilter)."' or ticket_subject like 
'".addslashes($searchfilter)."'";
!               
$GLOBALS['phpgw']->template->set_var('tts_searchfilter',addslashes($searchfilter));
!       }
! 
!       if (!$sort)
!       {
!               $sortmethod = 'order by ticket_priority desc';
!       }
!       else
!       {
!               $sortmethod = "order by $order $sort";
!       }
! 
!       $GLOBALS['phpgw']->db->query("select count(*) from 
phpgw_tts_tickets",__LINE__,__FILE__);
!       $GLOBALS['phpgw']->db->next_record();
!       $numtotal = $GLOBALS['phpgw']->db->f('0') ;
! 
!       $GLOBALS['phpgw']->db->query("select count(*) from phpgw_tts_tickets 
where ticket_status='O'",__LINE__,__FILE__);
!       $GLOBALS['phpgw']->db->next_record();
!       $numopen = $GLOBALS['phpgw']->db->f('0') ;
! 
!       $GLOBALS['phpgw']->template->set_var('tts_numtotal',lang('Tickets total 
%1',$numtotal));
!       $GLOBALS['phpgw']->template->set_var('tts_numopen',lang('Tickets open 
%1',$numopen));
!       
!       if($filter == 'viewopen')
!       {
!               //Filter überprüfen und ausführen *START*
!               if($_POST['ticket']['filter_prio'] != "")
!               {
!                       $filterstring = " and ticket_priority like 
".$_POST['ticket']['filter_prio'];
!               }
!       
!               if($_POST['ticket']['filter_owner'] != "")
!               {
!                       $filterstring1 = " and ticket_owner like 
'".$GLOBALS['phpgw']->accounts->name2id($_POST['ticket']['filter_owner'])."'";
!               }
! 
!               if($_POST['ticket']['filter_assignedto'] != "")
!               {
!                       $filterstring2 = " and ticket_assignedto like 
'".$GLOBALS['phpgw']->accounts->name2id($_POST['ticket']['filter_assignedto'])."'";
!               }
!       
!               if($_POST['ticket']['filter_category'] != "")
!               {
!                       $filterstring3 = " and ticket_category like '" . 
$GLOBALS['phpgw']->categories->name2id($_POST['ticket']['filter_category']) . 
"'";
!               }
!       
!               $filtermethod = "where 1" . $filterstring . $filterstring1 . 
$filterstring2 . $filterstring3; 
!       }
! 
!       $db2 = $GLOBALS['phpgw']->db;
!       $GLOBALS['phpgw']->db->query("select * from phpgw_tts_tickets 
$filtermethod $sortmethod",__LINE__,__FILE__);
!       $numfound = $GLOBALS['phpgw']->db->num_rows();
! 
!       if ($filter != '' || $filter == 'viewopen')
!       {
!               $filtermethod = "where ticket_details like 
'%".addslashes($searchfilter)."%' or ticket_subject like 
'%".addslashes($searchfilter)."%'";
!               
$GLOBALS['phpgw']->template->set_var('tts_searchfilter',addslashes($searchfilter));
!               
$GLOBALS['phpgw']->template->set_var('tts_numfound',lang('Tickets found 
%1',$numfound));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_searchfilter','');
!               $GLOBALS['phpgw']->template->set_var('tts_numfound','');
!       }
! 
!       if ($filter != 'viewopen')
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_changeview_link', 
$GLOBALS['phpgw']->link('/tts/index.php'));
!               $GLOBALS['phpgw']->template->set_var('tts_changeview', 
lang('View only open tickets'));
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_changeview_link', 
$GLOBALS['phpgw']->link('/tts/index.php','filter=viewall'));
!               $GLOBALS['phpgw']->template->set_var('tts_changeview', 
lang('View all tickets'));
!       }
! 
!       $GLOBALS['phpgw']->template->set_var('tts_ticketstotal', lang('Tickets 
total %1',$numtotal));
!       $GLOBALS['phpgw']->template->set_var('tts_ticketsopen', lang('Tickets 
open %1',$numopen));
!       
!       // fill header
!       
$GLOBALS['phpgw']->template->set_var('tts_head_bgcolor',$GLOBALS['phpgw_info']['theme']['th_bg']
 );
!       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']
 );
!       $GLOBALS['phpgw']->template->set_var('tts_head_ticket', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_id',$order,'/tts/index.php',lang('Ticket').'
 #'));
!       $GLOBALS['phpgw']->template->set_var('tts_head_prio', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_priority',$order,'/tts/index.php',lang('Prio')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_group',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_group',$order,'/tts/index.php',lang('Group')));
!       
$GLOBALS['phpgw']->template->set_var('tts_head_category',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_category',$order,'/tts/index.php',lang('Category')));
!       $GLOBALS['phpgw']->template->set_var('tts_head_assignedto', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_assignedto',$order,'/tts/index.php',lang('Assigned
 to')));
!       $GLOBALS['phpgw']->template->set_var('tts_head_openedby', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_owner',$order,'/tts/index.php',lang('Opened
 by')));
! 
!       // I am not sure how the sorting will work for this, if at all. (jengo)
!       $GLOBALS['phpgw']->template->set_var('tts_head_dateopened',lang('Date 
opened'));
! //    $GLOBALS['phpgw']->template->set_var('tts_head_dateopened', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'',$order,'/tts/index.php',lang('Date
 opened')));
!       if ($filter != 'viewopen')
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_head_dateclosed', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_status',$order,'/tts/index.php',lang('Status/Date
 closed')));
!               
$GLOBALS['phpgw']->template->parse('tts_head_status','tts_head_ifviewall',false);
!       }
!       $GLOBALS['phpgw']->template->set_var('tts_head_subject', 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'ticket_subject',$order,'/tts/index.php',lang('Subject')));
! 
!       if ($GLOBALS['phpgw']->db->num_rows() == 0)
!       {
!               $GLOBALS['phpgw']->template->set_var('rows', 
'<p><center>'.lang('No tickets found').'</center>');
!       }
!       else
!       {
!               while ($GLOBALS['phpgw']->db->next_record())
!               {
!                       
$GLOBALS['phpgw']->template->set_var('tts_col_status','');
!                       $priority = $GLOBALS['phpgw']->db->f('ticket_priority');
!                       switch ($priority)
!                       {
!                               case 1:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg01']; $prio = '1'; break;
!                               case 2:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg02']; $prio = '2'; break;
!                               case 3:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg03']; $prio = '3'; break;
!                               case 4:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg04']; $prio = '4'; break;
!                               case 5:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg05']; $prio = '5'; break;
!                               case 6:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg06']; $prio = '6'; break;
!                               case 7:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg07']; $prio = '7'; break;
!                               case 8:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg08']; $prio = '8'; break;
!                               case 9:  $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg09']; $prio = '9'; break;
!                               case 10: $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg10']; $prio = '10'; break;
!                               default: $tr_color = 
$GLOBALS['phpgw_info']['theme']['bg_color']; $prio = '-';
!                       }
! 
!                       if ($filter!="viewopen" && 
$GLOBALS['phpgw']->db->f('t_timestamp_closed'))
!                       {
!                               $tr_color = 
$GLOBALS['phpgw_info']['theme']['th_bg']; /*"#CCCCCC";*/
!                       }
! 
!                       $db2->query("select count(*) from phpgw_tts_views where 
view_id='" . $GLOBALS['phpgw']->db->f('ticket_id')
!                               . "' and view_account_id='" . 
$GLOBALS['phpgw_info']['user']['account_id'] . "'",__LINE__,__FILE__);
!                       $db2->next_record();
! 
!                       if ($db2->f(0))
!                       {
!                               $ticket_read = True;
!                       }
!                       else
!                       {
!                               $ticket_read = False;
!                       }
! 
!                       $GLOBALS['phpgw']->template->set_var('tts_row_color', 
$tr_color );
!                       
$GLOBALS['phpgw']->template->set_var('tts_ticketdetails_link', 
$GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=' . 
$GLOBALS['phpgw']->db->f('ticket_id')));
! 
!                       
$GLOBALS['phpgw']->template->set_var('row_ticket_id','<a href="' . 
$GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=' . 
$GLOBALS['phpgw']->db->f('ticket_id')) . '">' . 
$GLOBALS['phpgw']->db->f('ticket_id') . '</a>');
! 
!                       if (! $ticket_read)
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('row_status','<img 
src="templates/default/images/updated.gif">');
!                       }
!                       else
!                       {
!                               
$GLOBALS['phpgw']->template->set_var('row_status','&nbsp;');
!                       }
! 
!                       $priostr = '';
! 
!                       while ($priority > 0)
!                       {
!                               $priostr = $priostr . "||";
!                               $priority--;
!                       }
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_priostr',$priostr);
! 
!                       $cat_name   = 
$GLOBALS['phpgw']->categories->id2name($GLOBALS['phpgw']->db->f('ticket_category'));
!                       
$GLOBALS['phpgw']->template->set_var('row_category',$cat_name);
! 
!                       $group_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_group'));
!                       $group_name = ($group_name ? $group_name : '--');
!                       
$GLOBALS['phpgw']->template->set_var('row_group',$group_name);
! 
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_assignedto', 
$GLOBALS['phpgw']->db->f('ticket_assignedto')?$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto')):lang('None'));
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_user',$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_owner')));
! 
!                       $history_values = 
$GLOBALS['phpgw']->historylog->return_array(array(),array('O'),'history_timestamp','ASC',$GLOBALS['phpgw']->db->f('ticket_id'));
!                       
$GLOBALS['phpgw']->template->set_var('tts_t_timestampopened',$GLOBALS['phpgw']->common->show_date($history_values[0]['datetime']
 - ((60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])));
! 
!                       if ($GLOBALS['phpgw']->db->f('ticket_status') == 'X')
!                       {
!                               $history_values = 
$GLOBALS['phpgw']->historylog->return_array(array(),array('X'),'history_timestamp','DESC',$GLOBALS['phpgw']->db->f('ticket_id'));
!                               
$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',$GLOBALS['phpgw']->common->show_date($history_values[0]['datetime']
 - ((60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'])));
!                               
$GLOBALS['phpgw']->template->parse('tts_col_status','tts_col_ifviewall',False);
!                       }
!                       elseif ($filter != 'viewopen')
!                       {
! //                            if 
($GLOBALS['phpgw']->db->f('ticket_assignedto') != -1)
! //                            {
! //                                    $assigned_to = lang('Not assigned');
! //                            }
! //                            else
! //                            {
! //                                    $assigned_to = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->db->f('ticket_assignedto'));
! //                            }
! //                            
$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',$assigned_to);
!                               
$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',lang('Open'));
!                               
$GLOBALS['phpgw']->template->parse('tts_col_status','tts_col_ifviewall',False);
!                       }
!                       $GLOBALS['phpgw']->template->set_var('tts_t_subject', 
$GLOBALS['phpgw']->db->f('ticket_subject'));
!                       $GLOBALS['phpgw']->template->set_var('tts_t_prio', 
$prio);
! 
!                       
$GLOBALS['phpgw']->template->parse('rows','tts_row',True);
!               }
!       }
! 
!       // this is a workaround to clear the subblocks autogenerated vars
!       $GLOBALS['phpgw']->template->set_var('tts_row','');
!       $GLOBALS['phpgw']->template->set_var('tts_col_ifviewall','');
!       $GLOBALS['phpgw']->template->set_var('tts_head_ifviewall','');
!       $GLOBALS['phpgw']->template->set_var('tts_ticket_id_read','');
!       $GLOBALS['phpgw']->template->set_var('tts_ticket_id_unread','');
! 
!       //Filterfelder erzeugen *START*
!       $GLOBALS['phpgw']->db->query("select count(*) from phpgw_tts_tickets");
!       $GLOBALS['phpgw']->db->next_record();
!       $exists = $GLOBALS['phpgw']->db->f('0');
!       if ($exists != 0)
!       {
!               $GLOBALS['phpgw']->db->query("select distinct ticket_priority 
from phpgw_tts_tickets order by ticket_priority desc");
!               $y=0;
!               while ($GLOBALS['phpgw']->db->next_record() != 0)
!               {
!                       $dbvalue[$y] = $GLOBALS['phpgw']->db->f('0') ;
!                       ++$y;
!               }
!               
!               unset($sel);
!               for($y-=1;$y>=0;--$y)
!               {
!                       if($dbvalue[$y] == $_POST['ticket']['filter_prio'])
!                       {
!                               $selected = " selected";
!                       }
!                       else
!                       {
!                               $selected = "";
!                       }
!                       $sel .= 
'<option'.$selected.'>'.$dbvalue[$y].'</option>' ;
!               }
!               $GLOBALS['phpgw']->template->set_var('filter_prio','<select 
name=ticket[filter_prio] onChange="document.search.submit()"><option> 
</option>'.$sel.'</select>');
!               
! 
!               $GLOBALS['phpgw']->db->query("select distinct ticket_owner from 
phpgw_tts_tickets order by ticket_owner desc");
!               $y=0;
!               while ($GLOBALS['phpgw']->db->next_record() != 0)
!               {
!                       $dbvalue[$y] = $GLOBALS['phpgw']->db->f('0') ;
!                       $db2name[$y] = 
$GLOBALS['phpgw']->accounts->id2name($dbvalue[$y]);
!                       ++$y;
!               }
!               
!               unset($sel);
!               natsort($db2name);
!               reset($db2name);
!               while(list($dummy,$entry) = each($db2name))
!               {
!                       if($entry == $_POST['ticket']['filter_owner'])
!                       {
!                               $selected = " selected";
!                       }
!                       else
!                       {
!                               $selected = "";
!                       }
!                       $sel .= '<option'.$selected.'>'.$entry.'</option>' ;
!               }
!               $GLOBALS['phpgw']->template->set_var('filter_owner','<select 
name=ticket[filter_owner] onChange="document.search.submit()"><option> 
</option>'.$sel.'</select>');
!       
!       
!               $GLOBALS['phpgw']->db->query("select distinct ticket_assignedto 
from phpgw_tts_tickets order by ticket_assignedto desc");
!               $y=0;
!               while ($GLOBALS['phpgw']->db->next_record() != 0)
!               {
!                       $dbvalue[$y] = $GLOBALS['phpgw']->db->f('0') ;
!                       $db2name[$y] = 
$GLOBALS['phpgw']->accounts->id2name($dbvalue[$y]);
!                       ++$y;
!               }
! 
!               unset($sel);
!               natsort($db2name);
!               reset($db2name);
!               while(list($dummy,$entry) = each($db2name))
!               {
!                       if($entry == $_POST['ticket']['filter_assignedto'])
!                       {
!                               $selected = " selected";
!                       }
!                       else
!                       {
!                               $selected = "";
!                       }
!                       $sel .= '<option'.$selected.'>'.$entry.'</option>' ;
!               }
! 
!               
$GLOBALS['phpgw']->template->set_var('filter_assignedto','<select 
name=ticket[filter_assignedto] onChange="document.search.submit()"><option> 
</option>'.$sel.'</select>');
!       
!               
!               $GLOBALS['phpgw']->db->query("select distinct ticket_category 
from phpgw_tts_tickets order by ticket_category");
!               $y=0;
!               unset($db2name);
!               while ($GLOBALS['phpgw']->db->next_record() != 0)
!               {
!                       $dbvalue[$y] = $GLOBALS['phpgw']->db->f('0');
!                       $db2name[$y] = 
$GLOBALS['phpgw']->categories->id2name($dbvalue[$y]);
!                       ++$y;
!               }
!               
!               unset($sel);
!               natsort($db2name);
!               reset($db2name);
!               while(list($dummy,$entry) = each($db2name))
!               {
!                       if($entry == $_POST['ticket']['filter_category'])
!                       {
!                               $selected = " selected";                        
        
!                       }
!                       else
!                       {
!                               $selected = "";
!                       }                       
!                       $sel .= '<option'.$selected.'>'.$entry.'</option>' ;
!               }
!       
!               $GLOBALS['phpgw']->template->set_var('filter_category','<select 
name=ticket[filter_category] 
onChange="document.search.submit()"><option></option>'.$sel.'</select>');
!       }
!       //Filterfenster erzeugen *ENDE*
!       
!       $GLOBALS['phpgw']->template->pfp('out','index');
! 
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>

Index: viewticket_details.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/viewticket_details.php,v
retrieving revision 1.42.2.6
retrieving revision 1.42.2.6.4.1
diff -C2 -d -r1.42.2.6 -r1.42.2.6.4.1
*** viewticket_details.php      9 Jun 2002 01:44:03 -0000       1.42.2.6
--- viewticket_details.php      31 Oct 2003 07:06:58 -0000      1.42.2.6.4.1
***************
*** 1,476 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - Trouble Ticket System                                  
   *
!       * http://www.phpgroupware.org                                           
   *
!       * --------------------------------------------                          
   *
!       *  This program is free software; you can redistribute it and/or modify 
it *
!       *  under the terms of the GNU General Public License as published by 
the   *
!       *  Free Software Foundation; either version 2 of the License, or (at 
your  *
!       *  option) any later version.                                           
   *
!       
\**************************************************************************/
[...1059 lines suppressed...]
!               }
!               else
!               {
!                       // Only do our commit once
!                       $GLOBALS['phpgw']->db->transaction_commit();
!               }
! 
!               if($fields_updated)
!               {
!                       
$GLOBALS['phpgw']->session->appsession('messages','tts',lang('Ticket has been 
updated'));
! 
!                       
if($GLOBALS['phpgw']->config->config_data['mailnotification'])
!                       {
!                               mail_ticket($ticket_id);
!                       } 
!               }
! 
!               
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id='
 . $ticket_id));
!       }
! ?>

Index: admin.php
===================================================================
RCS file: /cvsroot/phpgroupware/tts/admin.php,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.1.4.1
diff -C2 -d -r1.2.2.1 -r1.2.2.1.4.1
*** admin.php   25 Jan 2002 22:00:52 -0000      1.2.2.1
--- admin.php   31 Oct 2003 07:06:58 -0000      1.2.2.1.4.1
***************
*** 1,160 ****
! <?php
!   /**************************************************************************\
!   * phpGroupWare - TTS                                                       *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'currentapp'  => 'tts', 
!               'noheader'    => True, 
!               'nonavbar'    => True, 
!               'noappheader' => True,
!               'noappfooter' => True,
!               'enable_config_class'     => True,
!               'enable_nextmatchs_class' => True
!       );
! 
!       include('../header.inc.php');
! 
!       $option_names = array(lang('Disabled'), lang('Users choice'), 
lang('Force'));
!       $owner_selected = array ();
!       $group_selected = array ();
!       $assigned_selected = array ();
! 
!       $GLOBALS['phpgw']->config->read_repository();
! 
!       if ($HTTP_POST_VARS['submit'])
!       {
!               if ($HTTP_POST_VARS['usemailnotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['mailnotification'] = True;
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['mailnotification']);
!               }
! 
!               if ($HTTP_POST_VARS['ownernotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['ownernotification'] = 
$HTTP_POST_VARS['ownernotification'];
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['ownernotification']);
!               }
! 
!               if ($HTTP_POST_VARS['groupnotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['groupnotification'] = 
$HTTP_POST_VARS['groupnotification'];
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['groupnotification']);
!               }
! 
!               if ($HTTP_POST_VARS['assignednotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['assignednotification'] = 
$HTTP_POST_VARS['assignednotification'];
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['assignednotification']);
!               }
! 
!               $GLOBALS['phpgw']->config->save_repository(True);
!               Header('Location: ' . 
$GLOBALS['phpgw']->link('/admin/index.php'));
!       }
! $after= $GLOBALS['phpgw']->config->config_data['mailnotification'];
! echo "after: $after <br>";
! 
!       $GLOBALS['phpgw']->common->phpgw_header();
!       echo parse_navbar();
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 'admin.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin', 
'tts_select_options','tts_select_options');
! 
!       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/tts/admin.php'));
! 
!       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
!       $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
! 
!       $GLOBALS['phpgw']->template->set_var('lang_mailnotification',lang('Use 
email notification'));
!       if ($GLOBALS['phpgw']->config->config_data['mailnotification'])
!       {
!               $GLOBALS['phpgw']->template->set_var('mailnotification',' 
checked');
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('mailnotification','');
!       }
! 
!       
$GLOBALS['phpgw']->template->set_var('lang_ownernotification',lang('Owner'));
!       if ($GLOBALS['phpgw']->config->config_data['ownernotification'])
!       {
!               
$owner_selected[$GLOBALS['phpgw']->config->config_data['ownernotification']]=' 
selected';
!       //      $GLOBALS['phpgw']->template->set_var('ownernotification',' 
checked');
!       }
!       else
!       {
!       //      $GLOBALS['phpgw']->template->set_var('ownernotification','');
!       }
! 
!       
$GLOBALS['phpgw']->template->set_var('lang_groupnotification',lang('Group'));
!       if ($GLOBALS['phpgw']->config->config_data['groupnotification'])
!       {
!               
$group_selected[$GLOBALS['phpgw']->config->config_data['groupnotification']]=' 
selected';
!       //      $GLOBALS['phpgw']->template->set_var('groupnotification',' 
checked');
!       }
!       else
!       {
!               //      
$GLOBALS['phpgw']->template->set_var('groupnotification','');
!       }
!       
$GLOBALS['phpgw']->template->set_var('lang_assignednotification',lang('Assigned 
to'));
!       if ($GLOBALS['phpgw']->config->config_data['assignednotification'])
!       {
!               
$assigned_selected[$GLOBALS['phpgw']->config->config_data['assignednotification']]='
 selected';
!       //      $GLOBALS['phpgw']->template->set_var('assignednotification',' 
checked');
!       }
!       else
!       {
!               //      
$GLOBALS['phpgw']->template->set_var('assignednotification','');
!       }
! 
!       for ($i=0; $i<3; $i++)
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_optionname', 
$option_names[$i]);
!               $GLOBALS['phpgw']->template->set_var('tts_optionvalue', $i);
!               $GLOBALS['phpgw']->template->set_var('tts_optionselected', 
$owner_selected[$i]);
!               
$GLOBALS['phpgw']->template->parse('tts_owneroptions','tts_select_options',true);
!       }
! 
!       for ($i=0; $i<3; $i++)
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_optionname', 
$option_names[$i]);
!               $GLOBALS['phpgw']->template->set_var('tts_optionvalue', $i);
!               $GLOBALS['phpgw']->template->set_var('tts_optionselected', 
$group_selected[$i]);
!               
$GLOBALS['phpgw']->template->parse('tts_groupoptions','tts_select_options',true);
!       }
! 
!       for ($i=0; $i<3; $i++)
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_optionname', 
$option_names[$i]);
!               $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_admin',lang('TTS').' 
'.lang('Admin'));
!       $GLOBALS['phpgw']->template->set_var('lang_submit',lang('submit'));
!       $GLOBALS['phpgw']->template->set_var('tts_select_options','');
! 
!       $GLOBALS['phpgw']->template->pparse('out','admin');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
--- 1,160 ----
! <?php
!   /**************************************************************************\
!   * phpGroupWare - TTS                                                       *
!   * http://www.phpgroupware.org                                              *
!   * --------------------------------------------                             *
!   *  This program is free software; you can redistribute it and/or modify it *
!   *  under the terms of the GNU General Public License as published by the   *
!   *  Free Software Foundation; either version 2 of the License, or (at your  *
!   *  option) any later version.                                              *
!   \**************************************************************************/
! 
!   /* $Id$ */
! 
!       $GLOBALS['phpgw_info']['flags'] = array(
!               'currentapp'  => 'tts', 
!               'noheader'    => True, 
!               'nonavbar'    => True, 
!               'noappheader' => True,
!               'noappfooter' => True,
!               'enable_config_class'     => True,
!               'enable_nextmatchs_class' => True
!       );
! 
!       include('../header.inc.php');
! 
!       $option_names = array(lang('Disabled'), lang('Users choice'), 
lang('Force'));
!       $owner_selected = array ();
!       $group_selected = array ();
!       $assigned_selected = array ();
! 
!       $GLOBALS['phpgw']->config->read_repository();
! 
!       if ($HTTP_POST_VARS['submit'])
!       {
!               if ($HTTP_POST_VARS['usemailnotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['mailnotification'] = True;
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['mailnotification']);
!               }
! 
!               if ($HTTP_POST_VARS['ownernotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['ownernotification'] = 
$HTTP_POST_VARS['ownernotification'];
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['ownernotification']);
!               }
! 
!               if ($HTTP_POST_VARS['groupnotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['groupnotification'] = 
$HTTP_POST_VARS['groupnotification'];
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['groupnotification']);
!               }
! 
!               if ($HTTP_POST_VARS['assignednotification'])
!               {
!                       
$GLOBALS['phpgw']->config->config_data['assignednotification'] = 
$HTTP_POST_VARS['assignednotification'];
!               }
!               else
!               {
!                       
unset($GLOBALS['phpgw']->config->config_data['assignednotification']);
!               }
! 
!               $GLOBALS['phpgw']->config->save_repository(True);
!               Header('Location: ' . 
$GLOBALS['phpgw']->link('/admin/index.php'));
!       }
! $after= $GLOBALS['phpgw']->config->config_data['mailnotification'];
! echo "after: $after <br>";
! 
!       $GLOBALS['phpgw']->common->phpgw_header();
!       echo parse_navbar();
! 
!       $GLOBALS['phpgw']->template->set_file(array('admin' => 'admin.tpl'));
!       $GLOBALS['phpgw']->template->set_block('admin', 
'tts_select_options','tts_select_options');
! 
!       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/tts/admin.php'));
! 
!       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
!       $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color);
! 
!       $GLOBALS['phpgw']->template->set_var('lang_mailnotification',lang('Use 
email notification'));
!       if ($GLOBALS['phpgw']->config->config_data['mailnotification'])
!       {
!               $GLOBALS['phpgw']->template->set_var('mailnotification',' 
checked');
!       }
!       else
!       {
!               $GLOBALS['phpgw']->template->set_var('mailnotification','');
!       }
! 
!       
$GLOBALS['phpgw']->template->set_var('lang_ownernotification',lang('Owner'));
!       if ($GLOBALS['phpgw']->config->config_data['ownernotification'])
!       {
!               
$owner_selected[$GLOBALS['phpgw']->config->config_data['ownernotification']]=' 
selected';
!       //      $GLOBALS['phpgw']->template->set_var('ownernotification',' 
checked');
!       }
!       else
!       {
!       //      $GLOBALS['phpgw']->template->set_var('ownernotification','');
!       }
! 
!       
$GLOBALS['phpgw']->template->set_var('lang_groupnotification',lang('Group'));
!       if ($GLOBALS['phpgw']->config->config_data['groupnotification'])
!       {
!               
$group_selected[$GLOBALS['phpgw']->config->config_data['groupnotification']]=' 
selected';
!       //      $GLOBALS['phpgw']->template->set_var('groupnotification',' 
checked');
!       }
!       else
!       {
!               //      
$GLOBALS['phpgw']->template->set_var('groupnotification','');
!       }
!       
$GLOBALS['phpgw']->template->set_var('lang_assignednotification',lang('Assigned 
to'));
!       if ($GLOBALS['phpgw']->config->config_data['assignednotification'])
!       {
!               
$assigned_selected[$GLOBALS['phpgw']->config->config_data['assignednotification']]='
 selected';
!       //      $GLOBALS['phpgw']->template->set_var('assignednotification',' 
checked');
!       }
!       else
!       {
!               //      
$GLOBALS['phpgw']->template->set_var('assignednotification','');
!       }
! 
!       for ($i=0; $i<3; $i++)
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_optionname', 
$option_names[$i]);
!               $GLOBALS['phpgw']->template->set_var('tts_optionvalue', $i);
!               $GLOBALS['phpgw']->template->set_var('tts_optionselected', 
$owner_selected[$i]);
!               
$GLOBALS['phpgw']->template->parse('tts_owneroptions','tts_select_options',true);
!       }
! 
!       for ($i=0; $i<3; $i++)
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_optionname', 
$option_names[$i]);
!               $GLOBALS['phpgw']->template->set_var('tts_optionvalue', $i);
!               $GLOBALS['phpgw']->template->set_var('tts_optionselected', 
$group_selected[$i]);
!               
$GLOBALS['phpgw']->template->parse('tts_groupoptions','tts_select_options',true);
!       }
! 
!       for ($i=0; $i<3; $i++)
!       {
!               $GLOBALS['phpgw']->template->set_var('tts_optionname', 
$option_names[$i]);
!               $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_admin',lang('TTS').' 
'.lang('Admin'));
!       $GLOBALS['phpgw']->template->set_var('lang_submit',lang('submit'));
!       $GLOBALS['phpgw']->template->set_var('tts_select_options','');
! 
!       $GLOBALS['phpgw']->template->pparse('out','admin');
!       $GLOBALS['phpgw']->common->phpgw_footer();
! ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]