browse.html.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?php
  2. /**
  3. * The browse view file of flow 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 flow
  9. * @version $Id$
  10. * @link http://www.zdoo.com
  11. */
  12. ?>
  13. <?php include 'header.html.php';?>
  14. <?php js::set('mode', $mode);?>
  15. <?php js::set('moduleName', $flow->module);?>
  16. <?php js::set('label', $label);?>
  17. <?php js::set('category', zget($currentCategory, 'type', '') . $categoryValue);?>
  18. <?php /* Search settings. */ ?>
  19. <?php if(commonModel::hasPriv($flow->module, 'search')):?>
  20. <?php if(empty($this->config->{$flow->module}->search['fields'])):?>
  21. <li id='searchTab'><?php echo baseHTML::a('#emptySearchModal', "<i class='icon-search icon'></i>" . $lang->search->common, "data-toggle='modal'");?></li>
  22. <div class='modal fade' id='emptySearchModal'>
  23. <div class='modal-dialog'>
  24. <div class='modal-content'>
  25. <div class='modal-header'>
  26. <button type='button' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span></button>
  27. <h4 class='modal-title'>
  28. <span class='modal-title-name'><?php echo $lang->search->common;?></span>
  29. </h4>
  30. </div>
  31. <div class='modal-body'>
  32. <?php
  33. if(commonModel::hasPriv('flow.workflowfield', 'setSearch'))
  34. {
  35. $designLink = baseHTML::a($this->createLink('workflowfield', 'setSearch', "module={$flow->module}"), $lang->flow->setSearch, "target='_parent'");
  36. }
  37. else
  38. {
  39. $designLink = $lang->flow->setSearch;
  40. }
  41. echo "<div class='alert'>" . sprintf($lang->flow->tips->emptySearchFields, $designLink) . '</div>';
  42. ?>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <?php else:?>
  48. <li id='bysearchTab'><?php echo baseHTML::a('javascript:;', "<i class='icon-search icon'></i>" . $lang->search->common);?></li>
  49. <?php endif;?>
  50. <?php endif;?>
  51. <?php echo $menuActions;?>
  52. <?php /* Tree Menu */ ?>
  53. <?php if($categories):?>
  54. <div class='main-row'>
  55. <div class='side-col'>
  56. <div class='main-col panel'>
  57. <div class='main-col panel-heading'>
  58. <ul class='nav nav-default'>
  59. <li>
  60. <a href='javascript:;' class='dropdown-toggle currentMenu' data-toggle='dropdown'>
  61. <?php echo $currentCategory->name;?>
  62. <?php if(count($categories) > 1):?>
  63. <span class='caret'></span>
  64. <?php endif;?>
  65. </a>
  66. <?php if(count($categories) > 1):?>
  67. <ul class='dropdown-menu'>
  68. <?php foreach($categories as $type => $category):?>
  69. <li><a href='javascript:;' data-type='<?php echo $type;?>' class='toggleTreeMenu'><?php echo $category->name;?></a></li>
  70. <?php endforeach;?>
  71. </ul>
  72. <?php endif;?>
  73. </li>
  74. </ul>
  75. </div>
  76. <div class='main-col panel-body'>
  77. <?php foreach($categories as $type => $category):?>
  78. <div id='<?php echo $type;?>Box' class='treeMenuBox <?php if($type != $currentCategory->type) echo 'hide';?>'>
  79. <?php echo $category->treeMenu;?>
  80. <?php extCommonModel::printLink('tree', 'browse', "rootID=0&type=$type&currentModuleID=0&branch=&from=$flow->module", sprintf($lang->flow->category->manage, $category->name), "class='btn btn-primary'");?>
  81. </div>
  82. <?php endforeach;?>
  83. </div>
  84. </div>
  85. </div>
  86. <div class='main-col'>
  87. <?php endif;?>
  88. <div class='main-col' data-ride='table'>
  89. <?php if($batchActions && $dataList):?>
  90. <form id='batchOperateForm' method='post'>
  91. <?php endif;?>
  92. <div class="table-responsive">
  93. <div class='main-table'>
  94. <table class='table has-sort-head' id="<?php echo $flow->module;?>Table">
  95. <thead>
  96. <tr class='text-center'>
  97. <?php $vars = "mode=$mode&label=$label&category=$categoryQuery&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
  98. <?php $index = 1;?>
  99. <?php foreach($fields as $field):?>
  100. <?php if(!$field->show) continue;?>
  101. <?php $width = ($field->width && $field->width != 'auto' ? $field->width . 'px' : 'auto');?>
  102. <th class="text-<?php echo $field->position;?>" style="width:<?php echo $width;?>">
  103. <?php if($index == 1 && $batchActions && $dataList):?>
  104. <div class='checkbox-primary check-all' title='<?php echo $this->lang->selectAll;?>'><label></label></div>
  105. <?php endif;?>
  106. <?php
  107. if($field->field == 'desc' || $field->field == 'asc' || $field->field == 'actions')
  108. {
  109. echo $field->name;
  110. }
  111. else
  112. {
  113. commonModel::printOrderLink($field->field, $orderBy, $vars, $field->name, $flow->module, 'browse');
  114. }
  115. ?>
  116. </th>
  117. <?php $index++;?>
  118. <?php endforeach;?>
  119. </tr>
  120. </thead>
  121. <tbody>
  122. <?php foreach($dataList as $data):?>
  123. <tr>
  124. <?php $index = 1;?>
  125. <?php foreach($fields as $field):?>
  126. <?php if(!$field->show || $field->field == 'actions') continue;?>
  127. <?php
  128. $output = '';
  129. if(is_array($data->{$field->field}))
  130. {
  131. foreach($data->{$field->field} as $value) $output .= zget($field->options, $value) . ' ';
  132. }
  133. else
  134. {
  135. if($field->field == 'id')
  136. {
  137. if(commonModel::hasPriv($flow->module, 'view'))
  138. {
  139. $output = baseHTML::a(helper::createLink($flow->module, 'view', "dataID={$data->id}"), $data->id);
  140. }
  141. else
  142. {
  143. $output = $data->id;
  144. }
  145. }
  146. else
  147. {
  148. $output = zget($field->options, $data->{$field->field});
  149. }
  150. if($field->control == 'datetime') $output = formatTime($output, 'Y-m-d H:i');
  151. }
  152. ?>
  153. <td class="text-<?php echo $field->position;?>" title='<?php echo strip_tags(str_replace("</p>", "\n", str_replace(array("\n", "\r"), "", $output)));?>'>
  154. <?php if($index == 1 && $batchActions):?>
  155. <div class='checkbox-primary'><input type='checkbox' name='dataIDList[]' value='<?php echo $data->id;?>' id='dataIDList<?php echo $data->id;?>'>
  156. <label for='dataIDList<?php echo $data->id;?>'></label>
  157. </div>
  158. <?php endif;?>
  159. <?php echo $output;?>
  160. </td>
  161. <?php $index++;?>
  162. <?php endforeach;?>
  163. <td class="actions nowrap"><?php echo $this->flow->buildOperateMenu($flow, $data, 'browse');?></td>
  164. </tr>
  165. <?php endforeach;?>
  166. </tbody>
  167. </table>
  168. </div>
  169. </div>
  170. <div class='table-footer'>
  171. <?php if($batchActions && $dataList):?>
  172. <div class='checkbox-primary check-all'><label><?php echo $lang->selectAll?></label></div>
  173. <div class='table-actions btn-toolbar'>
  174. <?php echo $batchActions;?>
  175. </div>
  176. <?php endif;?>
  177. <?php if($summary):?>
  178. <div class='table-statistic'>
  179. <?php echo $lang->workflowlayout->summary . '(' . $summary . ')';?>
  180. </div>
  181. <?php endif;?>
  182. <?php $pager->show('right', 'pagerjs');?>
  183. </div>
  184. <?php if($batchActions && $dataList):?>
  185. </form>
  186. <?php endif;?>
  187. </div>
  188. <?php if($categories):?>
  189. </div>
  190. </div>
  191. <?php endif;?>
  192. <script>
  193. <?php helper::import('../js/search.js');?>
  194. </script>
  195. <?php include 'footer.html.php';?>