Skip to content

Instantly share code, notes, and snippets.

@ChristianPeters
Last active December 10, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChristianPeters/a060d1a514ac15a0566a to your computer and use it in GitHub Desktop.
Save ChristianPeters/a060d1a514ac15a0566a to your computer and use it in GitHub Desktop.
Export eines Sprints aus Targetprocess zur Dokumentation von Sprintplanung und Sprintreview/Abnahme
$(function() {
addPerformModificationsButton = function(mode) {
var button;
button = $('<a class="button-box x-button user-action button small ui-print__controls__print" role="button"></a>');
if (mode == 'planning')
button.append('<span class="">Zu Planungsdokumentation konvertieren</span>');
else if (mode == 'review')
button.append('<span class="">Zu Abnahmedokumentation konvertieren</span>');
$('body').prepend(button);
button.click(function() {
applyModifications(mode);
});
}
tableHeaderTemplate = function() {
var html;
html = '<th class="tau-list__table__cell-id">ID</th>';
html += '<th class="tau-list__table__cell-name">Titel</th>';
html += '<th class="tau-list__table__cell-effort">Komplexität</th>';
return html;
}
applyModifications = function(mode) {
var effort;
effort = $('.ui-additionalinfo__value .effort').text();
effort = effort.replace(/pt/, 'SP');
effort = effort.replace('.', ',');
// Header
//-------
// Title
$('.tau-entity-icon--iteration').remove();
$('.view-header__wrap .entity-id').remove();
var title;
title = $('.view-header__entity-title');
if (mode == 'planning') {
document.title = 'Liste geplanter User Stories ' + title.text();
title.prepend('Geplante User Stories ');
} else if (mode == 'review') {
document.title = 'Liste abgenommener User Stories ' + title.text();
title.prepend('Abgenommene User Stories ');
}
// Follow Link
$('.view-header__link').remove();
// Iteration Description
$('#entitygeneralinfo146 .ui-label:contains("Description")').parent().parent().remove();
// Converting "User Stories" to "Summe: 35,5 SP"
var label;
label = $('.ui-label:contains("User Stories")');
label.css('padding-bottom', 0);
label.css('font-size', '14px');
label.css('float', 'right');
label.css('margin-right', '4px');
label.text('Summe: ' + effort);
// Content
//--------
$('.tau-list__table__cell-dragdrop').remove();
$('.tau-list__table__row_isfinalstate_true .tau-list__table__cell-id').css('opacity', '1.0');
$('.tau-list__table__row_isfinalstate_true .tau-list__table__cell-name').css('opacity', '1.0').css('color', 'black');
$('.tau-list__content .tau-list__table').first().prepend(tableHeaderTemplate()); // NOTE: It's a list and each li has a table
$('.tau-list__table__cell-state').remove();
$('.tau-list__table__cell-priority').remove();
$('.tau-list__table__cell-assignments').remove();
$('.tau-list__table__cell-effort').css('width', '75px');
$('.tau-list__table__cell-effort').each(function() {
entryText = $(this).text();
entryText = entryText.replace(/pt/, ' SP');
entryText = entryText.replace('.', ',');
$(this).text(entryText);
});
$('.tau-list__table__cell-progress').remove();
$('.tau-action-link').removeClass('tau-action-link');
// Sidebar and buttons
//--------------------
$('#entityadditionalinfo147').remove();
$('.button').remove();
}
if(document.URL.match(/iteration\/\d*\/print/)) {
$(document).ready(function() {
addPerformModificationsButton('planning');
addPerformModificationsButton('review');
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment