Re: Re: Re: Re: Trouble Ticket System broken

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

Steven Gilroy a =E9crit :
> LOL sorry, was early for me, I put in the command correctly and here is=
 the result:
>=20
> Quote:
>> patching file tts/index.php
>> Hunk #4 FAILED at 278.
>> 1 out of 9 hunks FAILED -- saving rejects to file tts/index.php.rej

My fault, I fixed another bug and forget to include it in the patch.

so please do the following :
patch -R -p1 < patch_tts_php53.diff

Then apply the new patch (attached)

patch -p1 < new_patch_tts_php53.diff

Sorry for the mistake :).

Caeies.

>=20
>=20
> index.php.rej is attached
>=20
> I now see the listings of tickets however there are no links to click o=
n for the ticket details/editing/updating.Sent from the phpGroupWare foru=
ms @ http://forums.phpGroupWare.org
>=20
>=20
> -----------------------------------------------------------------------=
-
>=20
> _______________________________________________
> phpGroupWare-users mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/phpgroupware-users


--------------020700080904040104020808
Content-Type: text/plain;
 name="new_patch_tts_php53.diff"
Content-Disposition: inline;
 filename="new_patch_tts_php53.diff"
Content-Transfer-Encoding: quoted-printable

Index: a/tts/index.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- a/tts/index.php	(r=C3=A9vision 21320)
+++ b/tts/index.php	(copie de travail)
@@ -184,9 +184,10 @@
 	}
 */=09
 =09
