doc.html.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * The doc view file of my module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Yuting Wang <wangyuting@easycorp.ltd>
  7. * @package my
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('account', $app->user->account);
  12. jsVar('draftLabel', $lang->doc->draft);
  13. jsVar('canCollect', common::hasPriv('doc', 'collect'));
  14. jsVar('objectIconList', $config->doc->objectIconList);
  15. featureBar
  16. (
  17. set::current($type),
  18. set::linkParams("mode=doc&type={key}&param=&orderBy={$orderBy}"),
  19. li(searchToggle(set::module('contributeDoc'), set::open($type == 'bySearch')))
  20. );
  21. if($type == 'openedbyme') unset($config->my->doc->dtable->fieldList['addedBy']);
  22. if($type == 'editedbyme') unset($config->my->doc->dtable->fieldList['editedBy']);
  23. $docs = initTableData($docs, $config->my->doc->dtable->fieldList, $this->doc);
  24. $cols = array_values($config->my->doc->dtable->fieldList);
  25. $data = array_values($docs);
  26. foreach($data as $doc)
  27. {
  28. if(!isset($doc->actions)) continue;
  29. foreach($doc->actions as &$action)
  30. {
  31. $actionName = $action['name'];
  32. if(!empty($doc->frozen) && in_array($actionName, array('edit', 'delete'))) $action['hint'] = sprintf($this->lang->doc->frozenTips, $this->lang->doc->{$actionName});
  33. }
  34. }
  35. dtable
  36. (
  37. set::cols($cols),
  38. set::data($data),
  39. set::userMap($users),
  40. set::onRenderCell(jsRaw('window.renderCell')),
  41. set::orderBy($orderBy),
  42. set::sortLink(createLink('my', $app->rawMethod, "mode=doc&type={$type}&param={$param}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")),
  43. set::footPager(usePager()),
  44. set::emptyTip($lang->doc->noDoc)
  45. );
  46. render();