browse.html.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /**
  3. * The browse view file of workflowlinkage 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 workflowlinkage
  9. * @version $Id$
  10. * @link http://www.zdoo.com
  11. */
  12. ?>
  13. <?php include '../../common/view/header.modal.html.php';?>
  14. <?php js::set('action', $action->id);?>
  15. <div id='createLinkage'>
  16. <?php extCommonModel::printLink('workflowlinkage', 'create', "action={$action->id}&ui={$ui}", "<i class='icon-plus'> </i>" . $lang->workflowlinkage->create, "class='btn btn-primary loadInModal iframe'");?>
  17. </div>
  18. <div class='panel main-table'>
  19. <table class='table table-fixed' id='linkageTable'>
  20. <thead>
  21. <tr>
  22. <th><?php echo $lang->workflowlinkage->source;?></th>
  23. <th><?php echo $lang->workflowlinkage->target;?></th>
  24. <th class='w-80px text-center'><?php echo $lang->actions;?></th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <?php $linkages = zget($action->linkages, $ui, array());?>
  29. <?php foreach($linkages as $key => $linkage):?>
  30. <?php $sources = zget($linkage, 'sources', array());?>
  31. <?php $targets = zget($linkage, 'targets', array());?>
  32. <tr>
  33. <td>
  34. <?php
  35. foreach($sources as $source)
  36. {
  37. if(is_array($source)) $source = (object)$source;
  38. if(!isset($fields[$source->field])) continue;
  39. $field = $fields[$source->field];
  40. echo $field->name . zget($config->workflowlinkage->operatorList, $source->operator);
  41. if($field->control == 'multi-select' or $field->control == 'checkbox')
  42. {
  43. $values = explode(',', $source->value);
  44. foreach($values as $value) echo zget($field->options, $value) . ' ' ;
  45. }
  46. else
  47. {
  48. echo zget($field->options, $source->value);
  49. }
  50. }
  51. ?>
  52. </td>
  53. <td>
  54. <?php
  55. foreach($targets as $target)
  56. {
  57. if(is_array($target)) $target = (object)$target;
  58. if(!isset($fields[$target->field])) continue;
  59. $field = $fields[$target->field];
  60. echo $field->name . "[{$lang->workflowlinkage->statusList[$target->status]}]&nbsp;&nbsp;&nbsp;&nbsp;";
  61. }
  62. ?>
  63. </td>
  64. <td class='actions'>
  65. <?php extCommonModel::printLink('workflowlinkage', 'edit', "action=$action->id&key=$key&ui={$ui}", $lang->edit, "class='edit loadInModal iframe'");?>
  66. <?php if(common::hasPriv('workflowlinkage', 'delete')) echo html::a('###', $lang->delete, '', "class='deleterLinkage' data-href='" . inlink('delete', "action=$action->id&key=$key&ui={$ui}") . "'");?>
  67. </td>
  68. </tr>
  69. <?php endforeach;?>
  70. </tbody>
  71. </table>
  72. </div>
  73. <div class='text-center'>
  74. <?php extCommonModel::printLink('workflowlayout', 'admin', "module={$action->module}&action={$action->action}&mode=view&ui={$ui}", $lang->goback, "class='btn btn-wide loadInModal iframe'");?>
  75. </div>
  76. <script>
  77. $(document).off('click', '.deleterLinkage').on('click', '.deleterLinkage', function()
  78. {
  79. if(confirm('<?php echo $lang->confirmDelete?>'))
  80. {
  81. let $deleter = $(this);
  82. $deleter.text('<?php echo $lang->deleteing?>');
  83. $.getJSON($deleter.attr('data-href'), function(response)
  84. {
  85. if(response.result == 'success') $('#triggerModal').load(response.locate, function(){ $.zui.ajustModalPosition(); });
  86. });
  87. }
  88. });
  89. </script>
  90. <?php include '../../common/view/footer.modal.html.php';?>