123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- 'use strict';
- angular.module('fehlerberichtApp').filter("euro", function () {
- return function (num) {
- if (num !== null) {
- return num.toFixed(2).toString().replace(".", ",");
- }
- return "0,00";
- };
- });
- angular.module('fehlerberichtApp')
- .controller('TicketsCtrl', function ($scope, $http) {
- var webservice = 'http://rbs06:8090/fehlerbericht/db.php?';
- $scope.current = {};
- $scope.domain = {
- 'status': [
- "offen",
- "in Bearbeitung",
- "zurückgestellt",
- "Rücksprache mit Kunde",
- "erledigt"
- ],
- 'statusicon': {
- '0': "glyphicon-folder-open",
- '1': "glyphicon-user",
- '2': "glyphicon-time",
- '3': "glyphicon-earphone",
- '4': "glyphicon-ok"
- },
- 'prioritaet': {
- '5': "sehr hoch",
- '4': "hoch",
- '0': "normal",
- '1': "niedrig"
- },
- 'prioritaeticon': {
- '0': "glyphicon-minus",
- '1': "glyphicon-chevron-down",
- '4': "glyphicon-chevron-up",
- '5': "glyphicon-fire"
- },
- 'fortschritt': [
- '0',
- '25',
- '50',
- '90',
- '100'
- ],
- 'kategorie': [
- "Anpassung",
- "Fehlersuche",
- "Installation",
- "Serverumzug",
- "Support"
- ],
- 'programm': [
- "Allgemein",
- "Finanzteil",
- "GCHR",
- "Monteurliste",
- "Operativteil",
- "Planung",
- "SPP",
- "Starter/Struct",
- "Tasks/Workflow",
- "Versand/Portal",
- "Excel-Makros",
- "Forderung",
- "Provision"
- ],
- 'kunde': []
- };
- $scope.benutzer = window.localStorage.getItem("Benutzer");
- $scope.heute = moment().format('YYYY-MM-DD');
- $scope.Filter = {
- 'benutzer': $scope.benutzer
- };
- $scope.tickets = [];
- $http.get(webservice + 'a=benutzer').success(function (data) {
- $scope.domain.benutzer = _.unique(_.pluck(data, 'benutzer'));
- });
- $http.get(webservice + 'a=kunden').success(function (data) {
- $scope.domain.kunde = _.unique(_.pluck(data, 'kunde'));
- });
- $http.get(webservice + 'a=tickets').success(function (data) {
- $scope.tickets = data;
- });
- $scope.newTicket = function () {
- $scope.current = {
- 'id': "",
- 'datum': $scope.heute,
- 'benutzer': $scope.benutzer,
- 'kunde': "",
- 'kontakt': "",
- 'beschreibung': "",
- 'termin': "",
- 'dauer': "01:00:00",
- 'status': "0",
- 'prioritaet': "0",
- 'fortschritt': "0",
- 'kategorie': "0",
- 'programm': "0",
- 'kommentar': ""
- };
- };
- $scope.saveTicket = function () {
- $http.put(webservice + 'a=tickets&id=' + $scope.current.id, $scope.current).success(function (data) {
- $scope.tickets = data;
- });
- };
- });
|