3 * General Tracker Content Widget Class
5 * Copyright 2016-2017,2021, Franck Villaume - TrivialDev
6 * http://fusionforge.org
8 * This file is a part of Fusionforge.
10 * Fusionforge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * Fusionforge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
24 require_once 'Widget.class.php';
26 class Widget_TrackerGeneral extends Widget {
30 function __construct() {
31 $owner_id = (int)substr(getStringFromRequest('owner'), 1);
33 $owner_id = getIntFromRequest('atid');
35 parent::__construct('trackergeneral', $owner_id, WidgetLayoutManager::OWNER_TYPE_TRACKER);
36 $this->title = _('General Information');
43 function getDescription() {
44 return _('Default widget where general informations are stored & displayed. Open/Modified/Close dates, submitted By, last Modified by.');
47 function isAvailable() {
48 return isset($this->title);
51 function getContent() {
62 $return = html_e('p', array(), _('Submit Instruction'));
63 $renderSubmitInstructions = $ath->renderSubmitInstructions();
64 if (strlen($renderSubmitInstructions) > 0) {
65 $return .= $renderSubmitInstructions;
67 $return .= $HTML->information('No specific instruction');
69 } elseif ($func == 'detail') {
70 $return = $HTML->listTableTop();
72 $cells[][] = html_e('strong', array(), _('Submitted by')._(':'));
73 if($ah->getSubmittedBy() != 100) {
74 $cells[][] = util_display_user($ah->getSubmittedUnixName(), $ah->getSubmittedBy(), $ah->getSubmittedRealName());
76 $cells[][] = $ah->getSubmittedRealName();
78 $return .= $HTML->multiTableRow(array(), $cells);
80 $cells[][] = html_e('strong', array(), _('Date Submitted')._(':'));
81 $cells[][] = date(_('Y-m-d H:i'), $ah->getOpenDate());
82 $return .= $HTML->multiTableRow(array(), $cells);
84 $cells[][] = html_e('strong', array(), _('Last Modified by')._(':'));
85 if($ah->getLastModifiedBy() != 100) {
86 $cells[][] = util_display_user($ah->getLastModifiedUnixName(), $ah->getLastModifiedBy(), $ah->getLastModifiedRealName());
88 $cells[][] = $ah->getLastModifiedRealName();
90 $return .= $HTML->multiTableRow(array(), $cells);
92 $cells[][] = html_e('strong', array(), _('Last Modified')._(':'));
93 $cells[][] = date(_('Y-m-d H:i'), $ah->getLastModifiedDate());
94 $return .= $HTML->multiTableRow(array(), $cells);
95 $close_date = $ah->getCloseDate();
96 if ($ah->getStatusID()==2 && $close_date > 1) {
98 $cells[][] = html_e('strong', array(), _('Date Closed')._(':'));
99 $cells[][] = date(_('Y-m-d H:i'), $close_date);
100 $return .= $HTML->multiTableRow(array(), $cells);
103 $cells[][] = html_e('strong', array(), util_make_link($ah->getPermalink(), _('Permalink'))._(':'));
104 $cells[][] = util_make_url($ah->getPermalink());
105 $return .= $HTML->multiTableRow(array(), $cells);
106 $return .= $HTML->listTableBottom();
111 function canBeRemove() {
115 function canBeMinize() {
119 function getCategory() {
120 return _('Trackers');