effort.html.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. /**
  3. * The control file of company module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2012 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license business(商业软件)
  7. * @author Yangyang Shi <shiyangyang@cnezsoft.com>
  8. * @package company
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php include $app->getModuleRoot() . 'common/view/datepicker.html.php';?>
  15. <?php include $app->getModuleRoot() . 'common/view/datatable.fix.html.php';?>
  16. <?php js::set('maxCount', $config->maxCount);?>
  17. <?php if(common::checkNotCN()):?>
  18. <style>
  19. #sidebar .form-group .input-group-addon{width:93px;}
  20. #sidebar .form-group #userBox .input-group-addon{padding:5px 32px;}
  21. </style>
  22. <?php endif;?>
  23. <div id='mainMenu' class='clearfix'>
  24. <div class='btn-toolbar pull-left'>
  25. <?php
  26. foreach($lang->company->featureBar['calendar'] as $type => $name)
  27. {
  28. $activeClass = $type == $date ? ' btn-active-text' : '';
  29. echo html::a(inlink($type == 'calendar' ? 'calendar' : 'effort', $type == 'calendar' ? '' : "date=$type"), "<span class='text'>{$name}</span>", '', "class='btn btn-link{$activeClass}' id='{$type}Tab'");
  30. }
  31. ?>
  32. </div>
  33. <div class='btn-toolbar pull-right'><?php common::printIcon('effort', 'export', "userID=" . ($user ? $user->id : '') . "&orderBy=date_asc", '', 'button', '', '', 'export');?></div>
  34. </div>
  35. <div id="mainContent" class="main-row fade">
  36. <div class="side-col" id="sidebar">
  37. <div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
  38. <div class='cell'>
  39. <form method='post' action='<?php echo $this->createLink('company', 'effort', "date=custom&orderBy=$orderBy")?>'>
  40. <div class='detail'>
  41. <div class='detail-content'>
  42. <div class='form-group'>
  43. <div class='input-group'>
  44. <span class='input-group-addon'><?php echo $lang->company->userType;?></span>
  45. <?php echo html::select('userType', $lang->company->userTypes, $userType, 'class="form-control chosen"');?>
  46. </div>
  47. </div>
  48. <div class='form-group'>
  49. <div class='input-group'>
  50. <span class='input-group-addon'><?php echo $lang->company->dept;?></span>
  51. <?php if(empty($mainDepts)) $mainDepts = array(0 => '/');?>
  52. <?php echo html::select('dept', $mainDepts, $dept, "class='form-control chosen' onchange='loadDeptUsers(this.value, \"account\")'");?>
  53. </div>
  54. </div>
  55. <div class='form-group'>
  56. <div class='input-group'>
  57. <span class='input-group-addon'><?php echo $lang->company->beginDate;?></span>
  58. <?php echo html::input('begin', $begin, 'class="form-control form-date"');?>
  59. </div>
  60. </div>
  61. <div class='form-group'>
  62. <div class='input-group'>
  63. <span class='input-group-addon'><?php echo $lang->company->endDate;?></span>
  64. <?php echo html::input('end', $end, 'class="form-control form-date"');?>
  65. </div>
  66. </div>
  67. <div class='form-group'>
  68. <div id='productIdBox' class='input-group'>
  69. <span class='input-group-addon'><?php echo $lang->company->product;?></span>
  70. <?php if($config->vision == 'lite'):?>
  71. <?php echo html::select('product', $products, $product, 'class="form-control chosen" onchange="loadProductExecutions(this.value)"');?>
  72. <?php else:?>
  73. <?php echo html::select('product', $products, $product, 'class="form-control chosen" onchange="loadProductProject(this.value)"');?>
  74. <?php endif;?>
  75. </div>
  76. </div>
  77. <?php if($config->vision != 'lite'):?>
  78. <div class='form-group'>
  79. <div id='projectIdBox' class='input-group'>
  80. <span class='input-group-addon'><?php echo $lang->company->project;?></span>
  81. <?php echo html::select('project', $projects, $project, 'class="form-control chosen" onchange="loadProductExecutions($(\'#product\').val(), this.value)"');?>
  82. </div>
  83. </div>
  84. <?php endif;?>
  85. <div class='form-group'>
  86. <div id='executionIdBox' class='input-group' style="width: 100%">
  87. <span class='input-group-addon'><?php echo $config->vision != 'lite' ? $lang->execution->common : $lang->company->execution;?></span>
  88. <?php echo html::select('execution', $executions, $execution, 'class="form-control chosen"');?>
  89. </div>
  90. </div>
  91. <div class='form-group'>
  92. <div id='userBox' class='input-group'>
  93. <span class='input-group-addon'><?php echo $lang->company->user;?></span>
  94. <?php echo html::select('user', $users, $account, 'class="form-control chosen"');?>
  95. </div>
  96. </div>
  97. <div class='form-group'><?php echo html::submitButton($lang->company->effort->view);?></div>
  98. </div>
  99. </div>
  100. </form>
  101. </div>
  102. </div>
  103. <div class="main-col">
  104. <?php
  105. $datatableId = $this->moduleName . ucfirst($this->methodName);
  106. $useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
  107. $vars = "date=$date&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage";
  108. //if($useDatatable) include $app->getModuleRoot() . 'common/view/datatable.html.php';
  109. $customFields = $this->datatable->getOldSetting('company', '', true);
  110. $columns = 0;
  111. $customFields = json_encode($customFields);
  112. $customFields = json_decode($customFields);
  113. ?>
  114. <form class='main-table' data-ride='table' method='post' id='effortForm' action='<?php echo $this->createLink('effort', 'batchEdit', "from=browse&userID=" . ($user ? $user->id : ''))?>' <?php if($useDatatable) echo "style='overflow:hidden'"?>>
  115. <div class="table-responsive">
  116. <table class='table has-sort-head table-fixed <?php if($useDatatable) echo 'datatable';?>' id='effortList' data-checkable='false' data-custom-menu='true' data-checkbox-name='effortIDList[]'>
  117. <thead>
  118. <tr>
  119. <?php
  120. foreach($customFields as $field)
  121. {
  122. $field->show = true;
  123. $this->datatable->printHead($field, $orderBy, $vars, false);
  124. $columns ++;
  125. }
  126. ?>
  127. <th></th>
  128. </tr>
  129. </thead>
  130. <?php $times = 0?>
  131. <?php if($efforts):?>
  132. <tbody>
  133. <?php foreach($efforts as $effort):?>
  134. <tr data-id='<?php echo $effort->id;?>'>
  135. <?php
  136. $effort->consumed = helper::formatHours($effort->consumed);
  137. $effort->left = helper::formatHours($effort->left);
  138. $mode = $useDatatable ? 'datatable' : 'table';
  139. foreach($customFields as $field) $this->effort->printCell($field, $effort, $mode, $executions);
  140. ?>
  141. <td></td>
  142. </tr>
  143. <?php $times += $effort->consumed;?>
  144. <?php endforeach;?>
  145. </tbody>
  146. <?php endif;?>
  147. </table>
  148. </div>
  149. <?php if($efforts):?>
  150. <div class='table-footer'>
  151. <?php if($times):?>
  152. <span class='table-statistic' style='line-height:28px'><?php printf($lang->company->effort->timeStat, $times);?></span>
  153. <?php endif;?>
  154. <?php $pager->show('right', 'pagerjs');?>
  155. </div>
  156. <?php endif;?>
  157. </form>
  158. </div>
  159. </div>
  160. <script>
  161. $(function()
  162. {
  163. $('#<?php echo $date;?>').addClass('btn-active-text');
  164. <?php if($date == 'custom'): ?>
  165. $('#all').addClass('btn-active-text')
  166. <?php endif;?>
  167. <?php if((int)$date != 0):?>
  168. $('#date').css("font-weight", "bold");
  169. <?php endif;?>
  170. })
  171. </script>
  172. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>