2005-07-13 01:13:46 +00:00
< ? php
2006-06-17 06:10:10 +00:00
require_once ( BASE . " include/util.php " );
2006-07-09 22:59:42 +00:00
require_once ( BASE . " include/application.php " );
2005-07-13 01:13:46 +00:00
/******************************************/
/* bug class and related functions */
/******************************************/
/**
* Bug Link class for handling Bug Links and thumbnails
*/
2007-08-27 03:48:44 +00:00
class Bug
{
2005-07-13 01:13:46 +00:00
var $iLinkId ;
2007-04-21 02:30:22 +00:00
// parameters necessary to create a new Bug with Bug::create()
var $iVersionId ;
2005-07-13 01:13:46 +00:00
var $iBug_id ;
2007-04-21 02:30:22 +00:00
// values retrieved from bugzilla
2005-07-13 01:13:46 +00:00
var $sShort_desc ;
var $sBug_status ;
var $sResolution ;
var $sSubmitTime ;
var $iSubmitterId ;
var $bQueued ;
/**
* Constructor , fetches the data and bug objects if $ilinkId is given .
*/
2007-08-27 03:48:44 +00:00
function bug ( $iLinkId = null , $oRow = null )
2005-07-13 01:13:46 +00:00
{
2007-08-27 03:48:44 +00:00
if ( ! $iLinkId && ! $oRow )
return ;
if ( ! $oRow )
2005-07-13 01:13:46 +00:00
{
2007-08-27 03:48:44 +00:00
$sQuery = " SELECT * FROM buglinks
WHERE linkid = '?' " ;
2006-06-27 19:16:27 +00:00
if ( $hResult = query_parameters ( $sQuery , $iLinkId ))
2005-07-13 01:13:46 +00:00
{
2007-08-03 23:27:25 +00:00
$oRow = query_fetch_object ( $hResult );
2007-08-27 03:48:44 +00:00
}
}
if ( $oRow )
{
$this -> iLinkId = $oRow -> linkId ;
$this -> iBug_id = $oRow -> bug_id ;
$this -> iVersionId = $oRow -> versionId ;
$this -> bQueued = ( $oRow -> queued == " true " ) ? true : false ;
$this -> sSubmitTime = $oRow -> submitTime ;
$this -> iSubmitterId = $oRow -> submitterId ;
/* lets fill in some blanks */
if ( $this -> iBug_id )
{
$sQuery = " SELECT *
2005-07-13 01:13:46 +00:00
FROM bugs
WHERE bug_id = " . $this->iBug_id ;
2007-08-27 03:48:44 +00:00
if ( $hResult = query_bugzilladb ( $sQuery ))
{
$oRow = query_fetch_object ( $hResult );
if ( $oRow )
2005-07-13 01:13:46 +00:00
{
$this -> sShort_desc = $oRow -> short_desc ;
$this -> sBug_status = $oRow -> bug_status ;
2005-08-13 01:54:15 +00:00
$this -> sResolution = $oRow -> resolution ;
2005-07-13 01:13:46 +00:00
}
}
}
}
}
/**
* Creates a new Bug .
*/
2007-04-21 02:30:22 +00:00
function create ()
2005-07-13 01:13:46 +00:00
{
2007-04-21 02:30:22 +00:00
$oVersion = new Version ( $this -> iVersionId );
2007-08-27 03:48:44 +00:00
// Security, if we are not an administrator or a maintainer,
// the Bug must be queued.
if ( $this -> mustBeQueued ())
2005-07-13 01:13:46 +00:00
{
$this -> bQueued = true ;
} else
{
$this -> bQueued = false ;
}
2007-08-27 03:48:44 +00:00
/* lets check for a valid bug id */
2007-04-21 02:30:22 +00:00
if ( ! is_numeric ( $this -> iBug_id ))
2005-07-13 01:13:46 +00:00
{
2007-04-21 02:30:22 +00:00
addmsg ( $this -> iBug_id . " is not a valid bug number. " , " red " );
2005-07-13 01:13:46 +00:00
return false ;
}
/* check that bug # exists in bugzilla*/
$sQuery = " SELECT *
FROM bugs
2007-04-21 02:30:22 +00:00
WHERE bug_id = " . $this->iBug_id ;
2007-08-03 23:27:25 +00:00
if ( query_num_rows ( query_bugzilladb ( $sQuery , " checking bugzilla " )) == 0 )
2005-07-13 01:13:46 +00:00
{
addmsg ( " There is no bug in Bugzilla with that bug number. " , " red " );
return false ;
}
/* Check for Duplicates */
$sQuery = " SELECT *
FROM buglinks
2006-06-27 19:16:27 +00:00
WHERE versionId = '?' " ;
2007-04-21 02:30:22 +00:00
if ( $hResult = query_parameters ( $sQuery , $this -> iVersionId ))
2005-07-13 01:13:46 +00:00
{
2007-08-03 23:27:25 +00:00
while ( $oRow = query_fetch_object ( $hResult ))
2005-07-13 01:13:46 +00:00
{
2007-04-21 02:30:22 +00:00
if ( $oRow -> bug_id == $this -> iBug_id )
2005-07-13 01:13:46 +00:00
{
addmsg ( " The Bug link has already been submitted. " , " red " );
return false ;
}
}
2005-07-16 20:02:17 +00:00
}
2005-07-13 01:13:46 +00:00
/* passed the checks so lets insert the puppy! */
2007-07-31 23:48:22 +00:00
$hResult = query_parameters ( " INSERT INTO buglinks (versionId, bug_id, " .
" submitTime, submitterId, queued) " .
" VALUES('?', '?', ?, '?', '?') " ,
2007-04-21 02:30:22 +00:00
$this -> iVersionId , $this -> iBug_id ,
2007-07-31 23:48:22 +00:00
" NOW() " ,
$_SESSION [ 'current' ] -> iUserId ,
$this -> bQueued ? " true " : " false " );
2006-06-24 04:20:32 +00:00
if ( $hResult )
2005-07-13 01:13:46 +00:00
{
2007-08-27 03:48:44 +00:00
$this -> iLinkId = query_appdb_insert_id ();
2005-07-16 20:02:17 +00:00
2005-09-30 01:55:51 +00:00
$this -> SendNotificationMail ();
2007-04-23 23:37:30 +00:00
2005-07-13 01:13:46 +00:00
return true ;
2007-04-21 02:30:22 +00:00
} else
2005-07-13 01:13:46 +00:00
{
2006-06-24 04:20:32 +00:00
addmsg ( " Error while creating a new Bug link. " , " red " );
2005-07-13 01:13:46 +00:00
return false ;
}
}
/**
* Deletes the Bug from the database .
* and request its deletion from the filesystem ( including the thumbnail ) .
2007-08-27 03:48:44 +00:00
*
* Return true if successful , false if an error occurs
2005-07-13 01:13:46 +00:00
*/
2007-09-14 23:02:12 -04:00
function delete ()
2005-07-13 01:13:46 +00:00
{
$sQuery = " DELETE FROM buglinks
2006-06-27 19:16:27 +00:00
WHERE linkId = '?' " ;
2007-09-14 23:02:12 -04:00
if ( ! ( $hResult = query_parameters ( $sQuery , $this -> iLinkId )))
return false ;
2005-07-13 01:13:46 +00:00
2007-08-27 03:48:44 +00:00
return true ;
2005-07-13 01:13:46 +00:00
}
/**
* Move Bug out of the queue .
*/
function unQueue ()
{
// If we are not in the queue, we can't move the Bug out of the queue.
if ( ! $this -> bQueued )
return false ;
2006-07-04 03:43:06 +00:00
if ( query_parameters ( " UPDATE buglinks SET queued = '?' WHERE linkId='?' " ,
" false " , $this -> iLinkId ))
2005-07-13 01:13:46 +00:00
{
$this -> bQueued = false ;
2006-12-31 19:39:41 +00:00
// we send an e-mail to interested people
2005-07-13 01:13:46 +00:00
$this -> mailSubmitter ();
2005-09-30 01:55:51 +00:00
$this -> SendNotificationMail ();
2005-07-13 01:13:46 +00:00
// the Bug has been unqueued
addmsg ( " The Bug has been unqueued. " , " green " );
}
}
2007-08-27 03:48:44 +00:00
//TODO: figure out what we might want to do here but lie and
// return true until then
function update ()
{
return true ;
}
2005-07-13 01:13:46 +00:00
function mailSubmitter ( $bRejected = false )
{
2007-01-04 02:35:01 +00:00
global $aClean ;
if ( ! isset ( $aClean [ 'sReplyText' ]))
$aClean [ 'sReplyText' ] = " " ;
2007-08-27 03:48:44 +00:00
2005-07-13 01:13:46 +00:00
if ( $this -> iSubmitterId )
{
$oSubmitter = new User ( $this -> iSubmitterId );
2007-08-27 03:48:44 +00:00
$sAppName = Version :: fullName ( $this -> iVersionId );
2005-07-13 01:13:46 +00:00
if ( ! $bRejected )
{
$sSubject = " Submitted Bug Link accepted " ;
2007-05-26 01:39:46 +00:00
$sMsg = " The bug link you submitted between Bug " . $this -> iBug_id . " and " .
$sAppName . " has been accepted. " ;
2005-07-13 01:13:46 +00:00
} else
{
$sSubject = " Submitted Bug Link rejected " ;
2007-05-26 01:39:46 +00:00
$sMsg = " The bug link you submitted between Bug " . $this -> iBug_id . " and " .
$sAppName . " has been deleted. " ;
2005-07-13 01:13:46 +00:00
}
2006-07-13 18:54:10 +00:00
$sMsg .= $aClean [ 'sReplyText' ] . " \n " ;
2005-07-13 01:13:46 +00:00
$sMsg .= " We appreciate your help in making the Application Database better for all users. " ;
mail_appdb ( $oSubmitter -> sEmail , $sSubject , $sMsg );
}
}
2005-09-30 01:55:51 +00:00
function SendNotificationMail ( $bDeleted = false )
2005-07-13 01:13:46 +00:00
{
2007-04-03 02:08:44 +00:00
$sAppName = version :: fullName ( $this -> iVersionId );
$oVersion = new version ( $this -> iVersionId );
2005-07-13 01:13:46 +00:00
if ( ! $bDeleted )
{
if ( ! $this -> bQueued )
{
2006-06-29 16:07:19 +00:00
$sSubject = " Link between Bug " . $this -> iBug_id . " and " . $sAppName . " added by " . $_SESSION [ 'current' ] -> sRealname ;
2007-04-03 02:08:44 +00:00
$sMsg = $oVersion -> objectMakeUrl () . " \n " ;
2005-07-13 01:13:46 +00:00
if ( $this -> iSubmitterId )
{
$oSubmitter = new User ( $this -> iSubmitterId );
$sMsg .= " This Bug Link has been submitted by " . $oSubmitter -> sRealname . " . " ;
$sMsg .= " \n " ;
}
addmsg ( " The Bug Link was successfully added into the database. " , " green " );
} else // Bug Link queued.
{
2006-06-29 16:07:19 +00:00
$sSubject = " Link between Bug " . $this -> iBug_id . " and " . $sAppName . " submitted by " . $_SESSION [ 'current' ] -> sRealname ;
2007-04-03 02:08:44 +00:00
$sMsg = $oVersion -> objectMakeUrl () . " \n " ;
2005-07-13 01:13:46 +00:00
$sMsg .= " This Bug Link has been queued. " ;
$sMsg .= " \n " ;
2005-07-16 20:02:17 +00:00
addmsg ( " The Bug Link you submitted will be added to the database after being reviewed. " , " green " );
2005-07-13 01:13:46 +00:00
}
} else // Bug Link deleted.
{
2006-06-29 16:07:19 +00:00
$sSubject = " Link between Bug " . $this -> iBug_id . " and " . $sAppName . " deleted by " . $_SESSION [ 'current' ] -> sRealname ;
2007-04-03 02:08:44 +00:00
$sMsg = $oVersion -> objectMakeUrl () . " \n " ;
2005-07-13 01:13:46 +00:00
addmsg ( " Bug Link deleted. " , " green " );
}
2006-06-29 15:54:29 +00:00
$sEmail = User :: get_notify_email_address_list ( null , $this -> iVersionId );
2005-07-13 01:13:46 +00:00
if ( $sEmail )
{
mail_appdb ( $sEmail , $sSubject , $sMsg );
}
2006-12-27 03:26:16 +00:00
}
2007-09-14 23:02:12 -04:00
function objectGetSubmitterId ()
{
return $this -> iSubmitterId ;
}
function objectGetMailOptions ( $sAction , $bMailSubmitter , $bParentAction )
{
return new mailOptions ();
}
function objectGetMail ( $sAction , $bMailSubmitter , $bParentAction )
{
/* We don't do this at the moment */
return array ( null , null , null );
}
2007-09-08 22:29:17 +00:00
function objectGetChildren ()
{
return array ();
}
2006-12-27 03:26:16 +00:00
/* Get a list of bugs submitted by a given user */
function listSubmittedBy ( $iUserId , $bQueued = true )
{
$hResult = query_parameters ( " SELECT appFamily.appName, buglinks.versionId, appVersion.versionName, buglinks.submitTime, buglinks.bug_id FROM buglinks, appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.queued = '?' AND buglinks.submitterId = '?' ORDER BY buglinks.versionId " , $bQueued ? " true " : " false " , $iUserId );
2007-08-03 23:27:25 +00:00
if ( ! $hResult || ! query_num_rows ( $hResult ))
2006-12-27 03:26:16 +00:00
return FALSE ;
$sReturn = html_table_begin ( " width= \" 100% \" align= \" center \" " );
$sReturn .= html_tr ( array (
" Version " ,
array ( " Bug # " , 'width="50"' ),
array ( " Status " , 'width="80"' ),
array ( " Resolution " , 'width="110"' ),
" Description " ,
" Submit time " ),
" color4 " );
2007-08-03 23:27:25 +00:00
for ( $i = 1 ; $oRow = query_fetch_object ( $hResult ); $i ++ )
2006-12-27 03:26:16 +00:00
{
$oBug = new Bug ( $oRow -> bug_id );
$sReturn .= html_tr ( array (
2007-04-03 02:08:44 +00:00
version :: fullNameUrl ( $oRow -> versionId ),
2006-12-27 03:26:16 +00:00
" <a href= \" " . BUGZILLA_ROOT . " show_bug.cgi?id= " . $oRow -> bug_id . " \" > " . $oRow -> bug_id . " </a> " ,
$oBug -> sBug_status ,
$oBug -> sResolution ,
$oBug -> sShort_desc ,
2007-07-31 23:48:22 +00:00
print_date ( mysqldatetime_to_unixtimestamp ( $oRow -> submitTime ))),
2006-12-27 03:26:16 +00:00
( $i % 2 ) ? " color0 " : " color1 " );
}
$sReturn .= html_table_end ();
return $sReturn ;
}
2007-07-22 00:49:15 +00:00
function isOpen ()
{
return ( $this -> sBug_status != 'RESOLVED' && $this -> sBug_status != 'CLOSED' );
}
2007-08-27 03:48:44 +00:00
function allowAnonymousSubmissions ()
{
return false ;
}
function mustBeQueued ()
{
if ( $_SESSION [ 'current' ] -> hasPriv ( " admin " ) ||
$_SESSION [ 'current' ] -> isMaintainer ( $oVersion -> iVersionId ) ||
$_SESSION [ 'current' ] -> isSuperMaintainer ( $oVersion -> iAppId ))
{
return false ;
}
return true ;
}
function objectGetId ()
{
return $this -> iLinkId ;
}
function objectGetEntries ( $bQueued , $bRejected , $iRows = 0 , $iStart = 0 )
{
$sLimit = " " ;
/* Selecting 0 rows makes no sense , so we assume the user
wants to select all of them
after an offset given by iStart */
if ( ! $iRows )
$iRows = bug :: objectGetEntriesCount ( $bQueued , $bRejected );
$sQueued = objectManager :: getQueueString ( $bQueued , $bRejected );
$sQuery = " select * from buglinks where queued = '?' LIMIT ?, ? " ;
$hResult = query_parameters ( $sQuery , $sQueued , $iStart , $iRows );
return $hResult ;
}
function objectGetEntriesCount ( $bQueued , $bRejected )
{
$sQueued = objectManager :: getQueueString ( $bQueued , $bRejected );
$sQuery = " select count(*) as cnt from buglinks where queued = '?' " ;
$hResult = query_parameters ( $sQuery , $sQueued );
$oRow = mysql_fetch_object ( $hResult );
return $oRow -> cnt ;
}
function objectGetHeader ()
{
$oTableRow = new TableRow ();
$oTableRow -> AddTextCell ( " Bug # " );
$oTableCell = new TableCell ( " Status " );
$oTableCell -> SetAlign ( " center " );
$oTableRow -> AddCell ( $oTableCell );
$oTableRow -> AddTextCell ( " Bug Description " );
$oTableCell = new TableCell ( " Application Name " );
$oTableCell -> SetAlign ( " center " );
$oTableRow -> AddCell ( $oTableCell );
$oTableCell = new TableCell ( " Application Description " );
$oTableCell -> SetAlign ( " center " );
$oTableRow -> AddCell ( $oTableCell );
$oTableCell = new TableCell ( " Version " );
$oTableCell -> SetAlign ( " center " );
$oTableRow -> AddCell ( $oTableCell );
return $oTableRow ;
}
// returns a table row
function objectGetTableRow ()
{
$oTableRow = new TableRow ();
$oVersion = new version ( $this -> iVersionId );
$oApp = new application ( $oVersion -> iAppId );
$oTableCell = new TableCell ( $this -> iBug_id );
$oTableCell -> SetAlign ( " center " );
2007-09-08 04:42:34 +00:00
$oTableCell -> SetCellLink ( BUGZILLA_ROOT . 'show_bug.cgi?id=' . $this -> iBug_id );
2007-08-27 03:48:44 +00:00
$oTableRow -> AddCell ( $oTableCell );
$oTableCell = new TableCell ( $this -> sBug_status );
$oTableCell -> SetAlign ( " center " );
$oTableRow -> AddCell ( $oTableCell );
$oTableRow -> AddTextCell ( $this -> sShort_desc );
$oTableRow -> AddTextCell ( $oApp -> objectMakeLink ());
$oTableRow -> AddTextCell ( util_trim_description ( $oApp -> sDescription ));
$oTableRow -> AddTextCell ( $oVersion -> objectMakeLink ());
$oOMTableRow = new OMTableRow ( $oTableRow );
// enable the deletion link, the objectManager will check
// for appropriate permissions before adding the link
2007-09-18 21:22:43 -04:00
$oOMTableRow -> SetHasDeleteLink ( true );
2007-08-27 03:48:44 +00:00
return $oOMTableRow ;
}
function objectMakeUrl ()
{
$oManager = new objectManager ( " bug " , " View Bug " );
return $oManager -> makeUrl ( " view " , $this -> objectGetId ());
}
function objectMakeLink ()
{
$sLink = " <a href= \" " . $this -> objectMakeUrl () . " \" > " .
$this -> sShort_desc . " </a> " ;
return $sLink ;
}
function canEdit ()
{
if ( $_SESSION [ 'current' ] -> hasPriv ( " admin " ))
{
return true ;
} else if ( $this -> iVersionId )
{
if ( maintainer :: isUserMaintainer ( $_SESSION [ 'current' ],
$this -> iVersionId ))
{
return true ;
}
}
return false ;
}
function objectGetItemsPerPage ( $bQueued = false )
{
$aItemsPerPage = array ( 25 , 50 , 100 , 200 );
$iDefaultPerPage = 25 ;
return array ( $aItemsPerPage , $iDefaultPerPage );
}
function display ()
{
$oTable = new Table ();
$oTable -> SetAlign ( " center " );
$oTable -> SetClass ( " color0 " );
$oTable -> SetCellPadding ( 2 );
$oHeaderRow = $this -> objectGetHeader ();
$oHeaderRow -> SetClass ( " color4 " );
$oTable -> AddRow ( $oHeaderRow );
$oDataRow = $this -> objectGetTableRow ();
$oDataRow -> oTableRow -> SetClass ( " color0 " );
$oTable -> AddRow ( $oDataRow );
echo $oTable -> GetString ();
}
// NOTE: we don't have any editing support for this entry at this time
// so output the entry and a field to identify the bug id
function outputEditor ()
{
$this -> display ();
2007-09-18 14:53:25 +02:00
echo '<input type="hidden" name="iBuglinkId" value="' . $this -> iBug_id . '" />' ;
echo '<input type="hidden" name="iVersionId" value="' . $this -> iVersionId . '" />' ;
2007-08-27 03:48:44 +00:00
}
function getOutputEditorValues ( $aClean )
{
2007-09-14 23:37:10 -04:00
$this -> iBug_id = $aClean [ 'iBuglinkId' ];
$this -> iVersionId = $aClean [ 'iVersionId' ];
2007-08-27 03:48:44 +00:00
}
2005-07-13 01:13:46 +00:00
}
/*
* Bug Link functions that are not part of the class
*/
function view_version_bugs ( $iVersionId = null , $aBuglinkIds )
{
2007-01-04 02:35:01 +00:00
global $aClean ;
2006-06-17 06:10:10 +00:00
2005-07-13 01:13:46 +00:00
$bCanEdit = FALSE ;
$oVersion = new Version ( $iVersionId );
2005-07-16 20:02:17 +00:00
2005-07-13 01:13:46 +00:00
// Security, if we are an administrator or a maintainer, we can remove or ok links.
if (( $_SESSION [ 'current' ] -> hasPriv ( " admin " ) ||
$_SESSION [ 'current' ] -> isMaintainer ( $oVersion -> iVersionId ) ||
$_SESSION [ 'current' ] -> isSuperMaintainer ( $oVersion -> iAppId )))
{
$bCanEdit = TRUE ;
}
//start format table
if ( $_SESSION [ 'current' ] -> isLoggedIn ())
{
2007-09-14 23:37:10 -04:00
echo " <form method=post action=' " . APPDB_ROOT . " objectManager.php'> \n " ;
2005-07-13 01:13:46 +00:00
}
echo html_frame_start ( " Known bugs " , " 98% " , '' , 0 );
echo " <table width= \" 100% \" border= \" 0 \" cellpadding= \" 3 \" cellspacing= \" 1 \" > \n \n " ;
echo " <tr class=color4> \n " ;
echo " <td align=center width= \" 80 \" >Bug #</td> \n " ;
echo " <td>Description</td> \n " ;
echo " <td align=center width= \" 80 \" >Status</td> \n " ;
echo " <td align=center width= \" 80 \" >Resolution</td> \n " ;
echo " <td align=center width= \" 80 \" >Other Apps affected</td> \n " ;
if ( $bCanEdit == true )
{
echo " <td align=center width= \" 80 \" >delete</td> \n " ;
echo " <td align=center width= \" 80 \" >checked</td> \n " ;
}
echo " </tr> \n \n " ;
$c = 0 ;
foreach ( $aBuglinkIds as $iBuglinkId )
{
2006-09-06 01:43:30 +00:00
$oBuglink = new Bug ( $iBuglinkId );
2005-07-13 01:13:46 +00:00
2007-07-22 00:49:15 +00:00
if (
( ! isset ( $aClean [ 'sAllBugs' ]) && $oBuglink -> isOpen () )
||
isset ( $aClean [ 'sAllBugs' ])
)
2005-07-13 01:13:46 +00:00
{
2007-07-21 23:32:10 +00:00
// set row color
$bgcolor = ( $c % 2 == 0 ) ? " color0 " : " color1 " ;
//display row
echo " <tr class= $bgcolor > \n " ;
echo " <td align=center><a href=' " . BUGZILLA_ROOT . " show_bug.cgi?id= " . $oBuglink -> iBug_id . " '> " . $oBuglink -> iBug_id . " </a></td> \n " ;
echo " <td> " . $oBuglink -> sShort_desc . " </td> \n " ;
echo " <td align=center> " . $oBuglink -> sBug_status . " </td> " , " \n " ;
echo " <td align=center> " . $oBuglink -> sResolution . " </td> " , " \n " ;
echo " <td align=center><a href='viewbugs.php?bug_id= " . $oBuglink -> iBug_id . " '>View</a></td> \n " ;
if ( $bCanEdit == true )
2005-07-13 01:13:46 +00:00
{
2007-09-17 20:41:47 +02:00
echo " <td align=center>[<a href='objectManager.php?sClass=bug&iId= " . $oBuglink -> iLinkId . " &sAction=delete&sSubmit=Delete&sReturnTo= " . $oVersion -> objectMakeUrl () . " '>delete</a>]</td> \n " ;
2007-07-21 23:32:10 +00:00
if ( $oBuglink -> bQueued )
{
2007-09-17 20:57:14 +02:00
echo " <td align=center>[<a href='objectManager.php?sClass=bug&iId= " . $oBuglink -> iLinkId . " &sAction=edit&sSubmit=Submit&bIsQueue=true&sReturnTo= " . $oVersion -> objectMakeUrl () . " '>OK</a>]</td> \n " ;
2007-07-21 23:32:10 +00:00
} else
{
echo " <td align=center>Yes</td> \n " ;
}
2005-07-13 01:13:46 +00:00
}
2007-07-21 23:32:10 +00:00
echo " </tr> \n \n " ;
2005-07-13 01:13:46 +00:00
2007-07-21 23:32:10 +00:00
$c ++ ;
}
2005-07-13 01:13:46 +00:00
}
2007-07-21 23:32:10 +00:00
2005-07-13 01:13:46 +00:00
if ( $_SESSION [ 'current' ] -> isLoggedIn ())
{
2006-07-06 17:27:54 +00:00
echo '<input type="hidden" name="iVersionId" value="' . $iVersionId . '">' , " \n " ;
2005-07-13 01:13:46 +00:00
echo '<tr class=color3><td align=center>' , " \n " ;
2007-07-21 23:32:10 +00:00
$sBuglinkId = isset ( $aClean [ 'buglinkId' ]) ? $aClean [ 'buglinkId' ] : '' ;
echo '<input type="text" name="iBuglinkId" value="' . $sBuglinkId . '" size="8"></td>' , " \n " ;
2007-09-14 23:37:10 -04:00
echo '<input type="hidden" name="sSubmit" value="Submit" />' , " \n " ;
echo '<input type="hidden" name="sClass" value="bug" />' , " \n " ;
echo '<input type="hidden" name="sReturnTo" value="' . $oVersion -> objectMakeUrl () . '" />' , " \n " ;
2006-07-06 17:27:54 +00:00
echo '<td><input type="submit" name="sSub" value="Submit a new bug link."></td>' , " \n " ;
2005-07-30 03:15:50 +00:00
echo '<td colspan=6></td></tr></form>' , " \n " ;
2005-07-13 01:13:46 +00:00
}
echo '</table>' , " \n " ;
2007-07-21 23:32:10 +00:00
// show only open link
if ( isset ( $aClean [ 'sAllBugs' ] ) )
{
$sURL = str_replace ( '&sAllBugs' , '' , $_SERVER [ 'REQUEST_URI' ] );
$sLink = '<a href="' . $sURL . '">Show Open Bugs</a>' ;
}
// show all link
else
{
$sURL = $_SERVER [ 'REQUEST_URI' ] . '&sAllBugs' ;
$sLink = '<a href="' . $sURL . '">Show All Bugs</a>' ;
}
echo '<div style="text-align:right;">' . $sLink . '</div>' ;
2005-07-13 01:13:46 +00:00
echo html_frame_end ();
2006-12-27 03:26:16 +00:00
}
2005-07-13 01:13:46 +00:00
?>