artifacthtml.class

来自「GForge 3.0 协作开发平台 支持CVS, mailing lists, 」· CLASS 代码 · 共 139 行

CLASS
139
字号
<?php/**  *  * SourceForge Generic Tracker facility  *  * SourceForge: Breaking Down the Barriers to Open Source Development  * Copyright 1999-2001 (c) VA Linux Systems  * http://sourceforge.net  *  * @version   $Id: ArtifactHtml.class,v 1.3 2001/05/22 19:57:56 pfalcon Exp $  *  */require_once('common/tracker/Artifact.class');class ArtifactHtml extends Artifact {	/**	 *  ArtifactHtml() - constructor	 *	 *  Use this constructor if you are modifying an existing artifact	 *	 *  @param $ArtifactType object	 *  @param $artifact_id integer (primary key from database)	 *  @return true/false	 */	function ArtifactHtml(&$ArtifactType,$artifact_id=false) {		return $this->Artifact($ArtifactType,$artifact_id);	}	function showMessages() {		global $sys_datefmt;		global $Language;		$result= $this->getMessages();		$rows=db_numrows($result);		if ($rows > 0) {			$title_arr=array();			$title_arr[]=$Language->getText('tracker_artifacthtml','message');			echo $GLOBALS['HTML']->listTableTop ($title_arr);			for ($i=0; $i < $rows; $i++) {				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td><PRE>'.$Language->getText('tracker_artifacthtml','date').': '. date($sys_datefmt,db_result($result, $i, 'adddate')) .''.$Language->getText('tracker_artifacthtml','sender').': '. db_result($result,$i,'user_name') . ''. util_line_wrap ( db_result($result, $i, 'body'),65,"\n"). '</PRE></td></tr>';			}			echo $GLOBALS['HTML']->listTableBottom();		} else {			echo '				<h3>'.$Language->getText('tracker_artifacthtml','no_followups').'</h3>';		}	}	function showHistory() {		global $sys_datefmt,$artifact_cat_arr,$artifact_grp_arr,$artifact_res_arr, $Language;		$result=$this->getHistory();		$rows= db_numrows($result);		if ($rows > 0) {			$title_arr=array();			$title_arr[]=$Language->getText('tracker_artifacthtml','field');			$title_arr[]=$Language->getText('tracker_artifacthtml','old_value');			$title_arr[]=$Language->getText('tracker_artifacthtml','date');			$title_arr[]=$Language->getText('tracker_artifacthtml','by');			echo $GLOBALS['HTML']->listTableTop ($title_arr);			$artifactType =& $this->getArtifactType();			for ($i=0; $i < $rows; $i++) {				$field=db_result($result, $i, 'field_name');				echo '				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'.$field.'</td><td>';				if ($field == 'status_id') {					echo $artifactType->getStatusName(db_result($result, $i, 'old_value'));				} else if ($field == 'resolution_id') {					if (!$artifact_res_arr["_".db_result($result, $i, 'old_value')]) {						$artifact_res_arr["_".db_result($result, $i, 'old_value')] 							= new ArtifactResolution($artifactType,db_result($result, $i, 'old_value'));					}					echo $artifact_res_arr["_".db_result($result, $i, 'old_value')]->getName();				} else if ($field == 'category_id') {					if (!$artifact_cat_arr["_".db_result($result, $i, 'old_value')]) {						$artifact_cat_arr["_".db_result($result, $i, 'old_value')] 							= new ArtifactCategory($artifactType,db_result($result, $i, 'old_value'));					}					echo $artifact_cat_arr["_".db_result($result, $i, 'old_value')]->getName();				} else if ($field == 'artifact_group_id') {					if (!$artifact_grp_arr["_".db_result($result, $i, 'old_value')]) {						$artifact_grp_arr["_".db_result($result, $i, 'old_value')] 							= new ArtifactGroup($artifactType,db_result($result, $i, 'old_value'));					}					echo $artifact_grp_arr["_".db_result($result, $i, 'old_value')]->getName();				} else if ($field == 'assigned_to') {					echo user_getname(db_result($result, $i, 'old_value'));				} else if ($field == 'close_date') {					echo date($sys_datefmt,db_result($result, $i, 'old_value'));				} else {					echo db_result($result, $i, 'old_value');				}				echo '</td>'.					'<td>'. date($sys_datefmt,db_result($result, $i, 'entrydate')) .'</td>'.					'<td>'. db_result($result, $i, 'user_name'). '</td></tr>';			}			echo $GLOBALS['HTML']->listTableBottom();		} else {			echo '			<h3>'.$Language->getText('tracker_artifacthtml','no_changes').'</h3>';		}	}}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?