Non conflict files
This commit is contained in:
5
gulliver/js/d3/d3.js
vendored
Normal file
5
gulliver/js/d3/d3.js
vendored
Normal file
File diff suppressed because one or more lines are too long
272
gulliver/js/d3/d3.tip.js
Normal file
272
gulliver/js/d3/d3.tip.js
Normal file
@@ -0,0 +1,272 @@
|
||||
d3.tip = function() {
|
||||
var direction = d3_tip_direction,
|
||||
offset = d3_tip_offset,
|
||||
html = d3_tip_html,
|
||||
node = initNode(),
|
||||
svg = null,
|
||||
point = null,
|
||||
target = null
|
||||
|
||||
function tip(vis) {
|
||||
svg = getSVGNode(vis)
|
||||
point = svg.createSVGPoint()
|
||||
document.body.appendChild(node)
|
||||
}
|
||||
|
||||
// Public - show the tooltip on the screen
|
||||
//
|
||||
// Returns a tip
|
||||
tip.show = function() {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
if(args[args.length - 1] instanceof SVGElement) target = args.pop()
|
||||
|
||||
var content = html.apply(this, args),
|
||||
poffset = offset.apply(this, args),
|
||||
dir = direction.apply(this, args),
|
||||
nodel = d3.select(node), i = 0,
|
||||
coords
|
||||
|
||||
nodel.html(content)
|
||||
.style({ opacity: 1, 'pointer-events': 'all' })
|
||||
|
||||
while(i--) nodel.classed(directions[i], false)
|
||||
coords = direction_callbacks.get(dir).apply(this)
|
||||
nodel.classed(dir, true).style({
|
||||
top: (coords.top + poffset[0]) + 'px',
|
||||
left: (coords.left + poffset[1]) + 'px'
|
||||
})
|
||||
|
||||
return tip
|
||||
}
|
||||
|
||||
// Public - hide the tooltip
|
||||
//
|
||||
// Returns a tip
|
||||
tip.hide = function() {
|
||||
nodel = d3.select(node)
|
||||
nodel.style({ opacity: 0, 'pointer-events': 'none' })
|
||||
return tip
|
||||
}
|
||||
|
||||
// Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.
|
||||
//
|
||||
// n - name of the attribute
|
||||
// v - value of the attribute
|
||||
//
|
||||
// Returns tip or attribute value
|
||||
tip.attr = function(n, v) {
|
||||
if (arguments.length < 2 && typeof n === 'string') {
|
||||
return d3.select(node).attr(n)
|
||||
} else {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
d3.selection.prototype.attr.apply(d3.select(node), args)
|
||||
}
|
||||
|
||||
return tip
|
||||
}
|
||||
|
||||
// Public: Proxy style calls to the d3 tip container. Sets or gets a style value.
|
||||
//
|
||||
// n - name of the property
|
||||
// v - value of the property
|
||||
//
|
||||
// Returns tip or style property value
|
||||
tip.style = function(n, v) {
|
||||
if (arguments.length < 2 && typeof n === 'string') {
|
||||
return d3.select(node).style(n)
|
||||
} else {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
d3.selection.prototype.style.apply(d3.select(node), args)
|
||||
}
|
||||
|
||||
return tip
|
||||
}
|
||||
|
||||
// Public: Set or get the direction of the tooltip
|
||||
//
|
||||
// v - One of n(north), s(south), e(east), or w(west), nw(northwest),
|
||||
// sw(southwest), ne(northeast) or se(southeast)
|
||||
//
|
||||
// Returns tip or direction
|
||||
tip.direction = function(v) {
|
||||
if (!arguments.length) return direction
|
||||
direction = v == null ? v : d3.functor(v)
|
||||
|
||||
return tip
|
||||
}
|
||||
|
||||
// Public: Sets or gets the offset of the tip
|
||||
//
|
||||
// v - Array of [x, y] offset
|
||||
//
|
||||
// Returns offset or
|
||||
tip.offset = function(v) {
|
||||
if (!arguments.length) return offset
|
||||
offset = v == null ? v : d3.functor(v)
|
||||
|
||||
return tip
|
||||
}
|
||||
|
||||
// Public: sets or gets the html value of the tooltip
|
||||
//
|
||||
// v - String value of the tip
|
||||
//
|
||||
// Returns html value or tip
|
||||
tip.html = function(v) {
|
||||
if (!arguments.length) return html
|
||||
html = v == null ? v : d3.functor(v)
|
||||
|
||||
return tip
|
||||
}
|
||||
|
||||
function d3_tip_direction() { return 'n' }
|
||||
function d3_tip_offset() { return [0, 0] }
|
||||
function d3_tip_html() { return ' ' }
|
||||
|
||||
var direction_callbacks = d3.map({
|
||||
n: direction_n,
|
||||
s: direction_s,
|
||||
e: direction_e,
|
||||
w: direction_w,
|
||||
nw: direction_nw,
|
||||
ne: direction_ne,
|
||||
sw: direction_sw,
|
||||
se: direction_se
|
||||
}),
|
||||
|
||||
directions = direction_callbacks.keys()
|
||||
|
||||
function direction_n() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.n.y - node.offsetHeight,
|
||||
left: bbox.n.x - node.offsetWidth / 2
|
||||
}
|
||||
}
|
||||
|
||||
function direction_s() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.s.y,
|
||||
left: bbox.s.x - node.offsetWidth / 2
|
||||
}
|
||||
}
|
||||
|
||||
function direction_e() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.e.y - node.offsetHeight / 2,
|
||||
left: bbox.e.x
|
||||
}
|
||||
}
|
||||
|
||||
function direction_w() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.w.y - node.offsetHeight / 2,
|
||||
left: bbox.w.x - node.offsetWidth
|
||||
}
|
||||
}
|
||||
|
||||
function direction_nw() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.nw.y - node.offsetHeight,
|
||||
left: bbox.nw.x - node.offsetWidth
|
||||
}
|
||||
}
|
||||
|
||||
function direction_ne() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.ne.y - node.offsetHeight,
|
||||
left: bbox.ne.x
|
||||
}
|
||||
}
|
||||
|
||||
function direction_sw() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.sw.y,
|
||||
left: bbox.sw.x - node.offsetWidth
|
||||
}
|
||||
}
|
||||
|
||||
function direction_se() {
|
||||
var bbox = getScreenBBox()
|
||||
return {
|
||||
top: bbox.se.y,
|
||||
left: bbox.e.x
|
||||
}
|
||||
}
|
||||
|
||||
function initNode() {
|
||||
var node = d3.select(document.createElement('div'))
|
||||
node.style({
|
||||
position: 'absolute',
|
||||
opacity: 0,
|
||||
pointerEvents: 'none',
|
||||
boxSizing: 'border-box'
|
||||
})
|
||||
|
||||
return node.node()
|
||||
}
|
||||
|
||||
function getSVGNode(el) {
|
||||
el = el.node()
|
||||
if(el.tagName.toLowerCase() == 'svg')
|
||||
return el
|
||||
|
||||
return el.ownerSVGElement
|
||||
}
|
||||
|
||||
// Private - gets the screen coordinates of a shape
|
||||
//
|
||||
// Given a shape on the screen, will return an SVGPoint for the directions
|
||||
// n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),
|
||||
// sw(southwest).
|
||||
//
|
||||
// +-+-+
|
||||
// | |
|
||||
// + +
|
||||
// | |
|
||||
// +-+-+
|
||||
//
|
||||
// Returns an Object {n, s, e, w, nw, sw, ne, se}
|
||||
function getScreenBBox() {
|
||||
var targetel = target || d3.event.target,
|
||||
bbox = {},
|
||||
matrix = targetel.getScreenCTM(),
|
||||
tbbox = targetel.getBBox(),
|
||||
width = tbbox.width,
|
||||
height = tbbox.height,
|
||||
x = tbbox.x,
|
||||
y = tbbox.y,
|
||||
scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
|
||||
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
|
||||
|
||||
|
||||
point.x = x + scrollLeft
|
||||
point.y = y + scrollTop
|
||||
bbox.nw = point.matrixTransform(matrix)
|
||||
point.x += width
|
||||
bbox.ne = point.matrixTransform(matrix)
|
||||
point.y += height
|
||||
bbox.se = point.matrixTransform(matrix)
|
||||
point.x -= width
|
||||
bbox.sw = point.matrixTransform(matrix)
|
||||
point.y -= height / 2
|
||||
bbox.w = point.matrixTransform(matrix)
|
||||
point.x += width
|
||||
bbox.e = point.matrixTransform(matrix)
|
||||
point.x -= width / 2
|
||||
point.y -= height / 2
|
||||
bbox.n = point.matrixTransform(matrix)
|
||||
point.y += height
|
||||
bbox.s = point.matrixTransform(matrix)
|
||||
|
||||
return bbox
|
||||
}
|
||||
|
||||
return tip
|
||||
};
|
||||
712
gulliver/js/gridstack/gridstack.js
Normal file
712
gulliver/js/gridstack/gridstack.js
Normal file
@@ -0,0 +1,712 @@
|
||||
(function (scope, _) {
|
||||
|
||||
var Utils = {
|
||||
is_intercepted: function (a, b) {
|
||||
return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y);
|
||||
},
|
||||
|
||||
sort: function (nodes, dir, width) {
|
||||
width = width || _.chain(nodes).map(function (node) { return node.x + node.width; }).max().value();
|
||||
dir = dir != -1 ? 1 : -1;
|
||||
return _.sortBy(nodes, function (n) { return dir * (n.x + n.y * width); });
|
||||
},
|
||||
|
||||
create_stylesheet: function () {
|
||||
var style = document.createElement("style");
|
||||
|
||||
// style.setAttribute("media", "screen")
|
||||
// style.setAttribute("media", "only screen and (max-width : 1024px)")
|
||||
|
||||
// WebKit hack :(
|
||||
style.appendChild(document.createTextNode(""));
|
||||
|
||||
document.head.appendChild(style);
|
||||
|
||||
return style.sheet;
|
||||
},
|
||||
|
||||
toBool: function (v) {
|
||||
if (typeof v == 'boolean')
|
||||
return v;
|
||||
if (typeof v == 'string') {
|
||||
v = v.toLowerCase();
|
||||
return !(v == '' || v == 'no' || v == 'false' || v == '0');
|
||||
}
|
||||
return Boolean(v);
|
||||
}
|
||||
};
|
||||
|
||||
var id_seq = 0;
|
||||
|
||||
var GridStackEngine = function (width, onchange, float, height, items) {
|
||||
this.width = width;
|
||||
this.float = float || false;
|
||||
this.height = height || 0;
|
||||
|
||||
this.nodes = items || [];
|
||||
this.onchange = onchange || function () {};
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._fix_collisions = function (node) {
|
||||
this._sort_nodes(-1);
|
||||
|
||||
while (true) {
|
||||
var collision_node = _.find(this.nodes, function (n) {
|
||||
return n != node && Utils.is_intercepted(n, node);
|
||||
}, this);
|
||||
if (typeof collision_node == 'undefined') {
|
||||
return;
|
||||
}
|
||||
this.move_node(collision_node, collision_node.x, node.y + node.height,
|
||||
collision_node.width, collision_node.height, true);
|
||||
}
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._sort_nodes = function (dir) {
|
||||
this.nodes = Utils.sort(this.nodes, dir, this.width);
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._pack_nodes = function () {
|
||||
this._sort_nodes();
|
||||
|
||||
if (this.float) {
|
||||
_.each(this.nodes, function (n, i) {
|
||||
if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y)
|
||||
return;
|
||||
|
||||
var new_y = n.y;
|
||||
while (new_y >= n._orig_y) {
|
||||
var collision_node = _.chain(this.nodes)
|
||||
.find(function (bn) {
|
||||
return n != bn && Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
|
||||
})
|
||||
.value();
|
||||
|
||||
if (!collision_node) {
|
||||
n._dirty = true;
|
||||
n.y = new_y;
|
||||
}
|
||||
--new_y;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
else {
|
||||
_.each(this.nodes, function (n, i) {
|
||||
if (n.locked)
|
||||
return;
|
||||
while (n.y > 0) {
|
||||
var new_y = n.y - 1;
|
||||
var can_be_moved = i == 0;
|
||||
|
||||
if (i > 0) {
|
||||
var collision_node = _.chain(this.nodes)
|
||||
.first(i)
|
||||
.find(function (bn) {
|
||||
return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
|
||||
})
|
||||
.value();
|
||||
can_be_moved = typeof collision_node == 'undefined';
|
||||
}
|
||||
|
||||
if (!can_be_moved) {
|
||||
break;
|
||||
}
|
||||
n._dirty = n.y != new_y;
|
||||
n.y = new_y;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._prepare_node = function (node, resizing) {
|
||||
node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 });
|
||||
|
||||
node.x = parseInt('' + node.x);
|
||||
node.y = parseInt('' + node.y);
|
||||
node.width = parseInt('' + node.width);
|
||||
node.height = parseInt('' + node.height);
|
||||
node.auto_position = node.auto_position || false;
|
||||
node.no_resize = node.no_resize || false;
|
||||
node.no_move = node.no_move || false;
|
||||
|
||||
if (node.width > this.width) {
|
||||
node.width = this.width;
|
||||
}
|
||||
else if (node.width < 1) {
|
||||
node.width = 1;
|
||||
}
|
||||
|
||||
if (node.height < 1) {
|
||||
node.height = 1;
|
||||
}
|
||||
|
||||
if (node.x < 0) {
|
||||
node.x = 0;
|
||||
}
|
||||
|
||||
if (node.x + node.width > this.width) {
|
||||
if (resizing) {
|
||||
node.width = this.width - node.x;
|
||||
}
|
||||
else {
|
||||
node.x = this.width - node.width;
|
||||
}
|
||||
}
|
||||
|
||||
if (node.y < 0) {
|
||||
node.y = 0;
|
||||
}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._notify = function () {
|
||||
var deleted_nodes = Array.prototype.slice.call(arguments, 1).concat(this.get_dirty_nodes());
|
||||
deleted_nodes = deleted_nodes.concat(this.get_dirty_nodes());
|
||||
this.onchange(deleted_nodes);
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.clean_nodes = function () {
|
||||
_.each(this.nodes, function (n) {n._dirty = false });
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.get_dirty_nodes = function () {
|
||||
return _.filter(this.nodes, function (n) { return n._dirty; });
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.add_node = function(node) {
|
||||
node = this._prepare_node(node);
|
||||
|
||||
if (typeof node.max_width != 'undefined') node.width = Math.min(node.width, node.max_width);
|
||||
if (typeof node.max_height != 'undefined') node.height = Math.min(node.height, node.max_height);
|
||||
if (typeof node.min_width != 'undefined') node.width = Math.max(node.width, node.min_width);
|
||||
if (typeof node.min_height != 'undefined') node.height = Math.max(node.height, node.min_height);
|
||||
|
||||
node._id = ++id_seq;
|
||||
node._dirty = true;
|
||||
|
||||
if (node.auto_position) {
|
||||
this._sort_nodes();
|
||||
|
||||
for (var i = 0; ; ++i) {
|
||||
var x = i % this.width, y = Math.floor(i / this.width);
|
||||
if (x + node.width > this.width) {
|
||||
continue;
|
||||
}
|
||||
if (!_.find(this.nodes, function (n) {
|
||||
return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n);
|
||||
})) {
|
||||
node.x = x;
|
||||
node.y = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.nodes.push(node);
|
||||
|
||||
this._fix_collisions(node);
|
||||
this._pack_nodes();
|
||||
this._notify();
|
||||
return node;
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.remove_node = function (node) {
|
||||
node._id = null;
|
||||
this.nodes = _.without(this.nodes, node);
|
||||
this._pack_nodes();
|
||||
this._notify(node);
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.can_move_node = function (node, x, y, width, height) {
|
||||
var has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
|
||||
|
||||
if (!this.height && !has_locked)
|
||||
return true;
|
||||
|
||||
var cloned_node;
|
||||
var clone = new GridStackEngine(
|
||||
this.width,
|
||||
null,
|
||||
this.float,
|
||||
0,
|
||||
_.map(this.nodes, function (n) { if (n == node) { cloned_node = $.extend({}, n); return cloned_node; } return $.extend({}, n) }));
|
||||
|
||||
clone.move_node(cloned_node, x, y, width, height);
|
||||
|
||||
var res = true;
|
||||
|
||||
if (has_locked)
|
||||
res &= !Boolean(_.find(clone.nodes, function (n) { return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); }));
|
||||
if (this.height)
|
||||
res &= clone.get_grid_height() <= this.height;
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.can_be_placed_with_respect_to_height = function (node) {
|
||||
if (!this.height)
|
||||
return true;
|
||||
|
||||
var clone = new GridStackEngine(
|
||||
this.width,
|
||||
null,
|
||||
this.float,
|
||||
0,
|
||||
_.map(this.nodes, function (n) { return $.extend({}, n) }));
|
||||
clone.add_node(node);
|
||||
return clone.get_grid_height() <= this.height;
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.move_node = function (node, x, y, width, height, no_pack) {
|
||||
if (typeof x != 'number') x = node.x;
|
||||
if (typeof y != 'number') y = node.y;
|
||||
if (typeof width != 'number') width = node.width;
|
||||
if (typeof height != 'number') height = node.height;
|
||||
|
||||
if (typeof node.max_width != 'undefined') width = Math.min(width, node.max_width);
|
||||
if (typeof node.max_height != 'undefined') height = Math.min(height, node.max_height);
|
||||
if (typeof node.min_width != 'undefined') width = Math.max(width, node.min_width);
|
||||
if (typeof node.min_height != 'undefined') height = Math.max(height, node.min_height);
|
||||
|
||||
if (node.x == x && node.y == y && node.width == width && node.height == height) {
|
||||
return node;
|
||||
}
|
||||
|
||||
var resizing = node.width != width;
|
||||
node._dirty = true;
|
||||
|
||||
node.x = x;
|
||||
node.y = y;
|
||||
node.width = width;
|
||||
node.height = height;
|
||||
|
||||
node = this._prepare_node(node, resizing);
|
||||
|
||||
this._fix_collisions(node);
|
||||
if (!no_pack) {
|
||||
this._pack_nodes();
|
||||
this._notify();
|
||||
}
|
||||
return node;
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.get_grid_height = function () {
|
||||
return _.reduce(this.nodes, function (memo, n) { return Math.max(memo, n.y + n.height); }, 0);
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.begin_update = function (node) {
|
||||
_.each(this.nodes, function (n) {
|
||||
n._orig_y = n.y;
|
||||
});
|
||||
node._updating = true;
|
||||
};
|
||||
|
||||
GridStackEngine.prototype.end_update = function () {
|
||||
var n = _.find(this.nodes, function (n) { return n._updating; });
|
||||
if (n) {
|
||||
n._updating = false;
|
||||
}
|
||||
};
|
||||
|
||||
var GridStack = function (el, opts) {
|
||||
var self = this, one_column_mode;
|
||||
|
||||
this.container = $(el);
|
||||
|
||||
this.opts = _.defaults(opts || {}, {
|
||||
width: parseInt(this.container.attr('data-gs-width')) || 12,
|
||||
height: parseInt(this.container.attr('data-gs-height')) || 0,
|
||||
item_class: 'grid-stack-item',
|
||||
placeholder_class: 'grid-stack-placeholder',
|
||||
handle: '.grid-stack-item-content',
|
||||
cell_height: 60,
|
||||
vertical_margin: 20,
|
||||
auto: true,
|
||||
min_width: 768,
|
||||
float: false,
|
||||
_class: 'grid-stack-' + (Math.random() * 10000).toFixed(0),
|
||||
animate: Boolean(this.container.attr('data-gs-animate')) || false
|
||||
});
|
||||
|
||||
this.container.addClass(this.opts._class);
|
||||
this._styles = Utils.create_stylesheet();
|
||||
this._styles._max = 0;
|
||||
|
||||
this.grid = new GridStackEngine(this.opts.width, function (nodes) {
|
||||
var max_height = 0;
|
||||
_.each(nodes, function (n) {
|
||||
if (n._id == null) {
|
||||
n.el.remove();
|
||||
}
|
||||
else {
|
||||
n.el
|
||||
.attr('data-gs-x', n.x)
|
||||
.attr('data-gs-y', n.y)
|
||||
.attr('data-gs-width', n.width)
|
||||
.attr('data-gs-height', n.height);
|
||||
max_height = Math.max(max_height, n.y + n.height);
|
||||
}
|
||||
});
|
||||
self._update_styles(max_height + 10);
|
||||
}, this.opts.float, this.opts.height);
|
||||
|
||||
if (this.opts.auto) {
|
||||
this.container.find('.' + this.opts.item_class).each(function (index, el) {
|
||||
self._prepare_element(el);
|
||||
});
|
||||
}
|
||||
|
||||
this.set_animation(this.opts.animate);
|
||||
|
||||
this.placeholder = $('<div class="' + this.opts.placeholder_class + ' ' + this.opts.item_class + '"><div class="placeholder-content" /></div>').hide();
|
||||
this.container.append(this.placeholder);
|
||||
this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
|
||||
|
||||
var on_resize_handler = function () {
|
||||
if (self._is_one_column_mode()) {
|
||||
if (one_column_mode)
|
||||
return;
|
||||
|
||||
one_column_mode = true;
|
||||
|
||||
_.each(self.grid.nodes, function (node) {
|
||||
if (!node.no_move) {
|
||||
node.el.draggable('disable');
|
||||
}
|
||||
if (!node.no_resize) {
|
||||
node.el.resizable('disable');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (!one_column_mode)
|
||||
return;
|
||||
|
||||
one_column_mode = false;
|
||||
|
||||
_.each(self.grid.nodes, function (node) {
|
||||
if (!node.no_move) {
|
||||
node.el.draggable('enable');
|
||||
}
|
||||
if (!node.no_resize) {
|
||||
node.el.resizable('enable');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(window).resize(on_resize_handler);
|
||||
on_resize_handler();
|
||||
};
|
||||
|
||||
GridStack.prototype._update_styles = function (max_height) {
|
||||
if (typeof max_height == 'undefined') {
|
||||
max_height = this._styles._max;
|
||||
this._styles._max = 0;
|
||||
while (this._styles.rules.length) {
|
||||
this._styles.removeRule(0);
|
||||
}
|
||||
this._update_container_height();
|
||||
}
|
||||
|
||||
if (max_height > this._styles._max) {
|
||||
for (var i = this._styles._max; i < max_height; ++i) {
|
||||
var css;
|
||||
css = '.' + this.opts._class + ' .' + this.opts.item_class + '[data-gs-height="' + (i + 1) + '"] { height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px; }';
|
||||
this._styles.insertRule(css, i);
|
||||
css = '.' + this.opts._class + ' .' + this.opts.item_class + '[data-gs-y="' + (i) + '"] { top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px; }';
|
||||
this._styles.insertRule(css, i);
|
||||
}
|
||||
this._styles._max = max_height;
|
||||
}
|
||||
};
|
||||
|
||||
GridStack.prototype._update_container_height = function () {
|
||||
this.container.height(this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
|
||||
};
|
||||
|
||||
GridStack.prototype._is_one_column_mode = function () {
|
||||
return $(window).width() <= this.opts.min_width;
|
||||
};
|
||||
|
||||
GridStack.prototype._prepare_element = function (el) {
|
||||
var self = this;
|
||||
el = $(el);
|
||||
|
||||
el.addClass(this.opts.item_class);
|
||||
|
||||
var node = self.grid.add_node({
|
||||
x: el.attr('data-gs-x'),
|
||||
y: el.attr('data-gs-y'),
|
||||
width: el.attr('data-gs-width'),
|
||||
height: el.attr('data-gs-height'),
|
||||
max_width: el.attr('data-gs-max-width'),
|
||||
min_width: el.attr('data-gs-min-width'),
|
||||
max_height: el.attr('data-gs-max-height') || 100,
|
||||
min_height: el.attr('data-gs-min-height'),
|
||||
auto_position: Utils.toBool(el.attr('data-gs-auto-position')),
|
||||
no_resize: Utils.toBool(el.attr('data-gs-no-resize')),
|
||||
no_move: Utils.toBool(el.attr('data-gs-no-move')),
|
||||
locked: Utils.toBool(el.attr('data-gs-locked')),
|
||||
el: el
|
||||
});
|
||||
el.data('_gridstack_node', node);
|
||||
|
||||
var cell_width, cell_height;
|
||||
|
||||
var on_start_moving = function (event, ui) {
|
||||
var o = $(this);
|
||||
self.grid.clean_nodes();
|
||||
self.grid.begin_update(node);
|
||||
cell_width = Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
|
||||
cell_height = self.opts.cell_height + self.opts.vertical_margin;
|
||||
self.placeholder
|
||||
.attr('data-gs-x', o.attr('data-gs-x'))
|
||||
.attr('data-gs-y', o.attr('data-gs-y'))
|
||||
.attr('data-gs-width', o.attr('data-gs-width'))
|
||||
.attr('data-gs-height', o.attr('data-gs-height'))
|
||||
.show();
|
||||
node.el = self.placeholder;
|
||||
};
|
||||
|
||||
var on_end_moving = function (event, ui) {
|
||||
var o = $(this);
|
||||
node.el = o;
|
||||
self.placeholder.hide();
|
||||
o
|
||||
.attr('data-gs-x', node.x)
|
||||
.attr('data-gs-y', node.y)
|
||||
.attr('data-gs-width', node.width)
|
||||
.attr('data-gs-height', node.height)
|
||||
.removeAttr('style');
|
||||
self._update_container_height();
|
||||
self.container.trigger('change', [self.grid.get_dirty_nodes()]);
|
||||
|
||||
self.grid.end_update();
|
||||
|
||||
self.grid._sort_nodes();
|
||||
setTimeout(function() { //if animating, delay detaching & reattaching all elements until animation finishes
|
||||
_.each(self.grid.nodes, function (node) {
|
||||
node.el.detach();
|
||||
self.container.append(node.el);
|
||||
});
|
||||
}, (self.opts.animate ? 300 : 0));
|
||||
};
|
||||
|
||||
el.draggable({
|
||||
handle: this.opts.handle,
|
||||
scroll: true,
|
||||
appendTo: 'body',
|
||||
|
||||
start: on_start_moving,
|
||||
stop: on_end_moving,
|
||||
drag: function (event, ui) {
|
||||
var x = Math.round(ui.position.left / cell_width),
|
||||
y = Math.floor((ui.position.top + cell_height/2) / cell_height);
|
||||
if (!self.grid.can_move_node(node, x, y, node.width, node.height)) {
|
||||
return;
|
||||
}
|
||||
self.grid.move_node(node, x, y);
|
||||
self._update_container_height();
|
||||
}
|
||||
}).resizable({
|
||||
autoHide: true,
|
||||
handles: 'se',
|
||||
minHeight: this.opts.cell_height - 10,
|
||||
minWidth: 70,
|
||||
|
||||
start: on_start_moving,
|
||||
stop: on_end_moving,
|
||||
resize: function (event, ui) {
|
||||
var width = Math.round(ui.size.width / cell_width),
|
||||
height = Math.round(ui.size.height / cell_height);
|
||||
if (!self.grid.can_move_node(node, node.x, node.y, width, height)) {
|
||||
return;
|
||||
}
|
||||
self.grid.move_node(node, node.x, node.y, width, height);
|
||||
self._update_container_height();
|
||||
}
|
||||
});
|
||||
|
||||
if (node.no_move || this._is_one_column_mode()) {
|
||||
el.draggable('disable');
|
||||
}
|
||||
|
||||
if (node.no_resize || this._is_one_column_mode()) {
|
||||
el.resizable('disable');
|
||||
}
|
||||
|
||||
el.attr('data-gs-locked', node.locked ? 'yes' : null);
|
||||
};
|
||||
|
||||
GridStack.prototype.set_animation = function (enable) {
|
||||
if (enable) {
|
||||
this.container.addClass('grid-stack-animate');
|
||||
}
|
||||
else {
|
||||
this.container.removeClass('grid-stack-animate');
|
||||
}
|
||||
};
|
||||
|
||||
GridStack.prototype.add_widget = function (el, x, y, width, height, auto_position) {
|
||||
el = $(el);
|
||||
if (typeof x != 'undefined') el.attr('data-gs-x', x);
|
||||
if (typeof y != 'undefined') el.attr('data-gs-y', y);
|
||||
if (typeof width != 'undefined') el.attr('data-gs-width', width);
|
||||
if (typeof height != 'undefined') el.attr('data-gs-height', height);
|
||||
if (typeof auto_position != 'undefined') el.attr('data-gs-auto-position', auto_position ? 'yes' : null);
|
||||
this.container.append(el);
|
||||
this._prepare_element(el);
|
||||
this._update_container_height();
|
||||
};
|
||||
|
||||
GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {
|
||||
var node = {x: x, y: y, width: width, height: height, auto_position: auto_position};
|
||||
return this.grid.can_be_placed_with_respect_to_height(node);
|
||||
};
|
||||
|
||||
GridStack.prototype.remove_widget = function (el) {
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
this.grid.remove_node(node);
|
||||
el.remove();
|
||||
this._update_container_height();
|
||||
};
|
||||
|
||||
GridStack.prototype.remove_all = function () {
|
||||
_.each(this.grid.nodes, function (node) {
|
||||
node.el.remove();
|
||||
});
|
||||
this.grid.nodes = [];
|
||||
this._update_container_height();
|
||||
};
|
||||
|
||||
GridStack.prototype.resizable = function (el, val) {
|
||||
el = $(el);
|
||||
el.each(function (index, el) {
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
if (typeof node == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
node.no_resize = !(val || false);
|
||||
if (node.no_resize) {
|
||||
el.resizable('disable');
|
||||
}
|
||||
else {
|
||||
el.resizable('enable');
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
GridStack.prototype.movable = function (el, val) {
|
||||
el = $(el);
|
||||
el.each(function (index, el) {
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
if (typeof node == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
node.no_move = !(val || false);
|
||||
if (node.no_move) {
|
||||
el.draggable('disable');
|
||||
}
|
||||
else {
|
||||
el.draggable('enable');
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
GridStack.prototype.locked = function (el, val) {
|
||||
el = $(el);
|
||||
el.each(function (index, el) {
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
if (typeof node == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
node.locked = (val || false);
|
||||
el.attr('data-gs-locked', node.locked ? 'yes' : null);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
GridStack.prototype._update_element = function (el, callback) {
|
||||
el = $(el).first();
|
||||
var node = el.data('_gridstack_node');
|
||||
if (typeof node == 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
self.grid.clean_nodes();
|
||||
self.grid.begin_update(node);
|
||||
|
||||
callback.call(this, el, node);
|
||||
|
||||
self._update_container_height();
|
||||
self.container.trigger('change', [self.grid.get_dirty_nodes()]);
|
||||
|
||||
self.grid.end_update();
|
||||
|
||||
self.grid._sort_nodes();
|
||||
_.each(self.grid.nodes, function (node) {
|
||||
node.el.detach();
|
||||
self.container.append(node.el);
|
||||
});
|
||||
};
|
||||
|
||||
GridStack.prototype.resize = function (el, width, height) {
|
||||
this._update_element(el, function (el, node) {
|
||||
width = (width != null && typeof width != 'undefined') ? width : node.width;
|
||||
height = (height != null && typeof height != 'undefined') ? height : node.height;
|
||||
|
||||
this.grid.move_node(node, node.x, node.y, width, height);
|
||||
});
|
||||
};
|
||||
|
||||
GridStack.prototype.move = function (el, x, y) {
|
||||
this._update_element(el, function (el, node) {
|
||||
x = (x != null && typeof x != 'undefined') ? x : node.x;
|
||||
y = (y != null && typeof y != 'undefined') ? y : node.y;
|
||||
|
||||
this.grid.move_node(node, x, y, node.width, node.height);
|
||||
});
|
||||
};
|
||||
|
||||
GridStack.prototype.cell_height = function (val) {
|
||||
if (typeof val == 'undefined') {
|
||||
return this.opts.cell_height;
|
||||
}
|
||||
val = parseInt(val);
|
||||
if (val == this.opts.cell_height)
|
||||
return;
|
||||
this.opts.cell_height = val || this.opts.cell_height;
|
||||
this._update_styles();
|
||||
};
|
||||
|
||||
GridStack.prototype.cell_width = function () {
|
||||
var o = this.container.find('.' + this.opts.item_class).first();
|
||||
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
|
||||
};
|
||||
|
||||
scope.GridStackUI = GridStack;
|
||||
|
||||
scope.GridStackUI.Utils = Utils;
|
||||
|
||||
$.fn.gridstack = function (opts) {
|
||||
return this.each(function () {
|
||||
if (!$(this).data('gridstack')) {
|
||||
$(this).data('gridstack', new GridStack(this, opts));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
})(window, _);
|
||||
2
gulliver/js/jquery/jquery-1.8.2.min.js
vendored
Normal file
2
gulliver/js/jquery/jquery-1.8.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
gulliver/js/jquery/jquery-ui-1.11.2.min.js
vendored
Normal file
7
gulliver/js/jquery/jquery-ui-1.11.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2559
gulliver/js/pmchart/pmCharts.js
Normal file
2559
gulliver/js/pmchart/pmCharts.js
Normal file
File diff suppressed because it is too large
Load Diff
150
workflow/engine/classes/class.dashboards.php
Normal file
150
workflow/engine/classes/class.dashboards.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
class Dashboards
|
||||
{
|
||||
public function getListDashboards ($start=0, $limit=20, $sort='', $dir='DESC', $search='')
|
||||
{
|
||||
require_once 'classes/model/Dashboard.php';
|
||||
require_once 'classes/model/DashboardIndicator.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
require_once 'classes/model/DashboardDasInd.php';
|
||||
|
||||
|
||||
$limit_size = isset($limit) ? $limit: 20;
|
||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
|
||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
|
||||
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
||||
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn('COUNT(*) AS CNT');
|
||||
$criteria->add(DashboardPeer::DAS_STATUS, array('2'), Criteria::NOT_IN);
|
||||
|
||||
$dataset = DashboardPeer::DoSelectRs($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$row = $dataset->getRow();
|
||||
$totalRows = $row['CNT'];
|
||||
|
||||
$criteria->clearSelectColumns();
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_UID);
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_TITLE);
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_DESCRIPTION);
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_UPDATE_DATE);
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_STATUS);
|
||||
|
||||
$criteria->add(DashboardPeer::DAS_STATUS, array('2'), Criteria::NOT_IN);
|
||||
|
||||
if ($sort != '') {
|
||||
if ($dir == 'ASC') {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
}
|
||||
}
|
||||
$criteria->setOffset($start);
|
||||
$criteria->setLimit($limit);
|
||||
$dataset = DashboardPeer::DoSelectRs($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rows = Array();
|
||||
$user = new Users();
|
||||
$group = new Groupwf();
|
||||
$owner = new DashboardDasInd();
|
||||
while ($dataset->next()) {
|
||||
$row = $dataset->getRow();
|
||||
$row['DAS_OWNER'] = '';
|
||||
try {
|
||||
$ownerDetail = $owner->loadByDashboards($row['DAS_UID']);
|
||||
foreach ($ownerDetail as $key => $value) {
|
||||
$title = '';
|
||||
$detail = '';
|
||||
if ($value['OWNER_TYPE'] == 'USER') {
|
||||
$detail = $user->load($value['OWNER_UID']);
|
||||
$title = $detail['USR_FIRSTNAME'] . ' '. $detail['USR_LASTNAME'];
|
||||
} else if ($value['OWNER_TYPE'] == 'GROUP') {
|
||||
$detail = $group->load($value['OWNER_UID']);
|
||||
$title = $detail['GRP_TITLE'];
|
||||
}
|
||||
$row['DAS_OWNER'] .= ($row['DAS_OWNER'] == '') ? $title : ', ' . $title;
|
||||
}
|
||||
|
||||
} catch (exception $oError) {
|
||||
//
|
||||
}
|
||||
|
||||
$row['DAS_LABEL_STATUS'] = ($row['DAS_STATUS'] == 1) ? G::loadTranslation('ID_ACTIVE') : G::loadTranslation('ID_INACTIVE');
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
$response = Array();
|
||||
$response['totalCount'] = $totalRows;
|
||||
$response['start'] = $start;
|
||||
$response['limit'] = $limit;
|
||||
$response['sort'] = G::toLower($sort);
|
||||
$response['dir'] = G::toLower($dir);
|
||||
$response['data'] = $rows;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
public function getOwnerByDasUid ($das_uid='', $start=0, $limit=20, $search='')
|
||||
{
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
require_once 'classes/model/DashboardDasInd.php';
|
||||
|
||||
$das_uid = isset($_REQUEST['das_uid']) ? $_REQUEST['das_uid'] : $das_uid;
|
||||
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : $start;
|
||||
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit;
|
||||
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : $search;
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $das_uid, Criteria::EQUAL);
|
||||
|
||||
$dataset = DashboardDasIndPeer::DoSelectRs($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$row = $dataset->getRow();
|
||||
$totalRows = $row['TOTAL'];
|
||||
|
||||
$criteria->clearSelectColumns();
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $das_uid, Criteria::EQUAL);
|
||||
|
||||
$criteria->setOffset($start);
|
||||
$criteria->setLimit($limit);
|
||||
$dataset = DashboardDasIndPeer::DoSelectRs($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rows = Array();
|
||||
$user = new Users();
|
||||
$group = new Groupwf();
|
||||
while ($dataset->next()) {
|
||||
$row = $dataset->getRow();
|
||||
$row['OWNER_LABEL'] = '---';
|
||||
try {
|
||||
if ($row['OWNER_TYPE'] == 'USER') {
|
||||
$detail = $user->load($row['OWNER_UID']);
|
||||
$row['OWNER_LABEL'] = $detail['USR_FIRSTNAME'] . ' '. $detail['USR_LASTNAME'];
|
||||
} else if ($row['OWNER_TYPE'] == 'GROUP') {
|
||||
$detail = $group->load($row['OWNER_UID']);
|
||||
$row['OWNER_LABEL'] = $detail['GRP_TITLE'];
|
||||
}
|
||||
} catch (exception $oError) {
|
||||
//
|
||||
}
|
||||
$rows[] = $row;
|
||||
}
|
||||
$response = Array();
|
||||
$response['totalCount'] = $totalRows;
|
||||
$response['start'] = $start;
|
||||
$response['limit'] = $limit;
|
||||
$response['data'] = $rows;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
755
workflow/engine/classes/class.indicatorsCalculator.php
Normal file
755
workflow/engine/classes/class.indicatorsCalculator.php
Normal file
@@ -0,0 +1,755 @@
|
||||
<?php
|
||||
|
||||
|
||||
abstract class BasicEnum {
|
||||
private static $constCacheArray = NULL;
|
||||
|
||||
private static function getConstants() {
|
||||
if (self::$constCacheArray == NULL) {
|
||||
self::$constCacheArray = array();
|
||||
}
|
||||
$calledClass = get_called_class();
|
||||
if (!array_key_exists($calledClass, self::$constCacheArray)) {
|
||||
$reflect = new ReflectionClass($calledClass);
|
||||
self::$constCacheArray[$calledClass] = $reflect->getConstants();
|
||||
}
|
||||
return self::$constCacheArray[$calledClass];
|
||||
}
|
||||
|
||||
public static function isValidName($name, $strict = false) {
|
||||
$constants = self::getConstants();
|
||||
|
||||
if ($strict) {
|
||||
return array_key_exists($name, $constants);
|
||||
}
|
||||
|
||||
$keys = array_map('strtolower', array_keys($constants));
|
||||
return in_array(strtolower($name), $keys);
|
||||
}
|
||||
|
||||
public static function isValidValue($value) {
|
||||
$values = array_values(self::getConstants());
|
||||
return in_array($value, $values, $strict = true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class ReportingPeriodicityEnum extends BasicEnum {
|
||||
//100s space to easy add more periods if in the future new periods are needed
|
||||
const NONE = 0;
|
||||
const MONTH = 100;
|
||||
const QUARTER = 200;
|
||||
const SEMESTER = 300;
|
||||
const YEAR = 400;
|
||||
|
||||
public static function fromValue($value) {
|
||||
if ($value == ReportingPeriodicityEnum::NONE) return ReportingPeriodicityEnum::NONE;
|
||||
if ($value == ReportingPeriodicityEnum::MONTH) return ReportingPeriodicityEnum::MONTH;
|
||||
if ($value == ReportingPeriodicityEnum::QUARTER) return ReportingPeriodicityEnum::QUARTER;
|
||||
if ($value == ReportingPeriodicityEnum::SEMESTER) return ReportingPeriodicityEnum::SEMESTER;
|
||||
if ($value == ReportingPeriodicityEnum::YEAR) return ReportingPeriodicityEnum::YEAR;
|
||||
return ReportingPeriodicityEnum::MONTH;
|
||||
}
|
||||
|
||||
public static function labelFromValue($value) {
|
||||
if ($value == ReportingPeriodicityEnum::MONTH) return "ID_MONTH" ;
|
||||
if ($value == ReportingPeriodicityEnum::QUARTER) return "ID_QUARTER";
|
||||
if ($value == ReportingPeriodicityEnum::SEMESTER) return "ID_SEMESTER";
|
||||
if ($value == ReportingPeriodicityEnum::YEAR) return "ID_YEAR";
|
||||
return "ID_MONTH";
|
||||
}
|
||||
}
|
||||
|
||||
abstract class IndicatorDataSourcesEnum extends BasicEnum {
|
||||
//100s space to easy add more periods if in the future new periods are needed
|
||||
const USER = 0;
|
||||
const PROCESS = 100;
|
||||
const PROCESS_CATEGORY = 200;
|
||||
const USER_GROUP = 300;
|
||||
}
|
||||
|
||||
class indicatorsCalculator
|
||||
{
|
||||
private static $connectionName = 'workflow';
|
||||
|
||||
private $userReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "USR_UID");
|
||||
private $processReportingMetadata = array("tableName" => "PRO_REPORTING", "keyField" => "PRO_UID");
|
||||
private $userGroupReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "USR_UID");
|
||||
private $processCategoryReportingMetadata = array("tableName" => "PRO_REPORTING", "keyField" => "PRO_UID");
|
||||
|
||||
private $peiCostFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
||||
private $peiFormula = "SUM(TOTAL_CASES_OUT*CONFIGURED_TASK_TIME) / SUM(SDV_TIME * TOTAL_CASES_OUT + TOTAL_TIME_BY_TASK)";
|
||||
|
||||
private $ueiCostFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
||||
private $ueiFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME) / SUM(TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
||||
|
||||
//
|
||||
// public function processEfficiencyIndex($processList, $initDate, $endDate)
|
||||
// {
|
||||
// $resultList = $this->processEfficiencyIndexList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return ($resultList[0]['PEI']);
|
||||
// }
|
||||
|
||||
public function peiHistoric($processId, $initDate, $endDate, $periodicity) {
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::USER
|
||||
, $processId, $periodicity, $initDate, $endDate
|
||||
, $this->peiFormula);
|
||||
|
||||
$returnValue = $this->propelExecutor($sqlString);
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
public function indicatorData($indicatorId)
|
||||
{
|
||||
$sqlString = "select * from DASHBOARD_INDICATOR where DAS_IND_UID= '$indicatorId'";
|
||||
$retval = $this->propelExecutor($sqlString);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
public function peiProcesses($indicatorId, $initDate, $endDate, $language)
|
||||
{
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$initYear = $initDate->format("Y");
|
||||
$initMonth = $initDate->format("m");
|
||||
$initDay = $endDay = 1;
|
||||
$endYear = $endDate->format("Y");
|
||||
$endMonth = $endDate->format("m");
|
||||
|
||||
$sqlString = "
|
||||
select
|
||||
i.PRO_UID as uid,
|
||||
tp.CON_VALUE as name,
|
||||
efficiencyIndex,
|
||||
inefficiencyCost
|
||||
from
|
||||
( select
|
||||
PRO_UID,
|
||||
$this->peiFormula as efficiencyIndex,
|
||||
$this->peiCostFormula as inefficiencyCost
|
||||
from USR_REPORTING
|
||||
WHERE
|
||||
(
|
||||
PRO_UID = (select DAS_UID_PROCESS from DASHBOARD_INDICATOR where DAS_IND_UID = '$indicatorId')
|
||||
or
|
||||
(select DAS_UID_PROCESS from DASHBOARD_INDICATOR where DAS_IND_UID = '$indicatorId')= '0'
|
||||
)
|
||||
AND
|
||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
AND
|
||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)
|
||||
group by PRO_UID
|
||||
) i
|
||||
left join (select *
|
||||
from CONTENT
|
||||
where CON_CATEGORY = 'PRO_TITLE'
|
||||
and CON_LANG = '$language'
|
||||
) tp on i.PRO_UID = tp.CON_ID";
|
||||
$retval = $this->propelExecutor($sqlString);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
public function ueiUserGroups($indicatorId, $initDate, $endDate, $language)
|
||||
{
|
||||
//for the moment all the indicator summarizes ALL users, so indicatorId is not used in this function.
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$initYear = $initDate->format("Y");
|
||||
$initMonth = $initDate->format("m");
|
||||
$initDay = $endDay = 1;
|
||||
$endYear = $endDate->format("Y");
|
||||
$endMonth = $endDate->format("m");
|
||||
|
||||
//TODO ADD to USR_REPORTING the user's Group to speed up the query.
|
||||
$sqlString = "
|
||||
select
|
||||
IFNULL(i.GRP_UID, '0') as uid,
|
||||
IFNULL(tp.CON_VALUE, 'No Group') as name,
|
||||
efficiencyIndex,
|
||||
inefficiencyCost,
|
||||
averageTime,
|
||||
deviationTime
|
||||
from
|
||||
( select
|
||||
gu.GRP_UID,
|
||||
$this->ueiFormula as efficiencyIndex,
|
||||
$this->ueiCostFormula as inefficiencyCost,
|
||||
AVG(AVG_TIME) as averageTime,
|
||||
AVG(SDV_TIME) as deviationTime
|
||||
from USR_REPORTING ur
|
||||
left join
|
||||
GROUP_USER gu on gu.USR_UID = ur.USR_UID
|
||||
WHERE
|
||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
AND
|
||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)
|
||||
group by gu.GRP_UID
|
||||
) i
|
||||
left join (select *
|
||||
from CONTENT
|
||||
where CON_CATEGORY = 'GRP_TITLE'
|
||||
and CON_LANG = 'en'
|
||||
) tp on i.GRP_UID = tp.CON_ID";
|
||||
|
||||
$retval = $this->propelExecutor($sqlString);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
public function groupEmployeesData($groupId, $initDate, $endDate, $language)
|
||||
{
|
||||
//TODO what if we are analizing empty user group (users without group)
|
||||
//for the moment all the indicator summarizes ALL users, so indicatorId is not used in this function.
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$initYear = $initDate->format("Y");
|
||||
$initMonth = $initDate->format("m");
|
||||
$initDay = $endDay = 1;
|
||||
$endYear = $endDate->format("Y");
|
||||
$endMonth = $endDate->format("m");
|
||||
|
||||
$sqlString = " select
|
||||
i.USR_UID as uid,
|
||||
i.name,
|
||||
efficiencyIndex,
|
||||
inefficiencyCost,
|
||||
averageTime,
|
||||
deviationTime
|
||||
from
|
||||
( select
|
||||
u.USR_UID,
|
||||
concat(u.USR_FIRSTNAME, ' ', u.USR_LASTNAME) as name,
|
||||
$this->ueiFormula as efficiencyIndex,
|
||||
$this->ueiCostFormula as inefficiencyCost,
|
||||
AVG(AVG_TIME) as averageTime,
|
||||
AVG(SDV_TIME) as deviationTime
|
||||
from USR_REPORTING ur
|
||||
left join
|
||||
GROUP_USER gu on gu.USR_UID = ur.USR_UID
|
||||
LEFT JOIN USERS u on u.USR_UID = ur.USR_UID
|
||||
where (gu.GRP_UID = '$groupId' or ('$groupId' = '0' && gu.GRP_UID is null ))
|
||||
AND
|
||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
AND
|
||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)
|
||||
group by ur.USR_UID
|
||||
) i";
|
||||
$returnValue = $this->propelExecutor($sqlString);
|
||||
return $returnValue;
|
||||
}
|
||||
//
|
||||
// public function employeeEfficiencyIndex($employeeList, $initDate, $endDate)
|
||||
// {
|
||||
// $resultList = $this->employeeEfficiencyIndexList($employeeList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($resultList));
|
||||
// }
|
||||
|
||||
public function ueiHistoric($employeeId, $initDate, $endDate, $periodicity)
|
||||
{
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::USER
|
||||
, $employeeId, $periodicity, $initDate, $endDate
|
||||
, $this->ueiFormula);
|
||||
$returnValue = $this->propelExecutor($sqlString);
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
// public function employeeEfficiencyCost($employeeList, $initDate, $endDate)
|
||||
// {
|
||||
// $resultList = $this->employeeEfficiencyCostList($employeeList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($resultList));
|
||||
// }
|
||||
//
|
||||
// public function userCostByGroupHistoric($groupId, $initDate, $endDate, $periodicity) {
|
||||
// if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
// if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
//
|
||||
// $periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
||||
// $periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
||||
// $initYear = $initDate->format("Y");
|
||||
// $initMonth = $initDate->format("m");
|
||||
// $initDay = $endDay = 1;
|
||||
// $endYear = $endDate->format("Y");
|
||||
// $endMonth = $endDate->format("m");
|
||||
//
|
||||
// $filterCondition = "";
|
||||
// if ($groupId != null && $groupId > 0) {
|
||||
// $filterCondition = " AND GRP_UID = '$groupId'";
|
||||
// }
|
||||
//
|
||||
// $sqlString = "SELECT (SUM(CONFIGURED_TASK_TIME) - SUM(TOTAL_TIME_BY_TASK)) * USER_HOUR_COST as EEC
|
||||
// FROM USR_REPORTING ur
|
||||
// LEFT JOIN GROUP_USER gu on gu.USR_UID =ur.USR_UID
|
||||
// LEFT JOIN GROUP_USER gu on gu.USR_UID =ur.USR_UID
|
||||
// WHERE
|
||||
// IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
// AND
|
||||
// IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
||||
// . $filterCondition
|
||||
// . $periodicityGroup;
|
||||
// $returnValue = $this->propelExecutor($sqlString);
|
||||
// return $returnValue;
|
||||
// }
|
||||
|
||||
// public function processEfficiencyCost($processList, $initDate, $endDate)
|
||||
// {
|
||||
// $resultList = $this->processEfficiencyCostList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($resultList));
|
||||
// }
|
||||
|
||||
public function peiCostHistoric($processId, $initDate, $endDate, $periodicity)
|
||||
{
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
||||
$periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
||||
$initYear = $initDate->format("Y");
|
||||
$initMonth = $initDate->format("m");
|
||||
$initDay = $endDay = 1;
|
||||
$endYear = $endDate->format("Y");
|
||||
$endMonth = $endDate->format("m");
|
||||
|
||||
$filterCondition = "";
|
||||
if ($processId != null && $processId > 0) {
|
||||
$filterCondition = " AND PRO_UID = '$processId'";
|
||||
}
|
||||
|
||||
$sqlString = "SELECT $periodicitySelectFields " . $this->peiCostFormula . " as PEC
|
||||
FROM USR_REPORTING
|
||||
WHERE
|
||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
AND
|
||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
||||
. $filterCondition
|
||||
. $periodicityGroup;
|
||||
|
||||
$retval = $this->propelExecutor($sqlString);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
public function generalIndicatorData($indicatorId, $initDate, $endDate, $periodicity) {
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$arrayT = $this->indicatorData($indicatorId);
|
||||
if (sizeof($arrayT) == 0 ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$indicator = $arrayT[0];
|
||||
$indicatorProcessId = $indicator["DAS_UID_PROCESS"];
|
||||
$indicatorType = $indicator["DAS_IND_TYPE"];
|
||||
if ($indicatorProcessId == "0" || strlen($indicatorProcessId) ==0) {
|
||||
$indicatorProcessId = null;
|
||||
}
|
||||
//$indicatorJson = unserialize($indicator['DAS_IND_PROPERTIES']);
|
||||
//$indicatorConfig = json_decode($indicatorJson);
|
||||
|
||||
/*$graph1 = $indicatorConfig->{'IND_FIRST_FIGURE'};
|
||||
$freq1 = $indicatorConfig->{'IND_FIRST_FREQUENCY'};
|
||||
$graph2 = $indicatorConfig->{'IND_SECOND_FIGURE'};
|
||||
$freq2 = $indicatorConfig->{'IND_SECOND_FREQUENCY'};
|
||||
*/
|
||||
|
||||
$graph1 = $indicator['DAS_IND_FIRST_FIGURE'];
|
||||
$freq1 = $indicator['DAS_IND_FIRST_FREQUENCY'];
|
||||
$graph2 = $indicator['DAS_IND_SECOND_FIGURE'];
|
||||
$freq2 = $indicator['DAS_IND_SECOND_FREQUENCY'];
|
||||
|
||||
$graph1XLabel = G::loadTranslation(ReportingPeriodicityEnum::labelFromValue($freq1));
|
||||
$graph1YLabel = "Value";
|
||||
|
||||
$graph2XLabel = G::loadTranslation(ReportingPeriodicityEnum::labelFromValue($freq2));
|
||||
$graph2YLabel = "Value";
|
||||
|
||||
$graphConfigurationString = "'$graph1XLabel' as graph1XLabel,
|
||||
'$graph1YLabel' as graph1YLabel,
|
||||
'$graph2XLabel' as graph2XLabel,
|
||||
'$graph2YLabel' as graph2YLabel,
|
||||
'$graph1' as graph1Type,
|
||||
'$freq1' as frequency1Type,
|
||||
'$graph2' as graph2Type,
|
||||
'$freq2' as frequency2Type,";
|
||||
|
||||
switch ($indicatorType) {
|
||||
//overdue
|
||||
case "1050":
|
||||
$calcField = "$graphConfigurationString 100 * SUM(TOTAL_CASES_OVERDUE) / SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE) as value";
|
||||
break;
|
||||
//new cases
|
||||
case "1060":
|
||||
$calcField = "$graphConfigurationString 100 * SUM(TOTAL_CASES_IN) / SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE) as value";
|
||||
break;
|
||||
//completed
|
||||
case "1070":
|
||||
$calcField = "$graphConfigurationString 100 * SUM(TOTAL_CASES_OUT) / SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE) as value";
|
||||
break;
|
||||
default:
|
||||
throw new Exception(" The indicator id '$indicatorId' with type $indicatorType hasn't an associated operation.");
|
||||
}
|
||||
|
||||
$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::PROCESS
|
||||
, $indicatorProcessId, $periodicity
|
||||
, $initDate, $endDate
|
||||
, $calcField);
|
||||
$returnValue = $this->propelExecutor($sqlString);
|
||||
return $returnValue;
|
||||
}
|
||||
// /***** Indicators for overdue, new, completed ******/
|
||||
// public function totalOverdueCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->totalOverdueCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function totalOverdueCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OVERDUE)", "");
|
||||
// }
|
||||
//
|
||||
// public function totalOverdueCasesByUser($userList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->totalOverdueCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function totalOverdueCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OVERDUE)", "");
|
||||
// }
|
||||
//
|
||||
// //percent
|
||||
// public function percentOverdueCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->percentOverdueCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
|
||||
// public function percentOverdueCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "100 * SUM(TOTAL_CASES_OVERDUE)", "SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE)");
|
||||
// }
|
||||
//
|
||||
// public function percentOverdueCasesByUser($userList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->percentOverdueCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function percentOverdueCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "100 * SUM(TOTAL_CASES_OVERDUE)", "SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE)");
|
||||
// }
|
||||
//
|
||||
// //new cases
|
||||
// public function totalNewCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->totalNewCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function totalNewCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_IN)", "");
|
||||
// }
|
||||
//
|
||||
// public function totalNewCasesByUser($userList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->totalNewCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function totalNewCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_IN)", "");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //completed cases
|
||||
// public function totalCompletedCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->totalCompletedCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function totalCompletedCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OUT)", "");
|
||||
// }
|
||||
//
|
||||
// public function totalCompletedCasesByUser($userList, $initDate, $endDate)
|
||||
// {
|
||||
// $returnList = $this->totalCompletedCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
||||
// return current(reset($returnList));
|
||||
// }
|
||||
//
|
||||
// public function totalCompletedCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OUT)", "");
|
||||
// }
|
||||
//
|
||||
// public function sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, $fieldToProcess, $fieldToCompare)
|
||||
// {
|
||||
// if ($processList != null && !is_array($processList)) throw new InvalidArgumentException ('employeeList parameter must be an Array or null value.', 0);
|
||||
// if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
// if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
//
|
||||
// $periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
||||
// $periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
||||
// $initYear = $initDate->format("Y");
|
||||
// $initMonth = $initDate->format("m");
|
||||
// $initDay = $endDay = 1;
|
||||
// $endYear = $endDate->format("Y");
|
||||
// $endMonth = $endDate->format("m");
|
||||
//
|
||||
//
|
||||
// $userCondition = "";
|
||||
// if ($processList != null && sizeof($processList) > 0) {
|
||||
// $userCondition = " AND PRO_UID IN " . "('" . implode("','", $processList) . "')";
|
||||
// }
|
||||
// $comparationOperation = "";
|
||||
// if (strlen($fieldToCompare) > 0) {
|
||||
// $comparationOperation = "/$fieldToCompare";
|
||||
// }
|
||||
//
|
||||
// $sqlString = "SELECT $periodicitySelectFields $fieldToProcess$comparationOperation as Indicator
|
||||
// FROM PRO_REPORTING
|
||||
// WHERE
|
||||
// IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
// AND
|
||||
// IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
||||
// . $userCondition
|
||||
// . $periodicityGroup;
|
||||
//
|
||||
// $retval = $this->propelExecutor($sqlString);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// public function sumCasesListByUser($processList, $initDate, $endDate, $periodicity, $fieldToProcess, $fieldToCompare)
|
||||
// {
|
||||
// if ($processList != null && !is_array($processList)) throw new InvalidArgumentException ('employeeList parameter must be an Array or null value.', 0);
|
||||
// if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
// if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
//
|
||||
// $periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
||||
// $periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
||||
// $initYear = $initDate->format("Y");
|
||||
// $initMonth = $initDate->format("m");
|
||||
// $initDay = $endDay = 1;
|
||||
// $endYear = $endDate->format("Y");
|
||||
// $endMonth = $endDate->format("m");
|
||||
//
|
||||
// $userCondition = "";
|
||||
// if ($processList != null && sizeof($processList) > 0) {
|
||||
// $userCondition = " AND USR_UID IN " . "('" . implode("','", $processList) . "')";
|
||||
// }
|
||||
//
|
||||
// $comparationOperation = "";
|
||||
// if (strlen($fieldToCompare) > 0) {
|
||||
// $comparationOperation = "/" . $fieldToCompare;
|
||||
// }
|
||||
//
|
||||
// $sqlString = "SELECT $periodicitySelectFields $fieldToProcess$comparationOperation as Indicator
|
||||
// FROM USR_REPORTING
|
||||
// WHERE
|
||||
// IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
// AND
|
||||
// IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
||||
// . $userCondition
|
||||
// . $periodicityGroup;
|
||||
//
|
||||
// $retval = $this->propelExecutor($sqlString);
|
||||
// return $retval;
|
||||
// }
|
||||
|
||||
public function peiTasks($processList, $initDate, $endDate, $language)
|
||||
{
|
||||
$processCondition = "";
|
||||
if ($processList != null && sizeof($processList) > 0) {
|
||||
$processCondition = " WHERE PRO_UID IN " . "('" . implode("','", $processList) . "')";
|
||||
}
|
||||
//TODO add dates condition in query
|
||||
$sqlString = " select
|
||||
i.TAS_UID as uid,
|
||||
t.CON_VALUE as name,
|
||||
i.efficienceIndex,
|
||||
i.averageTime,
|
||||
i.deviationTime,
|
||||
i.configuredTime
|
||||
FROM
|
||||
( select
|
||||
TAS_UID,
|
||||
$this->peiFormula as efficienceIndex,
|
||||
AVG(AVG_TIME) as averageTime,
|
||||
AVG(SDV_TIME) as deviationTime,
|
||||
CONFIGURED_TASK_TIME as configuredTime
|
||||
from USR_REPORTING
|
||||
$processCondition
|
||||
group by TAS_UID
|
||||
) i
|
||||
left join (select *
|
||||
from CONTENT
|
||||
where CON_CATEGORY = 'TAS_TITLE'
|
||||
and CON_LANG = '$language'
|
||||
) t on i.TAS_UID = t.CON_ID";
|
||||
$retval = $this->propelExecutor($sqlString);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
// public function employeeTasksInfoList($userList, $initDate, $endDate, $language)
|
||||
// {
|
||||
// $userCondition = "";
|
||||
// if ($userList != null && sizeof($userList) > 0) {
|
||||
// $userCondition = " WHERE USR_UID IN " . "('" . implode("','", $userList) . "')";
|
||||
// }
|
||||
// //TODO add dates contidion to query
|
||||
// $sqlString = " select
|
||||
// i.PRO_UID as ProcessId,
|
||||
// tp.CON_VALUE as ProcessTitle,
|
||||
// i.TAS_UID as TaskId,
|
||||
// tt.CON_VALUE as TaskTitle,
|
||||
// i.EfficienceIndex,
|
||||
// i.TimeAverage,
|
||||
// i.TimeSdv,
|
||||
// i.CONFIGURED_TASK_TIME as ConfiguredTime
|
||||
// FROM
|
||||
// ( select
|
||||
// PRO_UID,
|
||||
// TAS_UID,
|
||||
// (AVG(CONFIGURED_TASK_TIME) + AVG(SDV_TIME))/ AVG(AVG_TIME) as EfficienceIndex,
|
||||
// AVG(AVG_TIME) as TimeAverage,
|
||||
// AVG(SDV_TIME) as TimeSdv,
|
||||
// CONFIGURED_TASK_TIME
|
||||
// from USR_REPORTING
|
||||
// $userCondition
|
||||
// group by PRO_UID, TAS_UID
|
||||
// ) i
|
||||
// left join (select *
|
||||
// from CONTENT
|
||||
// where CON_CATEGORY = 'TAS_TITLE'
|
||||
// and CON_LANG = '$language'
|
||||
// ) tt on i.TAS_UID = tt.CON_ID
|
||||
// left join (select *
|
||||
// from CONTENT
|
||||
// where CON_CATEGORY = 'PRO_TITLE'
|
||||
// and CON_LANG = '$language'
|
||||
// ) tp on i.PRO_UID = tp.CON_ID";
|
||||
// $retval = $this->propelExecutor($sqlString);
|
||||
// return $retval;
|
||||
// }
|
||||
|
||||
private function periodicityFieldsForSelect($periodicity) {
|
||||
$periodicityFields = $this->periodicityFieldsString($periodicity);
|
||||
//add a comma if there are periodicity fields
|
||||
return $periodicityFields
|
||||
. ((strlen($periodicityFields) > 0)
|
||||
? ", "
|
||||
: "");
|
||||
}
|
||||
|
||||
private function periodicityFieldsForGrouping($periodicity) {
|
||||
$periodicityFields = $this->periodicityFieldsString($periodicity);
|
||||
|
||||
return ((strlen($periodicityFields) > 0)
|
||||
? " GROUP BY "
|
||||
: "") . str_replace(" AS QUARTER", "", str_replace(" AS SEMESTER", "", $periodicityFields));
|
||||
}
|
||||
|
||||
private function periodicityFieldsString($periodicity) {
|
||||
if (!ReportingPeriodicityEnum::isValidValue($periodicity)) throw new ArgumentException('Not supported periodicity: ', 0, 'periodicity');
|
||||
|
||||
$retval = "";
|
||||
switch ($periodicity) {
|
||||
case ReportingPeriodicityEnum::MONTH;
|
||||
$retval = "`YEAR`, `MONTH` ";
|
||||
break;
|
||||
case ReportingPeriodicityEnum::SEMESTER;
|
||||
$retval = "`YEAR`, IF (`MONTH` <= 6, 1, 2) AS SEMESTER";
|
||||
break;
|
||||
case ReportingPeriodicityEnum::QUARTER;
|
||||
$retval = "`YEAR`, CASE WHEN `MONTH` BETWEEN 1 AND 3 THEN 1 WHEN `MONTH` BETWEEN 4 AND 6 THEN 2 WHEN `MONTH` BETWEEN 7 AND 9 THEN 3 WHEN `MONTH` BETWEEN 10 AND 12 THEN 4 END AS QUARTER";
|
||||
break;
|
||||
case ReportingPeriodicityEnum::YEAR;
|
||||
$retval = "`YEAR` ";
|
||||
break;
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
|
||||
private function propelExecutor($sqlString) {
|
||||
$con = Propel::getConnection(self::$connectionName);
|
||||
$qry = $con->PrepareStatement($sqlString);
|
||||
try {
|
||||
$dataSet = $qry->executeQuery();
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Can't execute query " . $sqlString);
|
||||
}
|
||||
|
||||
$rows = Array();
|
||||
while ($dataSet->next()) {
|
||||
$rows[] = $dataSet->getRow();
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
private function indicatorsBasicQueryBuilder($reportingTable, $filterId, $periodicity, $initDate, $endDate, $fields ) {
|
||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||
|
||||
$tableMetadata = $this->metadataForTable($reportingTable);
|
||||
$periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
||||
$periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
||||
$initYear = $initDate->format("Y");
|
||||
$initMonth = $initDate->format("m");
|
||||
$endYear = $endDate->format("Y");
|
||||
$endMonth = $endDate->format("m");
|
||||
|
||||
$filterCondition = "";
|
||||
if ($filterId != null && $filterId > 0) {
|
||||
$filterCondition = " AND ".$tableMetadata["keyField"]." = '$filterId'";
|
||||
}
|
||||
|
||||
$sqlString = "SELECT $periodicitySelectFields $fields
|
||||
FROM ".$tableMetadata["tableName"].
|
||||
" WHERE
|
||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
||||
AND
|
||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
||||
. $filterCondition
|
||||
. $periodicityGroup;
|
||||
return $sqlString;
|
||||
}
|
||||
|
||||
private function metadataForTable($table) {
|
||||
$returnVal = null;
|
||||
switch (strtolower($table)) {
|
||||
case IndicatorDataSourcesEnum::USER:
|
||||
$returnVal = $this->userReportingMetadata;
|
||||
break;
|
||||
case IndicatorDataSourcesEnum::PROCESS:
|
||||
$returnVal = $this->processReportingMetadata;
|
||||
break;
|
||||
case IndicatorDataSourcesEnum::USER_GROUP:
|
||||
$returnVal = $this->userGroupReportingMetadata;
|
||||
break;
|
||||
case IndicatorDataSourcesEnum::PROCESS_CATEGORY:
|
||||
$returnVal = $this->processCategoryReportingMetadata;
|
||||
break;
|
||||
}
|
||||
if ($returnVal == null) {
|
||||
throw new Exception("'$table' it's not supportes. It has not associated a template.");
|
||||
}
|
||||
return $returnVal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
111
workflow/engine/classes/model/Catalog.php
Normal file
111
workflow/engine/classes/model/Catalog.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseCatalog.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'CATALOG' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class Catalog extends BaseCatalog
|
||||
{
|
||||
public function load ($catUid, $catType)
|
||||
{
|
||||
try {
|
||||
$catalog = CatalogPeer::retrieveByPK($catUid, $catType);
|
||||
$fields = $catalog->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$catalog->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function createOrUpdate($data)
|
||||
{
|
||||
$connection = Propel::getConnection(CatalogPeer::DATABASE_NAME);
|
||||
try {
|
||||
if (!isset($data['CAT_UID'])) {
|
||||
$data['CAT_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$msg = "Create Catalog";
|
||||
$catalog = new catalog();
|
||||
} else {
|
||||
$msg = "Update Catalog";
|
||||
$catalog = CatalogPeer::retrieveByPK($data['CAT_UID']);
|
||||
}
|
||||
$data['CAT_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$catalog->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($catalog->validate()) {
|
||||
$connection->begin();
|
||||
$result = $catalog->save();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog($msg, "Catalog ID Label: ".$catalog->getCatLabelId()." Catalog type: (".$catalog->getCatType().") ");
|
||||
return $catalog->getCatLabelId();
|
||||
} else {
|
||||
$message = '';
|
||||
$validationFailures = $catalog->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '. ';
|
||||
}
|
||||
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($catUid, $catType)
|
||||
{
|
||||
$connection = Propel::getConnection(CatalogPeer::DATABASE_NAME);
|
||||
try {
|
||||
$catalog = CatalogPeer::retrieveByPK($catUid, $catType);
|
||||
if (!is_null($catalog)) {
|
||||
$connection->begin();
|
||||
$catalogData = $this->load($dasUid);
|
||||
$result = $catalog->delete();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog("Deletecatalog", "Catalog Id Label: ". $catalogData['CAT_UID']." Catalog Type: (". $catalogData['CAT_TYPE'] .") ");
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $catalogData['CAT_UID']. '" does not exist.');
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function loadByType ($catType)
|
||||
{
|
||||
try {
|
||||
$criteria = new Criteria();
|
||||
$criteria->clearSelectColumns();
|
||||
$criteria->add(CatalogPeer::CAT_TYPE, strtoupper($catType), Criteria::EQUAL);
|
||||
|
||||
$rs = CatalogPeer::doSelectRS($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$catalog = array();
|
||||
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
$row['CAT_LABEL_ID'] = G::loadTranslation($row['CAT_LABEL_ID']);
|
||||
$catalog[] = $row;
|
||||
}
|
||||
|
||||
return $catalog;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
23
workflow/engine/classes/model/CatalogPeer.php
Normal file
23
workflow/engine/classes/model/CatalogPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseCatalogPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/Catalog.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'CATALOG' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class CatalogPeer extends BaseCatalogPeer {
|
||||
|
||||
} // CatalogPeer
|
||||
103
workflow/engine/classes/model/Dashboard.php
Normal file
103
workflow/engine/classes/model/Dashboard.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseDashboard.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'DASHBOARD' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class Dashboard extends BaseDashboard
|
||||
{
|
||||
|
||||
public function load ($dasUid)
|
||||
{
|
||||
try {
|
||||
$dashboard = DashboardPeer::retrieveByPK($dasUid);
|
||||
$fields = $dashboard->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$dashboard->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function createOrUpdate($data)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardPeer::DATABASE_NAME);
|
||||
try {
|
||||
|
||||
if (!isset($data['DAS_UID'])) {
|
||||
$data['DAS_UID'] = G::generateUniqueID();
|
||||
$data['DAS_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashboard = new Dashboard();
|
||||
$msg = 'Create ';
|
||||
} else {
|
||||
$msg = 'Update ';
|
||||
$dashboard = DashboardPeer::retrieveByPK($data['DAS_UID']);
|
||||
}
|
||||
|
||||
$data['DAS_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashboard->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($dashboard->validate()) {
|
||||
$connection->begin();
|
||||
$result = $dashboard->save();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog($msg, "Dashboard Name: " . $dashboard->getDasTitle() . " Dashboard ID: (".$dashboard->getDasUid().") ");
|
||||
return $dashboard->getDasUid();
|
||||
} else {
|
||||
$message = '';
|
||||
$validationFailures = $dashboard->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '. ';
|
||||
}
|
||||
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($dasUid)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardPeer::DATABASE_NAME);
|
||||
try {
|
||||
|
||||
require_once 'classes/model/DashboardDasInd.php';
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $dasUid);
|
||||
DashboardDasIndPeer::doDelete($criteria);
|
||||
|
||||
require_once 'classes/model/DashboardIndicator.php';
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DashboardIndicatorPeer::DAS_UID, $dasUid);
|
||||
DashboardIndicatorPeer::doDelete($criteria);
|
||||
|
||||
$dashboard = DashboardPeer::retrieveByPK($dasUid);
|
||||
if (!is_null($dashboard)) {
|
||||
$connection->begin();
|
||||
$dashboardData = $this->load($dasUid);
|
||||
$result = $dashboard->delete();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog("Deletedashboard", "Dashboard Name: ". $dashboardData['DAS_TITLE']." Dashboard ID: (".$dasUid.") ");
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
117
workflow/engine/classes/model/DashboardDasInd.php
Normal file
117
workflow/engine/classes/model/DashboardDasInd.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseDashboardDasInd.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'DASHBOARD_DAS_IND' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashboardDasInd extends BaseDashboardDasInd
|
||||
{
|
||||
public function loadByDashboards ($dasUid)
|
||||
{
|
||||
try {
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $dasUid);
|
||||
|
||||
$dataset = DashboardDasIndPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$fields = array();
|
||||
|
||||
while ($dataset->next()) {
|
||||
$auxField = $dataset->getRow();
|
||||
$fields[] = $auxField;
|
||||
}
|
||||
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function loadByOwner ($ownerUid)
|
||||
{
|
||||
try {
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_UID, $ownerUid);
|
||||
|
||||
$dataset = DashboardDasIndPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$fields = array();
|
||||
|
||||
while ($dataset->next()) {
|
||||
$auxField = $dataset->getRow();
|
||||
$fields[] = $auxField;
|
||||
}
|
||||
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function create($data)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
||||
try {
|
||||
$dashboardDasInd = new DashboardDasInd();
|
||||
$dashboardDasInd->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($dashboardDasInd->validate()) {
|
||||
$connection->begin();
|
||||
$result = $dashboardDasInd->save();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog("Create", "Dashboard Owner: ". $data['OWNER_UID']." Dashboard ID: (".$dashboardDasInd->getDasUid().") ");
|
||||
return $dashboardDasInd;
|
||||
} else {
|
||||
$message = '';
|
||||
$validationFailures = $dashboardDasInd->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '. ';
|
||||
}
|
||||
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($dasUid, $owner)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
||||
try {
|
||||
$dashboardDasInd = DashboardDasIndPeer::retrieveByPK($dasUid, $owner);
|
||||
if (!is_null($dashboardDasInd)) {
|
||||
$connection->begin();
|
||||
$result = $dashboardDasInd->delete();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog("DeletedashboardIndicator", "Dashboard ID: ". $dasUid ." Dashboard owner ID: (".$owner.") ");
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasUid. '" does not exist.');
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function getOwnerByDashboard ($dasUid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
23
workflow/engine/classes/model/DashboardDasIndPeer.php
Normal file
23
workflow/engine/classes/model/DashboardDasIndPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseDashboardDasIndPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/DashboardDasInd.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'DASHBOARD_DAS_IND' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashboardDasIndPeer extends BaseDashboardDasIndPeer {
|
||||
|
||||
} // DashboardDasIndPeer
|
||||
169
workflow/engine/classes/model/DashboardIndicator.php
Normal file
169
workflow/engine/classes/model/DashboardIndicator.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseDashboardIndicator.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'DASHBOARD_INDICATOR' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashboardIndicator extends BaseDashboardIndicator
|
||||
{
|
||||
public function load ($dasIndUid)
|
||||
{
|
||||
try {
|
||||
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($dasIndUid);
|
||||
$fields = $dashboardIndicator->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$dashboardIndicator->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
function loadbyDasUid ($dasUid, $vmeasureDate, $vcompareDate, $userUid)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
|
||||
try {
|
||||
|
||||
$connection = Propel::getConnection('workflow');
|
||||
$qryString = "select * from CONFIGURATION where CFG_UID = 'DASHBOARDS_SETTINGS' and USR_UID = '$userUid'";
|
||||
$qry = $connection->PrepareStatement($qryString);
|
||||
$dataSet = $qry->executeQuery();
|
||||
$dashConfig = array();
|
||||
while ($dataSet->next()){
|
||||
$row = $dataSet->getRow();
|
||||
$dashConfig = unserialize($row['CFG_VALUE']);
|
||||
}
|
||||
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
|
||||
$criteria->add( DashboardIndicatorPeer::DAS_UID, $dasUid, criteria::EQUAL );
|
||||
|
||||
$rs = DashboardIndicatorPeer::doSelectRS( $criteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$dashboardIndicator = array();
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
|
||||
//$currentDate = new DateTime (date("Y-m-d"));
|
||||
$measureDate = new DateTime ($vmeasureDate);
|
||||
$compareDate = new DateTime ($vcompareDate);
|
||||
$uid = ($row['DAS_UID_PROCESS'] == '0' ? null: $row['DAS_UID_PROCESS']) ;
|
||||
switch ($row['DAS_IND_TYPE']) {
|
||||
case '1010':
|
||||
$value = current(reset($calculator->peiHistoric($uid, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$oldValue = current(reset($calculator->peiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
break;
|
||||
case '1030':
|
||||
$value = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$oldValue = current(reset($calculator->ueiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
break;
|
||||
default:
|
||||
$arrResult = $calculator->generalIndicatorData($row['DAS_IND_UID'], $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = $arrResult[0]['value'];
|
||||
$row['DAS_IND_VARIATION'] = $row['DAS_IND_GOAL'];
|
||||
break;
|
||||
}
|
||||
$row['DAS_IND_VALUE'] = $value;
|
||||
|
||||
$indId = $row['DAS_IND_UID'];
|
||||
$row['DAS_IND_X'] = 0;
|
||||
$row['DAS_IND_Y'] = 0;
|
||||
$row['DAS_IND_WIDTH'] = 0;
|
||||
$row['DAS_IND_HEIGHT'] = 0;
|
||||
$row['DAS_IND_FAVORITE'] = 0;
|
||||
|
||||
foreach ($dashConfig as $dashId=>$oneDash) {
|
||||
if($dashId == $dasUid && is_array($oneDash['dashData'])) {
|
||||
foreach($oneDash['dashData'] as $graphConfig) {
|
||||
if ($graphConfig['indicatorId'] == $indId) {
|
||||
$row['DAS_IND_X'] = $graphConfig['x'];
|
||||
$row['DAS_IND_Y'] = $graphConfig['y'];
|
||||
$row['DAS_IND_WIDTH'] = $graphConfig['width'];
|
||||
$row['DAS_IND_HEIGHT'] = $graphConfig['height'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dashboardIndicator[] = $row;
|
||||
}
|
||||
return $dashboardIndicator;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function createOrUpdate($data)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
try {
|
||||
if (!isset($data['DAS_IND_UID'])) {
|
||||
$data['DAS_IND_UID'] = G::generateUniqueID();
|
||||
$data['DAS_IND_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashboardIndicator = new DashboardIndicator();
|
||||
$msg = 'Create';
|
||||
} else {
|
||||
$msg = 'Update';
|
||||
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($data['DAS_IND_UID']);
|
||||
}
|
||||
$data['DAS_IND_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashboardIndicator->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($dashboardIndicator->validate()) {
|
||||
$connection->begin();
|
||||
$result = $dashboardIndicator->save();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog($msg, "Dashboard Indicator Name: ".$dashboardIndicator->getDasIndTitle()." Dashboard indicator ID: (".$dashboardIndicator->getDasIndUid() .") ");
|
||||
return $dashboardIndicator->getDasIndUid();
|
||||
} else {
|
||||
$message = '';
|
||||
$validationFailures = $dashboardIndicator->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '. ';
|
||||
}
|
||||
throw(new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED", SYS_LANG) . ' ' . $message));
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($dasIndUid)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
try {
|
||||
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($dasIndUid);
|
||||
if (!is_null($dashboardIndicator)) {
|
||||
$connection->begin();
|
||||
$dashboardIndicatorData = $this->load($dasIndUid);
|
||||
$result = $dashboardIndicator->delete();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog("DeletedashboardIndicator", "Dashboard Indicator Name: ". $dashboardIndicatorData['DAS_IND_TITLE']." Dashboard Instance ID: (".$dasIndUid.") ");
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasIndUid. '" does not exist.');
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
23
workflow/engine/classes/model/DashboardIndicatorPeer.php
Normal file
23
workflow/engine/classes/model/DashboardIndicatorPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseDashboardIndicatorPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/DashboardIndicator.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'DASHBOARD_INDICATOR' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashboardIndicatorPeer extends BaseDashboardIndicatorPeer {
|
||||
|
||||
} // DashboardIndicatorPeer
|
||||
23
workflow/engine/classes/model/DashboardPeer.php
Normal file
23
workflow/engine/classes/model/DashboardPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseDashboardPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/Dashboard.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'DASHBOARD' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class DashboardPeer extends BaseDashboardPeer {
|
||||
|
||||
} // DashboardPeer
|
||||
19
workflow/engine/classes/model/ProReporting.php
Normal file
19
workflow/engine/classes/model/ProReporting.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseProReporting.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'PRO_REPORTING' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class ProReporting extends BaseProReporting {
|
||||
|
||||
} // ProReporting
|
||||
23
workflow/engine/classes/model/ProReportingPeer.php
Normal file
23
workflow/engine/classes/model/ProReportingPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseProReportingPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/ProReporting.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'PRO_REPORTING' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class ProReportingPeer extends BaseProReportingPeer {
|
||||
|
||||
} // ProReportingPeer
|
||||
19
workflow/engine/classes/model/UsrReporting.php
Normal file
19
workflow/engine/classes/model/UsrReporting.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseUsrReporting.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'USR_REPORTING' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class UsrReporting extends BaseUsrReporting {
|
||||
|
||||
} // UsrReporting
|
||||
23
workflow/engine/classes/model/UsrReportingPeer.php
Normal file
23
workflow/engine/classes/model/UsrReportingPeer.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// include base peer class
|
||||
require_once 'classes/model/om/BaseUsrReportingPeer.php';
|
||||
|
||||
// include object class
|
||||
include_once 'classes/model/UsrReporting.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'USR_REPORTING' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
class UsrReportingPeer extends BaseUsrReportingPeer {
|
||||
|
||||
} // UsrReportingPeer
|
||||
84
workflow/engine/classes/model/map/CatalogMapBuilder.php
Normal file
84
workflow/engine/classes/model/map/CatalogMapBuilder.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'CATALOG' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class CatalogMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.CatalogMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('CATALOG');
|
||||
$tMap->setPhpName('Catalog');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('CAT_UID', 'CatUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('CAT_LABEL_ID', 'CatLabelId', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addPrimaryKey('CAT_TYPE', 'CatType', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('CAT_FLAG', 'CatFlag', 'string', CreoleTypes::VARCHAR, false, 50);
|
||||
|
||||
$tMap->addColumn('CAT_OBSERVATION', 'CatObservation', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addColumn('CAT_CREATE_DATE', 'CatCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('CAT_UPDATE_DATE', 'CatUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // CatalogMapBuilder
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'DASHBOARD_DAS_IND' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class DashboardDasIndMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.DashboardDasIndMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('DASHBOARD_DAS_IND');
|
||||
$tMap->setPhpName('DashboardDasInd');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addForeignPrimaryKey('DAS_UID', 'DasUid', 'string' , CreoleTypes::VARCHAR, 'DASHBOARD', 'DAS_UID', true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('OWNER_UID', 'OwnerUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('OWNER_TYPE', 'OwnerType', 'string', CreoleTypes::VARCHAR, true, 15);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // DashboardDasIndMapBuilder
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'DASHBOARD_INDICATOR' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class DashboardIndicatorMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.DashboardIndicatorMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('DASHBOARD_INDICATOR');
|
||||
$tMap->setPhpName('DashboardIndicator');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('DAS_IND_UID', 'DasIndUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addForeignKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, 'DASHBOARD', 'DAS_UID', true, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_TYPE', 'DasIndType', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_TITLE', 'DasIndTitle', 'string', CreoleTypes::VARCHAR, true, 255);
|
||||
|
||||
$tMap->addColumn('DAS_IND_GOAL', 'DasIndGoal', 'double', CreoleTypes::DECIMAL, true, 7,2);
|
||||
|
||||
$tMap->addColumn('DAS_IND_DIRECTION', 'DasIndDirection', 'int', CreoleTypes::TINYINT, true, null);
|
||||
|
||||
$tMap->addColumn('DAS_UID_PROCESS', 'DasUidProcess', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_FIRST_FIGURE', 'DasIndFirstFigure', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_FIRST_FREQUENCY', 'DasIndFirstFrequency', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_SECOND_FIGURE', 'DasIndSecondFigure', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_SECOND_FREQUENCY', 'DasIndSecondFrequency', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('DAS_IND_CREATE_DATE', 'DasIndCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('DAS_IND_UPDATE_DATE', 'DasIndUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('DAS_IND_STATUS', 'DasIndStatus', 'int', CreoleTypes::TINYINT, true, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // DashboardIndicatorMapBuilder
|
||||
82
workflow/engine/classes/model/map/DashboardMapBuilder.php
Normal file
82
workflow/engine/classes/model/map/DashboardMapBuilder.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'DASHBOARD' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class DashboardMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.DashboardMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('DASHBOARD');
|
||||
$tMap->setPhpName('Dashboard');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('DAS_UID', 'DasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('DAS_TITLE', 'DasTitle', 'string', CreoleTypes::VARCHAR, true, 255);
|
||||
|
||||
$tMap->addColumn('DAS_DESCRIPTION', 'DasDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addColumn('DAS_CREATE_DATE', 'DasCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('DAS_UPDATE_DATE', 'DasUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('DAS_STATUS', 'DasStatus', 'int', CreoleTypes::TINYINT, true, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // DashboardMapBuilder
|
||||
94
workflow/engine/classes/model/map/ProReportingMapBuilder.php
Normal file
94
workflow/engine/classes/model/map/ProReportingMapBuilder.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'PRO_REPORTING' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class ProReportingMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.ProReportingMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('PRO_REPORTING');
|
||||
$tMap->setPhpName('ProReporting');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('MONTH', 'Month', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addPrimaryKey('YEAR', 'Year', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('AVG_TIME', 'AvgTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('SDV_TIME', 'SdvTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_IN', 'TotalCasesIn', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_OUT', 'TotalCasesOut', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('CONFIGURED_PROCESS_TIME', 'ConfiguredProcessTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('CONFIGURED_PROCESS_COST', 'ConfiguredProcessCost', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_OPEN', 'TotalCasesOpen', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_OVERDUE', 'TotalCasesOverdue', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_ON_TIME', 'TotalCasesOnTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ProReportingMapBuilder
|
||||
98
workflow/engine/classes/model/map/UsrReportingMapBuilder.php
Normal file
98
workflow/engine/classes/model/map/UsrReportingMapBuilder.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'USR_REPORTING' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class UsrReportingMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.UsrReportingMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('USR_REPORTING');
|
||||
$tMap->setPhpName('UsrReporting');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('MONTH', 'Month', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addPrimaryKey('YEAR', 'Year', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('TOTAL_TIME_BY_TASK', 'TotalTimeByTask', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_IN', 'TotalCasesIn', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_OUT', 'TotalCasesOut', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('USER_HOUR_COST', 'UserHourCost', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('AVG_TIME', 'AvgTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('SDV_TIME', 'SdvTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('CONFIGURED_TASK_TIME', 'ConfiguredTaskTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_OVERDUE', 'TotalCasesOverdue', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
$tMap->addColumn('TOTAL_CASES_ON_TIME', 'TotalCasesOnTime', 'double', CreoleTypes::DECIMAL, false, 7,2);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // UsrReportingMapBuilder
|
||||
926
workflow/engine/classes/model/om/BaseCatalog.php
Normal file
926
workflow/engine/classes/model/om/BaseCatalog.php
Normal file
@@ -0,0 +1,926 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/om/BaseObject.php';
|
||||
|
||||
require_once 'propel/om/Persistent.php';
|
||||
|
||||
|
||||
include_once 'propel/util/Criteria.php';
|
||||
|
||||
include_once 'classes/model/CatalogPeer.php';
|
||||
|
||||
/**
|
||||
* Base class that represents a row from the 'CATALOG' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseCatalog extends BaseObject implements Persistent
|
||||
{
|
||||
|
||||
/**
|
||||
* The Peer class.
|
||||
* Instance provides a convenient way of calling static methods on a class
|
||||
* that calling code may not be able to identify.
|
||||
* @var CatalogPeer
|
||||
*/
|
||||
protected static $peer;
|
||||
|
||||
/**
|
||||
* The value for the cat_uid field.
|
||||
* @var string
|
||||
*/
|
||||
protected $cat_uid = '0';
|
||||
|
||||
/**
|
||||
* The value for the cat_label_id field.
|
||||
* @var string
|
||||
*/
|
||||
protected $cat_label_id = '';
|
||||
|
||||
/**
|
||||
* The value for the cat_type field.
|
||||
* @var string
|
||||
*/
|
||||
protected $cat_type = '';
|
||||
|
||||
/**
|
||||
* The value for the cat_flag field.
|
||||
* @var string
|
||||
*/
|
||||
protected $cat_flag = '';
|
||||
|
||||
/**
|
||||
* The value for the cat_observation field.
|
||||
* @var string
|
||||
*/
|
||||
protected $cat_observation = '';
|
||||
|
||||
/**
|
||||
* The value for the cat_create_date field.
|
||||
* @var int
|
||||
*/
|
||||
protected $cat_create_date;
|
||||
|
||||
/**
|
||||
* The value for the cat_update_date field.
|
||||
* @var int
|
||||
*/
|
||||
protected $cat_update_date;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
* @var boolean
|
||||
*/
|
||||
protected $alreadyInSave = false;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless validation loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
* @var boolean
|
||||
*/
|
||||
protected $alreadyInValidation = false;
|
||||
|
||||
/**
|
||||
* Get the [cat_uid] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCatUid()
|
||||
{
|
||||
|
||||
return $this->cat_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [cat_label_id] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCatLabelId()
|
||||
{
|
||||
|
||||
return $this->cat_label_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [cat_type] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCatType()
|
||||
{
|
||||
|
||||
return $this->cat_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [cat_flag] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCatFlag()
|
||||
{
|
||||
|
||||
return $this->cat_flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [cat_observation] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCatObservation()
|
||||
{
|
||||
|
||||
return $this->cat_observation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] [cat_create_date] column value.
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the integer unix timestamp will be returned.
|
||||
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
|
||||
* @throws PropelException - if unable to convert the date/time to timestamp.
|
||||
*/
|
||||
public function getCatCreateDate($format = 'Y-m-d H:i:s')
|
||||
{
|
||||
|
||||
if ($this->cat_create_date === null || $this->cat_create_date === '') {
|
||||
return null;
|
||||
} elseif (!is_int($this->cat_create_date)) {
|
||||
// a non-timestamp value was set externally, so we convert it
|
||||
$ts = strtotime($this->cat_create_date);
|
||||
if ($ts === -1 || $ts === false) {
|
||||
throw new PropelException("Unable to parse value of [cat_create_date] as date/time value: " .
|
||||
var_export($this->cat_create_date, true));
|
||||
}
|
||||
} else {
|
||||
$ts = $this->cat_create_date;
|
||||
}
|
||||
if ($format === null) {
|
||||
return $ts;
|
||||
} elseif (strpos($format, '%') !== false) {
|
||||
return strftime($format, $ts);
|
||||
} else {
|
||||
return date($format, $ts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] [cat_update_date] column value.
|
||||
*
|
||||
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||
* If format is NULL, then the integer unix timestamp will be returned.
|
||||
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
|
||||
* @throws PropelException - if unable to convert the date/time to timestamp.
|
||||
*/
|
||||
public function getCatUpdateDate($format = 'Y-m-d H:i:s')
|
||||
{
|
||||
|
||||
if ($this->cat_update_date === null || $this->cat_update_date === '') {
|
||||
return null;
|
||||
} elseif (!is_int($this->cat_update_date)) {
|
||||
// a non-timestamp value was set externally, so we convert it
|
||||
$ts = strtotime($this->cat_update_date);
|
||||
if ($ts === -1 || $ts === false) {
|
||||
throw new PropelException("Unable to parse value of [cat_update_date] as date/time value: " .
|
||||
var_export($this->cat_update_date, true));
|
||||
}
|
||||
} else {
|
||||
$ts = $this->cat_update_date;
|
||||
}
|
||||
if ($format === null) {
|
||||
return $ts;
|
||||
} elseif (strpos($format, '%') !== false) {
|
||||
return strftime($format, $ts);
|
||||
} else {
|
||||
return date($format, $ts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [cat_uid] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatUid($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cat_uid !== $v || $v === '0') {
|
||||
$this->cat_uid = $v;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_UID;
|
||||
}
|
||||
|
||||
} // setCatUid()
|
||||
|
||||
/**
|
||||
* Set the value of [cat_label_id] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatLabelId($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cat_label_id !== $v || $v === '') {
|
||||
$this->cat_label_id = $v;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_LABEL_ID;
|
||||
}
|
||||
|
||||
} // setCatLabelId()
|
||||
|
||||
/**
|
||||
* Set the value of [cat_type] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatType($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cat_type !== $v || $v === '') {
|
||||
$this->cat_type = $v;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_TYPE;
|
||||
}
|
||||
|
||||
} // setCatType()
|
||||
|
||||
/**
|
||||
* Set the value of [cat_flag] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatFlag($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cat_flag !== $v || $v === '') {
|
||||
$this->cat_flag = $v;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_FLAG;
|
||||
}
|
||||
|
||||
} // setCatFlag()
|
||||
|
||||
/**
|
||||
* Set the value of [cat_observation] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatObservation($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cat_observation !== $v || $v === '') {
|
||||
$this->cat_observation = $v;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_OBSERVATION;
|
||||
}
|
||||
|
||||
} // setCatObservation()
|
||||
|
||||
/**
|
||||
* Set the value of [cat_create_date] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatCreateDate($v)
|
||||
{
|
||||
|
||||
if ($v !== null && !is_int($v)) {
|
||||
$ts = strtotime($v);
|
||||
//Date/time accepts null values
|
||||
if ($v == '') {
|
||||
$ts = null;
|
||||
}
|
||||
if ($ts === -1 || $ts === false) {
|
||||
throw new PropelException("Unable to parse date/time value for [cat_create_date] from input: " .
|
||||
var_export($v, true));
|
||||
}
|
||||
} else {
|
||||
$ts = $v;
|
||||
}
|
||||
if ($this->cat_create_date !== $ts) {
|
||||
$this->cat_create_date = $ts;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_CREATE_DATE;
|
||||
}
|
||||
|
||||
} // setCatCreateDate()
|
||||
|
||||
/**
|
||||
* Set the value of [cat_update_date] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setCatUpdateDate($v)
|
||||
{
|
||||
|
||||
if ($v !== null && !is_int($v)) {
|
||||
$ts = strtotime($v);
|
||||
//Date/time accepts null values
|
||||
if ($v == '') {
|
||||
$ts = null;
|
||||
}
|
||||
if ($ts === -1 || $ts === false) {
|
||||
throw new PropelException("Unable to parse date/time value for [cat_update_date] from input: " .
|
||||
var_export($v, true));
|
||||
}
|
||||
} else {
|
||||
$ts = $v;
|
||||
}
|
||||
if ($this->cat_update_date !== $ts) {
|
||||
$this->cat_update_date = $ts;
|
||||
$this->modifiedColumns[] = CatalogPeer::CAT_UPDATE_DATE;
|
||||
}
|
||||
|
||||
} // setCatUpdateDate()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
* An offset (1-based "start column") is specified so that objects can be hydrated
|
||||
* with a subset of the columns in the resultset rows. This is needed, for example,
|
||||
* for results of JOIN queries where the resultset row includes columns from two or
|
||||
* more tables.
|
||||
*
|
||||
* @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
|
||||
* @param int $startcol 1-based offset column which indicates which restultset column to start with.
|
||||
* @return int next starting column
|
||||
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
|
||||
*/
|
||||
public function hydrate(ResultSet $rs, $startcol = 1)
|
||||
{
|
||||
try {
|
||||
|
||||
$this->cat_uid = $rs->getString($startcol + 0);
|
||||
|
||||
$this->cat_label_id = $rs->getString($startcol + 1);
|
||||
|
||||
$this->cat_type = $rs->getString($startcol + 2);
|
||||
|
||||
$this->cat_flag = $rs->getString($startcol + 3);
|
||||
|
||||
$this->cat_observation = $rs->getString($startcol + 4);
|
||||
|
||||
$this->cat_create_date = $rs->getTimestamp($startcol + 5, null);
|
||||
|
||||
$this->cat_update_date = $rs->getTimestamp($startcol + 6, null);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 7; // 7 = CatalogPeer::NUM_COLUMNS - CatalogPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Catalog object", $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes this object from datastore and sets delete attribute.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see BaseObject::setDeleted()
|
||||
* @see BaseObject::isDeleted()
|
||||
*/
|
||||
public function delete($con = null)
|
||||
{
|
||||
if ($this->isDeleted()) {
|
||||
throw new PropelException("This object has already been deleted.");
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CatalogPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
CatalogPeer::doDelete($this, $con);
|
||||
$this->setDeleted(true);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the object in the database. If the object is new,
|
||||
* it inserts it; otherwise an update is performed. This method
|
||||
* wraps the doSave() worker method in a transaction.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return int The number of rows affected by this insert/update
|
||||
* @throws PropelException
|
||||
* @see doSave()
|
||||
*/
|
||||
public function save($con = null)
|
||||
{
|
||||
if ($this->isDeleted()) {
|
||||
throw new PropelException("You cannot save an object that has been deleted.");
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CatalogPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
$affectedRows = $this->doSave($con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the object in the database.
|
||||
*
|
||||
* If the object is new, it inserts it; otherwise an update is performed.
|
||||
* All related objects are also updated in this method.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return int The number of rows affected by this insert/update and any referring
|
||||
* @throws PropelException
|
||||
* @see save()
|
||||
*/
|
||||
protected function doSave($con)
|
||||
{
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
if (!$this->alreadyInSave) {
|
||||
$this->alreadyInSave = true;
|
||||
|
||||
|
||||
// If this object has been modified, then save it to the database.
|
||||
if ($this->isModified()) {
|
||||
if ($this->isNew()) {
|
||||
$pk = CatalogPeer::doInsert($this, $con);
|
||||
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
|
||||
// should always be true here (even though technically
|
||||
// BasePeer::doInsert() can insert multiple rows).
|
||||
|
||||
$this->setNew(false);
|
||||
} else {
|
||||
$affectedRows += CatalogPeer::doUpdate($this, $con);
|
||||
}
|
||||
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
||||
}
|
||||
|
||||
$this->alreadyInSave = false;
|
||||
}
|
||||
return $affectedRows;
|
||||
} // doSave()
|
||||
|
||||
/**
|
||||
* Array of ValidationFailed objects.
|
||||
* @var array ValidationFailed[]
|
||||
*/
|
||||
protected $validationFailures = array();
|
||||
|
||||
/**
|
||||
* Gets any ValidationFailed objects that resulted from last call to validate().
|
||||
*
|
||||
*
|
||||
* @return array ValidationFailed[]
|
||||
* @see validate()
|
||||
*/
|
||||
public function getValidationFailures()
|
||||
{
|
||||
return $this->validationFailures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the objects modified field values and all objects related to this table.
|
||||
*
|
||||
* If $columns is either a column name or an array of column names
|
||||
* only those columns are validated.
|
||||
*
|
||||
* @param mixed $columns Column name or an array of column names.
|
||||
* @return boolean Whether all columns pass validation.
|
||||
* @see doValidate()
|
||||
* @see getValidationFailures()
|
||||
*/
|
||||
public function validate($columns = null)
|
||||
{
|
||||
$res = $this->doValidate($columns);
|
||||
if ($res === true) {
|
||||
$this->validationFailures = array();
|
||||
return true;
|
||||
} else {
|
||||
$this->validationFailures = $res;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function performs the validation work for complex object models.
|
||||
*
|
||||
* In addition to checking the current object, all related objects will
|
||||
* also be validated. If all pass then <code>true</code> is returned; otherwise
|
||||
* an aggreagated array of ValidationFailed objects will be returned.
|
||||
*
|
||||
* @param array $columns Array of column names to validate.
|
||||
* @return mixed <code>true</code> if all validations pass;
|
||||
array of <code>ValidationFailed</code> objects otherwise.
|
||||
*/
|
||||
protected function doValidate($columns = null)
|
||||
{
|
||||
if (!$this->alreadyInValidation) {
|
||||
$this->alreadyInValidation = true;
|
||||
$retval = null;
|
||||
|
||||
$failureMap = array();
|
||||
|
||||
|
||||
if (($retval = CatalogPeer::doValidate($this, $columns)) !== true) {
|
||||
$failureMap = array_merge($failureMap, $retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->alreadyInValidation = false;
|
||||
}
|
||||
|
||||
return (!empty($failureMap) ? $failureMap : true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a field from the object by name passed in as a string.
|
||||
*
|
||||
* @param string $name name
|
||||
* @param string $type The type of fieldname the $name is of:
|
||||
* one of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return mixed Value of field.
|
||||
*/
|
||||
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = CatalogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||
return $this->getByPosition($pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a field from the object by Position as specified in the xml schema.
|
||||
* Zero-based.
|
||||
*
|
||||
* @param int $pos position in xml schema
|
||||
* @return mixed Value of field at $pos
|
||||
*/
|
||||
public function getByPosition($pos)
|
||||
{
|
||||
switch($pos) {
|
||||
case 0:
|
||||
return $this->getCatUid();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getCatLabelId();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getCatType();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getCatFlag();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getCatObservation();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getCatCreateDate();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCatUpdateDate();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the object as an array.
|
||||
*
|
||||
* You can specify the key type of the array by passing one of the class
|
||||
* type constants.
|
||||
*
|
||||
* @param string $keyType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return an associative array containing the field names (as keys) and field values
|
||||
*/
|
||||
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = CatalogPeer::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getCatUid(),
|
||||
$keys[1] => $this->getCatLabelId(),
|
||||
$keys[2] => $this->getCatType(),
|
||||
$keys[3] => $this->getCatFlag(),
|
||||
$keys[4] => $this->getCatObservation(),
|
||||
$keys[5] => $this->getCatCreateDate(),
|
||||
$keys[6] => $this->getCatUpdateDate(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a field from the object by name passed in as a string.
|
||||
*
|
||||
* @param string $name peer name
|
||||
* @param mixed $value field value
|
||||
* @param string $type The type of fieldname the $name is of:
|
||||
* one of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return void
|
||||
*/
|
||||
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = CatalogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a field from the object by Position as specified in the xml schema.
|
||||
* Zero-based.
|
||||
*
|
||||
* @param int $pos position in xml schema
|
||||
* @param mixed $value field value
|
||||
* @return void
|
||||
*/
|
||||
public function setByPosition($pos, $value)
|
||||
{
|
||||
switch($pos) {
|
||||
case 0:
|
||||
$this->setCatUid($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setCatLabelId($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setCatType($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setCatFlag($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setCatObservation($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setCatCreateDate($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCatUpdateDate($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the object using an array.
|
||||
*
|
||||
* This is particularly useful when populating an object from one of the
|
||||
* request arrays (e.g. $_POST). This method goes through the column
|
||||
* names, checking to see whether a matching key exists in populated
|
||||
* array. If so the setByName() method is called for that column.
|
||||
*
|
||||
* You can specify the key type of the array by additionally passing one
|
||||
* of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
|
||||
* TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
|
||||
*
|
||||
* @param array $arr An array to populate the object from.
|
||||
* @param string $keyType The type of keys the array uses.
|
||||
* @return void
|
||||
*/
|
||||
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = CatalogPeer::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) {
|
||||
$this->setCatUid($arr[$keys[0]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[1], $arr)) {
|
||||
$this->setCatLabelId($arr[$keys[1]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[2], $arr)) {
|
||||
$this->setCatType($arr[$keys[2]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[3], $arr)) {
|
||||
$this->setCatFlag($arr[$keys[3]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[4], $arr)) {
|
||||
$this->setCatObservation($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[5], $arr)) {
|
||||
$this->setCatCreateDate($arr[$keys[5]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[6], $arr)) {
|
||||
$this->setCatUpdateDate($arr[$keys[6]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a Criteria object containing the values of all modified columns in this object.
|
||||
*
|
||||
* @return Criteria The Criteria object containing all modified values.
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(CatalogPeer::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_UID)) {
|
||||
$criteria->add(CatalogPeer::CAT_UID, $this->cat_uid);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_LABEL_ID)) {
|
||||
$criteria->add(CatalogPeer::CAT_LABEL_ID, $this->cat_label_id);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_TYPE)) {
|
||||
$criteria->add(CatalogPeer::CAT_TYPE, $this->cat_type);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_FLAG)) {
|
||||
$criteria->add(CatalogPeer::CAT_FLAG, $this->cat_flag);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_OBSERVATION)) {
|
||||
$criteria->add(CatalogPeer::CAT_OBSERVATION, $this->cat_observation);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_CREATE_DATE)) {
|
||||
$criteria->add(CatalogPeer::CAT_CREATE_DATE, $this->cat_create_date);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(CatalogPeer::CAT_UPDATE_DATE)) {
|
||||
$criteria->add(CatalogPeer::CAT_UPDATE_DATE, $this->cat_update_date);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a Criteria object containing the primary key for this object.
|
||||
*
|
||||
* Unlike buildCriteria() this method includes the primary key values regardless
|
||||
* of whether or not they have been modified.
|
||||
*
|
||||
* @return Criteria The Criteria object containing value(s) for primary key(s).
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(CatalogPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(CatalogPeer::CAT_UID, $this->cat_uid);
|
||||
$criteria->add(CatalogPeer::CAT_TYPE, $this->cat_type);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the composite primary key for this object.
|
||||
* The array elements will be in same order as specified in XML.
|
||||
* @return array
|
||||
*/
|
||||
public function getPrimaryKey()
|
||||
{
|
||||
$pks = array();
|
||||
|
||||
$pks[0] = $this->getCatUid();
|
||||
|
||||
$pks[1] = $this->getCatType();
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the [composite] primary key.
|
||||
*
|
||||
* @param array $keys The elements of the composite key (order must match the order in XML file).
|
||||
* @return void
|
||||
*/
|
||||
public function setPrimaryKey($keys)
|
||||
{
|
||||
|
||||
$this->setCatUid($keys[0]);
|
||||
|
||||
$this->setCatType($keys[1]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets contents of passed object to values from current object.
|
||||
*
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of Catalog (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copyInto($copyObj, $deepCopy = false)
|
||||
{
|
||||
|
||||
$copyObj->setCatLabelId($this->cat_label_id);
|
||||
|
||||
$copyObj->setCatFlag($this->cat_flag);
|
||||
|
||||
$copyObj->setCatObservation($this->cat_observation);
|
||||
|
||||
$copyObj->setCatCreateDate($this->cat_create_date);
|
||||
|
||||
$copyObj->setCatUpdateDate($this->cat_update_date);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
$copyObj->setCatUid('0'); // this is a pkey column, so set to default value
|
||||
|
||||
$copyObj->setCatType(''); // this is a pkey column, so set to default value
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a copy of this object that will be inserted as a new row in table when saved.
|
||||
* It creates a new object filling in the simple attributes, but skipping any primary
|
||||
* keys that are defined for the table.
|
||||
*
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return Catalog Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
{
|
||||
// we use get_class(), because this might be a subclass
|
||||
$clazz = get_class($this);
|
||||
$copyObj = new $clazz();
|
||||
$this->copyInto($copyObj, $deepCopy);
|
||||
return $copyObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a peer instance associated with this om.
|
||||
*
|
||||
* Since Peer classes are not to have any instance attributes, this method returns the
|
||||
* same instance for all member of this class. The method could therefore
|
||||
* be static, but this would prevent one from overriding the behavior.
|
||||
*
|
||||
* @return CatalogPeer
|
||||
*/
|
||||
public function getPeer()
|
||||
{
|
||||
if (self::$peer === null) {
|
||||
self::$peer = new CatalogPeer();
|
||||
}
|
||||
return self::$peer;
|
||||
}
|
||||
}
|
||||
|
||||
587
workflow/engine/classes/model/om/BaseCatalogPeer.php
Normal file
587
workflow/engine/classes/model/om/BaseCatalogPeer.php
Normal file
@@ -0,0 +1,587 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by CatalogPeer::getOMClass()
|
||||
include_once 'classes/model/Catalog.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'CATALOG' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseCatalogPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'CATALOG';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.Catalog';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 7;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the CAT_UID field */
|
||||
const CAT_UID = 'CATALOG.CAT_UID';
|
||||
|
||||
/** the column name for the CAT_LABEL_ID field */
|
||||
const CAT_LABEL_ID = 'CATALOG.CAT_LABEL_ID';
|
||||
|
||||
/** the column name for the CAT_TYPE field */
|
||||
const CAT_TYPE = 'CATALOG.CAT_TYPE';
|
||||
|
||||
/** the column name for the CAT_FLAG field */
|
||||
const CAT_FLAG = 'CATALOG.CAT_FLAG';
|
||||
|
||||
/** the column name for the CAT_OBSERVATION field */
|
||||
const CAT_OBSERVATION = 'CATALOG.CAT_OBSERVATION';
|
||||
|
||||
/** the column name for the CAT_CREATE_DATE field */
|
||||
const CAT_CREATE_DATE = 'CATALOG.CAT_CREATE_DATE';
|
||||
|
||||
/** the column name for the CAT_UPDATE_DATE field */
|
||||
const CAT_UPDATE_DATE = 'CATALOG.CAT_UPDATE_DATE';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('CatUid', 'CatLabelId', 'CatType', 'CatFlag', 'CatObservation', 'CatCreateDate', 'CatUpdateDate', ),
|
||||
BasePeer::TYPE_COLNAME => array (CatalogPeer::CAT_UID, CatalogPeer::CAT_LABEL_ID, CatalogPeer::CAT_TYPE, CatalogPeer::CAT_FLAG, CatalogPeer::CAT_OBSERVATION, CatalogPeer::CAT_CREATE_DATE, CatalogPeer::CAT_UPDATE_DATE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('CAT_UID', 'CAT_LABEL_ID', 'CAT_TYPE', 'CAT_FLAG', 'CAT_OBSERVATION', 'CAT_CREATE_DATE', 'CAT_UPDATE_DATE', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('CatUid' => 0, 'CatLabelId' => 1, 'CatType' => 2, 'CatFlag' => 3, 'CatObservation' => 4, 'CatCreateDate' => 5, 'CatUpdateDate' => 6, ),
|
||||
BasePeer::TYPE_COLNAME => array (CatalogPeer::CAT_UID => 0, CatalogPeer::CAT_LABEL_ID => 1, CatalogPeer::CAT_TYPE => 2, CatalogPeer::CAT_FLAG => 3, CatalogPeer::CAT_OBSERVATION => 4, CatalogPeer::CAT_CREATE_DATE => 5, CatalogPeer::CAT_UPDATE_DATE => 6, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('CAT_UID' => 0, 'CAT_LABEL_ID' => 1, 'CAT_TYPE' => 2, 'CAT_FLAG' => 3, 'CAT_OBSERVATION' => 4, 'CAT_CREATE_DATE' => 5, 'CAT_UPDATE_DATE' => 6, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/CatalogMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.CatalogMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = CatalogPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. CatalogPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(CatalogPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_UID);
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_LABEL_ID);
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_TYPE);
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_FLAG);
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_OBSERVATION);
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_CREATE_DATE);
|
||||
|
||||
$criteria->addSelectColumn(CatalogPeer::CAT_UPDATE_DATE);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(CATALOG.CAT_UID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT CATALOG.CAT_UID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(CatalogPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(CatalogPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = CatalogPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return Catalog
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = CatalogPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return CatalogPeer::populateObjects(CatalogPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
CatalogPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = CatalogPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return CatalogPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a Catalog or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Catalog object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from Catalog object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a Catalog or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Catalog object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(CatalogPeer::CAT_UID);
|
||||
$selectCriteria->add(CatalogPeer::CAT_UID, $criteria->remove(CatalogPeer::CAT_UID), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(CatalogPeer::CAT_TYPE);
|
||||
$selectCriteria->add(CatalogPeer::CAT_TYPE, $criteria->remove(CatalogPeer::CAT_TYPE), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the CATALOG table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(CatalogPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a Catalog or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Catalog object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CatalogPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof Catalog) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey
|
||||
// values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
$vals = array();
|
||||
foreach ($values as $value) {
|
||||
|
||||
$vals[0][] = $value[0];
|
||||
$vals[1][] = $value[1];
|
||||
}
|
||||
|
||||
$criteria->add(CatalogPeer::CAT_UID, $vals[0], Criteria::IN);
|
||||
$criteria->add(CatalogPeer::CAT_TYPE, $vals[1], Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given Catalog object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param Catalog $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(Catalog $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(CatalogPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(CatalogPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(CatalogPeer::DATABASE_NAME, CatalogPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve object using using composite pkey values.
|
||||
* @param string $cat_uid
|
||||
* @param string $cat_type
|
||||
* @param Connection $con
|
||||
* @return Catalog
|
||||
*/
|
||||
public static function retrieveByPK($cat_uid, $cat_type, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(CatalogPeer::CAT_UID, $cat_uid);
|
||||
$criteria->add(CatalogPeer::CAT_TYPE, $cat_type);
|
||||
$v = CatalogPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) ? $v[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseCatalogPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/CatalogMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.CatalogMapBuilder');
|
||||
}
|
||||
|
||||
1142
workflow/engine/classes/model/om/BaseDashboard.php
Normal file
1142
workflow/engine/classes/model/om/BaseDashboard.php
Normal file
File diff suppressed because it is too large
Load Diff
723
workflow/engine/classes/model/om/BaseDashboardDasInd.php
Normal file
723
workflow/engine/classes/model/om/BaseDashboardDasInd.php
Normal file
@@ -0,0 +1,723 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/om/BaseObject.php';
|
||||
|
||||
require_once 'propel/om/Persistent.php';
|
||||
|
||||
|
||||
include_once 'propel/util/Criteria.php';
|
||||
|
||||
include_once 'classes/model/DashboardDasIndPeer.php';
|
||||
|
||||
/**
|
||||
* Base class that represents a row from the 'DASHBOARD_DAS_IND' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseDashboardDasInd extends BaseObject implements Persistent
|
||||
{
|
||||
|
||||
/**
|
||||
* The Peer class.
|
||||
* Instance provides a convenient way of calling static methods on a class
|
||||
* that calling code may not be able to identify.
|
||||
* @var DashboardDasIndPeer
|
||||
*/
|
||||
protected static $peer;
|
||||
|
||||
/**
|
||||
* The value for the das_uid field.
|
||||
* @var string
|
||||
*/
|
||||
protected $das_uid = '';
|
||||
|
||||
/**
|
||||
* The value for the owner_uid field.
|
||||
* @var string
|
||||
*/
|
||||
protected $owner_uid = '';
|
||||
|
||||
/**
|
||||
* The value for the owner_type field.
|
||||
* @var string
|
||||
*/
|
||||
protected $owner_type = '';
|
||||
|
||||
/**
|
||||
* @var Dashboard
|
||||
*/
|
||||
protected $aDashboard;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
* @var boolean
|
||||
*/
|
||||
protected $alreadyInSave = false;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless validation loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
* @var boolean
|
||||
*/
|
||||
protected $alreadyInValidation = false;
|
||||
|
||||
/**
|
||||
* Get the [das_uid] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDasUid()
|
||||
{
|
||||
|
||||
return $this->das_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [owner_uid] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOwnerUid()
|
||||
{
|
||||
|
||||
return $this->owner_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [owner_type] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOwnerType()
|
||||
{
|
||||
|
||||
return $this->owner_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [das_uid] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setDasUid($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->das_uid !== $v || $v === '') {
|
||||
$this->das_uid = $v;
|
||||
$this->modifiedColumns[] = DashboardDasIndPeer::DAS_UID;
|
||||
}
|
||||
|
||||
if ($this->aDashboard !== null && $this->aDashboard->getDasUid() !== $v) {
|
||||
$this->aDashboard = null;
|
||||
}
|
||||
|
||||
} // setDasUid()
|
||||
|
||||
/**
|
||||
* Set the value of [owner_uid] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setOwnerUid($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->owner_uid !== $v || $v === '') {
|
||||
$this->owner_uid = $v;
|
||||
$this->modifiedColumns[] = DashboardDasIndPeer::OWNER_UID;
|
||||
}
|
||||
|
||||
} // setOwnerUid()
|
||||
|
||||
/**
|
||||
* Set the value of [owner_type] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setOwnerType($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->owner_type !== $v || $v === '') {
|
||||
$this->owner_type = $v;
|
||||
$this->modifiedColumns[] = DashboardDasIndPeer::OWNER_TYPE;
|
||||
}
|
||||
|
||||
} // setOwnerType()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
* An offset (1-based "start column") is specified so that objects can be hydrated
|
||||
* with a subset of the columns in the resultset rows. This is needed, for example,
|
||||
* for results of JOIN queries where the resultset row includes columns from two or
|
||||
* more tables.
|
||||
*
|
||||
* @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
|
||||
* @param int $startcol 1-based offset column which indicates which restultset column to start with.
|
||||
* @return int next starting column
|
||||
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
|
||||
*/
|
||||
public function hydrate(ResultSet $rs, $startcol = 1)
|
||||
{
|
||||
try {
|
||||
|
||||
$this->das_uid = $rs->getString($startcol + 0);
|
||||
|
||||
$this->owner_uid = $rs->getString($startcol + 1);
|
||||
|
||||
$this->owner_type = $rs->getString($startcol + 2);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 3; // 3 = DashboardDasIndPeer::NUM_COLUMNS - DashboardDasIndPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating DashboardDasInd object", $e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes this object from datastore and sets delete attribute.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
* @see BaseObject::setDeleted()
|
||||
* @see BaseObject::isDeleted()
|
||||
*/
|
||||
public function delete($con = null)
|
||||
{
|
||||
if ($this->isDeleted()) {
|
||||
throw new PropelException("This object has already been deleted.");
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
DashboardDasIndPeer::doDelete($this, $con);
|
||||
$this->setDeleted(true);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the object in the database. If the object is new,
|
||||
* it inserts it; otherwise an update is performed. This method
|
||||
* wraps the doSave() worker method in a transaction.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return int The number of rows affected by this insert/update
|
||||
* @throws PropelException
|
||||
* @see doSave()
|
||||
*/
|
||||
public function save($con = null)
|
||||
{
|
||||
if ($this->isDeleted()) {
|
||||
throw new PropelException("You cannot save an object that has been deleted.");
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
try {
|
||||
$con->begin();
|
||||
$affectedRows = $this->doSave($con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the object in the database.
|
||||
*
|
||||
* If the object is new, it inserts it; otherwise an update is performed.
|
||||
* All related objects are also updated in this method.
|
||||
*
|
||||
* @param Connection $con
|
||||
* @return int The number of rows affected by this insert/update and any referring
|
||||
* @throws PropelException
|
||||
* @see save()
|
||||
*/
|
||||
protected function doSave($con)
|
||||
{
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
if (!$this->alreadyInSave) {
|
||||
$this->alreadyInSave = true;
|
||||
|
||||
|
||||
// We call the save method on the following object(s) if they
|
||||
// were passed to this object by their coresponding set
|
||||
// method. This object relates to these object(s) by a
|
||||
// foreign key reference.
|
||||
|
||||
if ($this->aDashboard !== null) {
|
||||
if ($this->aDashboard->isModified()) {
|
||||
$affectedRows += $this->aDashboard->save($con);
|
||||
}
|
||||
$this->setDashboard($this->aDashboard);
|
||||
}
|
||||
|
||||
|
||||
// If this object has been modified, then save it to the database.
|
||||
if ($this->isModified()) {
|
||||
if ($this->isNew()) {
|
||||
$pk = DashboardDasIndPeer::doInsert($this, $con);
|
||||
$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
|
||||
// should always be true here (even though technically
|
||||
// BasePeer::doInsert() can insert multiple rows).
|
||||
|
||||
$this->setNew(false);
|
||||
} else {
|
||||
$affectedRows += DashboardDasIndPeer::doUpdate($this, $con);
|
||||
}
|
||||
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
||||
}
|
||||
|
||||
$this->alreadyInSave = false;
|
||||
}
|
||||
return $affectedRows;
|
||||
} // doSave()
|
||||
|
||||
/**
|
||||
* Array of ValidationFailed objects.
|
||||
* @var array ValidationFailed[]
|
||||
*/
|
||||
protected $validationFailures = array();
|
||||
|
||||
/**
|
||||
* Gets any ValidationFailed objects that resulted from last call to validate().
|
||||
*
|
||||
*
|
||||
* @return array ValidationFailed[]
|
||||
* @see validate()
|
||||
*/
|
||||
public function getValidationFailures()
|
||||
{
|
||||
return $this->validationFailures;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the objects modified field values and all objects related to this table.
|
||||
*
|
||||
* If $columns is either a column name or an array of column names
|
||||
* only those columns are validated.
|
||||
*
|
||||
* @param mixed $columns Column name or an array of column names.
|
||||
* @return boolean Whether all columns pass validation.
|
||||
* @see doValidate()
|
||||
* @see getValidationFailures()
|
||||
*/
|
||||
public function validate($columns = null)
|
||||
{
|
||||
$res = $this->doValidate($columns);
|
||||
if ($res === true) {
|
||||
$this->validationFailures = array();
|
||||
return true;
|
||||
} else {
|
||||
$this->validationFailures = $res;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function performs the validation work for complex object models.
|
||||
*
|
||||
* In addition to checking the current object, all related objects will
|
||||
* also be validated. If all pass then <code>true</code> is returned; otherwise
|
||||
* an aggreagated array of ValidationFailed objects will be returned.
|
||||
*
|
||||
* @param array $columns Array of column names to validate.
|
||||
* @return mixed <code>true</code> if all validations pass;
|
||||
array of <code>ValidationFailed</code> objects otherwise.
|
||||
*/
|
||||
protected function doValidate($columns = null)
|
||||
{
|
||||
if (!$this->alreadyInValidation) {
|
||||
$this->alreadyInValidation = true;
|
||||
$retval = null;
|
||||
|
||||
$failureMap = array();
|
||||
|
||||
|
||||
// We call the validate method on the following object(s) if they
|
||||
// were passed to this object by their coresponding set
|
||||
// method. This object relates to these object(s) by a
|
||||
// foreign key reference.
|
||||
|
||||
if ($this->aDashboard !== null) {
|
||||
if (!$this->aDashboard->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $this->aDashboard->getValidationFailures());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (($retval = DashboardDasIndPeer::doValidate($this, $columns)) !== true) {
|
||||
$failureMap = array_merge($failureMap, $retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->alreadyInValidation = false;
|
||||
}
|
||||
|
||||
return (!empty($failureMap) ? $failureMap : true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a field from the object by name passed in as a string.
|
||||
*
|
||||
* @param string $name name
|
||||
* @param string $type The type of fieldname the $name is of:
|
||||
* one of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return mixed Value of field.
|
||||
*/
|
||||
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = DashboardDasIndPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||
return $this->getByPosition($pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a field from the object by Position as specified in the xml schema.
|
||||
* Zero-based.
|
||||
*
|
||||
* @param int $pos position in xml schema
|
||||
* @return mixed Value of field at $pos
|
||||
*/
|
||||
public function getByPosition($pos)
|
||||
{
|
||||
switch($pos) {
|
||||
case 0:
|
||||
return $this->getDasUid();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getOwnerUid();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getOwnerType();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
/**
|
||||
* Exports the object as an array.
|
||||
*
|
||||
* You can specify the key type of the array by passing one of the class
|
||||
* type constants.
|
||||
*
|
||||
* @param string $keyType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return an associative array containing the field names (as keys) and field values
|
||||
*/
|
||||
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = DashboardDasIndPeer::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getDasUid(),
|
||||
$keys[1] => $this->getOwnerUid(),
|
||||
$keys[2] => $this->getOwnerType(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a field from the object by name passed in as a string.
|
||||
*
|
||||
* @param string $name peer name
|
||||
* @param mixed $value field value
|
||||
* @param string $type The type of fieldname the $name is of:
|
||||
* one of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return void
|
||||
*/
|
||||
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$pos = DashboardDasIndPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
|
||||
return $this->setByPosition($pos, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a field from the object by Position as specified in the xml schema.
|
||||
* Zero-based.
|
||||
*
|
||||
* @param int $pos position in xml schema
|
||||
* @param mixed $value field value
|
||||
* @return void
|
||||
*/
|
||||
public function setByPosition($pos, $value)
|
||||
{
|
||||
switch($pos) {
|
||||
case 0:
|
||||
$this->setDasUid($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setOwnerUid($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setOwnerType($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates the object using an array.
|
||||
*
|
||||
* This is particularly useful when populating an object from one of the
|
||||
* request arrays (e.g. $_POST). This method goes through the column
|
||||
* names, checking to see whether a matching key exists in populated
|
||||
* array. If so the setByName() method is called for that column.
|
||||
*
|
||||
* You can specify the key type of the array by additionally passing one
|
||||
* of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
|
||||
* TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
|
||||
*
|
||||
* @param array $arr An array to populate the object from.
|
||||
* @param string $keyType The type of keys the array uses.
|
||||
* @return void
|
||||
*/
|
||||
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
$keys = DashboardDasIndPeer::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) {
|
||||
$this->setDasUid($arr[$keys[0]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[1], $arr)) {
|
||||
$this->setOwnerUid($arr[$keys[1]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[2], $arr)) {
|
||||
$this->setOwnerType($arr[$keys[2]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a Criteria object containing the values of all modified columns in this object.
|
||||
*
|
||||
* @return Criteria The Criteria object containing all modified values.
|
||||
*/
|
||||
public function buildCriteria()
|
||||
{
|
||||
$criteria = new Criteria(DashboardDasIndPeer::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(DashboardDasIndPeer::DAS_UID)) {
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $this->das_uid);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(DashboardDasIndPeer::OWNER_UID)) {
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_UID, $this->owner_uid);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(DashboardDasIndPeer::OWNER_TYPE)) {
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_TYPE, $this->owner_type);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a Criteria object containing the primary key for this object.
|
||||
*
|
||||
* Unlike buildCriteria() this method includes the primary key values regardless
|
||||
* of whether or not they have been modified.
|
||||
*
|
||||
* @return Criteria The Criteria object containing value(s) for primary key(s).
|
||||
*/
|
||||
public function buildPkeyCriteria()
|
||||
{
|
||||
$criteria = new Criteria(DashboardDasIndPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $this->das_uid);
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_UID, $this->owner_uid);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the composite primary key for this object.
|
||||
* The array elements will be in same order as specified in XML.
|
||||
* @return array
|
||||
*/
|
||||
public function getPrimaryKey()
|
||||
{
|
||||
$pks = array();
|
||||
|
||||
$pks[0] = $this->getDasUid();
|
||||
|
||||
$pks[1] = $this->getOwnerUid();
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the [composite] primary key.
|
||||
*
|
||||
* @param array $keys The elements of the composite key (order must match the order in XML file).
|
||||
* @return void
|
||||
*/
|
||||
public function setPrimaryKey($keys)
|
||||
{
|
||||
|
||||
$this->setDasUid($keys[0]);
|
||||
|
||||
$this->setOwnerUid($keys[1]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets contents of passed object to values from current object.
|
||||
*
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param object $copyObj An object of DashboardDasInd (or compatible) type.
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copyInto($copyObj, $deepCopy = false)
|
||||
{
|
||||
|
||||
$copyObj->setOwnerType($this->owner_type);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
$copyObj->setDasUid(''); // this is a pkey column, so set to default value
|
||||
|
||||
$copyObj->setOwnerUid(''); // this is a pkey column, so set to default value
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a copy of this object that will be inserted as a new row in table when saved.
|
||||
* It creates a new object filling in the simple attributes, but skipping any primary
|
||||
* keys that are defined for the table.
|
||||
*
|
||||
* If desired, this method can also make copies of all associated (fkey referrers)
|
||||
* objects.
|
||||
*
|
||||
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
|
||||
* @return DashboardDasInd Clone of current object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function copy($deepCopy = false)
|
||||
{
|
||||
// we use get_class(), because this might be a subclass
|
||||
$clazz = get_class($this);
|
||||
$copyObj = new $clazz();
|
||||
$this->copyInto($copyObj, $deepCopy);
|
||||
return $copyObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a peer instance associated with this om.
|
||||
*
|
||||
* Since Peer classes are not to have any instance attributes, this method returns the
|
||||
* same instance for all member of this class. The method could therefore
|
||||
* be static, but this would prevent one from overriding the behavior.
|
||||
*
|
||||
* @return DashboardDasIndPeer
|
||||
*/
|
||||
public function getPeer()
|
||||
{
|
||||
if (self::$peer === null) {
|
||||
self::$peer = new DashboardDasIndPeer();
|
||||
}
|
||||
return self::$peer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a Dashboard object.
|
||||
*
|
||||
* @param Dashboard $v
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setDashboard($v)
|
||||
{
|
||||
|
||||
|
||||
if ($v === null) {
|
||||
$this->setDasUid('');
|
||||
} else {
|
||||
$this->setDasUid($v->getDasUid());
|
||||
}
|
||||
|
||||
|
||||
$this->aDashboard = $v;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated Dashboard object
|
||||
*
|
||||
* @param Connection Optional Connection object.
|
||||
* @return Dashboard The associated Dashboard object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getDashboard($con = null)
|
||||
{
|
||||
// include the related Peer class
|
||||
include_once 'classes/model/om/BaseDashboardPeer.php';
|
||||
|
||||
if ($this->aDashboard === null && (($this->das_uid !== "" && $this->das_uid !== null))) {
|
||||
|
||||
$this->aDashboard = DashboardPeer::retrieveByPK($this->das_uid, $con);
|
||||
|
||||
/* The following can be used instead of the line above to
|
||||
guarantee the related object contains a reference
|
||||
to this object, but this level of coupling
|
||||
may be undesirable in many circumstances.
|
||||
As it can lead to a db query with many results that may
|
||||
never be used.
|
||||
$obj = DashboardPeer::retrieveByPK($this->das_uid, $con);
|
||||
$obj->addDashboards($this);
|
||||
*/
|
||||
}
|
||||
return $this->aDashboard;
|
||||
}
|
||||
}
|
||||
|
||||
770
workflow/engine/classes/model/om/BaseDashboardDasIndPeer.php
Normal file
770
workflow/engine/classes/model/om/BaseDashboardDasIndPeer.php
Normal file
@@ -0,0 +1,770 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by DashboardDasIndPeer::getOMClass()
|
||||
include_once 'classes/model/DashboardDasInd.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'DASHBOARD_DAS_IND' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseDashboardDasIndPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'DASHBOARD_DAS_IND';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.DashboardDasInd';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 3;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the DAS_UID field */
|
||||
const DAS_UID = 'DASHBOARD_DAS_IND.DAS_UID';
|
||||
|
||||
/** the column name for the OWNER_UID field */
|
||||
const OWNER_UID = 'DASHBOARD_DAS_IND.OWNER_UID';
|
||||
|
||||
/** the column name for the OWNER_TYPE field */
|
||||
const OWNER_TYPE = 'DASHBOARD_DAS_IND.OWNER_TYPE';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DasUid', 'OwnerUid', 'OwnerType', ),
|
||||
BasePeer::TYPE_COLNAME => array (DashboardDasIndPeer::DAS_UID, DashboardDasIndPeer::OWNER_UID, DashboardDasIndPeer::OWNER_TYPE, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'OWNER_UID', 'OWNER_TYPE', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DasUid' => 0, 'OwnerUid' => 1, 'OwnerType' => 2, ),
|
||||
BasePeer::TYPE_COLNAME => array (DashboardDasIndPeer::DAS_UID => 0, DashboardDasIndPeer::OWNER_UID => 1, DashboardDasIndPeer::OWNER_TYPE => 2, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'OWNER_UID' => 1, 'OWNER_TYPE' => 2, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/DashboardDasIndMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.DashboardDasIndMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = DashboardDasIndPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. DashboardDasIndPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(DashboardDasIndPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::DAS_UID);
|
||||
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::OWNER_UID);
|
||||
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::OWNER_TYPE);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(DASHBOARD_DAS_IND.DAS_UID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHBOARD_DAS_IND.DAS_UID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = DashboardDasIndPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return DashboardDasInd
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = DashboardDasIndPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return DashboardDasIndPeer::populateObjects(DashboardDasIndPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
DashboardDasIndPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = DashboardDasIndPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related Dashboard table
|
||||
*
|
||||
* @param Criteria $c
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinDashboard(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$criteria->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
|
||||
$rs = DashboardDasIndPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of DashboardDasInd objects pre-filled with their Dashboard objects.
|
||||
*
|
||||
* @return array Array of DashboardDasInd objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinDashboard(Criteria $c, $con = null)
|
||||
{
|
||||
$c = clone $c;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($c->getDbName() == Propel::getDefaultDB()) {
|
||||
$c->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
DashboardDasIndPeer::addSelectColumns($c);
|
||||
$startcol = (DashboardDasIndPeer::NUM_COLUMNS - DashboardDasIndPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
|
||||
DashboardPeer::addSelectColumns($c);
|
||||
|
||||
$c->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
$rs = BasePeer::doSelect($c, $con);
|
||||
$results = array();
|
||||
|
||||
while($rs->next()) {
|
||||
|
||||
$omClass = DashboardDasIndPeer::getOMClass();
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($rs);
|
||||
|
||||
$omClass = DashboardPeer::getOMClass();
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($rs, $startcol);
|
||||
|
||||
$newObject = true;
|
||||
foreach($results as $temp_obj1) {
|
||||
$temp_obj2 = $temp_obj1->getDashboard(); //CHECKME
|
||||
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
|
||||
$newObject = false;
|
||||
// e.g. $author->addBookRelatedByBookId()
|
||||
$temp_obj2->addDashboardDasInd($obj1); //CHECKME
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($newObject) {
|
||||
$obj2->initDashboardDasInds();
|
||||
$obj2->addDashboardDasInd($obj1); //CHECKME
|
||||
}
|
||||
$results[] = $obj1;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining all related tables
|
||||
*
|
||||
* @param Criteria $c
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardDasIndPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$criteria->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
|
||||
$rs = DashboardDasIndPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of DashboardDasInd objects pre-filled with all related objects.
|
||||
*
|
||||
* @return array Array of DashboardDasInd objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinAll(Criteria $c, $con = null)
|
||||
{
|
||||
$c = clone $c;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($c->getDbName() == Propel::getDefaultDB()) {
|
||||
$c->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
DashboardDasIndPeer::addSelectColumns($c);
|
||||
$startcol2 = (DashboardDasIndPeer::NUM_COLUMNS - DashboardDasIndPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
|
||||
|
||||
DashboardPeer::addSelectColumns($c);
|
||||
$startcol3 = $startcol2 + DashboardPeer::NUM_COLUMNS;
|
||||
|
||||
$c->addJoin(DashboardDasIndPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
|
||||
$rs = BasePeer::doSelect($c, $con);
|
||||
$results = array();
|
||||
|
||||
while($rs->next()) {
|
||||
|
||||
$omClass = DashboardDasIndPeer::getOMClass();
|
||||
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($rs);
|
||||
|
||||
|
||||
// Add objects for joined Dashboard rows
|
||||
|
||||
$omClass = DashboardPeer::getOMClass();
|
||||
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($rs, $startcol2);
|
||||
|
||||
$newObject = true;
|
||||
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
|
||||
$temp_obj1 = $results[$j];
|
||||
$temp_obj2 = $temp_obj1->getDashboard(); // CHECKME
|
||||
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
|
||||
$newObject = false;
|
||||
$temp_obj2->addDashboardDasInd($obj1); // CHECKME
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($newObject) {
|
||||
$obj2->initDashboardDasInds();
|
||||
$obj2->addDashboardDasInd($obj1);
|
||||
}
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return DashboardDasIndPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a DashboardDasInd or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or DashboardDasInd object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from DashboardDasInd object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a DashboardDasInd or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or DashboardDasInd object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(DashboardDasIndPeer::DAS_UID);
|
||||
$selectCriteria->add(DashboardDasIndPeer::DAS_UID, $criteria->remove(DashboardDasIndPeer::DAS_UID), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(DashboardDasIndPeer::OWNER_UID);
|
||||
$selectCriteria->add(DashboardDasIndPeer::OWNER_UID, $criteria->remove(DashboardDasIndPeer::OWNER_UID), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the DASHBOARD_DAS_IND table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(DashboardDasIndPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a DashboardDasInd or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or DashboardDasInd object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(DashboardDasIndPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof DashboardDasInd) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey
|
||||
// values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
$vals = array();
|
||||
foreach ($values as $value) {
|
||||
|
||||
$vals[0][] = $value[0];
|
||||
$vals[1][] = $value[1];
|
||||
}
|
||||
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $vals[0], Criteria::IN);
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_UID, $vals[1], Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given DashboardDasInd object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param DashboardDasInd $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(DashboardDasInd $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(DashboardDasIndPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(DashboardDasIndPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(DashboardDasIndPeer::DATABASE_NAME, DashboardDasIndPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve object using using composite pkey values.
|
||||
* @param string $das_uid
|
||||
* @param string $owner_uid
|
||||
* @param Connection $con
|
||||
* @return DashboardDasInd
|
||||
*/
|
||||
public static function retrieveByPK($das_uid, $owner_uid, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(DashboardDasIndPeer::DAS_UID, $das_uid);
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_UID, $owner_uid);
|
||||
$v = DashboardDasIndPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) ? $v[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseDashboardDasIndPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/DashboardDasIndMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.DashboardDasIndMapBuilder');
|
||||
}
|
||||
|
||||
1399
workflow/engine/classes/model/om/BaseDashboardIndicator.php
Normal file
1399
workflow/engine/classes/model/om/BaseDashboardIndicator.php
Normal file
File diff suppressed because it is too large
Load Diff
835
workflow/engine/classes/model/om/BaseDashboardIndicatorPeer.php
Normal file
835
workflow/engine/classes/model/om/BaseDashboardIndicatorPeer.php
Normal file
@@ -0,0 +1,835 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by DashboardIndicatorPeer::getOMClass()
|
||||
include_once 'classes/model/DashboardIndicator.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'DASHBOARD_INDICATOR' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseDashboardIndicatorPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'DASHBOARD_INDICATOR';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.DashboardIndicator';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 14;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the DAS_IND_UID field */
|
||||
const DAS_IND_UID = 'DASHBOARD_INDICATOR.DAS_IND_UID';
|
||||
|
||||
/** the column name for the DAS_UID field */
|
||||
const DAS_UID = 'DASHBOARD_INDICATOR.DAS_UID';
|
||||
|
||||
/** the column name for the DAS_IND_TYPE field */
|
||||
const DAS_IND_TYPE = 'DASHBOARD_INDICATOR.DAS_IND_TYPE';
|
||||
|
||||
/** the column name for the DAS_IND_TITLE field */
|
||||
const DAS_IND_TITLE = 'DASHBOARD_INDICATOR.DAS_IND_TITLE';
|
||||
|
||||
/** the column name for the DAS_IND_GOAL field */
|
||||
const DAS_IND_GOAL = 'DASHBOARD_INDICATOR.DAS_IND_GOAL';
|
||||
|
||||
/** the column name for the DAS_IND_DIRECTION field */
|
||||
const DAS_IND_DIRECTION = 'DASHBOARD_INDICATOR.DAS_IND_DIRECTION';
|
||||
|
||||
/** the column name for the DAS_UID_PROCESS field */
|
||||
const DAS_UID_PROCESS = 'DASHBOARD_INDICATOR.DAS_UID_PROCESS';
|
||||
|
||||
/** the column name for the DAS_IND_FIRST_FIGURE field */
|
||||
const DAS_IND_FIRST_FIGURE = 'DASHBOARD_INDICATOR.DAS_IND_FIRST_FIGURE';
|
||||
|
||||
/** the column name for the DAS_IND_FIRST_FREQUENCY field */
|
||||
const DAS_IND_FIRST_FREQUENCY = 'DASHBOARD_INDICATOR.DAS_IND_FIRST_FREQUENCY';
|
||||
|
||||
/** the column name for the DAS_IND_SECOND_FIGURE field */
|
||||
const DAS_IND_SECOND_FIGURE = 'DASHBOARD_INDICATOR.DAS_IND_SECOND_FIGURE';
|
||||
|
||||
/** the column name for the DAS_IND_SECOND_FREQUENCY field */
|
||||
const DAS_IND_SECOND_FREQUENCY = 'DASHBOARD_INDICATOR.DAS_IND_SECOND_FREQUENCY';
|
||||
|
||||
/** the column name for the DAS_IND_CREATE_DATE field */
|
||||
const DAS_IND_CREATE_DATE = 'DASHBOARD_INDICATOR.DAS_IND_CREATE_DATE';
|
||||
|
||||
/** the column name for the DAS_IND_UPDATE_DATE field */
|
||||
const DAS_IND_UPDATE_DATE = 'DASHBOARD_INDICATOR.DAS_IND_UPDATE_DATE';
|
||||
|
||||
/** the column name for the DAS_IND_STATUS field */
|
||||
const DAS_IND_STATUS = 'DASHBOARD_INDICATOR.DAS_IND_STATUS';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DasIndUid', 'DasUid', 'DasIndType', 'DasIndTitle', 'DasIndGoal', 'DasIndDirection', 'DasUidProcess', 'DasIndFirstFigure', 'DasIndFirstFrequency', 'DasIndSecondFigure', 'DasIndSecondFrequency', 'DasIndCreateDate', 'DasIndUpdateDate', 'DasIndStatus', ),
|
||||
BasePeer::TYPE_COLNAME => array (DashboardIndicatorPeer::DAS_IND_UID, DashboardIndicatorPeer::DAS_UID, DashboardIndicatorPeer::DAS_IND_TYPE, DashboardIndicatorPeer::DAS_IND_TITLE, DashboardIndicatorPeer::DAS_IND_GOAL, DashboardIndicatorPeer::DAS_IND_DIRECTION, DashboardIndicatorPeer::DAS_UID_PROCESS, DashboardIndicatorPeer::DAS_IND_FIRST_FIGURE, DashboardIndicatorPeer::DAS_IND_FIRST_FREQUENCY, DashboardIndicatorPeer::DAS_IND_SECOND_FIGURE, DashboardIndicatorPeer::DAS_IND_SECOND_FREQUENCY, DashboardIndicatorPeer::DAS_IND_CREATE_DATE, DashboardIndicatorPeer::DAS_IND_UPDATE_DATE, DashboardIndicatorPeer::DAS_IND_STATUS, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DAS_IND_UID', 'DAS_UID', 'DAS_IND_TYPE', 'DAS_IND_TITLE', 'DAS_IND_GOAL', 'DAS_IND_DIRECTION', 'DAS_UID_PROCESS', 'DAS_IND_FIRST_FIGURE', 'DAS_IND_FIRST_FREQUENCY', 'DAS_IND_SECOND_FIGURE', 'DAS_IND_SECOND_FREQUENCY', 'DAS_IND_CREATE_DATE', 'DAS_IND_UPDATE_DATE', 'DAS_IND_STATUS', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DasIndUid' => 0, 'DasUid' => 1, 'DasIndType' => 2, 'DasIndTitle' => 3, 'DasIndGoal' => 4, 'DasIndDirection' => 5, 'DasUidProcess' => 6, 'DasIndFirstFigure' => 7, 'DasIndFirstFrequency' => 8, 'DasIndSecondFigure' => 9, 'DasIndSecondFrequency' => 10, 'DasIndCreateDate' => 11, 'DasIndUpdateDate' => 12, 'DasIndStatus' => 13, ),
|
||||
BasePeer::TYPE_COLNAME => array (DashboardIndicatorPeer::DAS_IND_UID => 0, DashboardIndicatorPeer::DAS_UID => 1, DashboardIndicatorPeer::DAS_IND_TYPE => 2, DashboardIndicatorPeer::DAS_IND_TITLE => 3, DashboardIndicatorPeer::DAS_IND_GOAL => 4, DashboardIndicatorPeer::DAS_IND_DIRECTION => 5, DashboardIndicatorPeer::DAS_UID_PROCESS => 6, DashboardIndicatorPeer::DAS_IND_FIRST_FIGURE => 7, DashboardIndicatorPeer::DAS_IND_FIRST_FREQUENCY => 8, DashboardIndicatorPeer::DAS_IND_SECOND_FIGURE => 9, DashboardIndicatorPeer::DAS_IND_SECOND_FREQUENCY => 10, DashboardIndicatorPeer::DAS_IND_CREATE_DATE => 11, DashboardIndicatorPeer::DAS_IND_UPDATE_DATE => 12, DashboardIndicatorPeer::DAS_IND_STATUS => 13, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DAS_IND_UID' => 0, 'DAS_UID' => 1, 'DAS_IND_TYPE' => 2, 'DAS_IND_TITLE' => 3, 'DAS_IND_GOAL' => 4, 'DAS_IND_DIRECTION' => 5, 'DAS_UID_PROCESS' => 6, 'DAS_IND_FIRST_FIGURE' => 7, 'DAS_IND_FIRST_FREQUENCY' => 8, 'DAS_IND_SECOND_FIGURE' => 9, 'DAS_IND_SECOND_FREQUENCY' => 10, 'DAS_IND_CREATE_DATE' => 11, 'DAS_IND_UPDATE_DATE' => 12, 'DAS_IND_STATUS' => 13, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/DashboardIndicatorMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.DashboardIndicatorMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = DashboardIndicatorPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. DashboardIndicatorPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(DashboardIndicatorPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_UID);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_UID);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_TYPE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_TITLE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_GOAL);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_DIRECTION);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_UID_PROCESS);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_FIRST_FIGURE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_FIRST_FREQUENCY);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_SECOND_FIGURE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_SECOND_FREQUENCY);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_CREATE_DATE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_UPDATE_DATE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::DAS_IND_STATUS);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(DASHBOARD_INDICATOR.DAS_IND_UID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHBOARD_INDICATOR.DAS_IND_UID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = DashboardIndicatorPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return DashboardIndicator
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = DashboardIndicatorPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return DashboardIndicatorPeer::populateObjects(DashboardIndicatorPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
DashboardIndicatorPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = DashboardIndicatorPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related Dashboard table
|
||||
*
|
||||
* @param Criteria $c
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinDashboard(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$criteria->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
|
||||
$rs = DashboardIndicatorPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of DashboardIndicator objects pre-filled with their Dashboard objects.
|
||||
*
|
||||
* @return array Array of DashboardIndicator objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinDashboard(Criteria $c, $con = null)
|
||||
{
|
||||
$c = clone $c;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($c->getDbName() == Propel::getDefaultDB()) {
|
||||
$c->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
DashboardIndicatorPeer::addSelectColumns($c);
|
||||
$startcol = (DashboardIndicatorPeer::NUM_COLUMNS - DashboardIndicatorPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
|
||||
DashboardPeer::addSelectColumns($c);
|
||||
|
||||
$c->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
$rs = BasePeer::doSelect($c, $con);
|
||||
$results = array();
|
||||
|
||||
while($rs->next()) {
|
||||
|
||||
$omClass = DashboardIndicatorPeer::getOMClass();
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($rs);
|
||||
|
||||
$omClass = DashboardPeer::getOMClass();
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($rs, $startcol);
|
||||
|
||||
$newObject = true;
|
||||
foreach($results as $temp_obj1) {
|
||||
$temp_obj2 = $temp_obj1->getDashboard(); //CHECKME
|
||||
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
|
||||
$newObject = false;
|
||||
// e.g. $author->addBookRelatedByBookId()
|
||||
$temp_obj2->addDashboardIndicator($obj1); //CHECKME
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($newObject) {
|
||||
$obj2->initDashboardIndicators();
|
||||
$obj2->addDashboardIndicator($obj1); //CHECKME
|
||||
}
|
||||
$results[] = $obj1;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining all related tables
|
||||
*
|
||||
* @param Criteria $c
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardIndicatorPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach($criteria->getGroupByColumns() as $column)
|
||||
{
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$criteria->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
|
||||
$rs = DashboardIndicatorPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of DashboardIndicator objects pre-filled with all related objects.
|
||||
*
|
||||
* @return array Array of DashboardIndicator objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinAll(Criteria $c, $con = null)
|
||||
{
|
||||
$c = clone $c;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($c->getDbName() == Propel::getDefaultDB()) {
|
||||
$c->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
DashboardIndicatorPeer::addSelectColumns($c);
|
||||
$startcol2 = (DashboardIndicatorPeer::NUM_COLUMNS - DashboardIndicatorPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
|
||||
|
||||
DashboardPeer::addSelectColumns($c);
|
||||
$startcol3 = $startcol2 + DashboardPeer::NUM_COLUMNS;
|
||||
|
||||
$c->addJoin(DashboardIndicatorPeer::DAS_UID, DashboardPeer::DAS_UID);
|
||||
|
||||
$rs = BasePeer::doSelect($c, $con);
|
||||
$results = array();
|
||||
|
||||
while($rs->next()) {
|
||||
|
||||
$omClass = DashboardIndicatorPeer::getOMClass();
|
||||
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($rs);
|
||||
|
||||
|
||||
// Add objects for joined Dashboard rows
|
||||
|
||||
$omClass = DashboardPeer::getOMClass();
|
||||
|
||||
|
||||
$cls = Propel::import($omClass);
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($rs, $startcol2);
|
||||
|
||||
$newObject = true;
|
||||
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
|
||||
$temp_obj1 = $results[$j];
|
||||
$temp_obj2 = $temp_obj1->getDashboard(); // CHECKME
|
||||
if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
|
||||
$newObject = false;
|
||||
$temp_obj2->addDashboardIndicator($obj1); // CHECKME
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($newObject) {
|
||||
$obj2->initDashboardIndicators();
|
||||
$obj2->addDashboardIndicator($obj1);
|
||||
}
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return DashboardIndicatorPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a DashboardIndicator or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or DashboardIndicator object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from DashboardIndicator object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a DashboardIndicator or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or DashboardIndicator object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(DashboardIndicatorPeer::DAS_IND_UID);
|
||||
$selectCriteria->add(DashboardIndicatorPeer::DAS_IND_UID, $criteria->remove(DashboardIndicatorPeer::DAS_IND_UID), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the DASHBOARD_INDICATOR table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(DashboardIndicatorPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a DashboardIndicator or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or DashboardIndicator object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof DashboardIndicator) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(DashboardIndicatorPeer::DAS_IND_UID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given DashboardIndicator object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param DashboardIndicator $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(DashboardIndicator $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(DashboardIndicatorPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(DashboardIndicatorPeer::DATABASE_NAME, DashboardIndicatorPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param mixed $pk the primary key.
|
||||
* @param Connection $con the connection to use
|
||||
* @return DashboardIndicator
|
||||
*/
|
||||
public static function retrieveByPK($pk, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(DashboardIndicatorPeer::DAS_IND_UID, $pk);
|
||||
|
||||
|
||||
$v = DashboardIndicatorPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function retrieveByPKs($pks, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(DashboardIndicatorPeer::DAS_IND_UID, $pks, Criteria::IN);
|
||||
$objs = DashboardIndicatorPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseDashboardIndicatorPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/DashboardIndicatorMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.DashboardIndicatorMapBuilder');
|
||||
}
|
||||
|
||||
592
workflow/engine/classes/model/om/BaseDashboardPeer.php
Normal file
592
workflow/engine/classes/model/om/BaseDashboardPeer.php
Normal file
@@ -0,0 +1,592 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by DashboardPeer::getOMClass()
|
||||
include_once 'classes/model/Dashboard.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'DASHBOARD' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseDashboardPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'DASHBOARD';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.Dashboard';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the DAS_UID field */
|
||||
const DAS_UID = 'DASHBOARD.DAS_UID';
|
||||
|
||||
/** the column name for the DAS_TITLE field */
|
||||
const DAS_TITLE = 'DASHBOARD.DAS_TITLE';
|
||||
|
||||
/** the column name for the DAS_DESCRIPTION field */
|
||||
const DAS_DESCRIPTION = 'DASHBOARD.DAS_DESCRIPTION';
|
||||
|
||||
/** the column name for the DAS_CREATE_DATE field */
|
||||
const DAS_CREATE_DATE = 'DASHBOARD.DAS_CREATE_DATE';
|
||||
|
||||
/** the column name for the DAS_UPDATE_DATE field */
|
||||
const DAS_UPDATE_DATE = 'DASHBOARD.DAS_UPDATE_DATE';
|
||||
|
||||
/** the column name for the DAS_STATUS field */
|
||||
const DAS_STATUS = 'DASHBOARD.DAS_STATUS';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DasUid', 'DasTitle', 'DasDescription', 'DasCreateDate', 'DasUpdateDate', 'DasStatus', ),
|
||||
BasePeer::TYPE_COLNAME => array (DashboardPeer::DAS_UID, DashboardPeer::DAS_TITLE, DashboardPeer::DAS_DESCRIPTION, DashboardPeer::DAS_CREATE_DATE, DashboardPeer::DAS_UPDATE_DATE, DashboardPeer::DAS_STATUS, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DAS_UID', 'DAS_TITLE', 'DAS_DESCRIPTION', 'DAS_CREATE_DATE', 'DAS_UPDATE_DATE', 'DAS_STATUS', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DasUid' => 0, 'DasTitle' => 1, 'DasDescription' => 2, 'DasCreateDate' => 3, 'DasUpdateDate' => 4, 'DasStatus' => 5, ),
|
||||
BasePeer::TYPE_COLNAME => array (DashboardPeer::DAS_UID => 0, DashboardPeer::DAS_TITLE => 1, DashboardPeer::DAS_DESCRIPTION => 2, DashboardPeer::DAS_CREATE_DATE => 3, DashboardPeer::DAS_UPDATE_DATE => 4, DashboardPeer::DAS_STATUS => 5, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('DAS_UID' => 0, 'DAS_TITLE' => 1, 'DAS_DESCRIPTION' => 2, 'DAS_CREATE_DATE' => 3, 'DAS_UPDATE_DATE' => 4, 'DAS_STATUS' => 5, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/DashboardMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.DashboardMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = DashboardPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. DashboardPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(DashboardPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_UID);
|
||||
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_TITLE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_DESCRIPTION);
|
||||
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_CREATE_DATE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_UPDATE_DATE);
|
||||
|
||||
$criteria->addSelectColumn(DashboardPeer::DAS_STATUS);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(DASHBOARD.DAS_UID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT DASHBOARD.DAS_UID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(DashboardPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(DashboardPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = DashboardPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return Dashboard
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = DashboardPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return DashboardPeer::populateObjects(DashboardPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
DashboardPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = DashboardPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return DashboardPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a Dashboard or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Dashboard object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from Dashboard object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a Dashboard or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or Dashboard object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(DashboardPeer::DAS_UID);
|
||||
$selectCriteria->add(DashboardPeer::DAS_UID, $criteria->remove(DashboardPeer::DAS_UID), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the DASHBOARD table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(DashboardPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a Dashboard or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or Dashboard object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(DashboardPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof Dashboard) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(DashboardPeer::DAS_UID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given Dashboard object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param Dashboard $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(Dashboard $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(DashboardPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(DashboardPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(DashboardPeer::DATABASE_NAME, DashboardPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param mixed $pk the primary key.
|
||||
* @param Connection $con the connection to use
|
||||
* @return Dashboard
|
||||
*/
|
||||
public static function retrieveByPK($pk, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(DashboardPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(DashboardPeer::DAS_UID, $pk);
|
||||
|
||||
|
||||
$v = DashboardPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function retrieveByPKs($pks, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(DashboardPeer::DAS_UID, $pks, Criteria::IN);
|
||||
$objs = DashboardPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseDashboardPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/DashboardMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.DashboardMapBuilder');
|
||||
}
|
||||
|
||||
1111
workflow/engine/classes/model/om/BaseProReporting.php
Normal file
1111
workflow/engine/classes/model/om/BaseProReporting.php
Normal file
File diff suppressed because it is too large
Load Diff
619
workflow/engine/classes/model/om/BaseProReportingPeer.php
Normal file
619
workflow/engine/classes/model/om/BaseProReportingPeer.php
Normal file
@@ -0,0 +1,619 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by ProReportingPeer::getOMClass()
|
||||
include_once 'classes/model/ProReporting.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'PRO_REPORTING' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseProReportingPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'PRO_REPORTING';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.ProReporting';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 12;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the PRO_UID field */
|
||||
const PRO_UID = 'PRO_REPORTING.PRO_UID';
|
||||
|
||||
/** the column name for the MONTH field */
|
||||
const MONTH = 'PRO_REPORTING.MONTH';
|
||||
|
||||
/** the column name for the YEAR field */
|
||||
const YEAR = 'PRO_REPORTING.YEAR';
|
||||
|
||||
/** the column name for the AVG_TIME field */
|
||||
const AVG_TIME = 'PRO_REPORTING.AVG_TIME';
|
||||
|
||||
/** the column name for the SDV_TIME field */
|
||||
const SDV_TIME = 'PRO_REPORTING.SDV_TIME';
|
||||
|
||||
/** the column name for the TOTAL_CASES_IN field */
|
||||
const TOTAL_CASES_IN = 'PRO_REPORTING.TOTAL_CASES_IN';
|
||||
|
||||
/** the column name for the TOTAL_CASES_OUT field */
|
||||
const TOTAL_CASES_OUT = 'PRO_REPORTING.TOTAL_CASES_OUT';
|
||||
|
||||
/** the column name for the CONFIGURED_PROCESS_TIME field */
|
||||
const CONFIGURED_PROCESS_TIME = 'PRO_REPORTING.CONFIGURED_PROCESS_TIME';
|
||||
|
||||
/** the column name for the CONFIGURED_PROCESS_COST field */
|
||||
const CONFIGURED_PROCESS_COST = 'PRO_REPORTING.CONFIGURED_PROCESS_COST';
|
||||
|
||||
/** the column name for the TOTAL_CASES_OPEN field */
|
||||
const TOTAL_CASES_OPEN = 'PRO_REPORTING.TOTAL_CASES_OPEN';
|
||||
|
||||
/** the column name for the TOTAL_CASES_OVERDUE field */
|
||||
const TOTAL_CASES_OVERDUE = 'PRO_REPORTING.TOTAL_CASES_OVERDUE';
|
||||
|
||||
/** the column name for the TOTAL_CASES_ON_TIME field */
|
||||
const TOTAL_CASES_ON_TIME = 'PRO_REPORTING.TOTAL_CASES_ON_TIME';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('ProUid', 'Month', 'Year', 'AvgTime', 'SdvTime', 'TotalCasesIn', 'TotalCasesOut', 'ConfiguredProcessTime', 'ConfiguredProcessCost', 'TotalCasesOpen', 'TotalCasesOverdue', 'TotalCasesOnTime', ),
|
||||
BasePeer::TYPE_COLNAME => array (ProReportingPeer::PRO_UID, ProReportingPeer::MONTH, ProReportingPeer::YEAR, ProReportingPeer::AVG_TIME, ProReportingPeer::SDV_TIME, ProReportingPeer::TOTAL_CASES_IN, ProReportingPeer::TOTAL_CASES_OUT, ProReportingPeer::CONFIGURED_PROCESS_TIME, ProReportingPeer::CONFIGURED_PROCESS_COST, ProReportingPeer::TOTAL_CASES_OPEN, ProReportingPeer::TOTAL_CASES_OVERDUE, ProReportingPeer::TOTAL_CASES_ON_TIME, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('PRO_UID', 'MONTH', 'YEAR', 'AVG_TIME', 'SDV_TIME', 'TOTAL_CASES_IN', 'TOTAL_CASES_OUT', 'CONFIGURED_PROCESS_TIME', 'CONFIGURED_PROCESS_COST', 'TOTAL_CASES_OPEN', 'TOTAL_CASES_OVERDUE', 'TOTAL_CASES_ON_TIME', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('ProUid' => 0, 'Month' => 1, 'Year' => 2, 'AvgTime' => 3, 'SdvTime' => 4, 'TotalCasesIn' => 5, 'TotalCasesOut' => 6, 'ConfiguredProcessTime' => 7, 'ConfiguredProcessCost' => 8, 'TotalCasesOpen' => 9, 'TotalCasesOverdue' => 10, 'TotalCasesOnTime' => 11, ),
|
||||
BasePeer::TYPE_COLNAME => array (ProReportingPeer::PRO_UID => 0, ProReportingPeer::MONTH => 1, ProReportingPeer::YEAR => 2, ProReportingPeer::AVG_TIME => 3, ProReportingPeer::SDV_TIME => 4, ProReportingPeer::TOTAL_CASES_IN => 5, ProReportingPeer::TOTAL_CASES_OUT => 6, ProReportingPeer::CONFIGURED_PROCESS_TIME => 7, ProReportingPeer::CONFIGURED_PROCESS_COST => 8, ProReportingPeer::TOTAL_CASES_OPEN => 9, ProReportingPeer::TOTAL_CASES_OVERDUE => 10, ProReportingPeer::TOTAL_CASES_ON_TIME => 11, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('PRO_UID' => 0, 'MONTH' => 1, 'YEAR' => 2, 'AVG_TIME' => 3, 'SDV_TIME' => 4, 'TOTAL_CASES_IN' => 5, 'TOTAL_CASES_OUT' => 6, 'CONFIGURED_PROCESS_TIME' => 7, 'CONFIGURED_PROCESS_COST' => 8, 'TOTAL_CASES_OPEN' => 9, 'TOTAL_CASES_OVERDUE' => 10, 'TOTAL_CASES_ON_TIME' => 11, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/ProReportingMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.ProReportingMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = ProReportingPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. ProReportingPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(ProReportingPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::PRO_UID);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::MONTH);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::YEAR);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::AVG_TIME);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::SDV_TIME);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_IN);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_OUT);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::CONFIGURED_PROCESS_TIME);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::CONFIGURED_PROCESS_COST);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_OPEN);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_OVERDUE);
|
||||
|
||||
$criteria->addSelectColumn(ProReportingPeer::TOTAL_CASES_ON_TIME);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(PRO_REPORTING.PRO_UID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT PRO_REPORTING.PRO_UID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(ProReportingPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(ProReportingPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = ProReportingPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return ProReporting
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = ProReportingPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return ProReportingPeer::populateObjects(ProReportingPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
ProReportingPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = ProReportingPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return ProReportingPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a ProReporting or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or ProReporting object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from ProReporting object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a ProReporting or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or ProReporting object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(ProReportingPeer::PRO_UID);
|
||||
$selectCriteria->add(ProReportingPeer::PRO_UID, $criteria->remove(ProReportingPeer::PRO_UID), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(ProReportingPeer::MONTH);
|
||||
$selectCriteria->add(ProReportingPeer::MONTH, $criteria->remove(ProReportingPeer::MONTH), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(ProReportingPeer::YEAR);
|
||||
$selectCriteria->add(ProReportingPeer::YEAR, $criteria->remove(ProReportingPeer::YEAR), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the PRO_REPORTING table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(ProReportingPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a ProReporting or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ProReporting object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(ProReportingPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof ProReporting) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey
|
||||
// values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
$vals = array();
|
||||
foreach ($values as $value) {
|
||||
|
||||
$vals[0][] = $value[0];
|
||||
$vals[1][] = $value[1];
|
||||
$vals[2][] = $value[2];
|
||||
}
|
||||
|
||||
$criteria->add(ProReportingPeer::PRO_UID, $vals[0], Criteria::IN);
|
||||
$criteria->add(ProReportingPeer::MONTH, $vals[1], Criteria::IN);
|
||||
$criteria->add(ProReportingPeer::YEAR, $vals[2], Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given ProReporting object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param ProReporting $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(ProReporting $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(ProReportingPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(ProReportingPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(ProReportingPeer::DATABASE_NAME, ProReportingPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve object using using composite pkey values.
|
||||
* @param string $pro_uid
|
||||
* @param int $month
|
||||
* @param int $year
|
||||
* @param Connection $con
|
||||
* @return ProReporting
|
||||
*/
|
||||
public static function retrieveByPK($pro_uid, $month, $year, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ProReportingPeer::PRO_UID, $pro_uid);
|
||||
$criteria->add(ProReportingPeer::MONTH, $month);
|
||||
$criteria->add(ProReportingPeer::YEAR, $year);
|
||||
$v = ProReportingPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) ? $v[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseProReportingPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/ProReportingMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.ProReportingMapBuilder');
|
||||
}
|
||||
|
||||
1232
workflow/engine/classes/model/om/BaseUsrReporting.php
Normal file
1232
workflow/engine/classes/model/om/BaseUsrReporting.php
Normal file
File diff suppressed because it is too large
Load Diff
636
workflow/engine/classes/model/om/BaseUsrReportingPeer.php
Normal file
636
workflow/engine/classes/model/om/BaseUsrReportingPeer.php
Normal file
@@ -0,0 +1,636 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/util/BasePeer.php';
|
||||
// The object class -- needed for instanceof checks in this class.
|
||||
// actual class may be a subclass -- as returned by UsrReportingPeer::getOMClass()
|
||||
include_once 'classes/model/UsrReporting.php';
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'USR_REPORTING' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package workflow.classes.model.om
|
||||
*/
|
||||
abstract class BaseUsrReportingPeer
|
||||
{
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'workflow';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'USR_REPORTING';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'classes.model.UsrReporting';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 14;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
|
||||
/** the column name for the USR_UID field */
|
||||
const USR_UID = 'USR_REPORTING.USR_UID';
|
||||
|
||||
/** the column name for the TAS_UID field */
|
||||
const TAS_UID = 'USR_REPORTING.TAS_UID';
|
||||
|
||||
/** the column name for the PRO_UID field */
|
||||
const PRO_UID = 'USR_REPORTING.PRO_UID';
|
||||
|
||||
/** the column name for the MONTH field */
|
||||
const MONTH = 'USR_REPORTING.MONTH';
|
||||
|
||||
/** the column name for the YEAR field */
|
||||
const YEAR = 'USR_REPORTING.YEAR';
|
||||
|
||||
/** the column name for the TOTAL_TIME_BY_TASK field */
|
||||
const TOTAL_TIME_BY_TASK = 'USR_REPORTING.TOTAL_TIME_BY_TASK';
|
||||
|
||||
/** the column name for the TOTAL_CASES_IN field */
|
||||
const TOTAL_CASES_IN = 'USR_REPORTING.TOTAL_CASES_IN';
|
||||
|
||||
/** the column name for the TOTAL_CASES_OUT field */
|
||||
const TOTAL_CASES_OUT = 'USR_REPORTING.TOTAL_CASES_OUT';
|
||||
|
||||
/** the column name for the USER_HOUR_COST field */
|
||||
const USER_HOUR_COST = 'USR_REPORTING.USER_HOUR_COST';
|
||||
|
||||
/** the column name for the AVG_TIME field */
|
||||
const AVG_TIME = 'USR_REPORTING.AVG_TIME';
|
||||
|
||||
/** the column name for the SDV_TIME field */
|
||||
const SDV_TIME = 'USR_REPORTING.SDV_TIME';
|
||||
|
||||
/** the column name for the CONFIGURED_TASK_TIME field */
|
||||
const CONFIGURED_TASK_TIME = 'USR_REPORTING.CONFIGURED_TASK_TIME';
|
||||
|
||||
/** the column name for the TOTAL_CASES_OVERDUE field */
|
||||
const TOTAL_CASES_OVERDUE = 'USR_REPORTING.TOTAL_CASES_OVERDUE';
|
||||
|
||||
/** the column name for the TOTAL_CASES_ON_TIME field */
|
||||
const TOTAL_CASES_ON_TIME = 'USR_REPORTING.TOTAL_CASES_ON_TIME';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('UsrUid', 'TasUid', 'ProUid', 'Month', 'Year', 'TotalTimeByTask', 'TotalCasesIn', 'TotalCasesOut', 'UserHourCost', 'AvgTime', 'SdvTime', 'ConfiguredTaskTime', 'TotalCasesOverdue', 'TotalCasesOnTime', ),
|
||||
BasePeer::TYPE_COLNAME => array (UsrReportingPeer::USR_UID, UsrReportingPeer::TAS_UID, UsrReportingPeer::PRO_UID, UsrReportingPeer::MONTH, UsrReportingPeer::YEAR, UsrReportingPeer::TOTAL_TIME_BY_TASK, UsrReportingPeer::TOTAL_CASES_IN, UsrReportingPeer::TOTAL_CASES_OUT, UsrReportingPeer::USER_HOUR_COST, UsrReportingPeer::AVG_TIME, UsrReportingPeer::SDV_TIME, UsrReportingPeer::CONFIGURED_TASK_TIME, UsrReportingPeer::TOTAL_CASES_OVERDUE, UsrReportingPeer::TOTAL_CASES_ON_TIME, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('USR_UID', 'TAS_UID', 'PRO_UID', 'MONTH', 'YEAR', 'TOTAL_TIME_BY_TASK', 'TOTAL_CASES_IN', 'TOTAL_CASES_OUT', 'USER_HOUR_COST', 'AVG_TIME', 'SDV_TIME', 'CONFIGURED_TASK_TIME', 'TOTAL_CASES_OVERDUE', 'TOTAL_CASES_ON_TIME', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('UsrUid' => 0, 'TasUid' => 1, 'ProUid' => 2, 'Month' => 3, 'Year' => 4, 'TotalTimeByTask' => 5, 'TotalCasesIn' => 6, 'TotalCasesOut' => 7, 'UserHourCost' => 8, 'AvgTime' => 9, 'SdvTime' => 10, 'ConfiguredTaskTime' => 11, 'TotalCasesOverdue' => 12, 'TotalCasesOnTime' => 13, ),
|
||||
BasePeer::TYPE_COLNAME => array (UsrReportingPeer::USR_UID => 0, UsrReportingPeer::TAS_UID => 1, UsrReportingPeer::PRO_UID => 2, UsrReportingPeer::MONTH => 3, UsrReportingPeer::YEAR => 4, UsrReportingPeer::TOTAL_TIME_BY_TASK => 5, UsrReportingPeer::TOTAL_CASES_IN => 6, UsrReportingPeer::TOTAL_CASES_OUT => 7, UsrReportingPeer::USER_HOUR_COST => 8, UsrReportingPeer::AVG_TIME => 9, UsrReportingPeer::SDV_TIME => 10, UsrReportingPeer::CONFIGURED_TASK_TIME => 11, UsrReportingPeer::TOTAL_CASES_OVERDUE => 12, UsrReportingPeer::TOTAL_CASES_ON_TIME => 13, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('USR_UID' => 0, 'TAS_UID' => 1, 'PRO_UID' => 2, 'MONTH' => 3, 'YEAR' => 4, 'TOTAL_TIME_BY_TASK' => 5, 'TOTAL_CASES_IN' => 6, 'TOTAL_CASES_OUT' => 7, 'USER_HOUR_COST' => 8, 'AVG_TIME' => 9, 'SDV_TIME' => 10, 'CONFIGURED_TASK_TIME' => 11, 'TOTAL_CASES_OVERDUE' => 12, 'TOTAL_CASES_ON_TIME' => 13, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
);
|
||||
|
||||
/**
|
||||
* @return MapBuilder the map builder for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getMapBuilder()
|
||||
{
|
||||
include_once 'classes/model/map/UsrReportingMapBuilder.php';
|
||||
return BasePeer::getMapBuilder('classes.model.map.UsrReportingMapBuilder');
|
||||
}
|
||||
/**
|
||||
* Gets a map (hash) of PHP names to DB column names.
|
||||
*
|
||||
* @return array The PHP to DB name map for this peer
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
|
||||
*/
|
||||
public static function getPhpNameMap()
|
||||
{
|
||||
if (self::$phpNameMap === null) {
|
||||
$map = UsrReportingPeer::getTableMap();
|
||||
$columns = $map->getColumns();
|
||||
$nameMap = array();
|
||||
foreach ($columns as $column) {
|
||||
$nameMap[$column->getPhpName()] = $column->getColumnName();
|
||||
}
|
||||
self::$phpNameMap = $nameMap;
|
||||
}
|
||||
return self::$phpNameMap;
|
||||
}
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants TYPE_PHPNAME,
|
||||
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. UsrReportingPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(UsrReportingPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param criteria object containing the columns to add.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria)
|
||||
{
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::USR_UID);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::TAS_UID);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::PRO_UID);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::MONTH);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::YEAR);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_TIME_BY_TASK);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_IN);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_OUT);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::USER_HOUR_COST);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::AVG_TIME);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::SDV_TIME);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::CONFIGURED_TASK_TIME);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_OVERDUE);
|
||||
|
||||
$criteria->addSelectColumn(UsrReportingPeer::TOTAL_CASES_ON_TIME);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(USR_REPORTING.USR_UID)';
|
||||
const COUNT_DISTINCT = 'COUNT(DISTINCT USR_REPORTING.USR_UID)';
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
|
||||
* @param Connection $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// clear out anything that might confuse the ORDER BY clause
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->addSelectColumn(UsrReportingPeer::COUNT_DISTINCT);
|
||||
} else {
|
||||
$criteria->addSelectColumn(UsrReportingPeer::COUNT);
|
||||
}
|
||||
|
||||
// just in case we're grouping: add those columns to the select statement
|
||||
foreach ($criteria->getGroupByColumns() as $column) {
|
||||
$criteria->addSelectColumn($column);
|
||||
}
|
||||
|
||||
$rs = UsrReportingPeer::doSelectRS($criteria, $con);
|
||||
if ($rs->next()) {
|
||||
return $rs->getInt(1);
|
||||
} else {
|
||||
// no rows returned; we infer that means 0 matches.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return UsrReporting
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = UsrReportingPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, $con = null)
|
||||
{
|
||||
return UsrReportingPeer::populateObjects(UsrReportingPeer::doSelectRS($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect()
|
||||
* method to get a ResultSet.
|
||||
*
|
||||
* Use this method directly if you want to just get the resultset
|
||||
* (instead of an array of objects).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return ResultSet The resultset object with numerically-indexed fields.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectRS(Criteria $criteria, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if (!$criteria->getSelectColumns()) {
|
||||
$criteria = clone $criteria;
|
||||
UsrReportingPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a Creole ResultSet, set to return
|
||||
// rows indexed numerically.
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(ResultSet $rs)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = UsrReportingPeer::getOMClass();
|
||||
$cls = Propel::import($cls);
|
||||
// populate the object(s)
|
||||
while ($rs->next()) {
|
||||
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($rs);
|
||||
$results[] = $obj;
|
||||
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* This uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass()
|
||||
{
|
||||
return UsrReportingPeer::CLASS_DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a UsrReporting or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or UsrReporting object containing data that is used to create the INSERT statement.
|
||||
* @param Connection $con the connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from UsrReporting object
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->begin();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a UsrReporting or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or UsrReporting object containing data create the UPDATE statement.
|
||||
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(UsrReportingPeer::USR_UID);
|
||||
$selectCriteria->add(UsrReportingPeer::USR_UID, $criteria->remove(UsrReportingPeer::USR_UID), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(UsrReportingPeer::TAS_UID);
|
||||
$selectCriteria->add(UsrReportingPeer::TAS_UID, $criteria->remove(UsrReportingPeer::TAS_UID), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(UsrReportingPeer::MONTH);
|
||||
$selectCriteria->add(UsrReportingPeer::MONTH, $criteria->remove(UsrReportingPeer::MONTH), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(UsrReportingPeer::YEAR);
|
||||
$selectCriteria->add(UsrReportingPeer::YEAR, $criteria->remove(UsrReportingPeer::YEAR), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the USR_REPORTING table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
$affectedRows += BasePeer::doDeleteAll(UsrReportingPeer::TABLE_NAME, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a UsrReporting or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or UsrReporting object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param Connection $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(UsrReportingPeer::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} elseif ($values instanceof UsrReporting) {
|
||||
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey
|
||||
// values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
$vals = array();
|
||||
foreach ($values as $value) {
|
||||
|
||||
$vals[0][] = $value[0];
|
||||
$vals[1][] = $value[1];
|
||||
$vals[2][] = $value[2];
|
||||
$vals[3][] = $value[3];
|
||||
}
|
||||
|
||||
$criteria->add(UsrReportingPeer::USR_UID, $vals[0], Criteria::IN);
|
||||
$criteria->add(UsrReportingPeer::TAS_UID, $vals[1], Criteria::IN);
|
||||
$criteria->add(UsrReportingPeer::MONTH, $vals[2], Criteria::IN);
|
||||
$criteria->add(UsrReportingPeer::YEAR, $vals[3], Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->begin();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollback();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given UsrReporting object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param UsrReporting $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(UsrReporting $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(UsrReportingPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(UsrReportingPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(UsrReportingPeer::DATABASE_NAME, UsrReportingPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve object using using composite pkey values.
|
||||
* @param string $usr_uid
|
||||
* @param string $tas_uid
|
||||
* @param int $month
|
||||
* @param int $year
|
||||
* @param Connection $con
|
||||
* @return UsrReporting
|
||||
*/
|
||||
public static function retrieveByPK($usr_uid, $tas_uid, $month, $year, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(UsrReportingPeer::USR_UID, $usr_uid);
|
||||
$criteria->add(UsrReportingPeer::TAS_UID, $tas_uid);
|
||||
$criteria->add(UsrReportingPeer::MONTH, $month);
|
||||
$criteria->add(UsrReportingPeer::YEAR, $year);
|
||||
$v = UsrReportingPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) ? $v[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static code to register the map builder for this Peer with the main Propel class
|
||||
if (Propel::isInit()) {
|
||||
// the MapBuilder classes register themselves with Propel during initialization
|
||||
// so we need to load them here.
|
||||
try {
|
||||
BaseUsrReportingPeer::getMapBuilder();
|
||||
} catch (Exception $e) {
|
||||
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
// even if Propel is not yet initialized, the map builder class can be registered
|
||||
// now and then it will be loaded when Propel initializes.
|
||||
require_once 'classes/model/map/UsrReportingMapBuilder.php';
|
||||
Propel::registerMapBuilder('classes.model.map.UsrReportingMapBuilder');
|
||||
}
|
||||
|
||||
211
workflow/engine/controllers/strategicDashboard.php
Normal file
211
workflow/engine/controllers/strategicDashboard.php
Normal file
@@ -0,0 +1,211 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* StrategicDashboard controller
|
||||
* @inherits Controller
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
|
||||
class StrategicDashboard extends Controller
|
||||
{
|
||||
|
||||
// Class properties
|
||||
private $urlProxy;
|
||||
private $clientToken;
|
||||
private $usrId;
|
||||
|
||||
// Class constructor
|
||||
public function __construct ()
|
||||
{
|
||||
global $RBAC;
|
||||
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header( 'location: login/login' );
|
||||
exit(0);
|
||||
}
|
||||
$this->usrId = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
|
||||
$this->urlProxy = '/api/1.0/' . SYS_SYS . '/';
|
||||
//change
|
||||
$clientId = 'x-pm-local-client';
|
||||
$client = $this->getClientCredentials($clientId);
|
||||
$authCode = $this->getAuthorizationCode($client);
|
||||
$debug = false; //System::isDebugMode();
|
||||
|
||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add(PATH_TRUNK . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
||||
|
||||
$request = array(
|
||||
'grant_type' => 'authorization_code',
|
||||
'code' => $authCode
|
||||
);
|
||||
$server = array(
|
||||
'REQUEST_METHOD' => 'POST'
|
||||
);
|
||||
$headers = array(
|
||||
"PHP_AUTH_USER" => $client['CLIENT_ID'],
|
||||
"PHP_AUTH_PW" => $client['CLIENT_SECRET'],
|
||||
"Content-Type" => "multipart/form-data;",
|
||||
"Authorization" => "Basic " . base64_encode($client['CLIENT_ID'] . ":" . $client['CLIENT_SECRET'])
|
||||
);
|
||||
|
||||
$request = new \OAuth2\Request(array(), $request, array(), array(), array(), $server, null, $headers);
|
||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
|
||||
$response = $oauthServer->postToken($request, true);
|
||||
$this->clientToken = $response->getParameters();
|
||||
$this->clientToken["client_id"] = $client['CLIENT_ID'];
|
||||
$this->clientToken["client_secret"] = $client['CLIENT_SECRET'];
|
||||
}
|
||||
|
||||
private function getClientCredentials($clientId)
|
||||
{
|
||||
$oauthQuery = new ProcessMaker\Services\OAuth2\PmPdo($this->getDsn());
|
||||
return $oauthQuery->getClientDetails($clientId);
|
||||
}
|
||||
|
||||
private function getAuthorizationCode($client)
|
||||
{
|
||||
\ProcessMaker\Services\OAuth2\Server::setDatabaseSource($this->getDsn());
|
||||
\ProcessMaker\Services\OAuth2\Server::setPmClientId($client['CLIENT_ID']);
|
||||
|
||||
$oauthServer = new \ProcessMaker\Services\OAuth2\Server();
|
||||
$userId = $_SESSION['USER_LOGGED'];
|
||||
$authorize = true;
|
||||
$_GET = array_merge($_GET, array(
|
||||
'response_type' => 'code',
|
||||
'client_id' => $client['CLIENT_ID'],
|
||||
'scope' => implode(' ', $oauthServer->getScope())
|
||||
));
|
||||
|
||||
$response = $oauthServer->postAuthorize($authorize, $userId, true);
|
||||
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
private function getDsn()
|
||||
{
|
||||
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
|
||||
$port = empty($port) ? '' : ";port=$port";
|
||||
$dsn = DB_ADAPTER.':host='.$host.';dbname='.DB_NAME.$port;
|
||||
|
||||
return array('dsn' => $dsn, 'username' => DB_USER, 'password' => DB_PASS);
|
||||
}
|
||||
|
||||
// Functions for the StrategicDashboards
|
||||
|
||||
public function dashboardList ()
|
||||
{
|
||||
try {
|
||||
$this->includeExtJS( 'strategicDashboard/dashboardList' );
|
||||
if (isset( $_SESSION['__StrategicDashboard_ERROR__'] )) {
|
||||
$this->setJSVar( '__StrategicDashboard_ERROR__', $_SESSION['__StrategicDashboard_ERROR__'] );
|
||||
unset( $_SESSION['__StrategicDashboard_ERROR__'] );
|
||||
}
|
||||
$this->setView( 'strategicDashboard/dashboardList' );
|
||||
|
||||
$this->setJSVar('urlProxy',$this->urlProxy);
|
||||
$this->setJSVar('credentials',$this->clientToken);
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
} catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
public function formDashboard ($data)
|
||||
{
|
||||
try {
|
||||
|
||||
$this->includeExtJS( 'strategicDashboard/formDashboard', true, true );
|
||||
$this->setView( 'strategicDashboard/formDashboard' );
|
||||
|
||||
$this->setJSVar('DAS_UID', '');
|
||||
$this->setJSVar('urlProxy',$this->urlProxy);
|
||||
$this->setJSVar('credentials',$this->clientToken);
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
return null;
|
||||
} catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
G::header( 'Location: dashboardList' );
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
public function formEditDashboard ($data)
|
||||
{
|
||||
try {
|
||||
|
||||
$this->includeExtJS( 'strategicDashboard/formDashboard', true, true );
|
||||
$this->setView( 'strategicDashboard/formDashboard' );
|
||||
|
||||
$dasUid = isset($_REQUEST['DAS_UID']) ? $_REQUEST['DAS_UID'] : '';
|
||||
$this->setJSVar('DAS_UID', $dasUid);
|
||||
$this->setJSVar('urlProxy',$this->urlProxy);
|
||||
$this->setJSVar('credentials',$this->clientToken);
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
return null;
|
||||
} catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
G::header( 'Location: dashboardList' );
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
public function viewDashboard ()
|
||||
{
|
||||
try {
|
||||
if (isset( $_SESSION['__StrategicDashboard_ERROR__'] )) {
|
||||
$this->setJSVar( '__StrategicDashboard_ERROR__', $_SESSION['__StrategicDashboard_ERROR__'] );
|
||||
unset( $_SESSION['__StrategicDashboard_ERROR__'] );
|
||||
}
|
||||
$this->setView( 'strategicDashboard/viewDashboard' );
|
||||
|
||||
$this->setVar('urlProxy',$this->urlProxy);
|
||||
$this->setVar('usrId',$this->usrId);
|
||||
$this->setVar('credentials',$this->clientToken);
|
||||
|
||||
$translation = array();
|
||||
|
||||
$translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS');
|
||||
$translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX');
|
||||
$translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER');
|
||||
$translation['ID_COMPLETED_CASES'] = G::LoadTranslation( 'ID_COMPLETED_CASES');
|
||||
$translation['ID_WELL_DONE'] = G::LoadTranslation( 'ID_WELL_DONE');
|
||||
$translation['ID_NUMBER_CASES'] = G::LoadTranslation( 'ID_NUMBER_CASES');
|
||||
$translation['ID_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_EFFICIENCY_INDEX');
|
||||
$translation['ID_INEFFICIENCY_COST'] = G::LoadTranslation( 'ID_INEFFICIENCY_COST');
|
||||
$translation['ID_EFFICIENCY_COST'] = G::LoadTranslation( 'ID_EFFICIENCY_COST');
|
||||
$translation['ID_RELATED_PROCESS'] = G::LoadTranslation( 'ID_RELATED_PROCESS');
|
||||
$translation['ID_RELATED_GROUPS'] = G::LoadTranslation( 'ID_RELATED_GROUPS');
|
||||
$translation['ID_RELATED_TASKS'] = G::LoadTranslation( 'ID_RELATED_TASKS');
|
||||
$translation['ID_RELATED_USERS'] = G::LoadTranslation( 'ID_RELATED_USERS');
|
||||
$translation['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE'] = G::LoadTranslation( 'ID_GRID_PAGE_NO_DASHBOARD_MESSAGE');
|
||||
$translation['ID_PROCESS_TASKS'] = G::LoadTranslation( 'ID_PROCESS_TASKS');
|
||||
$translation['ID_TIME_HOURS'] = G::LoadTranslation( 'ID_TIME_HOURS');
|
||||
$translation['ID_GROUPS'] = G::LoadTranslation( 'ID_GROUPS');
|
||||
$translation['ID_YEAR'] = G::LoadTranslation( 'ID_YEAR');
|
||||
$translation['ID_USERS'] = G::LoadTranslation( 'ID_USERS');
|
||||
|
||||
$this->setVar('translation', $translation);
|
||||
$this->render();
|
||||
} catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
public function viewDashboardIE ()
|
||||
{
|
||||
try {
|
||||
$this->setView( 'strategicDashboard/viewDashboardIE' );
|
||||
$this->render();
|
||||
} catch (Exception $error) {
|
||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
6
workflow/engine/js/strategicDashboard/bootstrap.min.js
vendored
Normal file
6
workflow/engine/js/strategicDashboard/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1181
workflow/engine/js/strategicDashboard/dashboard.js
Normal file
1181
workflow/engine/js/strategicDashboard/dashboard.js
Normal file
File diff suppressed because it is too large
Load Diff
502
workflow/engine/js/strategicDashboard/dashboardProxy.js
Normal file
502
workflow/engine/js/strategicDashboard/dashboardProxy.js
Normal file
@@ -0,0 +1,502 @@
|
||||
|
||||
var getKeyValue =
|
||||
function getKeyValue(obj, key, undefined) {
|
||||
var reg = /\./gi
|
||||
, subKey
|
||||
, keys
|
||||
, context
|
||||
, x
|
||||
;
|
||||
|
||||
if (reg.test(key)) {
|
||||
keys = key.split(reg);
|
||||
context = obj;
|
||||
|
||||
for (x = 0; x < keys.length; x++) {
|
||||
subKey = keys[x];
|
||||
|
||||
//the values of all keys except for
|
||||
//the last one should be objects
|
||||
if (x < keys.length -1) {
|
||||
if (!context.hasOwnProperty(subKey)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
context = context[subKey];
|
||||
}
|
||||
else {
|
||||
return context[subKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return obj[key];
|
||||
}
|
||||
};
|
||||
|
||||
var setKeyValue =
|
||||
function setKeyValue(obj, key, value) {
|
||||
var reg = /\./gi
|
||||
, subKey
|
||||
, keys
|
||||
, context
|
||||
, x
|
||||
;
|
||||
|
||||
//check to see if we need to process
|
||||
//multiple levels of objects
|
||||
if (reg.test(key)) {
|
||||
keys = key.split(reg);
|
||||
context = obj;
|
||||
|
||||
for (x = 0; x < keys.length; x++) {
|
||||
subKey = keys[x];
|
||||
|
||||
//the values of all keys except for
|
||||
//the last one should be objects
|
||||
if (x < keys.length -1) {
|
||||
if (!context[subKey]) {
|
||||
context[subKey] = {};
|
||||
}
|
||||
|
||||
context = context[subKey];
|
||||
}
|
||||
else {
|
||||
context[subKey] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj[key] = value;
|
||||
}
|
||||
};
|
||||
|
||||
var merge =
|
||||
function merge(objFrom, objTo, propMap) {
|
||||
var toKey
|
||||
, fromKey
|
||||
, x
|
||||
, value
|
||||
, def
|
||||
, transform
|
||||
, key
|
||||
, keyIsArray
|
||||
;
|
||||
|
||||
if (!objTo) {
|
||||
objTo = {};
|
||||
}
|
||||
|
||||
for(fromKey in propMap) {
|
||||
if (propMap.hasOwnProperty(fromKey)) {
|
||||
toKey = propMap[fromKey];
|
||||
|
||||
//force toKey to an array of toKeys
|
||||
if (!Array.isArray(toKey)) {
|
||||
toKey = [toKey];
|
||||
}
|
||||
|
||||
for(x = 0; x < toKey.length; x++) {
|
||||
def = null;
|
||||
transform = null;
|
||||
key = toKey[x];
|
||||
keyIsArray = Array.isArray(key);
|
||||
|
||||
if (typeof(key) === "object" && !keyIsArray) {
|
||||
def = key.default || null;
|
||||
transform = key.transform || null;
|
||||
key = key.key;
|
||||
//evaluate if the new key is an array
|
||||
keyIsArray = Array.isArray(key);
|
||||
}
|
||||
|
||||
if (keyIsArray) {
|
||||
//key[toKeyName,transform,default]
|
||||
def = key[2] || null;
|
||||
transform = key[1] || null;
|
||||
key = key[0];
|
||||
}
|
||||
|
||||
if (def && typeof(def) === "function" ) {
|
||||
def = def(objFrom, objTo);
|
||||
}
|
||||
|
||||
value = getKeyValue(objFrom, fromKey);
|
||||
|
||||
if (transform) {
|
||||
value = transform(value, objFrom, objTo);
|
||||
}
|
||||
|
||||
if (typeof value !== 'undefined') {
|
||||
setKeyValue(objTo, key, value);
|
||||
}
|
||||
else if (typeof def !== 'undefined') {
|
||||
setKeyValue(objTo, key, def);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return objTo;
|
||||
};
|
||||
|
||||
var DashboardProxy = function (oauthToken, server, workspace) {
|
||||
this.server = server;
|
||||
this.workspace = workspace;
|
||||
this.baseUrl = "/api/1.0/" + workspace + "/";
|
||||
this.oauthToken = oauthToken;
|
||||
};
|
||||
|
||||
DashboardProxy.prototype.userDashboards = function(userId, callBack) {
|
||||
this.getJson('dashboard/ownerData/' + userId,
|
||||
function (r) {
|
||||
var returnList = [];
|
||||
$.each(r, function(index, originalObject) {
|
||||
var map = {
|
||||
"DAS_TITLE" : "dashName",
|
||||
"DAS_UID" : "dashUid",
|
||||
"DAS_FAVORITE" : "favorite",
|
||||
};
|
||||
|
||||
var newObject = merge(originalObject, {}, map);
|
||||
returnList.push(newObject);
|
||||
});
|
||||
callBack(returnList);
|
||||
});
|
||||
};
|
||||
|
||||
DashboardProxy.prototype.dashboardIndicators = function(dashboardId, initDate, endDate, callBack) {
|
||||
this.getJson('dashboard/' + dashboardId + '/indicator?dateIni=' + initDate + '&dateFin=' + endDate,
|
||||
function (r) {
|
||||
var returnList = [];
|
||||
$.each(r, function(index, originalObject) {
|
||||
var map = {
|
||||
"DAS_IND_UID" : "indUid",
|
||||
"DAS_IND_TITLE" : "indName",
|
||||
"DAS_IND_TYPE" : "id",
|
||||
"DAS_IND_VARIATION" : "comparative",
|
||||
"DAS_IND_DIRECTION" : "direction",
|
||||
"DAS_IND_VALUE" : "index",
|
||||
"DAS_IND_X" : "x",
|
||||
"DAS_IND_Y" : "y",
|
||||
"DAS_IND_WIDTH" : "width",
|
||||
"DAS_IND_HEIGHT" : "height",
|
||||
"DAS_UID_PROCESS" : "process"
|
||||
};
|
||||
|
||||
var newObject = merge(originalObject, {}, map);
|
||||
//TODO do not burn this value. Data must come from the endpoint
|
||||
newObject.favorite = ((returnList.length == 1) ? 1 : 0);
|
||||
returnList.push(newObject);
|
||||
});
|
||||
callBack(returnList);
|
||||
});
|
||||
};
|
||||
|
||||
DashboardProxy.prototype.peiData = function(indicatorId, measureDate, compareDate, callBack) {
|
||||
var endPoint = "ReportingIndicators/process-efficiency-data?" +
|
||||
"indicator_uid=" + indicatorId +
|
||||
"&measure_date=" + measureDate +
|
||||
"&compare_date=" + compareDate +
|
||||
"&language=en";
|
||||
this.getJson(endPoint,
|
||||
function (r) {
|
||||
var graphData = [];
|
||||
$.each(r.data, function(index, originalObject) {
|
||||
var map = {
|
||||
"name" : "datalabel",
|
||||
"inefficiencyCost" : "value"
|
||||
};
|
||||
var newObject = merge(originalObject, {}, map);
|
||||
var shortLabel = (newObject.datalabel == null)
|
||||
? ""
|
||||
: newObject.datalabel.substring(0,15);
|
||||
newObject.datalabel = shortLabel;
|
||||
graphData.push(newObject);
|
||||
});
|
||||
r.dataToDraw = graphData.splice(0,7);
|
||||
callBack(r);
|
||||
});
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.processTasksData = function(process, initDate, endDate, callBack) {
|
||||
var endPoint = "ReportingIndicators/process-tasks?" +
|
||||
"process_list=" + process +
|
||||
"&init_date=" + initDate +
|
||||
"&end_date=" + endDate +
|
||||
"&language=en";
|
||||
this.getJson(endPoint,
|
||||
function (r) {
|
||||
var graphData = [];
|
||||
$.each(r, function(index, originalObject) {
|
||||
var map = {
|
||||
"name" : "datalabel",
|
||||
"averageTime" : "value",
|
||||
"deviationTime" : "dispersion"
|
||||
};
|
||||
var newObject = merge(originalObject, {}, map);
|
||||
newObject.datalabel = newObject.datalabel.substring(0, 7);
|
||||
graphData.push(newObject);
|
||||
});
|
||||
var retval = {};
|
||||
retval.dataToDraw = graphData.splice(0,7);
|
||||
retval.tasksData = r;
|
||||
callBack(retval);
|
||||
});
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.ueiData = function(indicatorId, measureDate, compareDate, callBack) {
|
||||
var endPoint = "ReportingIndicators/employee-efficiency-data?" +
|
||||
"indicator_uid=" + indicatorId +
|
||||
"&measure_date=" + measureDate +
|
||||
"&compare_date=" + compareDate +
|
||||
"&language=en";
|
||||
this.getJson(endPoint,
|
||||
function (r) {
|
||||
var graphData = [];
|
||||
$.each(r.data, function(index, originalObject) {
|
||||
var map = {
|
||||
"name" : "datalabel",
|
||||
"averageTime" : "value",
|
||||
"deviationTime" : "dispersion"
|
||||
};
|
||||
var newObject = merge(originalObject, {}, map);
|
||||
var shortLabel = (newObject.datalabel == null)
|
||||
? ""
|
||||
: newObject.datalabel.substring(0,7);
|
||||
|
||||
newObject.datalabel = shortLabel;
|
||||
graphData.push(newObject);
|
||||
});
|
||||
r.dataToDraw = graphData.splice(0,7);
|
||||
callBack(r);
|
||||
});
|
||||
|
||||
/*var retval = {
|
||||
"efficiencyIndex":1.23,
|
||||
"efficiencyVariation":0.23,
|
||||
"inefficiencyCost":"$ 20112.23",
|
||||
"employeeGroupsDataToDraw":
|
||||
[
|
||||
{"value":"96", "datalabel":"User 1"},
|
||||
{"value":"84", "datalabel":"User 2"},
|
||||
{"value":"72", "datalabel":"User 3"},
|
||||
{"value":"18", "datalabel":"User 4"},
|
||||
{"value":"85", "datalabel":"User 5"}
|
||||
],
|
||||
|
||||
"employeeGroupsData": [
|
||||
{"name": "User 1", "efficiencyIndex":"0.45", "innefficiencyCost":"$ 3404"},
|
||||
{"name": "User 2", "efficiencyIndex":"1.45", "innefficiencyCost":"$ 1404"},
|
||||
{"name": "User 3", "efficiencyIndex":"0.25", "innefficiencyCost":"$ 3304"},
|
||||
{"name": "User 4", "efficiencyIndex":"1.95", "innefficiencyCost":"$ 404"},
|
||||
{"name": "User 5", "efficiencyIndex":"1.25", "innefficiencyCost":"$ 13404"},
|
||||
{"name": "User 6", "efficiencyIndex":"0.75", "innefficiencyCost":"$ 4"}
|
||||
]
|
||||
}
|
||||
return retval;*/
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.userGroupData = function(groupId, initDate, endDate, callBack) {
|
||||
var endPoint = "ReportingIndicators/group-employee-data?" +
|
||||
"group_uid=" + groupId +
|
||||
"&init_date=" + initDate +
|
||||
"&end_date=" + endDate +
|
||||
"&language=en";
|
||||
this.getJson(endPoint,
|
||||
function (r) {
|
||||
var graphData = [];
|
||||
$.each(r, function(index, originalObject) {
|
||||
var map = {
|
||||
"name" : "datalabel",
|
||||
"averageTime" : "value",
|
||||
"deviationTime" : "dispersion"
|
||||
};
|
||||
var newObject = merge(originalObject, {}, map);
|
||||
newObject.datalabel = newObject.datalabel.substring(0, 7);
|
||||
graphData.push(newObject);
|
||||
});
|
||||
var retval = {};
|
||||
retval.dataToDraw = graphData.splice(0,7);
|
||||
retval.tasksData = r;
|
||||
callBack(retval);
|
||||
});
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.generalIndicatorData = function(indicatorId, initDate, endDate, callBack) {
|
||||
var method = "";
|
||||
var endPoint = "ReportingIndicators/general-indicator-data?" +
|
||||
"indicator_uid=" + indicatorId +
|
||||
"&init_date=" + initDate +
|
||||
"&end_date=" + endDate +
|
||||
"&language=en";
|
||||
this.getJson(endPoint,
|
||||
function (r) {
|
||||
$.each(r.graph1Data, function(index, originalObject) {
|
||||
var label = (('YEAR' in originalObject) ? originalObject.YEAR : "") ;
|
||||
label += (('MONTH' in originalObject) ? "/" + originalObject.MONTH : "") ;
|
||||
label += (('QUARTER' in originalObject) ? "/" + originalObject.QUARTER : "");
|
||||
label += (('SEMESTER' in originalObject) ? "/" + originalObject.SEMESTER : "");
|
||||
originalObject.datalabel = label;
|
||||
});
|
||||
|
||||
$.each(r.graph2Data, function(index, originalObject) {
|
||||
var label = (('YEAR' in originalObject) ? originalObject.YEAR : "") ;
|
||||
label += (('MONTH' in originalObject) ? "/" + originalObject.MONTH : "") ;
|
||||
label += (('QUARTER' in originalObject) ? "/" + originalObject.QUARTER : "");
|
||||
label += (('SEMESTER' in originalObject) ? "/" + originalObject.SEMESTER : "") ;
|
||||
originalObject.datalabel = label;
|
||||
});
|
||||
callBack(r);
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*var retval = {
|
||||
"index" : "23",
|
||||
"graph1Data": [
|
||||
{"value":"96", "datalabel":"User 1"},
|
||||
{"value":"84", "datalabel":"User 2"},
|
||||
{"value":"72", "datalabel":"User 3"},
|
||||
{"value":"18", "datalabel":"User 4"},
|
||||
{"value":"85", "datalabel":"User 5"}
|
||||
],
|
||||
"graph2Data": [
|
||||
{"value":"196", "datalabel":"User 1"},
|
||||
{"value":"184", "datalabel":"User 2"},
|
||||
{"value":"172", "datalabel":"User 3"},
|
||||
{"value":"118", "datalabel":"User 4"},
|
||||
{"value":"185", "datalabel":"User 5"}
|
||||
]
|
||||
}
|
||||
return retval;*/
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.userTasksData = function(processId, monthCompare, yearCompare) {
|
||||
var retval = {
|
||||
"tasksDataToDraw": [
|
||||
{"value":"96", "datalabel":"Task 1"},
|
||||
{"value":"84", "datalabel":"Task 2"},
|
||||
{"value":"72", "datalabel":"Task 3"},
|
||||
{"value":"18", "datalabel":"Task 4"},
|
||||
{"value":"85", "datalabel":"Task 5"}
|
||||
],
|
||||
|
||||
"tasksData": [
|
||||
{"Name": "Task 1", "efficiencyIndex":"0.45", "deviationTime":"0.45", "averageTime":"34 days"},
|
||||
{"Name": "Task 2", "efficiencyIndex":"1.45", "deviationTime":"1.45", "averageTime":"14 days"},
|
||||
{"Name": "Task 3", "efficiencyIndex":"0.25", "deviationTime":"0.25", "averageTime":"3 days"},
|
||||
{"Name": "Task 4", "efficiencyIndex":"1.95", "deviationTime":"1.95", "averageTime":"4 days"},
|
||||
{"Name": "Task 5", "efficiencyIndex":"1.25", "deviationTime":"1.25", "averageTime":"14 days"},
|
||||
{"Name": "Task 6", "efficiencyIndex":"0.75", "deviationTime":"0.75", "averageTime":"4 days"}
|
||||
]
|
||||
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.getPositionIndicator = function(callBack) {
|
||||
console.log("GET");
|
||||
this.getJson('dashboard/config', function (r) {
|
||||
var graphData = [];
|
||||
$.each(r, function(index, originalObject) {
|
||||
console.log(originalObject);
|
||||
var map = {
|
||||
"widgetId" : originalObject.widgetId,
|
||||
"x" : originalObject.x,
|
||||
"y" : originalObject.y,
|
||||
"width" : originalObject.width,
|
||||
"height" : originalObject.height
|
||||
|
||||
};
|
||||
graphData.push(map);
|
||||
});
|
||||
callBack(graphData);
|
||||
});
|
||||
};
|
||||
|
||||
DashboardProxy.prototype.setPositionIndicator = function(data, callBack) {
|
||||
var that = this;
|
||||
|
||||
this.getPositionIndicator(
|
||||
function(response){
|
||||
if (response.length != 0) {
|
||||
that.putJson('dashboard/config', data, function (r) {
|
||||
});
|
||||
} else {
|
||||
that.postJson('dashboard/config', data, function (r) {
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
DashboardProxy.prototype.getJson = function (endPoint, callBack) {
|
||||
var that = this;
|
||||
var callUrl = this.baseUrl + endPoint
|
||||
console.log('Llamando:');
|
||||
console.log(callUrl)
|
||||
$.ajax({
|
||||
url: callUrl,
|
||||
type: 'GET',
|
||||
datatype: 'json',
|
||||
success: function(response) { callBack(response); },
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(textStatus, errorThrown);
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader('Authorization', 'Bearer ' + that.oauthToken);
|
||||
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
DashboardProxy.prototype.postJson = function (endPoint, data, callBack) {
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url : this.baseUrl + endPoint,
|
||||
type : 'POST',
|
||||
datatype : 'json',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
data: JSON.stringify(data),
|
||||
success: function(response) {
|
||||
callBack(response);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(textStatus, errorThrown);
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader('Authorization', 'Bearer ' + that.oauthToken);
|
||||
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
}).fail(function () {
|
||||
console.log('Fail server');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
DashboardProxy.prototype.putJson = function (endPoint, data, callBack) {
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url : this.baseUrl + endPoint,
|
||||
type : 'PUT',
|
||||
datatype : 'json',
|
||||
contentType: "application/json; charset=utf-8",
|
||||
data: JSON.stringify(data),
|
||||
success: function(response) {
|
||||
callBack(response);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(textStatus, errorThrown);
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader('Authorization', 'Bearer ' + that.oauthToken);
|
||||
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
}).fail(function () {
|
||||
console.log('Fail server');
|
||||
});
|
||||
};
|
||||
1416
workflow/engine/js/strategicDashboard/underscore.js
Normal file
1416
workflow/engine/js/strategicDashboard/underscore.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
SET @INIT_DATE = '{init_date}';
|
||||
SET @FINISH_DATE = '{finish_date}';
|
||||
|
||||
DELETE FROM PRO_REPORTING WHERE `YEAR` >= DATE_FORMAT(CAST(@INIT_DATE AS DATE), '%Y')
|
||||
AND `MONTH` >= DATE_FORMAT(CAST(@INIT_DATE AS DATE), '%m')
|
||||
AND `YEAR` <= DATE_FORMAT(CAST(@FINISH_DATE AS DATE), '%Y')
|
||||
AND `MONTH` <= DATE_FORMAT(CAST(@FINISH_DATE AS DATE), '%m');
|
||||
|
||||
INSERT INTO PRO_REPORTING (
|
||||
PRO_UID,
|
||||
`MONTH`,
|
||||
`YEAR`,
|
||||
AVG_TIME,
|
||||
SDV_TIME,
|
||||
TOTAL_CASES_IN,
|
||||
TOTAL_CASES_OUT,
|
||||
CONFIGURED_PROCESS_TIME,
|
||||
CONFIGURED_PROCESS_COST,
|
||||
TOTAL_CASES_OPEN,
|
||||
TOTAL_CASES_OVERDUE,
|
||||
TOTAL_CASES_ON_TIME
|
||||
)
|
||||
|
||||
SELECT
|
||||
APPLICATION.PRO_UID,
|
||||
DATE_FORMAT(APPLICATION.APP_INIT_DATE, '%m') AS `MONTH`,
|
||||
DATE_FORMAT(APPLICATION.APP_INIT_DATE, '%Y') AS `YEAR`,
|
||||
AVG(APPLICATION.APP_DURATION) AS `AVG_TIME`,
|
||||
STD(APPLICATION.APP_DURATION) AS `STD_TIME`,
|
||||
COUNT(APPLICATION.APP_INIT_DATE) AS `TOTAL_CASES_IN`,
|
||||
COUNT(APPLICATION.APP_FINISH_DATE) AS `TOTAL_CASES_OUT`,
|
||||
NULL,
|
||||
NULL,
|
||||
count(if(APPLICATION.APP_FINISH_DATE != null, NULL, 1)) AS TOTAL_CASES_OPEN,
|
||||
count(if(APPLICATION.APP_DELAY_DURATION > 0, 1, NULL)) AS TOTAL_CASES_OVERDUE,
|
||||
count(if(APPLICATION.APP_DELAY_DURATION <= 0, 1, NULL)) AS TOTAL_CASES_ON_TIME
|
||||
FROM
|
||||
APPLICATION FORCE INDEX (PRIMARY)
|
||||
WHERE
|
||||
APPLICATION.APP_INIT_DATE BETWEEN CAST(@INIT_DATE AS DATETIME) AND CAST(@FINISH_DATE AS DATETIME)
|
||||
GROUP BY APPLICATION.PRO_UID;
|
||||
|
||||
|
||||
UPDATE PRO_REPORTING
|
||||
SET PRO_REPORTING.CONFIGURED_PROCESS_TIME = (
|
||||
SELECT SUM(if (TASK.TAS_TIMEUNIT = "DAYS", (TASK.TAS_DURATION*8), TASK.TAS_DURATION))
|
||||
FROM TASK
|
||||
WHERE PRO_REPORTING.PRO_UID = TASK.PRO_UID
|
||||
);
|
||||
|
||||
UPDATE PRO_REPORTING
|
||||
SET PRO_REPORTING.CONFIGURED_PROCESS_COST = (
|
||||
SELECT SUM(USERS.USR_COST_BY_HOUR)
|
||||
FROM TASK, TASK_USER, USERS
|
||||
WHERE TASK.PRO_UID = PRO_REPORTING.PRO_UID
|
||||
AND TASK.TAS_UID = TASK_USER.TAS_UID
|
||||
AND TASK_USER.USR_UID = USERS.USR_UID
|
||||
) OR (
|
||||
SELECT SUM(USERS.USR_COST_BY_HOUR)
|
||||
FROM TASK, TASK_USER, GROUP_USER, USERS
|
||||
WHERE PRO_REPORTING.PRO_UID = TASK.PRO_UID
|
||||
AND TASK.TAS_UID = TASK_USER.TAS_UID
|
||||
AND TASK_USER.USR_UID = GROUP_USER.GRP_UID
|
||||
AND GROUP_USER.USR_UID = USERS.USR_UID
|
||||
)
|
||||
@@ -0,0 +1,61 @@
|
||||
SET @INIT_DATE = '{init_date}';
|
||||
SET @FINISH_DATE = '{finish_date}';
|
||||
|
||||
DELETE FROM USR_REPORTING WHERE `YEAR` >= DATE_FORMAT(CAST(@INIT_DATE AS DATE), '%Y')
|
||||
AND `MONTH` >= DATE_FORMAT(CAST(@INIT_DATE AS DATE), '%m')
|
||||
AND `YEAR` <= DATE_FORMAT(CAST(@FINISH_DATE AS DATE), '%Y')
|
||||
AND `MONTH` <= DATE_FORMAT(CAST(@FINISH_DATE AS DATE), '%m');
|
||||
|
||||
INSERT INTO USR_REPORTING (
|
||||
USR_UID,
|
||||
TAS_UID,
|
||||
PRO_UID,
|
||||
MONTH,
|
||||
YEAR,
|
||||
TOTAL_TIME_BY_TASK,
|
||||
TOTAL_CASES_IN,
|
||||
TOTAL_CASES_OUT,
|
||||
USER_HOUR_COST,
|
||||
AVG_TIME,
|
||||
SDV_TIME,
|
||||
CONFIGURED_TASK_TIME,
|
||||
TOTAL_CASES_OVERDUE,
|
||||
TOTAL_CASES_ON_TIME
|
||||
)
|
||||
|
||||
SELECT
|
||||
ACV.USR_UID,
|
||||
ACV.TAS_UID,
|
||||
ACV.PRO_UID,
|
||||
DATE_FORMAT(ACV.DEL_INIT_DATE, '%m') AS `MONTH`,
|
||||
DATE_FORMAT(ACV.DEL_INIT_DATE, '%Y') AS `YEAR`,
|
||||
SUM(ACV.DEL_DURATION) AS TOT_TIME_BY_TASK,
|
||||
COUNT(ACV.DEL_INIT_DATE) AS TOT_CASES_IN,
|
||||
COUNT(ACV.DEL_FINISH_DATE) AS TOT_CASES_OUT,
|
||||
NULL,
|
||||
AVG(DEL_DURATION) AS `AVG_TIME`,
|
||||
STD(DEL_DURATION) AS `STD_TIME`,
|
||||
NULL,
|
||||
count(if(ACV.DEL_DELAY_DURATION > 0, 1, NULL)) AS TOTAL_CASES_OVERDUE,
|
||||
count(if(ACV.DEL_DELAY_DURATION <= 0, 1, NULL)) AS TOTAL_CASES_ON_TIME
|
||||
FROM
|
||||
APP_CACHE_VIEW AS ACV
|
||||
WHERE
|
||||
ACV.DEL_INIT_DATE BETWEEN CAST(@INIT_DATE AS DATETIME) AND CAST(@FINISH_DATE AS DATETIME)
|
||||
GROUP BY ACV.USR_UID , ACV.TAS_UID , ACV.PRO_UID;
|
||||
|
||||
|
||||
UPDATE USR_REPORTING
|
||||
INNER JOIN
|
||||
USERS
|
||||
ON USR_REPORTING.USR_UID = USERS.USR_UID
|
||||
SET USR_REPORTING.USER_HOUR_COST = USERS.USR_COST_BY_HOUR;
|
||||
|
||||
UPDATE USR_REPORTING
|
||||
INNER JOIN
|
||||
TASK
|
||||
ON USR_REPORTING.TAS_UID = TASK.TAS_UID
|
||||
SET USR_REPORTING.CONFIGURED_TASK_TIME = if (TASK.TAS_TIMEUNIT = "DAYS", (TASK.TAS_DURATION*8), TASK.TAS_DURATION)
|
||||
|
||||
|
||||
|
||||
34
workflow/engine/methods/strategicDashboard/main.php
Normal file
34
workflow/engine/methods/strategicDashboard/main.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* dashboard.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions( 'PM_DASHBOARD' );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'DASHBOARD+';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'strategicDashboard/load' );
|
||||
G::RenderPage( 'publish' );
|
||||
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
<?php
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
if(isset($_SESSION['USER_LOGGED'])) {
|
||||
$_SESSION['USER_LOGGED'] = $filter->xssFilterHard($_SESSION['USER_LOGGED']);
|
||||
}
|
||||
if(isset($_SESSION['USR_USERNAME'])) {
|
||||
$_SESSION['USR_USERNAME'] = $filter->xssFilterHard($_SESSION['USR_USERNAME']);
|
||||
}
|
||||
|
||||
global $RBAC;
|
||||
$result = new StdClass();
|
||||
@@ -164,6 +155,10 @@ switch ($_POST['action']) {
|
||||
$zipCode = $form['USR_ZIP_CODE'] ? " - Zip Code: ". $form['USR_ZIP_CODE'] : "";
|
||||
$position = $form['USR_POSITION'] ? " - Position: ". $form['USR_POSITION'] : "";
|
||||
$role = $form['USR_ROLE'] ? " - Role: ". $form['USR_ROLE'] : "";
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$costByHour = $form['USR_COST_BY_HOUR'] ? $form['USR_COST_BY_HOUR'] : "";
|
||||
$unit = $form['USR_UNIT_COST'] ? $form['USR_UNIT_COST'] : "";
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
if ($form['USR_UID'] == '') {
|
||||
$criteria = new Criteria();
|
||||
@@ -182,6 +177,7 @@ switch ($_POST['action']) {
|
||||
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$aData['USR_BIRTHDAY'] = date('Y-m-d');
|
||||
$aData['USR_AUTH_USER_DN'] = $form['USR_AUTH_USER_DN'];
|
||||
|
||||
//fixing bug in inactive user when the admin create a new user.
|
||||
$statusWF = $form['USR_STATUS'];
|
||||
$aData['USR_STATUS'] = $form['USR_STATUS'] ;//== 'ACTIVE' ? 1 : 0;
|
||||
@@ -202,6 +198,10 @@ switch ($_POST['action']) {
|
||||
$aData['USR_POSITION'] = $form['USR_POSITION'];
|
||||
// $aData['USR_RESUME'] = $form['USR_RESUME'];
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$aData['USR_COST_BY_HOUR'] = $form['USR_COST_BY_HOUR'];
|
||||
$aData['USR_UNIT_COST'] = $form['USR_UNIT_COST'];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
@@ -373,7 +373,14 @@ switch ($_POST['action']) {
|
||||
if (isset($form['USR_ROLE'])) {
|
||||
$aData['USR_ROLE'] = $form['USR_ROLE'];
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (isset($form['USR_COST_BY_HOUR'])) {
|
||||
$aData['USR_COST_BY_HOUR'] = $form['USR_COST_BY_HOUR'];
|
||||
}
|
||||
if (isset($form['USR_UNIT_COST'])) {
|
||||
$aData['USR_UNIT_COST'] = $form['USR_UNIT_COST'];
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (isset($form['USR_REPLACED_BY'])) {
|
||||
$aData['USR_REPLACED_BY'] = $form['USR_REPLACED_BY'];
|
||||
}
|
||||
|
||||
80
workflow/engine/src/ProcessMaker/BusinessModel/Catalog.php
Normal file
80
workflow/engine/src/ProcessMaker/BusinessModel/Catalog.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
|
||||
/**
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Catalog
|
||||
{
|
||||
|
||||
/**
|
||||
* Get CatalogUid by UserUid
|
||||
*
|
||||
* @param string $cat_type type of catalog
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
**/
|
||||
public function getCatalogByType($cat_type)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->loadByType($cat_type);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Catalog
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Group created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function create($arrayData)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->create($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Catalog
|
||||
*
|
||||
* @param string $cat_uid Unique id of Group
|
||||
* @param string $cat_type Unique id of Group
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Group update
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function update($cat_uid, $cat_type, $arrayData)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->update($cat_uid, $cat_type, $arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Catalog
|
||||
*
|
||||
* @param string $cat_uid Unique id of Group
|
||||
* @param string $cat_type Unique id of Group
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function delete($cat_uid, $cat_type)
|
||||
{
|
||||
$catalog = new \Catalog();
|
||||
$response = $catalog->delete($cat_uid, $cat_type);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
461
workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php
Normal file
461
workflow/engine/src/ProcessMaker/BusinessModel/Dashboard.php
Normal file
@@ -0,0 +1,461 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
|
||||
/**
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Dashboard {
|
||||
|
||||
/**
|
||||
* Get DashboardUid by UserUid
|
||||
*
|
||||
* @param string $usr_uid Unique id of User
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getDashboardsUidByUser($usr_uid)
|
||||
{
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php");
|
||||
$oDashboardDasInd = new \DashboardDasInd();
|
||||
|
||||
$response = $oDashboardDasInd->loadByOwner($usr_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Dashboard Data by UserUid
|
||||
*
|
||||
* @param string $usr_uid Unique id of User
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getDashboardDataByUser($usr_uid)
|
||||
{
|
||||
$resp = array();
|
||||
$dashboards = $this->getDashboardsUidByUser($usr_uid);
|
||||
$existFavorite = false;
|
||||
foreach($dashboards as $i=>$x) {
|
||||
$resp[$i] = $this->getDashboard($x['DAS_UID']);
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$dashConfig = $Dashboard->getConfig($usr_uid);
|
||||
$resp[$i]['DAS_FAVORITE'] = 0;
|
||||
foreach ($dashConfig as $dashId=>$dashData) {
|
||||
if($dashId == $x['DAS_UID'] ) {
|
||||
$resp[$i]['DAS_FAVORITE'] = $dashData['dashFavorite'];
|
||||
if ($dashData['dashFavorite']==1) {
|
||||
$existFavorite = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if no favorite is set, the default vavorite is the first one
|
||||
if ($existFavorite == false && $dashboards != null && sizeof($dashboards)>0) {
|
||||
$resp[0]['DAS_FAVORITE'] = 1;
|
||||
}
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Users of a dashboard
|
||||
*
|
||||
* @param string $das_uid Unique id of the Dashboard
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getUsersOfDashboard($das_uid)
|
||||
{
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php");
|
||||
$oDashboardDasInd = new \DashboardDasInd();
|
||||
|
||||
$response = $oDashboardDasInd->loadByDashboards($das_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboard data
|
||||
*
|
||||
* @param string $das_uid Unique id of the Dashboard
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getDashboard($das_uid)
|
||||
{
|
||||
$oDashboard = new \Dashboard();
|
||||
$response = $oDashboard->load($das_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboard indicators
|
||||
*
|
||||
* @param string $dasInd_uid Unique id of the Dashboard indicator
|
||||
*
|
||||
* return id
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getIndicator($dasInd_uid)
|
||||
{
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardIndicator.php");
|
||||
$oDashboardIndicator = new \DashboardIndicator();
|
||||
|
||||
$response = $oDashboardIndicator->load($dasInd_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get dashboard indicators by das_uid
|
||||
*
|
||||
* @param string $das_uid Unique id of the Dashboard
|
||||
* @param string $dateIni
|
||||
* @param string $dateFin
|
||||
* @param string $usrUid
|
||||
*
|
||||
* return uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getIndicatorsByDasUid($das_uid, $dateIni, $dateFin, $usrUid)
|
||||
{
|
||||
$oDashboardIndicator = new \DashboardIndicator();
|
||||
|
||||
$response = $oDashboardIndicator->loadbyDasUid($das_uid, $dateIni, $dateFin, $usrUid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list All dashboards
|
||||
*
|
||||
* @access public
|
||||
* @param array $options, Data for list
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function getListDashboards($options = array())
|
||||
{
|
||||
Validator::isArray($options, '$options');
|
||||
|
||||
G::LoadClass("dashboards");
|
||||
$dir = isset( $options["dir"] ) ? $options["dir"] : "DESC";
|
||||
$sort = isset( $options["sort"] ) ? $options["sort"] : "DASHBOARD.DAS_TITLE";
|
||||
$start = isset( $options["start"] ) ? $options["start"] : "0";
|
||||
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
|
||||
$search = isset( $options["search"] ) ? $options["search"] : "";
|
||||
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
|
||||
$type = "extjs";
|
||||
|
||||
$start = (int)$start;
|
||||
$start = abs($start);
|
||||
if ($start != 0) {
|
||||
$start--;
|
||||
}
|
||||
$limit = (int)$limit;
|
||||
$limit = abs($limit);
|
||||
if ($limit == 0) {
|
||||
G::LoadClass("configuration");
|
||||
$conf = new \Configurations();
|
||||
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($configList['casesListRowNumber'])) {
|
||||
$limit = (int)$configList['casesListRowNumber'];
|
||||
} else {
|
||||
$limit = 25;
|
||||
}
|
||||
} else {
|
||||
$limit = (int)$limit;
|
||||
}
|
||||
|
||||
if ($sort != 'DASHBOARD.DAS_TITLE') {
|
||||
$sort = G::toUpper($sort);
|
||||
$columnsAppCacheView = DashboardPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
|
||||
if (!(in_array($sort, $columnsAppCacheView))) {
|
||||
$sort = 'APP_CACHE_VIEW.APP_NUMBER';
|
||||
}
|
||||
}
|
||||
$dir = G::toUpper($dir);
|
||||
if (!($dir == 'DESC' || $dir == 'ASC')) {
|
||||
$dir = 'DESC';
|
||||
}
|
||||
|
||||
$dashboards = new \Dashboards();
|
||||
$result = $dashboards->getListDashboards($start, $limit, $sort, $dir, $search);
|
||||
|
||||
if ($paged == false) {
|
||||
$response = $result['data'];
|
||||
} else {
|
||||
$response['total'] = $result['totalCount'];
|
||||
$response['start'] = $start+1;
|
||||
$response['limit'] = $limit;
|
||||
$response['sort'] = G::toLower($sort);
|
||||
$response['dir'] = G::toLower($dir);
|
||||
$response['search'] = $search;
|
||||
|
||||
$response['data'] = $result['data'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list All owners of dashboards
|
||||
*
|
||||
* @access public
|
||||
* @param array $options, Data for list
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function getOwnerByDasUid($options = array())
|
||||
{
|
||||
Validator::isArray($options, '$options');
|
||||
|
||||
G::LoadClass("dashboards");
|
||||
$das_uid = isset( $options["das_uid"] ) ? $options["das_uid"] : "";
|
||||
$start = isset( $options["start"] ) ? $options["start"] : "0";
|
||||
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
|
||||
$search = isset( $options["search"] ) ? $options["search"] : "";
|
||||
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
|
||||
$type = "extjs";
|
||||
|
||||
$start = (int)$start;
|
||||
$start = abs($start);
|
||||
if ($start != 0) {
|
||||
$start--;
|
||||
}
|
||||
$limit = (int)$limit;
|
||||
$limit = abs($limit);
|
||||
if ($limit == 0) {
|
||||
G::LoadClass("configuration");
|
||||
$conf = new \Configurations();
|
||||
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($configList['casesListRowNumber'])) {
|
||||
$limit = (int)$configList['casesListRowNumber'];
|
||||
} else {
|
||||
$limit = 25;
|
||||
}
|
||||
} else {
|
||||
$limit = (int)$limit;
|
||||
}
|
||||
|
||||
$dashboards = new \Dashboards();
|
||||
$result = $dashboards->getOwnerByDasUid($das_uid, $start, $limit, $search);
|
||||
|
||||
|
||||
if ($paged == false) {
|
||||
$response = $result['data'];
|
||||
} else {
|
||||
$response['totalCount'] = $result['totalCount'];
|
||||
$response['start'] = $start+1;
|
||||
$response['limit'] = $limit;
|
||||
$response['search'] = $search;
|
||||
|
||||
$response['owner'] = $result['data'];
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dashboard
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return id new Dashboard created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function createDashboard($arrayData)
|
||||
{
|
||||
$dashboard = new \Dashboard();
|
||||
$response = $dashboard->createOrUpdate($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Dashboard
|
||||
*
|
||||
* @param string $das_uid Unique id
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function deletedashboard($das_uid)
|
||||
{
|
||||
$dashboard = new \Dashboard();
|
||||
$response = $dashboard->remove($das_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dashboard Owner
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return id new Owner created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function createOwner($arrayData)
|
||||
{
|
||||
$dashboard = new \DashboardDasInd();
|
||||
$response = $dashboard->create($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Dashboard owner
|
||||
*
|
||||
* @param string $das_uid
|
||||
* @param string $owner_uid
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function deleteDashboardOwner($das_uid, $owner_uid)
|
||||
{
|
||||
$dashboard = new \DashboardDasInd();
|
||||
$response = $dashboard->remove($das_uid, $owner_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dashboard Indicator
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return id new Indicator created
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function createIndicator($arrayData)
|
||||
{
|
||||
$dashboard = new \DashboardIndicator();
|
||||
$response = $dashboard->createOrUpdate($arrayData);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Indicator
|
||||
*
|
||||
* @param string $das_ind_uid Unique id
|
||||
*
|
||||
* return void
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
*/
|
||||
public function delete($das_ind_uid)
|
||||
{
|
||||
$dashboard = new \DashboardIndicator();
|
||||
$response = $dashboard->remove($das_ind_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Dashboards User Configuration
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
* @param string $usrUid
|
||||
*
|
||||
* return array Return data of the user configuration
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function postConfigByUsr($arrayData, $usrUid)
|
||||
{
|
||||
$cnfgData[$arrayData['dashId']] = $arrayData;
|
||||
|
||||
$data['CFG_UID'] = 'DASHBOARDS_SETTINGS';
|
||||
$data['OBJ_UID'] = '';
|
||||
$data['CFG_VALUE'] = serialize($cnfgData);
|
||||
$data['USR_UID'] = $usrUid;
|
||||
$data['PRO_UID'] = "";
|
||||
$data['APP_UID'] = "";
|
||||
|
||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Configuration.php");
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$response = $oConfig->create($data);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Dashboard configuration by UserUid
|
||||
*
|
||||
* @param string $usr_uid Unique id of User
|
||||
*
|
||||
* return array
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function getConfig($usr_uid)
|
||||
{
|
||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Configuration.php");
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$response = array();
|
||||
if($oConfig->exists('DASHBOARDS_SETTINGS', '', '', $usr_uid, '') == true){
|
||||
$data = $oConfig->load('DASHBOARDS_SETTINGS', '', '', $usr_uid, '');
|
||||
$response = unserialize($data['CFG_VALUE']);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put Dashboard configuration by UserUid
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
* @param string $usrUid
|
||||
*
|
||||
* return array
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
*/
|
||||
public function putConfigByUsr($arrayData, $usrUid)
|
||||
{
|
||||
$oConfig = new \Configuration();
|
||||
|
||||
$cnfgData = array();
|
||||
if($oConfig->exists('DASHBOARDS_SETTINGS', '', '', $usrUid, '') == true){
|
||||
$data = $oConfig->load('DASHBOARDS_SETTINGS', '', '', $usrUid, '');
|
||||
$cnfgData = unserialize($data['CFG_VALUE']);
|
||||
}
|
||||
|
||||
if($arrayData['dashData']==""){
|
||||
foreach($cnfgData as $dashId=>$dashData) {
|
||||
$cnfgData[$dashData['dashId']]['dashFavorite'] = 0;
|
||||
}
|
||||
$cnfgData[$arrayData['dashId']]['dashId'] = $arrayData['dashId'];
|
||||
$cnfgData[$arrayData['dashId']]['dashFavorite'] = $arrayData['dashFavorite'];
|
||||
$cnfgData[$arrayData['dashId']]['dashData'] = $arrayData['dashData'];
|
||||
} else{
|
||||
$cnfgData[$arrayData['dashId']] = $arrayData;
|
||||
}
|
||||
|
||||
$data['CFG_UID'] = 'DASHBOARDS_SETTINGS';
|
||||
$data['OBJ_UID'] = '';
|
||||
$data['CFG_VALUE'] = serialize($cnfgData);
|
||||
$data['USR_UID'] = $usrUid;
|
||||
$data['PRO_UID'] = "";
|
||||
$data['APP_UID'] = "";
|
||||
|
||||
$response = $oConfig->update($data);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
|
||||
|
||||
class ReportingIndicators
|
||||
{
|
||||
// /**et
|
||||
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $processList array with the list of processes to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getPeiCompleteData($indicatorUid, $measureDate, $compareDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$processes = $calculator->peiProcesses($indicatorUid, $measureDate, $measureDate, $language);
|
||||
$arr = $calculator->indicatorData($indicatorUid);
|
||||
$indicator = $arr[0];
|
||||
$processesId = $indicator['DAS_UID_PROCESS'];
|
||||
$peiValue = current(reset($calculator-> peiHistoric($processesId, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$peiCost = current(reset($calculator->peiCostHistoric($processesId, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$peiCompare = current(reset($calculator->peiHistoric($processesId, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
|
||||
$retval = array("efficiencyIndex" => $peiValue,
|
||||
"efficiencyVariation" => ($peiValue-$peiCompare),
|
||||
"inefficiencyCost" => $peiCost,
|
||||
"data"=>$processes);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $employeeList array with the list of employeees to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getUeiCompleteData($indicatorUid, $measureDate, $compareDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$groups = $calculator->ueiUserGroups($indicatorUid, $measureDate, $measureDate, $language);
|
||||
|
||||
$groupIds = array();
|
||||
foreach($groups as $p) {
|
||||
array_push($groupIds, $p['uid']);
|
||||
}
|
||||
|
||||
if (sizeof($groupIds) == 0) {
|
||||
$groupIds = null;
|
||||
}
|
||||
|
||||
//TODO think what if each indicators has a group or user subset assigned. Now are all
|
||||
$ueiValue = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$arrCost = $calculator->ueiUserGroups($indicatorUid, $measureDate, $measureDate, $language);
|
||||
|
||||
$ueiCost = (sizeof($arrCost) > 0)
|
||||
? $arrCost[0]['inefficiencyCost']
|
||||
: null;
|
||||
|
||||
$ueiCompare = current(reset($calculator->ueiHistoric(null, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
|
||||
$retval = array("efficiencyIndex" => $ueiValue,
|
||||
"efficiencyVariation" => ($ueiValue-$ueiCompare),
|
||||
"inefficiencyCost" => $ueiCost,
|
||||
"data"=>$groups);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $employeeList array with the list of employeees to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getUeiGroupsStatistics($groupId, $initDate, $endDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$retval = $calculator->groupEmployeesData($groupId, $initDate, $endDate, $language);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param array $processList array with the list of processes to filter the results.
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
*/
|
||||
public function getPeiTasksStatistics($processList, $initDate, $endDate, $language)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$retval = $calculator->peiTasks($processList, $initDate, $endDate, $language);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
// *
|
||||
// * @param array $employeeList array with the list of employeees to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getEmployeeTasksInfoList($employeeList, $initDate, $endDate, $language)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->employeeTasksInfoList($employeeList, $initDate, $endDate, $language);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue time
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentOverdueCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->percentOverdueCasesByProcess($processList, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue by period (month, semester, etc.)
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentOverdueCasesByProcessHistory($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->percentOverdueCasesByProcessList($processList, $initDate, $endDate, \ReportingPeriodicityEnum::fromValue($periodicity));
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the number of new Cases
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentNewCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalNewCasesByProcess($processList, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of new Cases historically
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentNewCasesByProcessHistory($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalNewCasesByProcessList($processList, $initDate, $endDate, \ReportingPeriodicityEnum::fromValue($periodicity));
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * Returns the number of completed Cases
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentCompletedCasesByProcess($processList, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalCompletedCasesByProcess($processList, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of completed Cases historically
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getPercentCompletedCasesByProcessHistory($processList, $initDate, $endDate, $periodicity)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $retval = $calculator->totalCompletedCasesByProcessList($processList, $initDate, $endDate, \ReportingPeriodicityEnum::fromValue($periodicity));
|
||||
// return $retval;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// *
|
||||
// *
|
||||
// * @param array $processList array with the list of processes to filter the results.
|
||||
// * @param DateTime $initDate date from the index will be calculated
|
||||
// * @param DateTime $endDate date until the index will be calculated
|
||||
// *
|
||||
// * return decimal value
|
||||
// */
|
||||
// public function getProcessEfficiencyIndexData($processId, $initDate, $endDate)
|
||||
// {
|
||||
// G::loadClass('IndicatorsCalculator');
|
||||
// $calculator = new \IndicatorsCalculator();
|
||||
// $indexValue = $calculator->processEfficiencyIndex ($processId, $initDate, $endDate);
|
||||
// $costValue = $calculator->processEfficiencyCost ($processId, $initDate, $endDate);
|
||||
// $retval = $calculator->totalCompletedCasesByProcessList($processId, $initDate, $endDate);
|
||||
// return $retval;
|
||||
// }
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param $indicatorId
|
||||
* @param DateTime $initDate date from the index will be calculated
|
||||
* @param DateTime $endDate date until the index will be calculated
|
||||
* @param string $language language for the names (en, es, etc.)
|
||||
*
|
||||
* return decimal value
|
||||
* @return array
|
||||
*/
|
||||
public function getGeneralIndicatorStatistics($indicatorId, $initDate, $endDate, $periodicity)
|
||||
{
|
||||
G::loadClass('indicatorsCalculator');
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
$arr = $calculator->generalIndicatorData($indicatorId, $initDate, $endDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = $arr[0]['value'];
|
||||
$dataList1 = $calculator->
|
||||
generalIndicatorData($indicatorId,
|
||||
$initDate, $endDate,
|
||||
\ReportingPeriodicityEnum::fromValue($arr[0]['frequency1Type']));
|
||||
|
||||
$dataList2 = $calculator->
|
||||
generalIndicatorData($indicatorId,
|
||||
$initDate, $endDate,
|
||||
\ReportingPeriodicityEnum::fromValue($arr[0]['frequency2Type']));
|
||||
|
||||
$returnValue = array("index" => $value,
|
||||
"graph1XLabel"=>$arr[0]['graph1XLabel'],
|
||||
"graph1YLabel"=>$arr[0]['graph1YLabel'],
|
||||
"graph2XLabel"=>$arr[0]['graph2XLabel'],
|
||||
"graph2YLabel"=>$arr[0]['graph2YLabel'],
|
||||
"graph1Type"=>$arr[0]['graph1Type'],
|
||||
"graph2Type"=>$arr[0]['graph2Type'],
|
||||
"frequency1Type"=>$arr[0]['frequency1Type'],
|
||||
"frequency2Type"=>$arr[0]['frequency2Type'],
|
||||
"graph1Data"=>$dataList1,
|
||||
"graph2Data"=>$dataList2
|
||||
);
|
||||
return $returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
105
workflow/engine/src/ProcessMaker/Services/Api/Catalog.php
Normal file
105
workflow/engine/src/ProcessMaker/Services/Api/Catalog.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
|
||||
/**
|
||||
* Catalog Api Controller
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Catalog extends Api
|
||||
{
|
||||
/**
|
||||
* Get Catalog by cat_type
|
||||
*
|
||||
* @param string $cat_type {@from path}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:cat_type
|
||||
*
|
||||
*/
|
||||
public function doGetCatalogByType($cat_type)
|
||||
{
|
||||
try {
|
||||
$Catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
$response = $Catalog->getCatalogByType($cat_type);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPost($request_data)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
$arrayData = $catalog->create($request_data);
|
||||
|
||||
$response = $arrayData;
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url PUT /:cat_uid/:cat_type
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_type {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doPut($cat_uid, $cat_type, $request_data)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
|
||||
$arrayData = $catalog->update($cat_uid, $cat_type, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:cat_uid/:cat_type
|
||||
*
|
||||
* @param string $cat_uid {@min 32}{@max 32}
|
||||
* @param string $cat_type {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDelete($cat_uid, $cat_type)
|
||||
{
|
||||
try {
|
||||
$catalog = new \ProcessMaker\BusinessModel\Catalog();
|
||||
|
||||
$arrayData = $catalog->delete($cat_uid, $cat_type);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
463
workflow/engine/src/ProcessMaker/Services/Api/Dashboard.php
Normal file
463
workflow/engine/src/ProcessMaker/Services/Api/Dashboard.php
Normal file
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
|
||||
/**
|
||||
* Dashboard Api Controller
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class Dashboard extends Api
|
||||
{
|
||||
/**
|
||||
* Get dashboards UID by user_uid
|
||||
*
|
||||
* @param string $usr_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /owner/:usr_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardsUidByUser($usr_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getDashboardsUidByUser($usr_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards data by user_uid
|
||||
*
|
||||
* @param string $usr_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /ownerData/:usr_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardsDataByUser($usr_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getDashboardDataByUser($usr_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get users by dashboards uid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /users/:das_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardUsers($das_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getUsersOfDashboard($das_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards data by uid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:das_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardData($das_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getDashboard($das_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards indicator by dasInd_uid
|
||||
*
|
||||
* @param string $dasInd_uid {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /indicator/:dasInd_uid
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardIndicator($dasInd_uid)
|
||||
{
|
||||
try {
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getIndicator($dasInd_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards indicators by dashboardUid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
* @param string $dateIni {@from path}
|
||||
* @param string $dateFin {@from path}
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:das_uid/indicator
|
||||
*
|
||||
*/
|
||||
public function doGetIndicatorsbyDasUid($das_uid, $dateIni="", $dateFin="")
|
||||
{
|
||||
try {
|
||||
$dateIni = ($dateIni=="") ? date("Y/m/d") : $dateIni;
|
||||
$dateFin = ($dateFin=="") ? date("Y/m/d") : $dateFin;
|
||||
|
||||
$usrUid = $this->getUserId();
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getIndicatorsByDasUid($das_uid, $dateIni, $dateFin, $usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list Dashboards
|
||||
*
|
||||
* @param string $start {@from path}
|
||||
* @param string $limit {@from path}
|
||||
* @param string $sort {@from path}
|
||||
* @param string $dir {@from path}
|
||||
* @param string $search {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET
|
||||
*/
|
||||
public function doGetListDashboards(
|
||||
$start = 0,
|
||||
$limit = 0,
|
||||
$sort = 'DASHBOARD.DAS_TITLE',
|
||||
$dir = 'DESC',
|
||||
$search = ''
|
||||
) {
|
||||
try {
|
||||
$options['start'] = $start;
|
||||
$options['limit'] = $limit;
|
||||
$options['sort'] = $sort;
|
||||
$options['dir'] = $dir;
|
||||
$options['search'] = $search;
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->getListDashboards($options);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Owners by das_uid
|
||||
*
|
||||
* @param string $das_uid {@from path}
|
||||
* @param string $start {@from path}
|
||||
* @param string $limit {@from path}
|
||||
* @param string $search {@from path}
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /:das_uid/owners
|
||||
*
|
||||
*/
|
||||
public function doGetOwnersByDasUid(
|
||||
$das_uid,
|
||||
$start = 0,
|
||||
$limit = 0,
|
||||
$search = '')
|
||||
{
|
||||
try {
|
||||
$options['das_uid'] = $das_uid;
|
||||
$options['start'] = $start;
|
||||
$options['limit'] = $limit;
|
||||
$options['search'] = $search;
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->getOwnerByDasUid($options);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostDashboard($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createDashboard($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put dashboards configuration
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT
|
||||
*
|
||||
*/
|
||||
public function doPutDashboard($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createDashboard($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:das_uid
|
||||
*
|
||||
* @param string $das_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDeleteDashboard($das_uid)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->deletedashboard($das_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /owner
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostOwner($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createOwner($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:das_uid/owner/:owner_uid
|
||||
*
|
||||
* @param string $das_uid {@min 32}{@max 32}
|
||||
* @param string $owner_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDeleteDashboardOwner($das_uid, $owner_uid)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->deleteDashboardOwner($das_uid, $owner_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /indicator
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostIndicator($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createIndicator($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put Indicator
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /indicator
|
||||
*
|
||||
*/
|
||||
public function doPutIndicator($request_data)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->createIndicator($request_data);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /indicator/:ind_uid
|
||||
*
|
||||
* @param string $ind_uid {@min 32}{@max 32}
|
||||
*
|
||||
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function doDeleteIndicator($ind_uid)
|
||||
{
|
||||
try {
|
||||
$dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $dashboard->delete($ind_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post dashboards configuration by userUid
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /config/
|
||||
*
|
||||
*/
|
||||
public function doPostDashboardConfigByUsrUid($request_data)
|
||||
{
|
||||
try {
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
$ConfigDashboards = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $ConfigDashboards->postConfigByUsr($request_data, $usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dashboards configuration by usr_uid
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /config/
|
||||
*
|
||||
*/
|
||||
public function doGetDashboardConfigActualUsr()
|
||||
{
|
||||
try {
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $Dashboard->getConfig($usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put dashboards configuration by usr_uid
|
||||
*
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Jenny Murillo <jennylee@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /config
|
||||
*
|
||||
*/
|
||||
public function doPutDashboardConfigByUsrUid($request_data)
|
||||
{
|
||||
try {
|
||||
$usrUid = $this->getUserId();
|
||||
|
||||
$ConfigDashboards = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$response = $ConfigDashboards->putConfigByUsr($request_data, $usrUid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,397 @@
|
||||
<?php
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
|
||||
/**
|
||||
* Calendar Api Controller
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
class ReportingIndicators extends Api
|
||||
{
|
||||
// /**
|
||||
// * Returns the aggregate Efficiency of a process or set of precesses
|
||||
// *
|
||||
// * @param string $process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /process-efficiency-index
|
||||
// */
|
||||
//
|
||||
// public function doGetProcessEfficiencyIndex($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
//
|
||||
// $response = $indicatorsObj->getProcessEfficiencyIndex($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
//
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Lists tasks of a process and it's statistics (efficiency, average times, etc.)
|
||||
*
|
||||
* @param string $process_list {@from path}
|
||||
* @param string $init_date {@from path}
|
||||
* @param string $end_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /process-tasks
|
||||
*/
|
||||
public function doGetProcessTasksInfo($process_list, $init_date, $end_date, $language)
|
||||
{
|
||||
|
||||
if ($process_list == null || strlen($process_list) <= 1)
|
||||
throw new InvalidArgumentException ('process_list must have at least a value', 0);
|
||||
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$listArray = $listArray = explode(',', $process_list);
|
||||
$response = $indicatorsObj->getPeiTasksStatistics($listArray,
|
||||
new \DateTime($init_date),
|
||||
new \DateTime($end_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Returns the aggregate Efficiency of a employee or set of employees
|
||||
// *
|
||||
// * @param string $employee_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /employee-efficiency-index
|
||||
// */
|
||||
// public function doGetEmployeeEfficiencyIndex($employee_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($employee_list) > 1)
|
||||
// ? $listArray = explode(',', $employee_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getEmployeeEfficiencyIndex($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Lists tasks of a employee and it's statistics (efficiency, average times, etc.)
|
||||
// *
|
||||
// * @param string $employee_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $language {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /employee-tasks
|
||||
// */
|
||||
// public function doGetEmployeeTasksInfo($employee_list, $init_date, $end_date, $language)
|
||||
// {
|
||||
// if ($employee_list == null || strlen($employee_list) <= 1)
|
||||
// throw new InvalidArgumentException ('employee_list must have at least a value', 0);
|
||||
//
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = $listArray = explode(',', $employee_list);
|
||||
// $response = $indicatorsObj->getEmployeeTasksInfoList($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $language);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue time
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /percent-overdue-cases
|
||||
// */
|
||||
// public function doGetPercentOverdueByProcess($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentOverdueCasesByProcess($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the percent of Cases with Overdue time with the selected periodicity
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $periodicity {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /percent-overdue-cases-history
|
||||
// */
|
||||
// public function doGetPercentOverdueByProcessHistory($process_list, $init_date, $end_date, $periodicity)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentOverdueCasesByProcessHistory($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $periodicity);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with New time
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-new-cases
|
||||
// */
|
||||
// public function doGetTotalNewByProcess($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentNewCasesByProcess($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with New time with the selected periodicity
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $periodicity {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-new-cases-history
|
||||
// */
|
||||
// public function doGetTotalNewByProcessHistory($process_list, $init_date, $end_date, $periodicity)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentNewCasesByProcessHistory($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $periodicity);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with Completed time
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-completed-cases
|
||||
// */
|
||||
// public function doGetTotalCompletedByProcess($process_list, $init_date, $end_date)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentCompletedCasesByProcess($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date));
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Returns the total of Cases with Completed time with the selected periodicity
|
||||
// *
|
||||
// * @param string $$process_list {@from path}
|
||||
// * @param string $init_date {@from path}
|
||||
// * @param string $end_date {@from path}
|
||||
// * @param string $periodicity {@from path}
|
||||
// * @return array
|
||||
// *
|
||||
// * @url GET /total-completed-cases-history
|
||||
// */
|
||||
// public function doGetTotalCompletedByProcessHistory($process_list, $init_date, $end_date, $periodicity)
|
||||
// {
|
||||
// try {
|
||||
// $indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
// $listArray = (strlen($process_list) > 1)
|
||||
// ? $listArray = explode(',', $process_list)
|
||||
// : null;
|
||||
// $response = $indicatorsObj->getPercentCompletedCasesByProcessHistory($listArray,
|
||||
// new \DateTime($init_date),
|
||||
// new \DateTime($end_date),
|
||||
// $periodicity);
|
||||
// return $response;
|
||||
// } catch (\Exception $e) {
|
||||
// throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /process-efficiency-data
|
||||
*/
|
||||
public function doGetProcessEficciencyData($indicator_uid, $measure_date, $compare_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getPeiCompleteData
|
||||
($indicator_uid,
|
||||
new \DateTime($measure_date),
|
||||
new \DateTime($compare_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /employee-efficiency-data
|
||||
*/
|
||||
public function doGetEmployeeEficciencyData($indicator_uid, $measure_date, $compare_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getUeiCompleteData
|
||||
($indicator_uid,
|
||||
new \DateTime($measure_date),
|
||||
new \DateTime($compare_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /group-employee-data
|
||||
*/
|
||||
public function doGetGroupEmployeesData($group_uid, $init_date, $end_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getUeiGroupsStatistics
|
||||
($group_uid,
|
||||
new \DateTime($init_date),
|
||||
new \DateTime($end_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total of Cases with Completed time with the selected periodicity
|
||||
*
|
||||
* @param string $indicator_uid {@from path}
|
||||
* @param string $measure_date {@from path}
|
||||
* @param string $compare_date {@from path}
|
||||
* @param string $language {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @url GET /general-indicator-data
|
||||
*/
|
||||
public function doGetGeneralIndicatorData ($indicator_uid, $init_date, $end_date, $language)
|
||||
{
|
||||
try {
|
||||
$indicatorsObj = new \ProcessMaker\BusinessModel\ReportingIndicators();
|
||||
$response = $indicatorsObj->getGeneralIndicatorStatistics
|
||||
($indicator_uid,
|
||||
new \DateTime($init_date),
|
||||
new \DateTime($end_date),
|
||||
$language);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<div style="padding: 15px">
|
||||
<div id="list-panel"></div>
|
||||
</div>
|
||||
397
workflow/engine/templates/strategicDashboard/dashboardList.js
Normal file
397
workflow/engine/templates/strategicDashboard/dashboardList.js
Normal file
@@ -0,0 +1,397 @@
|
||||
new Ext.KeyMap(document, [
|
||||
{
|
||||
key: Ext.EventObject.F5,
|
||||
fn: function(k, e) {
|
||||
if (!e.ctrlKey) {
|
||||
if (Ext.isIE) {
|
||||
e.browserEvent.keyCode = 8;
|
||||
}
|
||||
e.stopEvent();
|
||||
document.location = document.location;
|
||||
} else {
|
||||
Ext.Msg.alert(_('ID_REFRESH_LABEL'), _('ID_REFRESH_MESSAGE'));
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
key: Ext.EventObject.DELETE,
|
||||
fn: function(k, e) {
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected) {
|
||||
deleteDashboard();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
key: Ext.EventObject.F2,
|
||||
fn: function(k, e) {
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected){
|
||||
editDashboard();
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
var store;
|
||||
var cmodel;
|
||||
var infoGrid;
|
||||
var viewport;
|
||||
var smodel;
|
||||
var newButton;
|
||||
var editButton;
|
||||
var deleteButton;
|
||||
var statusButton;
|
||||
var actionButtons;
|
||||
var contextMenu;
|
||||
var myMask;
|
||||
|
||||
Ext.onReady(function() {
|
||||
Ext.QuickTips.init();
|
||||
|
||||
pageSize = 20;
|
||||
myMask = new Ext.LoadMask(Ext.getBody(), {msg:_('ID_LOADING')});
|
||||
|
||||
newButton = new Ext.Action({
|
||||
text: _('ID_NEW'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
||||
handler: newDashboard
|
||||
});
|
||||
|
||||
editButton = new Ext.Action({
|
||||
text: _('ID_EDIT'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||
handler: editDashboard,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
deleteButton = new Ext.Action({
|
||||
text: _('ID_DELETE'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||
handler: deleteDashboard,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
statusButton = new Ext.Action({
|
||||
text: _('ID_STATUS'),
|
||||
iconCls: 'silk-add',
|
||||
handler: statusDashboard,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
contextMenu = new Ext.menu.Menu({
|
||||
items: [editButton, deleteButton, statusButton]
|
||||
});
|
||||
|
||||
actionButtons = [newButton, '-', editButton, deleteButton, statusButton];
|
||||
|
||||
smodel = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true,
|
||||
listeners:{
|
||||
rowselect: function(sm, index, record) {
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
statusButton.enable();
|
||||
|
||||
if (typeof(_rowselect) !== 'undefined') {
|
||||
if (Ext.isArray(_rowselect)) {
|
||||
for (var i = 0; i < _rowselect.length; i++) {
|
||||
if (Ext.isFunction(_rowselect[i])) {
|
||||
_rowselect[i](sm, index, record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( record.data.DAS_STATUS == 1 ){
|
||||
statusButton.setIconClass('icon-activate');
|
||||
statusButton.setText( _('ID_DEACTIVATE') );
|
||||
editButton.enable();
|
||||
deleteButton.enable();
|
||||
//statusButton.enable();
|
||||
} else {
|
||||
statusButton.setIconClass('icon-deactivate');
|
||||
statusButton.setText( _('ID_ACTIVATE') );
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
//statusButton.disable();
|
||||
}
|
||||
},
|
||||
rowdeselect: function(sm, index, record){
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
statusButton.disable();
|
||||
if (typeof(_rowdeselect) !== 'undefined') {
|
||||
if (Ext.isArray(_rowdeselect)) {
|
||||
for (var i = 0; i < _rowdeselect.length; i++) {
|
||||
if (Ext.isFunction(_rowdeselect[i])) {
|
||||
_rowdeselect[i](sm, index, record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
api: {
|
||||
read : urlProxy + 'dashboard'
|
||||
}
|
||||
,method: 'GET'
|
||||
,headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + credentials.access_token
|
||||
}
|
||||
}),
|
||||
reader : new Ext.data.JsonReader( {
|
||||
root: 'data',
|
||||
totalProperty: 'total',
|
||||
fields : [
|
||||
{name : 'DAS_UID'},
|
||||
{name : "DAS_TITLE"},
|
||||
{name : 'DAS_DESCRIPTION'},
|
||||
{name : 'DAS_OWNER'},
|
||||
{name : 'DAS_UPDATE_DATE'},
|
||||
{name : 'DAS_LABEL_STATUS'},
|
||||
{name : 'DAS_STATUS'}
|
||||
]
|
||||
}),
|
||||
sortInfo: {
|
||||
field: 'DAS_TITLE',
|
||||
direction: 'ASC'
|
||||
}
|
||||
});
|
||||
|
||||
var formatLineWrap = function (value) {
|
||||
str = '<div class="title-dashboard-text">'+value+'</div>';
|
||||
return str;
|
||||
};
|
||||
|
||||
cmodel = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 50,
|
||||
sortable: true
|
||||
},
|
||||
columns: [
|
||||
{id:'DAS_UID', dataIndex: 'DAS_UID', hidden:true, hideable:false},
|
||||
{header: _("ID_TITLE"), dataIndex: "DAS_TITLE", width: 150, hidden: false, align: "left", renderer : formatLineWrap},
|
||||
{header: _("ID_DESCRIPTION"), dataIndex: "DAS_DESCRIPTION", width: 200, hidden: false, align: "left"},
|
||||
{header: _('ID_ASSIGNED_TO'), dataIndex: 'DAS_OWNER', width: 200, hidden: false, align: 'center'},
|
||||
{header: _('ID_UPDATE_DATE'), dataIndex: 'DAS_UPDATE_DATE', width: 80, hidden: false, align: 'center'},
|
||||
{header: _('ID_STATUS'), dataIndex: 'DAS_LABEL_STATUS', width: 60, hidden: false, align: 'center'}
|
||||
]
|
||||
});
|
||||
|
||||
storePageSize = new Ext.data.SimpleStore({
|
||||
fields: ['size'],
|
||||
data: [['20'],['30'],['40'],['50'],['100']],
|
||||
autoLoad: true
|
||||
});
|
||||
|
||||
comboPageSize = new Ext.form.ComboBox({
|
||||
typeAhead : false,
|
||||
mode : 'local',
|
||||
triggerAction : 'all',
|
||||
store: storePageSize,
|
||||
valueField: 'size',
|
||||
displayField: 'size',
|
||||
width: 50,
|
||||
editable: false,
|
||||
listeners:{
|
||||
select: function(c,d,i){
|
||||
bbarpaging.pageSize = parseInt(d.data['size']);
|
||||
bbarpaging.moveFirst();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
comboPageSize.setValue(pageSize);
|
||||
|
||||
bbarpaging = new Ext.PagingToolbar({
|
||||
pageSize: pageSize,
|
||||
store: store,
|
||||
displayInfo: true,
|
||||
displayMsg: _('ID_GRID_PAGE_DISPLAYING_DASHBOARD_MESSAGE') + ' ',
|
||||
//displayMsg: 'Displaying Dashboards s {0} - {1} of {2}' + ' ',
|
||||
emptyMsg: _('ID_GRID_PAGE_NO_DASHBOARD_MESSAGE'),
|
||||
//emptyMsg: 'No Dashboards s to display',
|
||||
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
|
||||
});
|
||||
|
||||
infoGrid = new Ext.grid.GridPanel({
|
||||
region: 'center',
|
||||
layout: 'fit',
|
||||
id: 'infoGrid',
|
||||
height:100,
|
||||
autoWidth : true,
|
||||
stateful : true,
|
||||
stateId : 'gridDashboardList',
|
||||
enableColumnResize: true,
|
||||
enableHdMenu: true,
|
||||
frame:false,
|
||||
columnLines: false,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
title : _('ID_DASHBOARD'),
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar: actionButtons,
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
rowdblclick: editDashboard,
|
||||
render: function(){
|
||||
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
||||
}
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
groupTextTpl: '{text}',
|
||||
cls:"x-grid-empty",
|
||||
emptyText: _('ID_NO_RECORDS_FOUND')
|
||||
})
|
||||
});
|
||||
|
||||
infoGrid.on('rowcontextmenu',
|
||||
function (grid, rowIndex, evt) {
|
||||
var sm = grid.getSelectionModel();
|
||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||
},
|
||||
this
|
||||
);
|
||||
|
||||
infoGrid.on('contextmenu',
|
||||
function (evt) {
|
||||
evt.preventDefault();
|
||||
},
|
||||
this
|
||||
);
|
||||
|
||||
infoGrid.addListener('rowcontextmenu',onMessageContextMenu,this);
|
||||
|
||||
infoGrid.store.load();
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [
|
||||
infoGrid
|
||||
]
|
||||
});
|
||||
|
||||
if (typeof(__DASHBOARD_ERROR__) !== 'undefined') {
|
||||
PMExt.notify(_('ID_DASHBOARD'), __DASHBOARD_ERROR__);
|
||||
}
|
||||
});
|
||||
|
||||
//Funtion Handles Context Menu Opening
|
||||
onMessageContextMenu = function (grid, rowIndex, e) {
|
||||
e.stopEvent();
|
||||
var coords = e.getXY();
|
||||
contextMenu.showAt([coords[0], coords[1]]);
|
||||
};
|
||||
|
||||
//Load Grid By Default
|
||||
gridByDefault = function() {
|
||||
infoGrid.store.load();
|
||||
};
|
||||
|
||||
//New Dashboard Action
|
||||
newDashboard = function() {
|
||||
location.href = 'formDashboard';
|
||||
};
|
||||
|
||||
//Edit Dashboard Action
|
||||
editDashboard = function() {
|
||||
var rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected){
|
||||
location.href = 'formEditDashboard?DAS_UID=' + rowSelected.data.DAS_UID;
|
||||
}
|
||||
};
|
||||
|
||||
//Delete Dashboard Action
|
||||
deleteDashboard = function() {
|
||||
var rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected) {
|
||||
Ext.Msg.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_DELETE_DASHBOARD'),function(btn, text)
|
||||
{
|
||||
if (btn == 'yes') {
|
||||
viewport.getEl().mask(_('ID_PROCESSING'));
|
||||
Ext.Ajax.request({
|
||||
url : urlProxy + 'dashboard/' + rowSelected.data.DAS_UID,
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + credentials.access_token
|
||||
},
|
||||
success: function (result, request) {
|
||||
viewport.getEl().unmask();
|
||||
response = Ext.util.JSON.decode(result.responseText);
|
||||
PMExt.notify(_('ID_DASHBOARD'),_('ID_DASHBOARD_SUCCESS_DELETE'));
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
infoGrid.store.load();
|
||||
},
|
||||
failure: function (result, request) {
|
||||
Ext.MessageBox.alert( _('ID_ALERT'), _('ID_AJAX_COMMUNICATION_FAILED') );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//Status Dashboard Action
|
||||
statusDashboard = function() {
|
||||
var rows = infoGrid.getSelectionModel().getSelections();
|
||||
if( rows.length > 0 ) {
|
||||
for (i=0; i<rows.length; i++) {
|
||||
var status;
|
||||
if (rows[i].data.DAS_STATUS == 1) {
|
||||
status = 0;
|
||||
} else {
|
||||
status = 1;
|
||||
}
|
||||
|
||||
Ext.Ajax.request({
|
||||
url : urlProxy + 'dashboard',
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + credentials.access_token
|
||||
},
|
||||
jsonData: {
|
||||
"DAS_UID" : rows[i].data.DAS_UID,
|
||||
"DAS_STATUS": status
|
||||
},
|
||||
success: function (result, request) {
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
statusButton.disable();
|
||||
|
||||
statusButton.setIconClass('silk-add');
|
||||
statusButton.setText( _('ID_STATUS') );
|
||||
infoGrid.store.load();
|
||||
},
|
||||
failure: function (result, request) {
|
||||
Ext.MessageBox.alert( _('ID_ALERT'), _('ID_AJAX_COMMUNICATION_FAILED') );
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Ext.Msg.show({
|
||||
title:'',
|
||||
msg: _('ID_NO_SELECTION_WARNING'),
|
||||
buttons: Ext.Msg.INFO,
|
||||
fn: function(){},
|
||||
animEl: 'elId',
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
<div style="padding: 15px">
|
||||
<div id="list-panel"></div>
|
||||
</div>
|
||||
1289
workflow/engine/templates/strategicDashboard/formDashboard.js
Normal file
1289
workflow/engine/templates/strategicDashboard/formDashboard.js
Normal file
File diff suppressed because it is too large
Load Diff
52
workflow/engine/templates/strategicDashboard/load.php
Normal file
52
workflow/engine/templates/strategicDashboard/load.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<html>
|
||||
<style type="text/css">
|
||||
.Footer .content {
|
||||
padding :0px !important;
|
||||
}
|
||||
*html body {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
</style>
|
||||
<body onresize="autoResizeScreen()" onload="autoResizeScreen()">
|
||||
<iframe name="dashboardFrame" id="dashboardFrame" src ="" width="99%" height="768" frameborder="0">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
</body>
|
||||
<script>
|
||||
if ( (navigator.userAgent.indexOf("MSIE")!=-1) || (navigator.userAgent.indexOf("Trident")!=-1) ) {
|
||||
if ( typeof(winStrategicDashboard) == "undefined" || winStrategicDashboard.closed ) {
|
||||
winStrategicDashboard = window.open(
|
||||
"../strategicDashboard/viewDashboard","winStrategicDashboard"
|
||||
);
|
||||
}
|
||||
document.getElementById('dashboardFrame').src = "../strategicDashboard/viewDashboardIE";
|
||||
} else {
|
||||
document.getElementById('dashboardFrame').src = "../strategicDashboard/viewDashboard";
|
||||
}
|
||||
if ( document.getElementById('pm_submenu') ) {
|
||||
document.getElementById('pm_submenu').style.display = 'none';
|
||||
}
|
||||
|
||||
document.documentElement.style.overflowY = 'hidden';
|
||||
var oClientWinSize = getClientWindowSize();
|
||||
|
||||
var autoResizeScreen = function () {
|
||||
|
||||
dashboardFrame = document.getElementById('dashboardFrame');
|
||||
if (dashboardFrame) {
|
||||
height = getClientWindowSize().height-90;
|
||||
if (typeof dashboardFrame.style != 'undefined') {
|
||||
dashboardFrame.style.height = height;
|
||||
}
|
||||
if (typeof dashboardFrame.contentWindow.document != 'undefined') {
|
||||
dashboardFrame = dashboardFrame.contentWindow.document.getElementById('dashboardFrame');
|
||||
if (dashboardFrame && typeof dashboardFrame.style != 'undefined') {
|
||||
dashboardFrame.style.height = height-5;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setTimeout('autoResizeScreen()', 2000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
134
workflow/engine/templates/strategicDashboard/viewDashboard.html
Normal file
134
workflow/engine/templates/strategicDashboard/viewDashboard.html
Normal file
@@ -0,0 +1,134 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>Dashboards</title>
|
||||
|
||||
|
||||
<!--<link rel="stylesheet" href="/lib/pmdynaform/libs/bootstrap-3.1.1/css/bootstrap.min.css">-->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/sb-admin-2.css">
|
||||
<link rel="stylesheet" href="/css/font-awesome.min.css">
|
||||
|
||||
<link href="/css/gridstack.css" rel="stylesheet">
|
||||
<link href="/css/general.css" rel="stylesheet">
|
||||
<link href="/css/dashboardStylesForIE.css" rel="stylesheet">
|
||||
|
||||
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
|
||||
<link href='http://fonts.googleapis.com/css?family=Chivo:400,400italic' rel='stylesheet' type='text/css'>
|
||||
|
||||
<script type="text/javascript" src="/js/jquery/jquery-1.8.2.min.js" ></script>
|
||||
<script type="text/javascript" src="/js/jquery/jquery-ui-1.11.2.min.js" ></script>
|
||||
<!--<script src="/lib/pmdynaform/libs/bootstrap-3.1.1/js/bootstrap.min.js"></script>-->
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/underscore.js"></script>
|
||||
<!--<script src="/lib/pmdynaform/libs/underscore/underscore.js"></script>-->
|
||||
<script type="text/javascript" src="/js/gridstack/gridstack.js"></script>
|
||||
<script type="text/javascript" src="/js/d3/d3.js" ></script>
|
||||
<script type="text/javascript" src="/js/d3/d3.tip.js"></script>
|
||||
<script type="text/javascript" src="/js/pmchart/pmCharts.js"></script>
|
||||
<script>
|
||||
var urlProxy = '{$urlProxy}';
|
||||
var usrId = '{$usrId}';
|
||||
var token = '{$credentials.access_token}';
|
||||
var G_STRING = [];
|
||||
{foreach from=$translation key=index item=option}
|
||||
G_STRING['{$index}'] = '{$option}';
|
||||
{/foreach}
|
||||
</script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/dashboardProxyTest.js"></script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/dashboard.js"></script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/dashboardProxy.js"></script>
|
||||
</head>
|
||||
<body id="page-top" class="index">
|
||||
<img id="theImg" class="floating" src="/images/scrolldown.gif" width="80" height="80"/>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<!--Cabezera-->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<a class="btn btn-primary dashboard-button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
|
||||
<i class="fa fa-bar-chart fa-2x"></i>
|
||||
<i class="fa fa-chevron-down fa-1x"></i>
|
||||
</a>
|
||||
<h4 id="titleH4" class="header-dashboard">{translate label="ID_MANAGERS_DASHBOARDS"}</h4>
|
||||
<div class="pull-right dashboard-right">
|
||||
<h5 class="pull-left">{translate label="ID_DASH_COMPARE_MONTH"}:</h5>
|
||||
<button type="button" class="btn btn-compare btn-success pull-right btn-date">{translate label="ID_DASH_COMPARE"}</button>
|
||||
|
||||
<select id="year" class="form-control pull-right ">
|
||||
{literal}
|
||||
<script>
|
||||
now = new Date();
|
||||
anio = now.getFullYear();
|
||||
for(a=anio;a>=anio-7;a--){
|
||||
document.write('<option value="'+a+'">'+a+'</option>');
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
</select>
|
||||
|
||||
<select id="mounth" class="form-control pull-right ">
|
||||
<option value="1">{translate label="ID_MONTH_ABB_1"}</option>
|
||||
<option value="2">{translate label="ID_MONTH_ABB_2"}</option>
|
||||
<option value="3">{translate label="ID_MONTH_ABB_3"}</option>
|
||||
<option value="4">{translate label="ID_MONTH_ABB_4"}</option>
|
||||
<option value="5">{translate label="ID_MONTH_ABB_5"}</option>
|
||||
<option value="6">{translate label="ID_MONTH_ABB_6"}</option>
|
||||
<option value="7">{translate label="ID_MONTH_ABB_7"}</option>
|
||||
<option value="8">{translate label="ID_MONTH_ABB_8"}</option>
|
||||
<option value="9">{translate label="ID_MONTH_ABB_9"}</option>
|
||||
<option value="10">{translate label="ID_MONTH_ABB_10"}</option>
|
||||
<option value="11">{translate label="ID_MONTH_ABB_11"}</option>
|
||||
<option value="12">{translate label="ID_MONTH_ABB_12"}</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="collapse" id="collapseExample">
|
||||
<div class="well">
|
||||
<p class="text-center">{translate label="ID_DASH_CLICK_TO_VIEW"}</p>
|
||||
<p>
|
||||
<!-- Split button -->
|
||||
<div id="dasbuttons">
|
||||
</div>
|
||||
</p>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
<!-- Indicators -->
|
||||
<div class="row">
|
||||
<div class="indicators">
|
||||
<div id="indicatorsGridStack" class="grid-stack" data-gs-width="12" data-gs-animate="no" >
|
||||
<!--Here are added dynamically the Indicators-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- Details by Indicator -->
|
||||
<div class="col-lg-12 col-md-12 bottom">
|
||||
<div id="indicatorsDataGridStack" class="grid-stack" data-gs-width="12" data-gs-animate="no" >
|
||||
<!--Here are added dynamically the Dat by indicator-->
|
||||
</div>
|
||||
</div>
|
||||
<div id="relatedLabel"></div>
|
||||
<div class="col-lg-12 col-md-12">
|
||||
<div id="relatedDataGridStack" class="grid-stack" data-gs-width="12" data-gs-animate="no" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body id="page-top" class="index">
|
||||
|
||||
<div id="wrapper">
|
||||
//Change xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
7
workflow/public_html/css/bootstrap.min.css
vendored
Normal file
7
workflow/public_html/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
18
workflow/public_html/css/dashboardStylesForIE.css
Normal file
18
workflow/public_html/css/dashboardStylesForIE.css
Normal file
@@ -0,0 +1,18 @@
|
||||
_:-ms-lang(x), .ie-progress-dark-base {
|
||||
top:-105px;
|
||||
zoom: 1;
|
||||
position:relative;
|
||||
z-index: -10;
|
||||
}
|
||||
|
||||
|
||||
_:-ms-lang(x), .ie-panel-content {
|
||||
height:150px !important;
|
||||
}
|
||||
|
||||
|
||||
_:-ms-lang(x), .ie-panel-footer {
|
||||
margin-top:-105px
|
||||
}
|
||||
|
||||
|
||||
4
workflow/public_html/css/font-awesome.min.css
vendored
Normal file
4
workflow/public_html/css/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
715
workflow/public_html/css/general.css
Normal file
715
workflow/public_html/css/general.css
Normal file
@@ -0,0 +1,715 @@
|
||||
|
||||
.pm-charts-no-draw {
|
||||
font-size:16px;
|
||||
font-family:"Arial";
|
||||
font-weight:bold;
|
||||
width:200px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color:#e14333;
|
||||
}
|
||||
|
||||
|
||||
.hideme {opacity:0;}
|
||||
|
||||
.pie-label {font-size:10px;}
|
||||
.axis-label {font-size:10px;}
|
||||
|
||||
.errorBar, .errorBarLowerMark, .errorBarUpperMark{
|
||||
stroke: blue;
|
||||
stroke-width: 1;
|
||||
}
|
||||
|
||||
.x-ticks-label {
|
||||
font-size:9px;
|
||||
}
|
||||
.y-ticks-label {
|
||||
font-size:9px;
|
||||
}
|
||||
|
||||
img.floating {
|
||||
position:fixed;
|
||||
right:0;
|
||||
bottom:0;
|
||||
margin:0;
|
||||
padding:0;
|
||||
z-index:1000;
|
||||
opacity: 0.9;
|
||||
filter: alpha(opacity=90);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
div.tooltipdiv {
|
||||
position: absolute;
|
||||
line-height: 1;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
width: 60px;
|
||||
height: 28px;
|
||||
padding: 10px;
|
||||
font: 10px sans-serif;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
border: 0px;
|
||||
border-radius: 8px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.d3-tip {
|
||||
line-height: 1;
|
||||
font-weight: bold;
|
||||
padding: 12px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: #fff;
|
||||
border-radius: 9px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Creates a small triangle extender for the tooltip */
|
||||
.d3-tip:after {
|
||||
box-sizing: border-box;
|
||||
display: inline;
|
||||
font-size: 10px;
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Northward tooltips */
|
||||
.d3-tip.n:after {
|
||||
content: "\25BC";
|
||||
margin: -1px 0 0 0;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Eastward tooltips */
|
||||
.d3-tip.e:after {
|
||||
content: "\25C0";
|
||||
margin: -4px 0 0 0;
|
||||
top: 50%;
|
||||
left: -8px;
|
||||
}
|
||||
|
||||
/* Southward tooltips */
|
||||
.d3-tip.s:after {
|
||||
content: "\25B2";
|
||||
margin: 0 0 1px 0;
|
||||
top: -8px;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Westward tooltips */
|
||||
.d3-tip.w:after {
|
||||
content: "\25B6";
|
||||
margin: -4px 0 0 -1px;
|
||||
top: 50%;
|
||||
left: 100%;
|
||||
}
|
||||
.grid-stack-item-content {
|
||||
background: white;
|
||||
color: #2c3e50;
|
||||
/*font-family: 'Indie Flower', cursive;*/
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
border-color: 2px;
|
||||
}
|
||||
|
||||
.grid-stack-item-content .fa {
|
||||
/*font-size: 64px;*/
|
||||
display: block;
|
||||
/*margin: 20px 0 10px;*/
|
||||
}
|
||||
|
||||
header a, header a:hover { color: #fff; }
|
||||
|
||||
.darklue { background: #F2F2E0; color: #fff; }
|
||||
.darklue hr.star-light::after {
|
||||
background-color: #F2F2E0;
|
||||
}
|
||||
|
||||
.max {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
/****************************** Estilos de Indicadores *****************************/
|
||||
.pricing-table {
|
||||
width: 100%;
|
||||
margin: 10px auto;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
padding-right: 0;
|
||||
display:flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content:center;
|
||||
}
|
||||
.pricing-table .heading{
|
||||
color: #9C9E9F;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.3rem;
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
.block{
|
||||
width:100%;
|
||||
margin: 0 15px;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
/* border: 1px solid red;*/
|
||||
}
|
||||
/*Shared properties*/
|
||||
.title,.pt-footer{
|
||||
font-family: Arial !important;
|
||||
color: #FEFEFE;
|
||||
text-transform: capitalize;
|
||||
line-height: 2.5;
|
||||
position: relative;
|
||||
-moz-border-radius: 7px;
|
||||
-webkit-border-radius: 7px;
|
||||
}
|
||||
.content{
|
||||
width:100%;
|
||||
height:115px;
|
||||
color: #FEFEFE;
|
||||
padding: 10px 0 10px 0;
|
||||
overflow-y:hidden;
|
||||
}
|
||||
/*/arrow creation*/
|
||||
.price{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-bottom: 0.625rem;
|
||||
}
|
||||
.price span{
|
||||
font-family: Arial !important;
|
||||
font-size: 9.5rem !important;
|
||||
letter-spacing: 1px;
|
||||
position:relative;
|
||||
top:-13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.price sup{
|
||||
font-family: Arial !important;
|
||||
font-size: 2rem;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: -30px;
|
||||
}
|
||||
.hint{
|
||||
font-family: Arial !important;
|
||||
font-style: italic;
|
||||
font-size: 1.7rem;
|
||||
position:absolute;
|
||||
top:117px;
|
||||
left:42%;
|
||||
}
|
||||
/*PERSONAL*/
|
||||
.indicator-color1 .title{
|
||||
background: #0769B6;
|
||||
}
|
||||
.indicator-color1 .content,.indicator-color1 .pt-footer{
|
||||
background: #1B7CC9;
|
||||
|
||||
}
|
||||
.indicator-color1 .content:after{
|
||||
border-top-color: #82DACA;
|
||||
}
|
||||
.indicator-color1 .pt-footer:after{
|
||||
border-top-color: #FFFFFF;
|
||||
}
|
||||
/*PROFESSIONAL*/
|
||||
.indicator-color2 .title{
|
||||
background: #0F768A;
|
||||
}
|
||||
.indicator-color2 .content,.indicator-color2 .pt-footer{
|
||||
background: #4CB6CA;
|
||||
|
||||
}
|
||||
.indicator-color2 .content:after{
|
||||
border-top-color: #53CFE9;
|
||||
}
|
||||
.indicator-color2 .pt-footer:after{
|
||||
border-top-color: #FFFFFF;
|
||||
}
|
||||
/*BUSINESS*/
|
||||
.indicator-color3 .title{
|
||||
background: #E37653;
|
||||
}
|
||||
.indicator-color3 .content,.indicator-color3 .pt-footer{
|
||||
background: #E4947B;
|
||||
|
||||
}
|
||||
.indicator-color3 .content:after{
|
||||
border-top-color: #EB6379;
|
||||
}
|
||||
.indicator-color3 .pt-footer:after {
|
||||
border-top-color: #FFFFFF;
|
||||
}
|
||||
|
||||
/*PERSONAL*/
|
||||
.indicator-color4 .title{
|
||||
background: #25943B;
|
||||
}
|
||||
.indicator-color4 .content,.personal .pt-footer{
|
||||
background: #7FC585;
|
||||
}
|
||||
.indicator-color4 .content:after{
|
||||
border-top-color: #82DACA;
|
||||
}
|
||||
.indicator-color4 .pt-footer:after{
|
||||
border-top-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
background-color: transparent;
|
||||
}
|
||||
caption {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
color: #777;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #6AA985;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.table > thead > tr > th,
|
||||
.table > tbody > tr > th,
|
||||
.table > tfoot > tr > th,
|
||||
.table > thead > tr > td,
|
||||
.table > tbody > tr > td,
|
||||
.table > tfoot > tr > td {
|
||||
padding: 8px;
|
||||
line-height: 1.42857143;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
.table > thead > tr > th {
|
||||
vertical-align: bottom;
|
||||
border-bottom: 2px solid #ddd;
|
||||
}
|
||||
.table > caption + thead > tr:first-child > th,
|
||||
.table > colgroup + thead > tr:first-child > th,
|
||||
.table > thead:first-child > tr:first-child > th,
|
||||
.table > caption + thead > tr:first-child > td,
|
||||
.table > colgroup + thead > tr:first-child > td,
|
||||
.table > thead:first-child > tr:first-child > td {
|
||||
border-top: 0;
|
||||
}
|
||||
.table > tbody + tbody {
|
||||
border-top: 2px solid #ddd;
|
||||
}
|
||||
.table .table {
|
||||
background-color: #fff;
|
||||
}
|
||||
.table-condensed > thead > tr > th,
|
||||
.table-condensed > tbody > tr > th,
|
||||
.table-condensed > tfoot > tr > th,
|
||||
.table-condensed > thead > tr > td,
|
||||
.table-condensed > tbody > tr > td,
|
||||
.table-condensed > tfoot > tr > td {
|
||||
padding: 5px;
|
||||
}
|
||||
.table-bordered {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.table-bordered > thead > tr > th,
|
||||
.table-bordered > tbody > tr > th,
|
||||
.table-bordered > tfoot > tr > th,
|
||||
.table-bordered > thead > tr > td,
|
||||
.table-bordered > tbody > tr > td,
|
||||
.table-bordered > tfoot > tr > td {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.table-bordered > thead > tr > th,
|
||||
.table-bordered > thead > tr > td {
|
||||
border-bottom-width: 2px;
|
||||
}
|
||||
.table-striped > tbody > tr:nth-child(odd) {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.table-hover > tbody > tr:hover {
|
||||
background-color: #B0C4DE;
|
||||
}
|
||||
table col[class*="col-"] {
|
||||
position: static;
|
||||
display: table-column;
|
||||
float: none;
|
||||
}
|
||||
table td[class*="col-"],
|
||||
table th[class*="col-"] {
|
||||
position: static;
|
||||
display: table-cell;
|
||||
float: none;
|
||||
}
|
||||
.table > thead > tr > td.active,
|
||||
.table > tbody > tr > td.active,
|
||||
.table > tfoot > tr > td.active,
|
||||
.table > thead > tr > th.active,
|
||||
.table > tbody > tr > th.active,
|
||||
.table > tfoot > tr > th.active,
|
||||
.table > thead > tr.active > td,
|
||||
.table > tbody > tr.active > td,
|
||||
.table > tfoot > tr.active > td,
|
||||
.table > thead > tr.active > th,
|
||||
.table > tbody > tr.active > th,
|
||||
.table > tfoot > tr.active > th {
|
||||
/*background-color: #f5f5f5;*/
|
||||
}
|
||||
.table-hover > tbody > tr > td.active:hover,
|
||||
.table-hover > tbody > tr > th.active:hover,
|
||||
.table-hover > tbody > tr.active:hover > td,
|
||||
.table-hover > tbody > tr:hover > .active,
|
||||
.table-hover > tbody > tr.active:hover > th {
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
.table > thead > tr > td.success,
|
||||
.table > tbody > tr > td.success,
|
||||
.table > tfoot > tr > td.success,
|
||||
.table > thead > tr > th.success,
|
||||
.table > tbody > tr > th.success,
|
||||
.table > tfoot > tr > th.success,
|
||||
.table > thead > tr.success > td,
|
||||
.table > tbody > tr.success > td,
|
||||
.table > tfoot > tr.success > td,
|
||||
.table > thead > tr.success > th,
|
||||
.table > tbody > tr.success > th,
|
||||
.table > tfoot > tr.success > th {
|
||||
background-color: #dff0d8;
|
||||
}
|
||||
.table-hover > tbody > tr > td.success:hover,
|
||||
.table-hover > tbody > tr > th.success:hover,
|
||||
.table-hover > tbody > tr.success:hover > td,
|
||||
.table-hover > tbody > tr:hover > .success,
|
||||
.table-hover > tbody > tr.success:hover > th {
|
||||
background-color: #d0e9c6;
|
||||
}
|
||||
.table > thead > tr > td.info,
|
||||
.table > tbody > tr > td.info,
|
||||
.table > tfoot > tr > td.info,
|
||||
.table > thead > tr > th.info,
|
||||
.table > tbody > tr > th.info,
|
||||
.table > tfoot > tr > th.info,
|
||||
.table > thead > tr.info > td,
|
||||
.table > tbody > tr.info > td,
|
||||
.table > tfoot > tr.info > td,
|
||||
.table > thead > tr.info > th,
|
||||
.table > tbody > tr.info > th,
|
||||
.table > tfoot > tr.info > th {
|
||||
background-color: #d9edf7;
|
||||
}
|
||||
.table-hover > tbody > tr > td.info:hover,
|
||||
.table-hover > tbody > tr > th.info:hover,
|
||||
.table-hover > tbody > tr.info:hover > td,
|
||||
.table-hover > tbody > tr:hover > .info,
|
||||
.table-hover > tbody > tr.info:hover > th {
|
||||
background-color: #c4e3f3;
|
||||
}
|
||||
.table > thead > tr > td.warning,
|
||||
.table > tbody > tr > td.warning,
|
||||
.table > tfoot > tr > td.warning,
|
||||
.table > thead > tr > th.warning,
|
||||
.table > tbody > tr > th.warning,
|
||||
.table > tfoot > tr > th.warning,
|
||||
.table > thead > tr.warning > td,
|
||||
.table > tbody > tr.warning > td,
|
||||
.table > tfoot > tr.warning > td,
|
||||
.table > thead > tr.warning > th,
|
||||
.table > tbody > tr.warning > th,
|
||||
.table > tfoot > tr.warning > th {
|
||||
background-color: #fcf8e3;
|
||||
}
|
||||
.table-hover > tbody > tr > td.warning:hover,
|
||||
.table-hover > tbody > tr > th.warning:hover,
|
||||
.table-hover > tbody > tr.warning:hover > td,
|
||||
.table-hover > tbody > tr:hover > .warning,
|
||||
.table-hover > tbody > tr.warning:hover > th {
|
||||
background-color: #faf2cc;
|
||||
}
|
||||
.table > thead > tr > td.danger,
|
||||
.table > tbody > tr > td.danger,
|
||||
.table > tfoot > tr > td.danger,
|
||||
.table > thead > tr > th.danger,
|
||||
.table > tbody > tr > th.danger,
|
||||
.table > tfoot > tr > th.danger,
|
||||
.table > thead > tr.danger > td,
|
||||
.table > tbody > tr.danger > td,
|
||||
.table > tfoot > tr.danger > td,
|
||||
.table > thead > tr.danger > th,
|
||||
.table > tbody > tr.danger > th,
|
||||
.table > tfoot > tr.danger > th {
|
||||
background-color: #f2dede;
|
||||
}
|
||||
.table-hover > tbody > tr > td.danger:hover,
|
||||
.table-hover > tbody > tr > th.danger:hover,
|
||||
.table-hover > tbody > tr.danger:hover > td,
|
||||
.table-hover > tbody > tr:hover > .danger,
|
||||
.table-hover > tbody > tr.danger:hover > th {
|
||||
background-color: #ebcccc;
|
||||
}
|
||||
.table-responsive {
|
||||
min-height: .01%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
|
||||
div.ok { position:relative;}
|
||||
img.positioned { position:absolute; height:28px; }
|
||||
img#topright { top:0; right:0; }
|
||||
|
||||
.timepoint {
|
||||
background-color:red;
|
||||
}
|
||||
|
||||
|
||||
#chart { /* NEW */
|
||||
height: 360px; /* NEW */
|
||||
position: relative; /* NEW */
|
||||
width: 360px; /* NEW */
|
||||
}
|
||||
path.slice{
|
||||
stroke-width:2px;
|
||||
}
|
||||
polyline{
|
||||
opacity: .3;
|
||||
stroke: black;
|
||||
stroke-width: 2px;
|
||||
fill: none;
|
||||
}
|
||||
svg text.percent{
|
||||
fill:white;
|
||||
text-anchor:middle;
|
||||
font-size:12px;
|
||||
}
|
||||
/*.tooltip {
|
||||
background: #eee;
|
||||
box-shadow: 0 0 5px #999999;
|
||||
color: #333;
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
left: 130px;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 95px;
|
||||
width: 80px;
|
||||
z-index: 10;
|
||||
}*/
|
||||
.legend {
|
||||
font-size: 12px;
|
||||
}
|
||||
rect {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.background {
|
||||
fill: #FFFFFF;
|
||||
fill-opacity: 0.01;
|
||||
}
|
||||
|
||||
.component {
|
||||
fill: #e1e1e1;
|
||||
}
|
||||
|
||||
.component .label {
|
||||
font-family: Myriad, "Helvetic Neue", Helvetica, Arial;
|
||||
text-anchor: middle;
|
||||
/*fill: #0000FF;*/
|
||||
}
|
||||
|
||||
.arc {
|
||||
stroke-weight:0.5;
|
||||
/*fill: #000000;*/
|
||||
}
|
||||
|
||||
|
||||
.arc2 {
|
||||
stroke-weight:0.1;
|
||||
fill: #3660b0;
|
||||
}
|
||||
|
||||
|
||||
.label {
|
||||
font-family: Myriad, "Helvetic Neue", Helvetica, Arial;
|
||||
text-anchor: middle;
|
||||
}
|
||||
|
||||
.radial-svg {
|
||||
/*display: block;*/
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.grid
|
||||
{
|
||||
stroke: black;
|
||||
stroke-opacity: 0.3;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
body {
|
||||
/*font: 10px Arial;
|
||||
font-weight:none;*/
|
||||
}
|
||||
|
||||
text.shadow {
|
||||
stroke: #fff;
|
||||
stroke-width: 2.5px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
path.line1 {
|
||||
stroke: steelblue;
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
shape-rendering: auto;
|
||||
}
|
||||
|
||||
.axis path,
|
||||
.axis line {
|
||||
fill: none;
|
||||
stroke: grey;
|
||||
stroke-width: 1;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
.grid path {
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.tooltip { /* NEW */
|
||||
background: #eee; /* NEW */
|
||||
box-shadow: 0 0 5px #999999; /* NEW */
|
||||
color: #333; /* NEW */
|
||||
display: none; /* NEW */
|
||||
font-size: 12px; /* NEW */
|
||||
left: 110px; /* NEW */
|
||||
padding: 10px; /* NEW */
|
||||
position: absolute; /* NEW */
|
||||
text-align: center; /* NEW */
|
||||
top: 85px; /* NEW */
|
||||
width: 80px; /* NEW */
|
||||
z-index: 10; /* NEW */
|
||||
}
|
||||
|
||||
.letter{
|
||||
background-image: url("../images/logo-proces-marker.png");
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
height: 150%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*------------header---------*/
|
||||
|
||||
.tick {
|
||||
stroke:blue;
|
||||
stroke-opacity: 0.3;
|
||||
font-size:12px;
|
||||
font-family:arial;
|
||||
/*font-weight:normal;*/
|
||||
/*text-shadow:1px 1px 1px #000;*/
|
||||
}
|
||||
.tick :Hover{
|
||||
stroke:red;
|
||||
stroke-opacity: 0.3;
|
||||
font-size:12px;
|
||||
font-family:arial;
|
||||
/*font-weight:normal;*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------index--------------*/
|
||||
|
||||
.FormTitle{
|
||||
background: none repeat scroll 0 0 #888888;
|
||||
border-bottom: 1px solid #626262;
|
||||
color: #ffffff;
|
||||
}
|
||||
.contact{
|
||||
background: none repeat scroll 0 0 #eeeeee;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
text.shadow {
|
||||
stroke: #fff;
|
||||
stroke-width: 2.5px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.line1 {
|
||||
stroke: steelblue;
|
||||
stroke-width: 2;
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.line2 {
|
||||
stroke: #eee;
|
||||
stroke-width: 2;
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.axis path,
|
||||
.axis line {
|
||||
fill: none;
|
||||
stroke: grey;
|
||||
stroke-width: 1;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.grid .tick {
|
||||
stroke: lightgrey;
|
||||
stroke-opacity: 0.7;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
.grid path {
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.area {
|
||||
fill: lightsteelblue;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.parea {
|
||||
fill: green;
|
||||
stroke-width: 0;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.point-area2 {
|
||||
fill:gray;
|
||||
opacity: 1.0;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
|
||||
129
workflow/public_html/css/gridstack.css
Normal file
129
workflow/public_html/css/gridstack.css
Normal file
@@ -0,0 +1,129 @@
|
||||
.grid-stack {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.grid-stack-item {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.grid-stack-item .grid-stack-item-content{
|
||||
/*margin: 0;*/
|
||||
position: absolute;
|
||||
/*top: 0;*/
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
/*bottom: 0;*/
|
||||
/*width: auto;*/
|
||||
z-index: 0 !important;
|
||||
/*overflow: auto;*/
|
||||
}
|
||||
|
||||
.grid-stack-item .placeholder-content {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 15px;
|
||||
right: 15px;
|
||||
bottom: 0;
|
||||
z-index: 0 !important;
|
||||
}
|
||||
|
||||
.grid-stack-placeholder .placeholder-content {
|
||||
border: 1px dashed lightgray;
|
||||
}
|
||||
|
||||
.grid-stack-item.ui-draggable-dragging,
|
||||
.grid-stack-item.ui-resizable-resizing {
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.grid-stack-item.ui-draggable-dragging .grid-stack-item-content,
|
||||
.grid-stack-item.ui-resizable-resizing .grid-stack-item-content {
|
||||
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.grid-stack-item .ui-resizable-handle {
|
||||
padding: 3px;
|
||||
margin: 3px 0;
|
||||
cursor: nwse-resize;
|
||||
color: gray;
|
||||
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 15px;
|
||||
|
||||
font: normal normal normal 10px/1 FontAwesome;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
||||
-webkit-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.grid-stack-item .ui-resizable-handle::before {
|
||||
content: "\f065";
|
||||
}
|
||||
|
||||
.grid-stack-item[data-gs-width="12"] { width: 100% }
|
||||
.grid-stack-item[data-gs-width="11"] { width: 91.66666667% }
|
||||
.grid-stack-item[data-gs-width="10"] { width: 83.33333333% }
|
||||
.grid-stack-item[data-gs-width="9"] { width: 75% }
|
||||
.grid-stack-item[data-gs-width="8"] { width: 66.66666667% }
|
||||
.grid-stack-item[data-gs-width="7"] { width: 58.33333333% }
|
||||
.grid-stack-item[data-gs-width="6"] { width: 50% }
|
||||
.grid-stack-item[data-gs-width="5"] { width: 41.66666667% }
|
||||
.grid-stack-item[data-gs-width="4"] { width: 33.33333333% }
|
||||
.grid-stack-item[data-gs-width="3"] { width: 25% }
|
||||
.grid-stack-item[data-gs-width="2"] { width: 16.66666667% }
|
||||
.grid-stack-item[data-gs-width="1"] { width: 8.33333333% }
|
||||
|
||||
.grid-stack-item[data-gs-x="12"] { left: 100% }
|
||||
.grid-stack-item[data-gs-x="11"] { left: 91.66666667% }
|
||||
.grid-stack-item[data-gs-x="10"] { left: 83.33333333% }
|
||||
.grid-stack-item[data-gs-x="9"] { left: 75% }
|
||||
.grid-stack-item[data-gs-x="8"] { left: 66.66666667% }
|
||||
.grid-stack-item[data-gs-x="7"] { left: 58.33333333% }
|
||||
.grid-stack-item[data-gs-x="6"] { left: 50% }
|
||||
.grid-stack-item[data-gs-x="5"] { left: 41.66666667% }
|
||||
.grid-stack-item[data-gs-x="4"] { left: 33.33333333% }
|
||||
.grid-stack-item[data-gs-x="3"] { left: 25% }
|
||||
.grid-stack-item[data-gs-x="2"] { left: 16.66666667% }
|
||||
.grid-stack-item[data-gs-x="1"] { left: 8.33333333% }
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.grid-stack-item {
|
||||
position: relative !important;
|
||||
width: auto !important;
|
||||
left: 0 !important;
|
||||
top: auto !important;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.grid-stack {
|
||||
height: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
.grid-stack.grid-stack-animate, .grid-stack.grid-stack-animate .grid-stack-item {
|
||||
-webkit-transition: left .3s, top .3s, height .3s, width .3s;
|
||||
-moz-transition: left .3s, top .3s, height .3s, width .3s;
|
||||
-o-transition: left .3s, top .3s, height .3s, width .3s;
|
||||
-ms-transition: left .3s, top .3s, height .3s, width .3s;
|
||||
transition: left .3s, top .3s, height .3s, width .3s;
|
||||
}
|
||||
/*Don't animate the placeholder or when dragging/resizing*/
|
||||
.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,
|
||||
.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing,
|
||||
.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder{
|
||||
-webkit-transition: left .0s, top .0s, height .0s, width .0s;
|
||||
-moz-transition: left .0s, top .0s, height .0s, width .0s;
|
||||
-o-transition: left .0s, top .0s, height .0s, width .0s;
|
||||
transition: left .0s, top .0s, height .0s, width .0s;
|
||||
}
|
||||
766
workflow/public_html/css/sb-admin-2.css
Normal file
766
workflow/public_html/css/sb-admin-2.css
Normal file
@@ -0,0 +1,766 @@
|
||||
/*!
|
||||
* Start Bootstrap - SB Admin 2 Bootstrap Admin Theme (http://startbootstrap.com)
|
||||
* Code licensed under the Apache License v2.0.
|
||||
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*/
|
||||
|
||||
body {
|
||||
background-color: #f5f5f5;
|
||||
font-size: 15px;
|
||||
font-family: 'Chivo', sans-serif;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6{
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#page-wrapper {
|
||||
padding: 0 15px;
|
||||
min-height: 568px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@media(min-width:768px) {
|
||||
#page-wrapper {
|
||||
position: inherit;
|
||||
margin: 0;
|
||||
padding: 0 30px;
|
||||
margin-top: 10px;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-top-links {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.navbar-top-links li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.navbar-top-links li:last-child {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.navbar-top-links li a {
|
||||
padding: 15px;
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-menu li {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-menu li:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-menu li a {
|
||||
padding: 3px 20px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-menu li a div {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-messages,
|
||||
.navbar-top-links .dropdown-tasks,
|
||||
.navbar-top-links .dropdown-alerts {
|
||||
width: 310px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-messages {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-tasks {
|
||||
margin-left: -59px;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-alerts {
|
||||
margin-left: -123px;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-user {
|
||||
right: 0;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.sidebar .sidebar-nav.navbar-collapse {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.sidebar .sidebar-search {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.sidebar ul li {
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
}
|
||||
|
||||
.sidebar ul li a.active {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.sidebar .arrow {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.sidebar .fa.arrow:before {
|
||||
content: "\f104";
|
||||
}
|
||||
|
||||
.sidebar .active>a>.fa.arrow:before {
|
||||
content: "\f107";
|
||||
}
|
||||
|
||||
.sidebar .nav-second-level li,
|
||||
.sidebar .nav-third-level li {
|
||||
border-bottom: 0!important;
|
||||
}
|
||||
|
||||
.sidebar .nav-second-level li a {
|
||||
padding-left: 37px;
|
||||
}
|
||||
|
||||
.sidebar .nav-third-level li a {
|
||||
padding-left: 52px;
|
||||
}
|
||||
|
||||
@media(min-width:768px) {
|
||||
.sidebar {
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
margin-top: 51px;
|
||||
}
|
||||
|
||||
.navbar-top-links .dropdown-messages,
|
||||
.navbar-top-links .dropdown-tasks,
|
||||
.navbar-top-links .dropdown-alerts {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-outline {
|
||||
color: inherit;
|
||||
background-color: transparent;
|
||||
transition: all .5s;
|
||||
}
|
||||
|
||||
.btn-primary.btn-outline {
|
||||
color: #428bca;
|
||||
}
|
||||
|
||||
.btn-success.btn-outline {
|
||||
color: #5cb85c;
|
||||
}
|
||||
|
||||
.btn-info.btn-outline {
|
||||
color: #5bc0de;
|
||||
}
|
||||
|
||||
.btn-warning.btn-outline {
|
||||
color: #f0ad4e;
|
||||
}
|
||||
|
||||
.btn-danger.btn-outline {
|
||||
color: #d9534f;
|
||||
}
|
||||
|
||||
.btn-primary.btn-outline:hover,
|
||||
.btn-success.btn-outline:hover,
|
||||
.btn-info.btn-outline:hover,
|
||||
.btn-warning.btn-outline:hover,
|
||||
.btn-danger.btn-outline:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.chat {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.chat li {
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px dotted #999;
|
||||
}
|
||||
|
||||
.chat li.left .chat-body {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
.chat li.right .chat-body {
|
||||
margin-right: 60px;
|
||||
}
|
||||
|
||||
.chat li .chat-body p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.panel .slidedown .glyphicon,
|
||||
.chat .glyphicon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.chat-panel .panel-body {
|
||||
height: 350px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.login-panel {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
.flot-chart {
|
||||
display: block;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.flot-chart-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.dataTables_wrapper {
|
||||
position: relative;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting,
|
||||
table.dataTable thead .sorting_asc,
|
||||
table.dataTable thead .sorting_desc,
|
||||
table.dataTable thead .sorting_asc_disabled,
|
||||
table.dataTable thead .sorting_desc_disabled {
|
||||
background: 0 0;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_asc:after {
|
||||
content: "\f0de";
|
||||
float: right;
|
||||
font-family: fontawesome;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
content: "\f0dd";
|
||||
float: right;
|
||||
font-family: fontawesome;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting:after {
|
||||
content: "\f0dc";
|
||||
float: right;
|
||||
font-family: fontawesome;
|
||||
color: rgba(50,50,50,.5);
|
||||
}
|
||||
|
||||
.btn-circle {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 6px 0;
|
||||
border-radius: 15px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 1.428571429;
|
||||
}
|
||||
|
||||
.btn-circle.btn-lg {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
padding: 10px 16px;
|
||||
border-radius: 25px;
|
||||
font-size: 18px;
|
||||
line-height: 1.33;
|
||||
}
|
||||
|
||||
.btn-circle.btn-xl {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
padding: 10px 16px;
|
||||
border-radius: 35px;
|
||||
font-size: 24px;
|
||||
line-height: 1.33;
|
||||
}
|
||||
|
||||
.show-grid [class^=col-] {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #eee!important;
|
||||
}
|
||||
|
||||
.show-grid {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.huge {
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.fontMedium {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.panel-green {
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
|
||||
.panel-green .panel-heading {
|
||||
border-color: #1fbc99;
|
||||
color: #fff;
|
||||
background-color: #1fbc99;
|
||||
}
|
||||
|
||||
.panel-green a {
|
||||
color: #606368;
|
||||
}
|
||||
|
||||
.panel-green a:hover {
|
||||
color: #1fbc99;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.panel-red {
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.panel-red .panel-heading {
|
||||
border-color: #e14333;
|
||||
color: #fff;
|
||||
background-color: #e14333;
|
||||
}
|
||||
|
||||
.panel-red a {
|
||||
color: #606368;
|
||||
}
|
||||
|
||||
.panel-red a:hover {
|
||||
color: #e14333;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.panel-yellow {
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.panel-yellow .panel-heading {
|
||||
border-color: #fcb322;
|
||||
color: #fff;
|
||||
background-color: #fcb322;
|
||||
}
|
||||
|
||||
.panel-yellow a {
|
||||
color: #606368;
|
||||
}
|
||||
|
||||
.panel-yellow a:hover {
|
||||
color: #fcb322;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/*NEW STYLES START HERE*/
|
||||
|
||||
/*navbar*/
|
||||
|
||||
|
||||
.navbar-default{
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
border-radius: 0;;
|
||||
}
|
||||
|
||||
.navbar-brand{
|
||||
height: 77px;
|
||||
padding: 7px 10px;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.navbar-nav{
|
||||
padding: 12px 15px;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover{
|
||||
background-color: transparent;
|
||||
color: #3397e1;
|
||||
display: inline-block;
|
||||
border-bottom: 2px solid #3397e1;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav>li>a{
|
||||
color: #7b7c80;
|
||||
padding: 16px 3px;
|
||||
margin: 0 12px;
|
||||
}
|
||||
|
||||
.navbar-default .navbar-nav>li>a:hover{
|
||||
color: #3397e1;
|
||||
}
|
||||
|
||||
.navbar-toggle{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
||||
.user i img{
|
||||
width: 54px;
|
||||
border-radius: 100px;
|
||||
border: 2px solid #e9e9e9;
|
||||
margin-right: 12px;
|
||||
display: inline-grid;;
|
||||
}
|
||||
|
||||
.user{
|
||||
background:transparent;
|
||||
border-left: 1px solid #dadada;
|
||||
margin-right: -15px;
|
||||
height: 77px;
|
||||
}
|
||||
|
||||
.user:hover, .user.open{
|
||||
background:#f5f5f5;
|
||||
}
|
||||
|
||||
.navbar-default .user>.active>a{
|
||||
border-bottom:0;
|
||||
color:#3397e1;
|
||||
padding: 0;
|
||||
height: 52px;
|
||||
}
|
||||
|
||||
.navbar-default .user>.active>a:hover, .navbar-default .user>.active>a:focus{
|
||||
color:#3397e1;
|
||||
border-bottom: 0;
|
||||
height: 52px;
|
||||
}
|
||||
/*navbar ends*/
|
||||
|
||||
/*title panel*/
|
||||
.panel{
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.panel-body{
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.dashboard-button{
|
||||
background-color: #fff;
|
||||
color:#3d4047;
|
||||
border-radius: 0;
|
||||
border: 0;
|
||||
height:55px;
|
||||
width: 85px;
|
||||
padding-top: 15px;
|
||||
float: left;
|
||||
margin-right: 25px;
|
||||
border-right: 1px solid #dadada;
|
||||
}
|
||||
|
||||
.dashboard-button:hover, .dashboard-button:active, .dashboard-button:focus{
|
||||
background-color: #3d4047;
|
||||
}
|
||||
|
||||
.dashboard-button i.fa-chevron-down{
|
||||
margin-top: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.fa-chevron-right{
|
||||
color: #337AB8;
|
||||
}
|
||||
|
||||
.header-dashboard{
|
||||
float: left;
|
||||
margin: 18px 0;
|
||||
}
|
||||
.clear{
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.well{
|
||||
background-color: #3d4047;
|
||||
border-radius: 0;
|
||||
color:#fff;
|
||||
border:0;
|
||||
box-shadow:none;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
|
||||
.btn-success{
|
||||
background-color: #1fbc99;
|
||||
border-color: #0b9778;
|
||||
border-radius: 2px;
|
||||
margin-right: 16px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
.btn-success:hover, .btn-success:active, .btn-success:focus{
|
||||
background-color: #0b9778;
|
||||
border-color: #0b9778;
|
||||
}
|
||||
|
||||
.form-control{
|
||||
width: 100px;
|
||||
margin: 11px 17px 0 0;
|
||||
}
|
||||
|
||||
.dashboard-right h5{
|
||||
margin: 20px 12px 0 0;
|
||||
}
|
||||
|
||||
/*title panel ends*/
|
||||
|
||||
.panel-primary{
|
||||
border-color: #ddd;
|
||||
}
|
||||
|
||||
.panel-primary a{
|
||||
color: #606368;
|
||||
}
|
||||
|
||||
.panel-primary a:hover{
|
||||
color: #3397e1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.panel{
|
||||
box-shadow:none;
|
||||
}
|
||||
|
||||
.panel a{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.indicators .panel-heading{
|
||||
min-height: 115px;
|
||||
}
|
||||
|
||||
.indicators{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.panel-green:hover, .panel-red:hover, .panel-yellow:hover, .panel-primary:hover{
|
||||
box-shadow:0px 3px 2px #dfdfdf;
|
||||
}
|
||||
|
||||
.small{
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.smallB{
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.panel-footer{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.panel-active{
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.panel-active:after, .panel-active:before {
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.panel-active:after {
|
||||
border-color: rgba(136, 183, 213, 0);
|
||||
border-top-color: #fff;
|
||||
border-width: 20px;
|
||||
margin-left: -20px;
|
||||
}
|
||||
.panel-active:before {
|
||||
border-color: rgba(194, 225, 245, 0);
|
||||
border-top-color: #ddd;
|
||||
border-width: 21px;
|
||||
margin-left: -21px;
|
||||
}
|
||||
|
||||
.progress{
|
||||
height: 115px;
|
||||
margin-bottom: 0;
|
||||
|
||||
}
|
||||
|
||||
.progress-bar{
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.progress-dark-base{
|
||||
background-color: #ddd;
|
||||
border-radius: 0;
|
||||
margin-top: -115px;
|
||||
}
|
||||
|
||||
.panel .text-right, .small{
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.panel-red .panel-heading, .panel-primary .panel-heading{
|
||||
color:rgba(0,0,0,0.4) !important;
|
||||
}
|
||||
|
||||
.panel-yellow .progress-bar{
|
||||
background: #fcb322;
|
||||
}
|
||||
|
||||
.process-div{
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
margin-top: 10px;
|
||||
padding:0;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
.process-div .panel-heading{
|
||||
color:#606368;
|
||||
}
|
||||
|
||||
.process-div .panel-heading a{
|
||||
color: #606368;
|
||||
}
|
||||
|
||||
.process-div .small{
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/*.process-div .breadcrumb{*/
|
||||
.breadcrumb{
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.breadcrumb>li+li:before{
|
||||
color: rgba(0,0,0, 2);
|
||||
}
|
||||
|
||||
.red{
|
||||
color:#e14333 !important;
|
||||
}
|
||||
|
||||
.green{
|
||||
color:#1fbc99 !important;
|
||||
}
|
||||
|
||||
.yellow{
|
||||
color:#fcb322 !important;
|
||||
}
|
||||
|
||||
.blue{
|
||||
color:#337AB8 !important;
|
||||
}
|
||||
|
||||
.grey{
|
||||
color:#606368 !important;
|
||||
}
|
||||
|
||||
.redbg{
|
||||
/*background:#e14333 !important;*/
|
||||
border-color: #e14333;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.greenbg{
|
||||
/*background:#1fbc99 !important;*/
|
||||
border-color: #1fbc99;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.yellowbg{
|
||||
/*background:#fcb322 !important;*/
|
||||
border-color: #fcb322;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bluebg{
|
||||
/*background:#337ab7 !important;*/
|
||||
border-color: #337ab7;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.greybg{
|
||||
background:#606368 !important;
|
||||
}
|
||||
|
||||
.vcenter {
|
||||
margin: 7% 0;
|
||||
}
|
||||
|
||||
.vcenter-task {
|
||||
margin: 2% 0;
|
||||
}
|
||||
|
||||
.border-left-light{
|
||||
border-left:1px solid rgba(255,255,255, 0.5);
|
||||
}
|
||||
|
||||
.border-left-dark{
|
||||
border-left:1px solid rgba(0,0,0, 0.2);
|
||||
}
|
||||
|
||||
.process-button{
|
||||
border:1px solid #dadada;
|
||||
display:inherit;
|
||||
height:83px;
|
||||
padding: 13px;
|
||||
}
|
||||
|
||||
.process-button .small{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.process-button .blue{
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.process-button:hover .blue, .process-button:hover, .process-button:hover .grey{
|
||||
background: #337AB8;
|
||||
color:#fff !important;
|
||||
}
|
||||
|
||||
.arrow{
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.title-process{
|
||||
margin-top:15px;
|
||||
}
|
||||
|
||||
.btn-group .btn-success{
|
||||
margin: 20px 0 0 0;
|
||||
}
|
||||
|
||||
.selected .fa-star{
|
||||
color: #fcb322 !important;
|
||||
}
|
||||
|
||||
.selected .btn-success{
|
||||
background-color: #007E62;
|
||||
}
|
||||
|
||||
.well .btn-group{
|
||||
margin: 0 15px 0 0;
|
||||
}
|
||||
|
||||
.bottom{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
BIN
workflow/public_html/fonts/fontawesome-webfont.woff
Normal file
BIN
workflow/public_html/fonts/fontawesome-webfont.woff
Normal file
Binary file not shown.
BIN
workflow/public_html/images/scrolldown.gif
Normal file
BIN
workflow/public_html/images/scrolldown.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
Reference in New Issue
Block a user