Merge branch 'master' of github.com:easysoft/zentaopms

Conflicts:
	module/project/css/task.css
This commit is contained in:
chenfeiCF
2016-11-28 09:11:57 +08:00
41 changed files with 528 additions and 473 deletions
+16 -73
View File
@@ -221,7 +221,7 @@ class bug extends control
}
$actionID = $this->action->create('bug', $bugID, 'Opened');
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
$location = $this->createLink('bug', 'browse', "productID={$this->post->product}&branch=$branch&type=byModule&param={$this->post->module}");
$response['locate'] = isset($_SESSION['bugList']) ? $this->session->bugList : $location;
@@ -361,7 +361,7 @@ class bug extends control
if(!empty($_POST))
{
$actions = $this->bug->batchCreate($productID, $branch);
foreach($actions as $bugID => $actionID) $this->sendmail($bugID, $actionID);
foreach($actions as $bugID => $actionID) $this->bug->sendmail($bugID, $actionID);
die(js::locate($this->session->bugList, 'parent'));
}
@@ -502,7 +502,7 @@ class bug extends control
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
$actionID = $this->action->create('bug', $bugID, $action, $fileAction . $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
}
$bug = $this->bug->getById($bugID);
@@ -597,7 +597,7 @@ class bug extends control
$actionID = $this->action->create('bug', $bugID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
$bug = $this->bug->getById($bugID);
if($bug->toTask != 0)
@@ -701,7 +701,7 @@ class bug extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('bug', $bugID, 'Assigned', $this->post->comment, $this->post->assignedTo);
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
@@ -737,7 +737,7 @@ class bug extends control
$this->loadModel('action');
$actionID = $this->action->create('bug', $bugID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
}
}
die(js::locate($this->session->bugList, 'parent'));
@@ -763,7 +763,7 @@ class bug extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('bug', $bugID, 'Assigned', $this->post->comment, $this->post->assignedTo);
$this->action->logHistory($actionID, $changes);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
}
}
if($type == 'product') die(js::locate($this->createLink('bug', 'browse', "productID=$projectID")));
@@ -785,7 +785,7 @@ class bug extends control
$this->bug->confirm($bugID);
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('bug', $bugID, 'bugConfirmed', $this->post->comment);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -818,7 +818,7 @@ class bug extends control
foreach($bugIDList as $bugID)
{
$actionID = $this->action->create('bug', $bugID, 'bugConfirmed');
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
}
die(js::locate($this->session->bugList, 'parent'));
}
@@ -840,7 +840,7 @@ class bug extends control
$fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';
$actionID = $this->action->create('bug', $bugID, 'Resolved', $fileAction . $this->post->comment, $this->post->resolution . ($this->post->duplicateBug ? ':' . (int)$this->post->duplicateBug : ''));
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
$bug = $this->bug->getById($bugID);
if($bug->toTask != 0)
@@ -896,7 +896,7 @@ class bug extends control
foreach($bugIDList as $bugID)
{
$actionID = $this->action->create('bug', $bugID, 'Resolved', '', $resolution);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
}
die(js::locate($this->session->bugList, 'parent'));
}
@@ -916,7 +916,7 @@ class bug extends control
if(dao::isError()) die(js::error(dao::getError()));
$files = $this->loadModel('file')->saveUpload('bug', $bugID);
$actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment);
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -951,7 +951,7 @@ class bug extends control
$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);
$this->bug->sendmail($bugID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent'));
}
@@ -1083,7 +1083,7 @@ class bug extends control
$this->bug->close($bugID);
$actionID = $this->action->create('bug', $bugID, 'Closed');
$this->sendmail($bugID, $actionID);
$this->bug->sendmail($bugID, $actionID);
}
if(isset($skipBugs)) echo js::alert(sprintf($this->lang->bug->skipClose, join(',', $skipBugs)));
@@ -1263,64 +1263,6 @@ class bug extends control
$this->display();
}
/**
* Send email.
*
* @param int $bugID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($bugID, $actionID)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$bug = $this->bug->getByID($bugID);
$productName = $this->products[$bug->product];
$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;
}
/* Get action info. */
$actions = $this->action->getList('bug', $bugID);
$action = zget($actions, $actionID, null);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
if(strtolower($action->action) == 'opened') $action->comment = $bug->steps;
/* Create the mail content. */
if($action->action == 'opened') $action->comment = '';
$this->view->bug = $bug;
$this->view->action = $action;
$this->view->users = $this->user->getPairs('noletter');
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send it. */
$this->loadModel('mail')->send($toList, 'BUG #'. $bug->id . ' ' . $bug->title . ' - ' . $productName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
/**
* Get data to export
*
@@ -1333,6 +1275,7 @@ class bug extends control
{
if($_POST)
{
$this->loadModel('file');
$bugLang = $this->lang->bug;
$bugConfig = $this->config->bug;
@@ -1469,7 +1412,7 @@ class bug extends control
{
foreach($relatedFiles[$bug->id] as $file)
{
$fileURL = 'http://' . $this->server->http_host . $this->config->webRoot . "data/upload/{$this->app->company->id}/" . $file->pathname;
$fileURL = common::getSysURL() . $this->file->webPath . $file->pathname;
$bug->files .= html::a($fileURL, $file->title, '_blank') . '<br />';
}
}
+3
View File
@@ -13,3 +13,6 @@
.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
.dropdown-list > li > a:hover,
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
#treebox{position:fixed;margin-left:20px;}
.outer.hide-side #treebox{margin-left:0px;}
+6
View File
@@ -19,4 +19,10 @@ $(document).ready(function()
});
setTimeout(function(){fixedTfootAction('#bugForm')}, 100);
setTimeout(function(){fixedTheadOfList('#bugList')}, 100);
var treeMaxHeight = document.documentElement.clientHeight - $('#header').height() - $('#featurebar').height() - $('#footer').height() - $('#treebox .side-body .panel-heading').height() - 120;
if($('#treebox').height() > $('#bugList').height()) treeMaxHeight -= 20;
$('#treebox .side-body .panel-body').children().each(function(){if(!$(this).hasClass('tree')) treeMaxHeight -= $(this).height()});
$('#treebox .tree').css({'max-height':treeMaxHeight, 'overflow-y': 'auto', 'overflow-x':'hidden'})
if(moduleID > 0)$('#treebox .tree').scrollTop($('#treebox .tree #module' + moduleID).offset().top - $('#treebox .tree li[data-id="1"]').offset().top);
});
+65
View File
@@ -2163,4 +2163,69 @@ class bugModel extends model
echo '</td>';
}
}
/**
* Send mail
*
* @param int $bugID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($bugID, $actionID)
{
$this->loadModel('mail');
$bug = $this->getByID($bugID);
$productName = $this->loadModel('product')->getById($bug->product)->name;
$users = $this->loadModel('user')->getPairs('noletter');
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Get mail content. */
$modulePath = $this->app->getModulePath();
$oldcwd = getcwd();
$viewFile = $modulePath . 'view/sendmail.html.php';
chdir($modulePath . 'view');
if(file_exists($modulePath . 'ext/view/sendmail.html.php'))
{
$viewFile = $modulePath . 'ext/view/sendmail.html.php';
chdir($modulePath . 'ext/view');
}
ob_start();
include $viewFile;
foreach(glob($modulePath . 'ext/view/sendmail.*.html.hook.php') as $hookFile) include $hookFile;
$mailContent = ob_get_contents();
ob_end_clean();
chdir($oldcwd);
/* Set toList and ccList. */
$toList = $bug->assignedTo;
$ccList = trim($bug->mailto, ',');
if(empty($toList))
{
if(empty($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;
}
/* Send it. */
$this->mail->send($toList, 'BUG #'. $bug->id . ' ' . $bug->title . ' - ' . $productName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
}
+4 -4
View File
@@ -11,12 +11,12 @@
*/
?>
<?php $mailTitle = 'BUG #' . $bug->id . ' ' . $bug->title;?>
<?php include '../../common/view/mail.header.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(common::getSysURL() . $this->createLink('bug', 'view', "bugID=$bug->id"), $mailTitle, '', "style='color: #333'");?></td>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('bug', 'view', "bugID=$bug->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?></td>
</tr>
</table>
</td>
@@ -24,9 +24,9 @@
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $lang->bug->legendSteps;?></legend>
<legend style='color: #114f8e'><?php echo $this->lang->bug->legendSteps;?></legend>
<div style='padding:5px;'><?php echo $bug->steps;?></div>
</fieldset>
</td>
</tr>
<?php include '../../common/view/mail.footer.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.footer.html.php';?>
+1
View File
@@ -870,6 +870,7 @@ class commonModel extends model
if(strtolower($key) == 'assigneddate') continue;
if(strtolower($key) == 'editedby') continue;
if(strtolower($key) == 'editeddate') continue;
if(strtolower($key) == 'uid') continue;
if($magicQuote) $value = stripslashes($value);
if($value != stripslashes($old->$key))
+19 -6
View File
@@ -1,20 +1,33 @@
<?php
$extViewFile = $this->app->getModuleRoot() . 'ext/view/' . basename(__FILE__);
if(file_exists($extViewFile))
{
include $extViewFile;
return;
}
?>
<?php if(!empty($action)): ?>
<?php if(!empty($action->comment)):?>
<tr>
<td style="padding:0px 10px 10px 10px; border: none;">
<fieldset style="border: 1px solid #e5e5e5">
<legend style="color: #114f8e"><?php echo $this->lang->comment?></legend>
<div style="padding:5px;"><?php echo $action->comment?></div>
</fieldset>
</td>
</tr>
<?php endif;?>
<tr>
<td style='padding: 10px; background-color: #FFF0D5'>
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
<?php if(isset($users[$action->actor])) $action->actor = $users[$action->actor];?>
<?php if(isset($users[$action->extra])) $action->extra = $users[$action->extra];?>
<span style='font-size: 16px; color: #F1A325'>●</span> &nbsp;<span><?php $this->action->printAction($action);?></span>
</td>
</tr>
<?php if(!empty($action->comment) or !empty($action->history)):?>
<?php if(!empty($action->history)):?>
<tr>
<td style='padding: 10px;'>
<div><?php echo $this->action->printChanges($action->objectType, $action->history);?></div>
<?php if(!empty($action->comment)): ?>
<p style='padding: 0; padding-left: 10px; margin: 0; margin-top: 8px; border-left: 4px solid #ddd; color: #666'><?php echo $action->comment;?></p>
<?php endif;?>
</div>
</td>
</tr>
<?php endif;?>
+1 -1
View File
@@ -16,7 +16,7 @@ if($onlybody) $_GET['onlybody'] = 'no';
<td>
<table align='center' border='0' cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px 0; border: none; vertical-align: middle;'><strong style='font-size: 16px'><?php echo $app->company->name ?></strong></td>
<td style='padding: 10px 0; border: none; vertical-align: middle;'><strong style='font-size: 16px'><?php echo $this->app->company->name ?></strong></td>
</tr>
</table>
<table align='center' border='0' cellpadding='0' cellspacing='0' width='600' style='border-collapse: collapse; background-color: #fff; border: 1px solid #cfcfcf; box-shadow: 0 0px 6px rgba(0, 0, 0, 0.1); margin-bottom: 20px; font-size:13px;'>
+8 -1
View File
@@ -68,6 +68,7 @@ class mail extends control
echo "<script>setTimeout(function(){parent.location.href='" . inlink('edit') . "'}, 10000)</script>";
$mailConfig = $this->mail->autoDetect($this->post->fromAddress);
$mailConfig->fromAddress = $this->post->fromAddress;
$mailConfig->domain = common::getSysURL();
$this->session->set('mailConfig', $mailConfig);
die(js::locate(inlink('edit'), 'parent'));
@@ -106,12 +107,15 @@ class mail extends control
$this->locate(inlink('detect'));
}
$mailConfig->domain = isset($this->config->mail->domain) ? $this->config->mail->domain : common::getSysURL();
$this->view->title = $this->lang->mail->common . $this->lang->colon . $this->lang->mail->edit;
$this->view->position[] = html::a(inlink('index'), $this->lang->mail->common);
$this->view->position[] = $this->lang->mail->edit;
$this->view->mailExist = $this->mail->mailExist();
$this->view->mailConfig = $mailConfig;
$this->view->openssl = extension_loaded('openssl');
$this->display();
}
@@ -133,6 +137,7 @@ class mail extends control
$mailConfig->async = $this->post->async;
$mailConfig->fromAddress = trim($this->post->fromAddress);
$mailConfig->fromName = trim($this->post->fromName);
$mailConfig->domain = trim($this->post->domain);
$mailConfig->smtp->host = trim($this->post->host);
$mailConfig->smtp->port = trim($this->post->port);
$mailConfig->smtp->auth = $this->post->auth;
@@ -195,6 +200,7 @@ class mail extends control
$mailConfig->async = $this->post->async;
$mailConfig->fromAddress = '';
$mailConfig->fromName = '';
$mailConfig->domain = trim($this->post->domain);
$mailConfig->sendcloud->accessKey = trim($this->post->accessKey);
$mailConfig->sendcloud->secretKey = trim($this->post->secretKey);
@@ -207,13 +213,14 @@ class mail extends control
die(js::reload('parent'));
}
$mailConfig = '';
$mailConfig = new stdclass();
if($this->config->mail->turnon)
{
$mailConfig = $this->config->mail->sendcloud;
$mailConfig->fromAddress = $this->config->mail->fromAddress;
$mailConfig->fromName = $this->config->mail->fromName;
$mailConfig->turnon = $this->config->mail->turnon;
$mailConfig->domain = isset($this->config->mail->domain) ? $this->config->mail->domain : common::getSysURL();
$mailConfig->async = isset($this->config->mail->async) ? $this->config->mail->async : 0;
}
+2
View File
@@ -16,6 +16,7 @@ $lang->mail->turnon = 'Turn On';
$lang->mail->async = 'Asynchronous';
$lang->mail->fromAddress = 'Email Address';
$lang->mail->fromName = 'Sender';
$lang->mail->domain = 'Domain';
$lang->mail->host = 'SMTP Server';
$lang->mail->port = 'SMTP Port';
$lang->mail->auth = 'Verification Required';
@@ -74,6 +75,7 @@ $lang->mail->sendmailTips = 'Note: Email author will not receive this email.';
$lang->mail->needConfigure = 'Email configuration is not found. Please cinfigure the Email first.';
$lang->mail->nofsocket = 'fsocket related function has been deactivated. Mails cannot send out. Please modify allow_url_fopen in php.ini to turn on Onopenssl, and restart Apache.';
$lang->mail->noOpenssl = 'Please turn on Onopenssl, and restart Apache.';
$lang->mail->disableSecure = 'No openssl, disable ssl and tls.';
$lang->mail->sendCloudFail = 'Failed. Reason:';
$lang->mail->sendCloudHelp = <<<EOD
<p>1、Notice SendCloud是SendCloud的Team通知服务。具体可以到<a href="http://notice.sendcloud.net/" target="_blank">notice.sendcloud.net</a>查看</p>
+2
View File
@@ -16,6 +16,7 @@ $lang->mail->turnon = '是否打开';
$lang->mail->async = '异步发送';
$lang->mail->fromAddress = '发信邮箱';
$lang->mail->fromName = '发信人';
$lang->mail->domain = '发信域名';
$lang->mail->host = 'smtp服务器';
$lang->mail->port = 'smtp端口号';
$lang->mail->auth = '是否需要验证';
@@ -74,6 +75,7 @@ $lang->mail->sendmailTips = '提示:系统不会为当前操作者发信。'
$lang->mail->needConfigure = '无法找到邮件配置信息,请先配置邮件发送参数。';
$lang->mail->nofsocket = 'fsocket相关函数被禁用,不能发信!请在php.ini中修改allow_url_fopen为On,打开openssl扩展。 保存并重新启动apache。';
$lang->mail->noOpenssl = 'ssl和tls加密,请打开openssl扩展。 保存并重新启动apache。';
$lang->mail->disableSecure = '没有openssl扩展,禁用ssl和tls加密';
$lang->mail->sendCloudFail = '操作失败,原因:';
$lang->mail->sendCloudHelp = <<<EOD
<p>1、Notice SendCloud是SendCloud的团队通知服务。具体可以到<a href="http://notice.sendcloud.net/" target="_blank">notice.sendcloud.net</a>查看</p>
+1 -1
View File
@@ -290,7 +290,7 @@ class mailModel extends model
$this->clear();
/* Replace full webPath image for mail. */
if(strpos($body, 'src="data/upload')) $body = preg_replace('/<img (.*)src="data\/upload/', '<img $1 src="http://' . $this->server->http_host . $this->config->webRoot . 'data/upload', $body);
if(strpos($body, 'src="data/upload')) $body = preg_replace('/<img (.*)src="data\/upload/', '<img $1 src="' . zget($this->config->mail, 'domain', common::getSysURL()) . $this->config->webRoot . 'data/upload', $body);
try
{
+25 -11
View File
@@ -25,6 +25,7 @@ include '../../common/view/header.html.php';
<th class='rowhead w-110px'><?php echo $lang->mail->turnon; ?></th>
<td class='w-p25-f'><?php echo html::radio('turnon', $lang->mail->turnonList, 1);?></td>
<td></td>
<td></td>
</tr>
<?php if(!empty($config->global->cron)):?>
<tr>
@@ -35,38 +36,51 @@ include '../../common/view/header.html.php';
<tr>
<th><?php echo $lang->mail->fromAddress; ?></th>
<td><?php echo html::input('fromAddress', $mailConfig->fromAddress, "class='form-control'");?></td>
<td><?php echo $lang->mail->addressWhiteList?></td>
<td colspan='2'><?php echo $lang->mail->addressWhiteList?></td>
</tr>
<tr>
<th><?php echo $lang->mail->fromName; ?></th>
<td colspan='2'>
<td colspan='3'>
<div class='required required-wrapper'></div>
<?php echo html::input('fromName', $mailConfig->fromName, "class='form-control'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->mail->domain; ?></th>
<td colspan='3'><?php echo html::input('domain', $mailConfig->domain, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->mail->host; ?></th>
<td colspan='2'><?php echo html::input('host', $mailConfig->host, "class='form-control'");?></td>
<td colspan='3'><?php echo html::input('host', $mailConfig->host, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->mail->port; ?></th>
<td colspan='2'><?php echo html::input('port', $mailConfig->port, "class='form-control'");?></td>
<td><?php echo html::input('port', $mailConfig->port, "class='form-control'");?></td>
<th class='w-70px'><?php echo $lang->mail->secure; ?></th>
<td>
<?php
if(!$openssl)
{
unset($lang->mail->secureList['ssl']);
unset($lang->mail->secureList['tls']);
$mailConfig->secure = '';
}
echo html::radio('secure', $lang->mail->secureList, $mailConfig->secure);
if(!$openssl) echo " &nbsp; <span class='text-warning'>" . $lang->mail->disableSecure . '</span>';
?>
</td>
</tr>
<tr>
<th><?php echo $lang->mail->auth; ?></th>
<td colspan='2'><?php echo html::radio('auth', $lang->mail->authList, $mailConfig->auth, 'onchange=setAuth(this.value)'); ?></td>
<td colspan='3'><?php echo html::radio('auth', $lang->mail->authList, $mailConfig->auth, 'onchange=setAuth(this.value)'); ?></td>
</tr>
<tr>
<th><?php echo $lang->mail->username; ?></th>
<td colspan='2'><?php echo html::input('username', $mailConfig->username, "class='form-control' autocomplete='off'") ?></td>
<td colspan='3'><?php echo html::input('username', $mailConfig->username, "class='form-control' autocomplete='off'") ?></td>
</tr>
<tr>
<th><?php echo $lang->mail->password; ?></th>
<td colspan='2'><?php echo html::password('password', $mailConfig->password, "class='form-control' autocomplete='off' placeholder='{$lang->mail->placeholder->password}'") ?></td>
</tr>
<tr>
<th><?php echo $lang->mail->secure; ?></th>
<td><?php echo html::radio('secure', $lang->mail->secureList, $mailConfig->secure); ?></td>
<td colspan='3'><?php echo html::password('password', $mailConfig->password, "class='form-control' autocomplete='off' placeholder='{$lang->mail->placeholder->password}'") ?></td>
</tr>
<tr>
<th><?php echo $lang->mail->debug; ?></th>
+4
View File
@@ -32,6 +32,10 @@ include '../../common/view/header.html.php';
</tr>
<?php endif;?>
<tr>
<tr>
<th><?php echo $lang->mail->domain?></th>
<td><?php echo html::input('domain', zget($config->mail, 'domain', common::getSysURL()), "class='form-control'")?></td>
</tr>
<th><?php echo $lang->mail->accessKey; ?></th>
<td>
<div class='required required-wrapper'></div>
+2
View File
@@ -6,6 +6,8 @@
.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
.dropdown-list > li > a:hover,
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
#treebox{position:fixed;margin-left:20px;}
.outer.hide-side #treebox{margin-left:0px;}
.pl-5px{padding-left:5px;}
a.removeModule{color:#ddd}
+6
View File
@@ -23,4 +23,10 @@ $(function()
$('.popoverStage').mouseout(function(){$(this).popover('hide')});
setTimeout(function(){fixedTfootAction('#productStoryForm')}, 100);
setTimeout(function(){fixedTheadOfList('#storyList')}, 100);
var treeMaxHeight = document.documentElement.clientHeight - $('#header').height() - $('#featurebar').height() - $('#footer').height() - $('#treebox .side-body .panel-heading').height() - 120;
if($('#treebox').height() > $('#storyList').height()) treeMaxHeight -= 20;
$('#treebox .side-body .panel-body').children().each(function(){if(!$(this).hasClass('tree')) treeMaxHeight -= $(this).height()});
$('#treebox .tree').css({'max-height':treeMaxHeight, 'overflow-y': 'auto', 'overflow-x':'hidden'})
if(moduleID > 0)$('#treebox .tree').scrollTop($('#treebox .tree #module' + moduleID).offset().top - $('#treebox .tree li[data-id="1"]').offset().top);
})
+1
View File
@@ -286,6 +286,7 @@
</form>
</div>
<script language='javascript'>
var moduleID = <?php echo $moduleID?>;
$('#module<?php echo $moduleID;?>').addClass('active');
$('#<?php echo ($browseType == 'bymodule' and $this->session->storyBrowseType == 'bysearch') ? 'all' : $this->session->storyBrowseType;?>Tab').addClass('active');
<?php if($browseType == 'bysearch'):?>
+2 -56
View File
@@ -385,7 +385,8 @@ class project extends control
$mails = $this->project->importBug($projectID);
if(dao::isError()) die(js::error(dao::getError()));
foreach($mails as $mail) $this->sendmail($mail->taskID, $mail->actionID);
$this->loadModel('task');
foreach($mails as $mail) $this->task->sendmail($mail->taskID, $mail->actionID);
/* Locate the browser. */
die(js::locate($this->createLink('project', 'importBug', "projectID=$projectID"), 'parent'));
@@ -1413,61 +1414,6 @@ class project extends control
}
}
/**
* Send email.
*
* @param int $taskID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($taskID, $actionID)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$task = $this->loadModel('task')->getById($taskID);
$projectName = $this->project->getById($task->project)->name;
$toList = $task->assignedTo;
$ccList = trim($task->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 = $task->finishedBy;
}
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Create the email content. */
$this->view->task = $task;
$this->view->action = $action;
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send emails. */
$this->loadModel('mail')->send($toList, 'TASK#' . $task->id . ' ' . $task->name . ' - ' . $projectName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
/**
* Manage products.
*
+43 -26
View File
@@ -4,10 +4,11 @@ table th.col-closed {width:15%}
#kanbanHeader .dropdown > a {color: #036}
#kanbanHeader th.col-closed {position: relative}
#kanbanHeader .actions {position: absolute; right: 0; top: 0; padding: 0px; background: #f1f1f1; border-left: 1px solid #ccc}
#kanbanHeader .actions .btn {display: block; border-radius: 0; width: 34px; height: 34px; position: relative; text-align: center; padding: 5px 0; color: #036}
#kanbanHeader .actions .btn {display: block; border-radius: 0; width: 34px; height: 36px; position: relative; text-align: center; padding: 5px 0; color: #036}
#kanbanHeader .actions .btn-text {display: none}
#kanbanWrapper {table-layout: fixed; border-top: none}
#kanbanWrapper > tbody > tr:first-child > td {border-top: none}
#kanbanWrapper thead th, #kanbanWrapper thead, #kanbanWrapper thead tr {padding: 0!important; border: none!important; height: 0!important; border-bottom: none!important}
#kanbanWrapper tbody td {vertical-align: top; padding: 6px}
#kanbanWrapper tbody th {background: #f1f1f1}
@@ -24,13 +25,13 @@ table th.col-closed {width:15%}
.board {background: #333; color: #f1f1f1; color: rgba(255,255,255,0.9); opacity: 1; padding: 3px 6px; transition: all 0.2s; position:relative;}
.board + .board {margin-top: 6px;}
.board:hover {opacity: 1}
.board a {color: #f1f1f1; color: rgba(255,255,255,0.9);}
.board a:hover {color: #fff}
.board a {opacity: 0.9; color: inherit}
.board a:hover {opacity: 1}
.board-title, .board-header, .board-footer {padding: 2px 0}
.board-title {padding-right:35px;}
.board-actions {position: absolute; right: 3px; top: 3px}
.board-actions .btn {margin: 0; color: #fff; color: rgba(255,255,255,0.5); min-width: 20px}
.board-actions .btn:hover {background: #999; color: #fff; background: rgba(255,255,255,.2);}
.board-actions .btn {color: inherit; margin: 0; min-width: 20px}
.board-actions .btn:active, .board-actions .btn:focus, .board-actions .btn:hover {background: #999; color: inherit; background: rgba(255,255,255,.2);}
.ie-8 .board-actions .btn {min-width: 10px}
.board-actions > .dropdown {display: inline-block; margin-left: -5px;}
.dropdown .caret {border-top-color: #999}
@@ -38,22 +39,12 @@ table th.col-closed {width:15%}
.dropdown-menu > a:hover {background: #f1f1f1; color: #1a53ff; text-decoration: none}
.dropdown-menu > a.disabled, .dropdown-menu > a.disabled:hover, .dropdown-menu > a.active {color: #aaa; background: none}
.board .board-footer {display: none; opacity: 0.9}
.board.show-info .board-footer {display: block; margin: 0 -6px -3px -6px; padding: 5px; background: rgba(0,0,0,0.2);}
.board.show-info .board-footer {display: block; margin: 0 -6px -3px -6px; padding: 5px; background: rgba(0,0,0,0.07);}
.board-footer .board-id {display: inline-block; border: 1px solid #aaa; font-weight: normal; padding: 0px 4px; text-align: center; min-width: 20px; line-height: 16px; height: 17px; margin-right: 10px; font-size: 12px;}
.board-bug-closed .board-footer .bug-pri, .board-task-closed .board-footer .task-pri {border-color: #666}
.board-bug-closed .board-footer .board-id, .board-task-closed .board-footer .board-id {border-color: #777}
.board-footer .bug-pri, .board-footer .task-pri, .board-footer .story-pri {margin-right: 10px;}
.board-bug-wait,.board-task-wait {background: #2b529c}
.board-bug-doing,.board-task-doing {background: #D2322D}
.board-bug-done,.board-task-done {background: #229F24}
.board-bug-closed,.board-task-closed {background: #ddd; color: #333}
.board-bug-closed .board-title,.board-task-closed .board-title {border-bottom-color: #333}
.board-bug-closed a,.board-task-closed a {color: #222}
.board-bug-closed a:hover,.board-task-closed a:hover {color: #000}
.board-bug-closed .board-actions .btn,.board-task-closed .board-actions .btn {color: #666}
.board-bug-closed .board-actions .btn:hover,.board-task-closed .board-actions .btn:hover {color: #333; background: #ccc}
.pri-0:before, .pri-3:before {content: "3";}
.pri-1:before {content: "1";}
.pri-2:before {content: "2";}
@@ -68,16 +59,42 @@ table th.col-closed {width:15%}
.story-pri.pri-3 {background-color:#b56a00;}
.story-pri.pri-4 {background-color:#795523;}
.board-story {background: #dd7503}
.board-story.stage-projected {background-color:#777;}
.board-story.stage-developing {background-color:#D2322D;}
.board-story.stage-developed {background-color:#229F24;}
.board-story.stage-testing {background-color:#EF6C00;}
.board-story.stage-tested {background-color:#827717;}
.board-story.stage-released {background-color:#9C27B0;}
.board {background: #ddd; color: #444; outline: 1px solid rgba(0,0,0,.1); outline-offset: -1px;}
.board-bug-wait,.board-task-wait {color: #2b529c; background-color: #E8EAF6}
.board-bug-doing,.board-task-doing {color: #D2322D; background-color: #FFEBEE;}
.board-bug-done,.board-task-done {color: #229F24; background-color: #E8F5E9;}
.board-bug-closed,.board-task-closed {color: #666; background-color: #ccc;}
.board:hover {outline: 1px solid rgba(0,0,0,.3);}
.bug-pri,.task-pri {display: inline-block; width: 16px; height: 16px; text-align: center; border-radius: 8px; border: 1px solid #ddd; font-size: 12px}
.board-story {color: #dd7503; background-color: #FFF3E0;}
.board-story.stage-projected {color:#777;}
.board-story.stage-developing {color:#D2322D; background-color: #FFEBEE;}
.board-story.stage-developed {color:#229F24; background-color: #E8F5E9;}
.board-story.stage-testing {color:#EF6C00; background-color: #FFF3E0;}
.board-story.stage-tested {color:#827717; background-color: #F9FBE7}
.board-story.stage-released {color:#9C27B0; background-color: #F3E5F5}
.board.inverse {background: #333; color: #f1f1f1;}
.board.inverse:hover {color: #fff;}
.board-bug-cancel.inverse, .board-task-cancel.inverse {background: #333;}
.board-bug-wait.inverse, .board-task-wait.inverse {background: #2b529c}
.board-bug-doing.inverse, .board-task-doing.inverse {background: #D2322D}
.board-bug-done.inverse, .board-task-done.inverse {background: #229F24}
.board-bug-closed.inverse, .board-task-closed.inverse {background: #777;}
.board-story.inverse {background: #dd7503}
.board-story.stage-projected.inverse {background-color:#777;}
.board-story.stage-developing.inverse {background-color:#D2322D;}
.board-story.stage-developed.inverse {background-color:#229F24;}
.board-story.stage-testing.inverse {background-color:#EF6C00;}
.board-story.stage-tested.inverse {background-color:#827717;}
.board-story.stage-released.inverse {background-color:#9C27B0;}
.bug-pri,.task-pri {display: inline-block; width: 16px; height: 16px; text-align: center; border-radius: 8px; border: 1px solid #ddd; font-size: 12px; line-height: 14px;}
.affix {position:fixed; top:0px; width:95%;z-index:1030;}
#kanbanHeader.affix {box-shadow: 0 3px 10px rgba(0,0,0,.1); background: }
#kanbanHeader.affix th {border-bottom: 1px solid #bbb; background: #ebf5f9}
#kanbanHeader.affix {box-shadow: 0 3px 10px rgba(0,0,0,.1);}
#kanbanHeader.affix th {border-bottom: 1px solid #bbb; background: #114f8e; color: #ccc; color: rgba(255,255,255,.8)}
#kanbanHeader.affix .dropdown > a {color: #fff;}
#kanbanHeader.affix .actions .btn {background: #114f8e; color: #f1f1f1;}
#kanbanHeader.affix th {border-color: rgba(255,255,255,.2)}
+8 -5
View File
@@ -1,6 +1,9 @@
.row {padding: 20px;}
#productsBox .row > .col-sm-4 {padding: 8px 15px; border:1px solid #ddd;margin-bottom:5px; width:32%; margin-right:8px;}
#productsBox .row > .col-sm-4 label {display:block; cursor: pointer;}
#productsBox .row > .col-sm-4:hover {background: #f1f1f1; cursor: pointer;}
#productsBox .row > .col-sm-4.checked, #productsBox .row > .col-sm-4.checked:hover {background: #E5FFE6; border: 1px solid #229F24;}
.col-sm-4+.col-sm-4 {margin-left: 0;}
#productsBox .row > .product {border:1px solid #ddd;margin-bottom:5px; width:32%; margin-right:8px; padding: 0; position: relative;}
#productsBox .row > .product label {display:block; cursor: pointer; margin: 0; padding: 8px 10px 8px 30px;}
#productsBox .row > .product:hover {background: #f1f1f1; cursor: pointer;}
#productsBox .row > .product.checked, #productsBox .row > .product.checked:hover {background: #E5FFE6; border: 1px solid #229F24;}
.product + .product {margin-left: 0;}
#productsBox .row > .product.has-branch label {margin-right: 40%;}
#productsBox .row > .product.has-branch > .form-control,
#productsBox .row > .product.has-branch > .chosen-container {position: absolute; width: 40%!important; right: 3px; top: 3px;}
+5
View File
@@ -1,3 +1,5 @@
.red{color:red;}
.bug, .task {color:gray; font-size:9px}
.cont-lt1 .side{width:220px}
#sidebar{position:absolute;left:15px;top:185px;width:20px;height:20px;cursor:pointer;background:url(theme/default/images/main/zt-icons.png) -81px -161px;}
@@ -19,4 +21,7 @@
.pl-5px{padding-left:5px;}
#taskTree{position:fixed;margin-left:20px;}
.outer.hide-side #taskTree{margin-left:0px;}
tbody > tr > td > .btn-icon {margin-right: 2px}
+6
View File
@@ -20,6 +20,12 @@ $(function()
$option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0);
});
});
var treeMaxHeight = document.documentElement.clientHeight - $('#header').height() - $('#featurebar').height() - $('#footer').height() - $('#taskTree .side-body .panel-heading').height() - 120;
if($('#taskTree').height() > $('#taskList').height()) treeMaxHeight -= 20;
$('#taskTree .side-body .panel-body').children().each(function(){if(!$(this).hasClass('tree')) treeMaxHeight -= $(this).height()});
$('#taskTree .tree').css({'max-height':treeMaxHeight, 'overflow-y': 'auto', 'overflow-x':'hidden'})
if(moduleID > 0)$('#taskTree .tree').scrollTop($('#taskTree .tree #module' + moduleID).offset().top - $('#taskTree .tree li[data-id="1"]').offset().top);
});
$('#module' + moduleID).addClass('active');
+2 -2
View File
@@ -58,7 +58,7 @@
<?php if($hasStory):?>
<td class='col-story'>
<?php if(!empty($story->id)):?>
<div class='board board-story stage-<?php echo $story->stage?>' data-id='<?php echo $story->id?>'>
<div class='board board-story stage-<?php echo $story->stage?><?php if($story->assignedTo == $this->app->user->account) echo ' inverse';?>' data-id='<?php echo $story->id?>'>
<div class='board-title'>
<?php echo html::a($this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', 'class="kanbanFrame" title="' . $story->title . '"');?>
<div class='board-actions'>
@@ -93,7 +93,7 @@
<td class='col-droppable col-<?php echo $col?>' data-id='<?php echo $col?>'>
<?php if(!empty($story->tasks[$col])):?>
<?php foreach($story->tasks[$col] as $task):?>
<div class='board board-task board-task-<?php echo $col ?>' data-id='<?php echo $task->id?>' id='task-<?php echo $task->id?>'>
<div class='board board-task board-task-<?php echo $col ?><?php if($task->assignedTo == $this->app->user->account) echo ' inverse';?>' data-id='<?php echo $task->id?>' id='task-<?php echo $task->id?>'>
<div class='board-title'>
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), $task->name, '', 'class="kanbanFrame" title="' . $task->name . '"');?>
<div class='board-actions'>
+6 -12
View File
@@ -24,17 +24,14 @@
<?php foreach($allProducts as $productID => $productName):?>
<?php if(isset($linkedProducts[$productID])):?>
<?php $checked = 'checked';?>
<div class='col-sm-4 <?php echo $checked?>'>
<?php if(isset($branchGroups[$productID])) echo "<div class='col-sm-6' style='padding-left:0px'>"?>
<label for='<?php echo 'products'. $productID?>';>
<div class='product col-sm-4 <?php echo $checked . (isset($branchGroups[$productID]) ? ' has-branch' : '')?>'>
<label class='text-ellipsis checkbox-inline' for='<?php echo 'products'. $productID?>';>
<?php echo "<input type='checkbox' name='products[$productID]' value='$productID' $checked id='products{$productID}'> $productName";?>
</label>
<?php
if(isset($branchGroups[$productID]))
{
echo "</div><div class='col-sm-6'>";
echo html::select("branch[$productID]", $branchGroups[$productID], $linkedProducts[$productID]->branch, "class='from-control chosen'");
echo '</div>';
echo html::select("branch[$productID]", $branchGroups[$productID], $linkedProducts[$productID]->branch, "class='form-control chosen'");
}
?>
</div>
@@ -47,17 +44,14 @@
<legend><?php echo $lang->project->unlinkedProducts;?></legend>
<div class='row'>
<?php foreach($allProducts as $productID => $productName):?>
<div class='col-sm-4'>
<?php if(isset($branchGroups[$productID])) echo "<div class='col-sm-6' style='padding-left:0px'>"?>
<label for='<?php echo 'products'. $productID?>';>
<div class='col-sm-4 product<?php echo isset($branchGroups[$productID]) ? ' has-branch' : ''?>'>
<label class='text-ellipsis checkbox-inline' for='<?php echo 'products'. $productID?>';>
<?php echo "<input type='checkbox' name='products[$productID]' value='$productID' id='products{$productID}'> $productName";?>
</label>
<?php
if(isset($branchGroups[$productID]))
{
echo "</div><div class='col-sm-6'>";
echo html::select("branch[$productID]", $branchGroups[$productID], '', "class='from-control chosen'");
echo '</div>';
echo html::select("branch[$productID]", $branchGroups[$productID], '', "class='form-control chosen'");
}
?>
</div>
-32
View File
@@ -1,32 +0,0 @@
<?php
/**
* The mail file of task module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yangyang Shi<shiyangyang@cnezsoft.com>
* @package task
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php $mailTitle = 'TASK #' . $task->id . ' ' . $task->name;?>
<?php include '../../common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(common::getSysURL() . $this->createLink('task', 'view', "taskID=$task->id"), $mailTitle, '', "style='color: #333;'");?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $lang->task->legendDesc;?></legend>
<div style='padding:5px;'><?php echo $task->desc;?></div>
</fieldset>
</td>
</tr>
<?php include '../../common/view/mail.footer.html.php';?>
+3
View File
@@ -206,7 +206,10 @@ class report extends control
/* Get email content and title.*/
$this->view->mail = $mail;
$oldViewType = $this->viewType;
if($oldViewType == 'json') $this->viewType = 'html';
$mailContent = $this->parse('report', 'dailyreminder');
$this->viewType == $oldViewType;
/* Send email.*/
echo date('Y-m-d H:i:s') . " sending to $user, ";
+2
View File
@@ -295,6 +295,8 @@ class reportModel extends model
*/
public function getSysURL()
{
if(isset($this->config->mail->domain)) return $this->config->mail->domain;
/* Ger URL when run in shell. */
if(PHP_SAPI == 'cli')
{
+18 -87
View File
@@ -78,7 +78,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Frombug', '', $bugID);
}
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
if($this->post->newStory)
{
$response['message'] = $this->lang->story->successSaved . $this->lang->story->newStory;
@@ -213,14 +213,14 @@ class story extends control
$mails = $this->story->batchCreate($productID, $branch);
if(dao::isError()) die(js::error(dao::getError()));
foreach($mails as $mail) $this->sendmail($mail->storyID, $mail->actionID);
foreach($mails as $mail) $this->story->sendmail($mail->storyID, $mail->actionID);
/* If storyID not equal zero, subdivide this story to child stories and close it. */
if($storyID)
{
$actionID = $this->story->subdivide($storyID, $mails);
if(dao::isError()) die(js::error(dao::getError()));
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
}
@@ -354,7 +354,7 @@ class story extends control
$action = !empty($changes) ? 'Edited' : 'Commented';
$actionID = $this->action->create('story', $storyID, $action, $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
@@ -398,7 +398,7 @@ class story extends control
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
}
die(js::locate($this->session->storyList, 'parent'));
@@ -501,7 +501,7 @@ class story extends control
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
$actionID = $this->action->create('story', $storyID, $action, $fileAction . $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
@@ -536,7 +536,7 @@ class story extends control
$this->story->activate($storyID);
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('story', $storyID, 'Activated', $this->post->comment);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
@@ -647,7 +647,7 @@ class story extends control
if($this->post->closedReason != '' and strpos('done,postponed,subdivided', $this->post->closedReason) !== false) $result = 'pass';
$actionID = $this->action->create('story', $storyID, 'Reviewed', $this->post->comment, ucfirst($result));
$this->action->logHistory($actionID, array());
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
if($this->post->result == 'reject')
{
$this->action->create('story', $storyID, 'Closed', '', ucfirst($this->post->closedReason));
@@ -700,7 +700,7 @@ class story extends control
$actions = $this->story->batchReview($storyIDList, $result, $reason);
if(dao::isError()) die(js::error(dao::getError()));
foreach($actions as $storyID => $actionID) $this->sendmail($storyID, $actionID);
foreach($actions as $storyID => $actionID) $this->story->sendmail($storyID, $actionID);
die(js::locate($this->session->storyList, 'parent'));
}
@@ -719,7 +719,7 @@ class story extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason) . ($this->post->duplicateStory ? ':' . (int)$this->post->duplicateStory : ''));
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
}
@@ -766,7 +766,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Closed', htmlspecialchars($this->post->comments[$storyID]), ucfirst($this->post->closedReasons[$storyID]) . ($this->post->duplicateStoryIDList[$storyID] ? ':' . (int)$this->post->duplicateStoryIDList[$storyID] : ''));
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
}
die(js::locate($this->session->storyList, 'parent'));
@@ -840,7 +840,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
die(js::reload('parent'));
}
@@ -861,7 +861,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
die(js::reload('parent'));
}
@@ -882,7 +882,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
die(js::reload('parent'));
}
@@ -903,7 +903,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
die(js::locate($this->session->storyList, 'parent'));
}
@@ -924,7 +924,7 @@ class story extends control
{
$actionID = $this->action->create('story', $storyID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
$this->story->sendmail($storyID, $actionID);
}
}
die(js::locate($this->session->storyList));
@@ -1238,76 +1238,6 @@ class story extends control
echo $story->module;
}
/**
* Send email.
*
* @param int $storyID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($storyID, $actionID)
{
/* Reset $this->output. */
$this->clear();
$story = $this->story->getById($storyID);
$productName = $this->product->getById($story->product)->name;
/* Get actions. */
$actions = $this->action->getList('story', $storyID);
$action = zget($actions, $actionID, null);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
if(strtolower($action->action) == 'opened') $action->comment = $story->spec;
/* Set toList and ccList. */
$toList = $story->assignedTo;
$ccList = str_replace(' ', '', trim($story->mailto, ','));
/* If the action is changed or reviewed, mail to the project team. */
if(strtolower($action->action) == 'changed' or strtolower($action->action) == 'reviewed')
{
$prjMembers = $this->story->getProjectMembers($storyID);
if($prjMembers)
{
$ccList .= ',' . join(',', $prjMembers);
$ccList = ltrim($ccList, ',');
}
}
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($toList == 'closed')
{
$toList = $story->openedBy;
}
/* Get the mail content. */
if($action->action == 'opened') $action->comment = '';
$this->view->story = $story;
$this->view->action = $action;
$this->view->users = $this->user->getPairs('noletter');
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send it. */
$this->loadModel('mail')->send($toList, 'STORY #' . $story->id . ' ' . $story->title . ' - ' . $productName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
/**
* The report page.
*
@@ -1362,6 +1292,7 @@ class story extends control
/* format the fields of every story in order to export data. */
if($_POST)
{
$this->loadModel('file');
$storyLang = $this->lang->story;
$storyConfig = $this->config->story;
@@ -1502,7 +1433,7 @@ class story extends control
{
foreach($relatedFiles[$story->id] as $file)
{
$fileURL = 'http://' . $this->server->http_host . $this->config->webRoot . "data/upload/{$this->app->company->id}/" . $file->pathname;
$fileURL = common::getSysURL() . $this->file->webPath . $file->pathname;
$story->files .= html::a($fileURL, $file->title, '_blank') . '<br />';
}
}
+77
View File
@@ -2330,4 +2330,81 @@ class storyModel extends model
return $forceReview;
}
/**
* Send mail
*
* @param int $storyID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($storyID, $actionID)
{
$this->loadModel('mail');
$story = $this->getById($storyID);
$productName = $this->loadModel('product')->getById($story->product)->name;
$users = $this->loadModel('user')->getPairs('noletter');
/* Get actions. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Get mail content. */
$modulePath = $this->app->getModulePath();
$oldcwd = getcwd();
$viewFile = $modulePath . 'view/sendmail.html.php';
chdir($modulePath . 'view');
if(file_exists($modulePath . 'ext/view/sendmail.html.php'))
{
$viewFile = $modulePath . 'ext/view/sendmail.html.php';
chdir($modulePath . 'ext/view');
}
ob_start();
include $viewFile;
foreach(glob($modulePath . 'ext/view/sendmail.*.html.hook.php') as $hookFile) include $hookFile;
$mailContent = ob_get_contents();
ob_end_clean();
chdir($oldcwd);
/* Set toList and ccList. */
$toList = $story->assignedTo;
$ccList = str_replace(' ', '', trim($story->mailto, ','));
/* If the action is changed or reviewed, mail to the project team. */
if(strtolower($action->action) == 'changed' or strtolower($action->action) == 'reviewed')
{
$prjMembers = $this->getProjectMembers($storyID);
if($prjMembers)
{
$ccList .= ',' . join(',', $prjMembers);
$ccList = ltrim($ccList, ',');
}
}
if(empty($toList))
{
if(empty($ccList)) return;
if(strpos($ccList, ',') === false)
{
$toList = $ccList;
$ccList = '';
}
else
{
$commaPos = strpos($ccList, ',');
$toList = substr($ccList, 0, $commaPos);
$ccList = substr($ccList, $commaPos + 1);
}
}
elseif($toList == 'closed')
{
$toList = $story->openedBy;
}
/* Send it. */
$this->mail->send($toList, 'STORY #' . $story->id . ' ' . $story->title . ' - ' . $productName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
}
+4 -4
View File
@@ -11,12 +11,12 @@
*/
?>
<?php $mailTitle = 'STORY #' . $story->id . ' ' . $story->title;?>
<?php include '../../common/view/mail.header.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(common::getSysURL() . $this->createLink('story', 'view', "storyID=$story->id"), $mailTitle, '', "style='color: #333;'");?></td>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('story', 'view', "storyID=$story->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?></td>
</tr>
</table>
</td>
@@ -24,9 +24,9 @@
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $lang->story->legendSpec;?></legend>
<legend style='color: #114f8e'><?php echo $this->lang->story->legendSpec;?></legend>
<div style='padding:5px;'><?php echo $story->spec;?></div>
</fieldset>
</td>
</tr>
<?php include '../../common/view/mail.footer.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.footer.html.php';?>
+16 -72
View File
@@ -96,7 +96,7 @@ class task extends control
$taskID = $taskID['id'];
$actionID = $this->action->create('task', $taskID, 'Opened', '');
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
/* If link from no head then reload*/
@@ -179,7 +179,7 @@ class task extends control
$mails = $this->task->batchCreate($projectID);
if(dao::isError()) die(js::error(dao::getError()));
foreach($mails as $mail) $this->sendmail($mail->taskID, $mail->actionID);
foreach($mails as $mail) $this->task->sendmail($mail->taskID, $mail->actionID);
/* Locate the browser. */
if($iframe) die(js::reload('parent.parent'));
@@ -260,7 +260,7 @@ class task extends control
$fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';
$actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment);
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
if($task->fromBug != 0)
@@ -313,7 +313,7 @@ class task extends control
$actionID = $this->loadModel('action')->create('task', $taskID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
$task = $this->task->getById($taskID);
if($task->fromBug != 0)
@@ -412,7 +412,7 @@ class task extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
@@ -445,7 +445,7 @@ class task extends control
$this->loadModel('action');
$actionID = $this->action->create('task', $taskID, 'Edited');
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
}
die(js::reload('parent'));
@@ -472,7 +472,7 @@ class task extends control
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->action->create('task', $taskID, 'Assigned', $this->post->comment, $this->post->assignedTo);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
die(js::locate($this->createLink('project', 'task', "projectID=$project"), 'parent'));
}
@@ -570,7 +570,7 @@ class task extends control
$act = $this->post->left == 0 ? 'Finished' : 'Started';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
/* Remind whether to update status of the bug, if task which from that bug has been finished. */
@@ -722,7 +722,7 @@ class task extends control
$fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';
$actionID = $this->action->create('task', $taskID, 'Finished', $fileAction . $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
if($this->task->needUpdateBugStatus($task))
@@ -804,7 +804,7 @@ class task extends control
$act = $this->post->left == 0 ? 'Finished' : 'Restarted';
$actionID = $this->action->create('task', $taskID, $act, $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
@@ -837,7 +837,7 @@ class task extends control
{
$actionID = $this->action->create('task', $taskID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
@@ -883,7 +883,7 @@ class task extends control
{
$actionID = $this->action->create('task', $taskID, 'Closed', '');
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
}
if(isset($skipTasks))
@@ -942,7 +942,7 @@ class task extends control
{
$actionID = $this->action->create('task', $taskID, 'Canceled', $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
@@ -976,7 +976,7 @@ class task extends control
{
$actionID = $this->action->create('task', $taskID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
$this->task->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
@@ -1015,63 +1015,6 @@ class task extends control
}
}
/**
* Send email.
*
* @param int $taskID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($taskID, $actionID)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$task = $this->task->getById($taskID);
$projectName = $this->project->getById($task->project)->name;
$users = $this->loadModel('user')->getPairs('noletter');
$toList = $task->assignedTo;
$ccList = trim($task->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 = $task->finishedBy;
}
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Create the email content. */
$this->view->task = $task;
$this->view->action = $action;
$this->view->users = $users;
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Send emails. */
$this->loadModel('mail')->send($toList, 'TASK#' . $task->id . ' ' . $task->name . ' - ' . $projectName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
/**
* AJAX: return tasks of a user in html select.
*
@@ -1169,6 +1112,7 @@ class task extends control
{
if($_POST)
{
$this->loadModel('file');
$taskLang = $this->lang->task;
$taskConfig = $this->config->task;
@@ -1247,7 +1191,7 @@ class task extends control
$task->files = '';
foreach($relatedFiles[$task->id] as $file)
{
$fileURL = 'http://' . $this->server->http_host . $this->config->webRoot . "data/upload/{$this->app->company->id}/" . $file->pathname;
$fileURL = common::getSysURL() . $this->file->webPath . $file->pathname;
$task->files .= html::a($fileURL, $file->title, '_blank') . '<br />';
}
}
+66
View File
@@ -1696,4 +1696,70 @@ class taskModel extends model
echo '</td>';
}
}
/**
* Send mail.
*
* @param int $taskID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($taskID, $actionID)
{
$this->loadModel('mail');
$task = $this->getById($taskID);
$projectName = $this->loadModel('project')->getById($task->project)->name;
$users = $this->loadModel('user')->getPairs('noletter');
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Get mail content. */
$modulePath = $this->app->getModulePath();
$oldcwd = getcwd();
$viewFile = $modulePath . 'view/sendmail.html.php';
chdir($modulePath . 'view');
if(file_exists($modulePath . 'ext/view/sendmail.html.php'))
{
$viewFile = $modulePath . 'ext/view/sendmail.html.php';
chdir($modulePath . 'ext/view');
}
ob_start();
include $viewFile;
foreach(glob($modulePath . 'ext/view/sendmail.*.html.hook.php') as $hookFile) include $hookFile;
$mailContent = ob_get_contents();
ob_end_clean();
chdir($oldcwd);
/* Set toList and ccList. */
$toList = $task->assignedTo;
$ccList = trim($task->mailto, ',');
if(empty($toList))
{
if(empty($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 = $task->finishedBy;
}
/* Send emails. */
$this->mail->send($toList, 'TASK#' . $task->id . ' ' . $task->name . ' - ' . $projectName, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
}
+4 -4
View File
@@ -11,12 +11,12 @@
*/
?>
<?php $mailTitle = 'TASK #' . $task->id . ' ' . $task->name;?>
<?php include '../../common/view/mail.header.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(common::getSysURL() . $this->createLink('task', 'view', "taskID=$task->id"), $mailTitle, '', "style='color: #333;'");?></td>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('task', 'view', "taskID=$task->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?></td>
</tr>
</table>
</td>
@@ -24,9 +24,9 @@
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $lang->task->legendDesc;?></legend>
<legend style='color: #114f8e'><?php echo $this->lang->task->legendDesc;?></legend>
<div style='padding:5px;'><?php echo $task->desc;?></div>
</fieldset>
</td>
</tr>
<?php include '../../common/view/mail.footer.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.footer.html.php';?>
+2
View File
@@ -10,3 +10,5 @@
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
.pl-5px{padding-left:5px;}
#treebox{position:fixed;margin-left:20px;}
.outer.hide-side #treebox{margin-left:0px;}
+6
View File
@@ -44,4 +44,10 @@ $(document).ready(function()
});
setModal4List('runCase', 'caseList');
var treeMaxHeight = document.documentElement.clientHeight - $('#header').height() - $('#featurebar').height() - $('#footer').height() - $('#treebox .side-body .panel-heading').height() - 120;
if($('#treebox').height() > $('#caseList').height()) treeMaxHeight -= 20;
$('#treebox .side-body .panel-body').children().each(function(){if(!$(this).hasClass('tree')) treeMaxHeight -= $(this).height()});
$('#treebox .tree').css({'max-height':treeMaxHeight, 'overflow-y': 'auto', 'overflow-x':'hidden'})
if(moduleID > 0)$('#treebox .tree').scrollTop($('#treebox .tree #module' + moduleID).offset().top - $('#treebox .tree li[data-id="1"]').offset().top);
});
+3 -69
View File
@@ -96,7 +96,7 @@ class testtask extends control
$taskID = $this->testtask->create();
if(dao::isError()) die(js::error(dao::getError()));
$actionID = $this->loadModel('action')->create('testtask', $taskID, 'opened');
$this->sendmail($taskID, $actionID, 'opened');
$this->testtask->sendmail($taskID, $actionID);
die(js::locate($this->createLink('testtask', 'browse', "productID=$productID"), 'parent'));
}
@@ -365,7 +365,7 @@ class testtask extends control
$this->action->logHistory($actionID, $changes);
/* send mail.*/
$this->sendmail($taskID, $actionID, 'edited');
$this->testtask->sendmail($taskID, $actionID);
}
die(js::locate(inlink('view', "taskID=$taskID"), 'parent'));
}
@@ -452,7 +452,7 @@ class testtask extends control
{
$actionID = $this->action->create('testtask', $taskID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID, 'closed');
$this->testtask->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::reload('parent.parent'));
@@ -822,70 +822,4 @@ class testtask extends control
->exec();
die(js::locate($this->session->caseList));
}
/**
* Send mail.
*
* @param int $testtaskID
* @param int $actionID
* @param string $action
* @access public
* @return void
*/
public function sendmail($testtaskID, $actionID, $actionType)
{
/* Reset $this->output. */
$this->clear();
/* Set toList and ccList. */
$testtask = $this->testtask->getByID($testtaskID);
$users = $this->loadModel('user')->getPairs('noletter');
$toList = $testtask->owner;
$ccList = str_replace(' ', '', trim($testtask->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);
}
}
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Create the email content. */
$this->view->testtask = $testtask;
$this->view->action = $action;
$this->view->users = $users;
$mailContent = $this->parse($this->moduleName, 'sendmail');
/* Set email title. */
if($actionType == 'opened')
{
$mailTitle = sprintf($this->lang->testtask->mail->create->title, $this->app->user->realname, $testtaskID, $this->post->name);
}
elseif($actionType == 'closed')
{
$mailTitle = sprintf($this->lang->testtask->mail->close->title, $this->app->user->realname, $testtaskID, $testtask->name);
}
else
{
$mailTitle = sprintf($this->lang->testtask->mail->edit->title, $this->app->user->realname, $testtaskID, $this->post->name);
}
/* Send mail. */
$this->loadModel('mail')->send($toList, $mailTitle, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
}
+2
View File
@@ -1,2 +1,4 @@
tfoot .table-actions #assignedTo_chosen a.chosen-default{height:26px;line-height:15px}
tfoot .table-actions .input-group-addon{padding:5px 12px;}
#casesbox{position:fixed;margin-left:20px;}
.outer.hide-side #casesbox{margin-left:0px;}
+6
View File
@@ -4,4 +4,10 @@ $(document).ready(function()
if(browseType == 'bysearch') ajaxGetSearchForm();
setTimeout(function(){fixedTfootAction('#casesForm')}, 100);
setTimeout(function(){fixedTheadOfList('#caseList')}, 100);
var treeMaxHeight = document.documentElement.clientHeight - $('#header').height() - $('#featurebar').height() - $('#footer').height() - $('#casesbox .side-body .panel-heading').height() - 120;
if($('#casesbox').height() > $('#caseList').height()) treeMaxHeight -= 20;
$('#casesbox .side-body .panel-body').children().each(function(){if(!$(this).hasClass('tree')) treeMaxHeight -= $(this).height()});
$('#casesbox .tree').css({'max-height':treeMaxHeight, 'overflow-y': 'auto', 'overflow-x':'hidden'});
if(moduleID > 0)$('#casesbox .tree').scrollTop($('#casesbox .tree #module' + moduleID).offset().top - $('#casesbox .tree li[data-id="1"]').offset().top);
});
+74
View File
@@ -734,4 +734,78 @@ class testtaskModel extends model
echo '</td>';
}
}
/**
* Send mail.
*
* @param int $testtaskID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($testtaskID, $actionID)
{
$this->loadModel('mail');
$testtask = $this->getByID($testtaskID);
$users = $this->loadModel('user')->getPairs('noletter');
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Get mail content. */
$modulePath = $this->app->getModulePath();
$oldcwd = getcwd();
$viewFile = $modulePath . 'view/sendmail.html.php';
chdir($modulePath . 'view');
if(file_exists($modulePath . 'ext/view/sendmail.html.php'))
{
$viewFile = $modulePath . 'ext/view/sendmail.html.php';
chdir($modulePath . 'ext/view');
}
ob_start();
include $viewFile;
foreach(glob($modulePath . 'ext/view/sendmail.*.html.hook.php') as $hookFile) include $hookFile;
$mailContent = ob_get_contents();
ob_end_clean();
chdir($oldcwd);
/* Set toList and ccList. */
$toList = $testtask->owner;
$ccList = str_replace(' ', '', trim($testtask->mailto, ','));
if(empty($toList))
{
if(empty($ccList)) return;
if(strpos($ccList, ',') === false)
{
$toList = $ccList;
$ccList = '';
}
else
{
$commaPos = strpos($ccList, ',');
$toList = substr($ccList, 0, $commaPos);
$ccList = substr($ccList, $commaPos + 1);
}
}
/* Set email title. */
if($action->action == 'opened')
{
$mailTitle = sprintf($this->lang->testtask->mail->create->title, $this->app->user->realname, $testtaskID, $this->post->name);
}
elseif($action->action == 'closed')
{
$mailTitle = sprintf($this->lang->testtask->mail->close->title, $this->app->user->realname, $testtaskID, $testtask->name);
}
else
{
$mailTitle = sprintf($this->lang->testtask->mail->edit->title, $this->app->user->realname, $testtaskID, $this->post->name);
}
/* Send mail. */
$this->mail->send($toList, $mailTitle, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
}
+4 -4
View File
@@ -11,12 +11,12 @@
*/
?>
<?php $mailTitle = 'TESTTASK #' . $testtask->id . ' ' . $testtask->name;?>
<?php include '../../common/view/mail.header.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(common::getSysURL() . $this->createLink('testtask', 'view', "testtaskID=$testtask->id"), $mailTitle, '', "style='color: #333;'");?></td>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'><?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('testtask', 'view', "testtaskID=$testtask->id"), $mailTitle, '', "style='color: #333; text-decoration: underline;'");?></td>
</tr>
</table>
</td>
@@ -24,9 +24,9 @@
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $lang->testtask->desc;?></legend>
<legend style='color: #114f8e'><?php echo $this->lang->testtask->desc;?></legend>
<div style='padding:5px;'><?php echo $testtask->desc;?></div>
</fieldset>
</td>
</tr>
<?php include '../../common/view/mail.footer.html.php';?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.footer.html.php';?>
+3 -3
View File
@@ -24,11 +24,11 @@ src=$1/
dest=$2/
# Rsync when the shell load first.
rsync -aqP --exclude='*.svn' --exclude="db/" --exclude="doc/" $src $dest
rsync -aqP --exclude="db/" --exclude="doc/" $src $dest
echo `date "+%H:%M:%S"` sync $src to $dest succssfully.
# Watch the $src directory, and sync files to destination.
inotifywait -mrq --event create,modify,delete,move --format '%w %e %f' --exclude=".svn" $src |\
inotifywait -mrq --event create,modify,delete,move --format '%w %e %f' $src |\
while read watcher event file ; do
# compute the $path2process.
@@ -56,7 +56,7 @@ while read watcher event file ; do
else
echo `date "+%H:%M:%S"` $path2process copied.
rsync -aqP --exclude='*.svn' --exclude='db/' --exclude='doc/' $src/ $dest
rsync -aqP --exclude='db/' --exclude='doc/' $src/ $dest
fi
done