effort.html.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. /**
  3. * The control file of my 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 my
  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. <div id="mainMenu" class="clearfix">
  16. <div class="btn-toolbar pull-left">
  17. <?php
  18. $menus = customModel::getFeatureMenu($app->rawModule, $app->rawMethod);
  19. foreach($menus as $menuItem)
  20. {
  21. $active = '';
  22. $label = "<span class='text'>{$menuItem->text}</span>";
  23. if($menuItem->name == $type)
  24. {
  25. $active = 'btn-active-text';
  26. $label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
  27. }
  28. echo html::a(inlink('effort', "date={$menuItem->name}"), $label, '', "class='btn btn-link $active' id='{$menuItem->name}'");
  29. }
  30. ?>
  31. <div class="input-control has-icon-right space">
  32. <?php echo html::input('date', $date, 'class="form-date form-control" onchange=changeDate(this.value)')?>
  33. <label for="inputPasswordExample1" class="input-control-icon-right"><i class="icon icon-delay"></i></label>
  34. </div>
  35. </div>
  36. <div class="btn-toolbar pull-right">
  37. <?php if(common::hasPriv('effort', 'calendar')):?>
  38. <div class="btn-group panel-actions">
  39. <?php echo html::a(helper::createLink('effort', 'calendar'), "<i class='icon-cards-view'></i> &nbsp;", '', "class='btn btn-icon' title='{$lang->effort->calendar}' id='switchButton'");?>
  40. <?php echo html::a(helper::createLink('my', 'effort', "type=all"), "<i class='icon-list'></i> &nbsp;", '', "class='btn btn-icon text-primary' title='{$lang->effort->list}' id='switchButton'");?>
  41. </div>
  42. <?php endif;?>
  43. <?php if(common::hasPriv('effort', 'export')) echo html::a(helper::createLink('effort', 'export', "userID={$app->user->id}&orderBy=date_asc", 'html', true), "<i class='icon-export muted'> </i> " . $lang->effort->export, '', "class='btn btn-link export'") ?>
  44. <?php common::printLink('effort', 'batchCreate', '', "<i class='icon icon-plus'></i> " . $lang->effort->create, '', "class='btn btn-primary iframe' id='batchCreate' data-width='95%'", '', true);?>
  45. </div>
  46. </div>
  47. <div id="mainContent">
  48. <form class="main-table table-effort" data-ride="table" method="post" action='<?php echo $this->createLink('effort', 'batchEdit', "from=browse")?>'>
  49. <?php
  50. $datatableId = $this->moduleName . ucfirst($this->methodName);
  51. $useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
  52. $vars = "type=$type&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage";
  53. if($useDatatable) include $app->getModuleRoot() . 'common/view/datatable.html.php';
  54. $customFields = $this->datatable->getOldSetting('my');
  55. $customFields = json_encode($customFields);
  56. $customFields = json_decode($customFields);
  57. $columns = 0;
  58. ?>
  59. <table class='table has-sort-head' data-custom-menu='true' data-checkbox-name='effortIDList[]'>
  60. <thead>
  61. <tr>
  62. <?php
  63. $hasProject = false;
  64. $hasExecution = false;
  65. foreach($customFields as $field)
  66. {
  67. if($field->id == 'project') $hasProject = true;
  68. if($field->id == 'execution') $hasExecution = true;
  69. $field->show = true;
  70. $this->datatable->printHead($field, $orderBy, $vars);
  71. $columns ++;
  72. }
  73. ?>
  74. </tr>
  75. </thead>
  76. <?php $times = 0?>
  77. <?php if($efforts):?>
  78. <?php
  79. $executions = array();
  80. if($hasExecution) $executions = $this->loadModel('execution')->getPairs(0, 'all', $hasProject ? 'multiple' : '');
  81. ?>
  82. <tbody>
  83. <?php foreach($efforts as $effort):?>
  84. <tr data-id='<?php echo $effort->id;?>'>
  85. <?php
  86. $mode = $useDatatable ? 'datatable' : 'table';
  87. foreach($customFields as $field) $this->effort->printCell($field, $effort, $mode, $executions);
  88. ?>
  89. </tr>
  90. <?php $times += $effort->consumed;?>
  91. <?php endforeach;?>
  92. </tbody>
  93. <?php endif;?>
  94. </table>
  95. <?php if($efforts):?>
  96. <div class="table-footer">
  97. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  98. <div class="table-actions btn-toolbar">
  99. <?php if(common::hasPriv('effort', 'batchEdit')):?>
  100. <?php echo html::submitButton($lang->effort->batchEdit, '', 'btn btn-primary');?>
  101. <?php endif;?>
  102. </div>
  103. <?php if($times) printf('<div class="text pull-left" style="margin-left: 20px;line-height:28px;">' . $lang->company->effort->timeStat . '</div>', $times);?>
  104. <?php $pager->show('right', 'pagerjs');?>
  105. </div>
  106. <?php endif;?>
  107. </form>
  108. </div>
  109. <?php
  110. if($type == 'bydate')
  111. {
  112. if($date == date('Y-m-d'))
  113. {
  114. $type = 'today';
  115. }
  116. else if($date == date('Y-m-d', strtotime('-1 day')))
  117. {
  118. $type = 'yesterday';
  119. }
  120. }
  121. ?>
  122. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>