maintainrelation.html.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /**
  3. * The control file of execution module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2012 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license business(商业软件)
  7. * @author Yangyang Shi <shiyangyang@cnezsoft.com>
  8. * @package execution
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php include "featurebar.html.php";?>
  15. <div id="mainContent" class="main-row hide-side">
  16. <div class='main-col'>
  17. <div class='cell'>
  18. <form method='post' class='load-indicator main-form' target='hiddenwin'>
  19. <?php if(!empty($relations)):?>
  20. <table class='table table-fixed mgb-20 table-form with-border'>
  21. <thead>
  22. <tr class='colhead text-center'>
  23. <th class='w-id'><?php echo $lang->execution->gantt->id;?></th>
  24. <th><?php echo $lang->execution->gantt->pretask;?></th>
  25. <th class='w-150px'><?php echo $lang->execution->gantt->condition;?></th>
  26. <th><?php echo $lang->execution->gantt->task;?></th>
  27. <th class='w-140px'><?php echo $lang->execution->gantt->action;?></th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <?php foreach($relations as $id => $relation):?>
  32. <?php
  33. $tasksClone = $tasks;
  34. unset($tasksClone[$relation->pretask]);
  35. ?>
  36. <tr>
  37. <td class='text-center'><?php echo $id . html::hidden("id[$id]", "$id");?></td>
  38. <td style='overflow:visible'><?php echo html::select("pretask[$id]", $tasks, $relation->pretask, "class='form-control chosen' onchange='deleteself(this, $id, \"\")'");?></td>
  39. <td><?php echo html::select("condition[$id]", $lang->execution->gantt->preTaskStatus, $relation->condition, 'class=form-control');?> </td>
  40. <td style='overflow:visible'><?php echo html::select("task[$id]", $tasksClone, $relation->task, "class='form-control chosen'");?> </td>
  41. <td><?php echo html::select("action[$id]", $lang->execution->gantt->taskActions, $relation->action, 'class=form-control');?> </td>
  42. </tr>
  43. <?php endforeach;?>
  44. </tbody>
  45. </table>
  46. <?php endif;?>
  47. <table class='table table-form table-fixed with-border'>
  48. <caption class='text-left'><strong><?php echo $lang->execution->gantt->newCreateRelationOfTasks;?></strong></caption>
  49. <thead>
  50. <tr class='colhead text-center'>
  51. <th class='w-id'><?php echo $lang->execution->gantt->id;?></th>
  52. <th><?php echo $lang->execution->gantt->pretask;?></th>
  53. <th class='w-150px'><?php echo $lang->execution->gantt->condition;?></th>
  54. <th><?php echo $lang->execution->gantt->task;?></th>
  55. <th class='w-140px'><?php echo $lang->execution->gantt->action;?></th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. <?php for($i = 1 ; $i <= 5 ; $i++):?>
  60. <tr>
  61. <td class='text-center'><?php echo $i . html::hidden("newid[$i]", $i);?></td>
  62. <td style='overflow:visible'><?php echo html::select("newpretask[$i]", $undoneTasks, '', "class='form-control chosen' onchange='deleteself(this, $i, \"new\")'");?> </td>
  63. <td><?php echo html::select("newcondition[$i]", $lang->execution->gantt->preTaskStatus, '', 'class=form-control');?> </td>
  64. <td style='overflow:visible'><?php echo html::select("newtask[$i]", $undoneTasks, '', "class='form-control chosen'");?> </td>
  65. <td><?php echo html::select("newaction[$i]", $lang->execution->gantt->taskActions, '', 'class=form-control');?> </td>
  66. </tr>
  67. <?php endfor;?>
  68. </tbody>
  69. <tfoot>
  70. <tr>
  71. <td colspan='5' class='text-center form-actions'>
  72. <?php echo html::submitButton() . html::backButton();?>
  73. </td>
  74. </tr>
  75. </tfoot>
  76. </table>
  77. </form>
  78. </div>
  79. </div>
  80. </div>
  81. <script language='Javascript'>
  82. $('#ganttTab').addClass('active');
  83. $('#maintainRelation').addClass('active');
  84. function deleteself(obj, i, isnew)
  85. {
  86. var value = $(obj).val();
  87. var options = '';
  88. $(obj).find('option').each(function(){
  89. var optionValue = $(this).attr('value');
  90. if(optionValue != value || optionValue == '') options = options + "<option value='" + optionValue + "'>" + $(this).html() + "</option>";
  91. });
  92. $('select').each(function()
  93. {
  94. if($(this).attr('name') == isnew + "task[" + i + "]")
  95. {
  96. $(this).html(options);
  97. $(this).trigger("chosen:updated");
  98. }
  99. });
  100. }
  101. </script>
  102. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>