Merge branch 'tsj_fixbug'
This commit is contained in:
@@ -274,6 +274,9 @@ SELECT t1.`group`, t1.`module`, 'myCollection' FROM `zt_grouppriv` AS t1 WHERE t
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'myCreation' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'browse';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'myEdited' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'browse';
|
||||
|
||||
INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`)
|
||||
SELECT t1.`group`, t1.`module`, 'productSpace' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'tableContents';
|
||||
|
||||
|
||||
@@ -3426,6 +3426,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(1, 'doc', 'manageBook'),
|
||||
(1, 'doc', 'myCollection'),
|
||||
(1, 'doc', 'myCreation'),
|
||||
(1, 'doc', 'myEdited'),
|
||||
(1, 'doc', 'mySpace'),
|
||||
(1, 'doc', 'myView'),
|
||||
(1, 'doc', 'productSpace'),
|
||||
@@ -4780,6 +4781,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(2, 'doc', 'index'),
|
||||
(2, 'doc', 'myCollection'),
|
||||
(2, 'doc', 'myCreation'),
|
||||
(2, 'doc', 'myEdited'),
|
||||
(2, 'doc', 'mySpace'),
|
||||
(2, 'doc', 'myView'),
|
||||
(2, 'doc', 'productSpace'),
|
||||
@@ -5508,6 +5510,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(3, 'doc', 'index'),
|
||||
(3, 'doc', 'myCollection'),
|
||||
(3, 'doc', 'myCreation'),
|
||||
(3, 'doc', 'myEdited'),
|
||||
(3, 'doc', 'mySpace'),
|
||||
(3, 'doc', 'myView'),
|
||||
(3, 'doc', 'productSpace'),
|
||||
@@ -6188,6 +6191,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(4, 'doc', 'manageBook'),
|
||||
(4, 'doc', 'myCollection'),
|
||||
(4, 'doc', 'myCreation'),
|
||||
(4, 'doc', 'myEdited'),
|
||||
(4, 'doc', 'mySpace'),
|
||||
(4, 'doc', 'myView'),
|
||||
(4, 'doc', 'productSpace'),
|
||||
@@ -7223,6 +7227,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(5, 'doc', 'index'),
|
||||
(5, 'doc', 'myCollection'),
|
||||
(5, 'doc', 'myCreation'),
|
||||
(5, 'doc', 'myEdited'),
|
||||
(5, 'doc', 'mySpace'),
|
||||
(5, 'doc', 'myView'),
|
||||
(5, 'doc', 'productSpace'),
|
||||
@@ -8142,6 +8147,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(6, 'doc', 'index'),
|
||||
(6, 'doc', 'myCollection'),
|
||||
(6, 'doc', 'myCreation'),
|
||||
(6, 'doc', 'myEdited'),
|
||||
(6, 'doc', 'mySpace'),
|
||||
(6, 'doc', 'myView'),
|
||||
(6, 'doc', 'productSpace'),
|
||||
@@ -8939,6 +8945,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(7, 'doc', 'index'),
|
||||
(7, 'doc', 'myCollection'),
|
||||
(7, 'doc', 'myCreation'),
|
||||
(7, 'doc', 'myEdited'),
|
||||
(7, 'doc', 'mySpace'),
|
||||
(7, 'doc', 'myView'),
|
||||
(7, 'doc', 'productSpace'),
|
||||
@@ -9751,6 +9758,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(8, 'doc', 'index'),
|
||||
(8, 'doc', 'myCollection'),
|
||||
(8, 'doc', 'myCreation'),
|
||||
(8, 'doc', 'myEdited'),
|
||||
(8, 'doc', 'mySpace'),
|
||||
(8, 'doc', 'myView'),
|
||||
(8, 'doc', 'productSpace'),
|
||||
@@ -10592,6 +10600,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(9, 'doc', 'index'),
|
||||
(9, 'doc', 'myCollection'),
|
||||
(9, 'doc', 'myCreation'),
|
||||
(9, 'doc', 'myEdited'),
|
||||
(9, 'doc', 'mySpace'),
|
||||
(9, 'doc', 'myView'),
|
||||
(9, 'doc', 'productSpace'),
|
||||
@@ -11259,6 +11268,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(10, 'doc', 'index'),
|
||||
(10, 'doc', 'myCollection'),
|
||||
(10, 'doc', 'myCreation'),
|
||||
(10, 'doc', 'myEdited'),
|
||||
(10, 'doc', 'mySpace'),
|
||||
(10, 'doc', 'myView'),
|
||||
(10, 'doc', 'productSpace'),
|
||||
@@ -11762,6 +11772,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
|
||||
(11, 'doc', 'index'),
|
||||
(11, 'doc', 'myCollection'),
|
||||
(11, 'doc', 'myCreation'),
|
||||
(11, 'doc', 'myEdited'),
|
||||
(11, 'doc', 'mySpace'),
|
||||
(11, 'doc', 'myView'),
|
||||
(11, 'doc', 'productSpace'),
|
||||
|
||||
@@ -87,3 +87,17 @@ function initDatepicker($obj, callback)
|
||||
|
||||
if(typeof callback == 'function') callback($obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attr date check.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function attrDateCheck($obj)
|
||||
{
|
||||
$obj.find('.form-date').attr('onchange', 'checkDate(this, this.value)');
|
||||
$obj.find('.form-datetime').attr('onchange', 'checkDate(this, this.value)');
|
||||
}
|
||||
|
||||
|
||||
+44
-42
@@ -1,10 +1,8 @@
|
||||
$(function()
|
||||
{
|
||||
initCheckBox();
|
||||
initQueryBtn();
|
||||
$('#exportchart').modalTrigger();
|
||||
|
||||
chartMap = new Map();
|
||||
if(charts.length > 0)
|
||||
{
|
||||
var chartPros = charts.map(function(chart)
|
||||
@@ -12,7 +10,6 @@ $(function()
|
||||
var echartDom = $('#chartDraw' + chart.currentGroup + '_' + chart.id).get(0);
|
||||
var echart = echarts.init(echartDom);
|
||||
ajaxGetChart(false, chart, echart);
|
||||
chartMap.set(chart.cudrrentGroup + chart.id, chart);
|
||||
return renderFilters(chart);
|
||||
});
|
||||
|
||||
@@ -21,9 +18,14 @@ $(function()
|
||||
calcPreviewGrowFilter();
|
||||
$('body').resize(() => {calcPreviewGrowFilter(true);});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
chartMap = new Map();
|
||||
charts.forEach(function(chart)
|
||||
{
|
||||
chartMap.set(chart.currentGroup + '_' + chart.id, chart);
|
||||
});
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
})
|
||||
|
||||
@@ -73,53 +75,53 @@ function initCheckBox()
|
||||
/**
|
||||
* Init query button.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function initQueryBtn()
|
||||
function queryData(obj)
|
||||
{
|
||||
$('.btn-query').click(function()
|
||||
var chartID = $(obj).parents('.filterBox').attr('data-chart');
|
||||
var chartInfo = chartMap.get(chartID);
|
||||
chartInfo.searchFilters = JSON.parse(JSON.stringify(chartInfo.filters));
|
||||
|
||||
// Foreach filters and set current value in searchFilters. */
|
||||
$('#filterItems' + chartID + ' .filter-items').children().each(function(index)
|
||||
{
|
||||
var chartID = $(this).attr('data-chart');
|
||||
var chartInfo = chartMap.get(chartID);
|
||||
chartInfo.searchFilters = JSON.parse(JSON.stringify(chartInfo.filters));
|
||||
var $child = $(this);
|
||||
if(!$child.hasClass('filter-item')) return;
|
||||
|
||||
// Foreach filters and set current value in searchFilters. */
|
||||
$('#filterItems' + chartID + ' .filter-items').children().each(function(index)
|
||||
var filter = chartInfo.searchFilters[index];
|
||||
var type = filter.type;
|
||||
var value = null;
|
||||
|
||||
if(type == 'input' || type == 'select')
|
||||
{
|
||||
var $child = $(this);
|
||||
var filter = chartInfo.searchFilters[index];
|
||||
var type = filter.type;
|
||||
var value = null;
|
||||
var value = $child.find('#default').val();
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'date' || type == 'datetime')
|
||||
{
|
||||
var begin = $child.find('input').first().val();
|
||||
var end = $child.find('input').last().val();
|
||||
|
||||
if(type == 'input' || type == 'select')
|
||||
{
|
||||
var value = $child.find('#default').val();
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'date' || type == 'datetime')
|
||||
{
|
||||
var begin = $child.find('input').first().val();
|
||||
var end = $child.find('input').last().val();
|
||||
var value = {"begin":begin, "end":end};
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'condition')
|
||||
{
|
||||
var operator = $child.find('#operator').data('zui.picker').getValue();
|
||||
var value = $child.find('#value').val();
|
||||
|
||||
var value = {"begin":begin, "end":end};
|
||||
chartInfo.searchFilters[index].default = value;
|
||||
}
|
||||
else if(type == 'condition')
|
||||
{
|
||||
var operator = $child.find('#operator').data('zui.picker').getValue();
|
||||
var value = $child.find('#value').val();
|
||||
|
||||
chartInfo.searchFilters[index].operator = operator;
|
||||
chartInfo.searchFilters[index].value = value;
|
||||
}
|
||||
});
|
||||
|
||||
//* Reload echart. */
|
||||
var echartDom = $('#chartDraw' + chartID).get(0);
|
||||
var echartInfo = echarts.init(echartDom);
|
||||
ajaxGetChart(false, chartInfo, echartInfo);
|
||||
chartInfo.searchFilters[index].operator = operator;
|
||||
chartInfo.searchFilters[index].value = value;
|
||||
}
|
||||
});
|
||||
|
||||
//* Reload echart. */
|
||||
var echartDom = $('#chartDraw' + chartID).get(0);
|
||||
var echartInfo = echarts.init(echartDom);
|
||||
ajaxGetChart(false, chartInfo, echartInfo);
|
||||
}
|
||||
|
||||
function calcPreviewGrowFilter(resize = false)
|
||||
@@ -247,6 +249,6 @@ function renderFilterItem(filter, resp, index, step)
|
||||
};
|
||||
var html = $($.zui.formatString(tpl, data))
|
||||
initPicker(html, 'picker-select', true);
|
||||
initDatepicker(html);
|
||||
initDatepicker(html, attrDateCheck);
|
||||
return html;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<?php js::set('WIDTH_INPUT', $config->chart->widthInput);?>
|
||||
<?php js::set('WIDTH_DATE', $config->chart->widthDate);?>
|
||||
<?php js::set('pickerHeight', $config->bi->pickerHeight);?>
|
||||
<?php $queryDom = "<div class='queryBtn query-inside hidden'> <button type='submit' id='submit' class='btn btn-primary btn-query' data-loading='Loading...'>{$lang->chart->query}</button></div>";?>
|
||||
<?php $queryDom = "<div class='queryBtn query-inside hidden'> <button type='submit' id='submit' onclick='queryData(this)' class='btn btn-primary btn-query' data-loading='Loading...'>{$lang->chart->query}</button></div>";?>
|
||||
<?php js::set('queryDom', $queryDom);?>
|
||||
|
||||
<div id='mainMenu' class='clearfix main-position'>
|
||||
@@ -94,10 +94,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<div id="filterItems<?php echo $chart->currentGroup . '_';?><?php echo $chart->id;?>" class='filterBox'>
|
||||
<div id="filterItems<?php echo $chart->currentGroup . '_';?><?php echo $chart->id;?>" data-chart="<?php echo $chart->currentGroup . '_' . $chart->id?>"class='filterBox'>
|
||||
<div class='filter-items'></div>
|
||||
<?php if(!empty($chart->filters)):?>
|
||||
<div class='queryBtn query-outside'><?php echo html::submitButton($lang->chart->query, "data-chart={$chart->currentGroup}{$chart->id}", 'btn btn-primary btn-query');?></div>
|
||||
<div class='queryBtn query-outside'><?php echo html::submitButton($lang->chart->query, "onclick='queryData(this)'", 'btn btn-primary btn-query');?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div id="chartDraw<?php echo $chart->currentGroup . '_';?><?php echo $chart->id;?>" data-group="<?php echo $chart->currentGroup;?>" data-id="<?php echo $chart->id;?>" class='echart-content'></div>
|
||||
|
||||
+11
-9
@@ -411,6 +411,7 @@ class docModel extends model
|
||||
}
|
||||
|
||||
$query = $this->getDocQuery($this->session->contributeDocQuery);
|
||||
$query = preg_replace('/(`\w+`)/', 't1.$1', $query);
|
||||
$docIDList = $this->dao->select('objectID')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('objectID')->in($hasPrivDocIdList)
|
||||
@@ -3147,22 +3148,23 @@ class docModel extends model
|
||||
$myCreation->hasAction = false;
|
||||
$myCreation->active = $libType == 'createdby' ? 1 : 0;
|
||||
|
||||
$myEdition = new stdclass();
|
||||
$myEdition->id = 0;
|
||||
$myEdition->name = $this->lang->doc->myEdited;
|
||||
$myEdition->type = 'editedBy';
|
||||
$myEdition->objectType = 'doc';
|
||||
$myEdition->objectID = 0;
|
||||
$myEdition->hasAction = false;
|
||||
$myEdition->active = $libType == 'editedby' ? 1 : 0;
|
||||
$myEdited = new stdclass();
|
||||
$myEdited->id = 0;
|
||||
$myEdited->name = $this->lang->doc->myEdited;
|
||||
$myEdited->type = 'editedBy';
|
||||
$myEdited->objectType = 'doc';
|
||||
$myEdited->objectID = 0;
|
||||
$myEdited->hasAction = false;
|
||||
$myEdited->active = $libType == 'editedby' ? 1 : 0;
|
||||
|
||||
$libTree = array();
|
||||
$libTree[] = $myLib;
|
||||
if(common::hasPriv('doc', 'myView')) $libTree[] = $myView;
|
||||
if(common::hasPriv('doc', 'myCollection')) $libTree[] = $myCollection;
|
||||
if(common::hasPriv('doc', 'myCreation')) $libTree[] = $myCreation;
|
||||
if(common::hasPriv('doc', 'myEdition')) $libTree[] = $myEdition;
|
||||
if(common::hasPriv('doc', 'myEdited')) $libTree[] = $myEdited;
|
||||
}
|
||||
|
||||
return $libTree;
|
||||
}
|
||||
|
||||
|
||||
@@ -1401,7 +1401,7 @@ $lang->resource->doc->mySpace = 'mySpace';
|
||||
$lang->resource->doc->myView = 'myView';
|
||||
$lang->resource->doc->myCollection = 'myCollection';
|
||||
$lang->resource->doc->myCreation = 'myCreation';
|
||||
$lang->resource->doc->myEdition = 'myEdition';
|
||||
$lang->resource->doc->myEdited = 'myEdited';
|
||||
$lang->resource->doc->createLib = 'createLib';
|
||||
$lang->resource->doc->editLib = 'editLib';
|
||||
$lang->resource->doc->deleteLib = 'deleteLib';
|
||||
@@ -1426,7 +1426,7 @@ $lang->doc->methodOrder[10] = 'mySpace';
|
||||
$lang->doc->methodOrder[15] = 'myView';
|
||||
$lang->doc->methodOrder[20] = 'myCollection';
|
||||
$lang->doc->methodOrder[25] = 'myCreation';
|
||||
$lang->doc->methodOrder[30] = 'myEdition';
|
||||
$lang->doc->methodOrder[30] = 'myEdited';
|
||||
$lang->doc->methodOrder[35] = 'createLib';
|
||||
$lang->doc->methodOrder[40] = 'editLib';
|
||||
$lang->doc->methodOrder[45] = 'deleteLib';
|
||||
|
||||
@@ -90,8 +90,8 @@
|
||||
<td class="c-date"><?php echo formatTime($doc->editedDate, 'Y-m-d');?></td>
|
||||
<td class="c-actions">
|
||||
<?php if(common::canBeChanged('doc', $doc)):?>
|
||||
<?php common::printLink('doc', 'edit', "docID=$doc->id&comment=false&from={$lang->navGroup->doc}", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn btn-link' data-app='doc'", true, false)?>
|
||||
<?php common::printLink('doc', 'delete', "docID=$doc->id&confirm=no&from={$lang->navGroup->doc}", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?>
|
||||
<?php common::printLink('doc', 'edit', "docID=$doc->id&comment=false&from={$lang->navGroup->doc}", "<i class='icon icon-edit'></i>", '', "title='{$lang->edit}' class='btn' data-app='doc'", true, false)?>
|
||||
<?php common::printLink('doc', 'delete', "docID=$doc->id&confirm=no&from={$lang->navGroup->doc}", "<i class='icon icon-trash'></i>", 'hiddenwin', "title='{$lang->delete}' class='btn'")?>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user