browse.html.php 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * The browse of assetlib module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2021 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Shujie Tian <tianshujie@easycorp.ltd>
  8. * @package assetlib
  9. * @version $Id: browse.html.php 4903 2021-07-02 09:37:59Z $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . "common/view/header.html.php"?>
  14. <?php if($canSort) include $app->getModuleRoot() . "common/view/sortable.html.php"?>
  15. <?php js::set('objectType', $objectType);?>
  16. <?php js::set('browseLink', $browseLink);?>
  17. <?php $label = "{$objectType}NoFeature";?>
  18. <?php $class = helper::hasFeature($objectType) ? '' : 'disabled';?>
  19. <?php $extra = helper::hasFeature($objectType) ? '' : "data-toggle='tooltip' data-placement='bottom' title='{$lang->assetlib->$label}'";?>
  20. <div id="mainMenu" class="clearfix">
  21. <div class="btn-toobar pull-left">
  22. <?php foreach($lang->assetlib->featureBar[$app->rawMethod] as $featureType => $label):?>
  23. <?php $label = "<span class='text'>$label</span>";?>
  24. <?php echo html::a(inlink($app->rawMethod), $label, '', "class='btn btn-link btn-active-text'");?>
  25. <?php endforeach;?>
  26. </div>
  27. <div class="btn-toolbar pull-right">
  28. <?php common::printLink('assetlib', $createMethod, '', "<i class='icon icon-plus'></i>" . $lang->assetlib->{$createMethod}, '', "class='btn btn-primary $class' $extra");?>
  29. </div>
  30. </div>
  31. <div id="mainContent" class="main-table">
  32. <?php if(empty($libs)):?>
  33. <div class="table-empty-tip">
  34. <p>
  35. <span class="text-muted"><?php echo $lang->noData;?></span>
  36. <?php if(common::hasPriv('assetlib', $createMethod)):?>
  37. <?php echo html::a($this->createLink('assetlib', $createMethod), "<i class='icon icon-plus'></i> " . $lang->assetlib->{$createMethod}, '', "class='btn btn-info $class' $extra");?>
  38. <?php endif;?>
  39. </p>
  40. </div>
  41. <?php else:?>
  42. <table class="table has-sort-head" id='libList'>
  43. <?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
  44. <thead>
  45. <tr>
  46. <th class='text-left c-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->assetlib->id);?></th>
  47. <th class='c-order' data-flex='false' title='<?php echo $this->lang->assetlib->sort?>'><?php echo $this->lang->assetlib->sort?></th>
  48. <th><?php common::printOrderLink('name', $orderBy, $vars, $lang->assetlib->name);?></th>
  49. <th class='c-desc'><?php echo $lang->assetlib->desc;?></th>
  50. <th class='c-createdBy'><?php common::printOrderLink('createdBy', $orderBy, $vars, $lang->assetlib->createdBy);?></th>
  51. <th class='c-actions-1 w-80px text-center'><?php echo $lang->actions?></th>
  52. </tr>
  53. </thead>
  54. <tbody class='sortable'>
  55. <?php $this->loadModel('file');?>
  56. <?php foreach($libs as $lib):?>
  57. <?php $lib = $this->file->replaceImgURL($lib, 'desc');?>
  58. <tr data-id='<?php echo $lib->id;?>'>
  59. <td><?php echo sprintf('%03d',$lib->id);?></td>
  60. <td class='sort-handler c-sort' title='' style=''><i class='icon-move'></td>
  61. <td class='c-name'><?php echo html::a($this->createLink('assetlib', $objectType, "libID=$lib->id"), $lib->name);?></td>
  62. <td class='text-left content'>
  63. <?php $desc = trim(strip_tags(str_replace(array('</p>', '<br />', '<br>', '<br/>'), "\n", str_replace(array("\n ", "\r"), '', $lib->desc)), '<img>'));?>
  64. <div title='<?php echo $desc;?>'><?php echo nl2br($desc);?></div>
  65. </td>
  66. <td class='c-openedBy' title='<?php echo zget($users, $lib->createdBy);?>'><?php echo zget($users, $lib->createdBy);?></td>
  67. <td class='c-actions text-center'>
  68. <?php common::printIcon('assetlib', $editMethod, "id=$lib->id", $lib, 'list', 'edit');?>
  69. </td>
  70. </tr>
  71. <?php endforeach;?>
  72. </tbody>
  73. </table>
  74. <div class='table-footer'>
  75. <?php $pager->show('right', 'pagerjs');?>
  76. </div>
  77. <?php endif;?>
  78. </div>
  79. <?php include $app->getModuleRoot() . "common/view/footer.html.php"?>