Skip to content

Commit f3ed276

Browse files
committed
Merge branch 'master' into duplicate
# Conflicts: # event/listener.php
2 parents ca72f14 + b916ecc commit f3ed276

12 files changed

Lines changed: 91 additions & 28 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# phpBB Ideas
22

3-
phpBB Ideas is an ideas centre for phpBB 3.2. It is based on [WordPress ideas](http://wordpress.org/extend/ideas/), and allows users to suggest and vote on "ideas" that would help improve and enhance phpBB.
3+
The official Ideas Centre used at [phpBB.com](https://www.phpbb.com/ideas/). This phpBB extension allows community members to suggest and vote on ideas that can help to improve and enhance phpBB software.
44

55
[![Build Status](https://travis-ci.org/phpbb/ideas.svg?branch=master)](https://travis-ci.org/phpbb/ideas)
66

@@ -23,4 +23,4 @@ Support is not available for phpBB Ideas however you may email `website [at] php
2323
Note: This extension is currently under development and is not recommended for use on any live forum.
2424

2525
## License
26-
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)
26+
[GNU General Public License v2](license.txt)

acp/ideas_module.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212

1313
class ideas_module
1414
{
15+
/** @var string */
16+
public $page_title;
17+
18+
/** @var string */
19+
public $tpl_name;
20+
1521
/** @var string */
1622
public $u_action;
1723

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "phpbb/ideas",
33
"type": "phpbb-extension",
4-
"description": "phpBB Ideas centre for phpBB 3.2.",
4+
"description": "phpBB Ideas centre",
55
"homepage": "https://www.phpbb.com",
66
"version": "2.2.2-dev",
77
"license": "GPL-2.0-only",

event/listener.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function clean_message($event)
128128

129129
// This freakish looking regex pattern should
130130
// remove the old ideas link-backs from the message.
131-
$message = preg_replace('/(<br[^>]*>\\n?)\\1-{10}\\1\\1.*]/s', '', $message);
131+
$message = preg_replace('/(<br[^>]*>\\n?)?\\1?-{10}\\1?\\1?.*]/s', '', $message);
132132

133133
$post_row['MESSAGE'] = $message;
134134
$event['post_row'] = $post_row;
@@ -228,15 +228,12 @@ public function show_idea($event)
228228
'IDEA_POINTS' => $points,
229229
'IDEA_STATUS_ID' => $idea['idea_status'],
230230
'IDEA_STATUS_NAME' => $this->ideas->get_status_from_id($idea['idea_status']),
231-
'IDEA_STATUS_LINK' => $this->helper->route('phpbb_ideas_list_controller', array('status' => $idea['idea_status'])),
232231

233232
'IDEA_DUPLICATE' => $idea['duplicate_id'] ? $this->ideas->get_title($idea['duplicate_id']) : '',
234233
'IDEA_RFC' => $idea['rfc_link'],
235234
'IDEA_TICKET' => $idea['ticket_id'],
236235
'IDEA_IMPLEMENTED' => $idea['implemented_version'],
237236

238-
'U_IDEA_DUPLICATE' => $this->link_helper->get_idea_link((int) $idea['duplicate_id']),
239-
240237
'S_IS_MOD' => $mod,
241238
'S_CAN_EDIT' => $mod || $own,
242239
'S_CAN_VOTE' => $can_vote,
@@ -253,6 +250,8 @@ public function show_idea($event)
253250
'U_EDIT_TICKET' => $this->link_helper->get_idea_link($idea['idea_id'], 'ticket', true),
254251
'U_REMOVE_VOTE' => $this->link_helper->get_idea_link($idea['idea_id'], 'removevote', true),
255252
'U_IDEA_VOTE' => $this->link_helper->get_idea_link($idea['idea_id'], 'vote', true),
253+
'U_IDEA_DUPLICATE' => $this->link_helper->get_idea_link($idea['duplicate_id']),
254+
'U_IDEA_STATUS_LINK'=> $this->helper->route('phpbb_ideas_list_controller', array('status' => $idea['idea_status'])),
256255
'U_TITLE_LIVESEARCH'=> $this->helper->route('phpbb_ideas_livesearch_controller'),
257256
));
258257

license.txt

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
GNU GENERAL PUBLIC LICENSE
2-
Version 2, June 1991
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 2, June 1991
33

4-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5-
675 Mass Ave, Cambridge, MA 02139, USA
4+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
66
Everyone is permitted to copy and distribute verbatim copies
77
of this license document, but changing it is not allowed.
88

9-
Preamble
9+
Preamble
1010

1111
The licenses for most software are designed to take away your
1212
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
1515
General Public License applies to most of the Free Software
1616
Foundation's software and to any other program whose authors commit to
1717
using it. (Some other Free Software Foundation software is covered by
18-
the GNU Library General Public License instead.) You can apply it to
18+
the GNU Lesser General Public License instead.) You can apply it to
1919
your programs, too.
2020

2121
When we speak of free software, we are referring to freedom, not
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
5656
The precise terms and conditions for copying, distribution and
5757
modification follow.
5858

59-
GNU GENERAL PUBLIC LICENSE
59+
GNU GENERAL PUBLIC LICENSE
6060
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
6161

6262
0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
255255
of preserving the free status of all derivatives of our free software and
256256
of promoting the sharing and reuse of software generally.
257257

258-
NO WARRANTY
258+
NO WARRANTY
259259

260260
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,4 +277,63 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278278
POSSIBILITY OF SUCH DAMAGES.
279279

280-
END OF TERMS AND CONDITIONS
280+
END OF TERMS AND CONDITIONS
281+
282+
How to Apply These Terms to Your New Programs
283+
284+
If you develop a new program, and you want it to be of the greatest
285+
possible use to the public, the best way to achieve this is to make it
286+
free software which everyone can redistribute and change under these terms.
287+
288+
To do so, attach the following notices to the program. It is safest
289+
to attach them to the start of each source file to most effectively
290+
convey the exclusion of warranty; and each file should have at least
291+
the "copyright" line and a pointer to where the full notice is found.
292+
293+
<one line to give the program's name and a brief idea of what it does.>
294+
Copyright (C) <year> <name of author>
295+
296+
This program is free software; you can redistribute it and/or modify
297+
it under the terms of the GNU General Public License as published by
298+
the Free Software Foundation; either version 2 of the License, or
299+
(at your option) any later version.
300+
301+
This program is distributed in the hope that it will be useful,
302+
but WITHOUT ANY WARRANTY; without even the implied warranty of
303+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304+
GNU General Public License for more details.
305+
306+
You should have received a copy of the GNU General Public License along
307+
with this program; if not, write to the Free Software Foundation, Inc.,
308+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309+
310+
Also add information on how to contact you by electronic and paper mail.
311+
312+
If the program is interactive, make it output a short notice like this
313+
when it starts in an interactive mode:
314+
315+
Gnomovision version 69, Copyright (C) year name of author
316+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317+
This is free software, and you are welcome to redistribute it
318+
under certain conditions; type `show c' for details.
319+
320+
The hypothetical commands `show w' and `show c' should show the appropriate
321+
parts of the General Public License. Of course, the commands you use may
322+
be called something other than `show w' and `show c'; they could even be
323+
mouse-clicks or menu items--whatever suits your program.
324+
325+
You should also get your employer (if you work as a programmer) or your
326+
school, if any, to sign a "copyright disclaimer" for the program, if
327+
necessary. Here is a sample; alter the names:
328+
329+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
331+
332+
<signature of Ty Coon>, 1 April 1989
333+
Ty Coon, President of Vice
334+
335+
This General Public License does not permit incorporating your program into
336+
proprietary programs. If your program is a subroutine library, you may
337+
consider it more useful to permit linking proprietary applications with the
338+
library. If this is what you want to do, use the GNU Lesser General
339+
Public License instead of this License.

styles/prosilver/template/idea_body.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
</div>
4848
</dd>
4949
<dt class="idealabel">{{ lang('STATUS') ~ lang('COLON') }}</dt>
50-
<dd class="status-dropdown-container dropdown-container">
50+
<dd class="status-dropdown-container dropdown-container dropdown-{S_CONTENT_FLOW_END}">
5151
<span class="status-badge status-{{ IDEA_STATUS_ID }}">
52-
<a href="{{ IDEA_STATUS_LINK }}" id="status-link"><i class="icon fa-fw {{ ideas_status_icon(IDEA_STATUS_ID) }}"></i>{{ IDEA_STATUS_NAME }}</a>
52+
<a href="{{ U_IDEA_STATUS_LINK }}" id="status-link"><i class="icon fa-fw {{ ideas_status_icon(IDEA_STATUS_ID) }}"></i>{{ IDEA_STATUS_NAME }}</a>
5353
{% if STATUS_ARY %}
5454
<a href="#" class="dropdown-trigger"><i class="icon fa-fw fa-caret-down"></i></a>
5555
{% endif %}

styles/prosilver/theme/ideas.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ dd.topics {
213213
}
214214

215215
.idea-panel {
216-
line-height: 1.48em;
216+
line-height: 16px;
217217
width: 100%;
218218
}
219219

tests/controller/index_controller_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public function controller_exception_test_data()
5858
* Basic controller exception test
5959
*
6060
* @dataProvider controller_exception_test_data
61-
* @expectedException \phpbb\exception\http_exception
6261
*/
6362
public function test_controller_exception($forum)
6463
{
64+
$this->expectException(\phpbb\exception\http_exception::class);
6565
$this->config['ideas_forum_id'] = $forum;
6666

6767
/** @var \phpbb\ideas\controller\index_controller $controller */

tests/controller/list_controller_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ public function controller_exception_test_data()
189189
* Basic controller exception test
190190
*
191191
* @dataProvider controller_exception_test_data
192-
* @expectedException \phpbb\exception\http_exception
193192
*/
194193
public function test_controller_exception($forum)
195194
{
195+
$this->expectException(\phpbb\exception\http_exception::class);
196196
$this->config['ideas_forum_id'] = $forum;
197197

198198
/** @var \phpbb\ideas\controller\list_controller $controller */

tests/functional/ideas_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function test_new_idea()
4444
$this->assertContains($this->lang('IDEAS'), $crawler->filter('#nav-breadcrumbs')->text());
4545
$this->assertContains($idea['title'], $crawler->filter('h2')->text());
4646
$this->assertContains($idea['message'], $crawler->filter('.content')->text());
47-
$this->assertContains('1', $crawler->filter('.rating > .vote-up')->text());
48-
$this->assertContains('0', $crawler->filter('.rating > .vote-down')->text());
47+
$this->assertStringContainsString('1', $crawler->filter('.rating > .vote-up')->text());
48+
$this->assertStringContainsString('0', $crawler->filter('.rating > .vote-down')->text());
4949
}
5050

5151
/**
@@ -131,7 +131,7 @@ public function create_idea($title, $message)
131131

132132
// Submit and verify success
133133
$crawler = self::submit($form);
134-
$this->assertContains($data['title'], $crawler->filter('h2')->text());
134+
$this->assertStringContainsString($data['title'], $crawler->filter('h2')->text());
135135

136136
// Get the new idea's ID and add it to the data array
137137
$url = $crawler->selectLink($this->lang('REMOVE_VOTE'))->link()->getUri();

0 commit comments

Comments
 (0)