view.html.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <?php
  2. /**
  3. * The view of risk module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2020 禅道软件(青岛)有限公司(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 Yuchun Li <liyuchun@cnezsoft.com>
  8. * @package view
  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/kindeditor.html.php';?>
  15. <?php $browseLink = $app->session->riskList ? $app->session->riskList : $this->createLink('risk', 'browse', "projectID={$risk->project}&from=$from");?>
  16. <?php $hasRisklib = helper::hasFeature('risklib');?>
  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'");?>
  22. <div class="divider"></div>
  23. <?php endif;?>
  24. <div class="page-title">
  25. <span class="label label-id"><?php echo $risk->id?></span>
  26. <span class="text" title='<?php echo $risk->name;?>'><?php echo $risk->name;?></span>
  27. <?php if($risk->deleted):?>
  28. <span class='label label-danger'><?php echo $lang->risk->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->risk->prevention;?></div>
  38. <div class="detail-content article-content"><?php echo $risk->prevention;?></div>
  39. </div>
  40. <div class="detail">
  41. <div class="detail-title"><?php echo $lang->risk->remedy;?></div>
  42. <div class="detail-content article-content"><?php echo $risk->remedy;?></div>
  43. </div>
  44. <div class="detail">
  45. <div class="detail-title"><?php echo $lang->risk->resolution;?></div>
  46. <div class="detail-content article-content"><?php echo $risk->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);?>
  53. <?php if(!isonlybody()) echo "<div class='divider'></div>";?>
  54. <?php if(!$risk->deleted):?>
  55. <?php
  56. common::printIcon('risk', 'track', "riskID=$risk->id", $risk, "button", 'checked', '', 'iframe showinonlybody', true);
  57. common::printIcon('risk', 'assignTo', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true);
  58. common::printIcon('effort', 'createForObject', "objectType=risk&objectID=$risk->id", '', 'button', 'time', '', 'iframe', true, '', $lang->risk->effort);
  59. common::printIcon('risk', 'cancel', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true);
  60. common::printIcon('risk', 'close', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true);
  61. common::printIcon('risk', 'hangup', "riskID=$risk->id", $risk, 'button', 'pause', '', 'iframe showinonlybody', true);
  62. common::printIcon('risk', 'activate', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true);
  63. if(common::hasPriv('risk', 'importToLib') and $hasRisklib) echo html::a('#importToLib', "<i class='icon icon-assets'></i> " . $this->lang->risk->importToLib, '', 'class="btn" data-toggle="modal"');
  64. echo "<div class='divider'></div>";
  65. common::printIcon('risk', 'edit', "riskID=$risk->id&from=$from", $risk);
  66. common::printIcon('risk', 'delete', "riskID=$risk->id&from=$from", $risk, 'button', 'trash', 'hiddenwin');
  67. ?>
  68. <?php endif;?>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="side-col col-4">
  73. <div class="cell">
  74. <div class='tabs'>
  75. <ul class='nav nav-tabs'>
  76. <li class='active'><a href='#basicInfo' data-toggle='tab'><?php echo $lang->risk->legendBasicInfo;?></a></li>
  77. <li><a href='#legendLifeTime' data-toggle='tab'><?php echo $lang->risk->legendLifeTime;?></a></li>
  78. </ul>
  79. <div class='tab-content'>
  80. <div class='tab-pane active' id='basicInfo'>
  81. <table class="table table-data">
  82. <tbody>
  83. <tr>
  84. <th class='w-90px'><?php echo $lang->risk->id;?></th>
  85. <td><?php echo $risk->id;?></td>
  86. </tr>
  87. <tr>
  88. <th><?php echo $lang->risk->source;?></th>
  89. <td><?php echo zget($lang->risk->sourceList, $risk->source);?></td>
  90. </tr>
  91. <tr>
  92. <th><?php echo $lang->risk->execution;?></th>
  93. <td>
  94. <?php if(isset($risk->execution) and ($risk->execution != 0)):?>
  95. <?php common::printLink('execution', 'view', "executionID=$risk->execution", zget($execution, 'name'), '', 'data-app="execution"');?>
  96. <?php endif;?>
  97. </td>
  98. </tr>
  99. <tr>
  100. <th><?php echo $lang->risk->category;?></th>
  101. <td><?php echo zget($lang->risk->categoryList, $risk->category);?></td>
  102. </tr>
  103. <tr>
  104. <th><?php echo $lang->risk->strategy;?></th>
  105. <td><?php echo zget($lang->risk->strategyList, $risk->strategy);?></td>
  106. </tr>
  107. <tr>
  108. <th><?php echo $lang->risk->status;?></th>
  109. <td><span class='status-risk status-<?php echo $risk->status?>'><?php echo $this->processStatus('risk', $risk);?></span></td>
  110. </tr>
  111. <tr>
  112. <th><?php echo $lang->risk->impact;?></th>
  113. <td><?php echo zget($lang->risk->impactList, $risk->impact);?></td>
  114. </tr>
  115. <tr>
  116. <th><?php echo $lang->risk->probability;?></th>
  117. <td><?php echo zget($lang->risk->probabilityList, $risk->probability);?></td>
  118. </tr>
  119. <tr>
  120. <th><?php echo $lang->risk->rate;?></th>
  121. <td><?php echo $risk->rate;?></td>
  122. </tr>
  123. <tr>
  124. <th><?php echo $lang->risk->pri;?></th>
  125. <td><span class='<?php echo 'pri-' . $risk->pri;?>' title='<?php echo zget($lang->risk->priList, $risk->pri)?>'><?php echo zget($lang->risk->priList, $risk->pri)?></span></td>
  126. </tr>
  127. <tr>
  128. <th><?php echo $lang->risk->identifiedDate;?></th>
  129. <td><?php echo $risk->identifiedDate == '0000-00-00' ? '' : $risk->identifiedDate;?></td>
  130. </tr>
  131. <tr>
  132. <th><?php echo $lang->risk->plannedClosedDate;?></th>
  133. <td><?php echo $risk->plannedClosedDate == '0000-00-00' ? '' : $risk->plannedClosedDate;?></td>
  134. </tr>
  135. <tr>
  136. <th><?php echo $lang->risk->actualClosedDate;?></th>
  137. <td><?php echo $risk->actualClosedDate == '0000-00-00' ? '' : $risk->actualClosedDate;?></td>
  138. </tr>
  139. </tbody>
  140. </table>
  141. </div>
  142. <div class='tab-pane' id='legendLifeTime'>
  143. <table class="table table-data">
  144. <tbody>
  145. <tr>
  146. <th class='liftTime-assignedTo'><?php echo $lang->risk->assignedTo;?></th>
  147. <td><?php echo zget($users, $risk->assignedTo);?></td>
  148. </tr>
  149. <tr>
  150. <th class='w-90px'><?php echo $lang->risk->trackedBy;?></th>
  151. <td><?php echo zget($users, $risk->trackedBy);?></td>
  152. </tr>
  153. <tr>
  154. <th><?php echo $lang->risk->trackedDate;?></th>
  155. <td><?php echo $risk->trackedDate == '0000-00-00' ? '' : $risk->trackedDate;?></td>
  156. </tr>
  157. <tr>
  158. <th class='w-90px'><?php echo $lang->risk->createdBy;?></th>
  159. <td><?php echo zget($users, $risk->createdBy);?></td>
  160. </tr>
  161. <tr>
  162. <th><?php echo $lang->risk->createdDate;?></th>
  163. <td><?php echo $risk->createdDate == '0000-00-00' ? '' : $risk->createdDate;?></td>
  164. </tr>
  165. <tr>
  166. <th class='w-90px'><?php echo $lang->risk->editedBy;?></th>
  167. <td><?php echo zget($users, $risk->editedBy);?></td>
  168. </tr>
  169. <tr>
  170. <th><?php echo $lang->risk->editedDate;?></th>
  171. <td><?php echo $risk->editedDate == '0000-00-00' ? '' : $risk->editedDate;?></td>
  172. </tr>
  173. <tr>
  174. <th><?php echo $lang->risk->assignedDate;?></th>
  175. <td><?php echo $risk->assignedDate == '0000-00-00' ? '' : $risk->assignedDate;?></td>
  176. </tr>
  177. <tr>
  178. <th class='w-90px'><?php echo $lang->risk->resolvedBy;?></th>
  179. <td><?php echo zget($users, $risk->resolvedBy);?></td>
  180. </tr>
  181. <tr>
  182. <th><?php echo $lang->risk->actualClosedDate;?></th>
  183. <td><?php echo $risk->actualClosedDate == '0000-00-00' ? '' : $risk->actualClosedDate;?></td>
  184. </tr>
  185. <tr>
  186. <th class='w-90px'><?php echo $lang->risk->cancelBy;?></th>
  187. <td><?php echo zget($users, $risk->cancelBy);?></td>
  188. </tr>
  189. <tr>
  190. <th><?php echo $lang->risk->cancelDate;?></th>
  191. <td><?php echo $risk->cancelDate == '0000-00-00' ? '' : $risk->cancelDate;?></td>
  192. </tr>
  193. <tr>
  194. <th><?php echo $lang->risk->cancelReason;?></th>
  195. <td><?php echo zget($lang->risk->cancelReasonList, $risk->cancelReason);?></td>
  196. </tr>
  197. <tr>
  198. <th class='w-90px'><?php echo $lang->risk->hangupBy;?></th>
  199. <td><?php echo zget($users, $risk->hangupBy);?></td>
  200. </tr>
  201. <tr>
  202. <th><?php echo $lang->risk->hangupDate;?></th>
  203. <td><?php echo $risk->hangupDate == '0000-00-00' ? '' : $risk->hangupDate;?></td>
  204. </tr>
  205. <tr>
  206. <th class='w-90px'><?php echo $lang->risk->activateBy;?></th>
  207. <td><?php echo zget($users, $risk->activateBy);?></td>
  208. </tr>
  209. <tr>
  210. <th><?php echo $lang->risk->activateDate;?></th>
  211. <td><?php echo $risk->activateDate == '0000-00-00' ? '' : $risk->activateDate;?></td>
  212. </tr>
  213. </tbody>
  214. </table>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <div class="cell">
  220. <div class='tabs'>
  221. <ul class='nav nav-tabs'>
  222. <li class='active'><a href='#legendMisc' data-toggle='tab'><?php echo $lang->risk->legendMisc;?></a></li>
  223. </ul>
  224. <div class='tab-content'>
  225. <div class='tab-pane active' id='legendMisc'>
  226. <table class="table table-data">
  227. <tbody>
  228. <tr>
  229. <th class='misc-linkdedIssues'><?php echo $lang->risk->linkedIssues;?></th>
  230. <td>
  231. <?php
  232. $hasViewIssuePriv = common::hasPriv('issue', 'view');
  233. foreach($linkedIssues as $issueID => $issue)
  234. {
  235. $issueTitle = "#$issueID {$issue->title}";
  236. $issueHtml = $issueTitle;
  237. if($hasViewIssuePriv)
  238. {
  239. $issueLink = $this->createLink('issue', 'view', "issueID=$issueID", '', true);
  240. $issueClass = isonlybody() ? '' : 'iframe';
  241. $issueHtml = html::a($issueLink, $issueTitle, '', "class='$issueClass' data-width='80%'");
  242. }
  243. $issueHtml .= '<br />';
  244. echo $issueHtml;
  245. }
  246. ?>
  247. </td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. <div class="modal fade" id="importToLib">
  258. <div class="modal-dialog mw-500px">
  259. <div class="modal-content">
  260. <div class="modal-header">
  261. <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon icon-close"></i></button>
  262. <h4 class="modal-title"><?php echo $lang->risk->importToLib;?></h4>
  263. </div>
  264. <div class="modal-body">
  265. <form method='post' class='form-ajax' action='<?php echo $this->createLink('risk', 'importToLib', "risk=$risk->id");?>'>
  266. <table class='table table-form'>
  267. <tr>
  268. <th><?php echo $lang->risk->lib;?></th>
  269. <td>
  270. <?php echo html::select('lib', $libs, '', "class='form-control chosen' required");?>
  271. </td>
  272. </tr>
  273. <?php if(!common::hasPriv('assetlib', 'approveStory') and !common::hasPriv('assetlib', 'batchApproveStory')):?>
  274. <tr>
  275. <th><?php echo $lang->risk->approver;?></th>
  276. <td>
  277. <?php echo html::select('assignedTo', $approvers, '', "class='form-control chosen'");?>
  278. </td>
  279. </tr>
  280. <?php endif;?>
  281. <tr>
  282. <td colspan='2' class='text-center'>
  283. <?php echo html::submitButton($lang->import, '', 'btn btn-primary');?>
  284. </td>
  285. </tr>
  286. </table>
  287. </form>
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. <div id="mainActions" class='main-actions'>
  293. <?php common::printPreAndNext($preAndNext, $this->createLink('risk', 'view', "riskID=%s&from=$from"));?>
  294. </div>
  295. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>