batchedit.html.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * The batchedit view file of product module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  6. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Wang Yidong <yidong@easycorp.ltd>
  8. * @package product
  9. * @link https://www.zentao.net
  10. */
  11. namespace zin;
  12. jsVar('lines', $lines);
  13. $items = array();
  14. $items['productIdList'] = array('name' => 'productIdList', 'label' => '', 'control' => 'hidden', 'hidden' => true);
  15. $items['id'] = array('name' => 'id', 'label' => $lang->idAB, 'control' => 'index', 'width' => '60px');
  16. foreach($fields as $fieldName => $field)
  17. {
  18. if($config->systemMode == 'light' && $fieldName == 'line') continue;
  19. $items[$fieldName] = array('name' => $fieldName, 'label' => $field['title'], 'control' => $field['control'], 'width' => $field['width'], 'required' => $field['required'], 'items' => zget($field, 'options', array()));
  20. if($items[$fieldName]['control'] == 'select') $items[$fieldName]['control'] = 'picker';
  21. }
  22. $items['acl']['control'] = array('control' => $items['acl']['control'], 'inline' => true);
  23. if($app->getClientLang() == 'en') $items['acl']['width'] = '150px';
  24. /* Build form field value for batch edit. */
  25. $fieldNameList = array_keys($items);
  26. formBatchPanel
  27. (
  28. on::change('[data-name="program"]', 'loadProductLines'),
  29. set::title($lang->product->batchEdit),
  30. set::mode('edit'),
  31. set::customFields(array('list' => $customFields, 'show' => explode(',', $showFields), 'key' => 'batchEditFields')),
  32. set::items($items),
  33. set::data(array_values($products)),
  34. set::onRenderRow(jsRaw('renderRowData'))
  35. );
  36. render();