📄 bugs.php
字号:
<?php
/*
// OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
// all the essential functionalities required for any enterprise.
// Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
// OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
// the GNU General Public License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
// OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along with this program;
// if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA
*/
require_once ROOT_PATH . '/lib/confs/Conf.php';
require_once ROOT_PATH . '/lib/dao/DMLFunctions.php';
require_once ROOT_PATH . '/lib/dao/SQLQBuilder.php';
require_once ROOT_PATH . '/lib/common/CommonFunctions.php';
require_once ROOT_PATH . '/lib/exception/ExceptionHandler.php';
class Bugs {
var $tableName = 'HS_HR_BUGS';
var $id;
var $bugNumber;
var $dateEntered;
var $dateModified;
var $modifiedUserId;
var $assignedDeveloperId;
var $deleted;
var $name;
var $status;
var $priority;
var $description;
var $createdBy;
var $resolution;
var $foundInRelease;
var $type;
var $fixedInRelease;
var $workLog;
var $source;
var $module;
var $email;
var $sql_builder;
var $dbConnection;
var $arrayDispList;
var $statusArray= array("new","assigned","closed","pending","rejected","reopen");
var $typeArray = array("defect","feature");
var $priorityArray = array("low","medium","high","urgent");
var $resolutionArray = array("accepted","duplicate","fixed","out of date","invalid","later");
var $sourceArray = array("internal","web","forum");
function Bugs(){
$this->sql_builder = new SQLQBuilder();
$this->dbConnection = new DMLFunctions();
}
function setBugId($id){
$this->id = $id;
}
function setBugNumber($bugNumber){
$this->bugNumber = $bugNumber;
}
function setDateEntered($dateEntered){
$this->dateEntered = $dateEntered;
}
function setDateModified($dateModified){
$this->dateModified = $dateModified;
}
function setModifiedUserId($modifiedUserId){
$this->modifiedUserId = $modifiedUserId;
}
function setAssignedDeveloperId($assignedDeveloperId){
$this->assignedDeveloperId = $assignedDeveloperId;
}
function setDeleted($deleted){
$this->deleted = $deleted;
}
function setName($name){
$this->name = $name;
}
function setStatus($status){
$this->status = $status;
}
function setPriority($priority){
$this->priority = $priority;
}
function setDescription($description){
$this->description = $description;
}
function setCreatedBy($createdBy){
$this->createdBy = $createdBy;
}
function setResolution($resolution){
$this->resolution = $resolution;
}
function setFoundInrelease($foundInRelease){
$this->foundInRelease = $foundInRelease;
}
function setType($type){
$this->type = $type;
}
function setFixedInRelease ($fixedInRelease){
$this->fixedInRelease = $fixedInRelease;
}
function setWorkLog($workLog){
$this->workLog = $workLog;
}
function setSource($source){
$this->source = $source;
}
function setModule($module){
$this->module = $module;
}
function setEmail($email) {
$this->email = $email;
}
function getDate(){
$date = getdate();
$textDate = $date['year']. "-".$date['mon']."-".$date['mday'] ;
return $textDate;
}
//////
function getBugId(){
return $this->id;
}
function getBugNumber(){
return $this->bugNumber;
}
function getDateEntered(){
return $this->dateEntered;
}
function getDateModified(){
return $this->dateModified;
}
function getModifiedUserId(){
return $this->modifiedUserId;
}
function getAssignedDeveloperId(){
return $this->assignedDeveloperId;
}
function getDeleted(){
return $this->deleted;
}
function getName(){
return $this->name;
}
function getStatus(){
return $this->status;
}
function getPriority(){
return $this->priority;
}
function getDescription(){
return $this->description;
}
function getCreatedBy(){
return $this->createdBy;
}
function getResolution(){
return $this->resolution;
}
function getFoundInrelease(){
return $this->foundInRelease;
}
function getType(){
return $this->type;
}
function getFixedInRelease (){
return $this->fixedInRelease;
}
function getWorkLog(){
return $this->workLog;
}
function getSource(){
return $this->source;
}
function getEmail() {
return $this->email;
}
function getModule(){
return $this->module;
}
function getListOfBugs($pageNo,$schStr,$mode){
$arrFieldList[0] = 'ID';
$arrFieldList[1] = 'name';
$this->sql_builder->table_name = $this->tableName;
$this->sql_builder->flg_select = 'true';
$this->sql_builder->arr_select = $arrFieldList;
$sqlQString =$this->sql_builder->passResultSetMessage($pageNo,$schStr,$mode);
$message2 = $this->dbConnection -> executeQuery($sqlQString);
$i=0;
while ($line = mysql_fetch_array($message2, MYSQL_NUM)) {
$arrayDispList[$i][0] = $line[0];
$arrayDispList[$i][1] = $line[1];
$i++;
}
if (isset($arrayDispList)) {
return $arrayDispList;
} else {
$arrayDispList = '';
return $arrayDispList;
}
}
function countBugs($schStr,$mode) {
$arrFieldList[0] = 'ID';
$arrFieldList[1] = 'name';
$sql_builder = new SQLQBuilder();
$sql_builder->table_name = $this->tableName;
$sql_builder->flg_select = 'true';
$sql_builder->arr_select = $arrFieldList;
$sqlQString = $sql_builder->countResultset($schStr,$mode);
//echo $sqlQString;
$dbConnection = new DMLFunctions();
$message2 = $dbConnection -> executeQuery($sqlQString); //Calling the addData() function
$line = mysql_fetch_array($message2, MYSQL_NUM);
return $line[0];
}
function addBugs(){
$arrFieldList[0] = "'". $this->getBugId() . "'";
$arrFieldList[1] = "'". $this->getBugNumber() . "'";
$arrFieldList[2] = "'". $this->getCreatedBy() . "'";
$arrFieldList[3] = "'". $this->getDateEntered() . "'";
$arrFieldList[4] = 'null';//"'". $this->getAssignedDeveloperId() . "'";
$arrFieldList[5] = "'". $this->getDescription() ."'";
$arrFieldList[6] = "'". $this->getFoundInrelease() ."'";
$arrFieldList[7] = "'". $this->getModule() ."'";
$arrFieldList[8] = "'". $this->getName() ."'";
$arrFieldList[9] = "'". $this->getPriority() ."'";
$arrFieldList[10] = "'". $this->getSource() ."'";
$arrFieldList[11] = "'". $this->getStatus() ."'";
$arrFieldList[12] = "'". $this->getType() ."'";
$arrFieldList[13] = "'". $this->getWorkLog() ."'";
$sysConst = new sysConf();
$to = 'koshika@beyondm.net';
$body = "Reported Date:".date("Y-m-d")."\n"."Name:".$this->getName()."\nModule:" .$this->getModule(). "\n Priority:".$this->getPriority()."\n". "Description:".$this->getDescription(). "\n";
$subject = "Bug Reported";
$headers = 'From: '. ($this->getEmail() != '') ? $this->getEmail() : 'noname@none.net' . "\r\n" .'Reply-To: ' . ($this->getEmail() != '') ? $this->getEmail() : 'noname@none.net' . "\r\n" ;
$emailSent = $this->sendMail($to,$subject,$body,$headers);
$description = "Module: " .$this->getModule(). "\n Description:".$this->getDescription(). "\n Email: ". $this->getEmail();
$host = 'sourceforge.net';
$method = 'POST';
$path = '/tracker/?func=add&group_id=156477&atid=799942';
$data = "group_id=156477&atid=799942&func=postadd&category_id=" .$this->getSource(). "&artifact_group_id=" . $this->getFoundInrelease(). "&summary=" .$this->getName(). "&details=" .$description ."&priority=" .$this->getPriority();
$fp = fsockopen($host, 80);
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -