PageRenderTime 33ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Template/project_overview/show.php

https://gitlab.com/Busfreak/Tabler
PHP | 454 lines | 267 code | 72 blank | 115 comment | 27 complexity | 8f279837175fa9fdeda943a45e835f6f MD5 | raw file
  1. <?= $this->asset->css('plugins/Tabler/assets/css/theme.blue.css') ?>
  2. <?= $this->asset->css('plugins/Tabler/assets/css/theme.bootstrap.css') ?>
  3. <?= $this->asset->css('plugins/Tabler/assets/css/tablesort.columnSelector.css') ?>
  4. <?= $this->asset->js('plugins/Tabler/assets/js/jquery.tablesorter.js') ?>
  5. <?= $this->asset->js('plugins/Tabler/assets/js/jquery.tablesorter.widgets.js') ?>
  6. <?= $this->asset->js('plugins/Tabler/assets/js/jquery.tablesorter.pager.js') ?>
  7. <?= $this->asset->js('plugins/Tabler/assets/js/jquery.tablesorter.widget-columnSelector.js') ?>
  8. <?= $this->asset->js('plugins/Tabler/assets/js/jquery.tablesorter.widget-reflow.js') ?>
  9. <?= $this->asset->css('plugins/Tabler/assets/css/pgwmodal.min.css') ?>
  10. <?= $this->asset->js('plugins/Tabler/assets/js/pgwmodal.min.js') ?>
  11. <style>
  12. .tablesorter-blue {
  13. margin: 0px 10px
  14. }
  15. .tablesorter-blue th
  16. {
  17. background: #f7f7f7;
  18. text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  19. }
  20. .tablesorter-blue .tablesorter-header {
  21. padding: 10px 8px;
  22. }
  23. .tablesorter-blue input.tablesorter-filter {
  24. padding: 1px;
  25. }
  26. .subtask {
  27. font-size: 12px;
  28. }
  29. .tablesorter-hasChildRow {
  30. font-size: 13px;
  31. }
  32. .tablesorter-blue tbody tr.odd > td childTaskExpanded {
  33. background: #f7f7f7;
  34. }
  35. .tablesorter-blue tbody tr.odd > td {
  36. // background-color: #ffffff;
  37. }
  38. .tablesorter-blue tbody > tr.odd.hover > td, .tablesorter-blue tbody > tr.odd:hover > td, .tablesorter-blue tbody > tr.odd:hover + tr.tablesorter-childRow > td, .tablesorter-blue tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td {
  39. background-color: #bbbbbb;
  40. }
  41. .tablesorter-sticky-visible {
  42. margin-left: 10px;
  43. }
  44. .project-header {
  45. margin-bottom: 0px;
  46. }
  47. .pagedisplay {
  48. margin-left: 20px;
  49. }
  50. .dropdown-submenu-open li:hover:not(.no-hover),
  51. .textarea-dropdown .active,
  52. .textarea-dropdown li:hover {
  53. background: #36c
  54. }
  55. ul.dropdown-submenu-open {
  56. border-radius: 0
  57. }
  58. .columnSelectorButton {
  59. width: 100px;
  60. font-weight: 600;
  61. text-align: center;
  62. margin-left: 20px;
  63. }
  64. #columnSelector {
  65. position: absolute;
  66. z-index: 1000;
  67. }
  68. #pager {
  69. margin-left: 20px;
  70. }
  71. th.tablesorter-header.resizable-false {
  72. background-color: #e6bf99;
  73. }
  74. /* ensure box-sizing is set to content-box, if using jQuery versions older than 1.8;
  75. this page is using jQuery 1.4 */
  76. *, *:before, *:after {
  77. -moz-box-sizing: content-box;
  78. -webkit-box-sizing: content-box;
  79. box-sizing: content-box;
  80. }
  81. /* overflow table */
  82. .wrapper {
  83. overflow-x: auto;
  84. overflow-y: hidden;
  85. width: 450px;
  86. }
  87. .wrapper table {
  88. width: auto;
  89. table-layout: fixed;
  90. }
  91. .wrapper .tablesorter td {
  92. overflow: hidden;
  93. text-overflow: ellipsis;
  94. white-space: nowrap;
  95. min-width: 10px;
  96. }
  97. .wrapper .tablesorter th {
  98. overflow: hidden;
  99. text-overflow: ellipsis;
  100. min-width: 10px;
  101. }
  102. .tablesorter, .tablesorter .tablesorter-filter {
  103. width: auto;
  104. }
  105. </style>
  106. <script id="js">
  107. $(function() {
  108. $(".tablesorter").tablesorter({
  109. theme: 'blue',
  110. widgets: ['zebra', 'reflow', 'resizable', 'columnSelector', 'stickyHeaders', 'filter', 'pager'],
  111. widgetOptions : {
  112. // target the column selector markup
  113. columnSelector_container : $('#columnSelector'),
  114. // column status, true = display, false = hide
  115. // disable = do not display on list
  116. columnSelector_columns : {
  117. 0: 'disable' /* set to disabled; not allowed to unselect it */
  118. },
  119. // remember selected columns (requires $.tablesorter.storage)
  120. columnSelector_saveColumns: true,
  121. // container layout
  122. columnSelector_layout : '<label><input type="checkbox">{name}</label>',
  123. // data attribute containing column name to use in the selector container
  124. columnSelector_name : 'data-name',
  125. /* Responsive Media Query settings */
  126. // enable/disable mediaquery breakpoints
  127. columnSelector_mediaquery: true,
  128. // toggle checkbox name
  129. columnSelector_mediaqueryName: 'Auto: ',
  130. // breakpoints checkbox initial setting
  131. columnSelector_mediaqueryState: true,
  132. // hide columnSelector false columns while in auto mode
  133. columnSelector_mediaqueryHidden: true,
  134. // responsive table hides columns with priority 1-6 at these breakpoints
  135. // see http://view.jquerymobile.com/1.3.2/dist/demos/widgets/table-column-toggle/#Applyingapresetbreakpoint
  136. // *** set to false to disable ***
  137. columnSelector_breakpoints : [ '20em', '30em', '40em', '50em', '60em', '70em' ],
  138. // data attribute containing column priority
  139. // duplicates how jQuery mobile uses priorities:
  140. // http://view.jquerymobile.com/1.3.2/dist/demos/widgets/table-column-toggle/
  141. columnSelector_priority : 'data-priority',
  142. // class name added to checked checkboxes - this fixes an issue with Chrome not updating FontAwesome
  143. // applied icons; use this class name (input.checked) instead of input:checked
  144. columnSelector_cssChecked : 'checked',
  145. reflow_headerAttrib : 'data-name',
  146. resizable: true,
  147. // These are the default column widths which are used when the table is
  148. // initialized or resizing is reset; note that the "Age" column is not
  149. // resizable, but the width can still be set to 40px here
  150. //resizable_widths : [ '10%', '10%', '40px', '10%', '100px' ]
  151. resizable_widths : [ '26px', '100px', '25%', '60px', '100px', '80px', '100px', '80px', '48px', '120px', '120px', '120px', '80px' ]
  152. }
  153. });
  154. // hide child rows
  155. //$('.tablesorter-childRow td').hide();
  156. $('.tablesorter-childRow td').addClass( 'hidden' );
  157. $(".tablesorter").tablesorter({
  158. theme : 'blue',
  159. // this is the default setting
  160. cssChildRow: "tablesorter-childRow"
  161. })
  162. .tablesorterPager({
  163. container: $("#pager"),
  164. positionFixed: false
  165. });
  166. /* // hide child rows after pager update
  167. $('.tablesorter-childRow td').hide();
  168. });
  169. */
  170. // Toggle child row content (td), not hiding the row since we are using rowspan
  171. // Using delegate because the pager plugin rebuilds the table after each page change
  172. // "delegate" works in jQuery 1.4.2+; use "live" back to v1.3; for older jQuery - SOL
  173. $('.tablesorter').delegate('.toggle', 'click' ,function(){
  174. $( this )
  175. .closest( 'tr' )
  176. .toggleClass( 'childTaskExpanded')
  177. .nextUntil( 'tr.tablesorter-hasChildRow' )
  178. .toggleClass( 'childTaskExpanded')
  179. .find( 'td' )
  180. .toggleClass( 'hidden' );
  181. // use "nextUntil" to toggle multiple child rows
  182. // toggle table cells instead of the row
  183. // $(this).closest('tr').nextUntil('tr:not(.tablesorter-childRow)').find('td').toggle();
  184. // in v2.5.12, the parent row now has the class tablesorter-hasChildRow
  185. // so you can use this code as well
  186. // $(this).closest('tr').nextUntil('tr.tablesorter-hasChildRow').find('td').toggle();
  187. return false;
  188. });
  189. $(".tablesorter").tablesorter({ sortList: [[0,0], [1,0]] });
  190. });
  191. </script>
  192. <?php //print_r(array_values($TablerData));?>
  193. <!-- This selector markup is completely customizable -->
  194. <div class="columnSelectorWrapper">
  195. <input id="colSelect1" type="checkbox" class="hidden">
  196. <label class="columnSelectorButton" for="colSelect1">Column</label>
  197. <div id="columnSelector" class="columnSelector">
  198. <!-- this div is where the column selector is added -->
  199. </div>
  200. </div>
  201. <table id="" class="tablesorter custom-popup">
  202. <! <colgroup>
  203. <! <col width="85" />
  204. <! <col width="100" />
  205. <! <col width="250" />
  206. <! <col width="90" />
  207. <! <col width="80" />
  208. <! <col width="80" />
  209. <! </colgroup>
  210. <thead>
  211. <tr>
  212. <th data-priority="critical">ID</th>
  213. <th data-priority="1">Project</th>
  214. <th data-priority="critical">Task</th>
  215. <th data-priority="3">Status</th>
  216. <th data-priority="4">Column</th>
  217. <th data-priority="5">Swimlane</th>
  218. <th data-priority="5">Category</th>
  219. <th data-priority="5">Priority</th>
  220. <th data-priority="6">Start date</th>
  221. <th data-priority="6">Due date</th>
  222. <th data-priority="6">Date modified</th>
  223. <th data-priority="6" class="columnSelector-false">Date moved</th>
  224. <th data-priority="6" class="columnSelector-false">Date created</th>
  225. <th data-priority="6">Owner</th>
  226. <th data-priority="6" class="columnSelector-false">Score</th>
  227. <th data-priority="6" class="columnSelector-false">Time spent</th>
  228. <th data-priority="6" class="columnSelector-false">Time estimated</th>
  229. </tr>
  230. </thead>
  231. <tbody>
  232. <?php
  233. $task = array();
  234. foreach($TablerData as $task){
  235. print '<tr><td class="task-table color-' . $task['color_id'] . '" rowspan="2">';
  236. //print '<tr><td class="task-table" rowspan="2">';
  237. ?>
  238. <?php if ($this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?>
  239. <?= $this->render('task/dropdown', array('task' => $task)) ?>
  240. <?php else: ?>
  241. #<?= $task['id'] ?>
  242. <?php endif ?>
  243. <?php
  244. print '</td>';
  245. print '<td rowspan="2">' . $task['project_name'] . '</td>';
  246. print '<td><a href="#" class="toggle">' . $task['title'] . '</a></td>';
  247. print '<td>';
  248. if(isset($task['is_active']) && $task['is_active'] == 0){
  249. print 'Closed';
  250. }elseif(isset($task['is_active']) && $task['is_active'] == 1){
  251. print 'Active';
  252. }
  253. //print '<td>' . $task['is_active'] . '</td>';
  254. print '</td>';
  255. print '<td>' . $task['column_name'] . '</td>';
  256. print '<td>' . $task['swimlane_name'] . '</td>';
  257. print '<td>' . $task['category_name'] . '</td>';
  258. print '<td>';
  259. if(isset($task['priority']) && $task['priority'] == 0){
  260. print 'None';
  261. }elseif(isset($task['priority']) && $task['priority'] == 1){
  262. print 'Low';
  263. }elseif(isset($task['priority']) && $task['priority'] == 2){
  264. print 'Medium';
  265. }elseif(isset($task['priority']) && $task['priority'] == 3){
  266. print 'High';
  267. }
  268. //print '<td>' . $task['priority'] . '</td>';
  269. print '<td>';
  270. if(isset($task['date_started']) && $task['date_started'] != 0){print date("Y-m-d - H:i", $task['date_started']);};
  271. print '</td>';
  272. print '<td>';
  273. if(isset($task['date_due']) && $task['date_due'] != 0){print date("Y-m-d - H:i", $task['date_due']);};
  274. print '</td>';
  275. print '<td>';
  276. if(isset($task['date_modification']) && $task['date_modification'] != 0){print date("Y-m-d - H:i", $task['date_modification']);};
  277. print '</td>';
  278. print '<td>';
  279. if(isset($task['date_moved']) && $task['date_moved'] != 0){print date("Y-m-d - H:i", $task['date_moved']);};
  280. print '</td>';
  281. print '<td>' . date("Y-m-d - H:i", $task['date_creation']) . '</td>';
  282. print '<td>' . $task['owner_username'] . '</td>';
  283. print '<td>' . $task['score'] . '</td>';
  284. print '<td>' . $task['time_spent'] . '</td>';
  285. print '<td>' . $task['time_estimated'] . '</td>';
  286. print '</tr>';
  287. ?>
  288. <tr class="tablesorter-childRow">
  289. <td class="subtask" colspan="">
  290. <div class="bold"><?php print $task['description']; ?></div>
  291. </td>
  292. </tr>
  293. <?php
  294. }
  295. ?>
  296. <?php
  297. /*
  298. <tr>
  299. <td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
  300. <a href="#" class="toggle">SO71774</a> <!-- link to toggle view of the child row -->
  301. </td>
  302. <td>Good Toys</td>
  303. <td>PO348186287</td>
  304. <td>Jul 20, 2007</td>
  305. <td>$972.78</td>
  306. </tr>
  307. <tr class="tablesorter-childRow">
  308. <td colspan="4">
  309. <div class="bold">Shipping Address</div>
  310. <div>99700 Bell Road<br>Auburn, California 95603</div>
  311. </td>
  312. </tr>
  313. <tr>
  314. <td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
  315. <a href="#" class="toggle">SO71775</a> <!-- link to toggle view of the child row -->
  316. </td>
  317. <td>Cycle Clearance</td>
  318. <td>PO58159451</td>
  319. <td>May 6, 2007</td>
  320. <td>$2,313.13</td>
  321. </tr>
  322. <tr class="tablesorter-childRow">
  323. <td colspan="4">
  324. <div class="bold">Shipping Address</div>
  325. <div>2255 254th Avenue Se<br>Albany, Oregon 97321</div>
  326. </td>
  327. </tr>
  328. <tr>
  329. <td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
  330. <a href="#" class="toggle">SO71774</a> <!-- link to toggle view of the child row -->
  331. </td>
  332. <td>Good Toys</td>
  333. <td>PO348186287</td>
  334. <td>Jul 20, 2007</td>
  335. <td>$972.78</td>
  336. </tr>
  337. <tr class="tablesorter-childRow">
  338. <td colspan="4">
  339. <div class="bold">Shipping Address</div>
  340. <div>99700 Bell Road<br>Auburn, California 95603</div>
  341. </td>
  342. </tr>
  343. <tr>
  344. <td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
  345. <a href="#" class="toggle">SO71775</a> <!-- link to toggle view of the child row -->
  346. </td>
  347. <td>Cycle Clearance</td>
  348. <td>P158159451</td>
  349. <td>May 6, 2007</td>
  350. <td>$2,313.13</td>
  351. </tr>
  352. <tr class="tablesorter-childRow">
  353. <td colspan="4">
  354. <div class="bold">Shipping Address</div>
  355. <div>2255 254th Avenue Se<br>Albany, Oregon 97321</div>
  356. </td>
  357. </tr>
  358. <!-- View page source for complete HTML markup -->
  359. */
  360. ?>
  361. </tbody>
  362. </table>
  363. <div id="pager" class="pager">
  364. <form>
  365. <input type="button" value="&lt;&lt;" class="columnSelectorButton first" />
  366. <input type="button" value="&lt;" class="columnSelectorButton prev" />
  367. <input type="text" class="pagedisplay"/>
  368. <input type="button" value="&gt;" class="columnSelectorButton next" />
  369. <input type="button" value="&gt;&gt;" class="columnSelectorButton last" />
  370. <select class="columnSelectorButton pagesize">
  371. <option selected="selected" value="10">10</option>
  372. <option value="20">20</option>
  373. <option value="30">30</option>
  374. <option value="40">40</option>
  375. </select>
  376. </form>
  377. </div>
  378. <br>
  379. <br>