diff --git a/module/block/control.php b/module/block/control.php index 040259e31f..2f9f3742b6 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -2119,6 +2119,11 @@ class block extends control */ public function printDocViewListBlock() { + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = new pager(0, 6, 1); + + $this->view->docList = $this->loadModel('doc')->getDocsByBrowseType('all', 0, 0,'views_desc', $pager); } /** @@ -2129,6 +2134,11 @@ class block extends control */ public function printDocCollectListBlock() { + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = new pager(0, 6, 1); + + $this->view->docList = $this->loadModel('doc')->getDocsByBrowseType('all', 0, 0, 'collects_desc', $pager); } /** diff --git a/module/block/view/doccollectlistblock.html.php b/module/block/view/doccollectlistblock.html.php index e69de29bb2..6c966fc7c9 100644 --- a/module/block/view/doccollectlistblock.html.php +++ b/module/block/view/doccollectlistblock.html.php @@ -0,0 +1,51 @@ + + * @package block + * @version $Id$ + * @link https://www.zentao.net + */ +?> + +
+ +

doc->noDoc;?>

+ +
+ + +
+ + createLink('doc', 'view', "docID=$doc->id"), $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'"); + } + else + { + echo "$icon {$doc->title}"; + } + ?> +
+ doc->collectCount, $doc->collects);?> +
+
+ + +
+ +
diff --git a/module/block/view/docviewlistblock.html.php b/module/block/view/docviewlistblock.html.php index e69de29bb2..dfee048be2 100644 --- a/module/block/view/docviewlistblock.html.php +++ b/module/block/view/docviewlistblock.html.php @@ -0,0 +1,51 @@ + + * @package block + * @version $Id$ + * @link https://www.zentao.net + */ +?> + +
+ +

doc->noDoc;?>

+ +
+ + +
+ + createLink('doc', 'view', "docID=$doc->id"), $doc->title, '', "title='{$doc->title}' class='doc-title' data-app='{$this->app->tab}'"); + } + else + { + echo "$icon {$doc->title}"; + } + ?> +
+ doc->viewCount, $doc->views);?> +
+
+ + +
+ +
diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 842b920098..414e02d102 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -156,6 +156,8 @@ $lang->doc->todayUpdated = "Today's update"; $lang->doc->daysUpdated = 'Updated %s days ago'; $lang->doc->monthsUpdated = 'Updated %s months ago'; $lang->doc->yearsUpdated = 'Updated %s years ago'; +$lang->doc->viewCount = '%s Visits'; +$lang->doc->collectCount = '%s Collections'; /* Methods list */ $lang->doc->index = 'Dashboard'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 8da8c26eff..d8f4a0de89 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -156,6 +156,8 @@ $lang->doc->todayUpdated = "Today's update"; $lang->doc->daysUpdated = 'Updated %s days ago'; $lang->doc->monthsUpdated = 'Updated %s months ago'; $lang->doc->yearsUpdated = 'Updated %s years ago'; +$lang->doc->viewCount = '%s Visits'; +$lang->doc->collectCount = '%s Collections'; /* Methods list */ $lang->doc->index = 'Dashboard'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index da3a1ec203..1cf8e58da5 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -156,6 +156,8 @@ $lang->doc->todayUpdated = "Today's update"; $lang->doc->daysUpdated = 'Updated %s days ago'; $lang->doc->monthsUpdated = 'Updated %s months ago'; $lang->doc->yearsUpdated = 'Updated %s years ago'; +$lang->doc->viewCount = '%s Visits'; +$lang->doc->collectCount = '%s Collections'; /* Methods list */ $lang->doc->index = 'Dashboard'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 87be150799..fc3fcfb248 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -156,6 +156,8 @@ $lang->doc->todayUpdated = '今天更新'; $lang->doc->daysUpdated = '%s天前更新'; $lang->doc->monthsUpdated = '%s月前更新'; $lang->doc->yearsUpdated = '%s年前更新'; +$lang->doc->viewCount = '%s次浏览'; +$lang->doc->collectCount = '%s次收藏'; /* 方法列表。*/ $lang->doc->index = '仪表盘'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index dc661007d5..ed9ef1281b 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -9075,8 +9075,12 @@ class upgradeModel extends model $this->loadModel('doc'); $users = $this->dao->select('account')->from(TABLE_USER)->fetchPairs('account', 'account'); - $stmt = $this->dao->select('id,collector')->from(TABLE_DOC)->where('collector')->ne('')->query(); - while($doc = $stmt->fetch()) + $docs = $this->dao->select('id,collector')->from(TABLE_DOC)->where('collector')->ne('')->fetchAll(); + + $this->dao->update(TABLE_DOC)->set('collector')->eq(0)->exec(); + $this->dao->exec("ALTER TABLE " . TABLE_DOC . " CHANGE `collector` `collects` smallint unsigned NOT NULL DEFAULT '0'"); + + foreach($docs as $doc) { foreach(explode(',', $doc->collector) as $collector) { @@ -9087,9 +9091,6 @@ class upgradeModel extends model } } - $this->dao->update(TABLE_DOC)->set('collector')->eq(0)->where('collector')->eq('')->exec(); - $this->dao->exec("ALTER TABLE " . TABLE_DOC . " CHANGE `collector` `collects` smallint unsigned NOT NULL DEFAULT '0'"); - return true; } }