* [story#69412,0.5h] add zentao list display.
This commit is contained in:
+20
-12
@@ -110,16 +110,18 @@ class doc extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function zentaoList(string $type)
|
||||
public function zentaoList(string $type, int $blockID)
|
||||
{
|
||||
list($url, $idList, $cols, $data) = $this->docZen->formFromSession($type);
|
||||
$blockData = $this->dao->select('*')->from(TABLE_DOCBLOCK)->where('id')->eq($blockID)->fetch();
|
||||
$content = json_decode($blockData->content, true);
|
||||
|
||||
$this->view->title = sprintf($this->lang->doc->insertTitle, $this->lang->doc->zentaoList[$type]);
|
||||
$this->view->type = $type;
|
||||
$this->view->url = $url;
|
||||
$this->view->idList = $idList;
|
||||
$this->view->cols = $cols;
|
||||
$this->view->data = $data;
|
||||
$this->view->title = sprintf($this->lang->doc->insertTitle, $this->lang->doc->zentaoList[$type]);
|
||||
$this->view->type = $type;
|
||||
$this->view->settings = $blockData->settings;
|
||||
$this->view->idList = $content['idList'];
|
||||
$this->view->cols = $content['cols'];
|
||||
$this->view->data = $content['data'];
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -132,12 +134,18 @@ class doc extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildZentaoList(string $type)
|
||||
public function buildZentaoList(int $docID, string $type)
|
||||
{
|
||||
$sessionName = 'zentaoList' . $type;
|
||||
$this->session->set($sessionName, $_POST);
|
||||
$docblock = new stdClass();
|
||||
$docblock->doc = $docID;
|
||||
$docblock->type = $type;
|
||||
$docblock->settings = $this->post->url;
|
||||
$docblock->content = json_encode(array('cols' => json_decode($this->post->cols), 'data' => json_decode($this->post->data), 'idList' => $this->post->idList));
|
||||
|
||||
return print(json_encode(array('result' => 'success')));
|
||||
$this->dao->insert(TABLE_DOCBLOCK)->data($docblock)->exec();
|
||||
if(dao::isError()) return print(json_encode(array('result' => 'fail', 'message' => dao::getError())));
|
||||
|
||||
return print(json_encode(array('result' => 'success', 'blockID' => $this->dao->lastInsertId())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.p-0-important {padding: 0 !important;}
|
||||
.mb-0-important {margin-bottom: 0 !important;}
|
||||
.w-22 {width: 88px;}
|
||||
html {overflow: hidden;}
|
||||
|
||||
@@ -62,9 +62,11 @@ function checkForm(form, formData)
|
||||
|
||||
window.backToSet = function()
|
||||
{
|
||||
const formData = getSettings(true);
|
||||
formData.append('action', 'preview');
|
||||
loadWithForm(formData, 'setting');
|
||||
const settings = $('#previewForm').data('settings');
|
||||
parent.zui.Modal.open({
|
||||
size: 'lg',
|
||||
url: settings
|
||||
});
|
||||
}
|
||||
|
||||
window.toggleCheckRows = function()
|
||||
|
||||
@@ -9,6 +9,7 @@ declare(strict_types=1);
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
set::zui(true);
|
||||
|
||||
$cols = array_values($cols);
|
||||
$data = array_values($data);
|
||||
@@ -21,6 +22,7 @@ formPanel
|
||||
(
|
||||
setID('previewForm'),
|
||||
setClass('mb-0-important'),
|
||||
set('data-settings', $settings),
|
||||
set::bodyClass('p-0-important'),
|
||||
set::actions(array()),
|
||||
div
|
||||
@@ -37,7 +39,9 @@ formPanel
|
||||
set::bordered(true),
|
||||
set::cols($cols),
|
||||
set::data($data),
|
||||
set::userMap($users),
|
||||
set::emptyTip($lang->doc->previewTip),
|
||||
set::checkable(false),
|
||||
/* set::afterRender(jsRaw('toggleCheckRows')) */
|
||||
),
|
||||
div
|
||||
@@ -61,3 +65,5 @@ formPanel
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
render('pagebase');
|
||||
|
||||
Reference in New Issue
Block a user