-
testlink&mantis系列:查看问题页按日期和其它项搜索结果不正确的问题
2013-01-15 15:41:11
mantisbt-1.2.12.zip版本自身问题:
查看问题页,按日期和其它项进行搜索时,搜索结果不正确的问题
修改mantis\core\filter_api.php
array_push( $t_project_where_clauses, "($t_bug_table.date_submitted BETWEEN " . db_param() . " AND " . db_param() . " )" );
=>
//2013-01-14 luly 修改按日期和其它项进行搜索时,搜索结果不正确的问题
//array_push( $t_project_where_clauses, "($t_bug_table.date_submitted BETWEEN " . db_param() . " AND " . db_param() . " )" );
array_push( $t_where_clauses, "($t_bug_table.date_submitted BETWEEN " . db_param() . " AND " . db_param() . " )" );
-
testlink&mantis系列:Mantis安装配置jpgraph
2013-01-15 15:39:48
1. Mantis安装配置jpgraph
1.1. 下载安装
(1)下载地址:
http://jpgraph.net/download/
这里使用:jpgraph-3.5.0b1.tar.gz
(2)解压其子目录src至mantis\library目录下,并改名为:jpgraph;
(3)确认PHP中有加载jpgraph使用的动态库:extension=php_gd2.dll
(4)安装插件:管理-插件管理-安装MantisGraph插件
(5)修改MantisGraph插件配置
要使用的图形库修改为:JpGraph
JpGraph 库系统路径:设置为对应的jpgraph路径;
例:D:\Program Files\EasyPHP-12.1\www\mantis\library\jpgraph
1.2. 修改mantis\library\jpgraph\jpgraph_ttf.inc.php
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}
=》
//2013-01-09 luly 解决jpgraph中文乱码问题
/*elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}*/
elseif( $aFF === FF_SIMSUN ) {
return $aTxt;
}
1.3. 修改mantis\plugins\MantisGraph\pages\config.php
(1)增加字体simsun
$t_current_font_selected = array(
'arial' => false,
=》
$t_current_font_selected = array(
//2013-01-09 luly 解决jpgraph中文乱码问题
'simsun' => false,
'arial' => false,
(2)配置页面显示新增加的simsun(宋体)
<td style="vertical-align: top">
Sans-serif:<br />
<label><input type="radio" name="font" value="arial"<?php echo print_font_checked( 'arial' )?>/>Arial</label><br />
=》
<td style="vertical-align: top">
Sans-serif:<br />
<!--2013-01-09 luly 解决jpgraph中文乱码问题 -->
<label><input type="radio" name="font" value="simsun"<?php echo print_font_checked( 'simsun' )?>/>宋体</label><br />
<label><input type="radio" name="font" value="arial"<?php echo print_font_checked( 'arial' )?>/>Arial</label><br />
注:因直接使用中文,为不显示为乱码,需要把该代码文件,转换成UTF-8编码格式,文件另存为时选择即可;
1.4. 修改mantis\plugins\MantisGraph\pages\config_edit.php
if ( plugin_config_get( 'font' ) != $f_font ) {
switch ( $f_font ) {
case 'arial':
=》
if ( plugin_config_get( 'font' ) != $f_font ) {
switch ( $f_font ) {
//2013-01-09 luly 解决jpgraph中文乱码问题
case 'simsun';
case 'arial':
1.5. 修改mantis\plugins\MantisGraph\core\graph_api.php
$t_font_map = array(
'arial' => FF_ARIAL,
=》
$t_font_map = array(
//2013-01-09 luly 解决jpgraph中文乱码问题
'simsun' => FF_SIMSUN,
'arial' => FF_ARIAL,
1.6. 修改MantisGraph插件配置
管理-插件管理-MantisGraph插件
编辑配置,修改字体为“宋体”
-
testlink&mantis系列:Testlink提交BUG到mantis方式简化
2013-01-15 15:37:22
1. Testlink提交BUG到mantis方式简化
1.1. Testlink提交BUG链接修改
1.1.1. 执行用例时,提交BUG的窗口链接修改为链接到mantis提交问题的页面
修改testlink\gui\templates\execute\inc_exec_show_tc_exec.tpl
如下:
{if $tc_old_exec.build_is_open}
<a href="javascript.:open_bug_add_window({$gui->tproject_id},{$tc_old_exec.id},{$tc_old_exec.execution_id},'link')">
=》
{if $tc_old_exec.build_is_open}
{* 2013-01-06 luly 增加BUG时,进行testlink关联 *}
{* <a href="javascript.:open_bug_add_window({$gui->tproject_id},{$tc_old_exec.id},{$tc_old_exec.execution_id},'link')"> *}
<a href="http://192.168.134.120/mantis/bug_report_page.php?exec_id={$tc_old_exec.execution_id}" target='_blank'>
{* *********************************************************** *}
1.1.2. mantis 提交bug的时候判断是否有exec_id参数传入
修改mantis\bug_report_page.php
<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />后增加一行:
<input type="hidden" name="exec_id" value="<?php echo $_GET["exec_id"]; ?>" />
如下:
<tr>
<td class="form-title" colspan="2">
<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
<?php echo lang_get( 'enter_report_details_title' ) ?>
</td>
</tr>
=》
<tr>
<td class="form-title" colspan="2">
<input type="hidden" name="m_id" value="<?php echo $f_master_bug_id ?>" />
<input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
<!--2013-01-06 luly 增加BUG时,进行testlink关联-->
<input type="hidden" name="exec_id" value="<?php echo $_GET["exec_id"]; ?>" />
<!--***********************************************************--> <?php echo lang_get( 'enter_report_details_title' ) ?>
</td>
</tr>
1.1.3. 在mantis目录下面新增bug_add_testlink.php页面,进行testlink和mantis的BUG关联的处理
新增:mantis\bug_add_testlink.php
<?php
//2013-01-06 luly 增加BUG时,进行testlink关联
function write_execution_bug($exec_id, $bug_id,$just_delete=false)
{
$conn = mysql_connect("localhost","root","");
$execution_bugs = 'testlink.ttexecution_bugs';
// Instead of Check if record exists before inserting, do delete + insert
$sql = "DELETE FROM {$execution_bugs} " .
"WHERE execution_id={$exec_id} " .
"AND bug_id='" . $bug_id ."'";
$result = mysql_query($sql,$conn);
if(!$just_delete)
{
$sql = "INSERT INTO {$execution_bugs} " .
"(execution_id,bug_id) " .
"VALUES({$exec_id},'" . $bug_id . "')";
$result = mysql_query($sql,$conn);
}
return $result ? 1 : 0;
}
?>
1.1.4. 修改bug_report.php,如果存在exec_id,则进行testlink和mantis的BUG关联
修改mantis\bug_report.php
(1)在一开始增加一句:
//2013-01-06 luly 增加BUG时,进行testlink关联
require_once( 'bug_add_testlink.php' );
//***********************************************************//
(2)修改如下内容:
$t_bug_id = $t_bug_data->create();
=》
//2013-01-06 luly 增加BUG时,进行testlink关联
//$t_bug_id = $t_bug_data->create();
$testlink_exec_id = $_POST["exec_id"];
if ($testlink_exec_id!= "")
{
$t_bug_id = $t_bug_data->create();
write_execution_bug($testlink_exec_id,$t_bug_id);
}
else
{
$t_bug_id = $t_bug_data->create();
}
//***********************************************************//
(3)修改如下内容:
<form method="post" action="<?php echo string_get_bug_report_url() ?>">
=》
<!--2013-01-06 luly 增加BUG时,进行testlink关联-->
<!--<form method="post" action="<?php echo string_get_bug_report_url() ?>">-->
<form method="post" action="<?php echo string_get_bug_report_url() ?>?exec_id=<?php echo $_POST['exec_id']; ?>">
<!--***********************************************************-->
1.2. Mantis删除BUG时,自动删除testlink关联
1.2.1. 修改bug_add_testlink.php 增加删除bug时,自动删除testlink关联的函数
修改mantis\bug_add_testlink.php
//2013-01-06 luly 删除BUG时,删除对应的testlink关联
function delete_testlink_bug($bug_id)
{
$conn = mysql_connect("localhost","root","");
$execution_bugs = 'testlink.ttexecution_bugs';
$sql = "DELETE FROM $execution_bugs WHERE bug_id = $bug_id ";
$result = mysql_query($sql,$conn);
return $result ? 1 : 0;
}
1.2.2. 修改bug_actiongroup.php,调用删除testlink关联的函数
修改mantis\bug_actiongroup.php
在开始增加:
//2013-01-06 luly 删除BUG时,删除对应的testlink关联
require_once( 'bug_add_testlink.php' );
//***********************************************************//
修改如下内容:
bug_delete( $t_bug_id );
=》
bug_delete( $t_bug_id );
//2013-01-06 luly 删除BUG时,删除对应的testlink关联
delete_testlink_bug($t_bug_id);
-
testlink&mantis系列: Testlink配置修改
2013-01-15 15:34:03
1. Testlink配置修改
1.1. config.inc.php
1.1.1. 日志路径配置
/**
* @var string Path to store logs -
* for security reasons (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/)
* put it out of reach via web or configure access denied.
*/
//$tlCfg->log_path = '/var/testlink/logs/'; /* unix example */
=>
$tlCfg->log_path = 'D:\Program Files\EasyPHP-12.1\www\testlink\logs\\';
1.1.2. 上传文件路径配置
/**
* TL_REPOSITORY_TYPE_FS: the where the filesystem repository should be located
* We recommend to change the directory for security reason.
* (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/)
* Put it out of reach via web or configure access denied.
*
**/
//$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */
=》
$g_repositoryPath = 'D:\Program Files\EasyPHP-12.1\www\testlink\upload_area\\';
1.1.3. 配置检查警告模式修改
There are security warnings for your consideration. See details on file: D:\Program Files\EasyPHP-12.1\www\testlink\logsconfig_check.txt. To disable any reference to these checkings, set $tlCfg->config_check_warning_mode = 'SILENT';
/**
* @var string How to warning user when security weak points exists.
*
* 'SCREEN': messages will displayed on login screen, and tl desktop (default)
* 'FILE': a file with a list is created but users are not notified via GUI
* user will receive a message on screen.
* 'SILENT': same that FILE, but user will not receive message on screen.
*/
//$tlCfg->config_check_warning_mode = 'FILE';
=》
$tlCfg->config_check_warning_mode = 'SILENT';
1.1.4. 语言设置
/** @var string Default localization for users */
// The value must be available in $g_locales (see cfg/const.inc.php).
// Note: An attempt will be done to establish the default locale
// automatically using $_SERVER['HTTP_ACCEPT_LANGUAGE']
//$tlCfg->default_language = 'en_GB';
=》
$tlCfg->default_language = 'zh_CN';
1.2. Testlink数据库配置
testlink\config_db.inc.php
<?php
// Automatically Generated by TestLink Installer
define('DB_TYPE', 'mysql');
define('DB_USER', 'testlink');
define('DB_PASS', 'testlink');
define('DB_HOST', 'localhost');
define('DB_NAME', 'testlink');
define('DB_TABLE_PREFIX', 'tt');
?>
1.3. Testlink和mantis集成
1、首页-Issue Tracker Management
配置内容如下:
Type:mantis (Interface: db)
Configuration:
<!-- Template mantisdbInterface -->
<issuetracker>
<dbhost>localhost</dbhost>
<dbname>bugtracker</dbname>
<dbtype>mysql</dbtype>
<dbuser>root</dbuser>
<dbpassword></dbpassword>
<uriview>http://192.168.134.120/mantis/view.php?id=</uriview>
<uricreate>http://192.168.134.120/mantis/</uricreate>
</issuetracker>
2、测试项目管理配置Issue Tracker,选择刚才配置::mantis (Interface: db)
-
testlink&mantis系列:Mantis配置修改
2013-01-15 15:31:54
1. Mantis配置修改
1.1. config_defaults_inc.php&config_inc.php
下述配置可以在config_defaults_inc.php中直接修改,也可以在config_inc.php中增加;
读配置时,config_inc.php中的配置优先于config_defaults_inc.php;
1.1.1. 创建用户及重置密码时是否发送邮件
config_defaults_inc.php
/**
* If ON, users will be sent their password when their account is created
* or password reset (this requires mail settings to be correctly configured).
* If OFF, then the Administrator will have to provide a password when
* creating new accounts, and the password will be set to blank when reset.
* @global int $g_send_reset_password
*/
$g_send_reset_password = ON;
=》
$g_send_reset_password = OFF;
1.1.2. 语言设置
config_defaults_inc.php
/**
* If the language is set to 'auto', the actual
* language is determined by the user agent (web browser)
* language preference.
* @global string $g_default_language
*/
$g_default_language = 'english';
=》
$g_default_language = 'chinese_simplified';
1.1.3. 允许删除自己上传的附件
config_defaults_inc.php
/**
* allow users to delete attachments uploaded by themselves even if their access
* level is below delete_attachments_threshold.
* @global int $g_allow_delete_own_attachments
*/
$g_allow_delete_own_attachments = OFF;
=》
$g_allow_delete_own_attachments = ON;
1.1.4. 经理以上级别才可以删除别人的附件
/**
* access level needed to delete bug attachments
* @global int $g_delete_attachments_threshold
*/
//$g_delete_attachments_threshold = DEVELOPER;
=》
$g_delete_attachments_threshold = MANAGER;
1.1.5. 允许报告员关闭问题
/**
* reporter can close
* Allow reporters to close the bugs they reported, after they're marked resolved.
* @global int $g_allow_reporter_close
*/
//$g_allow_reporter_close = OFF;
=》
$g_allow_reporter_close = ON;
1.1.6. 不允许用户自己注册帐号
config_defaults_inc.php
/**
* Allow users to signup for their own accounts.
* If ON, then $g_send_reset_password must be ON as well, and mail settings
* must be correctly configured
* @see $g_send_reset_password
* @global int $g_allow_signup
*/
//$g_allow_signup = ON;
=>
$g_allow_signup = OFF;
1.1.7. 修改时区
config_defaults_inc.php
/**
* Default timezone to use in mantis.
* See http://us.php.net/manual/en/timezones.php
* for a list of valid timezones.
* Note: if this is left blank, we use the result of
* date_default_timezone_get() i.e. in order:
* 1. Reading the TZ environment variable (if non empty)
* 2. Reading the value of the date.timezone php.ini option (if set)
* 3. Querying the host operating system (if supported and allowed by the OS)
* 4. If none of the above succeed, will return a default timezone of UTC.
* @global string $g_default_timezone
*/
$g_default_timezone = '';
=》
$g_default_timezone = 'Asia/Shanghai';
1.1.8. 分派列表显示真实姓名
config_defaults_inc.php
/**
* show users with their real name or not
* @global int $g_show_realname
*/
//$g_show_realname = OFF;
=》
$g_show_realname = ON;
1.1.9. mantis邮件配置
config_defaults_inc.php
SMTP服务器设置:
$g_phpMailer_method = PHPMAILER_METHOD_MAIL;
$g_smtp_host = 'localhost';
$g_smtp_username = '';
$g_smtp_password = '';
=>
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = '192.168.146.182';
$g_smtp_username = 'luly@luly182.com';
$g_smtp_password = 'abc1233';
邮件帐号设置:
$g_administrator_email = 'luly@luly182.com';
$g_webmaster_email = 'luly@luly182.com';
$g_from_email = 'luly@luly182.com';
$g_from_name = 'Mantis Bug Tracker';
$g_return_path_email = 'luly@luly182.com';
以上内容进行对应的设置;
邮件通知默认开关设置:
$g_default_email_on_new = ON;
$g_default_email_on_assigned = ON;
$g_default_email_on_feedback = ON;
$g_default_email_on_resolved = ON;
$g_default_email_on_closed = ON;
$g_default_email_on_reopened = ON;
$g_default_email_on_bugnote = ON;
以上设为OFF,默认都不进行邮件通知;
1.1.10. BUG严重级别修改
config_defaults_inc.php
/**
*
* @global string $g_severity_enum_string
*/
$g_severity_enum_string = '10:feature,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block';
=》
$g_severity_enum_string = '10:docbug,20:suggested,30:L,40:M,50:H,60:VH';
mantis\lang\strings_chinese_simplified.txt
对应修改:
$s_severity_enum_string = '10:新功能,20:细节,30:文字,40:小调整,50:小错误,60:很严重,70:崩溃,80:宕机';
=》
$s_severity_enum_string = '10:文档BUG,20:建议,30:L,40:M,50:H,60:VH'; 查看(4095) 评论(2) 收藏 分享 管理
testlink&mantis系列: 安装Mantis&Testlink
2013-01-15 15:27:49
1. 安装Mantis&Testlink
在windows平台下,安装mantis&testlink
网上相关介绍的文章有很多;
这里使用EasyPHP进行基础环境:php+apache+mysql的安装;
EasyPHP下载地址:
http://www.easyphp.org/
EasyPHP-12.1_with_PHP-5.4.6-setup.exe
Mantis下载地址:
http://www.mantisbt.org/download.php
mantisbt-1.2.12.zip
Testlink下载地址:
http://sourceforge.net/projects/testlink/files/
testlink-1.9.5.tar.gz
我的栏目
标题搜索
我的存档
数据统计
- 访问量: 1091864
- 日志数: 260
- 文件数: 1
- 书签数: 1
- 建立时间: 2009-01-05
- 更新时间: 2017-08-22