-	$db2 =3D $GLOBALS['phpgw']->db;
-	$GLOBALS['phpgw']->db->query("select * from phpgw_tts_tickets $filterme=
thod $sortmethod",__LINE__,__FILE__);
-	$numfound =3D $GLOBALS['phpgw']->db->num_rows();
+	$db =3D clone $GLOBALS['phpgw']->db;
+	$db2 =3D clone $GLOBALS['phpgw']->db;
+	$db->query("select * from phpgw_tts_tickets $filtermethod $sortmethod",=
__LINE__,__FILE__);
+	$numfound =3D $db->num_rows();
=20
 	if ($filter !=3D '' || $filter =3D=3D 'viewopen')
 	{
@@ -233,16 +234,16 @@
 	}
 	$GLOBALS['phpgw']->template->set_var('tts_head_subject', $GLOBALS['phpg=
w']->nextmatchs->show_sort_order($sort,'ticket_subject',$order,'/tts/inde=
x.php',lang('Subject')));
=20
-	if ($GLOBALS['phpgw']->db->num_rows() =3D=3D 0)
+	if ($db->num_rows() =3D=3D 0)
 	{
 		$GLOBALS['phpgw']->template->set_var('rows', '<p><center>'.lang('No ti=
ckets found').'</center>');
 	}
 	else
 	{
-		while ($GLOBALS['phpgw']->db->next_record())
+		while ($db->next_record())
 		{
 			$GLOBALS['phpgw']->template->set_var('tts_col_status','');
-			$priority =3D $GLOBALS['phpgw']->db->f('ticket_priority');
+			$priority =3D $db->f('ticket_priority');
 			switch ($priority)
 			{
 				case 1:  $tr_color =3D $GLOBALS['phpgw_info']['theme']['bg01']; $pri=
o =3D '1'; break;
@@ -258,12 +259,12 @@
 				default: $tr_color =3D $GLOBALS['phpgw_info']['theme']['bg_color']; =
$prio =3D '-';
 			}
=20
-			if ($filter!=3D"viewopen" && $GLOBALS['phpgw']->db->f('t_timestamp_cl=
osed'))
+			if ($filter!=3D"viewopen" && $db->f('t_timestamp_closed'))
 			{
 				$tr_color =3D $GLOBALS['phpgw_info']['theme']['th_bg']; /*"#CCCCCC";=
*/
 			}
=20
-			$db2->query("select count(*) from phpgw_tts_views where view_id=3D'" =
. $GLOBALS['phpgw']->db->f('ticket_id')
+			$db2->query("select count(*) from phpgw_tts_views where view_id=3D'" =
. $db->f('ticket_id')
 				. "' and view_account_id=3D'" . $GLOBALS['phpgw_info']['user']['acco=
unt_id'] . "'",__LINE__,__FILE__);
 			$db2->next_record();
=20
@@ -277,9 +278,9 @@
 			}
=20
 			$GLOBALS['phpgw']->template->set_var('tts_row_color', $tr_color );
-			$GLOBALS['phpgw']->template->set_var('tts_ticketdetails_link', $GLOBA=
LS['phpgw']->link('/tts/viewticket_details.php','ticket_id=3D' . $GLOBALS=
['phpgw']->db->f('ticket_id')));
+			$GLOBALS['phpgw']->template->set_var('tts_ticketdetails_link', $GLOBA=
LS['phpgw']->link('/tts/viewticket_details.php','ticket_id=3D' . $db->f('=
ticket_id')));
=20
-			$GLOBALS['phpgw']->template->set_var('row_ticket_id','<a href=3D"' . =
$GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=3D' . $G=
LOBALS['phpgw']->db->f('ticket_id')) . '">' . $GLOBALS['phpgw']->db->f('t=
icket_id') . '</a>');
+			$GLOBALS['phpgw']->template->set_var('row_ticket_id','<a href=3D"' . =
$GLOBALS['phpgw']->link('/tts/viewticket_details.php','ticket_id=3D' . $d=
b->f('ticket_id')) . '">' . $db->f('ticket_id') . '</a>');
=20
 			if (! $ticket_read)
 			{
@@ -299,22 +300,22 @@
 			}
 			$GLOBALS['phpgw']->template->set_var('tts_t_priostr',$priostr);
=20
-			$cat_name   =3D $GLOBALS['phpgw']->categories->id2name($GLOBALS['phpg=
w']->db->f('ticket_category'));
+			$cat_name   =3D $GLOBALS['phpgw']->categories->id2name($db->f('ticket=
_category'));
 			$GLOBALS['phpgw']->template->set_var('row_category',$cat_name);
=20
-			$group_name =3D $GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw'=
]->db->f('ticket_group'));
+			$group_name =3D $GLOBALS['phpgw']->accounts->id2name($db->f('ticket_g=
roup'));
 			$group_name =3D ($group_name ? $group_name : '--');
 			$GLOBALS['phpgw']->template->set_var('row_group',$group_name);
=20
-			$GLOBALS['phpgw']->template->set_var('tts_t_assignedto', $GLOBALS['ph=
pgw']->db->f('ticket_assignedto')?$GLOBALS['phpgw']->accounts->id2name($G=
LOBALS['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('tick=
et_assignedto')?$GLOBALS['phpgw']->accounts->id2name($db->f('ticket_assig=
nedto')):lang('None'));
+			$GLOBALS['phpgw']->template->set_var('tts_t_user',$GLOBALS['phpgw']->=
accounts->id2name($db->f('ticket_owner')));
=20
-			$history_values =3D $GLOBALS['phpgw']->historylog->return_array(array=
(),array('O'),'history_timestamp','ASC',$GLOBALS['phpgw']->db->f('ticket_=
id'));
+			$history_values =3D $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'])));
=20
-			if ($GLOBALS['phpgw']->db->f('ticket_status') =3D=3D 'X')
+			if ($db->f('ticket_status') =3D=3D 'X')
 			{
-				$history_values =3D $GLOBALS['phpgw']->historylog->return_array(arra=
y(),array('X'),'history_timestamp','DESC',$GLOBALS['phpgw']->db->f('ticke=
t_id'));
+				$history_values =3D $GLOBALS['phpgw']->historylog->return_array(arra=
y(),array('X'),'history_timestamp','DESC',$db->f('ticket_id'));
 				$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',$GLOBAL=
S['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_ifviewa=
ll',False);
 			}
@@ -332,7 +333,7 @@
 				$GLOBALS['phpgw']->template->set_var('tts_t_timestampclosed',lang('O=
pen'));
 				$GLOBALS['phpgw']->template->parse('tts_col_status','tts_col_ifviewa=
ll',False);
 			}
-			$GLOBALS['phpgw']->template->set_var('tts_t_subject', htmlspecialchar=
s(stripslashes($GLOBALS['phpgw']->db->f('ticket_subject'))));
+			$GLOBALS['phpgw']->template->set_var('tts_t_subject', htmlspecialchar=
s(stripslashes($db->f('ticket_subject'))));
 			$GLOBALS['phpgw']->template->set_var('tts_t_prio', $prio);
=20
 			$GLOBALS['phpgw']->template->parse('rows','tts_row',True);
@@ -376,11 +377,11 @@
 		$GLOBALS['phpgw']->template->set_var('filter_prio','<select name=3Dtic=
ket[filter_prio] onChange=3D"document.search.submit()"><option> </option>=
'.$sel.'</select>');
 	=09
=20
-		$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=3D0;
-		while ($GLOBALS['phpgw']->db->next_record() !=3D 0)
+		while ($db->next_record() !=3D 0)
  		{
-			$dbvalue[$y] =3D $GLOBALS['phpgw']->db->f('0') ;
+			$dbvalue[$y] =3D $db->f('0') ;
 			$db2name[$y] =3D $GLOBALS['phpgw']->accounts->id2name($dbvalue[$y]);
    			++$y;
  		}
@@ -405,9 +406,9 @@
 =09
 		$GLOBALS['phpgw']->db->query("select distinct ticket_assignedto from p=
hpgw_tts_tickets order by ticket_assignedto desc");
 		$y=3D0;
-		while ($GLOBALS['phpgw']->db->next_record() !=3D 0)
+		while ($db->next_record() !=3D 0)
  		{
-			$dbvalue[$y] =3D $GLOBALS['phpgw']->db->f('0') ;
+			$dbvalue[$y] =3D $db->f('0') ;
 			$db2name[$y] =3D $GLOBALS['phpgw']->accounts->id2name($dbvalue[$y]);
    			++$y;
  		}
@@ -434,9 +435,9 @@
 		$GLOBALS['phpgw']->db->query("select distinct ticket_category from php=
gw_tts_tickets order by ticket_category");
 		$y=3D0;
 		unset($db2name);
-		while ($GLOBALS['phpgw']->db->next_record() !=3D 0)
+		while ($db->next_record() !=3D 0)
  		{
-			$dbvalue[$y] =3D $GLOBALS['phpgw']->db->f('0');
+			$dbvalue[$y] =3D $db->f('0');
 			$db2name[$y] =3D $GLOBALS['phpgw']->categories->id2name($dbvalue[$y])=
;
    			++$y;
  		}

--------------020700080904040104020808
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

--------------020700080904040104020808--