view.html.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <?php
  2. /**
  3. * The view of opportunity module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2021 禅道软件(青岛)有限公司(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 Shujie Tian <tianshujie@easycorp.ltd>
  8. * @package view
  9. * @version $Id: view.html.php 4903 2021-05-26 11:00:59Z tsj $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <?php include $app->getModuleRoot() . 'common/view/kindeditor.html.php';?>
  15. <?php $browseLink = $app->session->opportunityList ? $app->session->opportunityList : $this->createLink('opportunity', 'browse', "projectID={$opportunity->project}");?>
  16. <?php $hasOpportunitylib = helper::hasFeature('opportunitylib');?>
  17. <?php js::set('sysurl', common::getSysUrl());?>
  18. <div id="mainMenu" class="clearfix">
  19. <div class="btn-toolbar pull-left">
  20. <?php if(!isonlybody()):?>
  21. <?php echo html::a($browseLink, '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary' data-app='{$app->tab}'");?>
  22. <div class="divider"></div>
  23. <?php endif;?>
  24. <div class="page-title">
  25. <span class="label label-id"><?php echo $opportunity->id?></span>
  26. <span class="text" title='<?php echo $opportunity->name;?>'><?php echo $opportunity->name;?></span>
  27. <?php if($opportunity->deleted):?>
  28. <span class='label label-danger'><?php echo $lang->opportunity->deleted;?></span>
  29. <?php endif; ?>
  30. </div>
  31. </div>
  32. </div>
  33. <div id="mainContent" class="main-row">
  34. <div class="main-col col-8">
  35. <div class="cell">
  36. <div class="detail">
  37. <div class="detail-title"><?php echo $lang->opportunity->desc;?></div>
  38. <div class="detail-content article-content"><?php echo $opportunity->desc;?></div>
  39. </div>
  40. <div class="detail">
  41. <div class="detail-title"><?php echo $lang->opportunity->prevention;?></div>
  42. <div class="detail-content article-content"><?php echo $opportunity->prevention;?></div>
  43. </div>
  44. <div class="detail">
  45. <div class="detail-title"><?php echo $lang->opportunity->resolution;?></div>
  46. <div class="detail-content article-content"><?php echo $opportunity->resolution;?></div>
  47. </div>
  48. </div>
  49. <div class="cell"><?php include $app->getModuleRoot() . 'common/view/action.html.php';?></div>
  50. <div class='main-actions'>
  51. <div class="btn-toolbar">
  52. <?php common::printBack($browseLink . "#app={$app->tab}");?>
  53. <?php if(!isonlybody()) echo "<div class='divider'></div>";?>
  54. <?php $canModify = !$opportunity->deleted;
  55. if($canModify && $project) $canModify = common::canModify('project', $project);
  56. if($canModify && $execution) $canModify = common::canModify('execution', $execution);
  57. ?>
  58. <?php if($canModify):?>
  59. <?php
  60. common::printIcon('opportunity', 'track', "opportunityID=$opportunity->id", $opportunity, "button", 'checked', '', 'iframe showinonlybody', true);
  61. common::printIcon('opportunity', 'assignTo', "opportunityID=$opportunity->id", $opportunity, 'button', '', '', 'iframe showinonlybody', true);
  62. common::printIcon('opportunity', 'cancel', "opportunityID=$opportunity->id", $opportunity, 'button', '', '', 'iframe showinonlybody', true);
  63. common::printIcon('opportunity', 'close', "opportunityID=$opportunity->id", $opportunity, 'button', '', '', 'iframe showinonlybody', true);
  64. common::printIcon('opportunity', 'hangup', "opportunityID=$opportunity->id", $opportunity, 'button', 'arrow-up', '', 'iframe showinonlybody', true);
  65. common::printIcon('opportunity', 'activate', "opportunityID=$opportunity->id", $opportunity, 'button', '', '', 'iframe showinonlybody', true);
  66. if(common::hasPriv('opportunity', 'importToLib') and $hasOpportunitylib) echo html::a('#importToLib', "<i class='icon icon-assets'></i> " . $this->lang->opportunity->importToLib, '', 'class="btn" data-toggle="modal"');
  67. echo "<div class='divider'></div>";
  68. common::printIcon('opportunity', 'edit', "opportunityID=$opportunity->id&from=$from", $opportunity);
  69. common::printIcon('opportunity', 'delete', "opportunityID=$opportunity->id&from=$from", $opportunity, 'button', 'trash', 'hiddenwin');
  70. ?>
  71. <?php endif;?>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="side-col col-4">
  76. <div class="cell">
  77. <div class='tabs'>
  78. <ul class='nav nav-tabs'>
  79. <li class='active'><a href='' data-toggle='tab'><?php echo $lang->opportunity->legendBasicInfo;?></a></li>
  80. </ul>
  81. <div class='tab-content'>
  82. <div class='tab-pane active' id='basicInfo'>
  83. <table class="table table-data">
  84. <tbody>
  85. <tr>
  86. <th><?php echo $lang->opportunity->source;?></th>
  87. <td><?php echo zget($lang->opportunity->sourceList, $opportunity->source);?></td>
  88. </tr>
  89. <tr>
  90. <th><?php echo $lang->opportunity->type;?></th>
  91. <td><?php echo zget($lang->opportunity->typeList, $opportunity->type);?></td>
  92. </tr>
  93. <tr>
  94. <th><?php echo $lang->opportunity->strategy;?></th>
  95. <td><?php echo zget($lang->opportunity->strategyList, $opportunity->strategy);?></td>
  96. </tr>
  97. <tr>
  98. <th><?php echo $lang->opportunity->status;?></th>
  99. <td><span class='status-task status-<?php echo $config->opportunity->labelDot[$opportunity->status];?>'><span class="label label-dot"></span> <?php echo $this->processStatus('opportunity', $opportunity);?></span></td>
  100. </tr>
  101. <tr <?php if(empty($project->multiple)) echo "class='hidden'";?>>
  102. <th><?php echo $lang->opportunity->execution;?></th>
  103. <td><?php if($opportunity->execution) common::printLink('execution', 'view', "executionID=$opportunity->execution", zget($execution, 'name'), '', 'data-app="execution"');?></td>
  104. </tr>
  105. <tr>
  106. <th><?php echo $lang->opportunity->impact;?></th>
  107. <td><?php echo zget($lang->opportunity->impactList, $opportunity->impact);?></td>
  108. </tr>
  109. <tr>
  110. <th><?php echo $lang->opportunity->chance;?></th>
  111. <td><?php echo zget($lang->opportunity->chanceList, $opportunity->chance);?></td>
  112. </tr>
  113. <tr>
  114. <th><?php echo $lang->opportunity->ratio;?></th>
  115. <td><?php echo $opportunity->ratio;?></td>
  116. </tr>
  117. <tr>
  118. <th><?php echo $lang->opportunity->pri;?></th>
  119. <td><span class='<?php echo 'pri-' . $opportunity->pri;?>' title='<?php echo zget($lang->opportunity->priList, $opportunity->pri)?>'><?php echo zget($lang->opportunity->priList, $opportunity->pri)?></span></td>
  120. </tr>
  121. <tr>
  122. <th><?php echo $lang->opportunity->identifiedDate;?></th>
  123. <td><?php echo helper::isZeroDate($opportunity->identifiedDate) ? '' : $opportunity->identifiedDate;?></td>
  124. </tr>
  125. <tr>
  126. <th><?php echo $lang->opportunity->plannedClosedDate;?></th>
  127. <td><?php echo helper::isZeroDate($opportunity->plannedClosedDate) ? '' : $opportunity->plannedClosedDate;?></td>
  128. </tr>
  129. <tr>
  130. <th><?php echo $lang->opportunity->actualClosedDate;?></th>
  131. <td><?php echo helper::isZeroDate($opportunity->actualClosedDate) ? '' : $opportunity->actualClosedDate;?></td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="cell">
  140. <div class='tabs'>
  141. <ul class='nav nav-tabs'>
  142. <li class='active'><a href='' data-toggle='tab'><?php echo $lang->opportunity->legendLifeTime;?></a></li>
  143. </ul>
  144. <div class='tab-content'>
  145. <div class='tab-pane active' id='legendLifeTime'>
  146. <table class="table table-data">
  147. <tbody>
  148. <tr>
  149. <th class='w-90px'><?php echo $lang->opportunity->assignedTo;?></th>
  150. <td><?php echo zget($users, $opportunity->assignedTo);?></td>
  151. </tr>
  152. <tr>
  153. <th class='w-90px'><?php echo $lang->opportunity->lastCheckedBy;?></th>
  154. <td><?php echo zget($users, $opportunity->lastCheckedBy);?></td>
  155. </tr>
  156. <tr>
  157. <th><?php echo $lang->opportunity->lastCheckedDate;?></th>
  158. <td><?php echo helper::isZeroDate($opportunity->lastCheckedDate) ? '' : $opportunity->lastCheckedDate;?></td>
  159. </tr>
  160. <tr>
  161. <th class='w-90px'><?php echo $lang->opportunity->createdBy;?></th>
  162. <td><?php echo zget($users, $opportunity->createdBy);?></td>
  163. </tr>
  164. <tr>
  165. <th><?php echo $lang->opportunity->createdDate;?></th>
  166. <td><?php echo helper::isZeroDate($opportunity->createdDate) ? '' : $opportunity->createdDate;?></td>
  167. </tr>
  168. <tr>
  169. <th class='w-90px'><?php echo $lang->opportunity->editedBy;?></th>
  170. <td><?php echo zget($users, $opportunity->editedBy);?></td>
  171. </tr>
  172. <tr>
  173. <th><?php echo $lang->opportunity->editedDate;?></th>
  174. <td><?php echo helper::isZeroDate($opportunity->editedDate) ? '' : $opportunity->editedDate;?></td>
  175. </tr>
  176. <tr>
  177. <th><?php echo $lang->opportunity->assignedDate;?></th>
  178. <td><?php echo helper::isZeroDate($opportunity->assignedDate) ? '' : $opportunity->assignedDate;?></td>
  179. </tr>
  180. <tr>
  181. <th class='w-90px'><?php echo $lang->opportunity->resolvedBy;?></th>
  182. <td><?php echo zget($users, $opportunity->resolvedBy);?></td>
  183. </tr>
  184. <tr>
  185. <th class='w-90px'><?php echo $lang->opportunity->resolvedDate;?></th>
  186. <td><?php echo helper::isZeroDate($opportunity->resolvedDate) ? '' : $opportunity->resolvedDate;?></td>
  187. </tr>
  188. <tr>
  189. <th><?php echo $lang->opportunity->actualClosedDate;?></th>
  190. <td><?php echo helper::isZeroDate($opportunity->actualClosedDate) ? '' : $opportunity->actualClosedDate;?></td>
  191. </tr>
  192. <tr>
  193. <th class='w-90px'><?php echo $lang->opportunity->canceledBy;?></th>
  194. <td><?php echo zget($users, $opportunity->canceledBy);?></td>
  195. </tr>
  196. <tr>
  197. <th><?php echo $lang->opportunity->canceledDate;?></th>
  198. <td><?php echo helper::isZeroDate($opportunity->canceledDate) ? '' : $opportunity->canceledDate;?></td>
  199. </tr>
  200. <tr>
  201. <th><?php echo $lang->opportunity->cancelReason;?></th>
  202. <td><?php echo zget($lang->opportunity->cancelReasonList, $opportunity->cancelReason);?></td>
  203. </tr>
  204. <tr>
  205. <th class='w-90px'><?php echo $lang->opportunity->hangupedBy;?></th>
  206. <td><?php echo zget($users, $opportunity->hangupedBy);?></td>
  207. </tr>
  208. <tr>
  209. <th><?php echo $lang->opportunity->hangupedDate;?></th>
  210. <td><?php echo helper::isZeroDate($opportunity->hangupedDate) ? '' : $opportunity->hangupedDate;?></td>
  211. </tr>
  212. <tr>
  213. <th class='w-90px'><?php echo $lang->opportunity->activatedBy;?></th>
  214. <td><?php echo zget($users, $opportunity->activatedBy);?></td>
  215. </tr>
  216. <tr>
  217. <th><?php echo $lang->opportunity->activatedDate;?></th>
  218. <td><?php echo helper::isZeroDate($opportunity->activatedDate) ? '' : $opportunity->activatedDate;?></td>
  219. </tr>
  220. </tbody>
  221. </table>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. <div class="modal fade" id="importToLib">
  229. <div class="modal-dialog mw-500px">
  230. <div class="modal-content">
  231. <div class="modal-header">
  232. <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon icon-close"></i></button>
  233. <h4 class="modal-title"><?php echo $lang->opportunity->importToLib;?></h4>
  234. </div>
  235. <div class="modal-body">
  236. <form method='post' class='form-ajax' action='<?php echo $this->createLink('opportunity', 'importToLib', "opportunity=$opportunity->id");?>'>
  237. <table class='table table-form'>
  238. <tr>
  239. <th><?php echo $lang->opportunity->lib;?></th>
  240. <td>
  241. <?php echo html::select('lib', $libs, '', "class='form-control chosen' required");?>
  242. </td>
  243. </tr>
  244. <?php if(!common::hasPriv('assetlib', 'approveStory') and !common::hasPriv('assetlib', 'batchApproveStory')):?>
  245. <tr>
  246. <th><?php echo $lang->opportunity->approver;?></th>
  247. <td>
  248. <?php echo html::select('assignedTo', $approvers, '', "class='form-control chosen'");?>
  249. </td>
  250. </tr>
  251. <?php endif;?>
  252. <tr>
  253. <td colspan='2' class='text-center'>
  254. <?php echo html::submitButton($lang->import, '', 'btn btn-primary');?>
  255. </td>
  256. </tr>
  257. </table>
  258. </form>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <div id="mainActions" class='main-actions'>
  264. <?php common::printPreAndNext($preAndNext, $this->createLink('opportunity', 'view', "opportunityID=%s&from=$from"));?>
  265. </div>
  266. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>