phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] tts/index.php, 1.43.2.7.2.2.2.4


From: nomail
Subject: [Phpgroupware-cvs] tts/index.php, 1.43.2.7.2.2.2.4
Date: Thu, 20 May 2004 15:35:29 -0000

Update of /tts
Modified Files:
        Branch: Version-0_9_16-branch
          index.php

date: 2004/04/16 11:30:05;  author: lpiepho;  state: Exp;  lines: +64 -16

Log Message:
General improvements and bugfixing
=====================================================================
No syntax errors detected in -
=====================================================================
Index: tts/index.php
diff -u tts/index.php:1.43.2.7.2.2.2.3 tts/index.php:1.43.2.7.2.2.2.4
--- tts/index.php:1.43.2.7.2.2.2.3      Tue Jan 20 05:03:42 2004
+++ tts/index.php       Fri Apr 16 11:30:05 2004
@@ -58,18 +58,41 @@
        
        
        // select what tickets to view
-       $filter = $_POST['searchfilter'];
+       $filter = $_REQUEST['filter'];  
        $start  = $_GET['start'];
        $sort   = $_GET['sort'];
        $order  = $_GET['order'];
-
+       $searchfilter = $_REQUEST['searchfilter'];
+                       
        if (!$filter)
        {
                $filter='viewopen';
        }
-       if ($filter == 'viewopen') 
+               
+       if ($filter == 'viewopen' || 'search') 
        {
-               $filtermethod = "where ticket_status='O'";
+               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 ticket_status='O'" . $filterstring . 
$filterstring1 . $filterstring2 . $filterstring3;
+               
 
                $GLOBALS['phpgw']->preferences->read_repository();
                if 
($GLOBALS['phpgw_info']['user']['preferences']['tts']['refreshinterval'])
@@ -81,10 +104,36 @@
                        $GLOBALS['phpgw']->template->set_var('autorefresh','');
                }
        }
+       
+       if ($filter == 'viewall')
+       {
+                       
+               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 ($filter != 'viewopen') 
+               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;
+       }
+       
+       if ($searchfilter != '') 
        {               
-               $filtermethod = "where ticket_details like 
'".addslashes($searchfilter)."' or ticket_subject like 
'".addslashes($searchfilter)."'";
+               $filtermethod = "where ticket_details like 
'%".addslashes($searchfilter)."%' or ticket_subject like 
'%".addslashes($searchfilter)."%'";
                
$GLOBALS['phpgw']->template->set_var('tts_searchfilter',addslashes($searchfilter));
        }
 
@@ -108,9 +157,9 @@
        $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')
+       //Get filters to work
+/*     if($filter == 'viewopen')
        {
-               //Filter überprüfen und ausführen *START*
                if($_POST['ticket']['filter_prio'] != "")
                {
                        $filterstring = " and ticket_priority like 
".$_POST['ticket']['filter_prio'];
@@ -133,14 +182,14 @@
        
                $filtermethod = "where 1=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));
        }
@@ -150,7 +199,7 @@
                $GLOBALS['phpgw']->template->set_var('tts_numfound','');
        }
 
-       if ($filter != 'viewopen')
+       if ($filter != 'viewopen' && $filter != 'search')
        {
                $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'));
@@ -177,7 +226,7 @@
        // 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')
+       if ($filter != 'viewopen' && $filter != 'search')
        {
                $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);
@@ -269,7 +318,7 @@
                                
$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')
+                       elseif ($filter != 'viewopen' && $filter != 'search')
                        {
 //                             if 
($GLOBALS['phpgw']->db->f('ticket_assignedto') != -1)
 //                             {
@@ -297,7 +346,7 @@
        $GLOBALS['phpgw']->template->set_var('tts_ticket_id_read','');
        $GLOBALS['phpgw']->template->set_var('tts_ticket_id_unread','');
 
-       //Filterfelder erzeugen *START*
+       //Create Autofilters
        $GLOBALS['phpgw']->db->query("select count(*) from phpgw_tts_tickets");
        $GLOBALS['phpgw']->db->next_record();
        $exists = $GLOBALS['phpgw']->db->f('0');
@@ -410,7 +459,6 @@
        
                $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');
 




reply via email to

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