Re: Re: Trouble Ticket System broken

Benoit Hamet <[email protected]> Wed, 08 Sep 2010 12:32:56 +0200
Newsgroups gmane.comp.web.phpgroupware.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------040203040208070703000108
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

Hi Steven,

Steven Gilroy a =E9crit :
>=20
>=20
> If you could send me the "hack fix" I'd greatly appreciate it.Sent from=
 the phpGroupWare forums @ http://forums.phpGroupWare.org
Please find it enclosed. use patch -p1 from the phpgroupware directory.

As said, this patch is not supported and his given AS IS :).

I'm interested if it fixed things for you.

Regards,

Caeies.

--------------040203040208070703000108
Content-Type: text/plain;
 name="patch_tts_php53.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch_tts_php53.diff"

diff -u a/tts/index.php b/tts/index.php
--- a/tts/index.php	2010-08-25 10:44:34.000000000 +0200
+++ b/tts/index.php	2010-09-08 12:22:22.000000000 +0200
@@ -184,9 +184,10 @@
 	}
 */	
 	
-	$db2 = $GLOBALS['phpgw']->db;
-	$GLOBALS['phpgw']->db->query("select * from phpgw_tts_tickets $filtermethod $sortmethod",__LINE__,__FILE__);
-	$numfound = $GLOBALS['phpgw']->db->num_rows();
+	$db = clone $GLOBALS['phpgw']->db;
+	$db2 = clone $GLOBALS['phpgw']->db;
+	$db->query("select * from phpgw_tts_tickets $filtermethod $sortmethod",__LINE__,__FILE__);
+	$numfound = $db->num_rows();
 
 	if ($filter != '' || $filter == 'viewopen')
 	{
@@ -233,16 +234,16 @@
 	}
 	$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)
+	if ($db->num_rows() == 0)
 	{
 		$GLOBALS['phpgw']->template->set_var('rows', '<p><center>'.lang('No tickets found').'</center>');
 	}
 	else
 	{
-		while ($GLOBALS['phpgw']->db->next_record())
+		while ($db->next_record())
 		{
 			$GLOBALS['phpgw']->template->set_var('tts_col_status','');
-			$priority = $GLOBALS['phpgw']->db->f('ticket_priority');
+			$priority = $db->f('ticket_priority');
 			switch ($priority)
 			{
 				case 1:  $tr_color = $GLOBALS['phpgw_info']['theme']['bg01']; $prio = '1'; break;
@@ -258,12 +259,12 @@
 				default: $tr_color = $GLOBALS['phpgw_info']['theme']['bg_color']; $prio = '-';
 			}
 
-			if ($filter!="viewopen" && $GLOBALS['phpgw']->db->f('t_timestamp_closed'))
+			if ($filter!="viewopen" && $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')
+			$db2->query("select count(*) from phpgw_tts_views where view_id='" . $db->f('ticket_id')
 				. "' and view_account_id='" . $GLOBALS['phpgw_info']['user']['account_id'] . "'",__LINE__,__FILE__);
 			$db2->next_record();
 
@@ -277,13 +278,13 @@
 			}
 
 			$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('tts_ticketdetails_link', $GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=' . $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>');
+			$GLOBALS['phpgw']->template->set_var('row_ticket_id','<a href="' . $GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=' . $db->f('ticket_id')) . '">' . $db->f('ticket_id') . '</a>');
 
 			if (! $ticket_read)
 			{
-				$GLOBALS['phpgw']->template->set_var('row_status','<img src="'. $GLOBALS['phpgw']->common->image('tts', 'updated.png').'">');
+				$GLOBALS['phpgw']->template->set_var('row_status','<img src="templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/images/updated.png">');
 			}
 			else
 			{
@@ -299,22 +300,22 @@
 			}
 			$GLOBALS['phpgw']->template->set_var('tts_t_priostr',$priostr);
 
-			$cat_name   = $GLOBALS['phpgw']->categories->id2name($GLOBALS['phpgw']->db->f('ticket_category'));
+			$cat_name   = $GLOBALS['phpgw']->categories->id2name($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 = $GLOBALS['phpgw']->accounts->id2name($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')));
+			$GLOBALS['phpgw']->template->set_var('tts_t_assignedto', $db->f('ticket_assignedto')?$GLOBALS['phpgw']->accounts->id2name($db->f('ticket_assignedto')):lang('None'));
+			$GLOBALS['phpgw']->template->set_var('tts_t_user',$GLOBALS['phpgw']->accounts->id2name($db->f('ticket_owner')));
 
-			$history_values = $GLOBALS['phpgw']->historylog->return_array(array(),array('O'),'history_timestamp','ASC',$GLOBALS['phpgw']->db->f('ticket_id'));
+			$history_values = $GLOBALS['phpgw']->historylog->return_array(array(),array('O'),'history_timestamp','ASC',$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')
+			if ($db->f('ticket_status') == 'X')
 			{
-				$history_values = $GLOBALS['phpgw']->historylog->return_array(array(),array('X'),'history_timestamp','DESC',$GLOBALS['phpgw']->db->f('ticket_id'));
+				$history_values = $GLOBALS['phpgw']->historylog->return_array(array(),array('X'),'history_timestamp','DESC',$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);
 			}
@@ -332,7 +333,7 @@
 				$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', htmlspecialchars(stripslashes($GLOBALS['phpgw']->db->f('ticket_subject'))));
+			$GLOBALS['phpgw']->template->set_var('tts_t_subject', htmlspecialchars(stripslashes($db->f('ticket_subject'))));
 			$GLOBALS['phpgw']->template->set_var('tts_t_prio', $prio);
 
 			$GLOBALS['phpgw']->template->parse('rows','tts_row',True);
@@ -376,11 +377,11 @@
 		$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");
+		$db->query("select distinct ticket_owner from phpgw_tts_tickets order by ticket_owner desc");
 		$y=0;
-		while ($GLOBALS['phpgw']->db->next_record() != 0)
+		while ($db->next_record() != 0)
  		{
-			$dbvalue[$y] = $GLOBALS['phpgw']->db->f('0') ;
+			$dbvalue[$y] = $db->f('0') ;
 			$db2name[$y] = $GLOBALS['phpgw']->accounts->id2name($dbvalue[$y]);
    			++$y;
  		}
@@ -405,9 +406,9 @@
 	
 		$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)
+		while ($db->next_record() != 0)
  		{
-			$dbvalue[$y] = $GLOBALS['phpgw']->db->f('0') ;
+			$dbvalue[$y] = $db->f('0') ;
 			$db2name[$y] = $GLOBALS['phpgw']->accounts->id2name($dbvalue[$y]);
    			++$y;
  		}
@@ -434,9 +435,9 @@
 		$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)
+		while ($db->next_record() != 0)
  		{
-			$dbvalue[$y] = $GLOBALS['phpgw']->db->f('0');
+			$dbvalue[$y] = $db->f('0');
 			$db2name[$y] = $GLOBALS['phpgw']->categories->id2name($dbvalue[$y]);
    			++$y;
  		}

--------------040203040208070703000108
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
phpGroupWare-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/phpgroupware-users

--------------040203040208070703000108--