var $jscomp = $jscomp || {}; $jscomp.scope = {}; $jscomp.ASSUME_ES5 = false; $jscomp.ASSUME_NO_NATIVE_MAP = false; $jscomp.ASSUME_NO_NATIVE_SET = false; $jscomp.defineProperty = $jscomp.ASSUME_ES5 || typeof Object.defineProperties == 'function' ? Object.defineProperty : function(target, property, descriptor) { descriptor = descriptor; if (target == Array.prototype || target == Object.prototype) { return; } target[property] = descriptor.value; }; $jscomp.getGlobal = function(maybeGlobal) { return typeof window != 'undefined' && window === maybeGlobal ? maybeGlobal : typeof global != 'undefined' && global != null ? global : maybeGlobal; }; $jscomp.global = $jscomp.getGlobal(this); $jscomp.polyfill = function(target, polyfill, fromLang, toLang) { if (!polyfill) { return; } var obj = $jscomp.global; var split = target.split('.'); for (var i = 0; i < split.length - 1; i++) { var key = split[i]; if (!(key in obj)) { obj[key] = {}; } obj = obj[key]; } var property = split[split.length - 1]; var orig = obj[property]; var impl = polyfill(orig); if (impl == orig || impl == null) { return; } $jscomp.defineProperty(obj, property, {configurable:true, writable:true, value:impl}); }; $jscomp.polyfill('Array.prototype.copyWithin', function(orig) { if (orig) { return orig; } var polyfill = function(target, start, opt_end) { var len = this.length; target = Number(target); start = Number(start); opt_end = Number(opt_end != null ? opt_end : len); if (target < start) { opt_end = Math.min(opt_end, len); while (start < opt_end) { if (start in this) { this[target++] = this[start++]; } else { delete this[target++]; start++; } } } else { opt_end = Math.min(opt_end, len + start - target); target += opt_end - start; while (opt_end > start) { if (--opt_end in this) { this[--target] = this[opt_end]; } else { delete this[target]; } } } return this; }; return polyfill; }, 'es6', 'es3'); $jscomp.SYMBOL_PREFIX = 'jscomp_symbol_'; $jscomp.initSymbol = function() { $jscomp.initSymbol = function() { }; if (!$jscomp.global['Symbol']) { $jscomp.global['Symbol'] = $jscomp.Symbol; } }; $jscomp.Symbol = function() { var counter = 0; function Symbol(opt_description) { return $jscomp.SYMBOL_PREFIX + (opt_description || '') + counter++; } return Symbol; }(); $jscomp.initSymbolIterator = function() { $jscomp.initSymbol(); var symbolIterator = $jscomp.global['Symbol'].iterator; if (!symbolIterator) { symbolIterator = $jscomp.global['Symbol'].iterator = $jscomp.global['Symbol']('iterator'); } if (typeof Array.prototype[symbolIterator] != 'function') { $jscomp.defineProperty(Array.prototype, symbolIterator, {configurable:true, writable:true, value:function() { return $jscomp.arrayIterator(this); }}); } $jscomp.initSymbolIterator = function() { }; }; $jscomp.arrayIterator = function(array) { var index = 0; return $jscomp.iteratorPrototype(function() { if (index < array.length) { return {done:false, value:array[index++]}; } else { return {done:true}; } }); }; $jscomp.iteratorPrototype = function(next) { $jscomp.initSymbolIterator(); var iterator = {next:next}; iterator[$jscomp.global['Symbol'].iterator] = function() { return this; }; return iterator; }; $jscomp.iteratorFromArray = function(array, transform) { $jscomp.initSymbolIterator(); if (array instanceof String) { array = array + ''; } var i = 0; var iter = {next:function() { if (i < array.length) { var index = i++; return {value:transform(index, array[index]), done:false}; } iter.next = function() { return {done:true, value:void 0}; }; return iter.next(); }}; iter[Symbol.iterator] = function() { return iter; }; return iter; }; $jscomp.polyfill('Array.prototype.entries', function(orig) { if (orig) { return orig; } var polyfill = function() { return $jscomp.iteratorFromArray(this, function(i, v) { return [i, v]; }); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Array.prototype.fill', function(orig) { if (orig) { return orig; } var polyfill = function(value, opt_start, opt_end) { var length = this.length || 0; if (opt_start < 0) { opt_start = Math.max(0, length + opt_start); } if (opt_end == null || opt_end > length) { opt_end = length; } opt_end = Number(opt_end); if (opt_end < 0) { opt_end = Math.max(0, length + opt_end); } for (var i = Number(opt_start || 0); i < opt_end; i++) { this[i] = value; } return this; }; return polyfill; }, 'es6', 'es3'); $jscomp.findInternal = function(array, callback, thisArg) { if (array instanceof String) { array = String(array); } var len = array.length; for (var i = 0; i < len; i++) { var value = array[i]; if (callback.call(thisArg, value, i, array)) { return {i:i, v:value}; } } return {i:-1, v:void 0}; }; $jscomp.polyfill('Array.prototype.find', function(orig) { if (orig) { return orig; } var polyfill = function(callback, opt_thisArg) { return $jscomp.findInternal(this, callback, opt_thisArg).v; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Array.prototype.findIndex', function(orig) { if (orig) { return orig; } var polyfill = function(callback, opt_thisArg) { return $jscomp.findInternal(this, callback, opt_thisArg).i; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Array.from', function(orig) { if (orig) { return orig; } var polyfill = function(arrayLike, opt_mapFn, opt_thisArg) { $jscomp.initSymbolIterator(); opt_mapFn = opt_mapFn != null ? opt_mapFn : function(x) { return x; }; var result = []; var iteratorFunction = arrayLike[Symbol.iterator]; if (typeof iteratorFunction == 'function') { arrayLike = iteratorFunction.call(arrayLike); var next; while (!(next = arrayLike.next()).done) { result.push(opt_mapFn.call(opt_thisArg, next.value)); } } else { var len = arrayLike.length; for (var i = 0; i < len; i++) { result.push(opt_mapFn.call(opt_thisArg, arrayLike[i])); } } return result; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Object.is', function(orig) { if (orig) { return orig; } var polyfill = function(left, right) { if (left === right) { return left !== 0 || 1 / left === 1 / right; } else { return left !== left && right !== right; } }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Array.prototype.includes', function(orig) { if (orig) { return orig; } var includes = function(searchElement, opt_fromIndex) { var array = this; if (array instanceof String) { array = String(array); } var len = array.length; for (var i = opt_fromIndex || 0; i < len; i++) { if (array[i] == searchElement || Object.is(array[i], searchElement)) { return true; } } return false; }; return includes; }, 'es7', 'es3'); $jscomp.polyfill('Array.prototype.keys', function(orig) { if (orig) { return orig; } var polyfill = function() { return $jscomp.iteratorFromArray(this, function(i) { return i; }); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Array.of', function(orig) { if (orig) { return orig; } var polyfill = function(var_args) { return Array.from(arguments); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Array.prototype.values', function(orig) { if (orig) { return orig; } var polyfill = function() { return $jscomp.iteratorFromArray(this, function(k, v) { return v; }); }; return polyfill; }, 'es6', 'es3'); $jscomp.makeIterator = function(iterable) { $jscomp.initSymbolIterator(); var iteratorFunction = iterable[Symbol.iterator]; return iteratorFunction ? iteratorFunction.call(iterable) : $jscomp.arrayIterator(iterable); }; $jscomp.FORCE_POLYFILL_PROMISE = false; $jscomp.polyfill('Promise', function(NativePromise) { if (NativePromise && !$jscomp.FORCE_POLYFILL_PROMISE) { return NativePromise; } function AsyncExecutor() { this.batch_ = null; } AsyncExecutor.prototype.asyncExecute = function(f) { if (this.batch_ == null) { this.batch_ = []; this.asyncExecuteBatch_(); } this.batch_.push(f); return this; }; AsyncExecutor.prototype.asyncExecuteBatch_ = function() { var self = this; this.asyncExecuteFunction(function() { self.executeBatch_(); }); }; var nativeSetTimeout = $jscomp.global['setTimeout']; AsyncExecutor.prototype.asyncExecuteFunction = function(f) { nativeSetTimeout(f, 0); }; AsyncExecutor.prototype.executeBatch_ = function() { while (this.batch_ && this.batch_.length) { var executingBatch = this.batch_; this.batch_ = []; for (var i = 0; i < executingBatch.length; ++i) { var f = executingBatch[i]; delete executingBatch[i]; try { f(); } catch (error) { this.asyncThrow_(error); } } } this.batch_ = null; }; AsyncExecutor.prototype.asyncThrow_ = function(exception) { this.asyncExecuteFunction(function() { throw exception; }); }; var PromiseState = {PENDING:0, FULFILLED:1, REJECTED:2}; var PolyfillPromise = function(executor) { this.state_ = PromiseState.PENDING; this.result_ = undefined; this.onSettledCallbacks_ = []; var resolveAndReject = this.createResolveAndReject_(); try { executor(resolveAndReject.resolve, resolveAndReject.reject); } catch (e) { resolveAndReject.reject(e); } }; PolyfillPromise.prototype.createResolveAndReject_ = function() { var thisPromise = this; var alreadyCalled = false; function firstCallWins(method) { return function(x) { if (!alreadyCalled) { alreadyCalled = true; method.call(thisPromise, x); } }; } return {resolve:firstCallWins(this.resolveTo_), reject:firstCallWins(this.reject_)}; }; PolyfillPromise.prototype.resolveTo_ = function(value) { if (value === this) { this.reject_(new TypeError('A Promise cannot resolve to itself')); } else { if (value instanceof PolyfillPromise) { this.settleSameAsPromise_(value); } else { if (isObject(value)) { this.resolveToNonPromiseObj_(value); } else { this.fulfill_(value); } } } }; PolyfillPromise.prototype.resolveToNonPromiseObj_ = function(obj) { var thenMethod = undefined; try { thenMethod = obj.then; } catch (error) { this.reject_(error); return; } if (typeof thenMethod == 'function') { this.settleSameAsThenable_(thenMethod, obj); } else { this.fulfill_(obj); } }; function isObject(value) { switch(typeof value) { case 'object': return value != null; case 'function': return true; default: return false; } } PolyfillPromise.prototype.reject_ = function(reason) { this.settle_(PromiseState.REJECTED, reason); }; PolyfillPromise.prototype.fulfill_ = function(value) { this.settle_(PromiseState.FULFILLED, value); }; PolyfillPromise.prototype.settle_ = function(settledState, valueOrReason) { if (this.state_ != PromiseState.PENDING) { throw new Error('Cannot settle(' + settledState + ', ' + valueOrReason | '): Promise already settled in state' + this.state_); } this.state_ = settledState; this.result_ = valueOrReason; this.executeOnSettledCallbacks_(); }; PolyfillPromise.prototype.executeOnSettledCallbacks_ = function() { if (this.onSettledCallbacks_ != null) { var callbacks = this.onSettledCallbacks_; for (var i = 0; i < callbacks.length; ++i) { callbacks[i].call(); callbacks[i] = null; } this.onSettledCallbacks_ = null; } }; var asyncExecutor = new AsyncExecutor; PolyfillPromise.prototype.settleSameAsPromise_ = function(promise) { var methods = this.createResolveAndReject_(); promise.callWhenSettled_(methods.resolve, methods.reject); }; PolyfillPromise.prototype.settleSameAsThenable_ = function(thenMethod, thenable) { var methods = this.createResolveAndReject_(); try { thenMethod.call(thenable, methods.resolve, methods.reject); } catch (error) { methods.reject(error); } }; PolyfillPromise.prototype.then = function(onFulfilled, onRejected) { var resolveChild; var rejectChild; var childPromise = new PolyfillPromise(function(resolve, reject) { resolveChild = resolve; rejectChild = reject; }); function createCallback(paramF, defaultF) { if (typeof paramF == 'function') { return function(x) { try { resolveChild(paramF(x)); } catch (error) { rejectChild(error); } }; } else { return defaultF; } } this.callWhenSettled_(createCallback(onFulfilled, resolveChild), createCallback(onRejected, rejectChild)); return childPromise; }; PolyfillPromise.prototype['catch'] = function(onRejected) { return this.then(undefined, onRejected); }; PolyfillPromise.prototype.callWhenSettled_ = function(onFulfilled, onRejected) { var thisPromise = this; function callback() { switch(thisPromise.state_) { case PromiseState.FULFILLED: onFulfilled(thisPromise.result_); break; case PromiseState.REJECTED: onRejected(thisPromise.result_); break; default: throw new Error('Unexpected state: ' + thisPromise.state_); } } if (this.onSettledCallbacks_ == null) { asyncExecutor.asyncExecute(callback); } else { this.onSettledCallbacks_.push(function() { asyncExecutor.asyncExecute(callback); }); } }; function resolvingPromise(opt_value) { if (opt_value instanceof PolyfillPromise) { return opt_value; } else { return new PolyfillPromise(function(resolve, reject) { resolve(opt_value); }); } } PolyfillPromise['resolve'] = resolvingPromise; PolyfillPromise['reject'] = function(opt_reason) { return new PolyfillPromise(function(resolve, reject) { reject(opt_reason); }); }; PolyfillPromise['race'] = function(thenablesOrValues) { return new PolyfillPromise(function(resolve, reject) { var iterator = $jscomp.makeIterator(thenablesOrValues); for (var iterRec = iterator.next(); !iterRec.done; iterRec = iterator.next()) { resolvingPromise(iterRec.value).callWhenSettled_(resolve, reject); } }); }; PolyfillPromise['all'] = function(thenablesOrValues) { var iterator = $jscomp.makeIterator(thenablesOrValues); var iterRec = iterator.next(); if (iterRec.done) { return resolvingPromise([]); } else { return new PolyfillPromise(function(resolveAll, rejectAll) { var resultsArray = []; var unresolvedCount = 0; function onFulfilled(i) { return function(ithResult) { resultsArray[i] = ithResult; unresolvedCount--; if (unresolvedCount == 0) { resolveAll(resultsArray); } }; } do { resultsArray.push(undefined); unresolvedCount++; resolvingPromise(iterRec.value).callWhenSettled_(onFulfilled(resultsArray.length - 1), rejectAll); iterRec = iterator.next(); } while (!iterRec.done); }); } }; return PolyfillPromise; }, 'es6', 'es3'); $jscomp.executeAsyncGenerator = function(generator) { function passValueToGenerator(value) { return generator.next(value); } function passErrorToGenerator(error) { return generator['throw'](error); } return new Promise(function(resolve, reject) { function handleGeneratorRecord(genRec) { if (genRec.done) { resolve(genRec.value); } else { Promise.resolve(genRec.value).then(passValueToGenerator, passErrorToGenerator).then(handleGeneratorRecord, reject); } } handleGeneratorRecord(generator.next()); }); }; $jscomp.owns = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }; $jscomp.polyfill('WeakMap', function(NativeWeakMap) { function isConformant() { if (!NativeWeakMap || !Object.seal) { return false; } try { var x = Object.seal({}); var y = Object.seal({}); var map = new NativeWeakMap([[x, 2], [y, 3]]); if (map.get(x) != 2 || map.get(y) != 3) { return false; } map['delete'](x); map.set(y, 4); return !map.has(x) && map.get(y) == 4; } catch (err) { return false; } } if (isConformant()) { return NativeWeakMap; } var prop = '$jscomp_hidden_' + Math.random().toString().substring(2); function insert(target) { if (!$jscomp.owns(target, prop)) { var obj = {}; $jscomp.defineProperty(target, prop, {value:obj}); } } function patch(name) { var prev = Object[name]; if (prev) { Object[name] = function(target) { insert(target); return prev(target); }; } } patch('freeze'); patch('preventExtensions'); patch('seal'); var index = 0; var PolyfillWeakMap = function(opt_iterable) { this.id_ = (index += Math.random() + 1).toString(); if (opt_iterable) { $jscomp.initSymbol(); $jscomp.initSymbolIterator(); var iter = $jscomp.makeIterator(opt_iterable); var entry; while (!(entry = iter.next()).done) { var item = entry.value; this.set(item[0], item[1]); } } }; PolyfillWeakMap.prototype.set = function(key, value) { insert(key); if (!$jscomp.owns(key, prop)) { throw new Error('WeakMap key fail: ' + key); } key[prop][this.id_] = value; return this; }; PolyfillWeakMap.prototype.get = function(key) { return $jscomp.owns(key, prop) ? key[prop][this.id_] : undefined; }; PolyfillWeakMap.prototype.has = function(key) { return $jscomp.owns(key, prop) && $jscomp.owns(key[prop], this.id_); }; PolyfillWeakMap.prototype['delete'] = function(key) { if (!$jscomp.owns(key, prop) || !$jscomp.owns(key[prop], this.id_)) { return false; } return delete key[prop][this.id_]; }; return PolyfillWeakMap; }, 'es6', 'es3'); $jscomp.MapEntry = function() { this.previous; this.next; this.head; this.key; this.value; }; $jscomp.polyfill('Map', function(NativeMap) { var isConformant = !$jscomp.ASSUME_NO_NATIVE_MAP && function() { if (!NativeMap || !NativeMap.prototype.entries || typeof Object.seal != 'function') { return false; } try { NativeMap = NativeMap; var key = Object.seal({x:4}); var map = new NativeMap($jscomp.makeIterator([[key, 's']])); if (map.get(key) != 's' || map.size != 1 || map.get({x:4}) || map.set({x:4}, 't') != map || map.size != 2) { return false; } var iter = map.entries(); var item = iter.next(); if (item.done || item.value[0] != key || item.value[1] != 's') { return false; } item = iter.next(); if (item.done || item.value[0].x != 4 || item.value[1] != 't' || !iter.next().done) { return false; } return true; } catch (err) { return false; } }(); if (isConformant) { return NativeMap; } $jscomp.initSymbol(); $jscomp.initSymbolIterator(); var idMap = new WeakMap; var PolyfillMap = function(opt_iterable) { this.data_ = {}; this.head_ = createHead(); this.size = 0; if (opt_iterable) { var iter = $jscomp.makeIterator(opt_iterable); var entry; while (!(entry = iter.next()).done) { var item = entry.value; this.set(item[0], item[1]); } } }; PolyfillMap.prototype.set = function(key, value) { var r = maybeGetEntry(this, key); if (!r.list) { r.list = this.data_[r.id] = []; } if (!r.entry) { r.entry = {next:this.head_, previous:this.head_.previous, head:this.head_, key:key, value:value}; r.list.push(r.entry); this.head_.previous.next = r.entry; this.head_.previous = r.entry; this.size++; } else { r.entry.value = value; } return this; }; PolyfillMap.prototype['delete'] = function(key) { var r = maybeGetEntry(this, key); if (r.entry && r.list) { r.list.splice(r.index, 1); if (!r.list.length) { delete this.data_[r.id]; } r.entry.previous.next = r.entry.next; r.entry.next.previous = r.entry.previous; r.entry.head = null; this.size--; return true; } return false; }; PolyfillMap.prototype.clear = function() { this.data_ = {}; this.head_ = this.head_.previous = createHead(); this.size = 0; }; PolyfillMap.prototype.has = function(key) { return !!maybeGetEntry(this, key).entry; }; PolyfillMap.prototype.get = function(key) { var entry = maybeGetEntry(this, key).entry; return entry && entry.value; }; PolyfillMap.prototype.entries = function() { return makeIterator(this, function(entry) { return [entry.key, entry.value]; }); }; PolyfillMap.prototype.keys = function() { return makeIterator(this, function(entry) { return entry.key; }); }; PolyfillMap.prototype.values = function() { return makeIterator(this, function(entry) { return entry.value; }); }; PolyfillMap.prototype.forEach = function(callback, opt_thisArg) { var iter = this.entries(); var item; while (!(item = iter.next()).done) { var entry = item.value; callback.call(opt_thisArg, entry[1], entry[0], this); } }; PolyfillMap.prototype[Symbol.iterator] = PolyfillMap.prototype.entries; var maybeGetEntry = function(map, key) { var id = getId(key); var list = map.data_[id]; if (list && $jscomp.owns(map.data_, id)) { for (var index = 0; index < list.length; index++) { var entry = list[index]; if (key !== key && entry.key !== entry.key || key === entry.key) { return {id:id, list:list, index:index, entry:entry}; } } } return {id:id, list:list, index:-1, entry:undefined}; }; var makeIterator = function(map, func) { var entry = map.head_; return $jscomp.iteratorPrototype(function() { if (entry) { while (entry.head != map.head_) { entry = entry.previous; } while (entry.next != entry.head) { entry = entry.next; return {done:false, value:func(entry)}; } entry = null; } return {done:true, value:void 0}; }); }; var createHead = function() { var head = {}; head.previous = head.next = head.head = head; return head; }; var mapIndex = 0; var getId = function(obj) { var type = obj && typeof obj; if (type == 'object' || type == 'function') { obj = obj; if (!idMap.has(obj)) { var id = '' + ++mapIndex; idMap.set(obj, id); return id; } return idMap.get(obj); } return 'p_' + obj; }; return PolyfillMap; }, 'es6', 'es3'); $jscomp.polyfill('Math.acosh', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); return Math.log(x + Math.sqrt(x * x - 1)); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.asinh', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); if (x === 0) { return x; } var y = Math.log(Math.abs(x) + Math.sqrt(x * x + 1)); return x < 0 ? -y : y; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.log1p', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); if (x < 0.25 && x > -0.25) { var y = x; var d = 1; var z = x; var zPrev = 0; var s = 1; while (zPrev != z) { y *= x; s *= -1; z = (zPrev = z) + s * y / ++d; } return z; } return Math.log(1 + x); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.atanh', function(orig) { if (orig) { return orig; } var log1p = Math.log1p; var polyfill = function(x) { x = Number(x); return (log1p(x) - log1p(-x)) / 2; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.cbrt', function(orig) { if (orig) { return orig; } var polyfill = function(x) { if (x === 0) { return x; } x = Number(x); var y = Math.pow(Math.abs(x), 1 / 3); return x < 0 ? -y : y; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.clz32', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x) >>> 0; if (x === 0) { return 32; } var result = 0; if ((x & 4294901760) === 0) { x <<= 16; result += 16; } if ((x & 4278190080) === 0) { x <<= 8; result += 8; } if ((x & 4026531840) === 0) { x <<= 4; result += 4; } if ((x & 3221225472) === 0) { x <<= 2; result += 2; } if ((x & 2147483648) === 0) { result++; } return result; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.cosh', function(orig) { if (orig) { return orig; } var exp = Math.exp; var polyfill = function(x) { x = Number(x); return (exp(x) + exp(-x)) / 2; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.expm1', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); if (x < .25 && x > -.25) { var y = x; var d = 1; var z = x; var zPrev = 0; while (zPrev != z) { y *= x / ++d; z = (zPrev = z) + y; } return z; } return Math.exp(x) - 1; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.hypot', function(orig) { if (orig) { return orig; } var polyfill = function(x, y, var_args) { x = Number(x); y = Number(y); var i, z, sum; var max = Math.max(Math.abs(x), Math.abs(y)); for (i = 2; i < arguments.length; i++) { max = Math.max(max, Math.abs(arguments[i])); } if (max > 1e100 || max < 1e-100) { x = x / max; y = y / max; sum = x * x + y * y; for (i = 2; i < arguments.length; i++) { z = Number(arguments[i]) / max; sum += z * z; } return Math.sqrt(sum) * max; } else { sum = x * x + y * y; for (i = 2; i < arguments.length; i++) { z = Number(arguments[i]); sum += z * z; } return Math.sqrt(sum); } }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.imul', function(orig) { if (orig) { return orig; } var polyfill = function(a, b) { a = Number(a); b = Number(b); var ah = a >>> 16 & 65535; var al = a & 65535; var bh = b >>> 16 & 65535; var bl = b & 65535; var lh = ah * bl + al * bh << 16 >>> 0; return al * bl + lh | 0; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.log10', function(orig) { if (orig) { return orig; } var polyfill = function(x) { return Math.log(x) / Math.LN10; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.log2', function(orig) { if (orig) { return orig; } var polyfill = function(x) { return Math.log(x) / Math.LN2; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.sign', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); return x === 0 || isNaN(x) ? x : x > 0 ? 1 : -1; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.sinh', function(orig) { if (orig) { return orig; } var exp = Math.exp; var polyfill = function(x) { x = Number(x); if (x === 0) { return x; } return (exp(x) - exp(-x)) / 2; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.tanh', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); if (x === 0) { return x; } var y = Math.exp(-2 * Math.abs(x)); var z = (1 - y) / (1 + y); return x < 0 ? -z : z; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Math.trunc', function(orig) { if (orig) { return orig; } var polyfill = function(x) { x = Number(x); if (isNaN(x) || x === Infinity || x === -Infinity || x === 0) { return x; } var y = Math.floor(Math.abs(x)); return x < 0 ? -y : y; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Number.EPSILON', function(orig) { return Math.pow(2, -52); }, 'es6', 'es3'); $jscomp.polyfill('Number.MAX_SAFE_INTEGER', function() { return 9007199254740991; }, 'es6', 'es3'); $jscomp.polyfill('Number.MIN_SAFE_INTEGER', function() { return -9007199254740991; }, 'es6', 'es3'); $jscomp.polyfill('Number.isFinite', function(orig) { if (orig) { return orig; } var polyfill = function(x) { if (typeof x !== 'number') { return false; } return !isNaN(x) && x !== Infinity && x !== -Infinity; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Number.isInteger', function(orig) { if (orig) { return orig; } var polyfill = function(x) { if (!Number.isFinite(x)) { return false; } return x === Math.floor(x); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Number.isNaN', function(orig) { if (orig) { return orig; } var polyfill = function(x) { return typeof x === 'number' && isNaN(x); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Number.isSafeInteger', function(orig) { if (orig) { return orig; } var polyfill = function(x) { return Number.isInteger(x) && Math.abs(x) <= Number.MAX_SAFE_INTEGER; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Object.assign', function(orig) { if (orig) { return orig; } var polyfill = function(target, var_args) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; if (!source) { continue; } for (var key in source) { if ($jscomp.owns(source, key)) { target[key] = source[key]; } } } return target; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Object.entries', function(orig) { if (orig) { return orig; } var entries = function(obj) { var result = []; for (var key in obj) { if ($jscomp.owns(obj, key)) { result.push([key, obj[key]]); } } return result; }; return entries; }, 'es8', 'es3'); $jscomp.polyfill('Object.getOwnPropertySymbols', function(orig) { if (orig) { return orig; } return function() { return []; }; }, 'es6', 'es5'); $jscomp.polyfill('Reflect.ownKeys', function(orig) { if (orig) { return orig; } var symbolPrefix = 'jscomp_symbol_'; function isSymbol(key) { return key.substring(0, symbolPrefix.length) == symbolPrefix; } var polyfill = function(target) { var keys = []; var names = Object.getOwnPropertyNames(target); var symbols = Object.getOwnPropertySymbols(target); for (var i = 0; i < names.length; i++) { (isSymbol(names[i]) ? symbols : keys).push(names[i]); } return keys.concat(symbols); }; return polyfill; }, 'es6', 'es5'); $jscomp.polyfill('Object.getOwnPropertyDescriptors', function(orig) { if (orig) { return orig; } var getOwnPropertyDescriptors = function(obj) { var result = {}; var keys = Reflect.ownKeys(obj); for (var i = 0; i < keys.length; i++) { result[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); } return result; }; return getOwnPropertyDescriptors; }, 'es8', 'es5'); $jscomp.underscoreProtoCanBeSet = function() { var x = {a:true}; var y = {}; try { y.__proto__ = x; return y.a; } catch (e) { } return false; }; $jscomp.setPrototypeOf = typeof Object.setPrototypeOf == 'function' ? Object.setPrototypeOf : $jscomp.underscoreProtoCanBeSet() ? function(target, proto) { target.__proto__ = proto; if (target.__proto__ !== proto) { throw new TypeError(target + ' is not extensible'); } return target; } : null; $jscomp.polyfill('Object.setPrototypeOf', function(orig) { return orig || $jscomp.setPrototypeOf; }, 'es6', 'es5'); $jscomp.polyfill('Object.values', function(orig) { if (orig) { return orig; } var values = function(obj) { var result = []; for (var key in obj) { if ($jscomp.owns(obj, key)) { result.push(obj[key]); } } return result; }; return values; }, 'es8', 'es3'); $jscomp.polyfill('Reflect.apply', function(orig) { if (orig) { return orig; } var apply = Function.prototype.apply; var polyfill = function(target, thisArg, argList) { return apply.call(target, thisArg, argList); }; return polyfill; }, 'es6', 'es3'); $jscomp.objectCreate = $jscomp.ASSUME_ES5 || typeof Object.create == 'function' ? Object.create : function(prototype) { var ctor = function() { }; ctor.prototype = prototype; return new ctor; }; $jscomp.construct = function() { function reflectConstructWorks() { function Base() { } function Derived() { } new Base; Reflect.construct(Base, [], Derived); return new Base instanceof Base; } if (typeof Reflect != 'undefined' && Reflect.construct) { if (reflectConstructWorks()) { return Reflect.construct; } var brokenConstruct = Reflect.construct; var patchedConstruct = function(target, argList, opt_newTarget) { var out = brokenConstruct(target, argList); if (opt_newTarget) { Reflect.setPrototypeOf(out, opt_newTarget.prototype); } return out; }; return patchedConstruct; } function construct(target, argList, opt_newTarget) { if (opt_newTarget === undefined) { opt_newTarget = target; } var proto = opt_newTarget.prototype || Object.prototype; var obj = $jscomp.objectCreate(proto); var apply = Function.prototype.apply; var out = apply.call(target, obj, argList); return out || obj; } return construct; }(); $jscomp.polyfill('Reflect.construct', function(orig) { return $jscomp.construct; }, 'es6', 'es3'); $jscomp.polyfill('Reflect.defineProperty', function(orig) { if (orig) { return orig; } var polyfill = function(target, propertyKey, attributes) { try { Object.defineProperty(target, propertyKey, attributes); var desc = Object.getOwnPropertyDescriptor(target, propertyKey); if (!desc) { return false; } return desc.configurable === (attributes.configurable || false) && desc.enumerable === (attributes.enumerable || false) && ('value' in desc ? desc.value === attributes.value && desc.writable === (attributes.writable || false) : desc.get === attributes.get && desc.set === attributes.set); } catch (err) { return false; } }; return polyfill; }, 'es6', 'es5'); $jscomp.polyfill('Reflect.deleteProperty', function(orig) { if (orig) { return orig; } var polyfill = function(target, propertyKey) { if (!$jscomp.owns(target, propertyKey)) { return true; } try { return delete target[propertyKey]; } catch (err) { return false; } }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Reflect.getOwnPropertyDescriptor', function(orig) { return orig || Object.getOwnPropertyDescriptor; }, 'es6', 'es5'); $jscomp.polyfill('Reflect.getPrototypeOf', function(orig) { return orig || Object.getPrototypeOf; }, 'es6', 'es5'); $jscomp.findDescriptor = function(target, propertyKey) { var obj = target; while (obj) { var property = Reflect.getOwnPropertyDescriptor(obj, propertyKey); if (property) { return property; } obj = Reflect.getPrototypeOf(obj); } return undefined; }; $jscomp.polyfill('Reflect.get', function(orig) { if (orig) { return orig; } var polyfill = function(target, propertyKey, opt_receiver) { if (arguments.length <= 2) { return target[propertyKey]; } var property = $jscomp.findDescriptor(target, propertyKey); if (property) { return property.get ? property.get.call(opt_receiver) : property.value; } return undefined; }; return polyfill; }, 'es6', 'es5'); $jscomp.polyfill('Reflect.has', function(orig) { if (orig) { return orig; } var polyfill = function(target, propertyKey) { return propertyKey in target; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Reflect.isExtensible', function(orig) { if (orig) { return orig; } if ($jscomp.ASSUME_ES5 || typeof Object.isExtensible == 'function') { return Object.isExtensible; } return function() { return true; }; }, 'es6', 'es3'); $jscomp.polyfill('Reflect.preventExtensions', function(orig) { if (orig) { return orig; } if (!($jscomp.ASSUME_ES5 || typeof Object.preventExtensions == 'function')) { return function() { return false; }; } var polyfill = function(target) { Object.preventExtensions(target); return !Object.isExtensible(target); }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('Reflect.set', function(orig) { if (orig) { return orig; } var polyfill = function(target, propertyKey, value, opt_receiver) { var property = $jscomp.findDescriptor(target, propertyKey); if (!property) { if (Reflect.isExtensible(target)) { target[propertyKey] = value; return true; } return false; } if (property.set) { property.set.call(arguments.length > 3 ? opt_receiver : target, value); return true; } else { if (property.writable && !Object.isFrozen(target)) { target[propertyKey] = value; return true; } } return false; }; return polyfill; }, 'es6', 'es5'); $jscomp.polyfill('Reflect.setPrototypeOf', function(orig) { if (orig) { return orig; } else { if ($jscomp.setPrototypeOf) { var setPrototypeOf = $jscomp.setPrototypeOf; var polyfill = function(target, proto) { try { setPrototypeOf(target, proto); return true; } catch (e) { return false; } }; return polyfill; } else { return null; } } }, 'es6', 'es5'); $jscomp.polyfill('Set', function(NativeSet) { var isConformant = !$jscomp.ASSUME_NO_NATIVE_SET && function() { if (!NativeSet || !NativeSet.prototype.entries || typeof Object.seal != 'function') { return false; } try { NativeSet = NativeSet; var value = Object.seal({x:4}); var set = new NativeSet($jscomp.makeIterator([value])); if (!set.has(value) || set.size != 1 || set.add(value) != set || set.size != 1 || set.add({x:4}) != set || set.size != 2) { return false; } var iter = set.entries(); var item = iter.next(); if (item.done || item.value[0] != value || item.value[1] != value) { return false; } item = iter.next(); if (item.done || item.value[0] == value || item.value[0].x != 4 || item.value[1] != item.value[0]) { return false; } return iter.next().done; } catch (err) { return false; } }(); if (isConformant) { return NativeSet; } $jscomp.initSymbol(); $jscomp.initSymbolIterator(); var PolyfillSet = function(opt_iterable) { this.map_ = new Map; if (opt_iterable) { var iter = $jscomp.makeIterator(opt_iterable); var entry; while (!(entry = iter.next()).done) { var item = entry.value; this.add(item); } } this.size = this.map_.size; }; PolyfillSet.prototype.add = function(value) { this.map_.set(value, value); this.size = this.map_.size; return this; }; PolyfillSet.prototype['delete'] = function(value) { var result = this.map_['delete'](value); this.size = this.map_.size; return result; }; PolyfillSet.prototype.clear = function() { this.map_.clear(); this.size = 0; }; PolyfillSet.prototype.has = function(value) { return this.map_.has(value); }; PolyfillSet.prototype.entries = function() { return this.map_.entries(); }; PolyfillSet.prototype.values = function() { return this.map_.values(); }; PolyfillSet.prototype.keys = PolyfillSet.prototype.values; PolyfillSet.prototype[Symbol.iterator] = PolyfillSet.prototype.values; PolyfillSet.prototype.forEach = function(callback, opt_thisArg) { var set = this; this.map_.forEach(function(value) { return callback.call(opt_thisArg, value, value, set); }); }; return PolyfillSet; }, 'es6', 'es3'); $jscomp.checkStringArgs = function(thisArg, arg, func) { if (thisArg == null) { throw new TypeError("The 'this' value for String.prototype." + func + ' must not be null or undefined'); } if (arg instanceof RegExp) { throw new TypeError('First argument to String.prototype.' + func + ' must not be a regular expression'); } return thisArg + ''; }; $jscomp.polyfill('String.prototype.codePointAt', function(orig) { if (orig) { return orig; } var polyfill = function(position) { var string = $jscomp.checkStringArgs(this, null, 'codePointAt'); var size = string.length; position = Number(position) || 0; if (!(position >= 0 && position < size)) { return void 0; } position = position | 0; var first = string.charCodeAt(position); if (first < 55296 || first > 56319 || position + 1 === size) { return first; } var second = string.charCodeAt(position + 1); if (second < 56320 || second > 57343) { return first; } return (first - 55296) * 1024 + second + 9216; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('String.prototype.endsWith', function(orig) { if (orig) { return orig; } var polyfill = function(searchString, opt_position) { var string = $jscomp.checkStringArgs(this, searchString, 'endsWith'); searchString = searchString + ''; if (opt_position === void 0) { opt_position = string.length; } var i = Math.max(0, Math.min(opt_position | 0, string.length)); var j = searchString.length; while (j > 0 && i > 0) { if (string[--i] != searchString[--j]) { return false; } } return j <= 0; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('String.fromCodePoint', function(orig) { if (orig) { return orig; } var polyfill = function(var_args) { var result = ''; for (var i = 0; i < arguments.length; i++) { var code = Number(arguments[i]); if (code < 0 || code > 1114111 || code !== Math.floor(code)) { throw new RangeError('invalid_code_point ' + code); } if (code <= 65535) { result += String.fromCharCode(code); } else { code -= 65536; result += String.fromCharCode(code >>> 10 & 1023 | 55296); result += String.fromCharCode(code & 1023 | 56320); } } return result; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('String.prototype.includes', function(orig) { if (orig) { return orig; } var polyfill = function(searchString, opt_position) { var string = $jscomp.checkStringArgs(this, searchString, 'includes'); return string.indexOf(searchString, opt_position || 0) !== -1; }; return polyfill; }, 'es6', 'es3'); $jscomp.polyfill('String.prototype.repeat', function(orig) { if (orig) { return orig; } var polyfill = function(copies) { var string = $jscomp.checkStringArgs(this, null, 'repeat'); if (copies < 0 || copies > 1342177279) { throw new RangeError('Invalid count value'); } copies = copies | 0; var result = ''; while (copies) { if (copies & 1) { result += string; } if (copies >>>= 1) { string += string; } } return result; }; return polyfill; }, 'es6', 'es3'); $jscomp.stringPadding = function(padString, padLength) { var padding = padString !== undefined ? String(padString) : ' '; if (!(padLength > 0) || !padding) { return ''; } var repeats = Math.ceil(padLength / padding.length); return padding.repeat(repeats).substring(0, padLength); }; $jscomp.polyfill('String.prototype.padEnd', function(orig) { if (orig) { return orig; } var padEnd = function(targetLength, opt_padString) { var string = $jscomp.checkStringArgs(this, null, 'padStart'); var padLength = targetLength - string.length; return string + $jscomp.stringPadding(opt_padString, padLength); }; return padEnd; }, 'es8', 'es3'); $jscomp.polyfill('String.prototype.padStart', function(orig) { if (orig) { return orig; } var padStart = function(targetLength, opt_padString) { var string = $jscomp.checkStringArgs(this, null, 'padStart'); var padLength = targetLength - string.length; return $jscomp.stringPadding(opt_padString, padLength) + string; }; return padStart; }, 'es8', 'es3'); $jscomp.polyfill('String.prototype.startsWith', function(orig) { if (orig) { return orig; } var polyfill = function(searchString, opt_position) { var string = $jscomp.checkStringArgs(this, searchString, 'startsWith'); searchString = searchString + ''; var strLen = string.length; var searchLen = searchString.length; var i = Math.max(0, Math.min(opt_position | 0, string.length)); var j = 0; while (j < searchLen && i < strLen) { if (string[i++] != searchString[j++]) { return false; } } return j >= searchLen; }; return polyfill; }, 'es6', 'es3'); $jscomp.arrayFromIterator = function(iterator) { var i; var arr = []; while (!(i = iterator.next()).done) { arr.push(i.value); } return arr; }; $jscomp.arrayFromIterable = function(iterable) { if (iterable instanceof Array) { return iterable; } else { return $jscomp.arrayFromIterator($jscomp.makeIterator(iterable)); } }; $jscomp.inherits = function(childCtor, parentCtor) { childCtor.prototype = $jscomp.objectCreate(parentCtor.prototype); childCtor.prototype.constructor = childCtor; if ($jscomp.setPrototypeOf) { var setPrototypeOf = $jscomp.setPrototypeOf; setPrototypeOf(childCtor, parentCtor); } else { for (var p in parentCtor) { if (p == 'prototype') { continue; } if (Object.defineProperties) { var descriptor = Object.getOwnPropertyDescriptor(parentCtor, p); if (descriptor) { Object.defineProperty(childCtor, p, descriptor); } } else { childCtor[p] = parentCtor[p]; } } } childCtor.superClass_ = parentCtor.prototype; }; $jscomp.polyfill('WeakSet', function(NativeWeakSet) { function isConformant() { if (!NativeWeakSet || !Object.seal) { return false; } try { var x = Object.seal({}); var y = Object.seal({}); var set = new NativeWeakSet([x]); if (!set.has(x) || set.has(y)) { return false; } set['delete'](x); set.add(y); return !set.has(x) && set.has(y); } catch (err) { return false; } } if (isConformant()) { return NativeWeakSet; } var PolyfillWeakSet = function(opt_iterable) { this.map_ = new WeakMap; if (opt_iterable) { $jscomp.initSymbol(); $jscomp.initSymbolIterator(); var iter = $jscomp.makeIterator(opt_iterable); var entry; while (!(entry = iter.next()).done) { var item = entry.value; this.add(item); } } }; PolyfillWeakSet.prototype.add = function(elem) { this.map_.set(elem, true); return this; }; PolyfillWeakSet.prototype.has = function(elem) { return this.map_.has(elem); }; PolyfillWeakSet.prototype['delete'] = function(elem) { return this.map_['delete'](elem); }; return PolyfillWeakSet; }, 'es6', 'es3'); try { if (Array.prototype.values.toString().indexOf('[native code]') == -1) { delete Array.prototype.values; } } catch (e) { } Ext.define('eqOnline.model.User', {extend:Ext.data.Model, fields:['admin', 'kuser', 'name', 'isadmin', 'locked', {name:'comboname', mapping:'kuser', convert:function(v, rec) { return v + ' - ' + rec.data['name']; }}, {name:'docdownload', type:'boolean', useNull:true}], idProperty:'kuser', proxy:{type:'ajax', url:'user', extraParams:{OnInputProcessing:'getList'}}}); Ext.define('eqOnline.view.Content', {extend:Ext.Panel, alias:'widget.contentarea', flex:90, padding:15, layout:'card', id:'content', style:{border:'1px solid #99BCE8'}, loader:{url:'application', renderer:'component', loadMask:true, ajaxOptions:{method:'GET'}}, initComponent:function() { this.callParent(); this.loadMask = new Ext.LoadMask(this, {msg:'Bitte warten...'}); }, loadView:function(viewName, noHistory, options, viewId) { this.loadMask.show(); this.fireEvent('viewrequested', viewName, noHistory, options); if (noHistory !== true) { var newToken = viewName, oldToken = Ext.History.getToken(); if (oldToken === null || oldToken.search(newToken) === -1) { Ext.History.add(newToken); } else { this.loadMask.hide(); } } else { var existing = this.down('[itemId\x3d' + viewName + ']'); if (existing && viewId) { this.remove(existing); existing = null; } if (existing) { this.getLayout().setActiveItem(viewName); } else { this.add(Ext.apply({xtype:viewName, itemId:viewName}, options)); this.getLayout().setActiveItem(viewName); } this.fireEvent('viewcalled', viewName); this.loadMask.hide(); } }}); Ext.define('eqOnline.view.Kontakt', {extend:Ext.Panel, flex:1, border:false, alias:'widget.contactform', layout:{type:'hbox'}, defaults:{border:false}, items:[{layout:{type:'vbox'}, defaults:{border:false}, flex:1, items:[{html:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eKontaktformular\x3c/h1\x3e\x3c/div\x3e'}, {xtype:'form', url:'application', width:350, layout:{type:'vbox', align:'stretch'}, defaults:{xtype:'textfield', labelWidth:140}, items:[{fieldLabel:'Empfänger', name:'receiver', xtype:'displayfield', submitValue:true, value:'timo.lommen@de.tuv.com'}, {fieldLabel:'Kopie an', name:'ccreceiver', value:''}, {fieldLabel:'Betreff', name:'subject', value:''}, {fieldLabel:'Nachricht', name:'message', value:'', xtype:'textarea'}, {fieldLabel:'Nachname', name:'last_name', value:''}, {fieldLabel:'Vorname', name:'first_name', value:''}, {fieldLabel:'Straße / Hausnummer', name:'street_hnum', value:''}, {fieldLabel:'PLZ / Ort', name:'plz_ort', value:''}, {fieldLabel:'Land', name:'country', value:''}, {fieldLabel:'Telefon', name:'phone', value:''}, {fieldLabel:'Fax', name:'fax', value:''}], buttons:[{text:'Nachricht abschicken', handler:function(button) { button.up('form').submit({url:'application', params:{OnInputProcessing:'send_mail'}, success:function(form) { form.reset(); Ext.Msg.alert('Nachricht versendet', 'Ihre Nachricht wurde versendet.'); }, failure:function() { Ext.Msg.alert('Nachricht nicht versendet', 'Ihre Nachricht konnte nicht verabreitet werden.'); }, scope:button.up('form')}); }}]}]}, {xtype:'panel', border:false, html:'\x3cp style\x3d"font-weight:bold;"\x3eTÜV Rheinland Group\x3cbr/\x3e' + 'Unternehmensbereich Industrie Service\x3c/p\x3e' + '\x3cp\x3eAm Grauen Stein\x3cbr/\x3e' + '51105 Köln\x3c/p\x3e' + '\x3cp\x3eTel.: +49 (0)221 806 1526\x3cbr/\x3e' + 'Fax +49 (0)221 806 3281\x3c/p\x3e'}]}); Ext.define('eqOnline.view.user.Login', {extend:Ext.Panel, alias:'widget.loginscreen', preventHeader:true, layout:{type:'vbox'}, flex:1, border:false, defaults:{border:false}, items:[{html:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eLogin\x3c/h1\x3e\x3c/div\x3e', height:30}, {xtype:'form', itemId:'loginForm', width:260, defaultType:'textfield', preventHeader:true, items:[{fieldLabel:EQOnlineLocale.benutzername, name:'username', allowBlank:false}, {fieldLabel:EQOnlineLocale.passwort, name:'password', inputType:'password', allowBlank:false}], dockedItems:[{xtype:'toolbar', dock:'bottom', ui:'footer', items:[{itemId:'loginButton', text:EQOnlineLocale.login, formBind:true}]}]}, {xtype:'button', text:EQOnlineLocale.guestaccess, itemId:'initGuest'}]}); Ext.define('eqOnline.view.Welcome', {extend:Ext.Panel, alias:'widget.welcome', border:false, tpl:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eEquipment\x3cspan style\x3d"font-weight: normal;"\x3eOnline\x3c/span\x3e\x3c/h1\x3e\x3cp\x3e\x3ctpl for\x3d"."\x3e{text}\x3c/tpl\x3e\x3c/p\x3e\x3c/div\x3e', loader:{url:'application', renderer:'data', method:'GET', params:{OnInputProcessing:'getwelcometext'}, autoLoad:true}}); Ext.define('eqOnline.view.Impressum', {extend:Ext.Panel, alias:'widget.impressum', autoScroll:true, border:false, loader:{url:'application', renderer:'data', autoLoad:true, params:{OnInputProcessing:'getImpressum'}}, tpl:Ext.create('Ext.XTemplate', '\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eImpressum\x3c/h1\x3e\x3cp\x3e(Anbieterkennzeichnung nach Teledienstegesetz)\x3c/p\x3e\x3c/div\x3e' + '\x3cdiv class\x3d"eqo"\x3e\x3ch2\x3eBetreiber der Webpräsenz\x3c/h2\x3e' + '\x3cp\x3e{bkname1} {bkname1_2} - {bkname1}\x3c/p\x3e' + '\x3cp\x3e{bkstrasse}\x3cbr/\x3e' + '{bkort}\x3cbr/\x3e' + 'Tel. 0221 / 806 - 0\x3cbr/\x3e' + 'Fax 0221 / 806 - 114\x3cbr/\x3e' + 'E-Mail: \x3ca href\x3d"mailto://webmaster@de.tuv.com"\x3ewebmaster@de.tuv.com\x3c/a\x3e\x3c/p\x3e' + '\x3ch2\x3eGeschäftsführung\x3c/h2\x3e' + '\x3cp\x3e{bkgeschf1} {bkgeschf_txt1}' + '\x3ctpl if\x3d"bkgeschf2"\x3e\x3cbr/\x3e{bkgeschf2} {bkgeschf_txt2}\x3c/tpl\x3e' + '\x3ctpl if\x3d"bkgeschf3"\x3e\x3cbr/\x3e{bkgeschf3} {bkgeschf_txt3}\x3c/tpl\x3e' + '\x3ctpl if\x3d"bkgeschf4"\x3e\x3cbr/\x3e{bkgeschf4} {bkgeschf_txt4}\x3c/tpl\x3e' + '\x3c/p\x3e' + '\x3ch2\x3eHandelsregister\x3c/h2\x3e' + '\x3cp\x3eRegisternummer {bkhrb}\x3c/p\x3e' + '\x3ch2\x3eHaftungsausschluss\x3c/h2\x3e' + '\x3cp\x3eDie TÜV Rheinland Industrie Service GmbH - TÜV Rheinland (TIS) ist um Richtigkeit und Aktualität ' + 'der auf dieser Internetpräsenz bereitgestellten Informationen bemüht. Trotzdem können Fehler und ' + 'Unklarheiten nicht vollständig ausgeschlossen werden. Die ' + 'TIS übernimmt daher keine Gewähr für die Aktualität, Korrektheit, Vollständigkeit und Qualität ' + 'der bereitgestellten Informationen. Die Inhalte fremder Seiten, auf die die TIS mit Links hinweist, ' + 'spiegeln nicht die Meinung der TIS wieder, sondern dienen ' + 'lediglich der Information und der Darstellung von Zusammenhängen. Die TIS haftet nicht für fremde ' + 'Inhalte, Werbung, Produkte oder andere Materialien, auf die sie lediglich im oben genannten Sinne ' + 'hinweist. Die Verantwortlichkeit liegt alleine bei dem ' + 'Anbieter der Inhalte. Diese fremden Inhalte stammen weder von der TIS, noch hat sie die Möglichkeit, ' + 'den Inhalt von Seiten Dritter zu ' + 'beeinflussen.\x3c/p\x3e')}); Ext.define('eqOnline.store.Users', {extend:Ext.data.Store, model:'eqOnline.model.User'}); Ext.define('eqOnline.controller.Application', {extend:Ext.app.Controller, views:['Content', 'Kontakt', 'user.Login', 'Welcome', 'Impressum'], stores:['Users'], models:['User'], modelsInitialized:false, eqColumns:null, eqPageSize:0, lastOptions:null, eqGridState:{}, refs:[{ref:'nav', selector:'#navigation'}, {ref:'content', selector:'#content'}], init:function() { Ext.History.on('change', function(token) { if (token) { var parts = token.split(':'), length = parts.length; this.processToken(token); this.fireEvent('navigate', token); } }, this); this.control({'#navigation':{itemclick:this.onNavigation, refresh:this.highlightNav}, '#metaNavigation':{itemclick:this.onNavigation}, '#content':{afterrender:this.checkUser, viewrequested:this.saveOptions}}); }, saveOptions:function(viewname, noHistory, options) { this.lastOptions = options; }, checkUser:function() { var store = this.getUsersStore(); this.getUsersStore().load({callback:this.loadStartpage, scope:this}); }, loadStartpage:function() { if (this.getUsersStore().count() > 0) { Ext.Ajax.request({url:'eqlist', method:'GET', params:{OnInputProcessing:'getGridColumns'}, callback:this.afterColumnRead, scope:this}); } else { var target = 'loginscreen'; if (document.getElementById('navTarget') && document.getElementById('navTarget').value) { target = document.getElementById('navTarget').value; } this.getContent().loadView(target, true); } }, afterColumnRead:function(options, success, response) { var model = Ext.decode(response.responseText), token = Ext.History.getToken(); this.eqColumns = model.columns, this.eqPageSize = model.meta.pageSize; if (token) { this.processToken(token); var tokens = token.split(':'); this.fireEvent('navigate', token); } else { var target = 'welcome'; if (document.getElementById('navTarget') && document.getElementById('navTarget').value) { target = document.getElementById('navTarget').value; } this.getContent().loadView(target); } }, loadWelcome:function() { if (this.getUsersStore().count() > 0) { this.getContent().loadView('welcome'); } else { this.getContent().loadView('loginscreen', true); } }, refreshNavigation:function() { Ext.getStore('Navigation').load(); }, processToken:function(token) { if (token == 'welcome' || token == 'impressum' || token == 'contactform') { this.getContent().loadView(token, true, this.lastOptions); } }, onNavigation:function(view, record) { switch(record.get('cls')) { case 'showHomeButton': this.loadWelcome(); break; case 'tuvcomButton': document.location.href = 'http://www.tuv.com'; break; case 'helpButton': this.showHelp(); break; case 'impressButton': this.getContent().loadView('impressum'); break; case 'kontaktButton': this.getContent().loadView('contactform'); break; } }, highlightNav:function() { var nav = this.getNav(), tk = Ext.History.currentToken; if (nav.getStore().count == 0 || tk == null) { return; } var rec = null; tk = tk.split(':')[0]; switch(tk) { case 'contractdetail': case 'contractlist': rec = nav.getStore().findRecord('cls', 'contractButton'); break; case 'userdata': rec = nav.getStore().findRecord('cls', 'userDataButton'); break; case 'equipmentlist': case 'equipmentdetail': rec = nav.getStore().findRecord('cls', 'eqListButton'); break; } if (rec != null) { nav.getSelectionModel().select(rec); } }, showHelp:function() { Ext.create('Ext.Window', {title:EQOnlineLocale.hilfeEqonline, width:600, height:400, x:20, y:20, resizable:true, maximizable:true, constrainHeader:true, layout:'fit', items:[{border:false, html:'\x3ciframe border\x3d"0" src\x3d"eqonline_hilfe.pdf" style\x3d"border: none; width: 100%; height: 100%"\x3e\x3c/iframe\x3e'}]}).show(); }}); Ext.define('eqOnline.model.Contract', {extend:Ext.data.Model, fields:contractModel, idProperty:'vtnum', associations:[{type:'hasMany', model:'eqOnline.model.Partner', name:'Partner', associationKey:'lt_partner', primaryKey:'vtnum', foreignKey:'vtnum'}, {type:'hasMany', model:'eqOnline.model.Mitarbeiter', name:'Mitarbeiter', associationKey:'lt_mitarbeiter', primaryKey:'vtnum', foreignKey:'vtnum'}, {type:'hasMany', model:'eqOnline.model.ContractDocFolder', name:'Ordner', associationKey:'lt_docs', primaryKey:'vtnum', foreignKey:'vtnum'}, {type:'hasMany', model:'eqOnline.model.ContractStatus', name:'Status', associationKey:'lt_status', primaryKey:'vtnum', foreignKey:'vtnum'}, {type:'hasMany', model:'eqOnline.model.ContractEquipment', name:'Equipments', associationKey:'lt_equipments', primaryKey:'vtnum', foreignKey:'vtnum'}], proxy:{type:'ajax', url:'contract', simpleSortMode:true, limitParam:false, extraParams:{'OnInputProcessing':'getList'}, reader:{type:'json'}}}); Ext.define('eqOnline.view.contract.List', {extend:Ext.Panel, alias:'widget.contractlist', layout:{type:'vbox', align:'stretch'}, border:false, flex:1, items:[{xtype:'grid', store:'Contracts', title:EQOnlineLocale.vertragsuebersicht, selType:'cellmodel', flex:1, dockedItems:[{xtype:'toolbar', dock:'top', items:['-\x3e', {xtype:'button', hidden:true, text:EQOnlineLocale.zuordnung, itemId:'showAssignments', action:'show'}]}], columns:contractModel}]}); Ext.define('eqOnline.store.Contracts', {extend:Ext.data.Store, model:'eqOnline.model.Contract'}); Ext.define('eqOnline.controller.Contract', {extend:Ext.app.Controller, stores:['Contracts'], models:['Contract'], views:['contract.List'], refs:[{ref:'contractTable', selector:'contractlist grid'}, {ref:'content', selector:'#content'}], init:function() { this.control({'#navigation':{itemclick:this.onNavigation}, 'contractlist grid button[itemId\x3dshowAssignments]':{click:this.showAssignments}, 'contractlist grid':{render:this.loadContractList, edit:this.editCell}}); this.application.getController('Application').on('navigate', this.processToken, this); }, editCell:function(editor, obj) { if (obj.field.indexOf('auth_c') != -1) { var rec = obj.record; Ext.Ajax.request({method:'GET', url:'contract', params:{OnInputProcessing:'setAssignment', username:obj.field.replace('auth_c_', ''), vtnum:rec.get('vtnum'), assign:obj.value}}); } }, loadContractList:function() { this.getContractsStore().load(); if (this.application.getController('User').isAdmin()) { this.getContractTable().down('button[itemId\x3dshowAssignments]').show(); } }, onNavigation:function(view, record) { if (record.get('cls') == 'contractButton') { this.getContent().loadView('contractlist'); } }, processToken:function(token) { if (token == 'contractlist') { this.getContent().loadView('contractlist', true); } }, showAssignments:function() { var button = this.getContractTable().down('button[itemId\x3dshowAssignments]'); var cols = this.getContractTable().columns; for (var i = 0, len = cols.length; i < len; i++) { if (cols[i].dataIndex.indexOf('auth_c_') != -1) { if (button.action == 'show') { cols[i].show(); } else { cols[i].hide(); } } } button.setText(button.action == 'show' ? EQOnlineLocale.zuordnungaus : EQOnlineLocale.zuordnung); button.action = button.action == 'show' ? 'hide' : 'show'; }}); Ext.define('eqOnline.model.Partner', {extend:Ext.data.Model, fields:[{name:'vtnum'}, {name:'Type', mapping:'parvw'}, {name:'Typedesc', mapping:'vtext'}, {name:'Id', mapping:'partner'}, {name:'Name', mapping:'name'}, {name:'Street', mapping:'street'}, {name:'PLZ', mapping:'pstlz'}, {name:'City', mapping:'city'}], idProperty:'parvw', belongsTo:'eqOnline.model.Contract'}); Ext.define('eqOnline.model.Mitarbeiter', {extend:Ext.data.Model, fields:[{name:'vtnum'}, {name:'Funktion', mapping:'tmfkt'}, {name:'Name', mapping:'name'}, {name:'Kostenstelle', mapping:'kostl'}, {name:'Telefon', mapping:'telnr'}, {name:'Email', mapping:'email'}], idProperty:'pernr', belongsTo:'eqOnline.model.Contract'}); Ext.define('eqOnline.model.ContractDocFolder', {extend:Ext.data.Model, fields:[{name:'vtnum'}, {name:'Ordner', mapping:'folder'}], idProperty:'Ordner', associations:[{type:'belongsTo', model:'eqOnline.model.Contract'}, {type:'hasMany', model:'eqOnline.model.ContractDoc', name:'Dokumente', associationKey:'docs', primaryKey:'Ordner', foreignKey:'Ordner'}]}); Ext.define('eqOnline.model.ContractDoc', {extend:Ext.data.Model, fields:[{name:'Ordner'}, {name:'Name', mapping:'dbez'}, {name:'EQOnline', mapping:'eqonl'}, {name:'Doc_Id', mapping:'arc_doc_id'}, {name:'ar_object'}, {name:'archiv_id'}, {name:'sap_object'}, {name:'dtype'}, {name:'Dateiname', mapping:'dname'}], idProperty:'Doc_Id', belongsTo:'eqOnline.model.ContractDocFolder'}); Ext.define('eqOnline.model.ContractStatus', {extend:Ext.data.Model, fields:[{name:'vtnum'}, {name:'neu', type:'int'}, {name:'disp', type:'int'}, {name:'svok', type:'int'}, {name:'ruek', type:'int'}, {name:'neurel', type:'float'}, {name:'disprel', type:'float'}, {name:'svokrel', type:'float'}, {name:'ruekrel', type:'float'}], associations:[{type:'belongsTo', model:'eqOnline.model.Contract'}]}); Ext.define('eqOnline.model.ContractEquipment', {extend:Ext.data.Model, fields:[{name:'vtnum', mapping:'vtnum'}, {name:'equnr', type:'int'}], associations:[{type:'belongsTo', model:'eqOnline.model.Contract'}]}); Ext.define('eqOnline.model.Equipment', {extend:Ext.data.Model, fields:eqModel.concat([{name:'quarter', useNull:true, mapping:'ztsfll', convert:function(v) { v = Ext.isDate(v) ? v : Ext.Date.parse(v, 'Ymd'); if (!Ext.isDate(v)) { return null; } return Ext.Date.parse('01.' + (parseInt((Ext.Date.format(v, 'm') - 1) / 3, 10) * 3 + 1) + '.' + Ext.Date.format(v, 'Y'), 'd.n.Y'); }}, {name:'baujj'}]), proxy:{type:'ajax', url:'eqlist', simpleSortMode:true, extraParams:{'OnInputProcessing':'getEquipments'}, reader:{type:'json', root:'items'}}}); Ext.define('eqOnline.model.Pruefung', {extend:Ext.data.Model, fields:pruefungenModel.fields, proxy:{type:'ajax', url:'eqdetail', simpleSortMode:true, extraParams:{'OnInputProcessing':'getTermine'}, reader:{type:'json', root:'items'}}}); Ext.define('eqOnline.view.contract.Documents', {extend:Ext.grid.Panel, alias:'widget.contractdocuments', features:[{ftype:'grouping'}], store:{model:'eqOnline.model.ContractDoc', groupField:'Ordner'}, columns:[{header:EQOnlineLocale.dateiname, width:150, dataIndex:'Dateiname'}, {header:EQOnlineLocale.bezeichnung, flex:1, dataIndex:'Name'}]}); Ext.define('eqOnline.view.contract.Chart', {extend:Ext.Panel, alias:'widget.contractchart', layout:'fit', bodyStyle:{background:'#FFF'}, items:[{xtype:'chart', theme:'Eqonline1', store:{model:'eqOnline.model.ContractStatus'}, legend:{position:'left', itemSpacing:5, boxStrokeWidth:0, padding:0}, axes:[{type:'Numeric', position:'bottom', fields:['neurel', 'disprel', 'svokrel', 'ruekrel'], grid:true, label:{renderer:Ext.util.Format.numberRenderer('0%')}, minimum:0, maximum:100}], series:[{type:'arrowbar', axis:'bottom', xField:'text', yField:['neurel', 'disprel', 'svokrel', 'ruekrel'], title:[EQOnlineLocale.faellig, EQOnlineLocale.bearbeitung, EQOnlineLocale.durch, EQOnlineLocale.abgeschlossen], stacked:true, showInLegend:true, highlight:false, label:{display:'insideEnd', minMargin:80, 'text-anchor':'end', renderer:function(v) { if (v == 0) { return ''; } return v; }, field:['neu', 'disp', 'svok', 'ruek'], contrast:true}}]}]}); Ext.define('eqOnline.view.contract.Detail', {extend:Ext.Panel, alias:'widget.contractdetail', layout:{type:'vbox', align:'stretch'}, border:false, flex:1, initComponent:function() { this.items = [{layout:{type:'hbox'}, border:false, items:[{data:{}, flex:1, border:false, itemId:'header', tpl:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eDetailansicht zu {text} ({vtnum})\x3c/h1\x3e\x3c/div\x3e'}, {xtype:'button', text:EQOnlineLocale.nachrichtantuv, itemId:'ctMailTuvButton'}, {xtype:'button', text:EQOnlineLocale.emailsenden, itemId:'ctMailButton'}]}, {xtype:'contractchart', collapsible:true, height:150, itemId:'statusChart'}, {height:10, border:false}, {layout:{type:'hbox', align:'stretch'}, flex:1, xtype:'tabpanel', border:false, items:[{xtype:'terminzeilengrid', itemId:'contractTerminzeilen', title:EQOnlineLocale.terminuebersicht, colModel:'CTL'}, {xtype:'equipmenttable', itemId:'contractEquipments', store:'ContractEquipments', columns:this.columns, title:EQOnlineLocale.anlagenuebersicht}, {xtype:'contractdocuments', itemId:'documents', title:EQOnlineLocale.vertragsdokumente}, {xtype:'grid', itemId:'mitarbeiter', title:EQOnlineLocale.kontaktpersonen, store:{model:'eqOnline.model.Mitarbeiter'}, columns:[{header:EQOnlineLocale.funktion, width:100, dataIndex:'Funktion'}, {header:EQOnlineLocale.name, flex:1, dataIndex:'Name'}, {header:EQOnlineLocale.kostenstelle, width:100, dataIndex:'Kostenstelle'}, {header:EQOnlineLocale.tel, width:100, dataIndex:'Telefon'}, {header:EQOnlineLocale.email, width:100, dataIndex:'Email'}]}]}]; this.callParent(); }}); Ext.define('eqOnline.view.equipment.Tabelle', {extend:Ext.panel.Panel, alias:'widget.equipmenttable', layout:'fit', dockedItems:[{xtype:'toolbar', dock:'top', items:[{xtype:'button', text:EQOnlineLocale.layspeichern, itemId:'saveLayout'}, {xtype:'button', text:EQOnlineLocale.layzurueck, itemId:'resetLayout'}, '-\x3e', {xtype:'button', hidden:true, text:EQOnlineLocale.zuordnung, itemId:'showAssignments', action:'show'}]}], initComponent:function() { this.store = this.store || 'Eqtable'; this.items = [{xtype:'grid', itemId:'equipmentGrid', flex:1, columns:this.columns, store:this.store, border:false, columnLines:false, stateful:false, viewConfig:{loadMask:false}, plugins:[Ext.create('Ext.grid.plugin.CellEditing', {clicksToEdit:2})], features:[{ftype:'filters'}, {ftype:'renamer'}, {ftype:'checkall'}], selType:'cellmodel', dockedItems:[{xtype:'pagingtoolbar', plugins:['pagesize'], store:this.store, dock:'bottom', displayInfo:true, displayMsg:'Equipments {0} - {1} von {2}'}]}]; this.callParent(); }}); Ext.define('eqOnline.view.equipment.Terminzeilen', {extend:Ext.panel.Panel, alias:'widget.terminzeilengrid', layout:'fit', title:EQOnlineLocale.pruefungen, dockedItems:[{xtype:'toolbar', dock:'top', items:[{xtype:'button', text:EQOnlineLocale.layspeichern, itemId:'saveLayout'}, {xtype:'button', text:EQOnlineLocale.layzurueck, itemId:'resetLayout'}]}], initComponent:function() { this.callParent(); this.initNewItems(); }, initNewItems:function() { Ext.Ajax.request({url:'eqdetail', method:'GET', params:{OnInputProcessing:'getPruefungenColumns', colModel:this.colModel || 'TZL'}, callback:this.afterColumnRead, scope:this}); }, afterColumnRead:function(options, success, response) { var model = Ext.decode(response.responseText), columns = model.fields; this.removeAll(); this.add([{xtype:'grid', features:[{ftype:'grouping', enableGroupingMenu:false, enableNoGroups:false, hideGroupedHeader:true}], border:false, store:'Pruefungen', selType:'cellmodel', columns:columns}]); }}); Ext.define('eqOnline.store.Equipments', {extend:Ext.data.Store, model:'eqOnline.model.Equipment', remoteSort:true, proxy:{type:'ajax', url:'eqlist', simpleSortMode:true, timeout:120000, extraParams:{'OnInputProcessing':'getEquipments'}, reader:{type:'json', root:'items'}}}); Ext.define('eqOnline.store.Pruefungen', {extend:Ext.data.Store, model:'eqOnline.model.Pruefung'}); Ext.define('eqOnline.store.ContractEquipments', {extend:Ext.data.Store, model:'eqOnline.model.Equipment', remoteSort:true, proxy:new Ext.ux.data.PagingMemoryProxy({reader:{type:'json', root:'items'}})}); Ext.define('eqOnline.controller.Contractdetail', {extend:Ext.app.Controller, stores:['Contracts', 'Equipments', 'Pruefungen', 'ContractEquipments'], models:['Contract', 'Partner', 'Mitarbeiter', 'ContractDocFolder', 'ContractDoc', 'ContractStatus', 'ContractEquipment', 'Equipment', 'Pruefung'], views:['contract.Documents', 'contract.Chart', 'contract.Detail', 'equipment.Tabelle', 'equipment.Terminzeilen'], refs:[{ref:'content', selector:'#content'}, {ref:'partnerGrid', selector:'contractdetail grid[itemId\x3dpartner]'}, {ref:'docGrid', selector:'contractdetail grid[itemId\x3ddocuments]'}, {ref:'statusChart', selector:'contractdetail contractchart[itemId\x3dstatusChart] chart'}, {ref:'tzGrid', selector:'contractdetail terminzeilengrid[itemId\x3dcontractTerminzeilen] grid'}, {ref:'maGrid', selector:'contractdetail grid[itemId\x3dmitarbeiter]'}], currentContract:null, currentHighlight:null, mailToTuv:false, init:function() { this.control({'contractlist grid':{select:this.ctGridCellSelected}, 'contractdetail panel[itemId\x3dheader]':{render:function(panel) { panel.update(this.currentContract.data); }}, 'contractdetail equipmenttable[itemId\x3dcontractEquipments] grid':{render:this.loadSubStores}, 'contractdetail terminzeilengrid[itemId\x3dcontractTerminzeilen] grid':{render:this.loadTerminzeilen}, 'contractdetail grid[itemId\x3dpartner]':{render:this.loadPartnerDetails}, 'contractdetail grid[itemId\x3dmitarbeiter]':{render:this.loadMitarbeiterDetails}, 'contractdetail grid[itemId\x3ddocuments]':{render:this.loadDocumentDetails}, 'contractdetail contractdocuments':{select:this.showDocument}, 'contractdetail contractchart[itemId\x3dstatusChart] chart':{render:function(chart) { this.loadStatusList(); }, scope:this}, 'contractdetail button[itemId\x3dctMailTuvButton]':{click:this.sendCtMailTuv, scope:this}, 'contractdetail button[itemId\x3dctMailButton]':{click:this.sendCtMail, scope:this}}); this.application.getController('Application').on('navigate', this.processToken, this); }, doNavigation:function() { this.getContent().loadView('contractdetail', true, {columns:this.application.getController('Application').eqColumns}, 'contractdetail-' + this.currentContract.get('vtnum')); }, processToken:function(token) { if (token) { var parts = token.split(':'), length = parts.length; if (length == 2 && parts[0] == 'contractdetail') { this.showContract(parts[1]); } } }, showContract:function(vtnum) { if (!this.getContractsStore().count()) { this.getContractsStore().load({callback:function() { this.currentContract = this.getContractsStore().getById(vtnum); this.loadEquipments(); }, scope:this}); } else { this.currentContract = this.getContractsStore().getById(vtnum); this.loadEquipments(); } }, loadEquipments:function() { this.getEquipmentsStore().load({params:{getAll:'true', iv_contract:this.currentContract.get('vtnum')}, callback:this.doNavigation, scope:this}); }, loadTerminzeilen:function(grid) { grid.getStore().sort('equnr'); grid.getStore().load({url:'contract', params:{iv_contract:this.currentContract.get('vtnum')}}); }, loadSubStores:function() { var data = this.getEquipmentsStore().getProxy().reader.jsonData; this.getContractEquipmentsStore().getProxy().data = data; this.getContractEquipmentsStore().loadPage(1); }, ctGridCellSelected:function(model, record, row, column, opt) { if (model.view.getHeaderAtIndex(column).dataIndex.indexOf('auth_c') == -1) { var newToken = 'contractdetail:' + record.get('vtnum'), oldToken = Ext.History.getToken(); if (oldToken === null || oldToken.search(newToken) === -1) { Ext.History.add(newToken); } } }, filterPruefungen:function(item) { if (this.currentHighlight != null) { item.series.unHighlightItem(this.currentHighlight); } item.series.highlightItem(item); this.currentHighlight = item; var value = item.yField.replace('rel', ''); this.getTzGrid().getStore().clearFilter(); switch(value) { case 'neu': value = '[3,4]'; break; case 'disp': value = 2; break; case 'svok': value = 5; break; case 'ruek': value = 1; break; } this.getTzGrid().getStore().filter('tstat', new RegExp('^' + value + '$')); }, loadPartnerDetails:function() { this.getPartnerGrid().getStore().loadRecords(this.currentContract.Partner().data.items); }, loadMitarbeiterDetails:function() { this.getMaGrid().getStore().loadRecords(this.currentContract.Mitarbeiter().data.items); }, loadStatusList:function() { var data = this.currentContract.Status().data.items; this.getStatusChart().getStore().loadRecords(data); }, loadDocumentDetails:function() { var data = [], items = this.currentContract.Ordner().data.items; for (var i = 0, len = items.length; i < len; i++) { data = data.concat(items[i].Dokumente().data.items); } this.getDocGrid().getStore().loadRecords(data); }, showDocument:function(rowModel, record, index, opts) { Ext.create('Ext.Window', {title:EQOnlineLocale.vertragsdokument, width:400, height:500, layout:'fit', maximizable:true, constrainHeader:true, items:[{border:false, html:'\x3ciframe src\x3d"documents?OnInputProcessing\x3dgetVtDocument\x26Object_id\x3d' + record.get('Doc_Id') + '\x26ar_object\x3d' + record.get('ar_object') + '\x26archiv_id\x3d' + record.get('archiv_id') + '\x26sap_object\x3d' + record.get('sap_object') + '\x26dtype\x3d' + record.get('dtype') + '\x26text\x3d' + record.get('Name') + '" border\x3d0 frameborder\x3d0 style\x3d"width:100%;height:100%"\x3e\x3c/iframe\x3e'}]}).show(); }, sendCtMailTuv:function() { this.mailToTuv = true; Ext.Ajax.request({url:'user', method:'GET', params:{OnInputProcessing:'get_data', userName:Ext.getStore('Users').getAt(0).get('kuser')}, callback:this.showCtMailWin, scope:this}); }, sendCtMail:function() { this.mailToTuv = false; Ext.Ajax.request({url:'user', method:'GET', params:{OnInputProcessing:'get_data', userName:Ext.getStore('Users').getAt(0).get('kuser')}, callback:this.showCtMailWin, scope:this}); }, showCtMailWin:function(options, success, response) { var ctData = this.currentContract.data; var userData = Ext.decode(response.responseText).data; var recipient = this.currentContract.Mitarbeiter() ? this.currentContract.Mitarbeiter().findRecord('Funktion', 'PD') : null; var recipient_address = ''; if (recipient) { recipient_address = recipient.get('Email'); } Ext.create('Ext.Window', {title:EQOnlineLocale.emailben + ctData['text'] + ' (' + ctData['vtnum'] + ')', layout:'fit', maximizable:true, constrainHeader:true, width:500, height:400, items:{xtype:'form', defaultType:'textfield', border:false, layout:{type:'vbox', align:'stretch'}, padding:10, items:[{xtype:'hidden', name:'mail_to_tuv', value:this.mailToTuv}, {xtype:'hidden', name:'contract', value:ctData['vtnum']}, {fieldLabel:EQOnlineLocale.empfaenger, border:false, hidden:!this.mailToTuv, value:recipient_address || '', xtype:'displayfield'}, {fieldLabel:EQOnlineLocale.empfaenger, border:false, name:'email_recipient', value:recipient_address || '', hidden:this.mailToTuv}, {fieldLabel:EQOnlineLocale.ccempfaenger, border:false, name:'email_cc', value:userData.MAIL}, {fieldLabel:EQOnlineLocale.betreff, name:'email_subject', border:false, value:EQOnlineLocale.eqnachrichtzu + ctData['text'] + ' (' + ctData['vtnum'] + ')'}, {fieldLabel:EQOnlineLocale.nachricht, name:'email_text', border:false, xtype:'textarea', height:200, value:EQOnlineLocale.vertrag + ' ' + ctData['text'] + '\n' + EQOnlineLocale.tuevvertrag + ' ' + ctData['vtnum'] + '\n' + EQOnlineLocale.mitteilungvon + ' ' + userData['TITLE'] + ' ' + userData['LAST_NAME'] + '(' + Ext.getStore('Users').getAt(0).get('kuser') + ')'}], buttons:[{text:EQOnlineLocale.senden, handler:function(button) { button.up('form').submit({url:'application', params:{OnInputProcessing:'send_eq_mail'}}); button.up('window').close(); }}]}}).show(); }}); Ext.define('eqOnline.model.Eqdocument', {extend:Ext.data.Model, fields:[{name:'filenum', mapping:'dateinum'}, {name:'filename', mapping:'dateiname'}, {name:'uploaddate', mapping:'aedat', type:'date', convert:function(v, rec) { return Ext.Date.parse(rec.raw.aedat + rec.raw.aetim, 'YmdHis'); }}, {name:'username', mapping:'uname'}, {name:'filesize', mapping:'groesse', type:'int'}, 'action'], proxy:{type:'ajax', url:'eqdetail', simpleSortMode:true, extraParams:{'OnInputProcessing':'getDocuments'}, reader:{type:'json', root:'items'}}}); Ext.define('eqOnline.view.equipment.Detail', {extend:Ext.Panel, alias:'widget.equipmentdetail', border:false, layout:{type:'vbox', align:'stretch'}, defaults:{border:false}, items:[{layout:{type:'hbox'}, border:false, items:[{data:{}, flex:1, border:false, itemId:'header', tpl:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eDetailansicht zu {eartx} ({equnr})\x3c/h1\x3e\x3c/div\x3e'}, {xtype:'button', text:EQOnlineLocale.nachrichtantuv, itemId:'eqMailTuvButton'}, {xtype:'button', text:EQOnlineLocale.emailsenden, itemId:'eqMailButton'}]}, {height:200, border:true, title:'Equipmentdetails', xtype:'tabpanel', collapsible:true, items:[{title:'Details', border:false, cls:'eqo', xtype:'form', layout:{type:'hbox'}, items:[{xtype:'fieldset', cls:'eqo', border:false, width:250, title:EQOnlineLocale.standort, defaultType:'displayfield', items:[{name:'sto_name1'}, {name:'sto_name2'}, {name:'sto_name3'}, {name:'sto_name4'}, {name:'sto_str'}, {xtype:'fieldcontainer', layout:'hbox', defaultType:'displayfield', items:[{name:'sto_plz', width:40, xtype:'displayfield'}, {name:'sto_ort', flex:1, xtype:'displayfield'}]}]}, {xtype:'fieldset', cls:'eqo', border:false, flex:1, title:EQOnlineLocale.anlagendaten, defaultType:'displayfield', defaults:{labelWidth:70}, items:[{name:'fabrnr', fieldLabel:EQOnlineLocale.fabrnr}, {name:'baujj', fieldLabel:EQOnlineLocale.baujahr}, {name:'invnr', fieldLabel:EQOnlineLocale.invnr}, {name:'zzhinext', fieldLabel:EQOnlineLocale.hinweise}]}]}, {xtype:'eqdocuments'}, {xtype:'eqcharts', width:350}, {xtype:'treepanel', title:'Equipmentfamilie', rootVisible:false, forceFit:true, columns:[{xtype:'treecolumn', text:'Equipment', dataIndex:'equnr'}], viewConfig:{getRowClass:function(record, rowIndex, rowParams, store) { return record.get('isInContract') ? '' : 'x-item-disabled'; }}, listeners:{select:function(grid, record) { if (record.get('isInContract')) { Ext.History.add('equipmentdetail:' + record.get('equnr')); } }}, store:{fields:[{name:'equnr', type:'int'}, {name:'isInContract', type:'boolean'}], proxy:{type:'ajax', url:'eqdetail', extraParams:{OnInputProcessing:'getCurrentEQStructure'}}, root:{expanded:true}}}]}, {height:10}, {xtype:'terminzeilengrid', title:EQOnlineLocale.pruefungenEQ, flex:1, border:true}]}); Ext.define('eqOnline.view.equipment.Documents', {extend:Ext.grid.Panel, alias:'widget.eqdocuments', title:'Dokumente zum Equipment', selType:'cellmodel', tbar:{items:[{xtype:'form', border:false, url:'eqdetail', method:'POST', layout:'hbox', height:22, baseParams:{OnInputProcessing:'upload'}, items:[{fieldLabel:EQOnlineLocale.neudok, xtype:'filefield', buttonText:EQOnlineLocale.dateiaus}, {xtype:'button', text:EQOnlineLocale.hochladen, itemId:'addFile'}]}, '-\x3e', {width:130, xtype:'progressbar', value:0, text:'', itemId:'freeSpace'}]}, columns:[{header:'Aktion', dataIndex:'action', xtype:'actioncolumn', icon:'ext/ux/css/images/delete.png', tooltip:EQOnlineLocale.loeschen, width:20}, {header:EQOnlineLocale.dateiname, dataIndex:'filename', flex:1}, {header:EQOnlineLocale.hochgeladen, dataIndex:'uploaddate', xtype:'datecolumn'}, {header:EQOnlineLocale.benutzer, dataIndex:'username'}, {header:EQOnlineLocale.groesse, xtype:'numbercolumn', dataIndex:'filesize', renderer:function(v) { return Math.round(v / 1024); }}], store:'Eqdocuments'}); Ext.define('eqOnline.view.equipment.Charts', {extend:Ext.Panel, alias:'widget.eqcharts', layout:'fit', title:EQOnlineLocale.pruefergebnis, items:[{xtype:'chart', itemId:'detailChart', store:'Tzchartvalues', legend:{position:'right'}, series:[{showInLegend:true, type:'pie', angleField:'value', tips:{trackMouse:true, width:140, height:28, renderer:function(storeItem, item) { var total = 0; storeItem.stores[0].each(function(rec) { total += rec.get('value'); }); this.setTitle(Math.round(storeItem.get('value') / total * 100) + '%'); }}, label:{field:'name'}}]}]}); Ext.define('eqOnline.store.Eqdocuments', {extend:Ext.data.Store, model:'eqOnline.model.Eqdocument', remoteGroup:false, remoteSort:true}); Ext.define('eqOnline.store.Pruefungenchart', {extend:Ext.data.Store, model:'eqOnline.model.Pruefung', remoteSort:false}); Ext.define('eqOnline.store.Tzchartvalues', {extend:Ext.data.Store, fields:['name', 'value'], remoteGroup:false, remoteSort:false}); Ext.define('eqOnline.controller.Eqdetail', {extend:Ext.app.Controller, stores:['Eqdocuments', 'Pruefungen', 'Equipments', 'Pruefungenchart', 'Tzchartvalues'], models:['Eqdocument', 'Pruefung'], views:['equipment.Detail', 'equipment.Terminzeilen', 'equipment.Documents', 'equipment.Charts'], firstEq:true, currentHighlight:null, detailMask:null, currentEq:null, refs:[{ref:'docs', selector:'eqdocuments'}, {ref:'content', selector:'#content'}], init:function() { this.control({'equipmentdetail panel[itemId\x3dheader]':{render:function(panel) { panel.update(this.getEquipmentsStore().findRecord('equnr', this.currentEq).data); }}, 'equipmentdetail form':{afterrender:function(panel) { panel.loadRecord(this.getEquipmentsStore().findRecord('equnr', this.currentEq)); }}, 'equipmentdetail grid':{afterrender:function(grid) { grid.getStore().clearGrouping(); grid.getStore().load(); }}, 'equipmenttable grid':{select:this.eqGridCellSelected}, 'eqdocuments':{select:this.showDocument}, 'eqdocuments button[itemId\x3daddFile]':{click:this.uploadFile}, 'eqdocuments actioncolumn':{click:this.deleteFile}, 'equipmentdetail terminzeilengrid grid':{columnshow:this.showColumn, columnhide:this.hideColumn, columnmove:this.moveColumn}, 'terminzeilengrid grid':{select:this.getDocWindow}, 'equipmentdetail terminzeilengrid button[itemId\x3dsaveLayout]':{click:this.saveLayout}, 'equipmentdetail terminzeilengrid button[itemId\x3dresetLayout]':{click:this.resetLayout}, 'chart[itemId\x3ddetailChart]':{render:function(chart) { chart.series.get(0).listeners = {'itemmouseup':this.filterPruefungen, scope:this}; }, scope:this}, 'equipmentdetail button[itemId\x3deqMailButton]':{click:this.sendEqMail, scope:this}, 'equipmentdetail button[itemId\x3deqMailTuvButton]':{click:this.sendEqMailTuv, scope:this}}); this.getPruefungenStore().on('load', function(store, records) { var aggStore = this.getPruefungenchartStore(); aggStore.loadRecords(records); aggStore.group('mstattext'); var storeData = aggStore.count(true); var data = []; for (var prid in storeData) { if (prid) { data.push({name:Ext.util.Format.ellipsis(prid, 20, true), value:storeData[prid]}); } } this.getTzchartvaluesStore().removeAll(); this.getTzchartvaluesStore().loadData(data); }, this); this.getEqdocumentsStore().on('load', this.updateFreeSpace, this); Ext.History.on('change', this.processToken, this); this.processToken(Ext.History.getToken()); }, processToken:function(token) { if (token) { var parts = token.split(':'), length = parts.length; if (length == 2 && parts[0] == 'equipmentdetail') { this.showEquipment(parts[1]); } } }, eqGridCellSelected:function(model, record, row, column, opt) { var column = model.view.getHeaderAtIndex(column); if (!column.getEditor()) { var target = record.get('equnr'); var newToken = 'equipmentdetail:' + target, oldToken = Ext.History.getToken(); if (oldToken === null || oldToken.search(newToken) === -1) { Ext.History.add(newToken); } } }, showEquipment:function(equnr) { this.currentEq = equnr; Ext.Ajax.request({url:'eqdetail', method:'GET', params:{OnInputProcessing:'setCurrentEQ', equnr:equnr}, callback:this.afterEQSet, scope:this}); }, afterEQSet:function() { this.getPruefungenStore().removeAll(); this.getPruefungenStore().clearFilter(); if (!this.getEquipmentsStore().count()) { this.getEquipmentsStore().load({params:{getAll:'true', iv_eqo_contract:'true'}, callback:function() { this.getContent().loadView('equipmentdetail', true, null, 'equipmentdetail-' + this.currentEq); }, scope:this}); } else { this.getContent().loadView('equipmentdetail', true, null, 'equipmentdetail-' + this.currentEq); } }, getDocWindow:function(selModel, record, row, column) { if (selModel.getHeaderCt().getHeaderAtIndex(column).dataIndex == 'pruefbericht') { Ext.Ajax.request({method:'GET', url:'eqdetail', params:{OnInputProcessing:'getDocumentList', ztsbln:record.get('ztsbln')}, success:this.showDocWindow, scope:this}); } }, showDocWindow:function(response) { var docdownload = Ext.getStore('Users').getAt(0).get('docdownload'); if (docdownload === false) { this.showDocViewWindow(response); } else { if (docdownload === true) { this.showDocDownloadWindow(response); } else { Ext.Msg.show({title:'Dokumente anzeigen oder downloaden?', msg:'Bitte wählen Sie aus, ob Sie die Dokumente direkt im Browser anzeigen möchten (erfordert evtl. Plugins), oder die Dokumente zum Download angeboten bekommen möchten.\x3cbr/\x3e' + 'Sie können diese Einstellung jederzeit im Benutzmenü verändern.', buttons:Ext.MessageBox.YESNO, buttonText:{yes:'Direkt anzeigen', no:'Download anbieten'}, fn:function(buttonId, text, opt) { Ext.getStore('Users').getAt(0).set('docdownload', buttonId == 'no' ? true : false); this.showDocViewWindow(opt.response); }, response:response, scope:this}); } } }, showDocDownloadWindow:function(response) { var docs = Ext.decode(response.responseText), buttons = []; if (docs.length == 1) { document.location.href = 'documents?OnInputProcessing\x3dgetPbDocument\x26download\x3dX\x26Object_id\x3d' + docs[0].archiv_id; } else { for (var i = 0, len = docs.length; i < len; i++) { buttons.push({border:false, text:docs[i].name, target:docs[i].archiv_id, handler:function(button) { document.location.href = 'documents?OnInputProcessing\x3dgetPbDocument\x26download\x3dX\x26Object_id\x3d' + button.target; }}); } Ext.create('Ext.menu.Menu', {title:'Dokumente zur Terminzeile', frame:true, items:buttons}).show(); } }, showDocViewWindow:function(response) { var docs = Ext.decode(response.responseText), tabs = []; for (var i = 0, len = docs.length; i < len; i++) { tabs.push({border:false, title:docs[i].name, xtype:'panel', html:'\x3ciframe src\x3d"documents?OnInputProcessing\x3dgetPbDocument\x26Object_id\x3d' + docs[i].archiv_id + '" border\x3d0 frameborder\x3d0 style\x3d"width:100%;height:100%"\x3e\x3c/iframe\x3e', bbar:[{xtype:'tbtext', text:'Verteiler: ' + (docs[i].verteiler || 'ohne')}]}); } Ext.create('Ext.Window', {title:'Dokumente zur Terminzeile', width:400, height:500, layout:'fit', maximizable:true, constrainHeader:true, items:{xtype:'tabpanel', border:false, items:tabs}}).show(); }, showDocument:function(selModel, record, row, column) { if (selModel.getHeaderCt().getHeaderAtIndex(column).dataIndex == 'filename') { Ext.create('Ext.Window', {title:'Dokument zu Equipment', width:400, height:500, layout:'fit', maximizable:true, constrainHeader:true, items:[{border:false, html:'\x3ciframe src\x3d"documents?OnInputProcessing\x3dgetEqDocument\x26equnr\x3d' + this.currentEq + '\x26dateinum\x3d' + record.get('filenum') + '" border\x3d0 frameborder\x3d0 style\x3d"width:100%;height:100%"\x3e\x3c/iframe\x3e'}]}).show(); } }, saveLayout:function() { Ext.Ajax.request({method:'GET', url:'eqdetail', params:{OnInputProcessing:'saveLayout'}, success:function() { Ext.Msg.alert('Änderungen gespeichert', 'Ihre Änderungen wurden übernommen'); }}); }, resetLayout:function() { Ext.Ajax.request({method:'GET', url:'eqdetail', params:{OnInputProcessing:'resetLayout'}, callback:this.reloadModel, scope:this}); }, reloadModel:function() { Ext.Ajax.request({url:'eqdetail', method:'GET', params:{OnInputProcessing:'getPruefungenColumns'}, callback:this.afterModelReload, scope:this}); }, afterModelReload:function(options, success, response) { equipmentModel = Ext.decode(response.responseText); this.getGrid().reconfigure(this.getGrid().getStore(), equipmentModel.fields); }, showColumn:function(header, column, opt) { if (column.dataIndex.indexOf('auth_t_') != -1) { return; } var columns = header.query('gridcolumn[hidden\x3dfalse]'); for (var i = 0, len = columns.length; i < len; i++) { if (columns[i].id == column.id) { var insertBefore = columns[i + 1].dataIndex; } } Ext.Ajax.request({method:'GET', url:'eqdetail', params:{OnInputProcessing:'fieldsassign', fieldName:column.dataIndex, insertBefore:insertBefore}}); }, hideColumn:function(header, column, opt) { if (column.dataIndex.indexOf('auth_t_') != -1) { return; } var columns = header.query('gridcolumn[hidden\x3dfalse]'); for (var i = 0, len = columns.length; i < len; i++) { if (columns[i].id == column.id) { var insertBefore = columns[i + 1].dataIndex; } } Ext.Ajax.request({method:'GET', url:'eqdetail', params:{OnInputProcessing:'fieldsremove', fieldName:column.dataIndex}}); }, moveColumn:function(header, column, oldPosition, newPosition) { var visibleColumns = header.getVisibleGridColumns(), colConfig = []; for (var i = 0; i < visibleColumns.length; i++) { colConfig.push(visibleColumns[i].dataIndex + ',' + (i + 1) * 10); } Ext.Ajax.request({method:'GET', url:'eqdetail', params:{OnInputProcessing:'movefields', newOrder:colConfig.join(';')}}); }, filterPruefungen:function(item) { if (this.currentHighlight != null) { item.series.unHighlightItem(this.currentHighlight); } item.series.highlightItem(item); this.currentHighlight = item; var value = item.storeItem.get('name'); this.getPruefungenStore().clearFilter(); this.getPruefungenStore().filter('mstattext', new RegExp('^' + value + '$')); }, sendEqMail:function() { this.mailToTuv = false; Ext.Ajax.request({url:'user', method:'GET', params:{OnInputProcessing:'get_data', userName:Ext.getStore('Users').getAt(0).get('kuser')}, callback:this.showEqMailWin, scope:this}); }, sendEqMailTuv:function() { Ext.Ajax.request({url:'eqdetail', method:'GET', params:{OnInputProcessing:'get_beamail'}, callback:this.doSendEqMailTuv, scope:this}); }, doSendEqMailTuv:function(options, success, response) { this.beamail = ''; if (success) { var respData = Ext.decode(response.responseText); if (respData.beamail) { this.beamail = respData.beamail; } } this.mailToTuv = true; Ext.Ajax.request({url:'user', method:'GET', params:{OnInputProcessing:'get_data', userName:Ext.getStore('Users').getAt(0).get('kuser')}, callback:this.showEqMailWin, scope:this}); }, showEqMailWin:function(options, success, response) { var eqData = this.getEquipmentsStore().findRecord('equnr', this.currentEq).data; var userData = Ext.decode(response.responseText).data; Ext.create('Ext.Window', {title:EQOnlineLocale.emailben + eqData['eartx'] + ' (' + eqData['equnr'] + ')', layout:'fit', maximizable:true, constrainHeader:true, width:500, height:400, items:{xtype:'form', defaultType:'textfield', border:false, layout:{type:'vbox', align:'stretch'}, padding:10, items:[{xtype:'hidden', name:'mail_to_tuv', value:this.mailToTuv}, {xtype:'hidden', name:'equnr', value:eqData['equnr']}, {fieldLabel:EQOnlineLocale.empfaenger, border:false, hidden:!this.mailToTuv, value:this.beamail || '', xtype:'displayfield'}, {fieldLabel:EQOnlineLocale.empfaenger, border:false, hidden:this.mailToTuv, name:'email_recipient', value:this.beamail || ''}, {fieldLabel:EQOnlineLocale.ccempfaenger, border:false, name:'email_cc', value:userData.MAIL}, {fieldLabel:EQOnlineLocale.betreff, name:'email_subject', border:false, value:EQOnlineLocale.eqnachrichtzu + eqData['eartx'] + ' (' + eqData['equnr'] + ')'}, {fieldLabel:EQOnlineLocale.nachricht, name:'email_text', border:false, xtype:'textarea', height:200, value:EQOnlineLocale.objektart + ' ' + eqData['eartx'] + '\n' + EQOnlineLocale.fabriknummer + ' ' + eqData['fabrnr'] + '\n' + EQOnlineLocale.standort + ' ' + eqData['sto_str'] + '\n ' + eqData['sto_plz'] + ' ' + eqData['sto_ort'] + '\n' + EQOnlineLocale.equnr + ' ' + eqData['equnr'] + '\n' + '\n' + EQOnlineLocale.mitteilungvon + userData['TITLE'] + ' ' + userData['LAST_NAME'] + ' (' + Ext.getStore('Users').getAt(0).get('kuser') + ')'}], buttons:[{text:EQOnlineLocale.senden, handler:function(button) { button.up('form').submit({url:'application', params:{OnInputProcessing:'send_eq_mail'}}); button.up('window').close(); }}]}}).show(); this.beamail = ''; }, deleteFile:function(grid, cell, rowIndex, colIndex, ev, rec) { Ext.Msg.confirm({title:'Dokument löschen', msg:'Möchten Sie das Dokument wirklich löschen?', buttons:Ext.Msg.YESNO, fn:function(buttonId) { if (buttonId == 'yes') { Ext.Ajax.request({url:'eqdetail', params:{OnInputProcessing:'deletefile', dateinum:rec.get('filenum')}, callback:function() { this.getDocs().getStore().load(); }, scope:this}); } }, scope:this}); }, uploadFile:function() { this.getDocs().down('form').submit({success:function() { this.getDocs().getStore().load(); }, scope:this}); }, updateFreeSpace:function(store) { var pBar = this.getDocs().down('progressbar[itemId\x3dfreeSpace]'); var usedSpace = store.proxy.reader.rawData.usedSpace; var availSpace = store.proxy.reader.rawData.availSpace; pBar.updateProgress(usedSpace / availSpace, Ext.util.Format.number(usedSpace / 1024, '0,0/i') + '/' + Math.round(availSpace / 1024) + ' MB'); }}); Ext.define('eqOnline.view.equipment.List', {extend:Ext.Panel, alias:'widget.equipmentlist', itemId:'eqipmentList', layout:{type:'vbox', align:'stretch'}, border:false, flex:1, initComponent:function() { this.items = [{xtype:'listcharts', collapsible:true, height:200}, {height:10, border:false}, {xtype:'equipmenttable', title:EQOnlineLocale.AnlagenuebsText, itemId:'equipmentGrid', columns:this.columns, flex:1}]; this.callParent(); }}); Ext.define('eqOnline.view.equipment.ListCharts', {extend:Ext.Panel, alias:'widget.listcharts', layout:'card', defaults:{border:false}, lbar:[{text:EQOnlineLocale.handlungsbedarf, itemId:'chart1Btn'}, {text:EQOnlineLocale.pruefergebnis, itemId:'chart2Btn'}, {text:EQOnlineLocale.faelligkeiten, itemId:'chart3Btn'}], items:[{xtype:'chart', store:{fields:['standort', 'ja', 'nein'], remoteGroup:false, remoteSort:false}, legend:{position:'right'}, axes:[{type:'Numeric', position:'left', fields:['ja', 'nein'], minimum:0, decimals:0}, {type:'Category', position:'bottom', fields:['standort']}], series:[{type:'column', xField:'eqart', yField:['ja', 'nein'], title:[EQOnlineLocale.handlungsbedarf, EQOnlineLocale.keinhandlungsbedarf], axis:'left', label:{display:'insideEnd', field:['ja', 'nein']}}]}, {layout:{type:'hbox', align:'stretch'}, items:[{xtype:'chart', flex:1, store:{fields:['anzahl'], remoteGroup:false, remoteSort:false}, axes:[{type:'gauge', position:'gauge', minimum:0, maximum:100, steps:10, margin:-5, title:EQOnlineLocale.keinemaengel}], series:[{type:'gauge', field:'anzahl', donut:60, colorSet:['#115fa6', '#ddd'], tips:{trackMouse:true, width:250, renderer:function(storeItem, item) { this.setTitle(storeItem.get('anzahl') + ' ' + EQOnlineLocale.eqohnemangel); }}}]}, {xtype:'chart', flex:1, store:{fields:['anzahl'], remoteGroup:false, remoteSort:false}, axes:[{type:'gauge', position:'gauge', minimum:0, maximum:100, steps:10, margin:-5, title:EQOnlineLocale.geringmaengel}], series:[{type:'gauge', field:'anzahl', donut:60, colorSet:['#ffd13e', '#ddd'], tips:{trackMouse:true, width:250, renderer:function(storeItem, item) { this.setTitle(storeItem.get('anzahl') + ' ' + EQOnlineLocale.eqgeringmangel); }}}]}, {xtype:'chart', flex:1, store:{fields:['anzahl'], remoteGroup:false, remoteSort:false}, axes:[{type:'gauge', position:'gauge', minimum:0, maximum:100, steps:10, margin:-5, title:EQOnlineLocale.erhebmaengel}], series:[{type:'gauge', field:'anzahl', donut:60, colorSet:['#ff8809', '#ddd'], tips:{trackMouse:true, width:250, renderer:function(storeItem, item) { this.setTitle(storeItem.get('anzahl') + ' ' + EQOnlineLocale.eqerhebmangel); }}}]}, {xtype:'chart', flex:1, store:{fields:['anzahl'], remoteGroup:false, remoteSort:false}, axes:[{type:'gauge', position:'gauge', minimum:0, maximum:100, steps:10, margin:-5, title:EQOnlineLocale.gefmaengel}], series:[{type:'gauge', field:'anzahl', donut:60, colorSet:['#a61120', '#ddd'], tips:{trackMouse:true, width:250, renderer:function(storeItem, item) { this.setTitle(storeItem.get('anzahl') + ' ' + EQOnlineLocale.eqgefmangel); }}}]}, {xtype:'chart', flex:1, store:{fields:['anzahl'], remoteGroup:false, remoteSort:false}, axes:[{type:'gauge', position:'gauge', minimum:0, maximum:100, steps:10, margin:-5, title:EQOnlineLocale.keinergebnis}], series:[{type:'gauge', field:'anzahl', donut:60, colorSet:['#999', '#ddd'], tips:{trackMouse:true, width:250, renderer:function(storeItem, item) { this.setTitle(storeItem.get('anzahl') + ' ' + EQOnlineLocale.eqkeinergebnis); }}}]}]}, {xtype:'chart', store:{fields:[{name:'quarter', type:'date'}, 'count'], remoteGroup:false, remoteSort:false}, axes:[{type:'Numeric', position:'left', fields:['count'], minimum:0, decimals:0}, {type:'Category', position:'bottom', label:{renderer:function(v) { v = new Date(v); return 'Q' + (parseInt(v.getMonth() / 3, 10) + 1) + '/' + v.getFullYear(); }}, fields:'quarter'}], series:[{type:'column', xField:'quarter', yField:'count', axis:'left', label:{display:'insideEnd', field:['count']}}]}]}); Ext.define('eqOnline.store.Eqtable', {extend:Ext.data.Store, model:'eqOnline.model.Equipment', remoteSort:true, proxy:new Ext.ux.data.PagingMemoryProxy({reader:{type:'json', root:'items'}})}); Ext.define('eqOnline.store.Eqcharts', {extend:Ext.data.Store, model:'eqOnline.model.Equipment', proxy:{type:'memory', simpleSortMode:true, limitParam:false, reader:{type:'json', root:'items'}}, remoteSort:false}); Ext.define('eqOnline.controller.Eqlist', {extend:Ext.app.Controller, stores:['Users', 'Equipments', 'Eqtable', 'Eqcharts'], models:['Equipment'], views:['equipment.List', 'equipment.Tabelle', 'equipment.ListCharts'], refs:[{ref:'eqTable', selector:'equipmenttable[itemId\x3dequipmentGrid]'}, {ref:'grid', selector:'equipmenttable[itemId\x3dequipmentGrid] grid'}, {ref:'charts', selector:'listcharts'}, {ref:'content', selector:'#content'}], initRun:true, init:function() { this.control({'equipmenttable[itemId\x3dequipmentGrid] grid':{afterrender:this.prepareView, columnshow:this.showColumn, columnhide:this.hideColumn, columnmove:this.moveColumn, edit:this.editCell, filterupdate:this.filterCharts, columnrenamed:this.renameColumn}, 'equipmenttable[itemId\x3dequipmentGrid] button[itemId\x3dsaveLayout]':{click:this.saveLayout}, 'equipmenttable[itemId\x3dequipmentGrid] button[itemId\x3dresetLayout]':{click:this.resetLayout}, 'equipmenttable[itemId\x3dequipmentGrid] button[itemId\x3dshowAssignments]':{click:this.showAssignments}, 'equipmenttable[itemId\x3dequipmentGrid] pagingtoolbar':{pagesizechanged:this.setPageSize}, 'listcharts toolbar button':{click:this.changeChart}, '#navigation':{itemclick:this.onNavigation}}); this.application.getController('Application').on('navigate', this.processToken, this); }, prepareData:function(grid) { this.getEqtableStore().load(); }, restoreFilterState:function(grid) { if (!this.application.filterState) { return; } grid.filters.createFilters(); }, saveFilterState:function(grid, state, eOpts) { if (grid.initRun === false) { grid.filters.saveState(grid, this.application.getController('Application').eqGridState); } else { state.filters = this.application.getController('Application').eqGridState; grid.initRun = false; } return true; }, editCell:function(editor, obj) { var rec = obj.record, equnr = rec.get('equnr'); if (obj.field.indexOf('auth_t') != -1) { Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'setAssignment', username:obj.field.replace('auth_t_', ''), equnr:equnr, assign:obj.value}}); rec.set(obj.field, obj.value ? 'X' : ''); } if (obj.field.indexOf('custom') != -1 || obj.field.indexOf('kf_') != -1) { var rec = obj.record; Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'setCustomValue', column:obj.field, equnr:equnr, value:obj.value}}); } var mod = Ext.Array.filter(obj.grid.getStore().getProxy().data.items, function(item) { return item.equnr == equnr; }); if (mod.length == 1) { mod[0][obj.field] = rec.get(obj.field); } }, saveLayout:function() { Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'saveLayout'}, success:function() { Ext.Ajax.request({url:'eqlist', method:'GET', params:{OnInputProcessing:'getGridColumns'}, callback:this.afterColumnSave, scope:this}); }, scope:this}); }, afterColumnSave:function(options, success, response) { var model = Ext.decode(response.responseText), columns = model.columns, pageSize = model.meta.pageSize; this.application.getController('Application').eqColumns = columns; this.application.getController('Application').eqPageSize = pageSize; Ext.Msg.alert('Änderungen gespeichert', 'Ihre Änderungen wurden übernommen'); }, resetLayout:function() { Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'resetLayout'}, callback:this.reloadModel, scope:this}); }, reloadModel:function() { Ext.Ajax.request({url:'eqlist', method:'GET', params:{OnInputProcessing:'getGridColumns'}, callback:this.afterColumnReset, scope:this}); }, afterColumnReset:function(options, success, response) { var model = Ext.decode(response.responseText), columns = model.columns, pageSize = model.meta.pageSize; this.application.getController('Application').eqColumns = columns; this.application.getController('Application').eqPageSize = pageSize; this.getGrid().getStore().pageSize = pageSize; this.getGrid().reconfigure(this.getGrid().getStore(), columns); Ext.Msg.alert('Änderungen zurückgesetzt', 'Ihre Änderungen wurden zurückgesetzt'); }, showAssignments:function() { var button = this.getEqTable().down('button[itemId\x3dshowAssignments]'); var cols = this.getGrid().columns; for (var i = 0, len = cols.length; i < len; i++) { if (cols[i].dataIndex.indexOf('auth_t_') != -1) { if (button.action == 'show') { cols[i].show(); } else { cols[i].hide(); } } } button.setText(button.action == 'show' ? EQOnlineLocale.zuordnungaus : EQOnlineLocale.zuordnung); button.action = button.action == 'show' ? 'hide' : 'show'; }, setPageSize:function(toolbar, pageSize) { Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'setPageSize', pageSize:pageSize}}); }, showColumn:function(header, column, opt) { if (column.dataIndex.indexOf('auth_t_') != -1) { return; } var columns = header.query('gridcolumn[hidden\x3dfalse]'); for (var i = 0, len = columns.length; i < len; i++) { if (columns[i].id == column.id) { var insertBefore = columns[i + 1].dataIndex; } } Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'fieldsassign', fieldName:column.dataIndex, insertBefore:insertBefore}}); }, hideColumn:function(header, column, opt) { if (column.dataIndex.indexOf('auth_t_') != -1) { return; } var columns = header.query('gridcolumn[hidden\x3dfalse]'); for (var i = 0, len = columns.length; i < len; i++) { if (columns[i].id == column.id) { var insertBefore = columns[i + 1].dataIndex; } } Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'fieldsremove', fieldName:column.dataIndex}}); }, moveColumn:function(header, column, oldPosition, newPosition) { var visibleColumns = header.getVisibleGridColumns(), colConfig = []; for (var i = 0; i < visibleColumns.length; i++) { colConfig.push(visibleColumns[i].dataIndex + ',' + (i + 1) * 10); } Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'movefields', newOrder:colConfig.join(';')}}); }, renameColumn:function(renamer, header, text) { Ext.Ajax.request({method:'GET', url:'eqlist', params:{OnInputProcessing:'columnrename', column:header.dataIndex, text:text}}); }, loadEquipments:function() { this.getEquipmentsStore().load({params:{getAll:'true', iv_eqo_contract:'true'}, callback:this.doNavigation, scope:this}); }, prepareView:function(grid) { this.prepareData(grid); this.loadSubStores(); if (this.application.getController('User').isAdmin()) { this.getEqTable().down('button[itemId\x3dshowAssignments]').show(); } }, loadSubStores:function() { this.getEqchartsStore().getProxy().data = this.getEquipmentsStore().getProxy().reader.jsonData; this.getEqchartsStore().load({callback:this.prepareChartStores, scope:this}); }, filterCharts:function(filterFeature, filter) { var state = filterFeature.saveState({}, {}); this.application.filterState = state; this.getEqchartsStore().filterBy(filterFeature.getRecordFilter()); this.prepareChartStores(); }, changeChart:function(button) { switch(button.getItemId()) { case 'chart1Btn': this.getCharts().getLayout().setActiveItem(0); break; case 'chart2Btn': this.getCharts().getLayout().setActiveItem(1); break; case 'chart3Btn': this.getCharts().getLayout().setActiveItem(2); break; } }, prepareChartStores:function() { this.getEqchartsStore().group('sto_ort'); var groups = this.getEqchartsStore().getGroups(); var data = []; if (groups.length < 30) { for (var group in groups) { var groupData = {standort:groups[group].name, ja:0, nein:0}; for (var i = 0, len = groups[group].children.length; i < len; i++) { var child = groups[group].children[i]; switch(child.get('handlbedkz')) { case 'J': groupData.ja++; break; case 'N': groupData.nein++; break; } } data.push(groupData); } this.getCharts().items.get(0).getStore().loadData(data); } else { this.getCharts().items.get(0).hide(); } this.getEqchartsStore().clearGrouping(); this.getEqchartsStore().group('mstat'); var all = this.getEqchartsStore().count(), chartItems = this.getCharts().items.get(1).items; groups = this.getEqchartsStore().count(true); chartItems.get(0).axes.get('gauge').maximum = all; chartItems.get(1).axes.get('gauge').maximum = all; chartItems.get(2).axes.get('gauge').maximum = all; chartItems.get(3).axes.get('gauge').maximum = all; chartItems.get(4).axes.get('gauge').maximum = all; chartItems.get(0).getStore().loadData([{anzahl:groups['1']}]); chartItems.get(1).getStore().loadData([{anzahl:groups['2']}]); chartItems.get(2).getStore().loadData([{anzahl:groups['3']}]); chartItems.get(3).getStore().loadData([{anzahl:groups['4']}]); chartItems.get(4).getStore().loadData([{anzahl:groups['']}]); this.getEqchartsStore().group({property:'quarter'}); groups = this.getEqchartsStore().count(true); var data = []; for (var group in groups) { var gDate = new Date(group); if (Ext.Date.add(gDate, Ext.Date.YEAR, -3) < new Date && Ext.Date.add(new Date, Ext.Date.YEAR, -3) < gDate) { data.push({quarter:gDate, count:groups[group]}); } } this.getCharts().items.get(2).getStore().loadData(data); }, processToken:function(token) { if (token == 'equipmentlist') { this.loadEquipments(); } }, onNavigation:function(view, record) { if (record.get('cls') == 'eqListButton') { this.getContent().loadView('equipmentlist', null, {columns:this.application.getController('Application').eqColumns}); } }, doNavigation:function() { this.getEqtableStore().getProxy().data = this.getEquipmentsStore().getProxy().reader.jsonData; var eqColumns = this.application.getController('Application').eqColumns; if (this.application.filterState) { eqColumns.forEach(function(el) { Ext.apply(el.filter, {value:null, active:false}); for (key in this.application.filterState) { if (el.dataIndex == key && el.filter) { Ext.apply(el.filter, {value:this.application.filterState[key], active:true}); } } }, this); } this.getContent().loadView('equipmentlist', true, {columns:eqColumns}); }}); Ext.define('eqOnline.model.Authcode', {extend:Ext.data.Model, fields:['id', 'name', 'value'], proxy:{type:'ajax', url:'user', extraParams:{OnInputProcessing:'getAuthCodes'}}}); Ext.define('eqOnline.view.user.Edit', {extend:Ext.Panel, alias:'widget.userdata', layout:'vbox', border:false, defaults:{border:false}, items:[{html:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3e' + EQOnlineLocale.benutzerverw + '\x3c/h1\x3e\x3c/div\x3e'}, {xtype:'form', itemId:'userData', width:500, bodyStyle:{padding:'10px'}, border:true, layout:{type:'vbox', align:'stretch'}, tbar:[{xtype:'combo', itemId:'userList', width:250, store:'Users', name:'userName', listConfig:{itemTpl:Ext.create('Ext.XTemplate', '{kuser} - {name}')}, displayField:'comboname', valueField:'kuser', triggerAction:'all', mode:'local', editable:false}, '-\x3e', {xtype:'button', text:EQOnlineLocale.sperren, itemId:'lockUser', hidden:true}, {xtype:'button', text:EQOnlineLocale.pwaendern, itemId:'changePassword'}], items:[{xtype:'fieldset', cls:'eqo', title:EQOnlineLocale.benutzdaten, defaults:{border:false, xtype:'textfield', labelWidth:150}, items:[{name:'TITLE', fieldLabel:EQOnlineLocale.anrede, maxWidth:250, xtype:'combo', queryMode:'local', editable:false, triggerAction:'all', store:[['Herr', 'Herr'], ['Frau', 'Frau']]}, {name:'FIRST_NAME', fieldLabel:EQOnlineLocale.vorname}, {name:'LAST_NAME', fieldLabel:EQOnlineLocale.nachname, allowBlank:false}, {xtype:'fieldcontainer', layout:'hbox', fieldLabel:EQOnlineLocale.telns, defaults:{xtype:'textfield'}, items:[{name:'PHONE', flex:1}, {xtype:'splitter'}, {name:'PHONE2', width:40}]}, {xtype:'fieldcontainer', layout:'hbox', fieldLabel:EQOnlineLocale.faxns, defaults:{xtype:'textfield'}, items:[{name:'FAX', flex:1}, {xtype:'splitter'}, {name:'FAX2', width:40}]}, {name:'MAIL', fieldLabel:EQOnlineLocale.email}]}], buttons:[{text:EQOnlineLocale.speichern, itemId:'submitButton', formBind:true}]}]}); Ext.define('eqOnline.store.Authcodes', {extend:Ext.data.Store, model:'eqOnline.model.Authcode'}); Ext.define('eqOnline.controller.User', {extend:Ext.app.Controller, stores:['Users', 'Authcodes'], models:['User', 'Authcode'], views:['user.Login', 'user.Edit'], refs:[{ref:'userForm', selector:'form[itemId\x3duserData]'}, {ref:'passwordForm', selector:'form[itemId\x3dnewPasswordForm]'}, {ref:'userSelect', selector:'combo[itemId\x3duserList]'}, {ref:'content', selector:'#content'}], init:function() { this.control({'form[itemId\x3dloginForm] button[itemId\x3dloginButton]':{click:this.login}, 'loginscreen button[itemId\x3dinitGuest]':{click:this.guestLogin}, 'form[itemId\x3dloginForm] button[itemId\x3dpwRemindButton]':{click:this.forgotPW}, 'form[itemId\x3dloginForm] textfield':{specialkey:this.checkEnter}, 'dataview[itemId\x3dnavigation]':{itemclick:this.onNavigation}, 'form[itemId\x3duserData]':{afterrender:this.initUserSelect}, 'form[itemId\x3duserData] button[itemId\x3dsubmitButton]':{click:this.saveUserData}, 'form[itemId\x3duserData] button[itemId\x3dchangePassword]':{click:this.showPasswordWindowNoOneTime}, 'form[itemId\x3duserData] button[itemId\x3dlockUser]':{click:this.lockUser}, 'form[itemId\x3dnewPasswordForm] button[itemId\x3dsavePassword]':{click:this.savePassword}, 'form[itemId\x3dgetPasswordForm] button[itemId\x3dgetNewPassword]':{click:this.checkGetNewPassword}, 'combo[itemId\x3duserList]':{select:this.loadUserData}}); this.application.getController('Application').on('navigate', this.processToken, this); }, isAdmin:function() { return this.getUsersStore().getAt(0).get('isadmin') == 'X'; }, checkEnter:function(field, event) { if (event.getKey() == event.ENTER) { if (field.up('form').getForm().isValid()) { field.up('form').submit({url:'user', params:{OnInputProcessing:'user_login'}, success:this.processLogin, scope:this}); } } }, login:function(button) { button.up('form').submit({url:'user', params:{OnInputProcessing:'user_login'}, success:this.processLogin, scope:this}); }, guestLogin:function(button) { Ext.Ajax.request({url:'user', method:'POST', params:{OnInputProcessing:'user_login', username:'equguest'}, success:this.processLogin, scope:this}); }, processLogin:function() { if (document.location.href.indexOf('#loginscreen') != -1) { document.location.href = ''; } else { window.location.reload(); } }, afterLogin:function() { var app = this.application.getController('Application'); app.refreshNavigation(); this.getContent().loadView('welcome'); }, processToken:function(token) { if (token == 'userdata') { this.getContent().loadView('userdata', true); } if (token == 'resetPassword') { this.showPasswordWindow(true); } }, showUserData:function() { this.getUsersStore().load({callback:function() { this.getContent().loadView('userdata'); this.getAuthcodesStore().load(); }, scope:this}); }, saveUserData:function() { this.getUserForm().submit({url:'user', params:{OnInputProcessing:'saveData'}, success:function() { this.getUsersStore().load(); }, scope:this}); }, lockUser:function() { var action = this.getUserSelect().findRecordByValue(this.getUserSelect().getValue()).get('locked') ? 'unlockUser' : 'lockUser'; Ext.Ajax.request({url:'user', params:{OnInputProcessing:action, username:this.getUserSelect().getValue()}, callback:function() { this.getUsersStore().load({callback:function() { this.setLockedButtonText(this.getUserSelect().findRecordByValue(this.getUserSelect().getValue())); }, scope:this}); }, scope:this}); }, setLockedButtonText:function(record) { if (record.get('locked')) { this.getUserForm().down('button[itemId\x3dlockUser]').setText('Entsperren'); } else { this.getUserForm().down('button[itemId\x3dlockUser]').setText('Sperren'); } }, savePassword:function() { this.getPasswordForm().submit({url:'user', params:{OnInputProcessing:'savePassword'}, success:function() { var window = this.getPasswordForm().up('window'); if (window.oneTimeReset) { document.location.href = 'index.html'; } else { window.close(); } }, failure:function(form, action) { var text = 'Bei der Kennwortänderung ist ein Fehler aufgetreten.'; if (action.result && action.result.msg) { text = action.result.msg; } Ext.Msg.alert('Fehler bei Kennwortänderung', text); }, scope:this}); }, showPasswordWindowNoOneTime:function() { this.showPasswordWindow(false); }, showPasswordWindow:function(oneTimeReset) { Ext.create('Ext.Window', {width:300, height:150, title:'Neues Kennwort vergeben', layout:'fit', modal:true, oneTimeReset:oneTimeReset, items:[{xtype:'form', padding:15, border:false, itemId:'newPasswordForm', defaults:{xtype:'textfield'}, items:[{fieldLabel:'Passwort', name:'PASSWORD', id:'firstPWToChange', allowBlank:false, inputType:'password'}, {fieldLabel:'Wiederholung', name:'PASSWORD2', vtype:'password', initialPassField:'firstPWToChange', allowBlank:false, inputType:'password'}, {hidden:true, name:'username', value:oneTimeReset ? 'oneTimeReset' : this.getUserSelect().getValue(), fieldLabel:'Wiederholung'}], buttons:[{text:'abbrechen', handler:function() { this.up('window').close(); }, hidden:oneTimeReset}, {text:'Passwort ändern', itemId:'savePassword', formBind:true}]}]}).show(); }, initUserSelect:function() { var combo = this.getUserSelect(), firstUser = combo.getStore().getAt(0); combo.select(firstUser); this.loadUserData(combo, [firstUser]); }, loadUserData:function(combo, records) { var newUser = records[0].get('kuser'); if (records[0].get('isadmin') == 'X' && newUser != records[0].get('admin')) { this.setLockedButtonText(records[0]); this.getUserForm().down('button[itemId\x3dlockUser]').show(); } else { this.getUserForm().down('button[itemId\x3dlockUser]').hide(); } this.getUserForm().load({url:'user', method:'GET', params:{OnInputProcessing:'get_data', userName:newUser}}); }, processNewPassword:function(form, action) { var text = 'Bei der Kennwortänderung ist ein Fehler aufgetreten.'; if (action.result && action.result.msg) { text = action.result.msg; } Ext.Msg.alert('Fehler bei Kennwortänderung', text); }, checkGetNewPassword:function(button) { button.up('form').submit({url:'user', params:{OnInputProcessing:'new_password'}, success:this.processNewPassword, scope:this}); }, forgotPW:function() { Ext.create('Ext.Window', {width:300, height:150, title:'Neues Kennwort anfordern', layout:'fit', modal:true, items:[{xtype:'form', padding:15, border:false, itemId:'getPasswordForm', defaults:{xtype:'textfield'}, items:[{name:'username', fieldLabel:'Benutzer', allowBlank:false}, {fieldLabel:'Email Adresse', name:'email', allowBlank:false}], buttons:[{text:'abbrechen', handler:function() { this.up('window').close(); }}, {text:'Passwort anfordern', itemId:'getNewPassword', formBind:true}]}]}).show(); }, goToContact:function() { this.getContent().loadView('contactform'); }, onNavigation:function(view, record) { switch(record.get('cls')) { case 'logoutButton': document.location.href = 'user?OnInputProcessing(user_logout)\x3dlogout'; break; case 'loginButton': this.getContent().loadView('loginscreen'); break; case 'userDataButton': this.showUserData(); break; } }}); Ext.define('eqOnline.store.Chartvalues', {extend:Ext.data.Store, fields:['standort', 'ja', 'nein'], remoteGroup:false, remoteSort:false}); Ext.define('eqOnline.view.equipment.Mail', {extend:Ext.Panel, alias:'widget.equipmentmail', border:false, layout:{type:'vbox', align:'stretch'}, defaults:{border:false}, items:[{html:'\x3cdiv class\x3d"eqo"\x3e\x3ch1\x3eE-Mail Benachrichtigung zu zum Equipment\x3c/h1\x3e\x3c/div\x3e'}, {xtype:'formpanel', items:[{label:EQOnlineLocale.empfaenger, name:'email_recipient'}, {label:EQOnlineLocale.ccempfaenger, name:'email_cc'}, {label:EQOnlineLocale.betreff, name:'email_subject'}, {label:EQOnlineLocale.nachricht, name:'email_text', xtype:'textarea'}], buttons:[{text:EQOnlineLocale.senden}]}]});