batchedit.html.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * The batch edit file of product module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Congzhi Chen <congzhi@cnezsoft.com>
  8. * @package ZenTaoPMS
  9. * @version $Id$
  10. */
  11. ?>
  12. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  13. <?php js::set('openTip', $lang->product->aclTips['open']);?>
  14. <?php js::set('privateTip', $lang->product->aclTips['private']);?>
  15. <?php js::set('productLines', $lines);?>
  16. <?php $users = $this->user->getPairs('noletter');?>
  17. <div id="mainContent" class="main-content">
  18. <div class="main-header">
  19. <h2><?php echo $lang->product->batchEdit;?></h2>
  20. <div class="pull-right btn-toolbar">
  21. <?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=product&section=custom&key=batchEditFields')?>
  22. <?php include $app->getModuleRoot() . 'common/view/customfield.html.php';?>
  23. </div>
  24. </div>
  25. <?php
  26. $visibleFields = array();
  27. $requiredFields = array();
  28. foreach(explode(',', $showFields) as $field)
  29. {
  30. if($field) $visibleFields[$field] = '';
  31. }
  32. foreach(explode(',', $config->product->edit->requiredFields) as $field)
  33. {
  34. if($field)
  35. {
  36. $requiredFields[$field] = '';
  37. if(strpos(",{$config->product->customBatchEditFields},", ",{$field},") !== false) $visibleFields[$field] = '';
  38. }
  39. }
  40. ?>
  41. <form method='post' class='load-indicator main-form' enctype='multipart/form-data' target='hiddenwin' id="batchEditForm">
  42. <div class="table-responsive">
  43. <table class="table table-form">
  44. <thead>
  45. <tr>
  46. <th class='c-id'><?php echo $lang->idAB;?></th>
  47. <?php
  48. $width = '';
  49. $full = 'width: 100%';
  50. if(count($visibleFields) > 6)
  51. {
  52. $width = 'w-200px';
  53. $full = '';
  54. }
  55. ?>
  56. <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
  57. <th class='c-program<?php echo zget($visibleFields, 'program', ' hidden') . zget($requiredFields, 'program', '', ' required');?>'><?php echo $lang->product->program;?></th>
  58. <?php endif;?>
  59. <th class='required <?php echo $width;?>' style="<?php echo $full;?>"><?php echo $lang->product->name;?></th>
  60. <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
  61. <th class='c-line<?php echo zget($visibleFields, 'line', ' hidden') . zget($requiredFields, 'line', '', ' required');?>'><?php echo $lang->product->line;?></th>
  62. <?php endif;?>
  63. <th class='c-user-box<?php echo zget($visibleFields, 'PO', ' hidden') . zget($requiredFields, 'PO', '', ' required');?>'><?php echo $lang->product->PO;?></th>
  64. <th class='c-user-box<?php echo zget($visibleFields, 'PMT', ' hidden') . zget($requiredFields, 'PMT', '', ' required');?>'><?php echo $lang->product->PMT;?></th>
  65. <th class='c-type<?php echo zget($visibleFields, 'type', ' hidden') . zget($requiredFields, 'type', '', ' required');?>'><?php echo $lang->product->type;?></th>
  66. <th class='c-desc<?php echo zget($visibleFields, 'desc', ' hidden') . zget($requiredFields, 'desc', '', ' required');?>'><?php echo $lang->product->desc;?></th>
  67. <th class='c-acl<?php echo zget($visibleFields, 'acl', ' hidden');?>'><?php echo $lang->product->acl;?></th>
  68. <?php
  69. $extendFields = $this->product->getFlowExtendFields();
  70. foreach($extendFields as $extendField) echo "<th class='c-extend'>{$extendField->name}</th>";
  71. ?>
  72. </tr>
  73. </thead>
  74. <tbody>
  75. <?php foreach($productIDList as $productID):?>
  76. <?php
  77. if(!empty($this->config->moreLinks["PMT"])) $this->config->moreLinks["PMTs[$productID]"] = $this->config->moreLinks["PMT"];
  78. ?>
  79. <tr>
  80. <td><?php echo sprintf('%03d', $productID) . html::hidden("productIDList[$productID]", $productID);?></td>
  81. <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
  82. <?php if(isset($unauthorizedPrograms[$products[$productID]->program])):?>
  83. <td class='text-left<?php echo zget($visibleFields, 'program', ' hidden')?>' style='overflow:visible'><?php echo html::select("programs[$productID]", $unauthorizedPrograms, $products[$productID]->program, "class='form-control' disabled");?></td>
  84. <?php else:?>
  85. <td class='text-left<?php echo zget($visibleFields, 'program', ' hidden')?>' style='overflow:visible'><?php echo html::select("programs[$productID]", $programs, $products[$productID]->program, "class='form-control picker-select' data-allow_single_deselect='false' onchange='loadProductLines(this.value, $productID)'");?></td>
  86. <?php endif;?>
  87. <?php endif;?>
  88. <td title='<?php echo $products[$productID]->name?>'><?php echo html::input("names[$productID]", $products[$productID]->name, "class='form-control'");?></td>
  89. <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
  90. <?php $productLines = isset($lines[$products[$productID]->program]) ? $lines[$products[$productID]->program] : '';?>
  91. <td class='text-left<?php echo zget($visibleFields, 'line', ' hidden')?>' style='overflow:visible' id="line_<?php echo $productID;?>"><?php echo html::select("lines[$productID]", in_array($config->systemMode, array('ALM', 'PLM')) ? $productLines : $lines, $products[$productID]->line, "class='form-control picker-select'");?></td>
  92. <?php endif;?>
  93. <td class='text-left<?php echo zget($visibleFields, 'PO', ' hidden')?>' style='overflow:visible'><?php echo html::select("PO[$productID]", $users, $products[$productID]->PO, "class='form-control picker-select'");?></td>
  94. <td class='text-left<?php echo zget($visibleFields, 'PMT', ' hidden')?>' style='overflow:visible'><?php echo html::select("PMTs[$productID][]", $users, $products[$productID]->PMT, "class='form-control picker-select' multiple");?></td>
  95. <td class='<?php echo zget($visibleFields, 'type', 'hidden')?>'><?php echo html::select("types[$productID]", $lang->product->typeList, $products[$productID]->type, "class='form-control'");?></td>
  96. <td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("descs[$productID]", htmlSpecialString($products[$productID]->desc), "rows='1' class='form-control autosize'");?></td>
  97. <td class='<?php echo zget($visibleFields, 'acl', 'hidden')?>'> <?php echo nl2br(html::radio("acls[$productID]", $lang->product->abbr->aclList, $products[$productID]->acl));?></td>
  98. <?php foreach($extendFields as $extendField) echo "<td" . (($extendField->control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->loadModel('flow')->getFieldControl($extendField, $products[$productID], $extendField->field . "[{$productID}]") . "</td>";?>
  99. </tr>
  100. <?php
  101. if(isset($this->config->moreLinks["PMTs[$productID]"])) unset($this->config->moreLinks["PMTs[$productID]"]);
  102. ?>
  103. <?php endforeach;?>
  104. </tbody>
  105. </table>
  106. <div class='table-footer'>
  107. <div class="text-center form-actions">
  108. <?php echo html::submitButton();?>
  109. <?php echo html::backButton();?>
  110. </div>
  111. </div>
  112. </div>
  113. </form>
  114. </div>
  115. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>