3 * Show Release Notes/ChangeLog Page
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright 2010 (c) FusionForge Team
8 * Copyright 2014, Franck Villaume - TrivialDev
9 * http://fusionforge.org/
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 /* please do not add require here : use www/frs/index.php to add require */
28 /* global variables used */
29 global $group_id; // id of group
30 global $HTML; // html object
32 $release_id = getIntFromRequest('release_id');
34 $frsr = frsrelease_get_object($release_id);
35 if (!$frsr || !is_object($frsr)) {
36 exit_error(_('That Release Was Not Found'), 'frs');
37 } elseif ($frsr->isError()) {
38 exit_error($frsr->getErrorMessage(), 'frs');
41 // Members of projects can see all packages
42 // Non-members can only see public packages
43 if(!$frsr->getFRSPackage()->isPublic()) {
44 if (!session_loggedin() || (!session_get_user()->isMember($group_id) &&
45 !forge_check_global_perm('forge_admin'))) {
46 exit_permission_denied();
50 echo html_e('h2', array(), _('File Release Notes and Changelog'));
51 echo html_e('h3', array(), _('Release Name')._(': ').util_make_link('/frs/?group_id='.$group_id.'&release_id='.$release_id, $frsr->getName()));
54 $package_release_votes = $frsr->getVotes();
55 if ($package_release_votes[1]) {
56 echo html_e('span', array('id' => 'frs_release-votes'), html_e('strong', array(), _('Votes') . _(': ')).sprintf('%1$d/%2$d (%3$d%%)', $package_release_votes[0], $package_release_votes[1], $package_release_votes[2]));
57 if ($frsr->canVote()) {
58 if ($frsr->hasVote()) {
59 $key = 'pointer_down';
60 $txt = _('Retract Vote');
63 $txt = _('Cast Vote');
65 echo util_make_link('/frs/?group_id='.$group_id.'&package_id='.$frsr->getFRSPackage()->getID().'&release_id='.$release_id.'&action='.$key.'&view=shownotes', html_image('ic/'.$key.'.png', 16, 16), array('id' => 'frsrelease-vote', 'alt' => $txt));
69 if (forge_get_config('use_object_associations')) {
70 echo html_ao('div', array('id' => 'tabber'));
71 $elementsLi = array();
72 $elementsLi[] = array('content' => util_make_link('#tabber-changelog', _('Change Log & Notes'), array('title' => _('View Changelog & Notes.')), true));
74 if ($frsr->getAssociationCounter()) {
75 $anf = ' ('.$frsr->getAssociationCounter().')';
77 $elementsLi[] = array('content' => util_make_link('#tabber-association', _('Associations').$anf, array('title' => _('View Associated Objects.')), true));
78 echo $HTML->html_list($elementsLi);
79 echo html_ao('div', array('id' => 'tabber-changelog', 'class' => 'tabbertab'));
81 // Show preformatted or plain notes/changes
82 if ($frsr->getPreformatted()) {
88 if (strlen($frsr->getNotes())) {
89 echo $HTML->boxTop(_('Release Notes'));
90 echo html_e($htmltag, array(), util_gen_cross_ref($frsr->getNotes(), $group_id), false, false);
91 echo $HTML->boxBottom();
93 echo $HTML->information(_('No release notes'));
96 if (strlen($frsr->getChanges())) {
97 echo $HTML->boxTop(_('Change Log'));
98 echo html_e($htmltag, array(), util_gen_cross_ref($frsr->getChanges(), $group_id), false, false);
99 echo $HTML->boxBottom();
101 echo $HTML->information(_('No change log'));
104 if (forge_get_config('use_object_associations')) {
105 echo html_ac(html_ap() -1);
106 echo html_e('div', array('id' => 'tabber-association', 'class' => 'tabbertab'), $frsr->showAssociations());
107 echo html_ac(html_ap() -1);