| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- /**
- * The batch edit file of product module of ZenTaoPMS.
- *
- * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
- * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
- * @author Congzhi Chen <congzhi@cnezsoft.com>
- * @package ZenTaoPMS
- * @version $Id$
- */
- ?>
- <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
- <?php js::set('openTip', $lang->product->aclTips['open']);?>
- <?php js::set('privateTip', $lang->product->aclTips['private']);?>
- <?php js::set('productLines', $lines);?>
- <?php $users = $this->user->getPairs('noletter');?>
- <div id="mainContent" class="main-content">
- <div class="main-header">
- <h2><?php echo $lang->product->batchEdit;?></h2>
- <div class="pull-right btn-toolbar">
- <?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=product§ion=custom&key=batchEditFields')?>
- <?php include $app->getModuleRoot() . 'common/view/customfield.html.php';?>
- </div>
- </div>
- <?php
- $visibleFields = array();
- $requiredFields = array();
- foreach(explode(',', $showFields) as $field)
- {
- if($field) $visibleFields[$field] = '';
- }
- foreach(explode(',', $config->product->edit->requiredFields) as $field)
- {
- if($field)
- {
- $requiredFields[$field] = '';
- if(strpos(",{$config->product->customBatchEditFields},", ",{$field},") !== false) $visibleFields[$field] = '';
- }
- }
- ?>
- <form method='post' class='load-indicator main-form' enctype='multipart/form-data' target='hiddenwin' id="batchEditForm">
- <div class="table-responsive">
- <table class="table table-form">
- <thead>
- <tr>
- <th class='c-id'><?php echo $lang->idAB;?></th>
- <?php
- $width = '';
- $full = 'width: 100%';
- if(count($visibleFields) > 6)
- {
- $width = 'w-200px';
- $full = '';
- }
- ?>
- <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
- <th class='c-program<?php echo zget($visibleFields, 'program', ' hidden') . zget($requiredFields, 'program', '', ' required');?>'><?php echo $lang->product->program;?></th>
- <?php endif;?>
- <th class='required <?php echo $width;?>' style="<?php echo $full;?>"><?php echo $lang->product->name;?></th>
- <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
- <th class='c-line<?php echo zget($visibleFields, 'line', ' hidden') . zget($requiredFields, 'line', '', ' required');?>'><?php echo $lang->product->line;?></th>
- <?php endif;?>
- <th class='c-user-box<?php echo zget($visibleFields, 'PO', ' hidden') . zget($requiredFields, 'PO', '', ' required');?>'><?php echo $lang->product->PO;?></th>
- <th class='c-user-box<?php echo zget($visibleFields, 'PMT', ' hidden') . zget($requiredFields, 'PMT', '', ' required');?>'><?php echo $lang->product->PMT;?></th>
- <th class='c-type<?php echo zget($visibleFields, 'type', ' hidden') . zget($requiredFields, 'type', '', ' required');?>'><?php echo $lang->product->type;?></th>
- <th class='c-desc<?php echo zget($visibleFields, 'desc', ' hidden') . zget($requiredFields, 'desc', '', ' required');?>'><?php echo $lang->product->desc;?></th>
- <th class='c-acl<?php echo zget($visibleFields, 'acl', ' hidden');?>'><?php echo $lang->product->acl;?></th>
- <?php
- $extendFields = $this->product->getFlowExtendFields();
- foreach($extendFields as $extendField) echo "<th class='c-extend'>{$extendField->name}</th>";
- ?>
- </tr>
- </thead>
- <tbody>
- <?php foreach($productIDList as $productID):?>
- <?php
- if(!empty($this->config->moreLinks["PMT"])) $this->config->moreLinks["PMTs[$productID]"] = $this->config->moreLinks["PMT"];
- ?>
- <tr>
- <td><?php echo sprintf('%03d', $productID) . html::hidden("productIDList[$productID]", $productID);?></td>
- <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
- <?php if(isset($unauthorizedPrograms[$products[$productID]->program])):?>
- <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>
- <?php else:?>
- <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>
- <?php endif;?>
- <?php endif;?>
- <td title='<?php echo $products[$productID]->name?>'><?php echo html::input("names[$productID]", $products[$productID]->name, "class='form-control'");?></td>
- <?php if(in_array($config->systemMode, array('ALM', 'PLM'))):?>
- <?php $productLines = isset($lines[$products[$productID]->program]) ? $lines[$products[$productID]->program] : '';?>
- <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>
- <?php endif;?>
- <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>
- <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>
- <td class='<?php echo zget($visibleFields, 'type', 'hidden')?>'><?php echo html::select("types[$productID]", $lang->product->typeList, $products[$productID]->type, "class='form-control'");?></td>
- <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>
- <td class='<?php echo zget($visibleFields, 'acl', 'hidden')?>'> <?php echo nl2br(html::radio("acls[$productID]", $lang->product->abbr->aclList, $products[$productID]->acl));?></td>
- <?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>";?>
- </tr>
- <?php
- if(isset($this->config->moreLinks["PMTs[$productID]"])) unset($this->config->moreLinks["PMTs[$productID]"]);
- ?>
- <?php endforeach;?>
- </tbody>
- </table>
- <div class='table-footer'>
- <div class="text-center form-actions">
- <?php echo html::submitButton();?>
- <?php echo html::backButton();?>
- </div>
- </div>
- </div>
- </form>
- </div>
- <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
|