batchedit.html.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. $items = array_merge(array('idIndex' => array('name' => 'idIndex', 'label' => $lang->idAB, 'control' => 'index', 'width' => '60px')), $config->productplan->form->batchEdit);
  13. $items['future'] = array('name' => 'future', 'label' => $lang->productplan->future, 'control' => 'checkList', 'width' => '80px', 'items' => array(1 => $lang->productplan->future));
  14. $items['branch']['multiple'] = true;
  15. $items['branch']['items'] = $branchTagOption;
  16. if($product->type == 'normal') unset($items['branch']);
  17. $parentBranches = array();
  18. foreach($plans as $plan)
  19. {
  20. if($plan->begin == $config->productplan->future) $plan->begin = '';
  21. if($plan->end == $config->productplan->future) $plan->end = '';
  22. if($plan->parent > 0 and isset($parentList[$plan->parent]))
  23. {
  24. $parentPlan = $parentList[$plan->parent];
  25. foreach($branchTagOption as $branchID => $branchName)
  26. {
  27. if(strpos(",{$parentPlan->branch},", ",$branchID,") !== false) $parentBranches[$plan->parent][] = array('text' => $branchName, 'value' => $branchID);
  28. }
  29. }
  30. }
  31. $branchPickerItems = array();
  32. foreach($branchTagOption as $branchID => $branchName) $branchPickerItems[] = array('text' => $branchName, 'value' => $branchID);
  33. $statusPickerItems = array();
  34. $noWaitPickerItems = array();
  35. foreach($lang->productplan->statusList as $statusKey => $statusName)
  36. {
  37. $statusPickerItems[] = array('text' => $statusName, 'value' => $statusKey);
  38. if($statusKey != 'wait') $noWaitPickerItems[] = array('text' => $statusName, 'value' => $statusKey);
  39. }
  40. jsVar('oldBranch', $oldBranch);
  41. jsVar('futureConfig', $config->productplan->future);
  42. jsVar('branchPickerItems', $branchPickerItems);
  43. jsVar('parentBranches', $parentBranches);
  44. jsVar('statusPickerItems', $statusPickerItems);
  45. jsVar('noWaitPickerItems', $noWaitPickerItems);
  46. formBatchPanel
  47. (
  48. setID('bachEditForm'),
  49. set::title($lang->product->batchEdit),
  50. set::mode('edit'),
  51. set::items($items),
  52. set::data(array_values($plans)),
  53. set::onRenderRow(jsRaw('renderRowData'))
  54. );
  55. render();