Skip to content

Commit

Permalink
OO#513 pendenzen service
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmpp committed Dec 19, 2022
1 parent de48272 commit 38488c4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/scripts/pendenzen/overview/pendenzen.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

/**
*/
angular.module('openolitor-admin')
.factory('PendenzenService', ['$rootScope',
function($rootScope) {
var regexAbo = /Abo Nr.: \d\d\d\d\d|Abo Nr.:\d\d\d\d\d/g;
var regexCode = /\d\d\d\d\d/g;

return {renderText(text ) {
if (text !== undefined) {
var foundValue = text.match(regexAbo);
if (foundValue) {
var code = text.match(regexCode);
var value = text.replace(foundValue, foundValue + ' <a target="_blank" rel="noopener noreferrer" href="#/abos?q=id%3D' + code + '"><i class="glyphicon small glyphicon-new-window"></i></a></b>')
return value;
} else {
return text;
}
} else return '';
}
};
}
]);

0 comments on commit 38488c4

Please sign in to comment.