Skip to content

Commit

Permalink
MassAction plugin on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis POKORSKI committed Dec 15, 2020
0 parents commit d59a029
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
55 changes: 55 additions & 0 deletions MassAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Created by PhpStorm.
* User: apokorski
* Date: 26/07/2018
* Time: 11:27
*/

class MassActionPlugin extends MantisPlugin {

/**
* A method that populates the plugin information and minimum requirements.
* @return void
*/
function register() {
$this->name = 'Copie des actions de masse';
$this->description = 'Copie les actions de masses en haut du tableau d\'affichage des fiches.';

$this->version = '1.0';
$this->requires = array(
'MantisCore' => '2.0.0',
);

$this->author = 'Alexis POKORSKI';
$this->contact = '';
$this->url = '';
}

/**
* Event hook declaration.
* @return array
*/
function hooks(){
return array(
"EVENT_LAYOUT_RESOURCES" => 'ressources',
'EVENT_MENU_FILTER'=>'reporting_menu'
);
}

/**
* Include massAction.
*/
function reporting_menu(){
include('pages/menuActions.php');
}

/**
* Include js function.
*/
function ressources() {
if(basename($_SERVER['PHP_SELF']) === 'view_all_bug_page.php'){
echo '<script src="'. plugin_file('UpdateSelected.js') . '" ></script>';
}
}
}
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
MassAction
=============
## Description

Mantis Bug Tracker plugin which copy bottom mass action on the top.

Are you tired of having to scroll all the way to the bottom of the page of all tickets to perform group actions ?

Use this plugin !

## Repository Information

| Branch | Description |
| ------------------------------------------------------------ | ------------------------------------------------------ |
| [master](https://github.com/VirusTwo/MassAction) | Support for MantisBT 2.x (current production version). |


## Installation

1. Download the files and place the folder `MassAction` in the directory `plugins/` of your Mantis installation.
2. With administrator privileges, go to the page *"Manage"* / *"Manage Plugins"*
3. In the list *"Available Plugins"*, you should see *"MassAction"*: click the install link for the plugin.

The MassAction plugin is now available.

## Change Log

## Screenshots & Gif :

What change mass action plugin ? :
![AutoAddUsersScreen](https://github.com/VirusTwo/MassAction/blob/master/screenshots/MassActionPlugin.PNG)
9 changes: 9 additions & 0 deletions files/UpdateSelected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$(document).ready( function() {
$('select[name="action2"]').on('change', function() {
$('select[name="action"]').val(this.value)
});

$('select[name="action"]').on('change', function() {
$('select[name="action2"]').val(this.value)
});
});
22 changes: 22 additions & 0 deletions pages/menuActions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<form id="bug_action" method="post" action="bug_actiongroup_page.php">
<?php
# -- ====================== MASS BUG MANIPULATION =================== --
# @@@ ideally buglist-footer would be in <tfoot>, but that's not possible due to global g_checkboxes_exist set via write_bug_rows()
?>
<div class="form-inline pull-right">
<?php
echo '<label class="inline">';
echo '<input class="ace check_all input-sm" type="checkbox" id="bug_arr_all" name="bug_arr_all" value="all" />';
echo '<span class="lbl padding-6">' . lang_get( 'select_all' ) . ' </span > ';
echo '</label>';
?>

<select name="action2" class="input-sm">
<?php print_all_bug_action_option_list()?>
</select>

<button type="submit" class="btn btn-primary btn-white btn-sm btn-round pull-right" formaction="bug_actiongroup_page.php"> <?php echo lang_get('ok'); ?> </button>
</div>
<?php # -- ====================== end of MASS BUG MANIPULATION ========================= -- ?>
</form>

Binary file added screenshots/MassActionPlugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d59a029

Please sign in to comment.