product.html.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * The product view file of workflowgroup module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2024 禅道软件(青岛)有限公司(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 Guangming Sun <sunguangming@chandao.com>
  7. * @package workflowgroup
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. jsVar('buildinLang', $lang->workflow->buildin);
  12. featurebar
  13. (
  14. set::current($browseType),
  15. set::linkParams("browseType={key}&orderBy={$orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")
  16. );
  17. hasPriv('workflowgroup', 'create') ? toolbar
  18. (
  19. item(set(array('icon' => 'plus', 'class' => 'primary', 'data-toggle' => 'modal', 'text' => $lang->workflowgroup->createProduct, 'url' => inlink('create', 'type=product'))))
  20. ) : null;
  21. $cols = $config->workflowgroup->dtable->product->fieldList;
  22. if(isset($cols['actions']['list']['design'])) $cols['actions']['list']['design']['url'] = array('module' => 'workflowgroup', 'method' => 'design', 'params' => 'id={id}');
  23. $cols['actions']['list']['delete']['data-confirm'] = sprintf($lang->workflowgroup->notice->confirmDelete, $lang->productCommon);
  24. $data = initTableData($groups, $cols, $this->workflowgroup);
  25. foreach($data as $workflowgroup)
  26. {
  27. if($workflowgroup->main == '0') continue;
  28. foreach($workflowgroup->actions as $i => $action)
  29. {
  30. if(!in_array($action['name'], array('edit', 'delete'))) continue;
  31. $workflowgroup->actions[$i]['disabled'] = true;
  32. }
  33. }
  34. dtable
  35. (
  36. set::cols($cols),
  37. set::data($data),
  38. set::orderBy($orderBy),
  39. set::onRenderCell(jsRaw('window.renderCell')),
  40. set::sortLink(createLink('workflowgroup', 'product', "orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}")),
  41. set::footPager(usePager())
  42. );