Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -53,9 +53,9 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-addon'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=bug¤tModuleID=0&branch=$branch"), $lang->tree->manage, '_blank');
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=bug¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
echo ' ';
|
||||
echo html::a("javascript:loadProductModules($productID)", $lang->refresh);
|
||||
echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'");
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -106,9 +106,9 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-addon'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=bug¤tModuleID=0&branch=$bug->branch"), $lang->tree->manage, '_blank');
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=bug¤tModuleID=0&branch=$bug->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
echo ' ';
|
||||
echo html::a("javascript:loadProductModules($productID)", $lang->refresh);
|
||||
echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'");
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
<script>
|
||||
var noResultsMatch = '<?php echo $lang->noResultsMatch;?>';
|
||||
var chooseUsersToMail = '<?php echo $lang->chooseUsersToMail;?>';
|
||||
var defaultChosenOptions = {no_results_text: noResultsMatch, width:'100%', allow_single_deselect: true, disable_search_threshold: 1, placeholder_text_single: ' ', placeholder_text_multiple: ' ', search_contains: true};
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#mailto").attr('data-placeholder', chooseUsersToMail);
|
||||
$("#mailto, #productID").chosen(defaultChosenOptions).on('chosen:showing_dropdown', function()
|
||||
{
|
||||
var $this = $(this);
|
||||
var $chosen = $this.next('.chosen-container').removeClass('chosen-up');
|
||||
var $drop = $chosen.find('.chosen-drop');
|
||||
});
|
||||
$("#mailto, #productID").chosen($.defaultChosenOptions).on('chosen:showing_dropdown');
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -68,8 +68,8 @@
|
||||
<div id="mainContent" class="main-row">
|
||||
<div class="main-col col-8">
|
||||
<div class="cell">
|
||||
<div class="detail">
|
||||
<div class="detail-content article-content">
|
||||
<div class="detail no-margin no-padding">
|
||||
<div class="detail-content article-content no-margin no-padding">
|
||||
<?php
|
||||
$content = $doc->content;
|
||||
if($doc->type == 'url')
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated();' class='form-control chosen'");
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-btn'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=case¤tModuleID=0&branch=$branch"), "<i class='icon icon-cog'></i>", '_blank', "data-toggle='tooltip' class='btn' title='{$lang->tree->manage}'");
|
||||
echo html::a("javascript:loadProductModules($productID)", "<i class='icon icon-refresh'></i>", '', "data-toggle='tooltip' class='btn' title='{$lang->refresh}'");
|
||||
echo "<span class='input-group-addon'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=case¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'");
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -152,9 +152,9 @@
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-addon'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib¤tModuleID=0&branch=$case->branch"), $lang->tree->manage, '_blank');
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib¤tModuleID=0&branch=$case->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
echo ' ';
|
||||
echo html::a("javascript:loadLibModules($libID)", $lang->refresh);
|
||||
echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadLibModules($libID)'");
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
@@ -180,9 +180,9 @@
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-addon'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=case¤tModuleID=0&branch=$case->branch"), $lang->tree->manage, '_blank');
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=case¤tModuleID=0&branch=$case->branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
echo ' ';
|
||||
echo html::a("javascript:loadProductModules($productID)", $lang->refresh);
|
||||
echo html::a("#", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'");
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
|
||||
+48
-32
@@ -447,60 +447,76 @@ class todoModel extends model
|
||||
public function createByCycle($todoList)
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$today = helper::today();
|
||||
$lastCycleList = $this->dao->select('*')->from(TABLE_TODO)->where('type')->eq('cycle')->andWhere('idvalue')->in(array_keys($todoList))->orderBy('date_asc')->fetchAll('idvalue');
|
||||
foreach($todoList as $todoID => $todo)
|
||||
{
|
||||
$todo->config = json_decode($todo->config);
|
||||
if(!empty($todo->config->end) and time() > strtotime($todo->config->end)) continue;
|
||||
$lastCycle = zget($lastCycleList, $todoID, '');
|
||||
$time = time();
|
||||
for($i = 0; $i <= $todo->config->beforeDays; $i++)
|
||||
$begin = $todo->config->begin;
|
||||
$end = $todo->config->end;
|
||||
$beforeDays = (int)$todo->config->beforeDays;
|
||||
if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$begin -{$beforeDays} days"));
|
||||
if($today < $begin or (!empty($end) && $today > $end)) continue;
|
||||
|
||||
$newTodo = new stdclass();
|
||||
$newTodo->account = $todo->account;
|
||||
$newTodo->begin = $todo->begin;
|
||||
$newTodo->end = $todo->end;
|
||||
$newTodo->type = 'cycle';
|
||||
$newTodo->idvalue = $todoID;
|
||||
$newTodo->pri = $todo->pri;
|
||||
$newTodo->name = $todo->name;
|
||||
$newTodo->desc = $todo->desc;
|
||||
$newTodo->status = 'wait';
|
||||
$newTodo->private = $todo->private;
|
||||
|
||||
$date = '';
|
||||
$start = strtotime($begin);
|
||||
$finish = strtotime("$today +{$beforeDays} days");
|
||||
foreach(range($start, $finish, 86400) as $today)
|
||||
{
|
||||
$newDate = '';
|
||||
$newTodo = new stdclass();
|
||||
$newTodo->account = $todo->account;
|
||||
$newTodo->begin = $todo->begin;
|
||||
$newTodo->end = $todo->end;
|
||||
$newTodo->type = 'cycle';
|
||||
$newTodo->idvalue = $todoID;
|
||||
$newTodo->pri = $todo->pri;
|
||||
$newTodo->name = $todo->name;
|
||||
$newTodo->desc = $todo->desc;
|
||||
$newTodo->status = 'wait';
|
||||
$newTodo->private = $todo->private;
|
||||
$today = date('Y-m-d', $today);
|
||||
$lastCycle = zget($lastCycleList, $todoID, '');
|
||||
|
||||
$date = date('Y-m-d', $time + $i * 24 * 3600);
|
||||
if($todo->config->type == 'day')
|
||||
{
|
||||
if(empty($lastCycle)) $newDate = date('Y-m-d', $time + ($todo->config->day - 1) * 24 * 3600);
|
||||
if(!empty($lastCycle->date)) $newDate = date('Y-m-d', strtotime($lastCycle->date) + $todo->config->day * 24 * 3600);
|
||||
$day = (int)$todo->config->day;
|
||||
if($day <= 0) continue;
|
||||
|
||||
if(empty($lastCycle)) $date = date('Y-m-d', strtotime("{$today} +" . ($day - 1) . " days"));
|
||||
if(!empty($lastCycle->date)) $date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days"));
|
||||
}
|
||||
elseif($todo->config->type == 'week')
|
||||
{
|
||||
$week = date('w', strtotime($date));
|
||||
$week = date('w', strtotime($today));
|
||||
if(strpos(",{$todo->config->week},", ",{$week},") !== false)
|
||||
{
|
||||
if(empty($lastCycle)) $newDate = $date;
|
||||
if($lastCycle->date < $date) $newDate = $date;
|
||||
if(empty($lastCycle)) $date = $today;
|
||||
if($lastCycle->date < $today) $date = $today;
|
||||
}
|
||||
}
|
||||
elseif($todo->config->type == 'month')
|
||||
{
|
||||
$day = date('j', strtotime($date));
|
||||
$day = date('j', strtotime($today));
|
||||
if(strpos(",{$todo->config->month},", ",{$day},") !== false)
|
||||
{
|
||||
if(empty($lastCycle)) $newDate = $date;
|
||||
if($lastCycle->date < $date) $newDate = $date;
|
||||
if(empty($lastCycle)) $date = $today;
|
||||
if($lastCycle->date < $today) $date = $today;
|
||||
}
|
||||
}
|
||||
|
||||
if($date == $newDate)
|
||||
{
|
||||
$newTodo->date = $newDate;
|
||||
$this->dao->insert(TABLE_TODO)->data($newTodo)->exec();
|
||||
$this->action->create('todo', $this->dao->lastInsertID(), 'opened', '', '', $newTodo->account);
|
||||
$lastCycleList[$todoID] = $newTodo;
|
||||
}
|
||||
if(!$date) continue;
|
||||
if($date < $todo->config->begin) continue;
|
||||
if($date < date('Y-m-d')) continue;
|
||||
if($date > date('Y-m-d', $finish)) continue;
|
||||
if(!empty($end) && $date > $end) continue;
|
||||
|
||||
$newTodo->date = $date;
|
||||
|
||||
$this->dao->insert(TABLE_TODO)->data($newTodo)->exec();
|
||||
$this->action->create('todo', $this->dao->lastInsertID(), 'opened', '', '', $newTodo->account);
|
||||
|
||||
$lastCycleList[$todoID] = $newTodo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user