editui.html.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. /**
  3. * The addUI view file of workflowlayout module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
  6. * @license 商业软件,非开源软件
  7. * @author Yidong Wang <yidong@chandao.com>
  8. * @package workflowlayout
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include '../../common/view/header.modal.html.php';?>
  14. <?php include '../../common/view/picker.html.php';?>
  15. <?php js::set('moduleName', $ui->module);?>
  16. <form id='ajaxForm' target='hiddenwin' method='post' action='<?php echo inlink('editUI', "ui={$ui->id}");?>'>
  17. <table class='table table-form' id='conditionTable'>
  18. <tr>
  19. <td class='w-80px'></td>
  20. <td class='w-220px'></td>
  21. <td class='w-80px'></td>
  22. <td></td>
  23. <td class='w-120px'></td>
  24. </tr>
  25. <tr>
  26. <th><?php echo $lang->workflowlayout->ui->name;?></th>
  27. <td colspan='3'><?php echo html::input('name', $ui->name, "class='form-control'");?></td>
  28. </tr>
  29. <?php $this->loadModel('workflowfield');?>
  30. <?php $operatorList = $lang->workflowcondition->operatorList;?>
  31. <?php foreach($ui->conditions as $key => $condition):?>
  32. <tr class='dataTR' data-key='<?php echo $key;?>'>
  33. <th class='text-right'><?php if($key == 0) echo $lang->workflowlayout->ui->condition;?></th>
  34. <td><?php echo html::select("field[$key]", $fields, $condition->field, "class='form-control chosen'");?></td>
  35. <td><?php echo html::select("operator[$key]", $lang->workflowcondition->operatorList, $condition->operator, "class='form-control'");?></td>
  36. <td id='paramTD'>
  37. <?php $condition->param = is_array($condition->param) ? (implode(',', $condition->param)) : $condition->param;?>
  38. <?php $value = helper::safe64Encode(urlencode($condition->param));?>
  39. <?php $elementName = helper::safe64Encode(urlencode("param[$key]"));?>
  40. <?php echo $this->workflowfield->getFieldControl($ui->module, $condition->field, $value, $elementName);?>
  41. </td>
  42. <td class='text-middle'>
  43. <?php echo baseHTML::a('javascript:;', "<i class='icon-plus icon-large'></i>", "class='btn addCondition'");?>
  44. <?php if($key > 0) echo baseHTML::a('javascript:;', "<i class='icon-close icon-large'></i>", "class='btn delCondition'");?>
  45. </td>
  46. </tr>
  47. <?php endforeach;?>
  48. <?php if($others):?>
  49. <tr><th class='text-left' colspan='4'><?php echo $lang->workflowlayout->ui->other;?></th></tr>
  50. <?php $preUI = 0;?>
  51. <?php foreach($others as $uiID => $uiConditions):?>
  52. <?php foreach($uiConditions as $fieldConditions):?>
  53. <?php foreach($fieldConditions as $condition):?>
  54. <tr>
  55. <th class='text-right'><?php echo $uiID != $preUI ? $uiList[$uiID]->name : ''; $preUI = $uiID;?></th>
  56. <td><?php echo html::select("otherfield", $fields, $condition->field, "class='form-control chosen' disabled");?></td>
  57. <td><?php echo html::select("otheroperator", $operatorList, $condition->operator, "class='form-control' disabled");?></td>
  58. <td id='paramTD'>
  59. <?php $value = helper::safe64Encode(urlencode($condition->param));?>
  60. <?php $elementName = helper::safe64Encode(urlencode("param"));?>
  61. <?php echo $this->workflowfield->getFieldControl($module, $condition->field, $value, $elementName, '', 'disabled');?>
  62. </td>
  63. <td class='text-middle'></td>
  64. </tr>
  65. <?php endforeach;?>
  66. <?php endforeach;?>
  67. <?php endforeach;?>
  68. <?php endif;?>
  69. <tr>
  70. <td class='form-actions text-center' colspan='5'>
  71. <?php
  72. echo html::submitButton();
  73. echo html::a(inlink('admin', "module={$ui->module}&action={$ui->action}&mode=view&ui={$ui->id}"), $lang->cancel, '', "class='btn btn-wide loadInModal iframe'");
  74. ?>
  75. </td>
  76. </tr>
  77. </table>
  78. </form>
  79. <?php
  80. $field = html::select("field[KEY]", $fields, '', "class='form-control chosen'");
  81. $operator = html::select("operator[KEY]", $lang->workflowcondition->operatorList, '', "class='form-control'");
  82. $itemRow = <<<EOT
  83. <tr class='dataTR' data-key='KEY'>
  84. <th></th>
  85. <td>{$field}</td>
  86. <td>{$operator}</td>
  87. <td id='paramTD'><input type="text" value= "" name="param[KEY]" id="paramKEY" class="form-control" autocomplete="off"></td>
  88. <td class='text-middle'>
  89. <a href="javascript:;" class="btn addCondition"><i class="icon-plus icon-large"></i></a>
  90. <a href="javascript:;" class="btn delCondition"><i class="icon-close icon-large"></i></a>
  91. </td>
  92. </tr>
  93. EOT;
  94. js::set('conditionKey', $key + 1);
  95. js::set('itemRow', $itemRow);
  96. ?>
  97. <script>
  98. <?php echo file_get_contents(dirname(__FILE__, 2) . '/js/uicommon.js');?>
  99. </script>
  100. <?php include '../../common/view/footer.modal.html.php';?>