admin.html.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. /**
  3. * The admin view file of workflowrelation module of ZDOO.
  4. *
  5. * @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Gang Liu <liugang@cnezsoft.com>
  8. * @package workflowrelation
  9. * @version $Id$
  10. * @link http://www.zdoo.com
  11. */
  12. ?>
  13. <?php include '../../workflow/view/header.html.php';?>
  14. <?php if($flow->buildin):?>
  15. <?php unset($lang->workflowrelation->relationActionList['many2one']);?>
  16. <?php unset($lang->workflowrelation->relationActionList['many2many']);?>
  17. <?php endif;?>
  18. <div class='space space-sm'></div>
  19. <div class='main-row'>
  20. <div class='side-col'>
  21. <?php include '../../workflow/view/side.html.php';?>
  22. </div>
  23. <div class='main-col'>
  24. <div class='panel'>
  25. <div class='panel-heading'>
  26. <strong><?php echo $lang->workflowrelation->admin;?></strong>
  27. </div>
  28. <div class='panel-body'>
  29. <form id='ajaxForm' method='post' action='<?php echo inlink('admin', "prev=$prev&next=$next");?>'>
  30. <table class='table table-form' id='relationTable' style="width:<?php echo $lang->workflowrelation->tableWidth;?>px">
  31. <thead>
  32. <tr class='text-center'>
  33. <th class='w-140px required'><?php echo $lang->workflowrelation->next;?></th>
  34. <th class='w-200px required'><?php echo $lang->workflowrelation->foreignKey;?></th>
  35. <th><?php echo $lang->workflowrelation->action;?></th>
  36. <th class='w-100px text-left'><?php echo $lang->actions;?></th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. <?php $index = 1;?>
  41. <?php if($relations):?>
  42. <?php foreach($relations as $relation):?>
  43. <?php if($relation->buildin):?>
  44. <tr data-key='<?php echo $index;?>'>
  45. <td class='text-center'><?php echo zget($flows, $relation->next) . html::hidden("next[$index]", $relation->next);?></td>
  46. <td class='text-center'>
  47. <div class='input-group'>
  48. <?php echo html::hidden("field[$index]", 'id');?>
  49. <?php echo html::hidden("newField[$index]", '');?>
  50. </div>
  51. </td>
  52. <td class='text-center'>
  53. <?php echo zget($lang->workflowrelation->relationActionList, $relation->actions) . "<div class='hidden'>" . html::checkbox("action[$index]", $lang->workflowrelation->relationActionList, $relation->actions, '', 'block') . "</div>";?>
  54. </td>
  55. <td>
  56. <a href='javascript:;' class='btn addRelation'><i class='icon icon-plus'></i></a>
  57. <a href='javascript:;' class='btn delRelation hidden'><i class='icon icon-close'></i></a>
  58. <?php echo html::hidden("buildin[$index]", $relation->buildin);?>
  59. </td>
  60. </tr>
  61. <?php else:?>
  62. <tr data-key='<?php echo $index;?>'>
  63. <td><?php echo html::select("next[$index]", $flows, $relation->next, "class='form-control chosen'");?></td>
  64. <td>
  65. <div class='input-group'>
  66. <?php echo html::select("field[$index]", array($relation->field => $relation->field), $relation->field, "class='form-control chosen'");?>
  67. <?php echo html::input("newField[$index]", '', "id='newField{$index}' class='form-control' placeholder='{$lang->workflowfield->placeholder->code}' style='display: none'");?>
  68. <span class='input-group-addon'>
  69. <div class='checkbox-primary'>
  70. <input type='checkbox' value='1' name='createField[<?php echo $index;?>]' id='createField<?php echo $index;?>'>
  71. <label for='createField<?php echo $index;?>'><?php echo $lang->workflowrelation->createForeignKey;?></label>
  72. </div>
  73. </span>
  74. </div>
  75. </td>
  76. <td><?php echo html::checkbox("action[$index]", $lang->workflowrelation->relationActionList, $relation->actions, '', 'block');?></td>
  77. <td>
  78. <a href='javascript:;' class='btn addRelation'><i class='icon icon-plus'></i></a>
  79. <a href='javascript:;' class='btn delRelation'><i class='icon icon-close'></i></a>
  80. <?php echo html::hidden("buildin[$index]", $relation->buildin);?>
  81. </td>
  82. </tr>
  83. <?php endif;?>
  84. <?php $index++;?>
  85. <?php endforeach;?>
  86. <?php else:?>
  87. <tr data-key='<?php echo $index;?>'>
  88. <td><?php echo html::select("next[$index]", $flows, $next, "class='form-control chosen'");?></td>
  89. <td>
  90. <div class='input-group'>
  91. <?php echo html::select("field[$index]", array('' => ''), '', "class='form-control chosen'");?>
  92. <?php echo html::input("newField[$index]", '', "id='newField{$index}' class='form-control' placeholder='{$lang->workflowfield->placeholder->code}' style='display: none'");?>
  93. <span class='input-group-addon'>
  94. <div class='checkbox-primary'>
  95. <input type='checkbox' value='1' name='createField[<?php echo $index;?>]' id='createField<?php echo $index;?>'>
  96. <label for='createField<?php echo $index;?>'><?php echo $lang->workflowrelation->createForeignKey;?></label>
  97. </div>
  98. </span>
  99. </div>
  100. </td>
  101. <td><?php echo html::checkbox("action[$index]", $lang->workflowrelation->relationActionList, '', '', 'block');?></td>
  102. <td>
  103. <a href='javascript:;' class='btn addRelation'><i class='icon icon-plus'></i></a>
  104. <a href='javascript:;' class='btn delRelation'><i class='icon icon-close'></i></a>
  105. <?php echo html::hidden("buildin[$index]", '0');?>
  106. </td>
  107. </tr>
  108. <?php $index++;?>
  109. <?php endif;?>
  110. <tr>
  111. <td class='text-important' colspan='4'><?php echo $lang->workflowrelation->tips->foreignKey;?></td>
  112. </tr>
  113. <tr>
  114. <td class='form-actions' colspan='4'><?php echo html::submitButton();?></td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </form>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <?php
  124. echo html::select('relationTemplateNext', $flows, '', "class='form-control hidden'");
  125. $next = html::select('next[KEY]', array('' => ''), '', "class='form-control'");
  126. $field = html::select('field[KEY]', array('' => ''), '', "class='form-control'");
  127. $newField = html::input('newField[KEY]', '', "id='newFieldKEY' class='form-control' placeholder='{$lang->workflowfield->placeholder->code}' style='display: none;'");
  128. $action = html::checkbox('action[KEY]', $lang->workflowrelation->relationActionList, '', '', 'block');
  129. $buildin = html::hidden('buildin[KEY]', '0');
  130. $itemRow = <<<EOT
  131. <tr data-key='KEY'>
  132. <td>{$next}</td>
  133. <td>
  134. <div class='input-group'>
  135. {$field}
  136. {$newField}
  137. <span class='input-group-addon'>
  138. <div class='checkbox-primary'>
  139. <input type='checkbox' value='1' name='createField[KEY]' id='createFieldKEY'>
  140. <label for='createFieldKEY'>{$lang->workflowrelation->createForeignKey}</label>
  141. </div>
  142. </span>
  143. </div>
  144. </td>
  145. <td>{$action}</td>
  146. <td>
  147. <a href='javascript:;' class='btn addRelation'><i class='icon icon-plus'></i></a>
  148. <a href='javascript:;' class='btn delRelation'><i class='icon icon-close'></i></a>
  149. {$buildin}
  150. </td>
  151. </tr>
  152. EOT;
  153. ?>
  154. <?php js::set('key', $index);?>
  155. <?php js::set('itemRow', $itemRow);?>
  156. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>