// console workaround
if (console == undefined)
{
var console = function()
{
this.log = function(msg)
{
//
}
}
}
function SystemCore()
{
}
SystemCore.language = "";
SystemCore.BASE_URL = "http://www.fdfa.ro/";
SystemCore.LIB_URL = "http://www.fdfa.ro/eob-libs/";
SystemCore.FILES_URL = "http://www.fdfa.ro/files_/";
SystemCore.MODULES_PATH = SystemCore.LIB_URL + "com/sds/eob/Modules/";
SystemCore.MODULES_GATEWAY = SystemCore.BASE_URL + "moduleGateway.php";
SystemCore.ADAPTERS_GATEWAY = SystemCore.BASE_URL + "adaptersGateway.php";
SystemCore.JS_LIB = SystemCore.BASE_URL + "";
SystemCore.USER_ID = "";
SystemCore.KEEP_ALIVE_TIME = 10000;
SystemCore.TITAN_GATEWAY = "http://www.fdfa.ro/galileo/Application ERP2/jqueryGateway.php";
function isEmptyObject(obj) {
for(var prop in obj) {
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
return false;
}
}
return true;
}
function objectLength(obj)
{
var nr=0;
for(var prop in obj)
{
if (Object.prototype.hasOwnProperty.call(obj, prop))
{
nr++;
}
}
return nr;
}
function fillFormWithArray(form, data, completeHandler)
{
$.each(data, function(key, value){
for (var i=0;i
0)
{
var first = value[0];
var j = 0;
if (first.hasOwnProperty("name"))
{
$this.children().remove();
for (j=0;j'+value[j]['name']+'');
}
}
}
else
{
$this.val(value);
}
break;
case 'checkbox':
case 'radio':
$this.attr("checked",(parseInt(value) > 0 ? "checked" : null));
break;
default:
$this.val(value);
break;
}
}
$this.trigger("keyup");
$this.trigger("change");
}
});
if (completeHandler != undefined)
{
completeHandler();
}
}
function ColorUtils()
{
}
ColorUtils.getFontColorForBackground = function(bgHex)
{
if (bgHex.indexOf('#') === 0)
{
bgHex = bgHex.substr(1,10);
}
res = parseInt(bgHex, 16);
if (res < 7368816)
{
color = "#ffffff";
}
else
{
color = "#000000";
}
return color;
}
/**
* Get instances as containers
*/
SystemCore.instances = {};
SystemCore.getInstances = function()
{
var rez = $("div[id^=inst_]");
var key = '';
var obj;
for(var i=0; i';
this.tpl;
this.activePage = 0;
this.tpl = $.template(this.templateName,this.tplWrapper);
this.setTotal = function(total,perPage)
{
this.total = total;
this.perPage = perPage ? perPage : 30;
this.totalPages = Math.ceil(this.total / this.perPage);
}
this.clearTemplate = function()
{
$(this.container).empty();
}
this.render = function(activePage)
{
// tplPaginationPlaceHolder
if (!this.tpl)
{
this.tpl = $.template(this.templateName,this.tplRow);
}
var pages = [];
this.activePage = activePage>=0 ? activePage : 0;
var obj = {};
for(var i=0; i');
$(this.container).append('');
//console.log($(this.container));
}
this.registerField = function(name,servicePath,params,encodeToJSON)
{
var paramsStr = params.join(",");
var fieldStr = '';
fieldStr += '';
fieldStr += '';
fieldStr += '';
$(this.container).append(fieldStr);
}
this.setParams = function(fieldName,params)
{
var paramsStr = params.join(",");
$(this.container + " [name="+fieldName+"Params]").val(paramsStr);
}
}
/**
* Load an array of .js and execute the callback function
* When all scripts 100% loaded
*
* @return
*/
function Includes()
{
}
Includes.scriptStack = {}
Includes.loadedCounter = 0;
Includes.len = 0;
//Includes.handler;
Includes.load = function(scripts, handler, errorHandler, forceLoading)
{
Includes.len = scripts.length;
Includes.handler = handler;
var scripts = scripts;
var concatChar = "?";
Includes.loadedCounter = 0;
for (var i=0; i