products.html.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. /**
  3. * The admin view file of feedback 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 Yidong Wang <yidong@cnezsoft.com>
  8. * @package feedback
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <div id="mainMenu" class="clearfix">
  15. <span class='label label-info'><?php echo $lang->feedback->hasPrivUser;?></span>
  16. <div class='btn-toolbar pull-right'>
  17. <?php common::printLink('feedback', 'productSetting', "", '<i class="icon icon-cog-outline"></i> ' . $lang->feedback->productSetting, '', "data-type='iframe' data-toggle='modal' data-size='lg'");?>
  18. </div>
  19. </div>
  20. <div id='mainContent' class='main-table'>
  21. <table id="productList" class="table has-sort-head table-nested table-fixed" data-ride="table" data-nested='true' data-preserve-nested='true' data-expand-nest-child='true'>
  22. <thead>
  23. <tr>
  24. <th class='w-400px'>
  25. <?php echo $app->getClientLang() == 'en' ? ($lang->productCommon . 's') : $lang->productCommon;?>
  26. </th>
  27. <th><?php echo $lang->user->common;?></th>
  28. <th class='w-60px c-actions text-left'><?php echo $lang->actions?></th>
  29. </tr>
  30. </thead>
  31. <?php if($productStructure):?>
  32. <tbody id="productTableList">
  33. <?php $lineNames = array();?>
  34. <?php foreach($productStructure as $programID => $program):?>
  35. <?php
  36. $trAttrs = "data-id='program.$programID' data-parent='0' data-nested='true'";
  37. $trClass = 'is-top-level table-nest-child text-center';
  38. $trAttrs .= " class='$trClass'";
  39. ?>
  40. <?php
  41. if(isset($programLines[$programID]))
  42. {
  43. foreach($programLines[$programID] as $lineID => $lineName)
  44. {
  45. if(!isset($program[$lineID]))
  46. {
  47. $program[$lineID] = array();
  48. $program[$lineID]['product'] = '';
  49. $program[$lineID]['lineName'] = $lineName;
  50. }
  51. }
  52. }
  53. ?>
  54. <?php if(isset($program['programName']) and $config->systemMode == 'ALM'):?>
  55. <tr class="row-program" <?php echo $trAttrs;?>>
  56. <td class='text-left table-nest-title' title="<?php echo $program['programName']?>">
  57. <i class="table-nest-icon icon table-nest-toggle icon-plus"></i>
  58. <i class="icon icon-cards-view"></i>
  59. <span><?php echo $program['programName']?></span>
  60. </td>
  61. </tr>
  62. <?php unset($program['programName']);?>
  63. <?php endif;?>
  64. <?php foreach($program as $lineID => $line):?>
  65. <?php if(isset($line['lineName']) and isset($line['products']) and is_array($line['products']) and $config->systemMode == 'ALM'):?>
  66. <?php $lineNames[] = $line['lineName'];?>
  67. <?php
  68. if($programID)
  69. {
  70. $trAttrs = "data-id='line.$lineID' data-parent='program.$programID'";
  71. $trAttrs .= " data-nest-parent='program.$programID' data-nest-path='program.$programID,line.$lineID'" . "class='text-center'";
  72. }
  73. else
  74. {
  75. $trAttrs = "data-id='line.$lineID' data-parent='0' data-nested='true'";
  76. $trClass = 'is-top-level table-nest-child text-center';
  77. $trAttrs .= " class='$trClass'";
  78. }
  79. ?>
  80. <tr class="row-line" <?php echo $trAttrs;?>>
  81. <td class='text-left table-nest-title' title="<?php echo $line['lineName']?>">
  82. <span class="table-nest-icon icon table-nest-toggle"></span>
  83. <?php echo $line['lineName']?>
  84. </td>
  85. </tr>
  86. <?php unset($line['lineName']);?>
  87. <?php endif;?>
  88. <?php if(isset($line['products']) and is_array($line['products'])):?>
  89. <?php foreach($line['products'] as $productID => $product):?>
  90. <?php
  91. $trClass = '';
  92. if($product->line and $this->config->systemMode == 'ALM')
  93. {
  94. $path = "line.$product->line,$product->id";
  95. if($this->config->systemMode == 'ALM' and $product->program) $path = "program.$product->program,$path";
  96. $trAttrs = "data-id='$product->id' data-parent='line.$product->line'";
  97. $trClass .= ' is-nest-child table-nest';
  98. $trAttrs .= " data-nest-parent='line.$product->line' data-nest-path='$path'";
  99. }
  100. elseif($product->program and $this->config->systemMode == 'ALM')
  101. {
  102. $trAttrs = "data-id='$product->id' data-parent='program.$product->program'";
  103. $trClass .= ' is-nest-child table-nest';
  104. $trAttrs .= " data-nest-parent='program.$product->program' data-nest-path='program.$product->program,$product->id'";
  105. }
  106. else
  107. {
  108. $trAttrs = "data-id='$product->id' data-parent='0'";
  109. $trClass .= ' no-nest';
  110. }
  111. $trAttrs .= " class='$trClass'";
  112. ?>
  113. <tr class="row-product" <?php echo $trAttrs;?>>
  114. <td class="c-name text-left sort-handler table-nest-title" title='<?php echo $product->name?>'>
  115. <?php echo $product->name;?>
  116. </td>
  117. <?php
  118. $authorizedUser = '';
  119. if(isset($feedbackView[$productID]))
  120. {
  121. foreach($feedbackView[$productID] as $account => $view)
  122. {
  123. if(!isset($users[$account])) continue;
  124. $user = $users[$account];
  125. $authorizedUser .= empty($user->realname) ? ',' . $account : ',' . $user->realname;
  126. }
  127. $authorizedUser = substr($authorizedUser, 1);
  128. }
  129. ?>
  130. <td class='text-left text-ellipsis' title='<?php echo $authorizedUser;?>'>
  131. <?php echo $authorizedUser;?>
  132. </td>
  133. <td class='c-actions'>
  134. <?php common::printLink('feedback', 'manageProduct', "product=$productID", "<i class='icon-group-managepriv icon-lock'></i>", '', "class='iframe btn' title='{$lang->feedback->manageProduct}'", '', true);?>
  135. </td>
  136. </tr>
  137. <?php endforeach;?>
  138. <?php endif;?>
  139. <?php endforeach;?>
  140. <?php endforeach;?>
  141. </tbody>
  142. <?php endif;?>
  143. </table>
  144. <div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
  145. </div>
  146. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>