edit.html.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * The edit view file of workflowhook module of ZDOO.
  4. *
  5. * @copyright Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
  6. * @license 商业软件,非开源软件
  7. * @author Gang Liu <liugang@cnezsoft.com>
  8. * @package workflowhook
  9. * @version $Id$
  10. * @link http://www.zdoo.com
  11. */
  12. ?>
  13. <?php include '../../common/view/header.modal.html.php';?>
  14. <?php include '../../common/view/picker.html.php';?>
  15. <?php js::set('moduleName', $flow->module);?>
  16. <form id='editLinkageForm' method='post' action='<?php echo inlink('edit', "action={$action->id}&key={$key}&ui={$ui}");?>'>
  17. <table class='table table-form' id='linkageTable'>
  18. <tr>
  19. <td class='w-80px'></td>
  20. <td></td>
  21. <td class='w-80px'></td>
  22. <td></td>
  23. <td class='w-120px'></td>
  24. </tr>
  25. <?php $linkage = $action->linkages[$ui][$key];?>
  26. <?php $sources = zget($linkage, 'sources', array());?>
  27. <?php $targets = zget($linkage, 'targets', array());?>
  28. <?php $sourceIndex = 1;?>
  29. <?php if($sources):?>
  30. <?php foreach($sources as $source):?>
  31. <tr>
  32. <?php if($sourceIndex == 1):?>
  33. <th class='source' rowspan='<?php echo count($sources);?>'>
  34. <?php echo $lang->workflowlinkage->source;?>
  35. </th>
  36. <?php endif;?>
  37. <td><?php echo html::select("source[$sourceIndex]", $fields, $source->field, "id='source$sourceIndex' class='form-control chosen'");?></td>
  38. <td><?php echo html::select("operator[$sourceIndex]", $config->workflowlinkage->operatorList, $source->operator, "id='operator$sourceIndex' class='form-control'");?></td>
  39. <td class='value required'><?php echo html::input("value[$sourceIndex]", $source->value, "id='value$sourceIndex' class='form-control'");?></td>
  40. <td></td>
  41. </tr>
  42. <?php $sourceIndex++;?>
  43. <?php endforeach;?>
  44. <?php else:?>
  45. <tr>
  46. <th class='source' rowspan='1'><?php echo $lang->workflowlinkage->source;?></th>
  47. <td><?php echo html::select("source[$sourceIndex]", $fields, '', "id='source$sourceIndex' class='form-control chosen'");?></td>
  48. <td><?php echo html::select("operator[$sourceIndex]", $config->workflowlinkage->operatorList, '', "id='operator$sourceIndex' class='form-control'");?></td>
  49. <td class='value required'><?php echo html::input("value[$sourceIndex]", '', "id='value$sourceIndex' class='form-control'");?></td>
  50. <td></td>
  51. </tr>
  52. <?php $sourceIndex++;?>
  53. <?php endif;?>
  54. <tr class='errorTR'>
  55. <th></th>
  56. <td colspan='4'><div id='source'></div></td>
  57. </tr>
  58. <?php $targetIndex = 1;?>
  59. <?php if($targets):?>
  60. <?php foreach($targets as $target):?>
  61. <tr>
  62. <?php if($targetIndex == 1):?>
  63. <th class='target' rowspan='<?php echo count($targets);?>'>
  64. <?php echo $lang->workflowlinkage->target;?>
  65. </th>
  66. <?php endif;?>
  67. <td><?php echo html::select("target[$targetIndex]", $fields, $target->field, "id='target$targetIndex' class='form-control chosen'");?></td>
  68. <td class='text-center'><?php echo $lang->workflowlinkage->status;?></td>
  69. <td><?php echo html::select("status[$targetIndex]", $lang->workflowlinkage->statusList, $target->status, "id='status$targetIndex' class='form-control'");?></td>
  70. <td>
  71. <a href='javascript:;' class='btn addTarget'><i class='icon icon-plus'></i></a>
  72. <a href='javascript:;' class='btn delTarget'><i class='icon icon-close'></i></a>
  73. </td>
  74. </tr>
  75. <?php $targetIndex++;?>
  76. <?php endforeach;?>
  77. <?php else:?>
  78. <tr>
  79. <th class='target' rowspan='1'><?php echo $lang->workflowlinkage->target;?></th>
  80. <td><?php echo html::select("target[$targetIndex]", $fields, '', "id='target$targetIndex' class='form-control chosen'");?></td>
  81. <td class='text-center'><?php echo $lang->workflowlinkage->status;?></td>
  82. <td><?php echo html::select("status[$targetIndex]", $lang->workflowlinkage->statusList, '', "id='status$targetIndex' class='form-control'");?></td>
  83. <td>
  84. <a href='javascript:;' class='btn addTarget'><i class='icon icon-plus'></i></a>
  85. <a href='javascript:;' class='btn delTarget'><i class='icon icon-close'></i></a>
  86. </td>
  87. </tr>
  88. <?php $targetIndex++;?>
  89. <?php endif;?>
  90. <tr class='errorTR'>
  91. <th></th>
  92. <td colspan='4'><div id='target'></div></td>
  93. </tr>
  94. <tr>
  95. <th></th>
  96. <td class='form-actions' colspan='4'>
  97. <?php
  98. echo html::hidden('ui', $ui);
  99. echo html::submitButton();
  100. extCommonModel::printLink('workflowlinkage', 'browse', "action={$action->id}&ui={$ui}", $lang->goback, "class='btn btn-wide loadInModal iframe'");
  101. ?>
  102. <tr>
  103. </table>
  104. </form>
  105. <?php
  106. echo html::select('fieldTemplate', $fields, '', "class='form-control hidden'");
  107. $th = "<th class='target' rowspan='ROWSPAN'>{$lang->workflowlinkage->target}</th>";
  108. $target = html::select('target[KEY]', $fields, '', "id='targetKEY' class='form-control chosen'");
  109. $status = html::select('status[KEY]', $lang->workflowlinkage->statusList, '', "id='statusKEY' class='form-control'");
  110. $targetRow = <<<EOT
  111. <tr>
  112. <td>{$target}</td>
  113. <td class='text-center'>{$lang->workflowlinkage->status}</td>
  114. <td>{$status}</td>
  115. <td>
  116. <a href="javascript:;" class="btn addTarget"><i class="icon icon-plus"></i></a>
  117. <a href="javascript:;" class="btn delTarget"><i class="icon icon-close"></i></a>
  118. </td>
  119. </tr>
  120. EOT;
  121. js::set('th', $th);
  122. js::set('targetRow', $targetRow);
  123. js::set('sourceIndex', $sourceIndex);
  124. js::set('targetIndex', $targetIndex);
  125. ?>
  126. <?php include '../../common/view/footer.modal.html.php';?>