managescope.html.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * The scope view file of deploy 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 deploy
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php js::set('hosts', $hosts);?>
  15. <div id='mainContent' class='main-content'>
  16. <div class='main-header'>
  17. <h2>
  18. <strong><?php echo $deploy->name . $lang->hyphen . $lang->deploy->manageScope;?></strong>
  19. </h2>
  20. </div>
  21. <div class='main'>
  22. <form method='post' target='hiddenwin'>
  23. <table class='table table-form table-fixed'>
  24. <thead>
  25. <tr>
  26. <th><?php echo $lang->deploy->service?></th>
  27. <th><?php echo $lang->deploy->hadHost?></th>
  28. <th><?php echo $lang->deploy->removeHost?></th>
  29. <th><?php echo $lang->deploy->addHost?></th>
  30. <th class='w-120px'></th>
  31. <tr>
  32. </thead>
  33. <tbody>
  34. <?php $i = 1;?>
  35. <?php if($scope):?>
  36. <?php foreach($scope as $item):?>
  37. <tr>
  38. <td style='overflow: visible'><?php echo html::select("service[$i]", $optionMenu, $item->service, "class='form-control chosen' onchange='loadHost(this)'")?></td>
  39. <?php
  40. $service = zget($services, $item->service, '');
  41. $serviceHosts = zget($service, 'hosts') . ',' . $item->hosts;
  42. $hostPairs = array('' => '');
  43. if($serviceHosts)
  44. {
  45. foreach(explode(',', $serviceHosts) as $hostID)
  46. {
  47. if(!isset($hosts[$hostID])) continue;
  48. $hostPairs[$hostID] = $hosts[$hostID];
  49. }
  50. }
  51. ?>
  52. <td style='overflow: visible'><?php echo html::select("hosts[$i][]", $hostPairs, $item->hosts, "class='form-control chosen' multiple");?></td>
  53. <td style='overflow: visible'><?php echo html::select("remove[$i][]", $hostPairs, $item->remove, "class='form-control chosen' multiple");?></td>
  54. <td style='overflow: visible'><?php echo html::select("add[$i][]", $hosts, $item->add, "class='form-control chosen' multiple");?></td>
  55. <td>
  56. <div class='btn-group'>
  57. <?php echo html::commonButton("<i class='icon icon-plus'></i>", "onclick='addItem(this)'");?>
  58. <?php echo html::commonButton("<i class='icon icon-close'></i>", "onclick='removeItem(this)'");?>
  59. </div>
  60. </td>
  61. </tr>
  62. <?php $i++; ?>
  63. <?php endforeach;?>
  64. <?php else:?>
  65. <tr>
  66. <td style='overflow: visible'><?php echo html::select("service[$i]", $optionMenu, '', "class='form-control chosen' onchange='loadHost(this)'")?></td>
  67. <td style='overflow: visible'><?php echo html::select("hosts[$i][]", $hosts, '', "class='form-control chosen' multiple");?></td>
  68. <td style='overflow: visible'><?php echo html::select("remove[$i][]", $hosts, '', "class='form-control chosen' multiple");?></td>
  69. <td style='overflow: visible'><?php echo html::select("add[$i][]", $hosts, '', "class='form-control chosen' multiple");?></td>
  70. <td>
  71. <div class='btn-group'>
  72. <?php echo html::commonButton("<i class='icon icon-plus'></i>", "onclick='addItem(this)'");?>
  73. <?php echo html::commonButton("<i class='icon icon-close'></i>", "onclick='removeItem(this)'");?>
  74. </div>
  75. </td>
  76. </tr>
  77. <?php $i++; ?>
  78. <?php endif;?>
  79. </tbody>
  80. <tfoot>
  81. <tr>
  82. <td colspan='5' class='text-center form-actions'>
  83. <?php echo html::submitButton();?>
  84. <?php echo html::backButton();?>
  85. </td>
  86. </tr>
  87. </tfoot>
  88. </table>
  89. </form>
  90. </div>
  91. </div>
  92. <?php js::set('index', $i);?>
  93. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>