Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite of different stuff #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
## Scrum plugin Revision History

### V0.4 - 2017-12-21

* Add settings page, there also save, change values.
* Rewrite of settings default, so that is easier to save it.
* Add function to save settings without redundant source.
* Clean up stylesheets for scrum overview.
* Each Issue on the Scrum Board use his status color to more illustrate.
* Fix different source topics.
* Add Status view, each first string of the status, to the issue.

### v0.3 - 2014-11-10

- Configuration page
- Fall back to default color for undefined severity/resolution
- Board column headers can now be localized
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Scrum Board plugin for MantisBT

Copyright (c) 2011 - 2012 John Reese - http://noswap.com
Copyright (c) 2012 - 2014 MantisBT Team - [email protected]
Copyright (c) 2012 - 2018 MantisBT Team - [email protected]

Released under the [MIT license](http://opensource.org/licenses/MIT)

Expand All @@ -13,15 +13,19 @@ See the [Changelog](https://github.com/mantisbt-plugins/scrum/blob/config/CHANGE
Adds a Scrum board based on Status, Category, and Target Version
to MantisBT.

![MantisBT Scrum Board page](./scrum-plugin-board.png)


## Requirements

The plugin requires [MantisBT](http://www.mantisbt.org/) version 1.2.6 or higher.
The plugin requires [MantisBT](http://www.mantisbt.org/) version 1.2.6 or higher and PHP 5.6.

If the [Source Integration plugin](https://github.com/mantisbt-plugins/source-integration)
(version 0.16 or higher) is installed, the cards will display the number of
changesets attached to each issue.

The plugin is currently only tested with MantisBT 1.2*.


## Installation

Expand All @@ -32,6 +36,7 @@ changesets attached to each issue.
*Manage -> Manage Plugins*.
4. In the *Available Plugins* list, you'll find the *Scrum* plugin;
click the **Install** link.
5. All settings are available after click on the plugin in the Plugin list.


## Usage
Expand Down
118 changes: 68 additions & 50 deletions Scrum/Scrum.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

# Copyright (c) 2011 John Reese
# Copyright (c) 2011-2018 John Reese
# Licensed under the MIT license

class ScrumPlugin extends MantisPlugin
{
class ScrumPlugin extends MantisPlugin {

const TOKEN_SCRUM_VERSION = 101;
const TOKEN_SCRUM_CATEGORY = 102;

Expand All @@ -13,78 +13,96 @@ class ScrumPlugin extends MantisPlugin
const DURATION_DAY = 86400;
const DURATION_WEEK = 604800;

public function register()
{
$this->name = plugin_lang_get("title");
$this->description = plugin_lang_get("description");
$this->page = 'config_page';
public function register() {

$this->name = plugin_lang_get( 'title' );
$this->description = plugin_lang_get( 'description' );
$this->page = 'config_page';

$this->version = "0.3";
$this->version = '0.4';
$this->requires = array(
"MantisCore" => "1.2.6",
'MantisCore' => '1.2.6',
);
$this->uses = array(
"Source" => "0.16",
$this->uses = array(
'Source' => '0.16',
);

$this->author = "John Reese";
$this->contact = "[email protected]";
$this->url = "https://github.com/mantisbt-plugins/scrum";
$this->author = 'John Reese';
$this->contact = '[email protected]';
$this->url = 'https://github.com/mantisbt-plugins/scrum';
}

public function config()
{
public function config() {

return array(
#$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';
"board_columns" => array(
"new" => array(10, 20, 30),
"confirmed" => array(40, 50),
"resolved" => array(80),
'board_columns' => array(
'new' => array( 10, 20, 30 ),
'confirmed' => array( 40, 50, 85 ),
'resolved' => array( 80, 88 ),
),

#$g_severity_enum_string = '10:feature,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block';
"board_severity_colors" => array(
10 => "green",
20 => "green",
30 => "green",
40 => "green",
50 => "gray",
60 => "gray",
70 => "orange",
80 => "red",
'board_severity_colors' => array(
10 => 'green',
20 => 'green',
30 => 'green',
40 => 'green',
50 => 'gray',
60 => 'gray',
70 => 'orange',
80 => 'red',
),

#$g_resolution_enum_string = '10:open,20:fixed,30:reopened,40:unable to duplicate,50:not fixable,60:duplicate,70:not a bug,80:suspended,90:wont fix';
"board_resolution_colors" => array(
10 => "orange",
20 => "green",
30 => "red",
40 => "gray",
50 => "gray",
60 => "gray",
70 => "gray",
80 => "gray",
90 => "gray",
'board_resolution_colors' => array(
10 => 'orange',
20 => 'green',
30 => 'red',
40 => 'gray',
50 => 'gray',
60 => 'gray',
70 => 'gray',
80 => 'gray',
90 => 'gray',
),

"token_expiry" => 30 * ScrumPlugin::DURATION_DAY,
"sprint_length" => 14 * ScrumPlugin::DURATION_DAY,
"show_empty_status" => OFF,
'token_expiry' => 30,
'board_sprint_length' => 14,
'show_empty_status' => false,
);
}

public function hooks()
{
public function hooks() {

return array(
"EVENT_MENU_MAIN" => "menu",
'EVENT_MENU_MAIN' => 'menu',
);
}

public function menu($event)
{
$links = array();
$links[] = '<a href="' . plugin_page("board") . '">' . plugin_lang_get("board") . '</a>';
public function menu() {

$links = array();
$links[] = '<a href="' . plugin_page( 'board' ) . '">' . plugin_lang_get( 'board' ) . '</a>';

return $links;
}

/**
* Set configuration option, if different to the current value.
*
* @param $option string Name of the option inside the database.
* @param $value mixed Value of the option.
*
* @return bool True if is changed and false, no change necessary.
*/
public function config_set( $option, $value ) {

if ( plugin_config_get( $option ) !== $value ) {
plugin_config_set( $option, $value );
return true;
}

return false;
}
}
23 changes: 16 additions & 7 deletions Scrum/files/scrumboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ div.scrumbar span {
}

div.scrumbar span.bar {
padding: 0.5em 0em;
padding: 0.5em 0;
background: #d2f5b0;
}

table.scrumboard {
}

td.scrumcolumn {
padding: 4px;
vertical-align: top;
Expand All @@ -31,18 +34,15 @@ td.scrumcolumn {
td.scrumcolumn hr {
clear: both;
border: 0;
border-bottom: 1px dotted #aaa;
border-bottom: 2px dotted #f4f4f4;
height: 6px;
}

div.scrumblock {
float: left;
width: 230px;
margin: 4px;

background: #FAF3AA;
border: 1px solid black;

text-align: center;
overflow: hidden;
}
Expand All @@ -63,14 +63,23 @@ div.scrumblock p.commits {

div.scrumblock p.category {
font-weight: bold;
height: 1.4em;
overflow: hidden;
}

div.scrumblock p.status {
float: right;
width: 1.2em;
height: 1.2em;
border: 1px solid black;
}

div.scrumblock p.summary {
clear: both;
width: 100%;
height: 5em;
border-top: 1px solid #e7df8a;
border-bottom: 1px solid #e7df8a;
border-top: 1px solid #f4f4f4;
border-bottom: 1px solid #f4f4f4;
padding-top: 3px;
text-align: left;
overflow: hidden;
Expand Down
8 changes: 4 additions & 4 deletions Scrum/lang/strings_english.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

# Copyright (c) 2011 John Reese
# Copyright (c) 2011-2018 John Reese
# Licensed under the MIT license

$s_plugin_Scrum_ = '';
Expand Down Expand Up @@ -29,9 +29,9 @@ $s_plugin_Scrum_reference_enum = 'Reference enumeration (%s):<br>%s';
$s_plugin_Scrum_board_severity_colors_label = 'Board Severity Colors';
$s_plugin_Scrum_board_resolution_colors_label = 'Board Resolution Colors';
$s_plugin_Scrum_color = 'Color';
$s_plugin_Scrum_colors_info = 'Define the colors assigned to each <i>%s</i>, as a comma-delimited list of elements with the form &lt;<i>Code</i>:<i>Color</i>&gt;.<br>Note: undefined codes will display in white on the Cards. You can either use standard CSS color names or hex values.';
$s_plugin_Scrum_sprint_length_label = 'Sprint Length';
$s_plugin_Scrum_sprint_length_info = 'The duration of the Sprint in days';
$s_plugin_Scrum_colors_info = 'Define the colors assigned to each <i>%s</i>, as a comma-delimited list of elements with the form <code>"Code":"Color"</code>.<br>Note: undefined codes will display in white on the Cards. You can either use standard CSS color names or hex values.';
$s_plugin_Scrum_board_sprint_length_label = 'Sprint Length';
$s_plugin_Scrum_board_sprint_length_info = 'The duration of the Sprint in days';
$s_plugin_Scrum_show_empty_status_label = 'Always show Status';
$s_plugin_Scrum_show_empty_status_info = 'If checked, the Status is displayed even if does not contain any Cards';
$s_plugin_Scrum_token_expiry_label = 'Token Expiry';
Expand Down
Loading