page.list.issue.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. global $myUser;
  3. User::check_access('issue','read');
  4. require_once(__DIR__.SLASH.'IssueReport.class.php');
  5. require_once(__DIR__.SLASH.'IssueReportTag.class.php');
  6. $browsers = array(
  7. 'opera' => 'Opera',
  8. 'firefox' => 'Mozilla Firefox',
  9. 'chrome' => 'Google Chrome',
  10. 'safari' => 'Safari',
  11. 'ie' => 'Internet Explorer',
  12. 'edge' => 'Microsoft Edge',
  13. 'blink' => 'Blink'
  14. );
  15. $states = array();
  16. foreach(IssueReport::states() as $slug=>$state)
  17. $states[$slug] = $state['label'];
  18. $tags = IssueReportTag::tags();
  19. $defaultFilters = filters_default(array(
  20. "",
  21. array(
  22. 'state' => "open"
  23. )
  24. ));
  25. ?>
  26. <div class="row">
  27. <div class="col-xl-9 noPrint">
  28. <h3>Tickets</h3>
  29. </div>
  30. <div class="col-xl-3 noPrint">
  31. <div class="btn btn-primary right" onclick="issue_add();" title="Déclarer un nouveau bug ou faire une nouvelle demande"><i class="fas fa-plus"></i> Déclarer un ticket</div>
  32. </div>
  33. </div>
  34. <div class="row mt-2">
  35. <div class="tab-content col-xl-12">
  36. <!-- Onglet Listing des rapports -->
  37. <div class="tab-pane show active in" id="tab-reports" role="tabpanel" aria-labelledby="tab-reports">
  38. <div class="issue-reports-search mb-2">
  39. <select id="filters"
  40. data-user-shortcut="#issue-shortcuts"
  41. data-slug="issue_search"
  42. data-label="Trouver un ticket"
  43. data-type="filter"
  44. data-show-url-advanced="false"
  45. data-default='<?php echo json_encode($defaultFilters); ?>'
  46. data-function="issue_issuereport_search">
  47. <option value="{{table}}.id" data-filter-type="number">Numéro ticket</option>
  48. <option value="state" data-filter-type="list" data-values='<?php echo json_encode($states); ?>'>État</option>
  49. <option value="from" data-filter-type="text">Url</option>
  50. <option value="comment" data-filter-type="text">Commentaire</option>
  51. <option value="{{table}}.creator" data-filter-type="user">Auteur</option>
  52. <option value="assign" data-filter-type="user">Assigné</option>
  53. <option value="{{table}}.created" data-filter-type="date">Date</option>
  54. <option value="browser" data-filter-type="list" data-values='<?php echo json_encode($browsers); ?>'>Navigateur</option>
  55. <option value="ip" data-filter-type="text">Adresse IP</option>
  56. </select>
  57. <div id="issue-shortcuts" class="p-0 m-0">
  58. <ul class="pl-0 mb-0 list-unstyled">
  59. <li class="hidden d-inline-block">
  60. <div class="btn btn-small btn-link pl-0" onclick="$('#filters').data('componentObject').filter_search_execute('{{uid}}');"><i class="fas fa-search"></i> {{label}}</div>
  61. </li>
  62. </ul>
  63. </div>
  64. <div>
  65. <label class="d-inline-block font-weight-bold text-muted text-uppercase">Tags :</label>
  66. <div class="d-inline-block">
  67. <input type="text" onchange="issue_issuereport_search()" data-tags='<?php echo json_encode($tags); ?>' id="report-tags" data-type="tagcloud">
  68. </div>
  69. </div>
  70. </div>
  71. <ul id="issuereports" class="list-issue-reports" data-entity-search="issue_issuereport_search">
  72. <li data-id="{{id}}" class="hidden">
  73. <a class="issue-title" title="Voir le rapport détaillé" href="index.php?module=issue&page=sheet.report&id={{id}}">
  74. <div class="issue-state">
  75. <i class="{{state.icon}}" style="color: {{state.color}};" title="{{state.label}}"></i>
  76. </div>
  77. <div class="infos-cell text-left">
  78. <span class="font-weight-bold d-inline-block mb-1">{{{excerpt}}}</span>
  79. {{#assign}}<span class="assign"> Assigné à <i class="ml-1 far fa-meh-blank"></i> {{assign}}</span>{{/assign}}
  80. <div class="mb-1 mt-2 text-muted">
  81. <span class="pointer font-weight-bold mr-2" onclick="event.preventDefault(); $(this).parent().next('div.issue-details').slideToggle(150)" title="Afficher plus de détails">#{{id}}</span><i class="far fa-calendar"></i> {{date}} <i class="far fa-clock ml-2"></i> {{hour}} par <span class=""><i class="far fa-meh-blank"></i> {{#fullName}}{{fullName}}{{/fullName}}{{^fullName}}{{creator}}{{/fullName}}</span>
  82. <ul class="report-tag ml-2">
  83. {{#tags}}
  84. <li><span class="badge badge-tag user-select-none" style="background-color:{{color}}; border:1px solid {{color}};color:#ffffff;"><i class="{{icon}}"></i> {{label}}</span></li>
  85. {{/tags}}
  86. </ul>
  87. </div>
  88. <div class="issue-details">
  89. <span> Page : <code title="Page concernée par le ticket">{{relativefrom}}</code></span><br>
  90. <small class="text-muted mb-2 d-block">IP: {{ip}}</small>
  91. <div>
  92. <span class="mr-1"><i class="{{browserIcon}}"></i> {{browser}}</span>|
  93. <span class="ml-1 mr-1"><i class="{{osIcon}}"></i> {{os}}</span>|
  94. <span class="ml-1"><i class="fas fa-tv"></i> {{width}}px * {{height}}px</span>
  95. </div>
  96. <small class="text-muted">{{browserVersion}}</small>
  97. </div>
  98. </div>
  99. <div class="report-buttons">
  100. {{#comments}}<i title="{{comments}} Commentaire(s)" class="fas fa-comment text-muted btn-comments"></i> {{comments}}{{/comments}}
  101. {{#belongUser}}
  102. <i class="far fa-trash-alt pointer btn-delete text-danger" title="Supprimer le ticket" onclick="event.preventDefault(); issue_issuereport_delete(this);"></i>
  103. {{/belongUser}}
  104. </div>
  105. </a>
  106. </li>
  107. </ul>
  108. <!-- Pagination -->
  109. <ul class="pagination justify-content-center">
  110. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');issue_issuereport_search();">
  111. <a class="page-link" href="#">{{label}}</a>
  112. </li>
  113. </ul>
  114. </div>
  115. </div>
  116. </div>