+ tag for 0.3beta.
This commit is contained in:
21
tags/zentaopms_0.3_beta_20100103/Makefile
Normal file
21
tags/zentaopms_0.3_beta_20100103/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
VERSION=$(shell head -n 1 VERSION)
|
||||
|
||||
all: tgz
|
||||
|
||||
clean:
|
||||
rm -fr pms
|
||||
rm -fr *.tar.gz
|
||||
tgz:
|
||||
mkdir -p pms/lib
|
||||
mkdir -p pms/doc
|
||||
cp doc/zentao.mysql4.sql pms/doc/zentao.sql
|
||||
cp doc/COPY* pms
|
||||
cp -fr lib/front pms/lib
|
||||
cp -fr config pms/
|
||||
cp -fr www pms/
|
||||
cp -fr module pms/
|
||||
find pms -name .svn |xargs rm -fr
|
||||
find pms -name tests |xargs rm -fr
|
||||
mkdir pms/cache
|
||||
tar czvf ZenTaoPMS.$(VERSION).tar.gz pms
|
||||
rm -fr pms
|
||||
1
tags/zentaopms_0.3_beta_20100103/VERSION
Normal file
1
tags/zentaopms_0.3_beta_20100103/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
0.2.ALPHA
|
||||
20
tags/zentaopms_0.3_beta_20100103/bin/computeburn.php
Normal file
20
tags/zentaopms_0.3_beta_20100103/bin/computeburn.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/* 此工具用来计算每个项目的burndown。*/
|
||||
mysql_connect('localhost', 'root', '');
|
||||
mysql_select_db('zentao');
|
||||
|
||||
$result = mysql_query("SELECT id FROM zt_project WHERE end >= CURRENT_DATE() or end = '0000-00-00'");
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
$projects[] = $row['id'];
|
||||
}
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$sql = "SELECT project, sum(`left`) as totalLeft, sum(consumed) as totalConsumed FROM zt_task WHERE project in(" . join(',', $projects) . ') and status !="cancel" group by project';
|
||||
$result = mysql_query($sql) or die(mysql_error());
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
$sql = "REPLACE INTO zt_burn values($row[project], '$date', $row[totalLeft], $row[totalConsumed])";
|
||||
mysql_query($sql);
|
||||
}
|
||||
?>
|
||||
156
tags/zentaopms_0.3_beta_20100103/bin/convertfrombugfree.php
Normal file
156
tags/zentaopms_0.3_beta_20100103/bin/convertfrombugfree.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/* <20><> BugFreeת<65><D7AA><EFBFBD><EFBFBD>zentaopms<6D><73>*/
|
||||
$companyID = 1;
|
||||
$myLink = mysql_connect('localhost', 'root', 'zentao');
|
||||
mysql_select_db('Backyard');
|
||||
mysql_query('SET NAMES UTF8', $myLink);
|
||||
clear();
|
||||
convertUser();
|
||||
convertProject();
|
||||
convertModule();
|
||||
convertBug();
|
||||
convertAction();
|
||||
fixModulePath();
|
||||
|
||||
function convertUser()
|
||||
{
|
||||
global $myLink, $companyID;
|
||||
$sql = "SELECT * FROM BugUser";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($user = mysql_fetch_assoc($result))
|
||||
{
|
||||
extract($user);
|
||||
$sql = "INSERT INTO zt_user(company, id, account, password, realname, email) values('$companyID', $UserID, '$UserName', '$UserPassword', '$RealName', '$Email')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
$sql = "SELECT OpenedBy AS UserName FROM BugInfo GROUP BY OpenedBy";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($user = mysql_fetch_assoc($result))
|
||||
{
|
||||
extract($user);
|
||||
$sql = "SELECT * FROM zt_user WHERE account = '$UserName'";
|
||||
if(!mysql_fetch_row(mysql_query($sql)))
|
||||
{
|
||||
$sql = "INSERT INTO zt_user(company, account) values('$companyID', '$UserName')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
$sql = "INSERT INTO zt_user(company, account) values('$companyID', 'liyp')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
|
||||
}
|
||||
|
||||
function convertProject()
|
||||
{
|
||||
global $myLink, $companyID;
|
||||
$sql = "SELECT * FROM BugProject";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($project = mysql_fetch_assoc($result))
|
||||
{
|
||||
extract($project);
|
||||
$sql = "INSERT INTO zt_product(id, name, company) values('$ProjectID', '$ProjectName', '$companyID')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
|
||||
function convertModule()
|
||||
{
|
||||
global $myLink, $companyID;
|
||||
$sql = "SELECT * FROM BugModule";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($module = mysql_fetch_assoc($result))
|
||||
{
|
||||
extract($module);
|
||||
$sql = "INSERT INTO zt_module(id, product, name, parent, grade, view) values($ModuleID, $ProjectID, '$ModuleName', $ParentID, $ModuleGrade, 'bug')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
|
||||
function convertBug()
|
||||
{
|
||||
global $myLink, $companyID;
|
||||
$sql = "SELECT * FROM BugInfo";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($bug = mysql_fetch_assoc($result))
|
||||
{
|
||||
foreach($bug as $key => $value)
|
||||
{
|
||||
if(strpos($key, 'Date')) $bug[$key] = strtotime($value);
|
||||
}
|
||||
extract($bug);
|
||||
$sql = "INSERT INTO zt_bug(id, product, module, title, severity, type, os,status, mailto,
|
||||
openedby, openedDate,openedBuild, assignedTo,assignedDate,
|
||||
resolvedBy, resolution, resolvedBuild, resolvedDate,
|
||||
closedBy, closedDate, lastEditedBy, lastEditedDate
|
||||
) values($BugID, '$ProjectID', '$ModuleID', '$BugTitle', '$BugSeverity', '$BugType', '$BugOS', '$BugStatus', '$MailTo',
|
||||
'$OpenedBy', '$OpenedDate', '$OpenedBuild', '$AssignedTo', '$AssignedDate',
|
||||
'$ResolvedBy', '$Resolution', '$ResolvedBuild', '$ResolvedDate',
|
||||
'$ClosedBy', '$ClosedDate', '$LastEditedBy', '$LastEditedDate')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
|
||||
function convertAction()
|
||||
{
|
||||
global $myLink, $companyID;
|
||||
$sql = "SELECT * FROM BugHistory ORDER BY BugID, HistoryID";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($history = mysql_fetch_assoc($result))
|
||||
{
|
||||
$historys[$history['BugID']][] = $history;
|
||||
}
|
||||
foreach($historys as $bugID => $bugHistorys)
|
||||
{
|
||||
foreach($bugHistorys as $key => $history)
|
||||
{
|
||||
$history['FullInfo'] = addslashes($history['FullInfo']);
|
||||
$history['ActionDate'] = strtotime($history['ActionDate']);
|
||||
if($key == 0)
|
||||
{
|
||||
$sql = "UPDATE zt_bug SET steps = \"$history[FullInfo]\" WHERE id='$bugID'";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
$history['FullInfo'] = '';
|
||||
}
|
||||
|
||||
extract($history);
|
||||
$sql = "INSERT INTO zt_action values($HistoryID, $companyID, 'bug', $BugID, '$UserName', '$Action', $ActionDate, '$FullInfo')";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fixModulePath()
|
||||
{
|
||||
global $myLink, $companyID;
|
||||
|
||||
$sql = "SELECT * FROM zt_module ORDER BY grade";
|
||||
$result = mysql_query($sql, $myLink);
|
||||
while($module = mysql_fetch_assoc($result))
|
||||
{
|
||||
if($module['grade'] == 1)
|
||||
{
|
||||
$sql = "UPDATE zt_module set path = ',$module[id],' WHERE id=$module[id]";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT path FROM zt_module WHERE id = $module[parent]";
|
||||
$result2 = mysql_query($sql);
|
||||
$parent = mysql_fetch_assoc($result2);
|
||||
$sql = "UPDATE zt_module set path = '$parent[path]$module[id],' WHERE id=$module[id]";
|
||||
mysql_query($sql) or die(mysql_error());
|
||||
}
|
||||
}
|
||||
}
|
||||
function clear()
|
||||
{
|
||||
global $myLink;
|
||||
$sqls[] = "TRUNCATE TABLE zt_user";
|
||||
$sqls[] = "TRUNCATE TABLE zt_product";
|
||||
$sqls[] = "TRUNCATE TABLE zt_module";
|
||||
$sqls[] = "TRUNCATE TABLE zt_bug";
|
||||
$sqls[] = "TRUNCATE TABLE zt_action";
|
||||
foreach($sqls as $sql) mysql_query($sql, $myLink);
|
||||
}
|
||||
?>
|
||||
31
tags/zentaopms_0.3_beta_20100103/bin/exportactions.php
Normal file
31
tags/zentaopms_0.3_beta_20100103/bin/exportactions.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
class control {}
|
||||
$moduleRoot = rtrim($argv[1], '/') . '/';
|
||||
|
||||
foreach(glob($moduleRoot . '*') as $modulePath)
|
||||
{
|
||||
$moduleName = basename($modulePath);
|
||||
$controlFile = $modulePath . '/control.php';
|
||||
if(file_exists($controlFile))
|
||||
{
|
||||
include $controlFile;
|
||||
$lines = explode("\n", file_get_contents($controlFile));
|
||||
if(class_exists($moduleName))
|
||||
{
|
||||
$class = new ReflectionClass($moduleName);
|
||||
$methods = $class->getMethods();
|
||||
foreach($methods as $method)
|
||||
{
|
||||
$methodRef = new ReflectionMethod($method->class, $method->name);
|
||||
if($methodRef->isPublic() and strpos($method->name, '__') === false)
|
||||
{
|
||||
echo "\$lang['action']['$moduleName']['$method->name'] = '$method->name';\n";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
14
tags/zentaopms_0.3_beta_20100103/bin/updaterevision.php
Normal file
14
tags/zentaopms_0.3_beta_20100103/bin/updaterevision.php
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* <20>˹<EFBFBD><CBB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>µ<EFBFBD>svn<76><6E>Ϣ<EFBFBD><CFA2>*/
|
||||
$svnInfo = `cd ../; svn info --xml |egrep 'revision|date'`;
|
||||
$svnInfo = explode("\n", trim($svnInfo));
|
||||
$revision = $svnInfo[0];
|
||||
$date = $svnInfo[2];
|
||||
preg_match('|"(.*)"|', $revision, $result);
|
||||
$revision = $result[1];
|
||||
preg_match('|>(.*)<|', $date, $result);
|
||||
$date = $result[1];
|
||||
$date = date('Y-m-d H:i:s', strtotime($date));
|
||||
file_put_contents('../cache/revision.txt', "$revision\n$date");
|
||||
?>
|
||||
105
tags/zentaopms_0.3_beta_20100103/config/config.php
Normal file
105
tags/zentaopms_0.3_beta_20100103/config/config.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* The config file of ZenTaoMS
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package ZenTaoMS
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$config->version = '0.3 beta'; // <20>汾<EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ<DEB8>
|
||||
$config->installed = false; // <20>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD>װ<EFBFBD><D7B0><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ҫ<EFBFBD>Ĵ˲<C4B4><CBB2><EFBFBD>Ϊtrue<75><65>
|
||||
$config->debug = true; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>debug<75><67><EFBFBD>ܡ<EFBFBD>
|
||||
$config->webRoot = '/'; // web<65><62>վ<EFBFBD>ĸ<EFBFBD>Ŀ¼<C4BF><C2BC>
|
||||
$config->encoding = 'UTF-8'; // <20><>վ<EFBFBD>ı<EFBFBD><C4B1>롣
|
||||
$config->cookiePath = '/'; // cookie<69><65><EFBFBD><EFBFBD>Ч·<D0A7><C2B7><EFBFBD><EFBFBD>
|
||||
$config->cookieLife = time() + 2592000; // cookie<69><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڡ<EFBFBD>
|
||||
|
||||
$config->requestType = 'PATH_INFO'; // <20><><EFBFBD>λ<EFBFBD>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>ѡֵ<D1A1><D6B5>PATH_INFO|GET
|
||||
$config->pathType = 'clean'; // requestType=PATH_INFO: <20><><EFBFBD><EFBFBD>url<72>ĸ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ѡֵΪfull|clean<61><6E>full<6C><6C>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>clean<61><6E>ֻ<EFBFBD><D6BB>ȡֵ<C8A1><D6B5>
|
||||
$config->strictParams= false; // <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>뷽<EFBFBD><EBB7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫһ<C8AB>¡<EFBFBD><C2A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊfalse<73><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>֤˳<D6A4><CBB3>һ<EFBFBD>¡<EFBFBD>
|
||||
$config->requestFix = '-'; // requestType=PATH_INFO: <20><><EFBFBD><EFBFBD>url<72>ķָ<C4B7><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡֵΪб<CEAA>ߡ<EFBFBD><DFA1>»<EFBFBD><C2BB>ߡ<EFBFBD><DFA1><EFBFBD><EFBFBD>š<EFBFBD><C5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SEO<45><4F>
|
||||
$config->moduleVar = 'm'; // requestType=GET: ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
$config->methodVar = 'f'; // requestType=GET: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
$config->viewVar = 't'; // requestType=GET: ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
$config->views = ',html,xml,json,txt,csv,doc,pdf,'; // ֧<>ֵ<EFBFBD><D6B5><EFBFBD>ͼ<EFBFBD>б<EFBFBD><D0B1><EFBFBD>
|
||||
$config->langs = 'zh-cn,zh-tw,zh-hk,en'; // ֧<>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>
|
||||
$config->themes = 'default'; // ֧<>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>
|
||||
|
||||
$config->super2OBJ = true; // <20>Ƿ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
$config->default->view = 'html'; // Ĭ<>ϵ<EFBFBD><CFB5><EFBFBD>ͼ<EFBFBD><CDBC>ʽ<EFBFBD><CABD>
|
||||
$config->default->lang = 'zh-cn'; // Ĭ<>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>ԡ<EFBFBD>
|
||||
$config->default->theme = 'default'; // Ĭ<>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>⡣
|
||||
$config->default->module = 'index'; // Ĭ<>ϵ<EFBFBD>ģ<EFBFBD>顣<EFBFBD><E9A1A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ָ<EFBFBD><D6B8>ģ<EFBFBD><C4A3>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ģ<EFBFBD>顣
|
||||
$config->default->method = 'index'; // Ĭ<>ϵķ<CFB5><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ø÷<C3B8><C3B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
$config->default->domain = 'pms.easysoft.com'; // Ĭ<>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ж<EFBFBD>Ӧ<EFBFBD>ļ<EFBFBD>¼ʱ<C2BC><CAB1>ʹ<EFBFBD>ô<EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>Ĺ<EFBFBD>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2>
|
||||
|
||||
$config->file->dangers = 'php,jsp,py,rb,asp,'; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>
|
||||
$config->file->maxSize = 1024 * 1024; // <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>λΪ<CEBB>ֽڡ<D6BD>
|
||||
|
||||
$config->db->errorMode = PDO::ERRMODE_EXCEPTION; // PDO<44>Ĵ<EFBFBD><C4B4><EFBFBD>ģʽ: PDO::ERRMODE_SILENT|PDO::ERRMODE_WARNING|PDO::ERRMODE_EXCEPTION
|
||||
$config->db->persistant = false; // <20>Ƿ<EFBFBD><C7B7>־<F2BFAAB3><D6BE><EFBFBD><EFBFBD>ӡ<EFBFBD>
|
||||
$config->db->driver = 'mysql'; // pdo<64><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>Ŀǰ<C4BF><C7B0>ʱֻ֧<D6BB><D6A7>mysql<71><6C>
|
||||
$config->db->host = '127.0.0.1'; // mysql<71><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
$config->db->port = '3306'; // mysql<71><6C><EFBFBD><EFBFBD><EFBFBD>˿ںš<DABA>
|
||||
$config->db->name = 'zentao'; // <20><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>ơ<EFBFBD>
|
||||
$config->db->user = 'root'; // <20><><EFBFBD>ݿ<EFBFBD><DDBF>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
$config->db->password = ''; // <20><><EFBFBD>롣
|
||||
$config->db->encoding = 'UTF8'; // <20><><EFBFBD>ݿ<EFBFBD><DDBF>ı<EFBFBD><C4B1>롣
|
||||
$config->db->prefix = 'zt_'; // <20><><EFBFBD>ݱ<EFBFBD>ǰ<C7B0><D7BA>
|
||||
$config->db->dao = true; // <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>DAO<41><4F>
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>*/
|
||||
$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php';
|
||||
if(file_exists($myConfig)) include $myConfig;
|
||||
|
||||
/* <20><><EFBFBD>ݱ<EFBFBD><DDB1>Ķ<EFBFBD><C4B6>塣*/
|
||||
define('TABLE_ACTION', $config->db->prefix . 'action');
|
||||
define('TABLE_BUG', $config->db->prefix . 'bug');
|
||||
define('TABLE_BUILD', $config->db->prefix . 'build');
|
||||
define('TABLE_CASE', $config->db->prefix . 'case');
|
||||
define('TABLE_CASERESULT', $config->db->prefix . 'caseResult');
|
||||
define('TABLE_CASESTEP', $config->db->prefix . 'caseStep');
|
||||
define('TABLE_COMPANY', $config->db->prefix . 'company');
|
||||
define('TABLE_CONFIG', $config->db->prefix . 'config');
|
||||
define('TABLE_DEPT', $config->db->prefix . 'dept');
|
||||
define('TABLE_EFFORT', $config->db->prefix . 'effort');
|
||||
define('TABLE_FILE', $config->db->prefix . 'file');
|
||||
define('TABLE_HISTORY', $config->db->prefix . 'history');
|
||||
define('TABLE_MODULE', $config->db->prefix . 'module');
|
||||
define('TABLE_USER', $config->db->prefix . 'user');
|
||||
define('TABLE_GROUP', $config->db->prefix . 'group');
|
||||
define('TABLE_USERGROUP', $config->db->prefix . 'userGroup');
|
||||
define('TABLE_GROUPPRIV', $config->db->prefix . 'groupPriv');
|
||||
define('TABLE_PLANCASE', $config->db->prefix . 'planCase');
|
||||
define('TABLE_PRODUCT', $config->db->prefix . 'product');
|
||||
define('TABLE_PRODUCTPLAN', $config->db->prefix . 'productPlan');
|
||||
define('TABLE_RELEASE', $config->db->prefix . 'release');
|
||||
define('TABLE_RELEATION', $config->db->prefix . 'releation');
|
||||
define('TABLE_RESULTSTEP', $config->db->prefix . 'resultStep');
|
||||
define('TABLE_PROJECT', $config->db->prefix . 'project');
|
||||
define('TABLE_TEAM', $config->db->prefix . 'team');
|
||||
define('TABLE_STORY', $config->db->prefix . 'story');
|
||||
define('TABLE_PROJECTSTORY', $config->db->prefix . 'projectStory');
|
||||
define('TABLE_TASK', $config->db->prefix . 'task');
|
||||
define('TABLE_TASKESTIMATE', $config->db->prefix . 'taskEstimate');
|
||||
define('TABLE_TESTPLAN', $config->db->prefix . 'testPlan');
|
||||
define('TABLE_PROJECTPRODUCT', $config->db->prefix . 'projectProduct');
|
||||
define('TABLE_TODO', $config->db->prefix . 'todo');
|
||||
define('TABLE_BURN', $config->db->prefix . 'burn');
|
||||
152
tags/zentaopms_0.3_beta_20100103/db/update.sql
Normal file
152
tags/zentaopms_0.3_beta_20100103/db/update.sql
Normal file
@@ -0,0 +1,152 @@
|
||||
-- story优先级的默认值。
|
||||
ALTER TABLE `zt_story` CHANGE `pri` `pri` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '3'
|
||||
|
||||
-- 修改project code字段的长度。
|
||||
ALTER TABLE `zt_project` CHANGE `code` `code` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
|
||||
|
||||
-- task 暂时增加left字段:
|
||||
ALTER TABLE `zt_task` ADD `left` tinyINT(3) NOT NULL AFTER `consumed`
|
||||
|
||||
-- 修改日期字段
|
||||
ALTER TABLE `zt_bug` CHANGE `openedDate` `openedDate` DATETIME NOT NULL ,
|
||||
CHANGE `assignedDate` `assignedDate` DATETIME NOT NULL ,
|
||||
CHANGE `resolvedDate` `resolvedDate` DATETIME NOT NULL ,
|
||||
CHANGE `closedDate` `closedDate` DATETIME NOT NULL ,
|
||||
CHANGE `lastEditedDate` `lastEditedDate` DATETIME NOT NULL
|
||||
|
||||
RENAME TABLE `zentao`.`zt_division` TO `zentao`.`zt_dept` ;
|
||||
ALTER TABLE `zt_user` CHANGE `division` `dept` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0'
|
||||
|
||||
|
||||
-- 0.2版本:
|
||||
--
|
||||
-- 修改task表name字段的长度。
|
||||
-- 修改task表的时间的类型,可以是浮点数。
|
||||
ALTER TABLE `zt_task` CHANGE `estimate` `estimate` FLOAT UNSIGNED NOT NULL ,
|
||||
CHANGE `consumed` `consumed` FLOAT UNSIGNED NOT NULL ,
|
||||
CHANGE `left` `left` FLOAT UNSIGNED NOT NULL
|
||||
|
||||
-- todo表
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `zt_todo` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`account` char(30) NOT NULL,
|
||||
`date` date NOT NULL default '0000-00-00',
|
||||
`begin` smallint(4) unsigned zerofill NOT NULL,
|
||||
`end` smallint(4) unsigned zerofill NOT NULL,
|
||||
`type` char(10) NOT NULL,
|
||||
`idvalue` mediumint(8) unsigned NOT NULL default '0',
|
||||
`pri` tinyint(3) unsigned NOT NULL,
|
||||
`name` char(90) NOT NULL,
|
||||
`desc` char(255) NOT NULL default '',
|
||||
`status` enum('wait','doing','done') NOT NULL default 'wait',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user` (`account`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- 更新product, project表中的company字段:
|
||||
update zt_product set company = 1;
|
||||
update zt_project set company = 1;
|
||||
|
||||
-- 更新story字段里面的estimate字段:
|
||||
ALTER TABLE `zt_story` CHANGE `estimate` `estimate` FLOAT UNSIGNED NOT NULL
|
||||
|
||||
-- 还是使用datetime字段。
|
||||
ALTER TABLE `zt_story` CHANGE `openedDate` `openedDate` DATETIME NOT NULL ,
|
||||
CHANGE `assignedDate` `assignedDate` DATETIME NOT NULL ,
|
||||
CHANGE `lastEditedDate` `lastEditedDate` DATETIME NOT NULL ,
|
||||
CHANGE `closedDate` `closedDate` DATETIME NOT NULL
|
||||
|
||||
-- 增加diff字段。
|
||||
ALTER TABLE `zt_history` ADD `diff` TEXT NOT NULL
|
||||
|
||||
-- 10.27
|
||||
ALTER TABLE `zt_todo` CHANGE `desc` `desc` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
|
||||
ALTER TABLE `zt_task` CHANGE `name` `name` VARCHAR( 90 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
|
||||
|
||||
ALTER TABLE `zt_task` CHANGE `estimate` `estimate` FLOAT UNSIGNED NOT NULL ,
|
||||
CHANGE `consumed` `consumed` FLOAT UNSIGNED NOT NULL ,
|
||||
CHANGE `left` `left` FLOAT UNSIGNED NOT NULL
|
||||
|
||||
|
||||
-- 11.2 todo表增加private字段:
|
||||
ALTER TABLE `zt_todo` ADD `private` BOOL NOT NULL
|
||||
|
||||
-- 11.4 增加消耗表。
|
||||
CREATE TABLE IF NOT EXISTS `zt_burn` (
|
||||
`project` mediumint(8) unsigned NOT NULL,
|
||||
`date` date NOT NULL,
|
||||
`left` float NOT NULL,
|
||||
`consumed` float NOT NULL,
|
||||
PRIMARY KEY (`project`,`date`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- 11.5 project status字段更改。
|
||||
ALTER TABLE `zt_project` CHANGE `status` `status` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
|
||||
|
||||
-- 11.10.
|
||||
|
||||
ALTER TABLE `zt_bug` CHANGE `openedDate` `openedDate` DATETIME NOT NULL ,
|
||||
CHANGE `assignedDate` `assignedDate` DATETIME NOT NULL ,
|
||||
CHANGE `resolvedDate` `resolvedDate` DATETIME NOT NULL ,
|
||||
CHANGE `closedDate` `closedDate` DATETIME NOT NULL ,
|
||||
CHANGE `lastEditedDate` `lastEditedDate` DATETIME NOT NULL
|
||||
|
||||
-- 11.12
|
||||
|
||||
ALTER TABLE `zt_bug` ADD `duplicateBug` MEDIUMINT UNSIGNED NOT NULL AFTER `closedDate` ,
|
||||
ADD `linkBug` VARCHAR( 255 ) NOT NULL AFTER `duplicateBug` ,
|
||||
ADD `case` MEDIUMINT UNSIGNED NOT NULL AFTER `linkBug` ,
|
||||
ADD `result` MEDIUMINT UNSIGNED NOT NULL AFTER `case`
|
||||
|
||||
-- 11.13
|
||||
ALTER TABLE `zt_case` CHANGE `openedDate` `openedDate` DATETIME NOT NULL ,
|
||||
CHANGE `lastEditedDate` `lastEditedDate` DATETIME NOT NULL
|
||||
|
||||
-- 11.16
|
||||
ALTER TABLE `zt_file` CHANGE `addedDate` `addedDate` DATETIME NOT NULL;
|
||||
ALTER TABLE `zt_file` ADD `title` CHAR( 90 ) NOT NULL AFTER `file`;
|
||||
ALTER TABLE `zt_file` ADD `objectType` CHAR( 10 ) NOT NULL AFTER `size` ,
|
||||
ADD `objectID` MEDIUMINT NOT NULL AFTER `objectType` ;
|
||||
|
||||
ALTER TABLE `zt_file` CHANGE `file` `pathname` CHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
ALTER TABLE `zt_file` CHANGE `type` `extension` CHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
|
||||
|
||||
ALTER TABLE `zt_task` CHANGE `status` `status` ENUM( 'wait', 'doing', 'done', 'cancel' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'wait'
|
||||
|
||||
ALTER TABLE `zt_todo` CHANGE `name` `name` CHAR( 150 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
|
||||
|
||||
|
||||
-- 12.10 新增productPlan表。
|
||||
CREATE TABLE `zentao`.`zt_productPlan` (
|
||||
`id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||||
`product` MEDIUMINT UNSIGNED NOT NULL ,
|
||||
`title` VARCHAR( 90 ) NOT NULL ,
|
||||
`desc` VARCHAR( 255 ) NOT NULL ,
|
||||
`begin` DATE NOT NULL ,
|
||||
`end` DATE NOT NULL
|
||||
) ENGINE = MYISAM ;
|
||||
|
||||
-- 将zt_story中的release改为plan。
|
||||
ALTER TABLE `zt_story` CHANGE `replease` `plan` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0'
|
||||
|
||||
-- 12.11 修改case表。
|
||||
|
||||
ALTER TABLE `zt_case` CHANGE `type` `type` CHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1',
|
||||
CHANGE `status` `status` CHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1',
|
||||
CHANGE `openedDate` `openedDate` DATETIME NOT NULL ,
|
||||
CHANGE `lastEditedDate` `lastEditedDate` DATETIME NOT NULL
|
||||
|
||||
ALTER TABLE `zt_case` CHANGE `title` `title` CHAR( 90 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
|
||||
|
||||
-- 12.28 zt_task字段增加自定义排序字段。
|
||||
ALTER TABLE `zt_task` ADD `statusCustom` TINYINT UNSIGNED NOT NULL AFTER `status` ,
|
||||
ADD INDEX ( statusCustom );
|
||||
update zt_task set statusCustom = locate(status, 'wait,doing,done,cancel')
|
||||
|
||||
-- 增加类型字段。--
|
||||
ALTER TABLE `zt_task` ADD `type` VARCHAR( 20 ) NOT NULL AFTER `name` ,
|
||||
ADD INDEX ( TYPE )
|
||||
|
||||
-- todo 增加状态--
|
||||
ALTER TABLE `zt_todo` CHANGE `status` `status` CHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'wait'
|
||||
460
tags/zentaopms_0.3_beta_20100103/db/zentao.sql
Normal file
460
tags/zentaopms_0.3_beta_20100103/db/zentao.sql
Normal file
@@ -0,0 +1,460 @@
|
||||
-- DROP TABLE IF EXISTS `zt_action`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_action` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`objectType` varchar(30) NOT NULL default '',
|
||||
`objectID` mediumint(8) unsigned NOT NULL default '0',
|
||||
`actor` varchar(30) NOT NULL default '',
|
||||
`action` varchar(30) NOT NULL default '',
|
||||
`date` int(10) unsigned NOT NULL default '0',
|
||||
`comment` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_bug`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_bug` (
|
||||
`id` mediumint(8) NOT NULL auto_increment,
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`module` mediumint(8) unsigned NOT NULL default '0',
|
||||
`project` mediumint(8) unsigned NOT NULL default '0',
|
||||
`story` mediumint(8) unsigned NOT NULL default '0',
|
||||
`task` mediumint(8) unsigned NOT NULL default '0',
|
||||
`title` varchar(150) NOT NULL default '',
|
||||
`severity` tinyint(4) NOT NULL default '0',
|
||||
`type` varchar(30) NOT NULL default '',
|
||||
`os` varchar(30) NOT NULL default '',
|
||||
`browser` varchar(30) NOT NULL default '',
|
||||
`hardware` varchar(30) NOT NULL default '',
|
||||
`found` varchar(30) NOT NULL default '',
|
||||
`steps` text NOT NULL,
|
||||
`status` enum('active','resolved','closed') NOT NULL default 'active',
|
||||
`mailto` varchar(255) NOT NULL default '',
|
||||
`openedBy` varchar(30) NOT NULL default '',
|
||||
`openedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`openedBuild` varchar(30) NOT NULL default '',
|
||||
`assignedTo` varchar(30) NOT NULL default '',
|
||||
`assignedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`resolvedBy` varchar(30) NOT NULL default '',
|
||||
`resolution` varchar(30) NOT NULL default '',
|
||||
`resolvedBuild` varchar(30) NOT NULL default '',
|
||||
`resolvedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`closedBy` varchar(30) NOT NULL default '',
|
||||
`closedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`duplicateBug` mediumint(8) unsigned NOT NULL default '0',
|
||||
`linkBug` varchar(255) NOT NULL default '',
|
||||
`case` mediumint(8) unsigned NOT NULL default '0',
|
||||
`result` mediumint(8) unsigned NOT NULL default '0',
|
||||
`lastEditedBy` varchar(30) NOT NULL default '',
|
||||
`lastEditedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`field1` varchar(255) NOT NULL default '',
|
||||
`field2` varchar(255) NOT NULL default '',
|
||||
`feild3` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_build`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_build` (
|
||||
`id` mediumint(8) unsigned NOT NULL default '0',
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`sprintprj` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` char(30) NOT NULL default '',
|
||||
`scmPath` char(255) NOT NULL default '',
|
||||
`buildDate` int(10) unsigned NOT NULL default '0',
|
||||
`builder` char(30) NOT NULL default '',
|
||||
`tasks` char(255) NOT NULL default '',
|
||||
`desc` char(255) NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_burn`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_burn` (
|
||||
`project` mediumint(8) unsigned NOT NULL default '0',
|
||||
`date` date NOT NULL default '0000-00-00',
|
||||
`left` float NOT NULL default '0',
|
||||
`consumed` float NOT NULL default '0',
|
||||
PRIMARY KEY (`project`,`date`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_case`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_case` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`module` mediumint(8) unsigned NOT NULL default '0',
|
||||
`path` mediumint(8) unsigned NOT NULL default '0',
|
||||
`story` mediumint(30) unsigned NOT NULL default '0',
|
||||
`title` varchar(30) NOT NULL default '',
|
||||
`pri` tinyint(3) unsigned NOT NULL default '0',
|
||||
`type` varchar(30) NOT NULL default '1',
|
||||
`status` varchar(30) NOT NULL default '1',
|
||||
`steps` text NOT NULL,
|
||||
`frequency` enum('1','2','3') NOT NULL default '1',
|
||||
`order` tinyint(30) unsigned NOT NULL default '0',
|
||||
`openedBy` varchar(30) NOT NULL default '',
|
||||
`openedDate` datetime NOT NULL,
|
||||
`lastEditedBy` varchar(30) NOT NULL default '',
|
||||
`lastEditedDate` datetime NOT NULL,
|
||||
`field1` varchar(30) NOT NULL default '',
|
||||
`field2` varchar(30) NOT NULL default '',
|
||||
`feidl3` varchar(30) NOT NULL default '',
|
||||
`version` tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_caseResult`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_caseResult` (
|
||||
`id` mediumint(8) unsigned NOT NULL default '0',
|
||||
`plan` mediumint(30) unsigned NOT NULL default '0',
|
||||
`build` mediumint(30) unsigned NOT NULL default '0',
|
||||
`case` mediumint(30) unsigned NOT NULL default '0',
|
||||
`result` enum('pass','fail','skip') NOT NULL default 'pass',
|
||||
`status` enum('finished','blocked') NOT NULL default 'finished',
|
||||
`executedBy` char(30) NOT NULL default '',
|
||||
`executedDate` int(30) unsigned NOT NULL default '0',
|
||||
`os` char(30) NOT NULL default '',
|
||||
`browser` char(30) NOT NULL default '',
|
||||
`hardware` char(30) NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_caseStep`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_caseStep` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`case` mediumint(8) unsigned NOT NULL default '0',
|
||||
`caseVersion` tinyint(3) unsigned NOT NULL default '0',
|
||||
`step` char(255) NOT NULL default '',
|
||||
`expect` char(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_company`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_company` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`name` char(120) NOT NULL default '',
|
||||
`phone` char(20) NOT NULL default '',
|
||||
`fax` char(20) NOT NULL default '',
|
||||
`address` char(120) NOT NULL default '',
|
||||
`zipcode` char(10) NOT NULL default '',
|
||||
`website` char(120) NOT NULL default '',
|
||||
`backyard` char(120) NOT NULL default '',
|
||||
`pms` char(120) NOT NULL default '',
|
||||
`guest` enum('1','0') NOT NULL default '0',
|
||||
`admins` char(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `pms` (`pms`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_config`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_config` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`owner` char(30) NOT NULL default '',
|
||||
`section` char(30) NOT NULL default '',
|
||||
`key` char(30) NOT NULL default '',
|
||||
`value` char(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_dept`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_dept` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` char(30) NOT NULL default '',
|
||||
`parent` mediumint(8) unsigned NOT NULL default '0',
|
||||
`path` char(255) NOT NULL default '',
|
||||
`grade` tinyint(3) unsigned NOT NULL default '0',
|
||||
`order` tinyint(3) unsigned NOT NULL default '0',
|
||||
`position` char(30) NOT NULL default '',
|
||||
`function` char(255) NOT NULL default '',
|
||||
`manager` char(30) NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `company` (`company`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_effort`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_effort` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`user` char(30) NOT NULL default '',
|
||||
`todo` enum('1','0') NOT NULL default '1',
|
||||
`date` date NOT NULL default '0000-00-00',
|
||||
`begin` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`end` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`type` enum('1','2','3') NOT NULL default '1',
|
||||
`idvalue` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` char(30) NOT NULL default '',
|
||||
`desc` char(255) NOT NULL default '',
|
||||
`status` enum('1','2','3') NOT NULL default '1',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user` (`user`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_file`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_file` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`pathname` char(50) NOT NULL,
|
||||
`title` char(90) NOT NULL,
|
||||
`extension` char(30) NOT NULL,
|
||||
`size` mediumint(8) unsigned NOT NULL default '0',
|
||||
`objectType` char(10) NOT NULL,
|
||||
`objectID` mediumint(9) NOT NULL,
|
||||
`addedBy` char(30) NOT NULL default '',
|
||||
`addedDate` datetime NOT NULL,
|
||||
`downloads` mediumint(8) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_group`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_group` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` char(30) NOT NULL default '',
|
||||
`desc` char(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_groupPriv`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_groupPriv` (
|
||||
`group` mediumint(8) unsigned NOT NULL default '0',
|
||||
`module` char(30) NOT NULL default '',
|
||||
`method` char(30) NOT NULL default '',
|
||||
UNIQUE KEY `group` (`group`,`module`,`method`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_history`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_history` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`action` mediumint(8) unsigned NOT NULL default '0',
|
||||
`field` varchar(30) NOT NULL default '',
|
||||
`old` text NOT NULL,
|
||||
`new` text NOT NULL,
|
||||
`diff` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_module`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_module` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` char(30) NOT NULL default '',
|
||||
`parent` mediumint(8) unsigned NOT NULL default '0',
|
||||
`path` char(255) NOT NULL default '',
|
||||
`grade` tinyint(3) unsigned NOT NULL default '0',
|
||||
`order` tinyint(3) unsigned NOT NULL default '0',
|
||||
`view` char(30) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_planCase`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_planCase` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`plan` mediumint(8) unsigned NOT NULL default '0',
|
||||
`case` mediumint(8) unsigned NOT NULL default '0',
|
||||
`caseVersion` tinyint(3) unsigned NOT NULL default '0',
|
||||
`assignedTo` char(30) NOT NULL default '',
|
||||
`assignedDate` int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_product`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_product` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` varchar(30) NOT NULL default '',
|
||||
`code` varchar(10) NOT NULL default '',
|
||||
`order` tinyint(3) unsigned NOT NULL default '0',
|
||||
`status` varchar(30) NOT NULL default '',
|
||||
`desc` text NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `company` (`company`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_productPlan`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_productPlan` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`product` mediumint(8) unsigned NOT NULL,
|
||||
`title` varchar(90) NOT NULL,
|
||||
`desc` varchar(255) NOT NULL,
|
||||
`begin` date NOT NULL,
|
||||
`end` date NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
-- DROP TABLE IF EXISTS `zt_project`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_project` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`isCat` enum('1','0') NOT NULL default '0',
|
||||
`catID` mediumint(8) unsigned NOT NULL default '0',
|
||||
`type` enum('sprint','project') NOT NULL default 'sprint',
|
||||
`parent` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` varchar(30) NOT NULL default '',
|
||||
`code` varchar(20) NOT NULL default '',
|
||||
`begin` date NOT NULL default '0000-00-00',
|
||||
`end` date NOT NULL default '0000-00-00',
|
||||
`status` varchar(10) NOT NULL default '',
|
||||
`statge` enum('1','2','3','4','5') NOT NULL default '1',
|
||||
`pri` enum('1','2','3','4') NOT NULL default '1',
|
||||
`desc` text NOT NULL,
|
||||
`goal` text NOT NULL,
|
||||
`openedBy` varchar(30) NOT NULL default '',
|
||||
`openedDate` int(10) unsigned NOT NULL default '0',
|
||||
`closedBy` varchar(30) NOT NULL default '',
|
||||
`closedDate` int(10) unsigned NOT NULL default '0',
|
||||
`canceledBy` varchar(30) NOT NULL default '',
|
||||
`canceledDate` int(10) unsigned NOT NULL default '0',
|
||||
`PO` varchar(30) NOT NULL default '',
|
||||
`PM` varchar(30) NOT NULL default '',
|
||||
`QM` varchar(30) NOT NULL default '',
|
||||
`team` varchar(30) NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `company` (`company`,`type`,`parent`,`begin`,`end`,`status`,`statge`,`pri`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_projectProduct`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_projectProduct` (
|
||||
`project` mediumint(8) unsigned NOT NULL default '0',
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`project`,`product`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_projectStory`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_projectStory` (
|
||||
`project` mediumint(8) unsigned NOT NULL default '0',
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`story` mediumint(8) unsigned NOT NULL default '0',
|
||||
UNIQUE KEY `project` (`project`,`story`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_release`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_release` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` varchar(30) NOT NULL default '',
|
||||
`desc` text NOT NULL,
|
||||
`status` varchar(30) NOT NULL default '',
|
||||
`planDate` date NOT NULL default '0000-00-00',
|
||||
`releaseDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `product` (`product`,`status`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_releation`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_releation` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`type` char(30) NOT NULL default '',
|
||||
`id1` mediumint(8) unsigned NOT NULL default '0',
|
||||
`id2` mediumint(8) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_resultStep`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_resultStep` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`result` mediumint(8) unsigned NOT NULL default '0',
|
||||
`step` mediumint(8) unsigned NOT NULL default '0',
|
||||
`stepResult` enum('pass','fail','block','n/a') NOT NULL default 'pass',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_story`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_story` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`product` mediumint(8) unsigned NOT NULL default '0',
|
||||
`module` mediumint(8) unsigned NOT NULL default '0',
|
||||
`plan` mediumint(8) unsigned NOT NULL default '0',
|
||||
`bug` mediumint(8) unsigned NOT NULL default '0',
|
||||
`title` varchar(90) NOT NULL default '',
|
||||
`spec` text NOT NULL,
|
||||
`type` varchar(30) NOT NULL default '',
|
||||
`pri` tinyint(3) unsigned NOT NULL default '3',
|
||||
`estimate` tinyint(3) unsigned NOT NULL default '0',
|
||||
`status` varchar(30) NOT NULL default '',
|
||||
`mailto` varchar(255) NOT NULL default '',
|
||||
`openedBy` varchar(30) NOT NULL default '',
|
||||
`openedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`assignedTo` varchar(30) NOT NULL default '',
|
||||
`assignedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`lastEditedBy` varchar(30) NOT NULL default '',
|
||||
`lastEditedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`closedBy` varchar(30) NOT NULL default '',
|
||||
`closedDate` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`version` float(4,1) NOT NULL default '0.0',
|
||||
`attatchment` varchar(30) NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `product` (`product`,`module`,`plan`,`type`,`pri`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_task`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_task` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`project` mediumint(8) unsigned NOT NULL default '0',
|
||||
`story` mediumint(8) unsigned NOT NULL default '0',
|
||||
`name` varchar(90) NOT NULL default '',
|
||||
`type` VARCHAR( 20 ) NOT NULL,
|
||||
`pri` tinyint(3) unsigned NOT NULL default '0',
|
||||
`owner` varchar(30) NOT NULL default '',
|
||||
`estimate` float unsigned NOT NULL default '0',
|
||||
`consumed` float unsigned NOT NULL default '0',
|
||||
`left` float unsigned NOT NULL default '0',
|
||||
`status` enum('wait','doing','done','cancel') NOT NULL default 'wait',
|
||||
`statusCustom` tinyint(3) unsigned NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `statusCustom` (`statusCustom`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_taskEstimate`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_taskEstimate` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`task` mediumint(8) unsigned NOT NULL default '0',
|
||||
`date` int(10) unsigned NOT NULL default '0',
|
||||
`estimate` tinyint(3) unsigned NOT NULL default '0',
|
||||
`estimater` char(30) NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `task` (`task`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_team`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_team` (
|
||||
`project` mediumint(8) unsigned NOT NULL default '0',
|
||||
`account` char(30) NOT NULL default '',
|
||||
`role` char(30) NOT NULL default '',
|
||||
`joinDate` date NOT NULL default '0000-00-00',
|
||||
`workingHour` tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`project`,`account`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_testPlan`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_testPlan` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`name` char(30) NOT NULL default '',
|
||||
`sprintprj` mediumint(8) unsigned NOT NULL default '0',
|
||||
`planBegin` int(10) unsigned NOT NULL default '0',
|
||||
`planEnd` int(10) unsigned NOT NULL default '0',
|
||||
`realBegin` int(10) unsigned NOT NULL default '0',
|
||||
`realEnd` int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_todo`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_todo` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`account` char(30) NOT NULL default '',
|
||||
`date` date NOT NULL default '0000-00-00',
|
||||
`begin` smallint(4) unsigned zerofill NOT NULL default '0000',
|
||||
`end` smallint(4) unsigned zerofill NOT NULL default '0000',
|
||||
`type` char(10) NOT NULL default '',
|
||||
`idvalue` mediumint(8) unsigned NOT NULL default '0',
|
||||
`pri` tinyint(3) unsigned NOT NULL default '0',
|
||||
`name` char(150) NOT NULL,
|
||||
`desc` char(255) NOT NULL default '',
|
||||
`status` enum('wait','doing','done') NOT NULL default 'wait',
|
||||
`private` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user` (`account`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_user`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_user` (
|
||||
`id` mediumint(8) unsigned NOT NULL auto_increment,
|
||||
`company` mediumint(8) unsigned NOT NULL default '0',
|
||||
`dept` mediumint(8) unsigned NOT NULL default '0',
|
||||
`account` char(30) NOT NULL default '',
|
||||
`password` char(32) NOT NULL default '',
|
||||
`realname` char(30) NOT NULL default '',
|
||||
`nickname` char(60) NOT NULL default '',
|
||||
`avatar` char(30) NOT NULL default '',
|
||||
`birthyear` smallint(5) unsigned NOT NULL default '0',
|
||||
`birthday` date NOT NULL default '0000-00-00',
|
||||
`gendar` enum('f','m') NOT NULL default 'f',
|
||||
`email` char(90) NOT NULL default '',
|
||||
`msn` char(90) NOT NULL default '',
|
||||
`qq` char(20) NOT NULL default '',
|
||||
`yahoo` char(90) NOT NULL default '',
|
||||
`gtalk` char(90) NOT NULL default '',
|
||||
`wangwang` char(90) NOT NULL default '',
|
||||
`mobile` char(11) NOT NULL default '',
|
||||
`phone` char(20) NOT NULL default '',
|
||||
`address` char(120) NOT NULL default '',
|
||||
`zipcode` char(10) NOT NULL default '',
|
||||
`join` date NOT NULL default '0000-00-00',
|
||||
`visits` mediumint(8) unsigned NOT NULL default '0',
|
||||
`ip` char(15) NOT NULL default '',
|
||||
`last` int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `account` (`account`),
|
||||
KEY `company` (`company`,`dept`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_userGroup`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_userGroup` (
|
||||
`account` char(30) NOT NULL default '',
|
||||
`group` mediumint(8) unsigned NOT NULL default '0',
|
||||
UNIQUE KEY `account` (`account`,`group`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
674
tags/zentaopms_0.3_beta_20100103/doc/COPYING
Normal file
674
tags/zentaopms_0.3_beta_20100103/doc/COPYING
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
165
tags/zentaopms_0.3_beta_20100103/doc/COPYING.LESSER
Normal file
165
tags/zentaopms_0.3_beta_20100103/doc/COPYING.LESSER
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
46
tags/zentaopms_0.3_beta_20100103/doc/README
Normal file
46
tags/zentaopms_0.3_beta_20100103/doc/README
Normal file
@@ -0,0 +1,46 @@
|
||||
一、什么是禅道项目管理软件
|
||||
|
||||
禅道项目管理软件(ZenTaoPMS)是一款国产的,基于LGPL协议,开源免费的项目管理软件,它集产品管理、项目管理、测试管理于一体,同时还包含了事务管理、组织管理等诸多功能,是中小型企业项目管理的首选。官方网站:www.zentao.cn
|
||||
|
||||
禅道项目管理软件使用PHP + MySQL开发,基于自主的PHP开发框架──ZenTaoPHP而成。第三方开发者或者企业可以非常方便的开发插件或者进行定制。
|
||||
|
||||
禅道在手,项目无忧!
|
||||
|
||||
二、禅道的含义
|
||||
|
||||
Zen是“禅”的意思,Tao是“道”的意思。ZenTao合意为禅与道。这个名称是我在读《编程之禅》和《编程之道》的时候受到启发,决定采用这个比较有中国味道的名字。
|
||||
|
||||
三、禅道项目管理软件的来由:
|
||||
|
||||
说到这个问题,要从BugFree谈起。自从04年发布BugFree以来到2007年,BugFree陆续发布了五六个版本,在Bug管理方面基本上已经完备。但这个时候产生了一些新的问题。很多网友拿着BugFree进行改动,改造为其他的管理系统。还经常有网友问,BugFree可以不可以加入项目管理的功能。我也一直在思考这些问题。后来我加入了阿里巴巴,在中国雅虎‘、阿里妈妈、淘宝三年的工作经历中,参加了大大小小的项目。也深为项目管理所困惑。于是就产生了做一个工具来解决项目管理的问题。
|
||||
|
||||
由于种种原因,我这个愿望在阿里巴巴并没有实现。说来也是一件幸事,这样我可以把它开源来发布。从今年初我就开始着手考虑这套管理软件的设计。整整花了半年的时间在考虑。7月份从阿里巴巴辞职之后,我开始有有了相对比较多的一点时间来进行这套系统的开发。同时也非常感谢现在的这家单位,为我开发禅道项目管理软件提供了大力的支持。
|
||||
|
||||
四、为什么还要做禅道项目管理软件:
|
||||
|
||||
很多朋友会问,已经有很多的开源项目管理软件或者系统了,为什么还要自己做一个呢?主要原因是我认为现在的开源项目管理软件对这个问题解决的并不好,比如缺乏需求管理,bug管理等功能。而且很多开源的项目管理软件使用起来也不方便。
|
||||
|
||||
市场上也有很多商业的软件,但收费都不菲,而且也未必见得好用。
|
||||
|
||||
现在也有很多在线的项目管理服务,比如国外的basecamp,国内的易度,忙吧等。但我的观点,这些在线的项目管理软件功能有限,缺乏定制,访问速度无法保证,而且缺乏保密。
|
||||
|
||||
五、禅道项目管理软件的特点:
|
||||
|
||||
集成了产品管理、项目管理、测试管理、人员管理、发布管理、事务管理等功能于一体。你只需要一个软件就可以完成项目管理的最核心的任务。
|
||||
开源免费,降低企业部署的成本。
|
||||
功能注重实效,使用方便,没有太多复杂的概念。我设计的理念是一个没有做过项目管理的人经过10分钟的培训可以使用它进行项目管理。:)
|
||||
基于PHP+MySQL开发,企业自主改动方便。并且基于ZenTaoPHP框架,为第三方开发者的加入打下了坚实的基础。
|
||||
主要理念基于scrum,同时结合了PMP里面的很多概念。
|
||||
支持多公司,多项目,多产品,多团队的开发。
|
||||
灵活的权限设置。
|
||||
支持产品与项目之间的矩阵关系。
|
||||
|
||||
六、禅道项目管理软件的现状及开发计划:
|
||||
|
||||
禅道项目管理软件目前正在紧密开发中,已经发布了几个alpha版本。但这几个版本的功能还仅仅是冰山一角。我们计划在今年年底的时候推出beta版本,明年第一季度的时候推出第一个stable的版本。
|
||||
|
||||
七、禅道项目管理软件需要您的帮助
|
||||
|
||||
禅道项目管理软件需要您的帮助,无论您是开发人员,抑或是项目经理,或者是产品经理,还是测试人员,又或者是开源爱好者,您都可以在禅道项目管理软件找到参与的地方。我们会以非常open的心态打造一个禅道项目管理软件的社区。我相信,禅道社区的成功,才是禅道项目管理软件的成功。
|
||||
|
||||
大家现在可以访问http://pms.zentao.cn来查看这个项目管理软件自身的进展情况。大家如果想加入,可以和我联系:wwccss#gmail.com。
|
||||
6
tags/zentaopms_0.3_beta_20100103/doc/THANKS
Normal file
6
tags/zentaopms_0.3_beta_20100103/doc/THANKS
Normal file
@@ -0,0 +1,6 @@
|
||||
鸣谢
|
||||
|
||||
禅道项目管理软件在开发过程中得到了普加网(青岛普加智能信息有限公司)的大力支持,在此表示感谢! 欢迎大家访问普加网 www.pujia.com ,获取最酷的民生信息!
|
||||
|
||||
王春生 易软开源软件研发中心
|
||||
2009-10-25
|
||||
410
tags/zentaopms_0.3_beta_20100103/lib/front/front.class.php
Normal file
410
tags/zentaopms_0.3_beta_20100103/lib/front/front.class.php
Normal file
@@ -0,0 +1,410 @@
|
||||
<?php
|
||||
/**
|
||||
* The front class file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package ZenTaoMS
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class html
|
||||
{
|
||||
/**
|
||||
* create tags like <a href="">text</a>
|
||||
*
|
||||
* @param string $href the link url.
|
||||
* @param string $title the link title.
|
||||
* @param string $target the target window
|
||||
* @param string $misc other params.
|
||||
*/
|
||||
static public function a($href = '', $title = '', $target = "_self", $misc = '')
|
||||
{
|
||||
if(empty($title)) $title = $href;
|
||||
if($target == '_self') return "<a href='$href' $misc>$title</a>\n";
|
||||
return "<a href='$href' target='$target' $misc>$title</a>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like <a href="mailto:">text</a>
|
||||
*
|
||||
* @param string $mail the email address
|
||||
* @param string $title the email title.
|
||||
*/
|
||||
static public function mailto($mail = '', $title = '')
|
||||
{
|
||||
if(empty($title)) $title = $mail;
|
||||
return "<a href='mailto:$mail'>$title</a>";
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<select><option></option></select>"
|
||||
*
|
||||
* @param string $name the name of the select tag.
|
||||
* @param array $options the array to create select tag from.
|
||||
* @param string $selectedItems the item(s) to be selected, can like item1,item2.
|
||||
* @param string $attrib other params such as multiple, size and style.
|
||||
*/
|
||||
static public function select($name = '', $options = array(), $selectedItems = "", $attrib = "")
|
||||
{
|
||||
$options = (array)($options);
|
||||
if(!is_array($options) or empty($options)) return false;
|
||||
|
||||
/* The begin. */
|
||||
$id = $name;
|
||||
if($pos = strpos($name, '[')) $id = substr($name, 0, $pos);
|
||||
$string = "<select name='$name' id='$id' $attrib>\n";
|
||||
|
||||
/* The options. */
|
||||
$selectedItems = ",$selectedItems,";
|
||||
foreach($options as $key => $value)
|
||||
{
|
||||
$key = str_replace('item', '', $key); // 因为对象的元素不能为数字,所以需要在配置里面会在数字前面添加item,这个地方将item去掉。
|
||||
$selected = strpos($selectedItems, ",$key,") !== false ? " selected='selected'" : '';
|
||||
$string .= "<option value='$key'$selected>$value</option>\n";
|
||||
}
|
||||
|
||||
/* End. */
|
||||
return $string .= "</select>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create tags like "<input type='radio' />"
|
||||
*
|
||||
* @param string $name the name of the radio tag.
|
||||
* @param array $options the array to create radio tag from.
|
||||
* @param string $checked the value to checked by default.
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function radio($name = '', $options = array(), $checked = '', $attrib = '')
|
||||
{
|
||||
$options = (array)($options);
|
||||
if(!is_array($options) or empty($options)) return false;
|
||||
|
||||
$string = '';
|
||||
foreach($options as $key => $value)
|
||||
{
|
||||
$string .= "<input type='radio' name='$name' value='$key' ";
|
||||
$string .= ($key == $checked) ? " checked ='checked'" : "";
|
||||
$string .= $attrib;
|
||||
$string .= " /> $value\n";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<input type='checkbox' />"
|
||||
*
|
||||
* @param string $name the name of the checkbox tag.
|
||||
* @param array $options the array to create checkbox tag from.
|
||||
* @param string $checked the value to checked by default, can be item1,item2
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function checkbox($name, $options, $checked = "", $attrib = "")
|
||||
{
|
||||
$options = (array)($options);
|
||||
if(!is_array($options) or empty($options)) return false;
|
||||
$string = '';
|
||||
$checked = ",$checked,";
|
||||
|
||||
foreach($options as $key => $value)
|
||||
{
|
||||
$key = str_replace('item', '', $key); // 因为对象的元素不能为数字,所以需要在配置里面会在数字前面添加item,这个地方将item去掉。
|
||||
$string .= "<input type='checkbox' name='{$name}[]' value='$key' ";
|
||||
$string .= strpos($checked, ",$key,") !== false ? " checked ='checked'" : "";
|
||||
$string .= $attrib;
|
||||
$string .= " /> $value\n";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<input type='text' />"
|
||||
*
|
||||
* @param string $name the name of the text input tag.
|
||||
* @param string $value the default value.
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function input($name, $value = "", $attrib = "")
|
||||
{
|
||||
return "<input type='text' name='$name' id='$name' value='$value' $attrib />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<input type='hidden' />"
|
||||
*
|
||||
* @param string $name the name of the text input tag.
|
||||
* @param string $value the default value.
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function hidden($name, $value = "", $attrib = "")
|
||||
{
|
||||
return "<input type='hidden' name='$name' id='$name' value='$value' $attrib />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<input type='password' />"
|
||||
*
|
||||
* @param string $name the name of the text input tag.
|
||||
* @param string $value the default value.
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function password($name, $value = "", $attrib = "")
|
||||
{
|
||||
return "<input type='password' name='$name' id='$name' value='$value' $attrib />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<textarea></textarea>"
|
||||
*
|
||||
* @param string $name the name of the textarea tag.
|
||||
* @param string $value the default value of the textarea tag.
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function textarea($name, $value = "", $attrib = "")
|
||||
{
|
||||
return "<textarea name='$name' id='$name' $attrib>$value</textarea>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* create tags like "<input type='file' />".
|
||||
*
|
||||
* @param string $name the name of the file name.
|
||||
* @param string $attrib other attribs.
|
||||
*/
|
||||
static public function file($name, $attrib = "")
|
||||
{
|
||||
return "<input type='file' name='$name' id='$name' $attrib />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* create submit button.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @return string the submit button tag.
|
||||
*/
|
||||
public static function submitButton($label = '')
|
||||
{
|
||||
if(empty($label))
|
||||
{
|
||||
global $lang;
|
||||
$label = $lang->save;
|
||||
}
|
||||
return " <input type='submit' id='submit' value='$label' class='button-s' /> ";
|
||||
}
|
||||
|
||||
/**
|
||||
* create reset button.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @return string the reset button tag.
|
||||
*/
|
||||
public static function resetButton()
|
||||
{
|
||||
global $lang;
|
||||
return " <input type='reset' id='reset' value='{$lang->reset}' class='button-r' /> ";
|
||||
}
|
||||
|
||||
/**
|
||||
* create common button.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @return string the reset button tag.
|
||||
*/
|
||||
public static function commonButton($label = '', $misc = '')
|
||||
{
|
||||
return " <input type='button' value='$label' class='button-c' $misc /> ";
|
||||
}
|
||||
}
|
||||
|
||||
class js
|
||||
{
|
||||
/* The start of javascript. */
|
||||
static private function start()
|
||||
{
|
||||
return <<<EOT
|
||||
<html>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
|
||||
<script language='Javascript'>
|
||||
EOT;
|
||||
}
|
||||
|
||||
/* The end of javascript. */
|
||||
static private function end()
|
||||
{
|
||||
return "\n</script>\n";
|
||||
}
|
||||
|
||||
/* Show a alert box. */
|
||||
static public function alert($message = '')
|
||||
{
|
||||
return self::start() . "alert('" . $message . "')" . self::end();
|
||||
}
|
||||
|
||||
/* 弹出错误。其中message可以是一条字符串,也可以是一维或者二维数组。*/
|
||||
static public function error($message)
|
||||
{
|
||||
$alertMessage = '';
|
||||
if(is_array($message))
|
||||
{
|
||||
foreach($message as $item)
|
||||
{
|
||||
is_array($item) ? $alertMessage .= join('\n', $item) . '\n' : $alertMessage .= $item . '\n';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$alertMessage = $message;
|
||||
}
|
||||
return self::alert($alertMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* show a confirm box, press ok go to okURL, else go to cancleURL.
|
||||
*
|
||||
* @param string $message the text to be showed.
|
||||
* @param string $okURL the url to go to when press 'ok'.
|
||||
* @param string $cancleURL the url to go to when press 'cancle'.
|
||||
* @param string $okTarget the target to go to when press 'ok'.
|
||||
* @param string $cancleTarget the target to go to when press 'cancle'.
|
||||
*/
|
||||
static public function confirm($message = '', $okURL = '', $cancleURL = '', $okTarget = "self", $cancleTarget = "self", $Echo = true)
|
||||
{
|
||||
$js = self::start();
|
||||
|
||||
$confirmAction = '';
|
||||
if(strtolower($okURL) == "back")
|
||||
{
|
||||
$confirmAction = "history.back(-1);";
|
||||
}
|
||||
elseif(!empty($okURL))
|
||||
{
|
||||
$confirmAction = "$okTarget.location = '$okURL';";
|
||||
}
|
||||
|
||||
$cancleAction = '';
|
||||
if(strtolower($cancleURL) == "back")
|
||||
{
|
||||
$cancleAction = "history.back(-1);";
|
||||
}
|
||||
elseif(!empty($cancleURL))
|
||||
{
|
||||
$cancleAction = "$cancleTarget.location = '$cancleURL';";
|
||||
}
|
||||
|
||||
$js .= <<<EOT
|
||||
if(confirm("$message"))
|
||||
{
|
||||
$confirmAction
|
||||
}
|
||||
else
|
||||
{
|
||||
$cancleAction
|
||||
}
|
||||
EOT;
|
||||
$js .= self::end();
|
||||
return $js;
|
||||
}
|
||||
|
||||
/**
|
||||
* change the location of the $target window to the $URL.
|
||||
*
|
||||
* @param string $url the url will go to.
|
||||
* @param string $target the target of the url.
|
||||
* @return string the javascript string.
|
||||
*/
|
||||
static public function locate($url, $target = "self")
|
||||
{
|
||||
$js = self::start();
|
||||
if(strtolower($url) == "back")
|
||||
{
|
||||
$js .= "history.back(-1);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$js .= "$target.location='$url';\n";
|
||||
}
|
||||
return $js . self::end();
|
||||
}
|
||||
|
||||
/* Close current window. */
|
||||
static public function closeWindow()
|
||||
{
|
||||
return self::start(). "window.close();" . self::end();
|
||||
}
|
||||
|
||||
/**
|
||||
* Goto a page after a timer.
|
||||
*
|
||||
* @param string $url the url will go to.
|
||||
* @param string $target the target of the url.
|
||||
* @param int $time the timer, msec.
|
||||
* @return string the javascript string.
|
||||
*/
|
||||
static public function refresh($url, $target = "self", $time = 3000)
|
||||
{
|
||||
$js = self::start();
|
||||
$js .= "setTimeout(\"$target.location='$url'\", $time);";
|
||||
$js .= self::end();
|
||||
return $js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload a window.
|
||||
*
|
||||
* @param string $window the window to reload.
|
||||
* @return string the javascript string.
|
||||
*/
|
||||
static public function reload($window = 'self')
|
||||
{
|
||||
$js = self::start();
|
||||
$js .= "$window.location.href=$window.location.href";
|
||||
$js .= self::end();
|
||||
return $js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the config vars for createLink() js version.
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
static public function exportConfigVars()
|
||||
{
|
||||
global $app, $config;
|
||||
$defaultViewType = $app->getViewType();
|
||||
$themeRoot = $app->getWebRoot() . 'theme/';
|
||||
$js = <<<EOT
|
||||
<script language = 'javascript'>
|
||||
webRoot = '$config->webRoot';
|
||||
requestType = '$config->requestType';
|
||||
pathType = '$config->pathType';
|
||||
requestFix = '$config->requestFix';
|
||||
moduleVar = '$config->moduleVar';
|
||||
methodVar = '$config->methodVar';
|
||||
viewVar = '$config->viewVar';
|
||||
defaultView = '$defaultViewType';
|
||||
themeRoot = '$themeRoot';
|
||||
</script>
|
||||
|
||||
EOT;
|
||||
return $js;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<input type='checkbox' name='checkbox[]' value='a' />texta
|
||||
<input type='checkbox' name='checkbox[]' value='b' />textb
|
||||
<input type='checkbox' name='checkbox[]' value='c' />textc
|
||||
|
||||
<input type='checkbox' name='checkbox[]' value='a' checked ='checked' />texta
|
||||
<input type='checkbox' name='checkbox[]' value='b' />textb
|
||||
<input type='checkbox' name='checkbox[]' value='c' />textc
|
||||
|
||||
<input type='checkbox' name='checkbox[]' value='a' checked ='checked' />texta
|
||||
<input type='checkbox' name='checkbox[]' value='b' checked ='checked' />textb
|
||||
<input type='checkbox' name='checkbox[]' value='c' />textc
|
||||
|
||||
<input type='checkbox' name='checkbox[]' value='a' />texta
|
||||
<input type='checkbox' name='checkbox[]' value='b' />textb
|
||||
<input type='checkbox' name='checkbox[]' value='c' />textc
|
||||
|
||||
<input type='checkbox' name='checkbox[]' value='a' style="color:red" />texta
|
||||
<input type='checkbox' name='checkbox[]' value='b' style="color:red" />textb
|
||||
<input type='checkbox' name='checkbox[]' value='c' style="color:red" />textc
|
||||
|
||||
bool(false)
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>html<6D><6C>checkbox<6F><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 2. <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>selectedItems<6D>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 3. <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>selectedItems<6D>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 4. <20><>֤selectedItems<6D><73><EFBFBD><EFBFBD>options<6E><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijһ<C4B3><D2BB>key<65><79><EFBFBD><EFBFBD>֤selected<65>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 5. <20><>֤attrib<69><62><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 6. <20><>֤optionsΪ<73>գ<EFBFBD><D5A3>Ƿ<C7B7>false<73><65>
|
||||
*
|
||||
* @author chunsheng.wang <wwccss@gmail.com>
|
||||
* @version $Id$
|
||||
*/
|
||||
include '../front.class.php';
|
||||
|
||||
$options['a'] = 'texta';
|
||||
$options['b'] = 'textb';
|
||||
$options['c'] = 'textc';
|
||||
|
||||
echo html::checkbox('checkbox', $options) . "\n";
|
||||
echo html::checkbox('checkbox', $options, 'a') . "\n";
|
||||
echo html::checkbox('checkbox', $options, 'a,b') . "\n";
|
||||
echo html::checkbox('checkbox', $options, 'ab') . "\n";
|
||||
echo html::checkbox('checkbox', $options, '', 'style="color:red"') . "\n";
|
||||
var_dump(html::checkbox('checkbox', array()));
|
||||
<<<expect
|
||||
html_checkbox.expect
|
||||
expect
|
||||
?>
|
||||
@@ -0,0 +1,13 @@
|
||||
<input type='radio' name='radio' value='a' />texta
|
||||
<input type='radio' name='radio' value='b' />textb
|
||||
<input type='radio' name='radio' value='c' />textc
|
||||
<input type='radio' name='radio' value='a' />texta
|
||||
<input type='radio' name='radio' value='b' />textb
|
||||
<input type='radio' name='radio' value='c' />textc
|
||||
<input type='radio' name='radio' value='a' />texta
|
||||
<input type='radio' name='radio' value='b' />textb
|
||||
<input type='radio' name='radio' value='c' />textc
|
||||
<input type='radio' name='radio' value='a' style="color:red" />texta
|
||||
<input type='radio' name='radio' value='b' style="color:red" />textb
|
||||
<input type='radio' name='radio' value='c' style="color:red" />textc
|
||||
bool(false)
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>html<6D><6C>radio<69><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 2. <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>selectedItems<6D>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 3. <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>selectedItems<6D>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>(û<><C3BB>һ<EFBFBD><D2BB>ѡ<EFBFBD>С<EFBFBD>)
|
||||
* 4. <20><>֤attrib<69><62><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 5. <20><>֤optionsΪ<73>գ<EFBFBD><D5A3>Ƿ<C7B7>false<73><65>
|
||||
*
|
||||
* @author chunsheng.wang <wwccss@gmail.com>
|
||||
* @version $Id$
|
||||
*/
|
||||
include '../front.class.php';
|
||||
|
||||
$options['a'] = 'texta';
|
||||
$options['b'] = 'textb';
|
||||
$options['c'] = 'textc';
|
||||
|
||||
echo html::radio('radio', $options);
|
||||
echo html::radio('radio', $options, 'a');
|
||||
echo html::radio('radio', $options, 'a,b');
|
||||
echo html::radio('radio', $options, '', 'style="color:red"');
|
||||
var_dump(html::radio('radio', array()));
|
||||
<<<expect
|
||||
html_radio.expect
|
||||
expect
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<select name='select' id='select' />
|
||||
<option value='a'>texta</option>
|
||||
<option value='b'>textb</option>
|
||||
<option value='c'>textc</option>
|
||||
</select>
|
||||
<select name='select[]' id='select' />
|
||||
<option value='a'>texta</option>
|
||||
<option value='b'>textb</option>
|
||||
<option value='c'>textc</option>
|
||||
</select>
|
||||
<select name='select' id='select' />
|
||||
<option value='a' selected='selected'>texta</option>
|
||||
<option value='b'>textb</option>
|
||||
<option value='c'>textc</option>
|
||||
</select>
|
||||
<select name='select' id='select' />
|
||||
<option value='a' selected='selected'>texta</option>
|
||||
<option value='b'>textb</option>
|
||||
<option value='c' selected='selected'>textc</option>
|
||||
</select>
|
||||
<select name='select' id='select' />
|
||||
<option value='a'>texta</option>
|
||||
<option value='b'>textb</option>
|
||||
<option value='c'>textc</option>
|
||||
</select>
|
||||
<select name='select' id='select' style="color:red" />
|
||||
<option value='a'>texta</option>
|
||||
<option value='b'>textb</option>
|
||||
<option value='c'>textc</option>
|
||||
</select>
|
||||
bool(false)
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>html<6D><6C>select<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 2. name<6D>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>ɵ<EFBFBD>id<69>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 3. name<6D>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>ɵ<EFBFBD>id<69>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 4. <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>selectedItems<6D>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 5. <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>selectedItems<6D>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 6. <20><>֤selectedItems<6D><73><EFBFBD><EFBFBD>options<6E><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijһ<C4B3><D2BB>key<65><79><EFBFBD><EFBFBD>֤selected<65>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 7. <20><>֤attri<72>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>
|
||||
* 8. <20><>֤optionsΪ<73>գ<EFBFBD><D5A3>Ƿ<C7B7>false<73><65>
|
||||
*
|
||||
* @author chunsheng.wang <wwccss@gmail.com>
|
||||
* @version $Id$
|
||||
*/
|
||||
include '../front.class.php';
|
||||
|
||||
$options['a'] = 'texta';
|
||||
$options['b'] = 'textb';
|
||||
$options['c'] = 'textc';
|
||||
|
||||
echo html::select('select', $options);
|
||||
echo html::select('select[]', $options);
|
||||
echo html::select('select', $options, 'a');
|
||||
echo html::select('select', $options, 'a,c');
|
||||
echo html::select('select', $options, 'ab');
|
||||
echo html::select('select', $options, '', 'style="color:red"');
|
||||
var_dump(html::select('select', array()));
|
||||
<<<expect
|
||||
html_select.expect
|
||||
expect
|
||||
?>
|
||||
504
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/LICENSE
Normal file
504
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/LICENSE
Normal file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
218
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/README
Normal file
218
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/README
Normal file
@@ -0,0 +1,218 @@
|
||||
/*******************************************************************
|
||||
* The http://phpmailer.codeworxtech.com/ website now carries a few *
|
||||
* advertisements through the Google Adsense network. Please visit *
|
||||
* the advertiser sites and help us offset some of our costs. *
|
||||
* Thanks .... *
|
||||
********************************************************************/
|
||||
|
||||
PHPMailer
|
||||
Full Featured Email Transfer Class for PHP
|
||||
==========================================
|
||||
|
||||
Version 5.0.0 (April 02, 2009)
|
||||
|
||||
With the release of this version, we are initiating a new version numbering
|
||||
system to differentiate from the PHP4 version of PHPMailer.
|
||||
|
||||
Most notable in this release is fully object oriented code.
|
||||
|
||||
We now have available the PHPDocumentor (phpdocs) documentation. This is
|
||||
separate from the regular download to keep file sizes down. Please see the
|
||||
download area of http://phpmailer.codeworxtech.com.
|
||||
|
||||
We also have created a new test script (see /test_script) that you can use
|
||||
right out of the box. Copy the /test_script folder directly to your server (in
|
||||
the same structure ... with class.phpmailer.php and class.smtp.php in the
|
||||
folder above it. Then launch the test script with:
|
||||
http://www.yourdomain.com/phpmailer/test_script/index.php
|
||||
from this one script, you can test your server settings for mail(), sendmail (or
|
||||
qmail), and SMTP. This will email you a sample email (using contents.html for
|
||||
the email body) and two attachments. One of the attachments is used as an inline
|
||||
image to demonstrate how PHPMailer will automatically detect if attachments are
|
||||
the same source as inline graphics and only include one version. Once you click
|
||||
the Submit button, the results will be displayed including any SMTP debug
|
||||
information and send status. We will also display a version of the script that
|
||||
you can cut and paste to include in your projects. Enjoy!
|
||||
|
||||
Version 2.3 (November 08, 2008)
|
||||
|
||||
We have removed the /phpdoc from the downloads. All documentation is now on
|
||||
the http://phpmailer.codeworxtech.com website.
|
||||
|
||||
The phpunit.php has been updated to support PHP5.
|
||||
|
||||
For all other changes and notes, please see the changelog.
|
||||
|
||||
Donations are accepted at PayPal with our id "paypal@worxteam.com".
|
||||
|
||||
Version 2.2 (July 15 2008)
|
||||
|
||||
- see the changelog.
|
||||
|
||||
Version 2.1 (June 04 2008)
|
||||
|
||||
With this release, we are announcing that the development of PHPMailer for PHP5
|
||||
will be our focus from this date on. We have implemented all the enhancements
|
||||
and fixes from the latest release of PHPMailer for PHP4.
|
||||
|
||||
Far more important, though, is that this release of PHPMailer (v2.1) is
|
||||
fully tested with E_STRICT error checking enabled.
|
||||
|
||||
** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
|
||||
IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
|
||||
APPRECIATED.
|
||||
|
||||
We have now added S/MIME functionality (ability to digitally sign emails).
|
||||
BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
|
||||
The "Signed Emails" functionality adds the Sign method to pass the private key
|
||||
filename and the password to read it, and then email will be sent with
|
||||
content-type multipart/signed and with the digital signature attached.
|
||||
|
||||
A quick note on E_STRICT:
|
||||
|
||||
- In about half the test environments the development version was subjected
|
||||
to, an error was thrown for the date() functions (used at line 1565 and 1569).
|
||||
This is NOT a PHPMailer error, it is the result of an incorrectly configured
|
||||
PHP5 installation. The fix is to modify your 'php.ini' file and include the
|
||||
date.timezone = America/New York
|
||||
directive, (for your own server timezone)
|
||||
- If you do get this error, and are unable to access your php.ini file, there is
|
||||
a workaround. In your PHP script, add
|
||||
date_default_timezone_set('America/Toronto');
|
||||
|
||||
* do NOT try to use
|
||||
$myVar = date_default_timezone_get();
|
||||
as a test, it will throw an error.
|
||||
|
||||
We have also included more example files to show the use of "sendmail", "mail()",
|
||||
"smtp", and "gmail".
|
||||
|
||||
We are also looking for more programmers to join the volunteer development team.
|
||||
If you have an interest in this, please let us know.
|
||||
|
||||
Enjoy!
|
||||
|
||||
|
||||
Version 2.1.0beta1 & beta2
|
||||
|
||||
please note, this is BETA software
|
||||
** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
|
||||
INTENDED STRICTLY FOR TESTING
|
||||
|
||||
** NOTE:
|
||||
|
||||
As of November 2007, PHPMailer has a new project team headed by industry
|
||||
veteran Andy Prevost (codeworxtech). The first release in more than two
|
||||
years will focus on fixes, adding ease-of-use enhancements, provide
|
||||
basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility
|
||||
features. A new release is planned before year-end 2007 that will provide
|
||||
full compatiblity with PHP4 and PHP5, as well as more bug fixes.
|
||||
|
||||
We are looking for project developers to assist in restoring PHPMailer to
|
||||
its leadership position. Our goals are to simplify use of PHPMailer, provide
|
||||
good documentation and examples, and retain backward compatibility to level
|
||||
1.7.3 standards.
|
||||
|
||||
If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer
|
||||
and indicate your interest.
|
||||
|
||||
**
|
||||
|
||||
http://phpmailer.sourceforge.net/
|
||||
|
||||
This software is licenced under the LGPL. Please read LICENSE for information on the
|
||||
software availability and distribution.
|
||||
|
||||
Class Features:
|
||||
- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
|
||||
- Redundant SMTP servers
|
||||
- Multipart/alternative emails for mail clients that do not read HTML email
|
||||
- Support for 8bit, base64, binary, and quoted-printable encoding
|
||||
- Uses the same methods as the very popular AspEmail active server (COM) component
|
||||
- SMTP authentication
|
||||
- Native language support
|
||||
- Word wrap, and more!
|
||||
|
||||
Why you might need it:
|
||||
|
||||
Many PHP developers utilize email in their code. The only PHP function
|
||||
that supports this is the mail() function. However, it does not expose
|
||||
any of the popular features that many email clients use nowadays like
|
||||
HTML-based emails and attachments. There are two proprietary
|
||||
development tools out there that have all the functionality built into
|
||||
easy to use classes: AspEmail(tm) and AspMail. Both of these
|
||||
programs are COM components only available on Windows. They are also a
|
||||
little pricey for smaller projects.
|
||||
|
||||
Since I do Linux development I<>ve missed these tools for my PHP coding.
|
||||
So I built a version myself that implements the same methods (object
|
||||
calls) that the Windows-based components do. It is open source and the
|
||||
LGPL license allows you to place the class in your proprietary PHP
|
||||
projects.
|
||||
|
||||
|
||||
Installation:
|
||||
|
||||
Copy class.phpmailer.php into your php.ini include_path. If you are
|
||||
using the SMTP mailer then place class.smtp.php in your path as well.
|
||||
In the language directory you will find several files like
|
||||
phpmailer.lang-en.php. If you look right before the .php extension
|
||||
that there are two letters. These represent the language type of the
|
||||
translation file. For instance "en" is the English file and "br" is
|
||||
the Portuguese file. Chose the file that best fits with your language
|
||||
and place it in the PHP include path. If your language is English
|
||||
then you have nothing more to do. If it is a different language then
|
||||
you must point PHPMailer to the correct translation. To do this, call
|
||||
the PHPMailer SetLanguage method like so:
|
||||
|
||||
// To load the Portuguese version
|
||||
$mail->SetLanguage("br", "/optional/path/to/language/directory/");
|
||||
|
||||
That's it. You should now be ready to use PHPMailer!
|
||||
|
||||
|
||||
A Simple Example:
|
||||
|
||||
<?php
|
||||
require("class.phpmailer.php");
|
||||
|
||||
$mail = new PHPMailer();
|
||||
|
||||
$mail->IsSMTP(); // set mailer to use SMTP
|
||||
$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server
|
||||
$mail->SMTPAuth = true; // turn on SMTP authentication
|
||||
$mail->Username = "jswan"; // SMTP username
|
||||
$mail->Password = "secret"; // SMTP password
|
||||
|
||||
$mail->From = "from@example.com";
|
||||
$mail->FromName = "Mailer";
|
||||
$mail->AddAddress("josh@example.net", "Josh Adams");
|
||||
$mail->AddAddress("ellen@example.com"); // name is optional
|
||||
$mail->AddReplyTo("info@example.com", "Information");
|
||||
|
||||
$mail->WordWrap = 50; // set word wrap to 50 characters
|
||||
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
|
||||
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
|
||||
$mail->IsHTML(true); // set email format to HTML
|
||||
|
||||
$mail->Subject = "Here is the subject";
|
||||
$mail->Body = "This is the HTML message body <b>in bold!</b>";
|
||||
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
|
||||
|
||||
if(!$mail->Send())
|
||||
{
|
||||
echo "Message could not be sent. <p>";
|
||||
echo "Mailer Error: " . $mail->ErrorInfo;
|
||||
exit;
|
||||
}
|
||||
|
||||
echo "Message has been sent";
|
||||
?>
|
||||
|
||||
CHANGELOG
|
||||
|
||||
See ChangeLog.txt
|
||||
|
||||
Download: http://sourceforge.net/project/showfiles.php?group_id=26031
|
||||
|
||||
Andy Prevost
|
||||
407
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/class.pop3.php
Normal file
407
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/class.pop3.php
Normal file
@@ -0,0 +1,407 @@
|
||||
<?php
|
||||
/*~ class.pop3.php
|
||||
.---------------------------------------------------------------------------.
|
||||
| Software: PHPMailer - PHP email class |
|
||||
| Version: 5.1 |
|
||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
||||
| Info: http://phpmailer.sourceforge.net |
|
||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| Admin: Andy Prevost (project admininistrator) |
|
||||
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
||||
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
||||
| Founder: Brent R. Matzelle (original founder) |
|
||||
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||
| http://www.gnu.org/copyleft/lesser.html |
|
||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| We offer a number of paid services (www.codeworxtech.com): |
|
||||
| - Web Hosting on highly optimized fast and secure servers |
|
||||
| - Technology Consulting |
|
||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
||||
'---------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPMailer - PHP POP Before SMTP Authentication Class
|
||||
* NOTE: Designed for use with PHP version 5 and up
|
||||
* @package PHPMailer
|
||||
* @author Andy Prevost
|
||||
* @author Marcus Bointon
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
||||
* @version $Id: class.pop3.php 444 2009-05-05 11:22:26Z coolbru $
|
||||
*/
|
||||
|
||||
/**
|
||||
* POP Before SMTP Authentication Class
|
||||
* Version 5.0.0
|
||||
*
|
||||
* Author: Richard Davey (rich@corephp.co.uk)
|
||||
* Modifications: Andy Prevost
|
||||
* License: LGPL, see PHPMailer License
|
||||
*
|
||||
* Specifically for PHPMailer to allow POP before SMTP authentication.
|
||||
* Does not yet work with APOP - if you have an APOP account, contact Richard Davey
|
||||
* and we can test changes to this script.
|
||||
*
|
||||
* This class is based on the structure of the SMTP class originally authored by Chris Ryan
|
||||
*
|
||||
* This class is rfc 1939 compliant and implements all the commands
|
||||
* required for POP3 connection, authentication and disconnection.
|
||||
*
|
||||
* @package PHPMailer
|
||||
* @author Richard Davey
|
||||
*/
|
||||
|
||||
class POP3 {
|
||||
/**
|
||||
* Default POP3 port
|
||||
* @var int
|
||||
*/
|
||||
public $POP3_PORT = 110;
|
||||
|
||||
/**
|
||||
* Default Timeout
|
||||
* @var int
|
||||
*/
|
||||
public $POP3_TIMEOUT = 30;
|
||||
|
||||
/**
|
||||
* POP3 Carriage Return + Line Feed
|
||||
* @var string
|
||||
*/
|
||||
public $CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* Displaying Debug warnings? (0 = now, 1+ = yes)
|
||||
* @var int
|
||||
*/
|
||||
public $do_debug = 2;
|
||||
|
||||
/**
|
||||
* POP3 Mail Server
|
||||
* @var string
|
||||
*/
|
||||
public $host;
|
||||
|
||||
/**
|
||||
* POP3 Port
|
||||
* @var int
|
||||
*/
|
||||
public $port;
|
||||
|
||||
/**
|
||||
* POP3 Timeout Value
|
||||
* @var int
|
||||
*/
|
||||
public $tval;
|
||||
|
||||
/**
|
||||
* POP3 Username
|
||||
* @var string
|
||||
*/
|
||||
public $username;
|
||||
|
||||
/**
|
||||
* POP3 Password
|
||||
* @var string
|
||||
*/
|
||||
public $password;
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// PROPERTIES, PRIVATE AND PROTECTED
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
private $pop_conn;
|
||||
private $connected;
|
||||
private $error; // Error log array
|
||||
|
||||
/**
|
||||
* Constructor, sets the initial values
|
||||
* @access public
|
||||
* @return POP3
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->pop_conn = 0;
|
||||
$this->connected = false;
|
||||
$this->error = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combination of public events - connect, login, disconnect
|
||||
* @access public
|
||||
* @param string $host
|
||||
* @param integer $port
|
||||
* @param integer $tval
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*/
|
||||
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
|
||||
$this->host = $host;
|
||||
|
||||
// If no port value is passed, retrieve it
|
||||
if ($port == false) {
|
||||
$this->port = $this->POP3_PORT;
|
||||
} else {
|
||||
$this->port = $port;
|
||||
}
|
||||
|
||||
// If no port value is passed, retrieve it
|
||||
if ($tval == false) {
|
||||
$this->tval = $this->POP3_TIMEOUT;
|
||||
} else {
|
||||
$this->tval = $tval;
|
||||
}
|
||||
|
||||
$this->do_debug = $debug_level;
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
|
||||
// Refresh the error log
|
||||
$this->error = null;
|
||||
|
||||
// Connect
|
||||
$result = $this->Connect($this->host, $this->port, $this->tval);
|
||||
|
||||
if ($result) {
|
||||
$login_result = $this->Login($this->username, $this->password);
|
||||
|
||||
if ($login_result) {
|
||||
$this->Disconnect();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// We need to disconnect regardless if the login succeeded
|
||||
$this->Disconnect();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to the POP3 server
|
||||
* @access public
|
||||
* @param string $host
|
||||
* @param integer $port
|
||||
* @param integer $tval
|
||||
* @return boolean
|
||||
*/
|
||||
public function Connect ($host, $port = false, $tval = 30) {
|
||||
// Are we already connected?
|
||||
if ($this->connected) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
||||
Rather than supress it with @fsockopen, let's capture it cleanly instead
|
||||
*/
|
||||
|
||||
set_error_handler(array(&$this, 'catchWarning'));
|
||||
|
||||
// Connect to the POP3 server
|
||||
$this->pop_conn = fsockopen($host, // POP3 Host
|
||||
$port, // Port #
|
||||
$errno, // Error Number
|
||||
$errstr, // Error Message
|
||||
$tval); // Timeout (seconds)
|
||||
|
||||
// Restore the error handler
|
||||
restore_error_handler();
|
||||
|
||||
// Does the Error Log now contain anything?
|
||||
if ($this->error && $this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
|
||||
// Did we connect?
|
||||
if ($this->pop_conn == false) {
|
||||
// It would appear not...
|
||||
$this->error = array(
|
||||
'error' => "Failed to connect to server $host on port $port",
|
||||
'errno' => $errno,
|
||||
'errstr' => $errstr
|
||||
);
|
||||
|
||||
if ($this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Increase the stream time-out
|
||||
|
||||
// Check for PHP 4.3.0 or later
|
||||
if (version_compare(phpversion(), '5.0.0', 'ge')) {
|
||||
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||
} else {
|
||||
// Does not work on Windows
|
||||
if (substr(PHP_OS, 0, 3) !== 'WIN') {
|
||||
socket_set_timeout($this->pop_conn, $tval, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the POP3 server response
|
||||
$pop3_response = $this->getResponse();
|
||||
|
||||
// Check for the +OK
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
// The connection is established and the POP3 server is talking
|
||||
$this->connected = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to the POP3 server (does not support APOP yet)
|
||||
* @access public
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return boolean
|
||||
*/
|
||||
public function Login ($username = '', $password = '') {
|
||||
if ($this->connected == false) {
|
||||
$this->error = 'Not connected to POP3 server';
|
||||
|
||||
if ($this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($username)) {
|
||||
$username = $this->username;
|
||||
}
|
||||
|
||||
if (empty($password)) {
|
||||
$password = $this->password;
|
||||
}
|
||||
|
||||
$pop_username = "USER $username" . $this->CRLF;
|
||||
$pop_password = "PASS $password" . $this->CRLF;
|
||||
|
||||
// Send the Username
|
||||
$this->sendString($pop_username);
|
||||
$pop3_response = $this->getResponse();
|
||||
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
// Send the Password
|
||||
$this->sendString($pop_password);
|
||||
$pop3_response = $this->getResponse();
|
||||
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from the POP3 server
|
||||
* @access public
|
||||
*/
|
||||
public function Disconnect () {
|
||||
$this->sendString('QUIT');
|
||||
|
||||
fclose($this->pop_conn);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Private Methods
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Get the socket response back.
|
||||
* $size is the maximum number of bytes to retrieve
|
||||
* @access private
|
||||
* @param integer $size
|
||||
* @return string
|
||||
*/
|
||||
private function getResponse ($size = 128) {
|
||||
$pop3_response = fgets($this->pop_conn, $size);
|
||||
|
||||
return $pop3_response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a string down the open socket connection to the POP3 server
|
||||
* @access private
|
||||
* @param string $string
|
||||
* @return integer
|
||||
*/
|
||||
private function sendString ($string) {
|
||||
$bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
|
||||
|
||||
return $bytes_sent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the POP3 server response for +OK or -ERR
|
||||
* @access private
|
||||
* @param string $string
|
||||
* @return boolean
|
||||
*/
|
||||
private function checkResponse ($string) {
|
||||
if (substr($string, 0, 3) !== '+OK') {
|
||||
$this->error = array(
|
||||
'error' => "Server reported an error: $string",
|
||||
'errno' => 0,
|
||||
'errstr' => ''
|
||||
);
|
||||
|
||||
if ($this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* If debug is enabled, display the error message array
|
||||
* @access private
|
||||
*/
|
||||
private function displayErrors () {
|
||||
echo '<pre>';
|
||||
|
||||
foreach ($this->error as $single_error) {
|
||||
print_r($single_error);
|
||||
}
|
||||
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes over from PHP for the socket warning handler
|
||||
* @access private
|
||||
* @param integer $errno
|
||||
* @param string $errstr
|
||||
* @param string $errfile
|
||||
* @param integer $errline
|
||||
*/
|
||||
private function catchWarning ($errno, $errstr, $errfile, $errline) {
|
||||
$this->error[] = array(
|
||||
'error' => "Connecting to the POP3 server raised a PHP warning: ",
|
||||
'errno' => $errno,
|
||||
'errstr' => $errstr
|
||||
);
|
||||
}
|
||||
|
||||
// End of class
|
||||
}
|
||||
?>
|
||||
814
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/class.smtp.php
Normal file
814
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/class.smtp.php
Normal file
@@ -0,0 +1,814 @@
|
||||
<?php
|
||||
/*~ class.smtp.php
|
||||
.---------------------------------------------------------------------------.
|
||||
| Software: PHPMailer - PHP email class |
|
||||
| Version: 5.1 |
|
||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
||||
| Info: http://phpmailer.sourceforge.net |
|
||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| Admin: Andy Prevost (project admininistrator) |
|
||||
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
||||
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
||||
| Founder: Brent R. Matzelle (original founder) |
|
||||
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||
| http://www.gnu.org/copyleft/lesser.html |
|
||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| We offer a number of paid services (www.codeworxtech.com): |
|
||||
| - Web Hosting on highly optimized fast and secure servers |
|
||||
| - Technology Consulting |
|
||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
||||
'---------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPMailer - PHP SMTP email transport class
|
||||
* NOTE: Designed for use with PHP version 5 and up
|
||||
* @package PHPMailer
|
||||
* @author Andy Prevost
|
||||
* @author Marcus Bointon
|
||||
* @copyright 2004 - 2008 Andy Prevost
|
||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
||||
* @version $Id: class.smtp.php 444 2009-05-05 11:22:26Z coolbru $
|
||||
*/
|
||||
|
||||
/**
|
||||
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
||||
* commands except TURN which will always return a not implemented
|
||||
* error. SMTP also provides some utility methods for sending mail
|
||||
* to an SMTP server.
|
||||
* original author: Chris Ryan
|
||||
*/
|
||||
|
||||
class SMTP {
|
||||
/**
|
||||
* SMTP server port
|
||||
* @var int
|
||||
*/
|
||||
public $SMTP_PORT = 25;
|
||||
|
||||
/**
|
||||
* SMTP reply line ending
|
||||
* @var string
|
||||
*/
|
||||
public $CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* Sets whether debugging is turned on
|
||||
* @var bool
|
||||
*/
|
||||
public $do_debug; // the level of debug to perform
|
||||
|
||||
/**
|
||||
* Sets VERP use on/off (default is off)
|
||||
* @var bool
|
||||
*/
|
||||
public $do_verp = false;
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// PROPERTIES, PRIVATE AND PROTECTED
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
private $smtp_conn; // the socket to the server
|
||||
private $error; // error if any on the last call
|
||||
private $helo_rply; // the reply the server sent to us for HELO
|
||||
|
||||
/**
|
||||
* Initialize the class so that the data is in a known state.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->smtp_conn = 0;
|
||||
$this->error = null;
|
||||
$this->helo_rply = null;
|
||||
|
||||
$this->do_debug = 0;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// CONNECTION FUNCTIONS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Connect to the server specified on the port specified.
|
||||
* If the port is not specified use the default SMTP_PORT.
|
||||
* If tval is specified then a connection will try and be
|
||||
* established with the server for that number of seconds.
|
||||
* If tval is not specified the default is 30 seconds to
|
||||
* try on the connection.
|
||||
*
|
||||
* SMTP CODE SUCCESS: 220
|
||||
* SMTP CODE FAILURE: 421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Connect($host, $port = 0, $tval = 30) {
|
||||
// set the error val to null so there is no confusion
|
||||
$this->error = null;
|
||||
|
||||
// make sure we are __not__ connected
|
||||
if($this->connected()) {
|
||||
// already connected, generate error
|
||||
$this->error = array("error" => "Already connected to a server");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(empty($port)) {
|
||||
$port = $this->SMTP_PORT;
|
||||
}
|
||||
|
||||
// connect to the smtp server
|
||||
$this->smtp_conn = @fsockopen($host, // the host of the server
|
||||
$port, // the port to use
|
||||
$errno, // error number if any
|
||||
$errstr, // error message if any
|
||||
$tval); // give up after ? secs
|
||||
// verify we connected properly
|
||||
if(empty($this->smtp_conn)) {
|
||||
$this->error = array("error" => "Failed to connect to server",
|
||||
"errno" => $errno,
|
||||
"errstr" => $errstr);
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// SMTP server can take longer to respond, give longer timeout for first read
|
||||
// Windows does not have support for this timeout function
|
||||
if(substr(PHP_OS, 0, 3) != "WIN")
|
||||
socket_set_timeout($this->smtp_conn, $tval, 0);
|
||||
|
||||
// get any announcement
|
||||
$announce = $this->get_lines();
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate a TLS communication with the server.
|
||||
*
|
||||
* SMTP CODE 220 Ready to start TLS
|
||||
* SMTP CODE 501 Syntax error (no parameters allowed)
|
||||
* SMTP CODE 454 TLS not available due to temporary reason
|
||||
* @access public
|
||||
* @return bool success
|
||||
*/
|
||||
public function StartTLS() {
|
||||
$this->error = null; # to avoid confusion
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array("error" => "Called StartTLS() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 220) {
|
||||
$this->error =
|
||||
array("error" => "STARTTLS not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Begin encrypted connection
|
||||
if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs SMTP authentication. Must be run after running the
|
||||
* Hello() method. Returns true if successfully authenticated.
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Authenticate($username, $password) {
|
||||
// Start authentication
|
||||
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "AUTH not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send encoded username
|
||||
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "Username not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send encoded password
|
||||
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($code != 235) {
|
||||
$this->error =
|
||||
array("error" => "Password not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if connected to a server otherwise false
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Connected() {
|
||||
if(!empty($this->smtp_conn)) {
|
||||
$sock_status = socket_get_status($this->smtp_conn);
|
||||
if($sock_status["eof"]) {
|
||||
// the socket is valid but we are not connected
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
|
||||
}
|
||||
$this->Close();
|
||||
return false;
|
||||
}
|
||||
return true; // everything looks good
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the socket and cleans up the state of the class.
|
||||
* It is not considered good to use this function without
|
||||
* first trying to use QUIT.
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function Close() {
|
||||
$this->error = null; // so there is no confusion
|
||||
$this->helo_rply = null;
|
||||
if(!empty($this->smtp_conn)) {
|
||||
// close the connection and cleanup
|
||||
fclose($this->smtp_conn);
|
||||
$this->smtp_conn = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// SMTP COMMANDS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Issues a data command and sends the msg_data to the server
|
||||
* finializing the mail transaction. $msg_data is the message
|
||||
* that is to be send with the headers. Each header needs to be
|
||||
* on a single line followed by a <CRLF> with the message headers
|
||||
* and the message body being seperated by and additional <CRLF>.
|
||||
*
|
||||
* Implements rfc 821: DATA <CRLF>
|
||||
*
|
||||
* SMTP CODE INTERMEDIATE: 354
|
||||
* [data]
|
||||
* <CRLF>.<CRLF>
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE FAILURE: 552,554,451,452
|
||||
* SMTP CODE FAILURE: 451,554
|
||||
* SMTP CODE ERROR : 500,501,503,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Data($msg_data) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Data() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"DATA" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 354) {
|
||||
$this->error =
|
||||
array("error" => "DATA command not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* the server is ready to accept data!
|
||||
* according to rfc 821 we should not send more than 1000
|
||||
* including the CRLF
|
||||
* characters on a single line so we will break the data up
|
||||
* into lines by \r and/or \n then if needed we will break
|
||||
* each of those into smaller lines to fit within the limit.
|
||||
* in addition we will be looking for lines that start with
|
||||
* a period '.' and append and additional period '.' to that
|
||||
* line. NOTE: this does not count towards limit.
|
||||
*/
|
||||
|
||||
// normalize the line breaks so we know the explode works
|
||||
$msg_data = str_replace("\r\n","\n",$msg_data);
|
||||
$msg_data = str_replace("\r","\n",$msg_data);
|
||||
$lines = explode("\n",$msg_data);
|
||||
|
||||
/* we need to find a good way to determine is headers are
|
||||
* in the msg_data or if it is a straight msg body
|
||||
* currently I am assuming rfc 822 definitions of msg headers
|
||||
* and if the first field of the first line (':' sperated)
|
||||
* does not contain a space then it _should_ be a header
|
||||
* and we can process all lines before a blank "" line as
|
||||
* headers.
|
||||
*/
|
||||
|
||||
$field = substr($lines[0],0,strpos($lines[0],":"));
|
||||
$in_headers = false;
|
||||
if(!empty($field) && !strstr($field," ")) {
|
||||
$in_headers = true;
|
||||
}
|
||||
|
||||
$max_line_length = 998; // used below; set here for ease in change
|
||||
|
||||
while(list(,$line) = @each($lines)) {
|
||||
$lines_out = null;
|
||||
if($line == "" && $in_headers) {
|
||||
$in_headers = false;
|
||||
}
|
||||
// ok we need to break this line up into several smaller lines
|
||||
while(strlen($line) > $max_line_length) {
|
||||
$pos = strrpos(substr($line,0,$max_line_length)," ");
|
||||
|
||||
// Patch to fix DOS attack
|
||||
if(!$pos) {
|
||||
$pos = $max_line_length - 1;
|
||||
$lines_out[] = substr($line,0,$pos);
|
||||
$line = substr($line,$pos);
|
||||
} else {
|
||||
$lines_out[] = substr($line,0,$pos);
|
||||
$line = substr($line,$pos + 1);
|
||||
}
|
||||
|
||||
/* if processing headers add a LWSP-char to the front of new line
|
||||
* rfc 822 on long msg headers
|
||||
*/
|
||||
if($in_headers) {
|
||||
$line = "\t" . $line;
|
||||
}
|
||||
}
|
||||
$lines_out[] = $line;
|
||||
|
||||
// send the lines to the server
|
||||
while(list(,$line_out) = @each($lines_out)) {
|
||||
if(strlen($line_out) > 0)
|
||||
{
|
||||
if(substr($line_out, 0, 1) == ".") {
|
||||
$line_out = "." . $line_out;
|
||||
}
|
||||
}
|
||||
fputs($this->smtp_conn,$line_out . $this->CRLF);
|
||||
}
|
||||
}
|
||||
|
||||
// message data has been sent
|
||||
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "DATA not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the HELO command to the smtp server.
|
||||
* This makes sure that we and the server are in
|
||||
* the same known state.
|
||||
*
|
||||
* Implements from rfc 821: HELO <SP> <domain> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE ERROR : 500, 501, 504, 421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Hello($host = '') {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Hello() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
// if hostname for HELO was not specified send default
|
||||
if(empty($host)) {
|
||||
// determine appropriate default to send to server
|
||||
$host = "localhost";
|
||||
}
|
||||
|
||||
// Send extended hello first (RFC 2821)
|
||||
if(!$this->SendHello("EHLO", $host)) {
|
||||
if(!$this->SendHello("HELO", $host)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a HELO/EHLO command.
|
||||
* @access private
|
||||
* @return bool
|
||||
*/
|
||||
private function SendHello($hello, $host) {
|
||||
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => $hello . " not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->helo_rply = $rply;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a mail transaction from the email address specified in
|
||||
* $from. Returns true if successful or false otherwise. If True
|
||||
* the mail transaction is started and then one or more Recipient
|
||||
* commands may be called followed by a Data command.
|
||||
*
|
||||
* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE SUCCESS: 552,451,452
|
||||
* SMTP CODE SUCCESS: 500,501,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Mail($from) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Mail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
$useVerp = ($this->do_verp ? "XVERP" : "");
|
||||
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "MAIL not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the quit command to the server and then closes the socket
|
||||
* if there is no error or the $close_on_error argument is true.
|
||||
*
|
||||
* Implements from rfc 821: QUIT <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 221
|
||||
* SMTP CODE ERROR : 500
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Quit($close_on_error = true) {
|
||||
$this->error = null; // so there is no confusion
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Quit() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
// send the quit command to the server
|
||||
fputs($this->smtp_conn,"quit" . $this->CRLF);
|
||||
|
||||
// get any good-bye messages
|
||||
$byemsg = $this->get_lines();
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
$rval = true;
|
||||
$e = null;
|
||||
|
||||
$code = substr($byemsg,0,3);
|
||||
if($code != 221) {
|
||||
// use e as a tmp var cause Close will overwrite $this->error
|
||||
$e = array("error" => "SMTP server rejected quit command",
|
||||
"smtp_code" => $code,
|
||||
"smtp_rply" => substr($byemsg,4));
|
||||
$rval = false;
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($e) || $close_on_error) {
|
||||
$this->Close();
|
||||
}
|
||||
|
||||
return $rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the command RCPT to the SMTP server with the TO: argument of $to.
|
||||
* Returns true if the recipient was accepted false if it was rejected.
|
||||
*
|
||||
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250,251
|
||||
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
|
||||
* SMTP CODE ERROR : 500,501,503,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Recipient($to) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Recipient() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 250 && $code != 251) {
|
||||
$this->error =
|
||||
array("error" => "RCPT not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the RSET command to abort and transaction that is
|
||||
* currently in progress. Returns true if successful false
|
||||
* otherwise.
|
||||
*
|
||||
* Implements rfc 821: RSET <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE ERROR : 500,501,504,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Reset() {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Reset() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"RSET" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "RSET failed",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a mail transaction from the email address specified in
|
||||
* $from. Returns true if successful or false otherwise. If True
|
||||
* the mail transaction is started and then one or more Recipient
|
||||
* commands may be called followed by a Data command. This command
|
||||
* will send the message to the users terminal if they are logged
|
||||
* in and send them an email.
|
||||
*
|
||||
* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE SUCCESS: 552,451,452
|
||||
* SMTP CODE SUCCESS: 500,501,502,421
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function SendAndMail($from) {
|
||||
$this->error = null; // so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called SendAndMail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "SAML not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an optional command for SMTP that this class does not
|
||||
* support. This method is here to make the RFC821 Definition
|
||||
* complete for this class and __may__ be implimented in the future
|
||||
*
|
||||
* Implements from rfc 821: TURN <CRLF>
|
||||
*
|
||||
* SMTP CODE SUCCESS: 250
|
||||
* SMTP CODE FAILURE: 502
|
||||
* SMTP CODE ERROR : 500, 503
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function Turn() {
|
||||
$this->error = array("error" => "This method, TURN, of the SMTP ".
|
||||
"is not implemented");
|
||||
if($this->do_debug >= 1) {
|
||||
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current error
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getError() {
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// INTERNAL FUNCTIONS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Read in as many lines as possible
|
||||
* either before eof or socket timeout occurs on the operation.
|
||||
* With SMTP we can tell if we have more lines to read if the
|
||||
* 4th character is '-' symbol. If it is a space then we don't
|
||||
* need to read anything else.
|
||||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
private function get_lines() {
|
||||
$data = "";
|
||||
while($str = @fgets($this->smtp_conn,515)) {
|
||||
if($this->do_debug >= 4) {
|
||||
echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
|
||||
echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
|
||||
}
|
||||
$data .= $str;
|
||||
if($this->do_debug >= 4) {
|
||||
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
|
||||
}
|
||||
// if 4th character is a space, we are done reading, break the loop
|
||||
if(substr($str,3,1) == " ") { break; }
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Arabic Version, UTF-8
|
||||
* by : bahjat al mostafa <bahjat983@hotmail.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: ';
|
||||
$PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : ';
|
||||
$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.';
|
||||
//$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' .
|
||||
'فشل في الارسال لكل من : ';
|
||||
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Portuguese Version
|
||||
* By Paulo Henrique Garcia - paulo@controllerweb.com.br
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados não aceitos.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Os endereços de rementente a seguir falharam: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não suportado.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de email.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Catalan Version
|
||||
* By Ivan: web AT microstudi DOT com
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s\'hapogut autenticar.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: ';
|
||||
$PHPMAILER_LANG['execute'] = 'No es pot executar: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l\'arxiu: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'No s\'ha pogut crear una instància de la funció Mail.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
|
||||
$PHPMAILER_LANG['provide_address'] = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Chinese Version
|
||||
* By LiuXin: www.80x86.cn/blog/
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = '未知编码:';
|
||||
$PHPMAILER_LANG['execute'] = '不能执行: ';
|
||||
$PHPMAILER_LANG['file_access'] = '不能访问文件:';
|
||||
$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
|
||||
$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: ';
|
||||
$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
|
||||
$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Czech Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentikace.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nelze navázat spojení se SMTP serverem.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data nebyla pøijata';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Neznámé kódování: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nelze provést: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Soubor nenalezen: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'File Error: Nelze otevøít soubor pro ètení: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Následující adresa From je nesprávná: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvoøit instanci emailové funkce.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailový klient není podporován.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy pøíjemcù nejsou správné ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* German Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fehler: Daten werden nicht akzeptiert.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'E-Mail Inhalt ist leer.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Unbekanntes Encoding-Format: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.';
|
||||
$PHPMAILER_LANG['invalid_email'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
|
||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.';
|
||||
$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: ';
|
||||
$PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Danish Version
|
||||
* Author: Mikael Stokkebro <info@stokkebro.dk>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Spanish version
|
||||
* Versión en español
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No se pudo autentificar.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No puedo conectar al servidor SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
|
||||
$PHPMAILER_LANG['execute'] = 'No puedo ejecutar: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'No puedo acceder al archivo: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: No puede abrir el archivo: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'No pude crear una instancia de la función Mail.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Debe proveer al menos una dirección de email como destinatario.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinatarios fallaron: ';
|
||||
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Estonian Version
|
||||
* By Indrek Päri
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Tundmatu Unknown kodeering: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Finnish Version
|
||||
* By Jyry Kuukanen
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-virhe: data on virheellinen.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Suoritus epäonnistui: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Seuraava lähettäjän osoite on virheellinen: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
|
||||
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Faroese Version [language of the Faroe Islands, a Danish dominion]
|
||||
* This file created: 11-06-2004
|
||||
* Supplied by Dávur Sørensen [www.profo-webdesign.dk]
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Ókend encoding: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* French Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : Echec de l\'authentification.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : Impossible de se connecter au serveur SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : Données incorrects.';
|
||||
$PHPMAILER_LANG['empty_message'] = 'Corps de message vide';
|
||||
$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
|
||||
$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Erreur Fichier : ouverture impossible : ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échouée : ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : Les destinataires suivants sont en erreur : ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Hungarian Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Hiba: Sikertelen autentikáció.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hiba: Nem elfogadható adat.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Ismeretlen kódolás: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nem tudtam végrehajtani: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Nem sikerült elérni a következõ fájlt: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Az alábbi Feladó cím hibás: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nem sikerült példányosítani a mail funkciót.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Meg kell adnod legalább egy címzett email címet.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' levelezõ nem támogatott.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hiba: Az alábbi címzettek hibásak: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Italian version
|
||||
* @package PHPMailer
|
||||
* @author Ilias Bartolini <brain79@inwind.it>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Japanese Version
|
||||
* By Mitsuhiro Yoshida - http://mitstek.com/
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
|
||||
$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
|
||||
$PHPMAILER_LANG['from_failed'] = '次のFromアドレスに間違いがあります: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Dutch Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Fout: authenticatie mislukt.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Fout: Kon niet verbinden met SMTP host.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fout: Data niet geaccepteerd.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Bestandsfout: Kon bestand niet openen: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'De volgende afzender adressen zijn mislukt: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Kon mail functie niet initialiseren.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Er moet tenmiste één ontvanger emailadres opgegeven worden.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fout: De volgende ontvangers zijn mislukt: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Norwegian Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke authentisere.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP host.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Data ble ikke akseptert.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Ukjent encoding: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Kunne ikke få tilgang til filen: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Fil feil: Kunne ikke åpne filen: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Følgende Fra feilet: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke instantiate mail funksjonen.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Du må ha med minst en mottager adresse.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottagere feilet: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Polish Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić autentykacji.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest jest nieprawidłowy: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Romanian Version
|
||||
* @package PHPMailer
|
||||
* @author Catalin Constantin <catalin@dazoot.ro>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Nu pot executa: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Russian Version by Alexey Chumakov <alex@chumakov.ru>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Swedish Version
|
||||
* Author: Johan Linnér <johan@linner.biz>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Kunde inte köra: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Turkish version
|
||||
* Türkçe Versiyonu
|
||||
* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Hatasý: Doðrulanamýyor.';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatasý: Veri kabul edilmedi.';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen þifreleme: ';
|
||||
$PHPMAILER_LANG['execute'] = 'Çalýþtýrýlamýyor: ';
|
||||
$PHPMAILER_LANG['file_access'] = 'Dosyaya eriþilemiyor: ';
|
||||
$PHPMAILER_LANG['file_open'] = 'Dosya Hatasý: Dosya açýlamýyor: ';
|
||||
$PHPMAILER_LANG['from_failed'] = 'Baþarýsýz olan gönderici adresi: ';
|
||||
$PHPMAILER_LANG['instantiate'] = 'Örnek mail fonksiyonu yaratýlamadý.';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = 'En az bir tane mail adresi belirtmek zorundasýnýz alýcýnýn email adresi.';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailler desteklenmemektedir.';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatasý: alýcýlara ulaþmadý: ';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Traditional Chinese Version
|
||||
* @author liqwei <liqwei@liqwei.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。';
|
||||
//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = '未知編碼: ';
|
||||
$PHPMAILER_LANG['file_access'] = '無法訪問文件:';
|
||||
$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:';
|
||||
$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:';
|
||||
$PHPMAILER_LANG['execute'] = '無法執行:';
|
||||
$PHPMAILER_LANG['instantiate'] = '未知函數調用。';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file: refer to English translation for definitive list
|
||||
* Simplified Chinese Version
|
||||
* @author liqwei <liqwei@liqwei.com>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
|
||||
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
|
||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
|
||||
//$P$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
||||
$PHPMAILER_LANG['encoding'] = '未知编码: ';
|
||||
$PHPMAILER_LANG['execute'] = '无法执行:';
|
||||
$PHPMAILER_LANG['file_access'] = '无法访问文件:';
|
||||
$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
|
||||
$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
|
||||
$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
|
||||
//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
||||
$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
|
||||
$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
|
||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
|
||||
//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
||||
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
||||
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
||||
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
||||
?>
|
||||
2320
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/phpmailer.class.php
Normal file
2320
tags/zentaopms_0.3_beta_20100103/lib/phpmailer/phpmailer.class.php
Normal file
File diff suppressed because it is too large
Load Diff
83
tags/zentaopms_0.3_beta_20100103/module/action/model.php
Normal file
83
tags/zentaopms_0.3_beta_20100103/module/action/model.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of action module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package action
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class actionModel extends model
|
||||
{
|
||||
/* 创建一条action动作。*/
|
||||
public function create($objectType, $objectID, $action, $comment = '')
|
||||
{
|
||||
$companyID = $this->app->company->id;
|
||||
$actor = $this->app->user->account;
|
||||
$actionDate = time();
|
||||
$sql = "INSERT INTO " . TABLE_ACTION . " VALUES('', '$companyID', '$objectType', '$objectID', '$actor', '$action', '$actionDate', '$comment')";
|
||||
$this->dbh->exec($sql);
|
||||
return $this->dbh->lastInsertID();
|
||||
}
|
||||
|
||||
/* 返回某一个对象的所有action列表。*/
|
||||
public function getList($objectType, $objectID)
|
||||
{
|
||||
$actions = array();
|
||||
$sql = "SELECT * FROM " . TABLE_ACTION . " WHERE objectType = '$objectType' AND objectID = '$objectID' AND company = '{$this->app->company->id}' ORDER BY ID";
|
||||
$stmt = $this->dbh->query($sql);
|
||||
while($action = $stmt->fetch())
|
||||
{
|
||||
$action->date = date('Y-m-d H:i:s', $action->date);
|
||||
$actions[$action->id] = $action;
|
||||
}
|
||||
|
||||
$histories = $this->getHistory(array_keys($actions));
|
||||
foreach($actions as $actionID => $action)
|
||||
{
|
||||
$action->history = isset($histories[$actionID]) ? $histories[$actionID] : array();
|
||||
$actions[$actionID] = $action;
|
||||
}
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/* 获得action信息。*/
|
||||
public function getById($actionID)
|
||||
{
|
||||
$action = $this->dao->findById((int)$actionID)->from(TABLE_ACTION)->fetch();
|
||||
$action->date = date('Y-m-d H:i:s', $action->date);
|
||||
return $action;
|
||||
}
|
||||
|
||||
/* 返回某一个action所对应的字段修改记录。*/
|
||||
public function getHistory($actionID)
|
||||
{
|
||||
return $this->dao->select()->from(TABLE_HISTORY)->where('action')->in($actionID)->orderBy('id')->fetchGroup('action');
|
||||
}
|
||||
|
||||
/* 记录历史。*/
|
||||
public function logHistory($actionID, $changes)
|
||||
{
|
||||
foreach($changes as $change)
|
||||
{
|
||||
$change['action'] = $actionID;
|
||||
$this->dao->insert(TABLE_HISTORY)->data($change)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
56
tags/zentaopms_0.3_beta_20100103/module/admin/control.php
Normal file
56
tags/zentaopms_0.3_beta_20100103/module/admin/control.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of admin module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class admin extends control
|
||||
{
|
||||
/* 构造函数,加载company, user, group模块。*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('company');
|
||||
$this->loadModel('user');
|
||||
$this->loadModel('group');
|
||||
}
|
||||
|
||||
/* 首页。*/
|
||||
public function index($tab = 'index')
|
||||
{
|
||||
$this->locate($this->createLink('admin', 'browseCompany'));
|
||||
}
|
||||
|
||||
/* 公司列表。*/
|
||||
public function browseCompany()
|
||||
{
|
||||
$header['title'] = $this->lang->admin->common . $this->lang->colon . $this->lang->company->browse;
|
||||
$position[] = $this->lang->admin->company;
|
||||
$position[] = $this->lang->company->browse;
|
||||
|
||||
$companies = $this->company->getList();
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('companies', $companies);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
33
tags/zentaopms_0.3_beta_20100103/module/admin/lang/zh-cn.php
Normal file
33
tags/zentaopms_0.3_beta_20100103/module/admin/lang/zh-cn.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* The admin module zh-cn file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang->admin->common = '后台';
|
||||
$lang->admin->index = '后台管理首页';
|
||||
$lang->admin->company = '公司管理';
|
||||
$lang->admin->user = '用户管理';
|
||||
$lang->admin->group = '分组管理';
|
||||
$lang->admin->welcome = '欢迎使用禅道管理软件后台管理系统';
|
||||
|
||||
$lang->admin->browseCompany = '浏览公司';
|
||||
$lang->admin->browseUser = '浏览用户';
|
||||
$lang->admin->browseGroup = '浏览分组';
|
||||
44
tags/zentaopms_0.3_beta_20100103/module/admin/model.php
Normal file
44
tags/zentaopms_0.3_beta_20100103/module/admin/model.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of admin module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class adminModel extends model
|
||||
{
|
||||
/* 获得整个pms系统的统计信息。*/
|
||||
public function getStatOfPMS()
|
||||
{
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
$tables = $this->dbh->query($sql)->fetchALL();
|
||||
}
|
||||
|
||||
/* 获得某一个公司的统计信息。*/
|
||||
public function getStatOfCompany($companyID)
|
||||
{
|
||||
}
|
||||
|
||||
/* 获得系统的运行信息。*/
|
||||
public function getStatOfSys()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse company view file of admin module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<table align='center' class='table-1'>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->company->id;?></th>
|
||||
<th><?php echo $lang->company->name;?></th>
|
||||
<th><?php echo $lang->company->phone;?></th>
|
||||
<th><?php echo $lang->company->fax;?></th>
|
||||
<th><?php echo $lang->company->address;?></th>
|
||||
<th><?php echo $lang->company->zipcode;?></th>
|
||||
<th><?php echo $lang->company->website;?></th>
|
||||
<th><?php echo $lang->company->backyard;?></th>
|
||||
<th><?php echo $lang->company->pms;?></th>
|
||||
<th><?php echo $lang->company->guest;?></th>
|
||||
<th><?php echo $lang->action;?></th>
|
||||
</tr>
|
||||
<?php foreach($companies as $company):?>
|
||||
<tr>
|
||||
<td class='a-center'><?php echo $company->id;?></td>
|
||||
<td><?php echo $company->name;?></td>
|
||||
<td><?php echo $company->phone;?></td>
|
||||
<td><?php echo $company->fax;?></td>
|
||||
<td><?php echo $company->address;?></td>
|
||||
<td><?php echo $company->zipcode;?></td>
|
||||
<td><?php echo html::a($company->website, $company->website, '_blank');?></td>
|
||||
<td><?php echo html::a($company->backyard,$company->backyard, '_blank');?></td>
|
||||
<td><?php echo html::a('http://' . $company->pms, $company->pms, '_blank');?></td>
|
||||
<td><?php echo $lang->company->guestList[(int)$company->guest];?></td>
|
||||
<td>
|
||||
<?php echo html::a($this->createLink('company', 'edit', "companyID=$company->id"), $this->lang->company->edit);?>
|
||||
<?php echo html::a($this->createLink('company', 'delete', "companyID=$company->id"), $this->lang->company->delete, "hiddenwin");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse group view file of admin module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div class="yui-d0 yui-t2">
|
||||
<div class="yui-b a-center">
|
||||
<?php include './menu.html.php';?>
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<table align='center' class='table-1'>
|
||||
<caption><?php echo $lang->group->browse;?></caption>
|
||||
<tr>
|
||||
<th><?php echo $lang->group->id;?></th>
|
||||
<th><?php echo $lang->group->name;?></th>
|
||||
<th><?php echo $lang->group->desc;?></th>
|
||||
<th><?php echo $lang->group->users;?></th>
|
||||
<th><?php echo $lang->action;?></th>
|
||||
</tr>
|
||||
<?php foreach($groups as $group):?>
|
||||
<tr>
|
||||
<td><?php echo $group->id;?></td>
|
||||
<td><?php echo $group->name;?></td>
|
||||
<td><?php echo $group->desc;?></td>
|
||||
<td>
|
||||
<?php
|
||||
foreach($groupUsers[$group->id] as $user)
|
||||
{
|
||||
echo $user . ' ';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><nobr>
|
||||
<?php echo html::a($this->createLink('group', 'edit', "groupID=$group->id"), $lang->group->edit);?>
|
||||
<?php echo html::a($this->createLink('group', 'managepriv', "groupID=$group->id"), $lang->group->managePriv);?>
|
||||
<?php echo html::a($this->createLink('group', 'managemember', "groupID=$group->id"), $lang->group->manageMember);?>
|
||||
<?php echo html::a($this->createLink('group', 'delete', "groupID=$group->id"), $lang->group->delete, "hiddenwin");?>
|
||||
</nobr>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<div class='a-right'><?php echo html::a($this->createLink('group', 'create'), $lang->group->create);?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse user view file of admin module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div class="yui-d0 yui-t2">
|
||||
<div class="yui-b a-center">
|
||||
<?php include './menu.html.php';?>
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<table align='center' class='table-1'>
|
||||
<caption><?php echo $lang->user->browse;?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->user->id;?></th>
|
||||
<th><?php echo $lang->user->account;?></th>
|
||||
<th><?php echo $lang->user->realname;?></th>
|
||||
<th><?php echo $lang->user->nickname;?></th>
|
||||
<th><?php echo $lang->user->email;?></th>
|
||||
<th><?php echo $lang->user->gendar;?></th>
|
||||
<th><?php echo $lang->user->phone;?></th>
|
||||
<th><?php echo $lang->user->join;?></th>
|
||||
<th><?php echo $lang->user->visits;?></th>
|
||||
<th><?php echo $lang->action;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($users as $user):?>
|
||||
<tr>
|
||||
<td class='a-right'><?php echo $user->id;?></td>
|
||||
<td><?php echo $user->realname;?></td>
|
||||
<td><?php if(common::hasPriv('user', 'view')) echo html::a($this->createLink('user', 'view', "account=$user->account"), $user->account); else echo $user->account;?></td>
|
||||
<td><?php echo $user->nickname;?></td>
|
||||
<td><?php echo html::mailto($user->email);?></td>
|
||||
<td class='a-center'><?php if(isset($lang->user->gendarList->{$user->gendar})) echo $lang->user->gendarList->{$user->gendar};?></td>
|
||||
<td><?php echo $user->phone;?></td>
|
||||
<td class='a-center'><?php echo $user->join;?></td>
|
||||
<td><?php echo $user->visits;?></td>
|
||||
<td>
|
||||
<?php if(common::hasPriv('user', 'edit')) echo html::a($this->createLink('user', 'edit', "userID=$user->id&from=company"), $lang->user->edit);?>
|
||||
<?php if(common::hasPriv('user', 'delete')) echo html::a($this->createLink('user', 'delete', "userID=$user->id"), $lang->user->delete, "hiddenwin");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='a-right'><?php if(common::hasPriv('user', 'create')) echo html::a($this->createLink('user', 'create'), $lang->user->create);?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* The index view file of admin module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package admin
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div class="yui-d0 yui-t2">
|
||||
<div class="yui-b a-center">
|
||||
<?php include './menu.html.php';?>
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<table align='center' class='table-1'>
|
||||
<caption><?php echo $lang->admin->welcome;?></caption>
|
||||
<tr>
|
||||
<td><?php echo $lang->admin->welcome;?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php $companyVar = "companyID={$app->company->id}";?>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->admin->company;?></caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo html::a($this->createLink('admin', 'browsecompany'), $lang->company->browse);?><br />
|
||||
<?php echo html::a($this->createLink('company', 'create'), $lang->company->create);?><br />
|
||||
<?php echo html::a($this->createLink('company', 'edit', $companyVar ), $lang->company->edit);?> <br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->admin->user;?></caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo html::a($this->createLink('admin', 'browseuser', $companyVar), $lang->user->browse);?><br />
|
||||
<?php echo html::a($this->createLink('user', 'create', $companyVar), $lang->user->create);?><br />
|
||||
</td>
|
||||
</tr>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->admin->group;?></caption>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo html::a($this->createLink('admin', 'browsegroup', $companyVar), $lang->group->browse);?><br />
|
||||
<?php echo html::a($this->createLink('group', 'create', $companyVar), $lang->group->create);?><br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
37
tags/zentaopms_0.3_beta_20100103/module/bug/config.php
Normal file
37
tags/zentaopms_0.3_beta_20100103/module/bug/config.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
global $lang;
|
||||
$config->bug->search['module'] = 'bug';
|
||||
$config->bug->search['fields']['id'] = $lang->bug->id;
|
||||
$config->bug->search['fields']['title'] = $lang->bug->title;
|
||||
$config->bug->search['fields']['product'] = $lang->bug->product;
|
||||
$config->bug->search['fields']['assignedTo'] = $lang->bug->assignedTo;
|
||||
$config->bug->search['fields']['resolvedBy'] = $lang->bug->resolvedBy;
|
||||
$config->bug->search['fields']['openedBy'] = $lang->bug->openedBy;
|
||||
$config->bug->search['fields']['closedBy'] = $lang->bug->closedBy;
|
||||
$config->bug->search['fields']['lastEditedBy'] = $lang->bug->lastEditedBy;
|
||||
$config->bug->search['fields']['status'] = $lang->bug->status;
|
||||
$config->bug->search['fields']['severity'] = $lang->bug->severity;
|
||||
$config->bug->search['fields']['type'] = $lang->bug->type;
|
||||
$config->bug->search['fields']['os'] = $lang->bug->os;
|
||||
$config->bug->search['fields']['browser'] = $lang->bug->browser;
|
||||
$config->bug->search['fields']['resolution'] = $lang->bug->resolution;
|
||||
$config->bug->search['fields']['mailto'] = $lang->bug->mailto;
|
||||
$config->bug->search['fields']['openedDate'] = $lang->bug->openedDate;
|
||||
$config->bug->search['fields']['assignedDate'] = $lang->bug->assignedDate;
|
||||
$config->bug->search['fields']['closedDate'] = $lang->bug->closedDate;
|
||||
$config->bug->search['fields']['lastEditedDate'] = $lang->bug->lastEditedDate;
|
||||
|
||||
$config->bug->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
$config->bug->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => 'products');
|
||||
$config->bug->search['params']['assignedTo'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->bug->search['params']['resolvedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->bug->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->bug->search['params']['closedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->bug->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
|
||||
$config->bug->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->statusList);
|
||||
$config->bug->search['params']['severity'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->severityList);
|
||||
$config->bug->search['params']['type'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->typeList);
|
||||
$config->bug->search['params']['os'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->osList);
|
||||
$config->bug->search['params']['browser'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->browserList);
|
||||
$config->bug->search['params']['resolution'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->resolutionList);
|
||||
$config->bug->search['params']['mailto'] = array('operator' => 'include', 'control' => 'select', 'values' => 'users');
|
||||
395
tags/zentaopms_0.3_beta_20100103/module/bug/control.php
Normal file
395
tags/zentaopms_0.3_beta_20100103/module/bug/control.php
Normal file
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of bug currentModule of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class bug extends control
|
||||
{
|
||||
private $products = array();
|
||||
|
||||
/* 构造函数,加载story, release, tree等模块。*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('tree');
|
||||
$this->loadModel('user');
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('story');
|
||||
$this->loadModel('task');
|
||||
$this->products = $this->product->getPairs();
|
||||
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
|
||||
$this->assign('products', $this->products);
|
||||
}
|
||||
|
||||
/* bug首页。*/
|
||||
public function index()
|
||||
{
|
||||
$this->locate($this->createLink('bug', 'browse'));
|
||||
}
|
||||
|
||||
/* 浏览一个产品下面的bug。*/
|
||||
public function browse($productID = 0, $type = 'byModule', $param = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&type=byQuery");
|
||||
$this->assign('searchForm', $this->fetch('search', 'buildForm', $this->config->bug->search));
|
||||
|
||||
$type = strtolower($type);
|
||||
$this->session->set('bugList', $this->app->getURI(true));
|
||||
|
||||
$productID = common::saveProductState($productID, key($this->products));
|
||||
$moduleID = ($type == 'bymodule') ? (int)$param : 0;
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$bugs = array();
|
||||
if($type == 'all')
|
||||
{
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq($productID)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == "bymodule")
|
||||
{
|
||||
$childModuleIds = $this->tree->getAllChildId($moduleID);
|
||||
$bugs = $this->bug->getModuleBugs($productID, $childModuleIds, $orderBy, $pager);
|
||||
}
|
||||
elseif($type == 'assigntome')
|
||||
{
|
||||
$bugs = $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'openedbyme')
|
||||
{
|
||||
$bugs = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'resolvedbyme')
|
||||
{
|
||||
$bugs = $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'assigntonull')
|
||||
{
|
||||
$bugs = $this->dao->findByAssignedTo('')->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'longlifebugs')
|
||||
{
|
||||
$bugs = $this->dao->findByLastEditedDate("<", date('Y-m-d', strtotime('-7 days')))->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'postponedbugs')
|
||||
{
|
||||
$bugs = $this->dao->findByResolution('postponed')->from(TABLE_BUG)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
elseif($type == 'byquery')
|
||||
{
|
||||
if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1');
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where($this->session->bugQuery)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
$users = $this->user->getPairs($this->app->company->id, 'noletter');
|
||||
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$position[] = $this->lang->bug->common;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('productID', $productID);
|
||||
$this->assign('productName', $this->products[$productID]);
|
||||
$this->assign('moduleTree', $this->tree->getTreeMenu($productID, $viewType = 'bug', $rooteModuleID = 0, array('treeModel', 'createBugLink')));
|
||||
$this->assign('type', $type);
|
||||
$this->assign('bugs', $bugs);
|
||||
$this->assign('users', $users);
|
||||
$this->assign('recTotal', $pager->recTotal);
|
||||
$this->assign('recPerPage', $pager->recPerPage);
|
||||
$this->assign('pager', $pager->get());
|
||||
$this->assign('param', $param);
|
||||
$this->assign('orderBy', $orderBy);
|
||||
$this->assign('moduleID', $moduleID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 创建Bug。*/
|
||||
public function create($productID, $moduleID = 0)
|
||||
{
|
||||
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$bugID = $this->bug->create();
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('bug', $bugID, 'Opened');
|
||||
$this->sendmail($bugID, $actionID);
|
||||
die(js::locate($this->createLink('bug', 'browse', "productID={$this->post->product}&type=byModule¶m={$this->post->module}"), 'parent'));
|
||||
}
|
||||
|
||||
$productID = common::saveProductState($productID, key($this->products));
|
||||
$currentModuleID = (int)$moduleID;
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->create;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$position[] = $this->lang->bug->create;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('productID', $productID);
|
||||
$this->assign('productName', $this->products[$productID]);
|
||||
$this->assign('moduleOptionMenu', $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0));
|
||||
$this->assign('currentModuleID', $currentModuleID);
|
||||
$this->assign('stories', $this->story->getProductStoryPairs($productID));
|
||||
$this->assign('users', $this->user->getPairs($this->app->company->id, 'noclosed'));
|
||||
$this->assign('projects', $this->product->getProjectPairs($productID));
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 查看一个bug。*/
|
||||
public function view($bugID)
|
||||
{
|
||||
$bug = $this->bug->getById($bugID);
|
||||
$productID = $bug->product;
|
||||
$productName = $this->products[$productID];
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->view;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName);
|
||||
$position[] = $this->lang->bug->view;
|
||||
|
||||
$users = $this->user->getPairs($this->app->company->id, 'noletter');
|
||||
$actions = $this->action->getList('bug', $bugID);
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('productName', $productName);
|
||||
$this->assign('modulePath', $this->tree->getParents($bug->module));
|
||||
$this->assign('bug', $bug);
|
||||
$this->assign('users', $users);
|
||||
$this->assign('actions', $actions);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 编辑一个Bug。*/
|
||||
public function edit($bugID)
|
||||
{
|
||||
/* 更新bug信息。*/
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->bug->update($bugID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->loadModel('file');
|
||||
$files = $this->file->saveUpload('files', 'bug', $bugID);
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = "Add Files " . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('bug', $bugID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($bugID, $actionID);
|
||||
}
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
/* 生成表单。*/
|
||||
$bug = $this->bug->getById($bugID);
|
||||
$productID = $bug->product;
|
||||
$currentModuleID = $bug->module;
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->edit;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$position[] = $this->lang->bug->edit;
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$projects = $this->product->getProjectPairs($bug->product);
|
||||
$stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product);
|
||||
$tasks = $this->task->getProjectTaskPairs($bug->project);
|
||||
|
||||
$users = $this->user->getPairs($this->app->company->id);
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('productID', $productID);
|
||||
$this->assign('productName', $this->products[$productID]);
|
||||
$this->assign('moduleOptionMenu', $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0));
|
||||
$this->assign('currentModuleID', $currentModuleID);
|
||||
$this->assign('users', $users);
|
||||
|
||||
$this->assign('projects', $projects);
|
||||
$this->assign('stories', $stories);
|
||||
$this->assign('tasks', $tasks);
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('bug', $bug);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 解决bug。*/
|
||||
public function resolve($bugID)
|
||||
{
|
||||
/* 更新bug信息。*/
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->bug->resolve($bugID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('bug', $bugID, 'Resolved', $this->post->comment);
|
||||
$this->sendmail($bugID, $actionID);
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
/* 生成表单。*/
|
||||
$bug = $this->bug->getById($bugID);
|
||||
$productID = $bug->product;
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$position[] = $this->lang->bug->resolve;
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$users = $this->user->getPairs($this->app->company->id);
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('bug', $bug);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 激活bug。*/
|
||||
public function activate($bugID)
|
||||
{
|
||||
/* 更新bug信息。*/
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->bug->activate($bugID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->loadModel('file');
|
||||
$files = $this->file->saveUpload('files', 'bug', $bugID);
|
||||
$actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment);
|
||||
$this->sendmail($bugID, $actionID);
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
/* 生成表单。*/
|
||||
$bug = $this->bug->getById($bugID);
|
||||
$productID = $bug->product;
|
||||
$users = $this->user->getPairs($this->app->company->id);
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$position[] = $this->lang->bug->activate;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('bug', $bug);
|
||||
$this->assign('users', $users);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 激活bug。*/
|
||||
public function close($bugID)
|
||||
{
|
||||
/* 更新bug信息。*/
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->bug->close($bugID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment);
|
||||
$this->sendmail($bugID, $actionID);
|
||||
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
|
||||
}
|
||||
|
||||
/* 生成表单。*/
|
||||
$bug = $this->bug->getById($bugID);
|
||||
$productID = $bug->product;
|
||||
|
||||
/* 设置菜单。*/
|
||||
$this->bug->setMenu($this->products, $productID);
|
||||
|
||||
$header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate;
|
||||
$position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$position[] = $this->lang->bug->activate;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('bug', $bug);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 获得用户的bug列表。*/
|
||||
public function ajaxGetUserBugs($account = '')
|
||||
{
|
||||
if($account == '') $account = $this->app->user->account;
|
||||
$bugs = $this->bug->getUserBugPairs($account);
|
||||
die(html::select('bug', $bugs, '', 'class=select-1'));
|
||||
}
|
||||
|
||||
/* 发送变量。*/
|
||||
private function sendmail($bugID, $actionID)
|
||||
{
|
||||
/* 设定toList和ccList。*/
|
||||
$bug = $this->bug->getByID($bugID);
|
||||
$toList = $bug->assignedTo;
|
||||
$ccList = trim($bug->mailto, ',');
|
||||
if($toList == '')
|
||||
{
|
||||
if($ccList == '') return;
|
||||
if(strpos($ccList, ',') === false)
|
||||
{
|
||||
$toList = $ccList;
|
||||
$ccList = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$commaPos = strpos($ccList, ',');
|
||||
$toList = substr($ccList, 0, $commaPos);
|
||||
$ccList = substr($ccList, $commaPos + 1);
|
||||
}
|
||||
}
|
||||
elseif(strtolower($toList) == 'closed')
|
||||
{
|
||||
$toList = $bug->resolvedBy;
|
||||
}
|
||||
|
||||
/* 获得action信息。*/
|
||||
$action = $this->action->getById($actionID);
|
||||
$histories = $this->action->getHistory($actionID);
|
||||
if(strtolower($action->action) == 'opened') $action->comment = $bug->steps;
|
||||
|
||||
/* 赋值,获得邮件内容。*/
|
||||
$this->assign('bug', $bug);
|
||||
$this->assign('action', $action);
|
||||
$this->assign('histories', $histories);
|
||||
$mailContent = $this->fetch($this->moduleName, 'sendmail');
|
||||
|
||||
/* 发信。*/
|
||||
$this->loadModel('mail')->send($toList, 'BUG #' . $bug->id . $this->lang->colon . $bug->title, $mailContent, $ccList);
|
||||
if($this->mail->isError()) echo js::error($this->mail->getError());
|
||||
}
|
||||
}
|
||||
63
tags/zentaopms_0.3_beta_20100103/module/bug/lang/en.php
Normal file
63
tags/zentaopms_0.3_beta_20100103/module/bug/lang/en.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* The bug module en file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang['page']['common'] = 'bug';
|
||||
$lang['page']['index'] = "{$lang['page']['common']}/index";
|
||||
$lang['page']['create'] = "{$lang['page']['common']}/create";
|
||||
$lang['page']['read'] = "{$lang['page']['common']}/read";
|
||||
$lang['page']['update'] = "{$lang['page']['common']}/update";
|
||||
$lang['page']['delete'] = "{$lang['page']['common']}/delete";
|
||||
$lang['bug']['id'] = 'id';
|
||||
$lang['bug']['product'] = 'product';
|
||||
$lang['bug']['module'] = 'module';
|
||||
$lang['bug']['path'] = 'path';
|
||||
$lang['bug']['project'] = 'project';
|
||||
$lang['bug']['sprint'] = 'sprint';
|
||||
$lang['bug']['story'] = 'story';
|
||||
$lang['bug']['task'] = 'task';
|
||||
$lang['bug']['title'] = 'title';
|
||||
$lang['bug']['severity'] = 'severity';
|
||||
$lang['bug']['type'] = 'type';
|
||||
$lang['bug']['os'] = 'os';
|
||||
$lang['bug']['browser'] = 'browser';
|
||||
$lang['bug']['machine'] = 'machine';
|
||||
$lang['bug']['found'] = 'found';
|
||||
$lang['bug']['steps'] = 'steps';
|
||||
$lang['bug']['status'] = 'status';
|
||||
$lang['bug']['mailto'] = 'mailto';
|
||||
$lang['bug']['openedBy'] = 'openedBy';
|
||||
$lang['bug']['openedDate'] = 'openedDate';
|
||||
$lang['bug']['openedBuild'] = 'openedBuild';
|
||||
$lang['bug']['assignedTo'] = 'assignedTo';
|
||||
$lang['bug']['assignedDate'] = 'assignedDate';
|
||||
$lang['bug']['resolvedBy'] = 'resolvedBy';
|
||||
$lang['bug']['resolution'] = 'resolution';
|
||||
$lang['bug']['resolvedBuild'] = 'resolvedBuild';
|
||||
$lang['bug']['resolvedDate'] = 'resolvedDate';
|
||||
$lang['bug']['closedBy'] = 'closedBy';
|
||||
$lang['bug']['closedDate'] = 'closedDate';
|
||||
$lang['bug']['lastEditedBy'] = 'lastEditedBy';
|
||||
$lang['bug']['lastEditedDate'] = 'lastEditedDate';
|
||||
$lang['bug']['field1'] = 'field1';
|
||||
$lang['bug']['field2'] = 'field2';
|
||||
$lang['bug']['feild3'] = 'feild3';
|
||||
162
tags/zentaopms_0.3_beta_20100103/module/bug/lang/zh-cn.php
Normal file
162
tags/zentaopms_0.3_beta_20100103/module/bug/lang/zh-cn.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**
|
||||
* The bug module zh-cn file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang->bug->common = '缺陷管理';
|
||||
$lang->bug->index = '首页';
|
||||
$lang->bug->create = '创建Bug';
|
||||
$lang->bug->edit = '编辑Bug';
|
||||
$lang->bug->browse = 'Bug列表';
|
||||
$lang->bug->view = 'Bug详情';
|
||||
$lang->bug->resolve = '解决Bug';
|
||||
$lang->bug->close = '关闭Bug';
|
||||
$lang->bug->activate = '激活Bug';
|
||||
$lang->bug->ajaxGetUserBugs = 'ajax:我的Bug';
|
||||
|
||||
$lang->bug->selectProduct = '请选择产品';
|
||||
$lang->bug->byModule = '按模块';
|
||||
$lang->bug->assignToMe = '指派给我';
|
||||
$lang->bug->openedByMe = '由我创建';
|
||||
$lang->bug->resolvedByMe = '由我解决';
|
||||
$lang->bug->assignToNull = '未指派';
|
||||
$lang->bug->longLifeBugs = '久未处理';
|
||||
$lang->bug->postponedBugs = '被延期';
|
||||
$lang->bug->allBugs = '所有Bug';
|
||||
$lang->bug->moduleBugs = '按模块浏览';
|
||||
$lang->bug->byQuery = '搜索';
|
||||
|
||||
$lang->bug->labProductAndModule = '产品模块';
|
||||
$lang->bug->labProjectAndTask = '项目任务';
|
||||
$lang->bug->labStory = '相关需求';
|
||||
$lang->bug->labBuild = '程序编译版本';
|
||||
$lang->bug->labTypeAndSeverity = '类型/严重程度';
|
||||
$lang->bug->labSystemBrowserAndHardware = '系统/浏览器';
|
||||
$lang->bug->labAssignedTo = '当前指派';
|
||||
$lang->bug->labMailto = '抄送给';
|
||||
$lang->bug->labLastEdited = '最后修改';
|
||||
$lang->bug->labResolved = '由谁解决';
|
||||
|
||||
$lang->bug->confirmChangeProduct = '修改产品会导致相应的项目、需求和任务发生变化,确定吗?';
|
||||
|
||||
$lang->bug->legendRelated = '相关信息';
|
||||
$lang->bug->legendBasicInfo = '基本信息';
|
||||
$lang->bug->legendMailto = '抄送给';
|
||||
$lang->bug->legendAttatch = '附件';
|
||||
$lang->bug->legendLinkBugs = '相关Bug';
|
||||
$lang->bug->legendOpenInfo = '创建信息';
|
||||
$lang->bug->legendResolveInfo = '解决信息';
|
||||
$lang->bug->legendCloseInfo = '关闭信息';
|
||||
$lang->bug->legendPrjStoryTask= '项目/需求/任务';
|
||||
$lang->bug->legendCases = '相关用例';
|
||||
$lang->bug->legendSteps = '重现步骤';
|
||||
$lang->bug->legendAction = '操作';
|
||||
$lang->bug->legendHistory = '历史记录';
|
||||
$lang->bug->legendComment = '备注';
|
||||
$lang->bug->legendLife = 'BUG的一生';
|
||||
|
||||
$lang->bug->buttonEdit = '编辑';
|
||||
$lang->bug->buttonActivate = '激活';
|
||||
$lang->bug->buttonResolve = '解决';
|
||||
$lang->bug->buttonClose = '关闭';
|
||||
$lang->bug->buttonToList = '返回';
|
||||
|
||||
$lang->bug->severityList[3] = 3;
|
||||
$lang->bug->severityList[1] = 1;
|
||||
$lang->bug->severityList[2] = 2;
|
||||
$lang->bug->severityList[4] = 4;
|
||||
|
||||
/* Define the OS list. */
|
||||
$lang->bug->osList->all = '全部';
|
||||
$lang->bug->osList->winxp = 'Windows XP';
|
||||
$lang->bug->osList->win2000 = 'Windows 2000';
|
||||
$lang->bug->osList->winnt = 'Windows NT';
|
||||
$lang->bug->osList->win98 = 'Windows 98';
|
||||
$lang->bug->osList->linux = 'Linux';
|
||||
$lang->bug->osList->unix = 'Unix';
|
||||
$lang->bug->osList->others = '其他';
|
||||
|
||||
/* Define the OS list. */
|
||||
$lang->bug->browserList->all = '全部';
|
||||
$lang->bug->browserList->ie6 = 'IE6';
|
||||
$lang->bug->browserList->ie7 = 'IE7';
|
||||
$lang->bug->browserList->ie8 = 'IE8';
|
||||
$lang->bug->browserList->firefox2 = 'firefox2';
|
||||
$lang->bug->browserList->firefx3 = 'firefox3';
|
||||
$lang->bug->browserList->opera9 = 'opera9';
|
||||
$lang->bug->browserList->oprea10 = '其他';
|
||||
|
||||
/* Define the types. */
|
||||
$lang->bug->typeList[''] = '';
|
||||
$lang->bug->typeList['codeerror'] = '代码错误';
|
||||
$lang->bug->typeList['interface'] = '界面优化';
|
||||
$lang->bug->typeList['designchange'] = '设计变更';
|
||||
$lang->bug->typeList['Others'] = '其他';
|
||||
|
||||
$lang->bug->statusList[''] = '';
|
||||
$lang->bug->statusList['active'] = 'active';
|
||||
$lang->bug->statusList['resolved'] = 'resolved';
|
||||
$lang->bug->statusList['closed'] = 'closed';
|
||||
|
||||
$lang->bug->resolutionList[''] = '';
|
||||
$lang->bug->resolutionList['bydesign'] = '设计如此';
|
||||
$lang->bug->resolutionList['duplicate'] = '重复Bug';
|
||||
$lang->bug->resolutionList['external'] = '外部原因';
|
||||
$lang->bug->resolutionList['fixed'] = '已解决';
|
||||
$lang->bug->resolutionList['notrepro'] = '无法重现';
|
||||
$lang->bug->resolutionList['postponed'] = '延期处理';
|
||||
$lang->bug->resolutionList['willnotfix'] = "不予解决";
|
||||
|
||||
$lang->bug->id = 'Bug编号';
|
||||
$lang->bug->product = '所属产品';
|
||||
$lang->bug->module = '所属模块';
|
||||
$lang->bug->path = '模块路径';
|
||||
$lang->bug->project = '所属项目';
|
||||
$lang->bug->story = '相关需求';
|
||||
$lang->bug->task = '相关任务';
|
||||
$lang->bug->title = 'Bug标题';
|
||||
$lang->bug->severity = '严重程度';
|
||||
$lang->bug->type = 'Bug类型';
|
||||
$lang->bug->os = '操作系统';
|
||||
$lang->bug->browser = '浏览器';
|
||||
$lang->bug->machine = '机器硬件';
|
||||
$lang->bug->found = '如何发现';
|
||||
$lang->bug->steps = '重现步骤';
|
||||
$lang->bug->status = 'Bug状态';
|
||||
$lang->bug->mailto = '抄送给';
|
||||
$lang->bug->openedBy = '由谁创建';
|
||||
$lang->bug->openedDate = '创建日期';
|
||||
$lang->bug->openedBuild = '创建版本';
|
||||
$lang->bug->assignedTo = '指派给';
|
||||
$lang->bug->assignedDate = '指派日期';
|
||||
$lang->bug->resolvedBy = '解决者';
|
||||
$lang->bug->resolution = '解决方案';
|
||||
$lang->bug->resolvedBuild = '解决版本';
|
||||
$lang->bug->resolvedDate = '解决日期';
|
||||
$lang->bug->closedBy = '由谁关闭';
|
||||
$lang->bug->closedDate = '关闭日期';
|
||||
$lang->bug->duplicateBug = '重复Bug';
|
||||
$lang->bug->lastEditedBy = '最后修改者';
|
||||
$lang->bug->lastEditedDate = '最后修改日期';
|
||||
$lang->bug->files = '附件';
|
||||
$lang->bug->field1 = 'field1';
|
||||
$lang->bug->field2 = 'field2';
|
||||
$lang->bug->feild3 = 'feild3';
|
||||
245
tags/zentaopms_0.3_beta_20100103/module/bug/model.php
Normal file
245
tags/zentaopms_0.3_beta_20100103/module/bug/model.php
Normal file
@@ -0,0 +1,245 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class bugModel extends model
|
||||
{
|
||||
/* 设置菜单。*/
|
||||
public function setMenu($products, $productID)
|
||||
{
|
||||
$selectHtml = html::select('productID', $products, $productID, "onchange=\"switchProduct(this.value, 'bug');\"");
|
||||
common::setMenuVars($this->lang->bug->menu, 'product', $selectHtml . $this->lang->arrow);
|
||||
common::setMenuVars($this->lang->bug->menu, 'bug', $productID);
|
||||
common::setMenuVars($this->lang->bug->menu, 'testcase', $productID);
|
||||
}
|
||||
|
||||
/* 创建一个Bug。*/
|
||||
public function create()
|
||||
{
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$bug = fixer::input('post')
|
||||
->add('openedBy', $this->app->user->account)
|
||||
->add('openedDate', $now)
|
||||
->setDefault('project,story,task', 0)
|
||||
->setIF($this->post->assignedTo != '', 'assignedDate', $now)
|
||||
->stripTags('title')
|
||||
->cleanInt('product, module, severity')
|
||||
->specialChars('steps')
|
||||
->join('mailto', ',')
|
||||
->get();
|
||||
$this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck('title,type', 'notempty')->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$bugID = $this->dao->lastInsertID();
|
||||
$this->loadModel('file');
|
||||
$this->file->saveUpload('files', 'bug', $bugID);
|
||||
return $bugID;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 获得某一个产品,某一个模块下面的所有bug。*/
|
||||
public function getModuleBugs($productID, $moduleIds = 0, $orderBy = 'id|desc', $pager = null)
|
||||
{
|
||||
$sql = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq((int)$productID);
|
||||
if(!empty($moduleIds)) $sql->andWhere('module')->in($moduleIds);
|
||||
return $sql->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
/* 获取一个bug的详细信息。*/
|
||||
public function getById($bugID)
|
||||
{
|
||||
$bug = $this->dao->select('t1.*, t2.name AS projectName, t3.title AS storyTitle, t4.name AS taskName')
|
||||
->from(TABLE_BUG)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')
|
||||
->leftJoin(TABLE_TASK)->alias('t4')->on('t1.task = t4.id')
|
||||
->where('t1.id')->eq((int)$bugID)->fetch();
|
||||
foreach($bug as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $bug->$key = '';
|
||||
$bug->mailto = ltrim(trim($bug->mailto), ',');
|
||||
if($bug->duplicateBug) $bug->duplicateBugTitle = $this->dao->findById($bug->duplicateBug)->from(TABLE_BUG)->fields('title')->fetch('title');
|
||||
|
||||
$this->loadModel('file');
|
||||
$bug->files = $this->file->getByObject('bug', $bugID);
|
||||
return $bug;
|
||||
}
|
||||
|
||||
/* 更新bug信息。*/
|
||||
public function update($bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$bug = fixer::input('post')
|
||||
->cleanInt('product,module,severity,project,story,task')
|
||||
->stripTags('title')
|
||||
->specialChars('steps')
|
||||
->remove('comment')
|
||||
->setDefault('project,module,project,story,task,duplicateBug', 0)
|
||||
->add('lastEditedBy', $this->app->user->account)
|
||||
->add('lastEditedDate', $now)
|
||||
->setIF($this->post->assignedTo != $oldBug->assignedTo, 'assignedDate', $now)
|
||||
->setIF($this->post->resolvedBy != '' and $this->post->resolvedDate == '', 'resolvedDate', $now)
|
||||
->setIF($this->post->resolution != '' and $this->post->resolvedDate == '', 'resolvedDate', $now)
|
||||
->setIF($this->post->resolution != '' and $this->post->resolvedBy == '', 'resolvedBy', $this->app->user->account)
|
||||
->setIF($this->post->closedBy != '' and $this->post->closedDate == '', 'closedDate', $now)
|
||||
->setIF($this->post->closedDate != '' and $this->post->closedBy == '', 'closedBy', $this->app->user->account)
|
||||
->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'assignedTo', 'closed')
|
||||
->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'assignedDate', $now)
|
||||
->setIF($this->post->resolution != '' or $this->post->resolvedDate != '', 'status', 'resolved')
|
||||
->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'status', 'closed')
|
||||
->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedTo', $oldBug->openedBy)
|
||||
->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedDate', $now)
|
||||
->setIF($this->post->resolution == '' and $this->post->resolvedDate =='', 'status', 'active')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)
|
||||
->autoCheck()
|
||||
->batchCheck('title,type', 'notempty')
|
||||
->checkIF($bug->resolvedBy, 'resolution', 'notempty')
|
||||
->checkIF($bug->closedBy, 'resolution', 'notempty')
|
||||
->checkIF($bug->resolution == 'duplicate', 'duplicateBug', 'notempty')
|
||||
->where('id')->eq((int)$bugID)
|
||||
->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldBug, $bug);
|
||||
}
|
||||
|
||||
/* 解决Bug。*/
|
||||
public function resolve($bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$bug = fixer::input('post')
|
||||
->add('resolvedBy', $this->app->user->account)
|
||||
->add('resolvedDate', $now)
|
||||
->add('status', 'resolved')
|
||||
->add('assignedTo', $oldBug->openedBy)
|
||||
->add('assignedDate', $now)
|
||||
->add('lastEditedBy', $this->app->user->account)
|
||||
->add('lastEditedDate', $now)
|
||||
->setDefault('duplicateBug', 0)
|
||||
->remove('comment')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)
|
||||
->autoCheck()
|
||||
->check('resolution', 'notempty')
|
||||
->checkIF($bug->resolution == 'duplicate', 'duplicateBug', 'notempty')
|
||||
->where('id')->eq((int)$bugID)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/* 激活Bug。*/
|
||||
public function activate($bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$bug = fixer::input('post')
|
||||
->add('assignedTo', $oldBug->resolvedBy)
|
||||
->add('assignedDate', $now)
|
||||
->add('resolution', '')
|
||||
->add('status', 'active')
|
||||
->add('resolvedDate', '0000-00-00')
|
||||
->add('resolvedBy', '')
|
||||
->add('resolvedBuild', '')
|
||||
->add('closedBy', '')
|
||||
->add('closedDate', '0000-00-00')
|
||||
->add('duplicateBug', 0)
|
||||
->add('lastEditedBy', $this->app->user->account)
|
||||
->add('lastEditedDate', $now)
|
||||
->remove('comment')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec();
|
||||
}
|
||||
|
||||
/* 关闭Bug。*/
|
||||
public function close($bugID)
|
||||
{
|
||||
$oldBug = $this->getById($bugID);
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$bug = fixer::input('post')
|
||||
->add('assignedTo', 'closed')
|
||||
->add('assignedDate', $now)
|
||||
->add('status', 'closed')
|
||||
->add('closedBy', $this->app->user->account)
|
||||
->add('closedDate', $now)
|
||||
->add('lastEditedBy', $this->app->user->account)
|
||||
->add('lastEditedDate', $now)
|
||||
->remove('comment')
|
||||
->get();
|
||||
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec();
|
||||
}
|
||||
|
||||
/* 从bug列表中提取所有出现过的账户。*/
|
||||
public function extractAccountsFromList($bugs)
|
||||
{
|
||||
$accounts = array();
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
if(!empty($bug->openedBy)) $accounts[] = $bug->openedBy;
|
||||
if(!empty($bug->assignedTo)) $accounts[] = $bug->assignedTo;
|
||||
if(!empty($bug->resolvedBy)) $accounts[] = $bug->resolvedBy;
|
||||
if(!empty($bug->closedBy)) $accounts[] = $bug->closedBy;
|
||||
if(!empty($bug->lastEditedBy)) $accounts[] = $bug->lastEditedBy;
|
||||
}
|
||||
return array_unique($accounts);
|
||||
}
|
||||
|
||||
/* 从一条bug中提取所有出现过的账户。*/
|
||||
public function extractAccountsFromSingle($bug)
|
||||
{
|
||||
$accounts = array();
|
||||
if(!empty($bug->openedBy)) $accounts[] = $bug->openedBy;
|
||||
if(!empty($bug->assignedTo)) $accounts[] = $bug->assignedTo;
|
||||
if(!empty($bug->resolvedBy)) $accounts[] = $bug->resolvedBy;
|
||||
if(!empty($bug->closedBy)) $accounts[] = $bug->closedBy;
|
||||
if(!empty($bug->lastEditedBy)) $accounts[] = $bug->lastEditedBy;
|
||||
return array_unique($accounts);
|
||||
}
|
||||
|
||||
/* 获得用户的Bug id=>title列表。*/
|
||||
public function getUserBugPairs($account)
|
||||
{
|
||||
$bugs = array();
|
||||
$stmt = $this->dao->select('t1.id, t1.title, t2.name as product')
|
||||
->from(TABLE_BUG)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')
|
||||
->on('t1.product=t2.id')
|
||||
->where('t1.assignedTo')->eq($account)
|
||||
->query();
|
||||
while($bug = $stmt->fetch())
|
||||
{
|
||||
$bug->title = $bug->product . ' / ' . $bug->title;
|
||||
$bugs[$bug->id] = $bug->title;
|
||||
}
|
||||
return $bugs;
|
||||
}
|
||||
|
||||
/* 获得某个项目的bug列表。*/
|
||||
public function getProjectBugs($projectID, $orderBy = 'id|desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)->where('project')->eq((int)$projectID)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* The activate file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<div class='yui-d0'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $bug->title;?></caption>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->assignedTo;?></td>
|
||||
<td><?php echo html::select('assignedTo', $users, $bug->resolvedBy, 'class=select-3');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->comment;?></td>
|
||||
<td><textarea name='comment' rows='6' class='area-1'></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->files;?></th>
|
||||
<td class='a-left'>
|
||||
<input type='file' name='files[]' class='text-4' />
|
||||
<input type='file' name='files[]' class='text-4' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'>
|
||||
<?php echo html::submitButton();?>
|
||||
<input type='button' value='<?php echo $lang->bug->buttonToList;?>' class='button-s'
|
||||
onclick='location.href="<?php echo $this->session->bugList;?>"' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
119
tags/zentaopms_0.3_beta_20100103/module/bug/view/browse.html.php
Normal file
119
tags/zentaopms_0.3_beta_20100103/module/bug/view/browse.html.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/treeview.html.php';?>
|
||||
<?php include '../../common/colorize.html.php';?>
|
||||
<script language='Javascript'>
|
||||
/* 切换浏览方式。*/
|
||||
function browseByModule(active)
|
||||
{
|
||||
$('#mainbox').addClass('yui-t7');
|
||||
$('#treebox').removeClass('hidden');
|
||||
$('#bymoduletab').addClass('active');
|
||||
$('#querybox').addClass('hidden');
|
||||
$('#' + active + 'tab').removeClass('active');
|
||||
}
|
||||
function search(active)
|
||||
{
|
||||
$('#mainbox').removeClass('yui-t7');
|
||||
$('#treebox').addClass('hidden');
|
||||
$('#querybox').removeClass('hidden');
|
||||
$('#byquerytab').addClass('active');
|
||||
$('#' + active + 'tab').removeClass('active');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class='yui-d0'>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<?php
|
||||
echo "<span id='bymoduletab' onclick=\"browseByModule('$type')\">" . $lang->bug->moduleBugs . "</span> ";
|
||||
echo "<span id='assigntometab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToMe¶m=0"), $lang->bug->assignToMe) . "</span>";
|
||||
echo "<span id='openedbymetab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=openedByMe¶m=0"), $lang->bug->openedByMe) . "</span>";
|
||||
echo "<span id='resolvedbymetab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=resolvedByMe¶m=0"), $lang->bug->resolvedByMe) . "</span>";
|
||||
echo "<span id='assigntonulltab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToNull¶m=0"), $lang->bug->assignToNull) . "</span>";
|
||||
echo "<span id='longlifebugstab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . "</span>";
|
||||
echo "<span id='postponedbugstab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=postponedBugs¶m=0"), $lang->bug->postponedBugs) . "</span>";
|
||||
echo "<span id='byquerytab' onclick=\"search('$type')\">{$lang->bug->byQuery}</span> ";
|
||||
echo "<span id='alltab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&type=all¶m=0"), $lang->bug->allBugs) . "</span>";
|
||||
?>
|
||||
</div>
|
||||
<div class='f-right'>
|
||||
<?php common::printLink('bug', 'create', "productID=$productID&moduleID=$moduleID", $lang->bug->create); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($type !='byquery') echo 'hidden';?>'><?php echo $searchForm;?></div>
|
||||
</div>
|
||||
|
||||
<div class='yui-d0 <?php if($type == 'bymodule') echo 'yui-t7';?>' id='mainbox'>
|
||||
<div class='yui-b <?php if($type != 'bymodule') echo 'hidden';?>' id='treebox'>
|
||||
<div class='box-title'><?php echo $productName;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manage);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<?php $vars = "productID=$productID&type=$type¶m=$param&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; ?>
|
||||
<table class='table-1 fixed colored'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php common::printOrderLink('id', $orderBy, $vars, $lang->bug->id);?></th>
|
||||
<th><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severity);?></th>
|
||||
<th class='w-p50'><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
|
||||
<th><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->bug->openedBy);?></th>
|
||||
<th><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->bug->assignedTo);?></th>
|
||||
<th><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
|
||||
<th><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolution);?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($bugs as $bug):?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?></td>
|
||||
<td><?php echo $bug->severity?></td>
|
||||
<td class='a-left nobr'><?php echo $bug->title;?></td>
|
||||
<td><?php echo $users[$bug->openedBy];?></td>
|
||||
<td <?php if($bug->assignedTo == $this->app->user->account) echo 'style=color:red';?>><?php echo $users[$bug->assignedTo];?></td>
|
||||
<td><?php echo $users[$bug->resolvedBy];?></td>
|
||||
<td><?php echo $lang->bug->resolutionList[$bug->resolution];?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='a-right'><?php echo $pager;?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script language='javascript'>
|
||||
$("#<?php echo $type;?>tab").addClass('active');
|
||||
$("#module<?php echo $moduleID;?>").addClass('active');
|
||||
</script>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The close file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<div class='yui-d0'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $bug->title;?></caption>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->comment;?></td>
|
||||
<td><textarea name='comment' rows='6' class='area-1'></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'>
|
||||
<?php echo html::submitButton();?>
|
||||
<input type='button' value='<?php echo $lang->bug->buttonToList;?>' class='button-s'
|
||||
onclick='location.href="<?php echo $this->session->bugList;?>"' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
169
tags/zentaopms_0.3_beta_20100103/module/bug/view/create.html.php
Normal file
169
tags/zentaopms_0.3_beta_20100103/module/bug/view/create.html.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<style>
|
||||
#project{width:245px}
|
||||
#product{width:245px}
|
||||
#story{width:245px}
|
||||
</style>
|
||||
<script language='Javascript'>
|
||||
/* 当选择产品时,触发这个方法。*/
|
||||
function loadAll(productID)
|
||||
{
|
||||
$('#taskIdBox').get(0).innerHTML = ''; // 将taskID内容复位。
|
||||
loadModuleMenu(productID); // 加载产品的模块列表。
|
||||
loadProductStories(productID); // 加载产品的需求列表。
|
||||
loadProjects(productID); // 加载项目列表。
|
||||
}
|
||||
|
||||
/* 加载模块列表。*/
|
||||
function loadModuleMenu(productID)
|
||||
{
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug');
|
||||
$('#moduleIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载产品的需求列表。*/
|
||||
function loadProductStories(productID)
|
||||
{
|
||||
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID);
|
||||
$('#storyIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载项目列表。*/
|
||||
function loadProjects(productID)
|
||||
{
|
||||
link = createLink('product', 'ajaxGetProjects', 'productID=' + productID);
|
||||
$('#projectIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载项目的任务列表和需求列表。*/
|
||||
function loadProjectStoriesAndTasks(projectID)
|
||||
{
|
||||
if(projectID)
|
||||
{
|
||||
loadProjectTasks(projectID);
|
||||
loadProjectStories(projectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#taskIdBox').get(0).innerHTML = '';
|
||||
loadProductStories($('#product').get(0).value);
|
||||
}
|
||||
}
|
||||
|
||||
/* 加载项目的任务列表。*/
|
||||
function loadProjectTasks(projectID)
|
||||
{
|
||||
link = createLink('task', 'ajaxGetProjectTasks', 'projectID=' + projectID);
|
||||
$('#taskIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载项目的需求列表。*/
|
||||
function loadProjectStories(projectID)
|
||||
{
|
||||
productID = $('#product').get(0).value;
|
||||
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + productID);
|
||||
$('#storyIdBox').load(link);
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class='yui-doc3'>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table align='center' class='table-1'>
|
||||
<caption><?php echo $lang->bug->create;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labProductAndModule;?></th>
|
||||
<td class='a-left'>
|
||||
<?php echo html::select('product', $products, $productID, "onchange=loadAll(this.value); class='select-2'");?>
|
||||
<span id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $currentModuleID, 'class=select-3');?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labProjectAndTask;?></th>
|
||||
<td class='a-left'>
|
||||
<span id='projectIdBox'><?php echo html::select('project', $projects, '', 'onchange=loadProjectStoriesAndTasks(this.value)');?></span>
|
||||
<span id='taskIdBox'></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labStory;?></th>
|
||||
<td class='a-left'>
|
||||
<span id='storyIdBox'><?php echo html::select('story', $stories);?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labBuild;?></th>
|
||||
<td class='a-left'>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labTypeAndSeverity;?></th>
|
||||
<td class='a-left'>
|
||||
<?php echo html::select('type', (array)$lang->bug->typeList, 'codeerror', 'class=select-2');?>
|
||||
<?php echo html::select('severity', (array)$lang->bug->severityList, '', 'class=select-2');?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><nobr><?php echo $lang->bug->labSystemBrowserAndHardware;?></nobr></th>
|
||||
<td class='a-left'>
|
||||
<?php echo html::select('os', (array)$lang->bug->osList, '', 'class=select-2');?>
|
||||
<?php echo html::select('browser', (array)$lang->bug->browserList, '', 'class=select-2');?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><nobr><?php echo $lang->bug->labAssignedTo;?></nobr></th>
|
||||
<td class='a-left'> <?php echo html::select('assignedTo', $users, '', 'class=select-3');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><nobr><?php echo $lang->bug->labMailto;?></nobr></th>
|
||||
<td class='a-left'> <?php echo html::select('mailto[]', $users, '', 'class=select-3 size=5 multiple=multiple');?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->title;?></th>
|
||||
<td class='a-left'><input type='text' name='title' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->steps;?></th>
|
||||
<td class='a-left'><textarea name='steps' class='area-1' rows='6'></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->files;?></th>
|
||||
<td class='a-left'>
|
||||
<input type='file' name='files[]' class='text-4' />
|
||||
<input type='file' name='files[]' class='text-4' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<?php echo html::submitButton() . html::resetButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
301
tags/zentaopms_0.3_beta_20100103/module/bug/view/edit.html.php
Normal file
301
tags/zentaopms_0.3_beta_20100103/module/bug/view/edit.html.php
Normal file
@@ -0,0 +1,301 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<style>#project, #story, #task{width:245px}</style>
|
||||
<script language='Javascript'>
|
||||
changeProductConfirmed = false;
|
||||
changeProjectConfirmed = false;
|
||||
oldProjectID = '<?php echo $bug->project;?>';
|
||||
oldStoryID = '<?php echo $bug->story;?>';
|
||||
oldTaskID = '<?php echo $bug->task;?>';
|
||||
emptySelect = "<select name='task' id='task'><option value=''></option></select>";
|
||||
/* 当选择产品时,触发这个方法。*/
|
||||
function loadAll(productID)
|
||||
{
|
||||
if(!changeProductConfirmed)
|
||||
{
|
||||
firstChoice = confirm('<?php echo $lang->bug->confirmChangeProduct;?>');
|
||||
changeProductConfirmed = true; // 已经提示过,下次就不再提示了。
|
||||
}
|
||||
if(changeProductConfirmed || firstChoice)
|
||||
{
|
||||
$('#taskIdBox').get(0).innerHTML = emptySelect;
|
||||
loadModuleMenu(productID); // 加载产品的模块列表。
|
||||
loadProductStories(productID); // 加载产品的需求列表。
|
||||
loadProjects(productID); // 加载项目列表。
|
||||
}
|
||||
}
|
||||
|
||||
/* 加载模块列表。*/
|
||||
function loadModuleMenu(productID)
|
||||
{
|
||||
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug');
|
||||
$('#moduleIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载产品的需求列表。*/
|
||||
function loadProductStories(productID)
|
||||
{
|
||||
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&moduleId=0&storyID=' + oldStoryID);
|
||||
$('#storyIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载项目列表。*/
|
||||
function loadProjects(productID)
|
||||
{
|
||||
link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=' + oldProjectID);
|
||||
$('#projectIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载项目的任务列表和需求列表。*/
|
||||
function loadProjectStoriesAndTasks(projectID)
|
||||
{
|
||||
if(projectID)
|
||||
{
|
||||
loadProjectTasks(projectID);
|
||||
loadProjectStories(projectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#taskIdBox').get(0).innerHTML = emptySelect;
|
||||
loadProductStories($('#product').get(0).value);
|
||||
}
|
||||
}
|
||||
|
||||
/* 加载项目的任务列表。*/
|
||||
function loadProjectTasks(projectID)
|
||||
{
|
||||
link = createLink('task', 'ajaxGetProjectTasks', 'projectID=' + projectID + '&taskID=' + oldTaskID);
|
||||
$('#taskIdBox').load(link);
|
||||
}
|
||||
|
||||
/* 加载项目的需求列表。*/
|
||||
function loadProjectStories(projectID)
|
||||
{
|
||||
productID = $('#product').get(0).value;
|
||||
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + productID + '&storyID=' + oldStoryID);
|
||||
$('#storyIdBox').load(link);
|
||||
}
|
||||
|
||||
function setDuplicate(resolution)
|
||||
{
|
||||
if(resolution == 'duplicate')
|
||||
{
|
||||
$('#duplicateBugBox').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#duplicateBugBox').hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<form method='post' target='hiddenwin' enctype='multipart/form-data'>
|
||||
<div class='yui-d0'>
|
||||
<div id='titlebar'>
|
||||
<div id='main'>
|
||||
BUG #<?php echo $bug->id . $lang->colon;?>
|
||||
<?php echo html::input('title', $bug->title, 'class=text-1');?>
|
||||
</div>
|
||||
<div><?php echo html::submitButton()?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='yui-d0'>
|
||||
<div class='yui-g'>
|
||||
|
||||
<div class='yui-u first'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendBasicInfo;?></legend>
|
||||
<table class='table-1 a-left' cellpadding='0' cellspacing='0'>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->labProductAndModule;?></td>
|
||||
<td>
|
||||
<?php echo html::select('product', $products, $productID, "onchange=loadAll(this.value); class='select-2'");?>
|
||||
<span id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $currentModuleID);?></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->type;?></td>
|
||||
<td><?php echo html::select('type', (array)$lang->bug->typeList, $bug->type, 'class=select-2');?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->severity;?></td>
|
||||
<td><?php echo html::select('severity', (array)$lang->bug->severityList, $bug->severity, 'class=select-2');?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->os;?></td>
|
||||
<td><?php echo html::select('os', (array)$lang->bug->osList, $bug->os, 'class=select-2');?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->status;?></td>
|
||||
<td><?php echo html::select('status', (array)$lang->bug->statusList, $bug->status, 'class=select-2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->assignedTo;?></td>
|
||||
<td><?php echo html::select('assignedTo', $users, $bug->assignedTo, 'class=select-2');?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendPrjStoryTask;?></legend>
|
||||
<table class='table-1 a-left'>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->project;?></td>
|
||||
<td><span id='projectIdBox'><?php echo html::select('project', $projects, $bug->project, 'class=select-3 onchange=loadProjectStoriesAndTasks(this.value)');?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->story;?></td>
|
||||
<td><span id='storyIdBox'><?php echo html::select('story', $stories, $bug->story, 'class=select-3');?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->task;?></td>
|
||||
<td><span id='taskIdBox'><?php echo html::select('task', $tasks, $bug->task, 'class=select-3');?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendMailto;?></legend>
|
||||
<table class='table-1 a-left'>
|
||||
<tr>
|
||||
<td class='rowhead'></td>
|
||||
<td><?php echo html::input('mailto', $bug->mailto, 'class=text-3');?></div>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendAttatch;?></legend>
|
||||
<table class='table-1 a-left'>
|
||||
<tr>
|
||||
<td class='rowhead'></td>
|
||||
<td>
|
||||
<?php foreach($bug->files as $file) echo html::a($file->fullPath, $file->title);?>
|
||||
<input type='file' name='files' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
|
||||
<div class='yui-u'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendOpenInfo;?></legend>
|
||||
<table class='table-1 a-left'>
|
||||
<tr>
|
||||
<td width='40%' class='rowhead'><?php echo $lang->bug->openedBy;?></td>
|
||||
<td><?php echo $users[$bug->openedBy];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->openedBuild;?></td>
|
||||
<td><?php echo html::input('openedBuild', $bug->openedBuild, 'class=text-2');?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendResolveInfo;?></legend>
|
||||
<table class='table-1 a-left'>
|
||||
<tr>
|
||||
<td width='40%' class='rowhead'><?php echo $lang->bug->resolvedBy;?></td>
|
||||
<td><?php echo html::select('resolvedBy', $users, $bug->resolvedBy, 'class=select-2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->resolvedDate;?></td>
|
||||
<td><?php echo html::input('resolvedDate', $bug->resolvedDate, 'class=text-2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->resolvedBuild;?></td>
|
||||
<td><?php echo html::input('resolvedBuild', $bug->resolvedBuild, 'class=text-2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->resolution;?></td>
|
||||
<td><?php echo html::select('resolution', $lang->bug->resolutionList, $bug->resolution, 'class=select-2 onchange=setDuplicate(this.value)');?></td>
|
||||
</tr>
|
||||
<tr id='duplicateBugBox' <?php if($bug->resolution != 'duplicate') echo "style='display:none'";?>>
|
||||
<td class='rowhead'><?php echo $lang->bug->duplicateBug;?></td>
|
||||
<td><?php echo html::input('duplicateBug', $bug->duplicateBug, 'class=text-2');?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendCloseInfo;?></legend>
|
||||
<table class='table-1 a-left'>
|
||||
<tr>
|
||||
<td width='40%' class='rowhead'><?php echo $lang->bug->closedBy;?></td>
|
||||
<td><?php echo html::select('closedBy', $users, $bug->closedBy, 'class=select-2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->closedDate;?></td>
|
||||
<td><?php echo html::input('closedDate', $bug->closedDate, 'class=text-2');?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendLinkBugs;?></legend>
|
||||
<div> </div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendCases;?></legend>
|
||||
<div> </div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='yui-d0'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendComment;?></legend>
|
||||
<table class='table-1'>
|
||||
<tr>
|
||||
<td width='90%'><textarea name='comment' rows='4' class='area-1'></textarea></td>
|
||||
<td>
|
||||
<?php echo html::submitButton();?>
|
||||
<input type='button' value='<?php echo $lang->bug->buttonToList;?>' class='button-s'
|
||||
onclick='location.href="<?php echo $this->createLink('bug', 'browse', "productID=$productID");?>"' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendSteps;?></legend>
|
||||
<table class='table-1'>
|
||||
<tr>
|
||||
<td width='90%'><textarea name='steps' rows='4' class='area-1'><?php echo $bug->steps;?></textarea></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* The index view file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div id='doc3'>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* The resolve file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<script language='Javascript'>
|
||||
function setDuplicate(resolution)
|
||||
{
|
||||
if(resolution == 'duplicate')
|
||||
{
|
||||
$('#duplicateBugBox').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#duplicateBugBox').hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<div class='yui-d0'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $bug->title;?></caption>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->resolution;?></td>
|
||||
<td><?php echo html::select('resolution', $lang->bug->resolutionList, '', 'class=select-3 onchange=setDuplicate(this.value)');?></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->resolvedBuild;?></td>
|
||||
<td><?php echo html::input('resolvedBuild', '', 'class=text-3');?></td>
|
||||
</tr>-->
|
||||
<tr id='duplicateBugBox' style='display:none'>
|
||||
<td class='rowhead'><?php echo $lang->bug->duplicateBug;?></td>
|
||||
<td><?php echo html::input('duplicateBug', '', 'class=text-3');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->comment;?></td>
|
||||
<td><textarea name='comment' rows='6' class='area-1'></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'>
|
||||
<?php echo html::submitButton();?>
|
||||
<input type='button' value='<?php echo $lang->bug->buttonToList;?>' class='button-s'
|
||||
onclick='location.href="<?php echo $this->session->bugList;?>"' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* The mail file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<table width='98%' align='center'>
|
||||
<tr class='header'>
|
||||
<td>
|
||||
BUG #<?php echo $bug->id . "=>$bug->assignedTo " . html::a(common::getSysURL() . $this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php include '../../common/mail.html.php';?></td>
|
||||
</tr>
|
||||
</table>
|
||||
192
tags/zentaopms_0.3_beta_20100103/module/bug/view/view.html.php
Normal file
192
tags/zentaopms_0.3_beta_20100103/module/bug/view/view.html.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* The view file of bug module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package bug
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
|
||||
<div class='yui-d0'>
|
||||
<div id='titlebar'>
|
||||
<div id='main'>BUG #<?php echo $bug->id . $lang->colon . $bug->title;?></div>
|
||||
<div>
|
||||
<?php
|
||||
common::printLink('bug', 'edit', "bugID=$bug->id", $lang->bug->buttonEdit);
|
||||
if($bug->status == 'active') common::printLink('bug', 'resolve', "bugID=$bug->id", $lang->bug->buttonResolve); else echo $lang->bug->buttonResolve . ' ';
|
||||
if($bug->status == 'resolved') common::printLink('bug', 'close', "bugID=$bug->id", $lang->bug->buttonClose); else echo $lang->bug->buttonClose . ' ';
|
||||
if($bug->status == 'closed' or $bug->status == 'resolved') common::printLink('bug', 'activate', "bugID=$bug->id", $lang->bug->buttonActivate); else echo $lang->bug->buttonActivate . ' ';
|
||||
if(common::hasPriv('bug', 'browse')) echo html::a($this->session->bugList, $lang->bug->buttonToList);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='yui-d0 yui-t6'>
|
||||
<div class='yui-main'>
|
||||
<div class='yui-b'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendSteps;?></legend>
|
||||
<div class='content'><?php echo nl2br($bug->steps);?></div>
|
||||
</fieldset>
|
||||
<?php include '../../common/action.html.php';?>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendAction;?></legend>
|
||||
<div class='a-center' style='font-size:16px; font-weight:bold'>
|
||||
<?php
|
||||
if(common::hasPriv('bug', 'edit')) echo html::a($this->createLink('bug', 'edit', "bugID=$bug->id"), $lang->bug->buttonEdit);
|
||||
if(common::hasPriv('bug', 'resolve') and $bug->status == 'active') echo html::a($this->createLink('bug', 'resolve', "bugID=$bug->id"), $lang->bug->buttonResolve); else echo $lang->bug->buttonResolve . ' ';
|
||||
if(common::hasPriv('bug', 'close') and $bug->status == 'resolved') echo html::a($this->createLink('bug', 'close', "bugID=$bug->id"), $lang->bug->buttonClose); else echo $lang->bug->buttonClose . ' ';
|
||||
if(common::hasPriv('bug', 'activate') and ($bug->status == 'closed' or $bug->status == 'resolved')) echo html::a($this->createLink('bug', 'activate', "bugID=$bug->id"), $lang->bug->buttonActivate); else echo $lang->bug->buttonActivate . ' ';
|
||||
if(common::hasPriv('bug', 'browse')) echo html::a($this->session->bugList, $lang->bug->buttonToList);
|
||||
?>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='yui-b'>
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendBasicInfo;?></legend>
|
||||
<table class='table-1 a-left fixed'>
|
||||
<tr>
|
||||
<th class='w-p25 rowhead'><?php echo $lang->bug->labProductAndModule;?></th>
|
||||
<td class='nobr'>
|
||||
<?php
|
||||
echo $productName;
|
||||
if(!empty($modulePath)) echo $lang->arrow;
|
||||
foreach($modulePath as $key => $module)
|
||||
{
|
||||
echo $module->name;
|
||||
if(isset($modulePath[$key + 1])) echo $lang->arrow;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->type;?></td>
|
||||
<td><?php echo $lang->bug->typeList[$bug->type];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->os;?></td>
|
||||
<td><?php echo $lang->bug->osList->{$bug->os};?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->severity;?></td>
|
||||
<td><?php echo $bug->severity;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->status;?></td>
|
||||
<td><?php echo $bug->status;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->labAssignedTo;?></td>
|
||||
<td><?php if($bug->assignedTo) echo $users[$bug->assignedTo] . $lang->at . $bug->assignedDate;?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendLife;?></legend>
|
||||
<table class='table-1 a-left fixed'>
|
||||
<tr>
|
||||
<th class='rowhead w-p25'><?php echo $lang->bug->openedBy;?></th>
|
||||
<td> <?php echo $users[$bug->openedBy] . $lang->at . $bug->openedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->openedBuild;?></th>
|
||||
<td><?php echo $bug->openedBuild;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labResolved;?></th>
|
||||
<td><?php if($bug->resolvedBy) echo $users[$bug->resolvedBy] . $lang->at . $bug->resolvedDate;?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->resolvedBuild;?></th>
|
||||
<td><?php echo $bug->resolvedBuild;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->resolution;?></th>
|
||||
<td>
|
||||
<?php
|
||||
echo $lang->bug->resolutionList[$bug->resolution];
|
||||
if(isset($bug->duplicateBugTitle)) echo " #$bug->duplicateBug:" . html::a($this->createLink('bug', 'view', "bugID=$bug->duplicateBug"), $bug->duplicateBugTitle);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->closedBy;?></th>
|
||||
<td><?php if($bug->closedBy) echo $users[$bug->closedBy] . $lang->at . $bug->closedDate;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->bug->labLastEdited;?></th>
|
||||
<td><?php if($bug->lastEditedBy) echo $users[$bug->lastEditedBy] . $lang->at . $bug->lastEditedDate?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendPrjStoryTask;?></legend>
|
||||
<table class='table-1 a-left fixed'>
|
||||
<tr>
|
||||
<td class='rowhead w-p25'><?php echo $lang->bug->project;?></td>
|
||||
<td><?php if($bug->project) echo html::a($this->createLink('project', 'browse', "projectid=$bug->project"), $bug->projectName);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->story;?></td>
|
||||
<td><?php if($bug->story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), $bug->storyTitle);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->bug->task;?></td>
|
||||
<td><?php if($bug->task) echo html::a($this->createLink('task', 'view', "taskID=$bug->task"), $bug->taskName);?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendMailto;?></legend>
|
||||
<div><?php $mailto = explode(',', $bug->mailto); foreach($mailto as $account) echo ' ' . $users[$account]; ?></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendAttatch;?></legend>
|
||||
<div>
|
||||
<?php
|
||||
foreach($bug->files as $file) echo html::a($file->fullPath, $file->title, '_blank');
|
||||
?>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendLinkBugs;?></legend>
|
||||
<div> </div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->bug->legendCases;?></legend>
|
||||
<div> </div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<fieldset>
|
||||
<legend><?php echo $lang->history;?></legend>
|
||||
<ol>
|
||||
<?php foreach($actions as $action):?>
|
||||
<li>
|
||||
<span><?php echo "$action->date, <strong>$action->action</strong> by <strong>$action->actor</strong>"; ?></span>
|
||||
<?php if(!empty($action->comment) or !empty($action->history)):?>
|
||||
<div class='history'>
|
||||
<?php
|
||||
foreach($action->history as $history)
|
||||
{
|
||||
if($history->diff != '')
|
||||
{
|
||||
echo "CHANGE <strong>$history->field</strong>, the diff is: <blockquote>" . nl2br($history->diff) . "</blockquote>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "CHANGE <strong>$history->field</strong> FROM '$history->old' TO '$history->new' . <br />";
|
||||
}
|
||||
}
|
||||
echo nl2br($action->comment);
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ol>
|
||||
</fieldset>
|
||||
@@ -0,0 +1,2 @@
|
||||
<link rel="stylesheet" href="<?php echo $clientTheme;?>colorbox.css" />
|
||||
<script src="<?php echo $jsRoot;?>jquery/colorbox/min.js" type="text/javascript"></script>
|
||||
@@ -0,0 +1,2 @@
|
||||
<script src='<?php echo $jsRoot;?>jquery/colorize/full.js' type='text/javascript'></script>
|
||||
<script language='javascript'>$(function(){$('.colored').colorize();});</script>
|
||||
423
tags/zentaopms_0.3_beta_20100103/module/common/control.php
Normal file
423
tags/zentaopms_0.3_beta_20100103/module/common/control.php
Normal file
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of common module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package common
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class common extends control
|
||||
{
|
||||
/**
|
||||
* <20><><EFBFBD>캯<EFBFBD><ECBAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ự<EFBFBD><E1BBB0><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>˾ģ<CBBE>飬<EFBFBD><E9A3AC><EFBFBD><EFBFBD><EFBFBD>ù<EFBFBD>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2>
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
session_start();
|
||||
$this->sendHeader();
|
||||
$this->loadModel('company');
|
||||
$this->setCompany();
|
||||
$this->setUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>Ե<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>Ȩ<EFBFBD>ޡ<EFBFBD><DEA1><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>Ȩ<EFBFBD>ޣ<EFBFBD><DEA3><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>档
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkPriv()
|
||||
{
|
||||
$module = $this->app->getModuleName();
|
||||
$method = $this->app->getMethodName();
|
||||
if($module == 'user')
|
||||
{
|
||||
if($method == 'login' or $method == 'logout' or $method == 'deny') return true;
|
||||
}
|
||||
|
||||
if(isset($this->app->user))
|
||||
{
|
||||
if(!common::hasPriv($module, $method))
|
||||
{
|
||||
$referer = helper::safe64Encode($_SERVER['HTTP_REFERER']);
|
||||
$denyLink = $this->createLink('user', 'deny', "module=$module&method=$method&referer=$referer");
|
||||
|
||||
/* Fix the bug of IE: use js locate, can't get the referer. */
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
|
||||
{
|
||||
echo <<<EOT
|
||||
<a href='$denyLink' id='denylink' style='display:none'>deny</a>
|
||||
<script language='javascript'>document.getElementById('denylink').click();</script>
|
||||
EOT;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo js::locate($denyLink);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->locate($this->createLink('user', 'login'));
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD>鵱ǰ<E9B5B1>û<EFBFBD><C3BB><EFBFBD>ijһ<C4B3><D2BB>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>ijһ<C4B3><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>Ȩ<EFBFBD><EFBFBD><DEB7>ʡ<EFBFBD>*/
|
||||
public static function hasPriv($module, $method)
|
||||
{
|
||||
global $app;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ǹ<EFBFBD><C7B9><EFBFBD>Ա<EFBFBD><D4B1>*/
|
||||
$account = ',' . $app->user->account . ',';
|
||||
if(strpos($app->company->admins, $account) !== false) return true;
|
||||
|
||||
/* <20>ǹ<EFBFBD><C7B9><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ڡ<EFBFBD>*/
|
||||
$rights = $app->user->rights;
|
||||
if(isset($rights[$module][$method])) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
public static function printTopBar()
|
||||
{
|
||||
global $lang, $app;
|
||||
if(isset($app->user)) echo $app->user->realname . ' ';
|
||||
if(isset($app->user) and $app->user->account != 'guest')
|
||||
{
|
||||
echo html::a(helper::createLink('my', 'index'), $lang->myControl);
|
||||
echo html::a(helper::createLink('user', 'logout'), $lang->logout);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::a(helper::createLink('user', 'login'), $lang->login);
|
||||
}
|
||||
echo html::a('http://www.zentao.cn', $lang->zentaoSite, '_blank');
|
||||
echo $lang->sponser;
|
||||
}
|
||||
|
||||
/* <20><>ӡ<EFBFBD><D3A1><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>*/
|
||||
public static function printMainmenu($moduleName)
|
||||
{
|
||||
global $lang;
|
||||
echo "<ul>\n";
|
||||
echo "<li>$lang->zentaoMS</li>\n";
|
||||
|
||||
/* <20>趨<EFBFBD><E8B6A8>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>Ĭ<EEA1A3><C4AC><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>IJ˵<C4B2><CBB5><EFBFBD><EFBFBD>飬<EFBFBD><E9A3AC>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>˵<EFBFBD><CBB5>*/
|
||||
$mainMenu = $moduleName;
|
||||
if(isset($lang->menugroup->$moduleName)) $mainMenu = $lang->menugroup->$moduleName;
|
||||
|
||||
/* ѭ<><D1AD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>*/
|
||||
foreach($lang->menu as $menuKey => $menu)
|
||||
{
|
||||
$active = $menuKey == $mainMenu ? 'class=active' : '';
|
||||
list($menuLabel, $module, $method) = explode('|', $menu);
|
||||
|
||||
if(common::hasPriv($module, $method))
|
||||
{
|
||||
$link = helper::createLink($module, $method);
|
||||
echo "<li $active><nobr><a href='$link'>$menuLabel</a></nobr></li>\n";
|
||||
}
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
/* <20><>ӡģ<D3A1><C4A3><EFBFBD>IJ˵<C4B2><CBB5><EFBFBD>*/
|
||||
public static function printModuleMenu($moduleName)
|
||||
{
|
||||
global $lang, $app;
|
||||
|
||||
/* û<><C3BB><EFBFBD><EFBFBD><EFBFBD>ò˵<C3B2><CBB5><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>*/
|
||||
if(!isset($lang->$moduleName->menu)) {echo "<ul></ul>"; return;}
|
||||
|
||||
/* <20><><EFBFBD>ò˵<C3B2><CBB5><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>ǰ<EFBFBD><C7B0>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
$submenus = $lang->$moduleName->menu;
|
||||
$currentModule = $app->getModuleName();
|
||||
$currentMethod = $app->getMethodName();
|
||||
|
||||
/* <20>˵<EFBFBD><CBB5><EFBFBD>ʼ<EFBFBD><CABC>*/
|
||||
echo "<ul>\n";
|
||||
|
||||
/* ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD>˵<EFBFBD><CBB5>*/
|
||||
foreach($submenus as $submenu)
|
||||
{
|
||||
/* <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>*/
|
||||
$link = $submenu;
|
||||
$subModule = '';
|
||||
$alias = '';
|
||||
$float = '';
|
||||
$active = '';
|
||||
$target = '';
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ò˵<C3B2><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>õģ<C3B5><C4A3><EFBFBD><F2B8B2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>*/
|
||||
if(is_array($submenu)) extract($submenu);
|
||||
|
||||
/* <20><>ӡ<EFBFBD>˵<EFBFBD><CBB5><EFBFBD>*/
|
||||
if(strpos($link, '|') === false)
|
||||
{
|
||||
echo "<li>$link</li>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = explode('|', $link);
|
||||
list($label, $module, $method) = $link;
|
||||
$vars = isset($link[3]) ? $link[3] : '';
|
||||
if(common::hasPriv($module, $method))
|
||||
{
|
||||
global $app;
|
||||
|
||||
/* <20>ж<EFBFBD><D0B6>Ƿ<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><C3BC>*/
|
||||
if($currentModule == $subModule) $active = 'active';
|
||||
if($module == $currentModule and ($method == $currentMethod or strpos($alias, $currentMethod) !== false)) $active = 'active';
|
||||
|
||||
echo "<li class='$float $active'>" . html::a(helper::createLink($module, $method, $vars), $label, $target) . "</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
/* <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
public static function printBreadMenu($moduleName, $position)
|
||||
{
|
||||
global $lang;
|
||||
$mainMenu = $moduleName;
|
||||
if(isset($lang->menugroup->$moduleName)) $mainMenu = $lang->menugroup->$moduleName;
|
||||
list($menuLabel, $module, $method) = explode('|', $lang->menu->index);
|
||||
echo html::a(helper::createLink($module, $method), $lang->zentaoMS) . $lang->arrow;
|
||||
if($moduleName != 'index')
|
||||
{
|
||||
list($menuLabel, $module, $method) = explode('|', $lang->menu->$mainMenu);
|
||||
echo html::a(helper::createLink($module, $method), $menuLabel);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $lang->index->common;
|
||||
}
|
||||
if(empty($position)) return;
|
||||
echo $lang->arrow;
|
||||
foreach($position as $key => $link)
|
||||
{
|
||||
echo $link;
|
||||
if(isset($position[$key + 1])) echo $lang->arrow;
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD>ò˵<C3B2><CBB5>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
public function setMenuVars($menu, $key, $params)
|
||||
{
|
||||
if(is_array($params))
|
||||
{
|
||||
if(is_array($menu->$key))
|
||||
{
|
||||
$menu->$key = (object)$menu->$key;
|
||||
$menu->$key->link = vsprintf($menu->$key->link, $params);
|
||||
$menu->$key = (array)$menu->$key;
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu->$key = vsprintf($menu->$key, $params);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(is_array($menu->$key))
|
||||
{
|
||||
$menu->$key = (object)$menu->$key;
|
||||
$menu->$key->link = sprintf($menu->$key->link, $params);
|
||||
$menu->$key = (array)$menu->$key;
|
||||
}
|
||||
else
|
||||
{
|
||||
$menu->$key = sprintf($menu->$key, $params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>orderby<62><79><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD> */
|
||||
public static function printOrderLink($fieldName, $orderBy, $vars, $label, $module = '', $method = '')
|
||||
{
|
||||
global $lang, $app;
|
||||
if(empty($module)) $module= $app->getModuleName();
|
||||
if(empty($method)) $method= $app->getMethodName();
|
||||
if(strpos($orderBy, $fieldName) !== false)
|
||||
{
|
||||
if(stripos($orderBy, 'desc') !== false)
|
||||
{
|
||||
$orderBy = str_ireplace('desc', 'asc', $orderBy);
|
||||
}
|
||||
elseif(stripos($orderBy, 'asc') !== false)
|
||||
{
|
||||
$orderBy = str_ireplace('asc', 'desc', $orderBy);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$orderBy = $fieldName . '|' . 'asc';
|
||||
}
|
||||
$link = helper::createLink($module, $method, sprintf($vars, $orderBy));
|
||||
echo html::a($link, $label);
|
||||
}
|
||||
|
||||
/* <20><>ӡ<EFBFBD><D3A1><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>*/
|
||||
public static function printLink($module, $method, $vars = '', $label, $target = '', $misc = '')
|
||||
{
|
||||
if(!common::hasPriv($module, $method)) return false;
|
||||
echo html::a(helper::createLink($module, $method, $vars), $label, $target, $misc);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ʵĹ<CAB5>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2>
|
||||
*
|
||||
* <20><><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD><D4B0>յ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD>Ӧ<EFBFBD>Ĺ<EFBFBD>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB7>鵽<EFBFBD><E9B5BD><EFBFBD>ٰ<EFBFBD><D9B0><EFBFBD>Ĭ<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2>ҡ<EFBFBD>
|
||||
* <20><>ȡ<EFBFBD><C8A1>˾<EFBFBD><CBBE>Ϣ֮<CFA2><EFBFBD><F3A3ACBD><EFBFBD>д<EFBFBD>뵽$_SESSION<4F>С<EFBFBD>
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
private function setCompany()
|
||||
{
|
||||
if(isset($_SESSION['company']) and $_SESSION['company']->pms == $_SERVER['HTTP_HOST'])
|
||||
{
|
||||
$this->app->setSessionCompany($_SESSION['company']);
|
||||
}
|
||||
$company = $this->company->getByDomain();
|
||||
if(!$company) $company = $this->company->getByDomain($this->config->default->domain);
|
||||
if(!$company) $this->app->error(sprintf($this->lang->error->companyNotFound, $_SERVER['HTTP_HOST']), __FILE__, __LINE__, $exit = true);
|
||||
$_SESSION['company'] = $company;
|
||||
$this->app->setSessionCompany($company);
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ʵ<EFBFBD><CAB5>û<EFBFBD><C3BB><EFBFBD>Ϣ<EFBFBD><CFA2>
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
private function setUser()
|
||||
{
|
||||
if(isset($_SESSION['user']))
|
||||
{
|
||||
$this->app->setSessionUser($_SESSION['user']);
|
||||
}
|
||||
elseif($this->app->company->guest)
|
||||
{
|
||||
$user = new stdClass();
|
||||
$user->account = 'guest';
|
||||
$user->realname = 'guest';
|
||||
$this->loadModel('user');
|
||||
$user->rights = $this->user->authorize('guest');
|
||||
$_SESSION['user'] = $user;
|
||||
$this->app->setSessionUser($_SESSION['user']);
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD>Ʒid<69><64>session<6F>Ự<EFBFBD>С<EFBFBD>*/
|
||||
public static function saveProductState($productID, $defaultProductID)
|
||||
{
|
||||
global $app;
|
||||
if($productID > 0) $app->session->set('product', (int)$productID);
|
||||
if($productID == 0 and $app->session->product == '') $app->session->set('product', $defaultProductID);
|
||||
return $app->session->product;
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀid<69><64>session<6F>Ự<EFBFBD>С<EFBFBD>*/
|
||||
public static function saveProjectState($projectID, $projects)
|
||||
{
|
||||
global $app;
|
||||
if($projectID > 0) $app->session->set('project', (int)$projectID);
|
||||
if($projectID == 0 and $app->session->project == '') $app->session->set('project', $projects[0]);
|
||||
if(!in_array($app->session->project, $projects)) $app->session->set('project', $projects[0]);
|
||||
return $app->session->project;
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD><EFBFBD>header<65><72>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function sendHeader()
|
||||
{
|
||||
header("Content-Type: text/html; Language={$this->config->encoding}");
|
||||
header("Cache-control: private");
|
||||
}
|
||||
|
||||
/* <20>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>صIJ<D8B5>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<DEB8>¼<EFBFBD><C2BC>*/
|
||||
public static function createChanges($old, $new)
|
||||
{
|
||||
global $config;
|
||||
$changes = array();
|
||||
$magicQuote = get_magic_quotes_gpc();
|
||||
foreach($new as $key => $value)
|
||||
{
|
||||
if(strtolower($key) == 'lastediteddate') continue;
|
||||
if(strtolower($key) == 'lasteditedby') continue;
|
||||
|
||||
if($magicQuote) $value = stripslashes($value);
|
||||
if($value != $old->$key)
|
||||
{
|
||||
$diff = '';
|
||||
if(substr_count($value, "\n") > 1 or substr_count($old->$key, "\n") > 1) $diff = self::diff($old->$key, $value);
|
||||
$changes[] = array('field' => $key, 'old' => $old->$key, 'new' => $value, 'diff' => $diff);
|
||||
}
|
||||
}
|
||||
return $changes;
|
||||
}
|
||||
|
||||
/* <20>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>IJ<EFBFBD>ͬ<EFBFBD><CDAC>ժ<EFBFBD><D5AA>PHPQAT<41>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Կ<EFBFBD><D4BF>ܡ<EFBFBD>*/
|
||||
public static function diff($text1, $text2)
|
||||
{
|
||||
$w = explode("\n", $text1);
|
||||
$o = explode("\n", $text2);
|
||||
$w1 = array_diff_assoc($w,$o);
|
||||
$o1 = array_diff_assoc($o,$w);
|
||||
$w2 = array();
|
||||
$o2 = array();
|
||||
foreach($w1 as $idx => $val) $w2[sprintf("%03d<",$idx)] = sprintf("%03d- ", $idx+1) . "<del>" . trim($val) . "</del>";
|
||||
foreach($o1 as $idx => $val) $o2[sprintf("%03d>",$idx)] = sprintf("%03d+ ", $idx+1) . "<ins>" . trim($val) . "</ins>";
|
||||
$diff = array_merge($w2, $o2);
|
||||
ksort($diff);
|
||||
return implode("\n", $diff);
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>ϵͳURL<52><4C>ַ<EFBFBD><D6B7>*/
|
||||
public function getSysURL()
|
||||
{
|
||||
global $config;
|
||||
$httpType = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ? 'https' : 'http';
|
||||
$httpHost = $_SERVER['HTTP_HOST'];
|
||||
return "$httpType://$httpHost";
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>ϵͳĬ<CDB3>ϵ<EFBFBD><CFB5><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>*/
|
||||
public function getDefaultCss()
|
||||
{
|
||||
global $app;
|
||||
$pathFix = $app->getPathFix();
|
||||
$cssFile = $app->getAppRoot() . "www{$pathFix}theme{$pathFix}default{$pathFix}style.css";
|
||||
$cssContent = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!','', file_get_contents($cssFile));
|
||||
$cssContent = str_replace(array(" {", "} ", ' ', "\r\n", "\r", "\n", "\t"), array("{", '}', ' ', ''), $cssContent);
|
||||
return $cssContent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<div class='yui-d0' id='hiddenbar'>
|
||||
<iframe frameborder='0' name='hiddenwin' id='hiddenwin' class='<?php $config->debug ? print("debugwin") : print('hiddenwin')?>'></iframe>
|
||||
</div>
|
||||
<div id='footer' class='yui-d0 yui-t7'>
|
||||
<div class='yui-g'>
|
||||
<div class='yui-g first' id='crumbs'><?php common::printBreadMenu($this->moduleName, isset($position) ? $position : ''); ?></div>
|
||||
<div class='yui-g'>
|
||||
<div class='yui-u first'> </div>
|
||||
<div class='yui-u a-right'>
|
||||
<span id='poweredby'>powered by <a href='http://www.zentao.cn' target='_blank'>ZenTaoPMS</a> (<?php echo $config->version;?>)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$clientTheme = $this->app->getClientTheme();
|
||||
$webRoot = $this->app->getWebRoot();
|
||||
$jsRoot = $webRoot . "js/";
|
||||
$themeRoot = $webRoot . "theme/";
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dli'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
|
||||
<?php
|
||||
$header = (object)$header;
|
||||
if(isset($header->title)) echo "<title>$header->title - $lang->zentaoMS</title>\n";
|
||||
if(isset($header->keyword)) echo "<meta name='keywords' content='$header->keyword'>\n";
|
||||
if(isset($header->desc)) echo "<meta name='description' content='$header->desc'>\n";
|
||||
?>
|
||||
<?php echo js::exportConfigVars();?>
|
||||
<script src="<?php echo $jsRoot;?>jquery/lib.js" type="text/javascript"></script>
|
||||
<script src="<?php echo $jsRoot;?>my.js" type="text/javascript"></script>
|
||||
<link rel='stylesheet' href='<?php echo $clientTheme . 'yui.css';?>' type='text/css' media='screen' />
|
||||
<link rel='stylesheet' href='<?php echo $clientTheme . 'style.css';?>' type='text/css' media='screen' />
|
||||
<script type="text/javascript">loadFixedCSS();</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id='topbar' class='yui-d0 yui-t6'>
|
||||
<div class='yui-main'><div class='yui-b'><?php printf($lang->welcome, $app->company->name);?></div></div>
|
||||
<div class='yui-b a-right'><?php common::printTopBar();?></div>
|
||||
</div>
|
||||
<div id='navbar' class='yui-d0'>
|
||||
<div id='mainmenu'><?php common::printMainmenu($this->moduleName);?></div>
|
||||
<div id='modulemenu'><?php common::printModuleMenu($this->moduleName);?></div>
|
||||
</div>
|
||||
25
tags/zentaopms_0.3_beta_20100103/module/common/lang/en.php
Normal file
25
tags/zentaopms_0.3_beta_20100103/module/common/lang/en.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* The common english language file of ZenTaoMS.
|
||||
*
|
||||
* All items used commonly should be defined here.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package ZenTaoMS
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
160
tags/zentaopms_0.3_beta_20100103/module/common/lang/zh-cn.php
Normal file
160
tags/zentaopms_0.3_beta_20100103/module/common/lang/zh-cn.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* The common simplified chinese file of ZenTaoMS.
|
||||
*
|
||||
* This file should be UTF-8 encoded.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package ZenTaoMS
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang->zentaoMS = '禅道管理';
|
||||
$lang->logout = '退出系统';
|
||||
$lang->login = '登陆';
|
||||
$lang->currentPos = '当前位置:';
|
||||
$lang->arrow = ' » ';
|
||||
$lang->colon = '::';
|
||||
$lang->reset = '重填';
|
||||
$lang->edit = '编辑';
|
||||
$lang->delete = '删除';
|
||||
$lang->save = '保存';
|
||||
$lang->action = '操作';
|
||||
$lang->comment = '备注';
|
||||
$lang->history = '历史记录';
|
||||
$lang->welcome = "欢迎使用%s{$lang->colon}{$lang->zentaoMS}";
|
||||
$lang->zentaoSite = "官方网站";
|
||||
$lang->myControl = "我的地盘";
|
||||
$lang->sponser = "<a href='http://www.pujia.com' target='_blank'>普加赞助</a>";
|
||||
$lang->at = ' 于 ';
|
||||
|
||||
/* 主导航菜单。*/
|
||||
$lang->menu->index = '首页|index|index';
|
||||
$lang->menu->my = '我的地盘|my|index';
|
||||
$lang->menu->product = '产品视图|product|index';
|
||||
$lang->menu->project = '项目视图|project|index';
|
||||
$lang->menu->qa = 'QA视图|qa|index';
|
||||
$lang->menu->company = '组织视图|company|index';
|
||||
$lang->menu->admin = '后台管理|admin|index';
|
||||
|
||||
/* 首页菜单设置。*/
|
||||
$lang->index->menu->product = '浏览产品|product|browse';
|
||||
$lang->index->menu->project = '浏览项目|project|browse';
|
||||
|
||||
/* 我的地盘菜单设置。*/
|
||||
$lang->my->menu->account = '%s' . $lang->arrow;
|
||||
$lang->my->menu->todo = array('link' => '我的TODO|my|todo|', 'subModule' => 'todo');
|
||||
$lang->my->menu->task = '我的任务|my|task|';
|
||||
$lang->my->menu->project = '我的项目|my|project|';
|
||||
$lang->my->menu->bug = '我的Bug|my|bug|';
|
||||
$lang->my->menu->profile = array('link' => '我的档案|my|profile|', 'alias' => 'editprofile');
|
||||
$lang->todo->menu = $lang->my->menu;
|
||||
|
||||
/* 产品视图设置。*/
|
||||
$lang->product->menu->list = '%s';
|
||||
$lang->product->menu->story = array('link' => '需求列表|product|browse|productID=%s', 'subModule' => 'story');
|
||||
$lang->product->menu->plan = array('link' => '计划列表|productplan|browse|productID=%s', 'subModule' => 'productplan');
|
||||
$lang->product->menu->edit = '编辑产品|product|edit|productID=%s';
|
||||
$lang->product->menu->delete = array('link' => '删除产品|product|delete|productID=%s', 'target' => 'hiddenwin');
|
||||
$lang->product->menu->module = '维护模块|tree|browse|productID=%s&view=product';
|
||||
$lang->product->menu->create = array('link' => '新增产品|product|create', 'float' => 'right');
|
||||
$lang->story->menu = $lang->product->menu;
|
||||
$lang->productplan->menu = $lang->product->menu;
|
||||
|
||||
/* 项目视图菜单设置。*/
|
||||
$lang->project->menu->list = '%s';
|
||||
$lang->project->menu->task = array('link' => '任务列表|project|task|projectID=%s', 'subModule' => 'task');
|
||||
$lang->project->menu->story = array('link' => '需求列表|project|story|projectID=%s', 'alias' => 'linkstory');
|
||||
$lang->project->menu->bug = 'Bug列表|project|bug|projectID=%s';
|
||||
$lang->project->menu->burn = '燃烧图|project|burn|projectID=%s';
|
||||
$lang->project->menu->team = array('link' => '团队成员|project|team|projectID=%s', 'alias' => 'managemembers');
|
||||
$lang->project->menu->line = $lang->colon;
|
||||
$lang->project->menu->view = '基本信息|project|view|projectID=%s';
|
||||
$lang->project->menu->edit = '编辑项目|project|edit|projectID=%s';
|
||||
$lang->project->menu->delete = array('link' => '删除项目|project|delete|projectID=%s', 'target' => 'hiddenwin');
|
||||
$lang->project->menu->product= '关联产品|project|manageproducts|projectID=%s';
|
||||
|
||||
$lang->project->menu->create = array('link' => '新增项目|project|create', 'float' => 'right');
|
||||
$lang->task->menu = $lang->project->menu;
|
||||
|
||||
/* QA视图菜单设置。*/
|
||||
$lang->bug->menu->product = '%s';
|
||||
$lang->bug->menu->bug = array('link' => '缺陷管理|bug|browse|productID=%s', 'alias' => 'view,create,edit,resolve,close,active', 'subModule' => 'tree');
|
||||
$lang->bug->menu->testcase = array('link' => '用例管理|testcase|browse|productID=%s', 'alias' => 'view,create,edit');
|
||||
|
||||
$lang->testcase->menu->product = '%s';
|
||||
$lang->testcase->menu->bug = array('link' => '缺陷管理|bug|browse|productID=%s', 'alias' => 'view,create,edit,resolve,close,active');
|
||||
$lang->testcase->menu->testcase = array('link' => '用例管理|testcase|browse|productID=%s', 'alias' => 'view,create,edit', 'subModule' => 'tree');
|
||||
|
||||
/* 组织结构视图菜单设置。*/
|
||||
$lang->company->menu->browseUser = array('link' => '用户管理|company|browse', 'subModule' => 'user');
|
||||
$lang->company->menu->dept = array('link' => '部门结构|dept|browse', 'subModule' => 'dept');
|
||||
$lang->company->menu->browseGroup = array('link' => '分组管理|group|browse', 'subModule' => 'group');
|
||||
$lang->company->menu->addGroup = array('link' => '添加分组|group|create', 'float' => 'right');
|
||||
$lang->company->menu->addUser = array('link' => '添加用户|user|create|company=%s&dept=%s&from=company', 'subModule' => 'user', 'float' => 'right');
|
||||
$lang->dept->menu = $lang->company->menu;
|
||||
$lang->group->menu = $lang->company->menu;
|
||||
|
||||
/* 用户信息菜单设置。*/
|
||||
$lang->user->menu->account = '%s' . $lang->arrow;
|
||||
$lang->user->menu->todo = array('link' => 'TODO列表|user|todo|account=%s', 'subModule' => 'todo');
|
||||
$lang->user->menu->task = '任务列表|user|task|account=%s';
|
||||
$lang->user->menu->project = '项目列表|user|project|account=%s';
|
||||
$lang->user->menu->bug = 'Bug列表|user|bug|account=%s';
|
||||
$lang->user->menu->profile = array('link' => '用户信息|user|profile|account=%s', 'alias' => 'edit');
|
||||
$lang->user->menu->browse = array('link' => '用户管理|company|browse|', 'float' => 'right');
|
||||
|
||||
/* 后台管理菜单设置。*/
|
||||
$lang->admin->menu->browseCompany = array('link' => '公司管理|admin|browsecompany', 'subModule' => 'company');
|
||||
$lang->admin->menu->createCompany = array('link' => '新增公司|company|create', 'float' => 'right');
|
||||
|
||||
/*菜单设置:分组设置。*/
|
||||
$lang->menugroup->release = 'product';
|
||||
$lang->menugroup->story = 'product';
|
||||
$lang->menugroup->productplan = 'product';
|
||||
$lang->menugroup->task = 'project';
|
||||
$lang->menugroup->company = 'admin';
|
||||
$lang->menugroup->user = 'company';
|
||||
$lang->menugroup->group = 'company';
|
||||
$lang->menugroup->bug = 'qa';
|
||||
$lang->menugroup->testcase = 'qa';
|
||||
$lang->menugroup->people = 'company';
|
||||
$lang->menugroup->dept = 'company';
|
||||
$lang->menugroup->todo = 'my';
|
||||
|
||||
/* 错误提示信息。*/
|
||||
$lang->error->companyNotFound = "您访问的域名 %s 没有对应的公司。";
|
||||
$lang->error->length = array("『%s』长度错误,应当为『%s』", "『%s』长度应当不超过『%s』,且不小于『%s』。");
|
||||
$lang->error->reg = "『%s』不符合格式,应当为:『%s』。";
|
||||
$lang->error->unique = "『%s』已经有『%s』这条记录了。";
|
||||
$lang->error->notempty = "『%s』不能为空。";
|
||||
$lang->error->int = array("『%s』应当是数字。", "『%s』应当介于『%s-%s』之间。");
|
||||
$lang->error->float = "『%s』应当是数字,可以是小数。";
|
||||
$lang->error->email = "『%s』应当为合法的EMAIL。";
|
||||
$lang->error->date = "『%s』应当为合法的日期。";
|
||||
$lang->error->account = "『%s』应当为合法的用户名。";
|
||||
$lang->error->passwordsame = "两次密码应当相等。";
|
||||
$lang->error->passwordrule = "密码应该符合规则。";
|
||||
|
||||
/* 分页信息。*/
|
||||
$lang->pager->noRecord = "暂时没有记录";
|
||||
$lang->pager->digest = "共<strong>%s</strong>条记录,每页 <strong>%s</strong>条,页面:<strong>%s/%s</strong> ";
|
||||
$lang->pager->first = "首页";
|
||||
$lang->pager->pre = "上页";
|
||||
$lang->pager->next = "下页";
|
||||
$lang->pager->last = "末页";
|
||||
$lang->pager->locate = "GO!";
|
||||
30
tags/zentaopms_0.3_beta_20100103/module/common/mail.html.php
Normal file
30
tags/zentaopms_0.3_beta_20100103/module/common/mail.html.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<span><?php echo "$action->date, <strong>$action->action</strong> by <strong>$action->actor</strong>"; ?></span>
|
||||
<?php if(!empty($action->comment) or !empty($histories)):?>
|
||||
<div class='history'>
|
||||
<?php
|
||||
if(!empty($histories))
|
||||
{
|
||||
foreach($histories[$action->id] as $history)
|
||||
{
|
||||
if($history->diff != '')
|
||||
{
|
||||
echo "CHANGE <strong>$history->field</strong>, the diff is: <blockquote>" . nl2br($history->diff) . "</blockquote>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "CHANGE <strong>$history->field</strong> FROM '$history->old' TO '$history->new' . <br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo nl2br($action->comment);
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<style>
|
||||
del {background:#fcc}
|
||||
ins {background:#cfc; text-decoration:none}
|
||||
table, tr, th, td {border:1px solid gray; font-size:12px; border-collapse:collapse}
|
||||
tr, th, td {padding:5px}
|
||||
.history {border:1px solid gray; padding:10px; margin-top:10px; margin-bottom:10px}
|
||||
.header {background:#efefef}
|
||||
</style>
|
||||
@@ -0,0 +1,31 @@
|
||||
<link rel='stylesheet' href='<?php echo $clientTheme;?>tablesorter.css' />
|
||||
<script src='<?php echo $jsRoot;?>jquery/tablesorter/min.js' type='text/javascript'></script>
|
||||
<script src='<?php echo $jsRoot;?>jquery/colorize/full.js' type='text/javascript'></script>
|
||||
<script language='javascript'>
|
||||
$(function() {
|
||||
|
||||
$('.tablesorter').tablesorter(
|
||||
{
|
||||
widgets: ['zebra'],
|
||||
widgetZebra: {css: ['odd', 'even'] }
|
||||
}
|
||||
);
|
||||
$('.tablesorter tr').hover(
|
||||
function(){$(this).addClass('hoover')},
|
||||
function(){$(this).removeClass('hoover')}
|
||||
);
|
||||
$('.tablesorter tr').click(
|
||||
function()
|
||||
{
|
||||
if($(this).attr('class').indexOf('clicked') > 0)
|
||||
{
|
||||
$(this).removeClass('clicked');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).addClass('clicked');
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,3 @@
|
||||
<link rel='stylesheet' href='<?php echo $clientTheme;?>treeview.css' type='text/css' />
|
||||
<script src='<?php echo $jsRoot;?>jquery/treeview/min.js' type='text/javascript'></script>
|
||||
<script language='javascript'>$(function() { $("#tree").treeview( { persist: "cookie", collapsed: false }) })</script>
|
||||
122
tags/zentaopms_0.3_beta_20100103/module/company/control.php
Normal file
122
tags/zentaopms_0.3_beta_20100103/module/company/control.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of company module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package company
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class company extends control
|
||||
{
|
||||
/* 构造函数。*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('admin');
|
||||
$this->loadModel('dept');
|
||||
$this->app->loadLang('user');
|
||||
}
|
||||
|
||||
/* 公司首页。*/
|
||||
public function index()
|
||||
{
|
||||
$this->locate($this->createLink('company', 'browse'));
|
||||
}
|
||||
|
||||
/* 浏览某一个公司。*/
|
||||
public function browse($deptID = 0)
|
||||
{
|
||||
$this->lang->set('menugroup.company', 'company');
|
||||
$childDeptIds = $this->dept->getAllChildID($deptID);
|
||||
|
||||
$this->company->setMenu($deptID);
|
||||
|
||||
$header['title'] = $this->lang->company->index . $this->lang->colon . $this->lang->dept->common;
|
||||
$position[] = $this->lang->dept->common;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('users', $this->dept->getUsers($childDeptIds));
|
||||
$this->assign('deptTree', $this->dept->getTreeMenu($rooteDeptID = 0, array('deptModel', 'createMemberLink')));
|
||||
$this->assign('parentDepts', $this->dept->getParents($deptID));
|
||||
$this->assign('deptID', $deptID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 新增一个公司。*/
|
||||
public function create()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->company->create();
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
die(js::locate($this->createLink('admin', 'browsecompany'), 'parent'));
|
||||
}
|
||||
|
||||
$this->lang->set('menugroup.company', 'admin');
|
||||
$this->lang->company->menu = $this->lang->admin->menu;
|
||||
|
||||
$header['title'] = $this->lang->admin->common . $this->lang->colon . $this->lang->company->create;
|
||||
$position[] = html::a($this->createLink('admin', 'browsecompany'), $this->lang->admin->company);
|
||||
$position[] = $this->lang->company->create;
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 编辑一个公司。*/
|
||||
public function edit($companyID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->company->update($companyID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
die(js::locate($this->createLink('admin', 'browsecompany'), 'parent'));
|
||||
}
|
||||
|
||||
$this->lang->set('menugroup.company', 'admin');
|
||||
$this->lang->company->menu = $this->lang->admin->menu;
|
||||
|
||||
$header['title'] = $this->lang->admin->common . $this->lang->colon . $this->lang->company->edit;
|
||||
$position[] = html::a($this->createLink('admin', 'browsecompany'), $this->lang->admin->company);
|
||||
$position[] = $this->lang->company->edit;
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('company', $this->company->getById($companyID));
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 删除公司。*/
|
||||
public function delete($companyID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
echo js::confirm($this->lang->company->confirmDelete, $this->createLink('company', 'delete', "companyID=$companyID&confirm=yes"));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->company->delete($companyID);
|
||||
echo js::locate($this->createLink('admin', 'browseCompany'), 'parent');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
tags/zentaopms_0.3_beta_20100103/module/company/lang/en.php
Normal file
39
tags/zentaopms_0.3_beta_20100103/module/company/lang/en.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* The company module en file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package company
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang['page']['common'] = 'company';
|
||||
$lang['page']['index'] = "{$lang['page']['common']}/index";
|
||||
$lang['page']['create'] = "{$lang['page']['common']}/create";
|
||||
$lang['page']['read'] = "{$lang['page']['common']}/read";
|
||||
$lang['page']['update'] = "{$lang['page']['common']}/update";
|
||||
$lang['page']['delete'] = "{$lang['page']['common']}/delete";
|
||||
$lang['company']['id'] = 'id';
|
||||
$lang['company']['name'] = 'name';
|
||||
$lang['company']['phpone'] = 'phpone';
|
||||
$lang['company']['fax'] = 'fax';
|
||||
$lang['company']['address'] = 'address';
|
||||
$lang['company']['zipcode'] = 'zipcode';
|
||||
$lang['company']['website'] = 'website';
|
||||
$lang['company']['backyard'] = 'backyard';
|
||||
$lang['company']['pms'] = 'pms';
|
||||
$lang['company']['guest'] = 'guest';
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* The company module zh-cn file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package company
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang->company->common = '公司';
|
||||
$lang->company->index = "公司首页";
|
||||
$lang->company->create = "新增公司";
|
||||
$lang->company->edit = "编辑公司";
|
||||
$lang->company->read = "公司信息";
|
||||
$lang->company->update = "更新公司";
|
||||
$lang->company->delete = "删除公司";
|
||||
$lang->company->browse = "浏览公司";
|
||||
$lang->company->depts = "部门列表";
|
||||
$lang->company->orgView = '组织视图';
|
||||
|
||||
$lang->company->confirmDelete = "您确定删除该公司吗?";
|
||||
|
||||
$lang->company->id = '编号';
|
||||
$lang->company->name = '公司名称';
|
||||
$lang->company->phone = '联系电话';
|
||||
$lang->company->fax = '传真';
|
||||
$lang->company->address = '通讯地址';
|
||||
$lang->company->zipcode = '邮政编码';
|
||||
$lang->company->website = '公司网站';
|
||||
$lang->company->backyard = '内网网址';
|
||||
$lang->company->pms = 'PMS网站';
|
||||
$lang->company->guest = '匿名登陆';
|
||||
|
||||
$lang->company->guestList[0] = '不允许';
|
||||
$lang->company->guestList[1] = '允许';
|
||||
89
tags/zentaopms_0.3_beta_20100103/module/company/model.php
Normal file
89
tags/zentaopms_0.3_beta_20100103/module/company/model.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of company module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package company
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class companyModel extends model
|
||||
{
|
||||
/* <20><><EFBFBD>ò˵<C3B2><CBB5><EFBFBD>*/
|
||||
public function setMenu($dept = 0)
|
||||
{
|
||||
common::setMenuVars($this->lang->company->menu, 'addUser', array($this->app->company->id, $dept));
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD>ù<EFBFBD>˾<EFBFBD>б<EFBFBD><D0B1><EFBFBD>*/
|
||||
public function getList()
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_COMPANY)->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2>
|
||||
*
|
||||
* @param string $domain <20><><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>ȡHTTP_HOST<53><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByDomain($domain = '')
|
||||
{
|
||||
if(empty($domain)) $domain = $_SERVER['HTTP_HOST'];
|
||||
return $this->dao->findByPMS($domain)->from(TABLE_COMPANY)->fetch();
|
||||
}
|
||||
|
||||
/* ͨ<><CDA8>id<69><64>ȡ<EFBFBD><C8A1>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2>*/
|
||||
public function getByID($companyID = '')
|
||||
{
|
||||
return $this->dao->findById((int)$companyID)->from(TABLE_COMPANY)->fetch();
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>˾<EFBFBD><CBBE>*/
|
||||
public function create()
|
||||
{
|
||||
$company = fixer::input('post')->get();
|
||||
$this->dao->insert(TABLE_COMPANY)
|
||||
->data($company)
|
||||
->autoCheck()
|
||||
->batchCheck('name, pms', 'notempty')
|
||||
->batchCheck('name,pms', 'unique')
|
||||
->exec();
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>˾<EFBFBD><CBBE>Ϣ<EFBFBD><CFA2>*/
|
||||
public function update($companyID)
|
||||
{
|
||||
$company = fixer::input('post')->get();
|
||||
$this->dao->update(TABLE_COMPANY)
|
||||
->data($company)
|
||||
->autoCheck()
|
||||
->batchCheck('name, pms', 'notempty')
|
||||
->batchCheck('name,pms', 'unique', "id != '$companyID'")
|
||||
->where('id')->eq($companyID)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/* ɾ<><C9BE>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>˾<EFBFBD><CBBE>*/
|
||||
public function delete($companyID)
|
||||
{
|
||||
return $this->dao->delete()->from(TABLE_COMPANY)->where('id')->eq((int)$companyID)->limit(1)->exec();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of product dept of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package product
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
include '../../common/header.html.php';
|
||||
include '../../common/treeview.html.php';
|
||||
include '../../common/tablesorter.html.php';
|
||||
?>
|
||||
<div class="yui-d0 yui-t7">
|
||||
<div class="yui-b">
|
||||
<div class='box-title'><?php echo $lang->dept->common;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $deptTree;?>
|
||||
<div class='a-right'>
|
||||
<?php
|
||||
common::printLink('dept', 'browse', '', $lang->dept->manage);
|
||||
common::printLink('user', 'create', "companyID={$this->app->company->id}&from=company", $lang->user->create);
|
||||
common::printLink('company', 'browse', '', $lang->user->allUsers);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<table class='table-1 tablesorter'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->user->id;?></th>
|
||||
<th><?php echo $lang->user->realname;?></th>
|
||||
<th><?php echo $lang->user->account;?></th>
|
||||
<th><?php echo $lang->user->nickname;?></th>
|
||||
<th><?php echo $lang->user->email;?></th>
|
||||
<th><?php echo $lang->user->gendar;?></th>
|
||||
<th><?php echo $lang->user->phone;?></th>
|
||||
<th><?php echo $lang->user->join;?></th>
|
||||
<th><?php echo $lang->user->visits;?></th>
|
||||
<th><?php echo $lang->action;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($users as $user):?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $user->id;?></td>
|
||||
<td><?php if(!common::printLink('user', 'view', "account=$user->account", $user->realname)) echo $user->realname;?></td>
|
||||
<td><?php echo $user->account;?></td>
|
||||
<td><?php echo $user->nickname;?></td>
|
||||
<td><?php echo html::mailto($user->email);?></td>
|
||||
<td><?php if(isset($lang->user->gendarList->{$user->gendar})) echo $lang->user->gendarList->{$user->gendar};?></td>
|
||||
<td><?php echo $user->phone;?></td>
|
||||
<td><?php echo $user->join;?></td>
|
||||
<td><?php echo $user->visits;?></td>
|
||||
<td>
|
||||
<?php common::printLink('user', 'edit', "userID=$user->id&from=company", $lang->user->edit);?>
|
||||
<?php common::printLink('user', 'delete', "userID=$user->id", $lang->user->delete, "hiddenwin");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script lanugage='Javascript'>$('#dept<?php echo $deptID;?>').addClass('active');</script>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of company module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package company
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-5'>
|
||||
<caption><?php echo $lang->company->create;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->name;?></th>
|
||||
<td><input type='text' name='name' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->phone;?></th>
|
||||
<td><input type='text' name='phone' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->fax;?></th>
|
||||
<td><input type='text' name='fax' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->address;?></th>
|
||||
<td><input type='text' name='address' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->zipcode;?></th>
|
||||
<td><input type='text' name='zipcode' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->website;?></th>
|
||||
<td><input type='text' name='website' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->backyard;?></th>
|
||||
<td><input type='text' name='backyard' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->pms;?></th>
|
||||
<td><input type='text' name='pms' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->guest;?></th>
|
||||
<td><?php echo html::radio('guest', $lang->company->guestList);?></td>
|
||||
</tr>
|
||||
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view of company module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package company
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-5 a-left'>
|
||||
<caption><?php echo $lang->company->create;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->name;?></th>
|
||||
<td><input type='text' name='name' value='<?php echo $company->name;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->phone;?></th>
|
||||
<td><input type='text' name='phone' value='<?php echo $company->phone;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->fax;?></th>
|
||||
<td><input type='text' name='fax' value='<?php echo $company->fax;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->address;?></th>
|
||||
<td><input type='text' name='address' value='<?php echo $company->address;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->zipcode;?></th>
|
||||
<td><input type='text' name='zipcode' value='<?php echo $company->zipcode;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->website;?></th>
|
||||
<td><input type='text' name='website' value='<?php echo $company->website;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->backyard;?></th>
|
||||
<td><input type='text' name='backyard' value='<?php echo $company->backyard;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->pms;?></th>
|
||||
<td><input type='text' name='pms' value='<?php echo $company->pms;?>' class='text-1' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->guest;?></th>
|
||||
<td><?php echo html::radio('guest', $lang->company->guestList, $company->guest);?></td>
|
||||
</tr>
|
||||
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
93
tags/zentaopms_0.3_beta_20100103/module/dept/control.php
Normal file
93
tags/zentaopms_0.3_beta_20100103/module/dept/control.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of dept module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package dept
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class dept extends control
|
||||
{
|
||||
const NEW_CHILD_COUNT = 5;
|
||||
|
||||
/* 部门列表。*/
|
||||
public function browse($deptID = 0)
|
||||
{
|
||||
$header['title'] = $this->lang->dept->manage . $this->lang->colon . $this->app->company->name;
|
||||
$position[] = $this->lang->dept->manage;
|
||||
|
||||
$parentDepts = $this->dept->getParents($deptID);
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('deptID', $deptID);
|
||||
$this->assign('depts', $this->dept->getTreeMenu($rooteDeptID = 0, array('deptmodel', 'createManageLink')));
|
||||
$this->assign('parentDepts',$parentDepts);
|
||||
$this->assign('sons', $this->dept->getSons($deptID));
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 编辑部门。*/
|
||||
public function edit($moduleID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
if($this->product->update($_POST)) die(js::locate($this->createLink($this->moduleName, 'index', "product=$_POST[id]"), 'parent'));
|
||||
}
|
||||
|
||||
$product = $this->product->getByID($productID);
|
||||
$header['title'] = $this->lang->product->edit . $this->lang->colon . $product->name;
|
||||
$this->assign('header', $header);
|
||||
$this->assign('product', $product);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 更新排序。*/
|
||||
public function updateOrder()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->dept->updateOrder($_POST['orders']);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/* 维护下级部门。*/
|
||||
public function manageChild()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->dept->manageChild($_POST['parentDeptID'], $_POST['depts']);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/* 删除某一个部门。*/
|
||||
public function delete($deptID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
echo js::confirm($this->lang->dept->confirmDelete, $this->createLink('dept', 'delete', "deptID=$deptID&confirm=yes"));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->dept->delete($deptID);
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
}
|
||||
35
tags/zentaopms_0.3_beta_20100103/module/dept/lang/zh-cn.php
Normal file
35
tags/zentaopms_0.3_beta_20100103/module/dept/lang/zh-cn.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* The dept module zh-cn file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package dept
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang->dept->common = '部门结构';
|
||||
$lang->dept->add = "添加";
|
||||
$lang->dept->addChild = "添加下级部门";
|
||||
$lang->dept->manageChild = "下级";
|
||||
$lang->dept->delete = "删除";
|
||||
$lang->dept->browse = "部门列表";
|
||||
$lang->dept->manage = "维护部门结构";
|
||||
$lang->dept->updateOrder = "更新排序";
|
||||
$lang->dept->users = "成员列表";
|
||||
|
||||
$lang->dept->saveButton = " 保存 (S) ";
|
||||
$lang->dept->confirmDelete = " 您确定删除该部门吗?";
|
||||
247
tags/zentaopms_0.3_beta_20100103/module/dept/model.php
Normal file
247
tags/zentaopms_0.3_beta_20100103/module/dept/model.php
Normal file
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of dept dept of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@gmail.com>
|
||||
* @package dept
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class deptModel extends model
|
||||
{
|
||||
/* 通过部门id获取部门信息。*/
|
||||
public function getByID($deptID)
|
||||
{
|
||||
return $this->dbh->query("SELECT * FROM " . TABLE_DEPT . " WHERE id = '$deptID'")->fetch();
|
||||
}
|
||||
|
||||
/* 生成查询的sql语句。*/
|
||||
private function buildMenuQuery($rootDeptID)
|
||||
{
|
||||
$sql = "SELECT * FROM " . TABLE_DEPT . " WHERE company = {$this->app->company->id}";
|
||||
if($rootDeptID > 0)
|
||||
{
|
||||
$rootDept = $this->getByID($rootDeptID);
|
||||
if($rootDept) $sql .= " AND `path` LIKE '$rootDept->path%'";
|
||||
}
|
||||
$sql .= " ORDER BY grade DESC, `order`";
|
||||
return $sql;
|
||||
}
|
||||
|
||||
/* 获取部门的下类列表,用于生成select控件。*/
|
||||
function getOptionMenu($rootDeptID = 0)
|
||||
{
|
||||
$deptMenu = array();
|
||||
$stmt = $this->dbh->query($this->buildMenuQuery($rootDeptID));
|
||||
$depts = array();
|
||||
while($dept = $stmt->fetch()) $depts[$dept->id] = $dept;
|
||||
|
||||
foreach($depts as $dept)
|
||||
{
|
||||
$parentDepts = explode(',', $dept->path);
|
||||
$deptName = '/';
|
||||
foreach($parentDepts as $parentDeptID)
|
||||
{
|
||||
if(empty($parentDeptID)) continue;
|
||||
$deptName .= $depts[$parentDeptID]->name . '/';
|
||||
}
|
||||
$deptName = rtrim($deptName, '/');
|
||||
$deptName .= "|$dept->id\n";
|
||||
|
||||
if(isset($deptMenu[$dept->id]) and !empty($deptMenu[$dept->id]))
|
||||
{
|
||||
if(isset($deptMenu[$dept->parent]))
|
||||
{
|
||||
$deptMenu[$dept->parent] .= $deptName;
|
||||
}
|
||||
else
|
||||
{
|
||||
$deptMenu[$dept->parent] = $deptName;;
|
||||
}
|
||||
$deptMenu[$dept->parent] .= $deptMenu[$dept->id];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($deptMenu[$dept->parent]) and !empty($deptMenu[$dept->parent]))
|
||||
{
|
||||
$deptMenu[$dept->parent] .= $deptName;
|
||||
}
|
||||
else
|
||||
{
|
||||
$deptMenu[$dept->parent] = $deptName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$topMenu = @array_pop($deptMenu);
|
||||
$topMenu = explode("\n", trim($topMenu));
|
||||
$lastMenu[] = '/';
|
||||
foreach($topMenu as $menu)
|
||||
{
|
||||
if(!strpos($menu, '|')) continue;
|
||||
list($label, $deptID) = explode('|', $menu);
|
||||
$lastMenu[$deptID] = $label;
|
||||
}
|
||||
return $lastMenu;
|
||||
}
|
||||
|
||||
/* 获取树状的部门列表。*/
|
||||
function getTreeMenu($rootDeptID = 0, $userFunc)
|
||||
{
|
||||
$deptMenu = array();
|
||||
$stmt = $this->dbh->query($this->buildMenuQuery($rootDeptID));
|
||||
while($dept = $stmt->fetch())
|
||||
{
|
||||
$linkHtml = call_user_func($userFunc, $dept);
|
||||
|
||||
if(isset($deptMenu[$dept->id]) and !empty($deptMenu[$dept->id]))
|
||||
{
|
||||
if(!isset($deptMenu[$dept->parent])) $deptMenu[$dept->parent] = '';
|
||||
$deptMenu[$dept->parent] .= "<li>$linkHtml";
|
||||
$deptMenu[$dept->parent] .= "<ul>".$deptMenu[$dept->id]."</ul>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($deptMenu[$dept->parent]) and !empty($deptMenu[$dept->parent]))
|
||||
{
|
||||
$deptMenu[$dept->parent] .= "<li>$linkHtml\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$deptMenu[$dept->parent] = "<li>$linkHtml\n";
|
||||
}
|
||||
}
|
||||
$deptMenu[$dept->parent] .= "</li>\n";
|
||||
}
|
||||
|
||||
$lastMenu = "<ul id='tree'>" . @array_pop($deptMenu) . "</ul>\n";
|
||||
return $lastMenu;
|
||||
}
|
||||
|
||||
/* 生成编辑链接。*/
|
||||
function createManageLink($dept)
|
||||
{
|
||||
$linkHtml = $dept->name;
|
||||
$linkHtml .= ' ' . html::a(helper::createLink('dept', 'browse', "deptid={$dept->id}"), $this->lang->dept->manageChild);
|
||||
$linkHtml .= ' ' . html::a(helper::createLink('dept', 'delete', "deptid={$dept->id}"), $this->lang->dept->delete, 'hiddenwin');
|
||||
$linkHtml .= ' ' . html::input("orders[$dept->id]", $dept->order, 'style="width:30px;text-align:center"');
|
||||
return $linkHtml;
|
||||
}
|
||||
|
||||
/* 生成用户链接。*/
|
||||
function createMemberLink($dept)
|
||||
{
|
||||
$linkHtml = html::a(helper::createLink('company', 'browse', "dept={$dept->id}"), $dept->name, '_self', "id='dept{$dept->id}'");
|
||||
return $linkHtml;
|
||||
}
|
||||
|
||||
/* 获得某一个部门的直接下级部门。*/
|
||||
public function getSons($deptID)
|
||||
{
|
||||
$sql = "SELECT * FROM " . TABLE_DEPT . " WHERE parent = '$deptID' ORDER BY `order`";
|
||||
return $this->dbh->query($sql)->fetchAll();
|
||||
}
|
||||
|
||||
/* 获得一个部门的id列表。*/
|
||||
public function getAllChildId($deptID)
|
||||
{
|
||||
if($deptID == 0) return array();
|
||||
$dept = $this->getById($deptID);
|
||||
$sql = "SELECT id FROM " . TABLE_DEPT . " WHERE path LIKE '{$dept->path}%'";
|
||||
$stmt = $this->dbh->query($sql);
|
||||
$deptIds = array();
|
||||
while($id = $stmt->fetchColumn()) $deptIds[] = $id;
|
||||
return $deptIds;
|
||||
}
|
||||
|
||||
/* 获得一个部门的所有上级部门。*/
|
||||
public function getParents($deptID)
|
||||
{
|
||||
if($deptID == 0) return array();
|
||||
$sql = "SELECT path FROM " . TABLE_DEPT . " WHERE id = '$deptID'";
|
||||
$path = $this->dbh->query($sql)->fetchColumn();
|
||||
$path = substr($path, 1, -1);
|
||||
if(empty($path)) return array();
|
||||
$sql = "SELECT * FROM " . TABLE_DEPT . " WHERE id IN($path) ORDER BY grade";
|
||||
$parents = $this->dbh->query($sql)->fetchAll();
|
||||
return $parents;
|
||||
}
|
||||
|
||||
/* 更新排序信息。*/
|
||||
public function updateOrder($orders)
|
||||
{
|
||||
foreach($orders as $deptID => $order)
|
||||
{
|
||||
$sql = "UPDATE " . TABLE_DEPT . " SET `order` = '$order' WHERE id = '$deptID' LIMIT 1";
|
||||
$this->dbh->exec($sql);
|
||||
}
|
||||
}
|
||||
|
||||
/* 更新某一个部门的子部门。*/
|
||||
public function manageChild($parentDeptID, $childs)
|
||||
{
|
||||
$parentDept = $this->getByID($parentDeptID);
|
||||
if($parentDept)
|
||||
{
|
||||
$grade = $parentDept->grade + 1;
|
||||
$parentPath = $parentDept->path;
|
||||
}
|
||||
else
|
||||
{
|
||||
$grade = 1;
|
||||
$parentPath = ',';
|
||||
}
|
||||
|
||||
foreach($childs as $deptID => $deptName)
|
||||
{
|
||||
if(empty($deptName)) continue;
|
||||
if(is_numeric($deptID))
|
||||
{
|
||||
$sql = "INSERT INTO " . TABLE_DEPT . "(`company`, `name`, `parent`, `path`, `grade`)
|
||||
VALUES('{$this->app->company->id}', '$deptName', '$parentDeptID', '', '$grade')";
|
||||
$this->dbh->exec($sql);
|
||||
$deptID = $this->dbh->lastInsertID();
|
||||
$childPath = $parentPath . "$deptID,";
|
||||
$sql = "UPDATE " . TABLE_DEPT . " SET `path` = '$childPath' WHERE id = '$deptID' LIMIT 1";
|
||||
$this->dbh->exec($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$deptID = str_replace('id', '', $deptID);
|
||||
$sql = "UPDATE " . TABLE_DEPT . " SET `name` = '$deptName' WHERE id = '$deptID' LIMIT 1";
|
||||
$this->dbh->exec($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 获得某一个部门的成员列表。*/
|
||||
public function getUsers($deptID)
|
||||
{
|
||||
$sql = $this->dao->select('*')->from(TABLE_USER);
|
||||
if($deptID) $sql->where('dept')->in($deptID);
|
||||
return $sql->orderBy('id')->fetchAll();
|
||||
}
|
||||
|
||||
/* 删除一个部门。Todo: 需要修改下级目录的权限,还有对应的需求列表。*/
|
||||
function delete($deptID)
|
||||
{
|
||||
$sql = "DELETE FROM " . TABLE_DEPT . " WHERE id = '$deptID' LIMIT 1";
|
||||
return $this->dbh->exec($sql);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of dept module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package dept
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/treeview.html.php';?>
|
||||
<div class="yui-d0 yui-t3">
|
||||
<div class="yui-b">
|
||||
<form method='post' target='hiddenwin' action='<?php echo $this->createLink('dept', 'updateOrder');?>'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $header->title;?></caption>
|
||||
<tr>
|
||||
<td>
|
||||
<div id='main'><?php echo $depts;?></div>
|
||||
<div class='a-center'><?php echo html::submitButton($lang->dept->updateOrder);?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<form method='post' target='hiddenwin' action='<?php echo $this->createLink('dept', 'manageChild');?>'>
|
||||
<table align='center' class='table-1'>
|
||||
<caption><?php echo $lang->dept->manageChild;?></caption>
|
||||
<tr>
|
||||
<td width='10%'>
|
||||
<nobr>
|
||||
<?php
|
||||
echo html::a($this->createLink('dept', 'browse'), $this->app->company->name);
|
||||
echo $lang->arrow;
|
||||
foreach($parentDepts as $dept)
|
||||
{
|
||||
echo html::a($this->createLink('dept', 'browse', "deptID=$dept->id"), $dept->name);
|
||||
echo $lang->arrow;
|
||||
}
|
||||
?>
|
||||
</nobr>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
foreach($sons as $sonDept) echo html::input("depts[id$sonDept->id]", $sonDept->name) . '<br />';
|
||||
for($i = 0; $i < DEPT::NEW_CHILD_COUNT ; $i ++) echo html::input("depts[]") . '<br />';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='a-center' colspan='2'>
|
||||
<?php echo html::submitButton() . html::resetButton();?>
|
||||
<input type='hidden' value='<?php echo $deptID;?>' name='parentDeptID' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of product module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package product
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div id='doc3'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-4'>
|
||||
<caption><?php echo $lang->product->create;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->product->name;?></th>
|
||||
<td class='a-left'><input type='text' name='name' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->product->code;?></th>
|
||||
<td class='a-left'><input type='text' name='code' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->product->desc;?></th>
|
||||
<td class='a-left'><textarea name='desc' style='width:100%' rows='5'></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<input type='submit' value='<?php echo $lang->product->saveButton;?>' accesskey='S' />
|
||||
<input type='reset' value='<?php echo $lang->reset;?>' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view of product module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package product
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<div id='doc3'>
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table align='center' class='table-4'>
|
||||
<caption><?php echo $lang->product->edit;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->product->name;?></th>
|
||||
<td class='a-left'><input type='text' name='name' value='<?php echo $product->name;?>' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->product->code;?></th>
|
||||
<td class='a-left'><input type='text' name='code' value='<?php echo $product->code;?>' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->product->desc;?></th>
|
||||
<td class='a-left'><textarea name='desc' style='width:100%' rows='5'><?php echo $product->desc;?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<input type='submit' value='<?php echo $lang->product->saveButton;?>' accesskey='S' />
|
||||
<input type='reset' value='<?php echo $lang->reset;?>' />
|
||||
<input type='hidden' value='<?php echo $product->id;?>' name='id' />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
26
tags/zentaopms_0.3_beta_20100103/module/file/control.php
Normal file
26
tags/zentaopms_0.3_beta_20100103/module/file/control.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of file module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package file
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class file extends control
|
||||
{
|
||||
}
|
||||
24
tags/zentaopms_0.3_beta_20100103/module/file/lang/zh-cn.php
Normal file
24
tags/zentaopms_0.3_beta_20100103/module/file/lang/zh-cn.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* The file module zh-cn file of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package file
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
$lang->file->common = '附件';
|
||||
134
tags/zentaopms_0.3_beta_20100103/module/file/model.php
Normal file
134
tags/zentaopms_0.3_beta_20100103/module/file/model.php
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of file module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package file
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class fileModel extends model
|
||||
{
|
||||
public $savePath = '';
|
||||
public $webPath = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setSavePath();
|
||||
$this->setWebPath();
|
||||
}
|
||||
|
||||
public function getByObject($objectType, $objectID)
|
||||
{
|
||||
$files = array();
|
||||
$stmt = $this->dao->select('*')->from(TABLE_FILE)->where('objectType')->eq($objectType)->andWhere('objectID')->eq((int)$objectID)->query();
|
||||
while($file = $stmt->fetch())
|
||||
{
|
||||
$file->fullPath = $this->webPath . $file->pathname;
|
||||
$files[] = $file;
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
/* 保存上传的文件。*/
|
||||
public function saveUpload($htmlTagName = 'files', $objectType = '', $objectID = '')
|
||||
{
|
||||
$fileTitles = array();
|
||||
$now = date('Y-m-d H:i:s');
|
||||
$files = $this->getUpload($htmlTagName);
|
||||
|
||||
foreach($files as $id => $file)
|
||||
{
|
||||
move_uploaded_file($file['tmpname'], $this->savePath . $file['pathname']);
|
||||
$file['company'] = $this->app->company->id;
|
||||
$file['objectType'] = $objectType;
|
||||
$file['objectID'] = $objectID;
|
||||
$file['addedBy'] = $this->app->user->account;
|
||||
$file['addedDate'] = $now;
|
||||
unset($file['tmpname']);
|
||||
$this->dao->insert(TABLE_FILE)->data($file)->exec();
|
||||
$fileTitles[$this->dao->lastInsertId()] = $file['title'];
|
||||
}
|
||||
return $fileTitles;
|
||||
}
|
||||
|
||||
/* 获取上传的文件信息。*/
|
||||
private function getUpload($htmlTagName)
|
||||
{
|
||||
$files = array();
|
||||
if(!isset($_FILES[$htmlTagName])) return $files;
|
||||
|
||||
/* 表单定义中的变量名是数组。*/
|
||||
if(is_array($_FILES[$htmlTagName]['name']))
|
||||
{
|
||||
extract($_FILES[$htmlTagName]);
|
||||
foreach($name as $id => $filename)
|
||||
{
|
||||
if(empty($filename)) continue;
|
||||
$file['extension'] = $this->getExtension($filename);
|
||||
$file['pathname'] = $this->setPathName($id, $file['extension']);
|
||||
$file['title'] = pathinfo($filename, PATHINFO_FILENAME);
|
||||
$file['size'] = $size[$id];
|
||||
$file['tmpname'] = $tmp_name[$id];
|
||||
$files[] = $file;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($_FILES[$htmlTagName]['name'])) return $files;
|
||||
extract($_FILES[$htmlTagName]);
|
||||
$file['extension'] = $this->getExtension($name);
|
||||
$file['pathname'] = $this->setPathName(0, $file['extension']);
|
||||
$file['title'] = pathinfo($name, PATHINFO_FILENAME);
|
||||
$file['size'] = $size;
|
||||
$file['tmpname'] = $tmp_name;
|
||||
return array($file);
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
/* 获取文件扩展名。*/
|
||||
private function getExtension($filename)
|
||||
{
|
||||
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
if(empty($extension)) return 'txt';
|
||||
if(strpos($this->config->file->dangers, $extension) !== false) return 'txt';
|
||||
return $extension;
|
||||
}
|
||||
|
||||
/* 设置要存储的文件名。*/
|
||||
private function setPathName($fileID, $extension)
|
||||
{
|
||||
return date('YmdHis') . $fileID . mt_rand(0, 10000) . '.' . $extension;
|
||||
}
|
||||
|
||||
/* 设置存储路径。*/
|
||||
private function setSavePath()
|
||||
{
|
||||
$this->savePath = $this->app->getAppRoot() . "www/data/upload/{$this->app->company->id}/";
|
||||
if(!file_exists($this->savePath)) mkdir($this->savePath, 0777, true);
|
||||
}
|
||||
|
||||
/* 设置web访问路径。*/
|
||||
private function setWebPath()
|
||||
{
|
||||
$this->webPath = $this->app->getWebRoot() . "data/upload/{$this->app->company->id}/";
|
||||
}
|
||||
}
|
||||
154
tags/zentaopms_0.3_beta_20100103/module/group/control.php
Normal file
154
tags/zentaopms_0.3_beta_20100103/module/group/control.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of group module of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright: 2009 Chunsheng Wang
|
||||
* @author Chunsheng Wang <wwccss@263.net>
|
||||
* @package group
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.cn
|
||||
*/
|
||||
class group extends control
|
||||
{
|
||||
/* 构造函数。*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('admin');
|
||||
$this->loadModel('user');
|
||||
}
|
||||
|
||||
/* 分组列表。*/
|
||||
public function browse($companyID = 0)
|
||||
{
|
||||
if($companyID == 0) $companyID = $this->app->company->id;
|
||||
|
||||
$header['title'] = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->browse;
|
||||
$position[] = $this->lang->group->browse;
|
||||
|
||||
$groups = $this->group->getList($companyID);
|
||||
$groupUsers = array();
|
||||
foreach($groups as $group) $groupUsers[$group->id] = $this->group->getUserPairs($group->id);
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('groups', $groups);
|
||||
$this->assign('groupUsers', $groupUsers);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 创建一个用户组。*/
|
||||
public function create($companyID = 0)
|
||||
{
|
||||
if($companyID == 0) $companyID = $this->app->company->id;
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->group->create($companyID);
|
||||
die(js::locate($this->createLink('group', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
$header['title'] = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->create;
|
||||
$position[] = $this->lang->group->create;
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 编辑一个用户。*/
|
||||
public function edit($groupID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->group->update($groupID);
|
||||
die(js::locate($this->createLink('group', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
$header['title'] = $this->lang->company->orgView . $this->lang->colon . $this->lang->group->edit;
|
||||
$position[] = $this->lang->group->edit;
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('group', $this->group->getById($groupID));
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 维护权限。*/
|
||||
public function managePriv($groupID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->group->updatePriv($groupID);
|
||||
die(js::alert($this->lang->group->successSaved));
|
||||
}
|
||||
$group = $this->group->getById($groupID);
|
||||
$groupPrivs = $this->group->getPrivs($groupID);
|
||||
|
||||
$header['title'] = $this->lang->admin->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->managePriv;
|
||||
$position[] = html::a($this->createLink('admin', 'browsegroup', "companyid={$this->app->company->id}"), $this->lang->admin->group);
|
||||
$position[] = $group->name . $this->lang->colon . $this->lang->group->managePriv;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('group', $group);
|
||||
$this->assign('groupPrivs', $groupPrivs);
|
||||
|
||||
/* 加载每一个模块的语言文件。*/
|
||||
foreach($this->lang->resource as $moduleName => $action) $this->app->loadLang($moduleName);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 维护用户。*/
|
||||
public function manageMember($groupID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->group->updateUser($groupID);
|
||||
die(js::locate($this->createLink('group', 'browse'), 'parent'));
|
||||
}
|
||||
$group = $this->group->getById($groupID);
|
||||
$groupUsers = $this->group->getUserPairs($groupID);
|
||||
$groupUsers = join(',', array_keys($groupUsers));
|
||||
$allUsers = $this->user->getPairs($this->app->company->id, 'noclosed|noempty|noletter');
|
||||
|
||||
$header['title'] = $this->lang->admin->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->manageMember;
|
||||
$position[] = html::a($this->createLink('admin', 'browsegroup', "companyid={$this->app->company->id}"), $this->lang->admin->group);
|
||||
$position[] = $group->name . $this->lang->colon . $this->lang->group->manageMember;
|
||||
|
||||
$this->assign('header', $header);
|
||||
$this->assign('position', $position);
|
||||
$this->assign('group', $group);
|
||||
$this->assign('groupUsers', $groupUsers);
|
||||
$this->assign('allUsers', $allUsers);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 删除一个分组。*/
|
||||
public function delete($groupID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->group->confirmDelete, $this->createLink('group', 'delete', "groupID=$groupID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->group->delete($groupID);
|
||||
die(js::locate($this->createLink('group', 'browse'), 'parent'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user