Skip to content

Instantly share code, notes, and snippets.

@DevertNet
Last active January 14, 2019 12:21
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 DevertNet/88c02c95c2eb3a5d2b096f8d76c57c68 to your computer and use it in GitHub Desktop.
Save DevertNet/88c02c95c2eb3a5d2b096f8d76c57c68 to your computer and use it in GitHub Desktop.
/*
Bericht für den heutigen Tag exportieren.
Porjekt öffnen, in den Tab "Tickets" wechseln, Datum in Code Ändern und in der Konsole abfeuern...
*/
var today = 0;
var all = '';
jQuery('.issuecalendar').each(function(e) {
if (typeof jQuery(this).attr('data-date') == 'undefined') return;
var date = new Date(parseInt(jQuery(this).attr('data-date')) * 1000);
var day = date.toISOString().split('T')[0].split('-')[2];
var date = date.toISOString().split('T')[0];
if (date != '2019-01-14') return;
var housrs = parseFloat(jQuery(this).parents('.date').find('> .hours').eq(1).html().replace(',', '.'));
var title = jQuery(this).parents('.date').prevAll('.issue').eq(0).find('> td').html().trim().split('</a> ')[1] + ' (Aufwand: ' + housrs + ' Std.)';
today += housrs;
jQuery.ajax(jQuery(this).parents('.date').prevAll('.issue').eq(0).find('> td > a').attr('href'))
.done(function(e) {
var found = false;
all += title + "\n";
jQuery(e).find('.issuehistory .comment .view').each(function() {
if (jQuery(this).html().trim() == '' || found) return;
found = true;
all += jQuery(this).text().trim() + "\n\n";
console.log(all + "\n" + 'Gesamtaufwand: ' + today + ' Std.');
});
});
});
/*
Ausgabe sieht so aus:
*/
Kundenlogin / Feld E-Mail Label anpassen (Aufwand: 0.25)
Letzter Comment im Ticket würde hier stehe.
Bestellung xxxxx Rabatt wird nicht in Bestellbestätigung angezeigt (Aufwand: 1)
Letzter Comment im Ticket würde hier stehe.
Mobile / Adresse Ändern Hinweis (Aufwand: 0.5)
Letzter Comment im Ticket würde hier stehe.
DailyDeal / Deals werden deaktiviert (Aufwand: 0.75)
Letzter Comment im Ticket würde hier stehe.
xxxx / Artikel berechnet (Aufwand: 0.75)
Letzter Comment im Ticket würde hier stehe.
Kundenkonto Umsatz anzeigen (Aufwand: 0.5)
Letzter Comment im Ticket würde hier stehe.
Projektmanagment (Aufwand: 0.25)
Letzter Comment im Ticket würde hier stehe.
Gesamtaufwand: 4
/*
TP Planung
*/
var text = '';
var month = '05';
jQuery('.issuedatefield').each(function(e){
if(jQuery(this).val().substr(3,2)!=month) return true;
var date = jQuery(this).val().substr(0,6);
var hours = jQuery(this).parents('tr').find('td').eq(1).find('input').val();
text += date + ' ('+hours+'h), ';
});
console.log(text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment