browse.html.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. /**
  3. * The browse view file of workflowfield 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 workflowfield
  9. * @version $Id$
  10. * @link http://www.zdoo.com
  11. */
  12. ?>
  13. <?php include '../../workflow/view/header.html.php';?>
  14. <?php include $app->getModuleRoot() . 'common/view/sortable.html.php';?>
  15. <?php js::set('defaultField', $config->workflowfield->default);?>
  16. <?php js::set('maxField', $config->workflowfield->max);?>
  17. <?php js::set('minField', $config->workflowfield->min);?>
  18. <?php js::set('tips', $lang->workflowfield->tips);?>
  19. <?php js::set('placeholder', $lang->workflowfield->placeholder);?>
  20. <?php js::set('formulaLang', $lang->workflowfield->formula);?>
  21. <?php js::set('determine', $lang->determine);?>
  22. <?php js::set('expression', array());?>
  23. <?php js::set('defaultConfirmDelete', $lang->workflowfield->alert->confirmDelete);?>
  24. <?php js::set('confirmDeleteHasQuote', $lang->workflowfield->alert->confirmDeleteHasQuote);?>
  25. <?php js::set('confirmDeleteInQuote', $lang->workflowfield->alert->confirmDeleteInQuote);?>
  26. <?php js::set('quotedFields', array_values($quotedFields));?>
  27. <div class='space space-sm'></div>
  28. <div class='row'>
  29. <div class='col-md-6'>
  30. <div class='panel' id='previewArea'>
  31. <div class='panel-heading'>
  32. <strong><?php echo $flow->name;?></strong>
  33. </div>
  34. <div class='panel-body'>
  35. <table class='table table-form'>
  36. <?php foreach($fields as $field):?>
  37. <tr>
  38. <th class='w-120px'><?php echo $field->name;?> </th>
  39. <td>
  40. <?php
  41. if($field->field == 'id' or $field->field == 'parent')
  42. {
  43. echo html::input($field->field, $lang->workflowfield->placeholder->auto, "class='form-control' disabled='disabled'");
  44. }
  45. else
  46. {
  47. echo $this->loadModel('flow')->buildControl($field, '', "preview_{$field->field}", '', true, true);
  48. }
  49. ?>
  50. </td>
  51. <td class='w-150px'></td>
  52. </tr>
  53. <?php endforeach;?>
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. <div class='col-md-6'>
  59. <div class='panel'>
  60. <div class='panel-heading'>
  61. <?php if($flow->type == 'flow'):?>
  62. <strong><?php echo $lang->workflowfield->settings;?></strong>
  63. <?php else:?>
  64. <div class='btn-toolbar'>
  65. <?php echo baseHTML::a($this->createLink('workflow', 'browsedb', "parent={$flow->parent}&table={$flow->module}"), $lang->goback, "class='btn btn-back'");?>
  66. <div class='divider'></div>
  67. <div class='page-title'><span class='text'><?php echo $flow->name;?></span></div>
  68. </div>
  69. <?php endif;?>
  70. <?php if($flow->type != 'table' || $flow->role != 'quote'):?>
  71. <div class='panel-actions pull-right'>
  72. <?php if($flow->type == 'flow') extCommonModel::printLink('workflowfield', 'quote', "module={$flow->module}&groupID={$groupID}", $lang->workflowfield->quote, "class='btn btn-secondary iframe' data-width='600'");?>
  73. <?php $canImport = commonModel::hasPriv('workflowfield', 'import');?>
  74. <?php $canExportTemplate = commonModel::hasPriv('workflowfield', 'exportTemplate');?>
  75. <?php if($canImport or $canExportTemplate):?>
  76. <div class='btn-group'>
  77. <button type='button' data-toggle='dropdown' class='btn btn-secondary dropdown-toggle'><?php echo $lang->importIcon . $lang->import;?> <span class='caret'></span></button>
  78. <ul class='dropdown-menu'>
  79. <?php if($canImport) echo '<li>' . baseHTML::a(inlink('import', "module={$flow->module}&type={$flow->type}"), $lang->workflowfield->import, "data-toggle='modal'") . '</li>';?>
  80. <?php if($canExportTemplate) echo '<li>' . baseHTML::a(inlink('exportTemplate', "module={$flow->module}&type={$flow->type}"), $lang->workflowfield->exportTemplate, "class='iframe'") . '</li>';?>
  81. </ul>
  82. </div>
  83. <?php endif;?>
  84. <?php extCommonModel::printLink('workflowfield', 'create', "module=$flow->module", '<i class="icon-plus"> </i> ' . $lang->workflowfield->create, "class='btn btn-primary' data-toggle='modal'");?>
  85. </div>
  86. <?php endif;?>
  87. </div>
  88. <div class='panel-body main-table no-padding'>
  89. <table class='table'>
  90. <thead>
  91. <tr>
  92. <th class='w-50px text-center'> <?php echo $lang->sort;?></th>
  93. <th><?php echo $lang->workflowfield->name;?></th>
  94. <th class='w-100px'><?php echo $lang->workflowfield->field;?></th>
  95. <th class='w-100px'><?php echo $lang->workflowfield->control;?></th>
  96. <?php if($flow->type == 'flow'):?>
  97. <th class='w-100px'><?php echo $lang->workflowfield->group;?></th>
  98. <?php endif;?>
  99. <?php if($flow->buildin):?>
  100. <th class='w-60px text-center'><?php echo $lang->workflowfield->buildin;?></th>
  101. <?php endif;?>
  102. <th class='w-70px text-center'><?php echo $lang->actions;?></th>
  103. </tr>
  104. </thead>
  105. <tbody class='sortable' id='fieldList'>
  106. <?php foreach($fields as $field):?>
  107. <tr data-id='<?php echo $field->id;?>'>
  108. <td class='sort-handler text-center'><i class='icon icon-move text-muted'></i></td>
  109. <td title='<?php echo $field->name;?>'><?php echo $field->name;?></td>
  110. <td><?php echo $field->field;?></td>
  111. <td><?php echo zget($lang->workflowfield->controlTypeList, $field->control, '');?></td>
  112. <?php if($flow->type == 'flow'):?>
  113. <td><?php echo $field->groupName;?></td>
  114. <?php endif;?>
  115. <?php if($flow->buildin):?>
  116. <td class='text-center buildin<?php echo $field->buildin;?>'><?php echo $field->buildin ? "<i class='icon icon-check'></i>" : "<i class='icon icon-times'></i>";?></td>
  117. <?php endif;?>
  118. <td class='actions'>
  119. <?php
  120. $disabled = '';
  121. if($flow->role == 'quote') $disabled = 'disabled';
  122. if($field->buildin) $disabled = 'disabled';
  123. extCommonModel::printLink('workflowfield', 'edit', "module=$field->module&id=$field->id", "<i class='icon icon-edit'></i>", "class='edit btn {$disabled}' data-toggle='modal' title='{$lang->workflowfield->edit}'");
  124. if(empty($disabled) && in_array($field->role, array('quote', 'custom')) && $field->buildin == '0')
  125. {
  126. $deleteTitle = $field->role == 'quote' ? $lang->workflowfield->remove : $lang->workflowfield->delete;
  127. $deleteIcon = $field->role == 'quote' ? 'icon-unlink' : 'icon-trash';
  128. extCommonModel::printLink('workflowfield', 'delete', "id=$field->id", "<i class='icon {$deleteIcon}'></i>", "class='deleteField btn' data-field='{$field->field}' data-role='{$field->role}' title='{$deleteTitle}'");
  129. }
  130. else
  131. {
  132. echo baseHTML::a('javascript:;', "<i class='icon icon-trash'></i>", "class='disabled btn' title='{$lang->workflowfield->delete}'");
  133. }
  134. ?>
  135. </td>
  136. </tr>
  137. <?php endforeach;?>
  138. </tbody>
  139. </table>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>