product.html.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * The product view file of program 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 wangyidong<wangyidong@cnezsoft.com>
  7. * @package program
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. dropmenu();
  12. featureBar
  13. (
  14. set::current($browseType),
  15. set::linkParams("programID={$programID}&browseType={key}&orderBy=$orderBy")
  16. );
  17. toolbar
  18. (
  19. item(set
  20. (array(
  21. 'text' => $lang->product->create,
  22. 'icon' => 'plus',
  23. 'class' => 'btn primary',
  24. 'data-app' => 'product',
  25. 'url' => $this->createLink('product', 'create', "programID={$programID}")
  26. )))
  27. );
  28. $cols = $this->config->product->dtable->fieldList;
  29. $data = array();
  30. $products = initTableData($products, $cols, $this->product);
  31. foreach($products as $product) $data[] = $this->product->formatDataForList($product, $users, $usersAvatar);
  32. $summary = sprintf($lang->product->pageSummary, count($data));
  33. $footToolbar = hasPriv('product', 'batchEdit') ? array(
  34. 'type' => 'btn-group',
  35. 'items' => array(
  36. array(
  37. 'text' => $lang->edit,
  38. 'className' => 'secondary size-sm batch-btn',
  39. 'data-page' => 'batch',
  40. 'data-app' => $this->app->tab,
  41. 'data-formaction' => $this->createLink('product', 'batchEdit', "programID={$programID}")
  42. )
  43. )
  44. ) : null;
  45. dtable
  46. (
  47. setID('products'),
  48. set::userMap($users),
  49. set::cols($cols),
  50. set::data($data),
  51. set::nested(false),
  52. set::orderBy($orderBy),
  53. set::sortLink(createLink('program', 'product', "programID={$programID}&browseType={$browseType}&orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")),
  54. set::footToolbar($footToolbar),
  55. set::footPager(usePager()),
  56. set::checkInfo(jsRaw("function(checkedIDList){ return window.footerSummary(checkedIDList, '{$summary}');}"))
  57. );
  58. render();