execution.html.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. /**
  3. * The html template file of all method of execution module for lite vision of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(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 Wenrui LI <liwenrui@easycorp.ltd>
  8. * @package execution
  9. * @version $Id: index.html.php 5094 2013-07-10 08:46:15Z chencongzhi520@gmail.com $
  10. */
  11. ?>
  12. <?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
  13. <?php include $this->app->getModuleRoot() . '/common/view/sortable.html.php';?>
  14. <div class='clearfix' id='mainMenu'>
  15. <div class='btn-toolbar pull-left'>
  16. <?php
  17. foreach($lang->project->featureBar['execution'] as $label => $labelName)
  18. {
  19. $active = $status == $label ? 'btn-active-text' : '';
  20. echo html::a($this->createLink('project', 'execution', "status=$label&projectID=$projectID"), '<span class="text">' . $labelName . '</span> ' . ($status == $label ? "<span class='label label-light label-badge'>" . (int)count($kanbanList) . '</span>' : ''), '', "class='btn btn-link $active'");
  21. }
  22. ?>
  23. </div>
  24. <div class='btn-toolbar pull-right'>
  25. <?php common::printLink('execution', 'create', "projectID=$projectID", '<i class="icon icon-plus"></i> ' . $lang->project->createKanban, '', 'class="btn btn-primary"');?>
  26. </div>
  27. </div>
  28. <div id='mainContent' class="main-row fade cell">
  29. <?php if(empty($kanbanList)):?>
  30. <div class="table-empty-tip">
  31. <p>
  32. <span class="text-muted"><?php echo $lang->execution->noExecution;?></span>
  33. <?php if(common::hasPriv('execution', 'create') and $allExecutionsNum):?>
  34. <?php echo html::a($this->createLink('execution', 'create', "projectID=$projectID"), "<i class='icon icon-plus'></i> " . $lang->project->createKanban, '', "class='btn btn-info' data-app='project'");?>
  35. <?php endif;?>
  36. </p>
  37. </div>
  38. <?php else:?>
  39. <div class='kanban-cards'>
  40. <?php
  41. $kanbanview = 'kanban';
  42. if($this->cookie->kanbanview) $kanbanview = $this->cookie->kanbanview;
  43. if(!common::hasPriv('execution', $kanbanview))
  44. {
  45. foreach (explode('|', 'kanban|task|calendar|gantt|tree|grouptask') as $view)
  46. {
  47. if(common::hasPriv('execution', $view))
  48. {
  49. $kanbanview = $view;
  50. break;
  51. }
  52. }
  53. }
  54. ?>
  55. <?php foreach($kanbanList as $index => $kanban):?>
  56. <div id="kanban-<?php echo $kanban->id;?>" class='kanban-card col' data-url='<?php echo $this->createLink('execution', $kanbanview, "kanbanID=$kanban->id");?>'>
  57. <div class="panel">
  58. <div class="panel-heading">
  59. <span class="label kanban-status-<?php echo $kanban->status;?>"><?php echo zget($lang->execution->statusList, $kanban->status);?></span>
  60. <strong class="kanban-name" title='<?php echo $kanban->name;?>'><?php echo $kanban->name;?></strong>
  61. <?php $canActions = (common::hasPriv('execution','edit') or (!empty($executionActions) and isset($executionActions[$kanban->id])));?>
  62. <?php if($canActions):?>
  63. <div class='kanban-actions kanban-actions<?php echo $kanban->id;?>'>
  64. <div class='dropdown'>
  65. <?php echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");?>
  66. <ul class='dropdown-menu <?php echo ($index + 1) % 4 == 0 ? 'pull-left' : 'pull-right';?>'>
  67. <?php
  68. if(common::hasPriv('execution','edit'))
  69. {
  70. $this->app->loadLang('kanban');
  71. echo '<li>';
  72. common::printLink('execution', 'edit', "executionID={$kanban->id}", '<i class="icon icon-edit"></i> ' . $lang->kanban->edit, '', "class='iframe' data-width='75%'", '', true);
  73. echo '</li>';
  74. }
  75. if(!empty($executionActions[$kanban->id]))
  76. {
  77. if(in_array('start', $executionActions[$kanban->id])) echo '<li>' . html::a(helper::createLink('execution', 'start', "executionID={$kanban->id}", '', true), '<i class="icon icon-play"></i>' . $lang->execution->start, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
  78. if(in_array('putoff', $executionActions[$kanban->id])) echo '<li>' . html::a(helper::createLink('execution', 'putoff', "executionID=$kanban->id", '', true), '<i class="icon icon-calendar"></i>' . $lang->execution->putoff, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
  79. if(in_array('suspend', $executionActions[$kanban->id])) echo '<li>' . html::a(helper::createLink('execution', 'suspend', "executionID=$kanban->id", '', true), '<i class="icon icon-pause"></i>' . $lang->execution->suspend, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
  80. if(in_array('close', $executionActions[$kanban->id])) echo '<li>' . html::a(helper::createLink('execution', 'close', "executionID=$kanban->id", '', true), '<i class="icon icon-off"></i>' . $lang->execution->close, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
  81. if(in_array('activate', $executionActions[$kanban->id])) echo '<li>' . html::a(helper::createLink('execution', 'activate', "executionID=$kanban->id", '', true), '<i class="icon icon-magic"></i>' . $lang->execution->activate, '', "class='iframe btn btn-link text-left' data-width='75%'") . '</li>';
  82. if(in_array('delete', $executionActions[$kanban->id])) echo '<li>' . html::a(helper::createLink('execution', 'delete', "executionID=$kanban->id&confirm=no&kanban=yes", '', true), '<i class="icon icon-trash"></i>' . $lang->kanban->delete, '', "target='hiddenwin'") . '</li>';
  83. }?>
  84. </ul>
  85. </div>
  86. </div>
  87. <?php endif;?>
  88. </div>
  89. <div class="panel-body">
  90. <div class="kanban-desc">
  91. <?php echo $kanban->desc;?>
  92. </div>
  93. <div class="kanban-footer">
  94. <div class='kanban-members pull-left'>
  95. <?php $teams = isset($memberGroup[$kanban->id]) ? $memberGroup[$kanban->id] : array();?>
  96. <?php $count = 0;?>
  97. <?php foreach($teams as $member):?>
  98. <?php if($count > 2) break;?>
  99. <?php $count ++;?>
  100. <div title="<?php echo zget($users, $member->account);?>">
  101. <?php echo html::smallAvatar(array('avatar' => zget($usersAvatar, $member->account), 'account' => $member->account, 'name' => isset($member->realname) ? $member->realname : '')); ?>
  102. </div>
  103. <?php endforeach;?>
  104. <?php if(count($teams) > 4):?>
  105. <?php echo '<span>… </span>';?>
  106. <?php endif;?>
  107. <?php if(count($teams) > 3):?>
  108. <?php $lastMember = end($teams);?>
  109. <div title="<?php echo $lastMember->realname;?>">
  110. <?php echo html::smallAvatar(array('avatar' => $usersAvatar[$lastMember->account], 'account' => $lastMember->account, 'name' => $lastMember->realname), 'avatar-circle avatar-' . key((array)$lastMember)); ?>
  111. </div>
  112. <?php endif;?>
  113. </div>
  114. <div class='kanban-members-count pull-left'><?php echo sprintf($lang->project->teamSumCount, count($teams));?></div>
  115. <div class='kanban-acl pull-right'>
  116. <span><i class="icon icon-<?php echo $kanban->acl == 'private' ? 'lock' : 'unlock-alt';?>"></i> <?php echo zget($lang->project->acls, $kanban->acl, '');?></span>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <?php endforeach;?>
  123. </div>
  124. <?php endif;?>
  125. </div>
  126. <style>
  127. .kanban-cards {padding-top: 12px; width: 100%;}
  128. .kanban-card {width: 25%;}
  129. .kanban-card .panel {margin: 0 0; border: 1px solid #DCDCDC; border-radius: 4px; box-shadow: none; cursor: pointer; height: 160px; margin-bottom: 5px;}
  130. .kanban-card .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
  131. .kanban-card .panel:hover .kanban-actions {visibility: unset;}
  132. .kanban-card .kanban-actions {position: absolute; top: 2px; right: 2px; float: right; visibility: hidden;}
  133. .kanban-card .kanban-actions .dropdown-menu.pull-right {top:31px; right: -84px; left: auto;}
  134. .kanban-card .kanban-actions .dropdown-menu.pull-left {top:31px; right:-1px; left: auto;}
  135. .kanban-card .kanban-desc {color: #838a9d; word-break:break-all; height: 70px; overflow: hidden; display: -webkit-box; float:left;}
  136. .kanban-card .kanban-footer {position: absolute; bottom: 10px; right: 10px; left: 15px;}
  137. .kanban-card .kanban-members {float: left; height: 24px; line-height: 24px;}
  138. .kanban-card .kanban-members > div {display: inline-block; height: 24px;}
  139. .kanban-card .kanban-members > div + div {margin-left: -5px;}
  140. .kanban-card .kanban-members > div > .avatar {display: inline-block; width: 24px; height: 24px; line-height: 24px; margin-right: 1px;}
  141. .kanban-card .kanban-members > span {display: inline-block; color: transparent; width: 2px; height: 2px; background-color: #8990a2; position: relative; border-radius: 50%; top: 3px; margin: 0 3px;}
  142. .kanban-card .kanban-members > span:before,
  143. .kanban-card .kanban-members > span:after {content: ''; display: block; position: absolute; width: 2px; height: 2px; background-color: #8990a2; top: 0; border-radius: 50%}
  144. .kanban-card .kanban-members > span:before {left: -4px;}
  145. .kanban-card .kanban-members > span:after {right: -4px;}
  146. .kanban-card .kanban-members-count {display: inline-block; margin-left: 6px; position: relative; top: 3px}
  147. .kanban-card .kanban-acl {position: absolute; right: 0px; bottom: 2px; color: #838a9d;}
  148. .kanban-card .label.kanban-status-wait {background-color: #E5E5E5; color: #808080;}
  149. .kanban-card .label.kanban-status-doing {background-color: #DDF4DF; color: #38B03F;}
  150. .kanban-card .label.kanban-status-suspended {background-color: #FFF0D5; color: #F1A325;}
  151. .kanban-card .label.kanban-status-closed {background-color: #808080; color: #FFF;}
  152. </style>
  153. <script>
  154. /* Make cards clickable. */
  155. $('.kanban-cards').on('click', '.kanban-card', function(e)
  156. {
  157. if(!$(e.target).closest('.kanban-actions').length)
  158. {
  159. window.location.href = $(this).data('url');
  160. }
  161. });
  162. </script>
  163. <?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>