Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -36,32 +36,7 @@
|
||||
<?php $datatableId = $this->moduleName . ucfirst($this->methodName);?>
|
||||
$(document).ready(function()
|
||||
{
|
||||
'use strict';
|
||||
|
||||
var $datatable = $('table.datatable').first();
|
||||
var datatableId = $datatable.attr('id');
|
||||
var dtSetting = $.cookie('datatable.<?php echo $datatableId?>' + '.cols') || {};
|
||||
if(dtSetting === 'null') dtSetting = {};
|
||||
if(typeof dtSetting === 'string') dtSetting = $.parseJSON(dtSetting);
|
||||
var $modal = $('#customDatatable');
|
||||
var $checkList = $modal.find('.modal-body > .table > tbody');
|
||||
|
||||
$datatable.find('thead>tr>th').each(function(idx)
|
||||
{
|
||||
var $th = $(this);
|
||||
idx = $th.data('index') || idx;
|
||||
var colSetting = dtSetting[idx];
|
||||
$th.toggleClass('ignore', !!(colSetting && colSetting.ignore));
|
||||
});
|
||||
|
||||
$checkList.on('click', 'tr', function()
|
||||
{
|
||||
var $tr = $(this);
|
||||
if($tr.hasClass('disabled')) return;
|
||||
$tr.toggleClass('checked');
|
||||
});
|
||||
|
||||
$datatable.datatable(
|
||||
var datatableOptions =
|
||||
{
|
||||
customizable : false,
|
||||
sortable : false,
|
||||
@@ -73,19 +48,46 @@ $(document).ready(function()
|
||||
fixedHeader: true,
|
||||
ready: function()
|
||||
{
|
||||
$datatable.addClass('datatable-origin');
|
||||
if ($datatable.hasClass('has-sort-head'))
|
||||
this.$table.addClass('datatable-origin');
|
||||
if (this.$table.hasClass('has-sort-head'))
|
||||
{
|
||||
this.$datatable.find('.table').addClass('has-sort-head');
|
||||
}
|
||||
this.$datatable.find('.sparkline').sparkline();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(window).on('fixFooter', function(e, isFixed)
|
||||
window.initDatatable = function($datatable)
|
||||
{
|
||||
$('body').toggleClass('has-fixed-footer', isFixed);
|
||||
});
|
||||
$datatable = $datatable || $('table.datatable').first();
|
||||
if(!$datatable.length) return null;
|
||||
var $datatable = $('table.datatable').first();
|
||||
var datatableId = $datatable.attr('id');
|
||||
var dtSetting = $.cookie('datatable.<?php echo $datatableId?>' + '.cols') || {};
|
||||
if(dtSetting === 'null') dtSetting = {};
|
||||
if(typeof dtSetting === 'string') dtSetting = $.parseJSON(dtSetting);
|
||||
|
||||
$datatable.datatable(datatableOptions);
|
||||
|
||||
|
||||
$datatable.find('thead>tr>th').each(function(idx)
|
||||
{
|
||||
var $th = $(this);
|
||||
idx = $th.data('index') || idx;
|
||||
var colSetting = dtSetting[idx];
|
||||
$th.toggleClass('ignore', !!(colSetting && colSetting.ignore));
|
||||
});
|
||||
return $datatable;
|
||||
};
|
||||
|
||||
var $datatable = initDatatable();
|
||||
if($datatable && $datatable.length)
|
||||
{
|
||||
$('#main').on('beforeTableReload', '[data-ride="table"]', function()
|
||||
{
|
||||
initDatatable($datatable);
|
||||
});
|
||||
}
|
||||
|
||||
window.saveDatatableConfig = function(name, value, reload, global)
|
||||
{
|
||||
@@ -102,6 +104,20 @@ $(document).ready(function()
|
||||
url: '<?php echo $this->createLink('datatable', 'ajaxSave')?>'
|
||||
});
|
||||
};
|
||||
|
||||
var $modal = $('#customDatatable');
|
||||
var $checkList = $modal.find('.modal-body > .table > tbody');
|
||||
$checkList.on('click', 'tr', function()
|
||||
{
|
||||
var $tr = $(this);
|
||||
if($tr.hasClass('disabled')) return;
|
||||
$tr.toggleClass('checked');
|
||||
});
|
||||
|
||||
$(window).on('fixFooter', function(e, isFixed)
|
||||
{
|
||||
$('body').toggleClass('has-fixed-footer', isFixed);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -72,6 +72,17 @@ $uid = uniqid('');
|
||||
var editorTool = editorToolsMap[options.tools || editor.tools] || simpleTools;
|
||||
var placeholder = $editor.attr('placeholder') || options.placeholder || '';
|
||||
|
||||
/* Remove fullscreen in modal. */
|
||||
if(config.onlybody == 'yes')
|
||||
{
|
||||
var newEditorTool = new Array();
|
||||
for(i in editorTool)
|
||||
{
|
||||
if(editorTool[i] != 'fullscreen') newEditorTool.push(editorTool[i]);
|
||||
}
|
||||
editorTool = newEditorTool;
|
||||
}
|
||||
|
||||
$.extend(options,
|
||||
{
|
||||
items: editorTool,
|
||||
|
||||
@@ -47,7 +47,7 @@ $lang->productplan->desc = 'Description';
|
||||
$lang->productplan->begin = 'Begin';
|
||||
$lang->productplan->end = 'End';
|
||||
$lang->productplan->last = 'Last plan';
|
||||
$lang->productplan->future = 'Future';
|
||||
$lang->productplan->future = 'Pending';
|
||||
$lang->productplan->stories = 'Stories';
|
||||
$lang->productplan->bugs = 'Bugs';
|
||||
$lang->productplan->hour = 'Hour';
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<?php echo html::a(inlink("all", "status=wait&projectID=$project->id&orderBy=$orderBy&productID=$productID"), "<span class='text'>{$lang->project->statusList['wait']}</span>", '', "class='btn btn-link' id='waitTab'");?>
|
||||
<?php echo html::a(inlink("all", "status=doing&projectID=$project->id&orderBy=$orderBy&productID=$productID"), "<span class='text'>{$lang->project->statusList['doing']}</span>", '', "class='btn btn-link' id='doingTab'");?>
|
||||
<?php echo html::a(inlink("all", "status=suspended&projectID=$project->id&orderBy=$orderBy&productID=$productID"), "<span class='text'>{$lang->project->statusList['suspended']}</span>", '', "class='btn btn-link' id='suspendedTab'");?>
|
||||
<?php echo html::a(inlink("all", "status=done&projectID=$project->id&orderBy=$orderBy&productID=$productID"), "<span class='text'>{$lang->project->statusList['done']}</span>", '', "class='btn btn-link' id='doneTab'");?>
|
||||
<?php echo html::a(inlink("all", "status=closed&projectID=$project->id&orderBy=$orderBy&productID=$productID"), "<span class='text'>{$lang->project->statusList['closed']}</span>", '', "class='btn btn-link' id='closedTab'");?>
|
||||
<div class='input-control space w-180px'>
|
||||
<?php echo html::select('product', $products, $productID, "class='chosen form-control' onchange='byProduct(this.value, $projectID, \"$status\")'");?>
|
||||
</div>
|
||||
|
||||
@@ -38,10 +38,10 @@ $lang->report->singleColor[] = 'F6BD0F';
|
||||
|
||||
$lang->report->projectDeviation = $lang->projectCommon . ' Deviation';
|
||||
$lang->report->productSummary = $lang->productCommon . ' Summary';
|
||||
$lang->report->bugCreate = 'Bug Reported Statement';
|
||||
$lang->report->bugAssign = 'Bug Assigned Statement';
|
||||
$lang->report->workload = 'Team Workload Statement';
|
||||
$lang->report->workloadAB = 'Workload Statement';
|
||||
$lang->report->bugCreate = 'Bug Reported';
|
||||
$lang->report->bugAssign = 'Bug Assigned';
|
||||
$lang->report->workload = 'Team Workload ';
|
||||
$lang->report->workloadAB = 'Workload';
|
||||
$lang->report->bugOpenedDate = 'Bug reported from';
|
||||
$lang->report->taskAssignedDate = 'From';
|
||||
$lang->report->beginAndEnd = ' : from';
|
||||
@@ -50,9 +50,9 @@ $lang->report->deviationChart = $lang->projectCommon . ' Deviation Chart';
|
||||
|
||||
$lang->reportList->project->lists[10] = $lang->projectCommon . ' Deviation|report|projectdeviation';
|
||||
$lang->reportList->product->lists[10] = $lang->productCommon . ' Summary|report|productsummary';
|
||||
$lang->reportList->test->lists[10] = 'Bugs Reported Statement|report|bugcreate';
|
||||
$lang->reportList->test->lists[13] = 'Bugs Assigned Statement|report|bugassign';
|
||||
$lang->reportList->staff->lists[10] = 'Team Workload Statement|report|workload';
|
||||
$lang->reportList->test->lists[10] = 'Bugs Reported|report|bugcreate';
|
||||
$lang->reportList->test->lists[13] = 'Bugs Assigned|report|bugassign';
|
||||
$lang->reportList->staff->lists[10] = 'Team Workload|report|workload';
|
||||
|
||||
$lang->report->id = 'ID';
|
||||
$lang->report->project = $lang->projectCommon;
|
||||
|
||||
+24
-11
@@ -95,7 +95,7 @@ class reportModel extends model
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->andWhere('t1.parent')->eq(0)
|
||||
->andWhere('t2.status')->eq('done')
|
||||
->andWhere('t2.status')->eq('closed')
|
||||
->beginIF($begin)->andWhere('t2.begin')->ge($begin)->fi()
|
||||
->beginIF($end)->andWhere('t2.end')->le($end)->fi()
|
||||
->orderBy('t2.end_desc')
|
||||
@@ -288,32 +288,45 @@ class reportModel extends model
|
||||
->andWhere('t1.status')->notin('cancel, closed, done, pause')
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->andWhere('t2.status')->notin('cancel, closed, done, suspended')
|
||||
->andWhere('assignedTo')->ne('')
|
||||
->beginIF($dept)->andWhere('t3.dept')->in($depts)->fi()
|
||||
->fetchGroup('assignedTo', 'id');
|
||||
->fetchAll('id');
|
||||
|
||||
if(empty($tasks)) return array();
|
||||
|
||||
/* Fix bug for children. */
|
||||
$parents = array();
|
||||
foreach($tasks as $user => $userTasks)
|
||||
$parents = array();
|
||||
$taskIdList = array();
|
||||
$taskGroups = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($user)
|
||||
if(!empty($task->parent)) $parents[$task->parent] = $task->parent;
|
||||
$taskGroups[$task->assignedTo][$task->id] = $task;
|
||||
}
|
||||
|
||||
$multiTaskTeams = $this->dao->select('*')->from(TABLE_TEAM)->where('type')->eq('task')
|
||||
->andWhere('root')->in(array_keys($tasks))
|
||||
->fetchGroup('account', 'root');
|
||||
foreach($multiTaskTeams as $assignedTo => $multiTasks)
|
||||
{
|
||||
foreach($multiTasks as $task)
|
||||
{
|
||||
foreach($userTasks as $task)
|
||||
{
|
||||
if(!empty($task->parent)) $parents[$task->parent] = $task->parent;
|
||||
}
|
||||
$userTask = $tasks[$task->root];
|
||||
$userTask->estimate = $task->estimate;
|
||||
$userTask->consumed = $task->consumed;
|
||||
$userTask->left = $task->left;
|
||||
$taskGroups[$assignedTo][$task->root] = $userTask;
|
||||
}
|
||||
}
|
||||
|
||||
$workload = array();
|
||||
foreach($tasks as $user => $userTasks)
|
||||
foreach($taskGroups as $user => $userTasks)
|
||||
{
|
||||
if($user)
|
||||
{
|
||||
foreach($userTasks as $task)
|
||||
{
|
||||
if(!empty($parents) && in_array($task->id, $parents)) continue;
|
||||
if(isset($parents[$task->id])) continue;
|
||||
$workload[$user]['task'][$task->projectName]['count'] = isset($workload[$user]['task'][$task->projectName]['count']) ? $workload[$user]['task'][$task->projectName]['count'] + 1 : 1;
|
||||
$workload[$user]['task'][$task->projectName]['manhour'] = isset($workload[$user]['task'][$task->projectName]['manhour']) ? $workload[$user]['task'][$task->projectName]['manhour'] + $task->left : $task->left;
|
||||
$workload[$user]['task'][$task->projectName]['projectID'] = $task->project;
|
||||
|
||||
+12
-5
@@ -221,11 +221,11 @@ class task extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$mails = $this->task->batchCreate($projectID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
/* Locate the browser. */
|
||||
if(!empty($iframe)) die(js::reload('parent.parent'));
|
||||
die(js::locate($storyLink, 'parent'));
|
||||
if(!empty($iframe)) $this->send(array('result' => 'success', 'locate' => 'parent'));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $storyLink));
|
||||
}
|
||||
|
||||
/* Set Custom*/
|
||||
@@ -1289,8 +1289,10 @@ class task extends control
|
||||
if(!$this->session->taskWithChildren)
|
||||
{
|
||||
$children = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)
|
||||
->andWhere('parent')->in(array_keys($tasks))
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi()
|
||||
->andWhere('parent')->ne(0)
|
||||
->andWhere('parent', true)->in(array_keys($tasks))
|
||||
->beginIF($this->post->exportType == 'selected')->orWhere('id')->in($this->cookie->checkedItem)->fi()
|
||||
->markRight(1)
|
||||
->orderBy($sort)
|
||||
->fetchGroup('parent', 'id');
|
||||
if(!empty($children))
|
||||
@@ -1324,8 +1326,13 @@ class task extends control
|
||||
{
|
||||
array_splice($tasks, $position, 0, $children[$task->id]);
|
||||
$position += count($children[$task->id]);
|
||||
unset($children[$task->id]);
|
||||
}
|
||||
}
|
||||
if($children)
|
||||
{
|
||||
foreach($children as $childTasks) $tasks += $childTasks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,26 @@ $(function()
|
||||
{
|
||||
removeDitto();
|
||||
if($('#batchCreateForm table thead tr th.c-name').width() < 200) $('#batchCreateForm table thead tr th.c-name').width(200);
|
||||
|
||||
$('#batchCreateForm').ajaxForm(
|
||||
{
|
||||
finish:function(response)
|
||||
{
|
||||
if(response.locate)
|
||||
{
|
||||
if(response.locate == 'parent')
|
||||
{
|
||||
parent.$.cookie('selfClose', 1);
|
||||
setTimeout(function(){parent.$.closeModal(null, 'this')}, 1200);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(function(){window.location.href = response.locate;}, 1200);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* Get select of stories.*/
|
||||
|
||||
@@ -279,7 +279,7 @@ class taskModel extends model
|
||||
{
|
||||
if(!$taskID) return true;
|
||||
|
||||
$tasks = $this->dao->select('`id`,`estimate`,`consumed`,`left`')->from(TABLE_TASK)->where('parent')->eq($taskID)->andWhere('status')->ne('cancel')->andWhere('deleted')->eq(0)->fetchAll('id');
|
||||
$tasks = $this->dao->select('`id`,`estimate`,`consumed`,`left`, status')->from(TABLE_TASK)->where('parent')->eq($taskID)->andWhere('status')->ne('cancel')->andWhere('deleted')->eq(0)->fetchAll('id');
|
||||
if(empty($tasks)) return true;
|
||||
|
||||
$estimate = 0;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
$hiddenStory = ((isonlybody() and $storyID) || $config->global->flow == 'onlyTask') ? ' hidden' : '';
|
||||
if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
|
||||
?>
|
||||
<form method='post' class='load-indicator batch-actions-form' enctype='multipart/form-data' target='hiddenwin' id="batchCreateForm">
|
||||
<form method='post' class='load-indicator batch-actions-form form-ajax' enctype='multipart/form-data' id="batchCreateForm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-form" id="tableBody">
|
||||
<thead>
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
<span class='input-group-addon'><?php echo $lang->task->estimate?></span>
|
||||
<?php echo html::input("teamEstimate[]", $member->estimate, "class='form-control text-center' autocomplete='off' placeholder='{$lang->task->hour}'")?>
|
||||
<span class='input-group-addon fix-border'><?php echo $lang->task->consumed?></span>
|
||||
<?php echo html::input("teamConsumed[]", $member->consumed, "class='form-control text-center' autocomplete='off' placeholder='{$lang->task->hour}'")?>
|
||||
<?php echo html::input("teamConsumed[]", $member->consumed, "class='form-control text-center' autocomplete='off' disabled='false' placeholder='{$lang->task->hour}'")?>
|
||||
<span class='input-group-addon fix-border'><?php echo $lang->task->left?></span>
|
||||
<?php echo html::input("teamLeft[]", $member->left, "class='form-control text-center' autocomplete='off' placeholder='{$lang->task->hour}'")?>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@ $lang->testcase->files = 'Files';
|
||||
$lang->testcase->linkCase = 'Linked Cases';
|
||||
$lang->testcase->linkCases = 'Link Cases';
|
||||
$lang->testcase->unlinkCase = 'Unlink Cases';
|
||||
$lang->testcase->stage = 'Stage';
|
||||
$lang->testcase->stage = 'Phase';
|
||||
$lang->testcase->reviewedBy = 'Reviewed by';
|
||||
$lang->testcase->reviewedDate = 'Reviewed on';
|
||||
$lang->testcase->reviewResult = 'Review Result';
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user