+ Add sort, statistics and pager for release view.

This commit is contained in:
caoyanyi
2023-06-06 16:24:41 +08:00
parent 4380c246bb
commit b2eb3bb723
2 changed files with 88 additions and 4 deletions
+12 -4
View File
@@ -19,13 +19,21 @@ detailHeader
);
jsVar('type', $type);
jsVar('orderBy', $orderBy);
jsVar('sortLink', helper::createLink('release', 'view', "releaseID={$release->id}&type={$type}&link={$link}&param={$param}&orderBy={orderBy}"));
jsVar('storyCases', $storyCases);
jsVar('summary', $summary);
jsVar('checkedSummary', str_replace('%storyCommon%', $lang->SRCommon, $lang->product->checkedSummary));
/* Table data and setting for finished story tab. */
$storyFootToolbar = array();
$storyTableData = initTableData($stories, $config->release->dtable->story->fieldList, $this->release);
jsVar('confirmUnlinkStory', $lang->release->confirmUnlinkStory);
jsVar('unlinkStoryUrl', helper::createLink('release', 'unlinkStory', "releaseID={$release->id}&story=%s"));
$storyTableData = initTableData($stories, $config->release->dtable->story->fieldList, $this->release);
$canBatchUnlinkStory = common::hasPriv('release', 'batchUnlinkStory');
$canBatchCloseStory = common::hasPriv('story', 'batchClose');
$storyFootToolbar = array();
if($canBatchUnlinkStory) $storyFootToolbar['items'][] = array('class' => 'btn primary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'btnType' => 'primary', 'data-url' => inlink('batchUnlinkStory', "release={$release->id}"));
if($canBatchCloseStory) $storyFootToolbar['items'][] = array('class' => 'btn primary size-sm batch-btn', 'text' => $lang->story->batchClose, 'btnType' => 'primary', 'data-url' => createLink('story', 'batchClose', "productID={$release->product}"));
@@ -45,7 +53,7 @@ detailBody
set::cols(array_values($config->release->dtable->story->fieldList)),
set::data($storyTableData),
set::checkable(true),
//set::sortLink(jsRaw('createSortLink')),
set::sortLink(jsRaw('createSortLink')),
set::footToolbar($storyFootToolbar),
set::footPager(
usePager(null, 'storyPager'),
@@ -53,7 +61,7 @@ detailBody
set::recTotal($storyPager->recTotal),
set::linkCreator(helper::createLink('release', 'view', "releaseID={$release->id}&type={$type}&link={$link}&param={$param}&orderBy={$orderBy}&recTotal={$storyPager->recTotal}&recPerPage={recPerPage}&page={page}"))
),
//set::checkInfo(jsRaw('function(checkedIDList){return window.setStatistics(this, checkedIDList);}'))
set::checkInfo(jsRaw('function(checkedIDList){return window.setStoryStatistics(this, checkedIDList);}'))
)
),
)