var IDTMFORMAT = bc_idtmformat;
var IDTMSEP = bc_idtmsep;
var timeTest;
if(IDTMFORMAT.indexOf('HH') != -1) {
timeTest = /^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/i;
}
else {
timeTest = /^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/i;
}
Ext.form.VTypes["time"] = function(val, field) {
return timeTest.test(val);
};
Ext.form.VTypes["timeText"] = '¡Hora inválida!';
Ext.UpdateManager.defaults.indicatorText = '
Procesando...
';
if(Ext.View){
Ext.View.prototype.emptyText = "";
}
if(Ext.grid.GridPanel){
Ext.grid.GridPanel.prototype.ddText = "{0} línea(s) seleccionada(s)";
}
if(Ext.TabPanelItem){
Ext.TabPanelItem.prototype.closeText = "Cerrar Solapa";
}
if(Ext.form.Field){
Ext.form.Field.prototype.invalidText = "Valor incorrecto.";
}
if(Ext.LoadMask){
Ext.LoadMask.prototype.msg = "Procesando...";
}
Date.monthNames = [
"Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agosto",
"Septiembre",
"Octubre",
"Noviembre",
"Diciembre"
];
Date.getShortMonthName = function(month) {
return Date.monthNames[month].substring(0, 3);
};
Date.monthNumbers = {
Jan : 0,
Feb : 1,
Mar : 2,
Apr : 3,
May : 4,
Jun : 5,
Jul : 6,
Aug : 7,
Sep : 8,
Oct : 9,
Nov : 10,
Dec : 11
};
Date.getMonthNumber = function(name) {
return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
};
Date.dayNames = [
"Domingo",
"Lunes",
"Martes",
"Miércoles",
"Jueves",
"Viernes",
"Sábado"
];
Date.getShortDayName = function(day) {
return Date.dayNames[day].substring(0, 3);
};
if(Ext.MessageBox){
Ext.MessageBox.buttonText = {
ok : "OK",
cancel : "Cancelar",
yes : "Sí",
no : "No"
};
}
if(Ext.util.Format){
Ext.util.Format.date = function(v, format){
if(!v) return "";
if(!(v instanceof Date)) v = new Date(Date.parse(v));
return v.dateFormat(format || "m/d/Y");
};
Ext.util.Format.brMoney = function(v){
v = (Math.round((v - 0) * 100)) / 100;
v = (v == Math.floor(v)) ? v + ".00" : ((v * 10 == Math.floor(v * 10)) ? v + "0" : v);
v = String(v);
var ps = v.split('.');
var whole = ps[0];
var sub = ps[1] ? bc_idcrdecimalsep + ps[1] : bc_idcrdecimalsep + '00';
var r = /(\d+)(\d{3})/;
while (r.test(whole)) {
whole = whole.replace(r, '$1' + '' + '$2');
}
v = whole + sub;
var IDCURRENCY = bc_idcurrency;
if (v.charAt(0) == '-') {
var FGCRNEGATIVEFORMAT = bc_fgcrnegativeformat;
var retu;
if(FGCRNEGATIVEFORMAT == '0') {
retu = '('+IDCURRENCY+v.substr(1)+')';
}
else if(FGCRNEGATIVEFORMAT == '1') {
retu = '-'+IDCURRENCY+v.substr(1);
}
else if(FGCRNEGATIVEFORMAT == '2') {
retu = IDCURRENCY+'-'+v.substr(1);
}
else if(FGCRNEGATIVEFORMAT == '3') {
retu = IDCURRENCY+v.substr(1)+'-';
}
else if(FGCRNEGATIVEFORMAT == '4') {
retu = '('+v.substr(1)+IDCURRENCY+')';
}
else if(FGCRNEGATIVEFORMAT == '5') {
retu = '-'+v.substr(1)+IDCURRENCY;
}
else if(FGCRNEGATIVEFORMAT == '6') {
retu = v.substr(1)+'-'+IDCURRENCY;
}
else if(FGCRNEGATIVEFORMAT == '7') {
retu = v.substr(1)+IDCURRENCY+'-';
}
else if(FGCRNEGATIVEFORMAT == '8') {
retu = '-'+v.substr(1)+' '+IDCURRENCY;
}
else if(FGCRNEGATIVEFORMAT == '9') {
retu = '-'+IDCURRENCY+' '+v.substr(1);
}
else if(FGCRNEGATIVEFORMAT == '10') {
retu = v.substr(1)+' '+IDCURRENCY+'-';
}
else if(FGCRNEGATIVEFORMAT == '11') {
retu = IDCURRENCY+' '+v.substr(1)+'-';
}
else if(FGCRNEGATIVEFORMAT == '12') {
retu = IDCURRENCY+' -'+v.substr(1);
}
else if(FGCRNEGATIVEFORMAT == '13') {
retu = IDCURRENCY+'- '+v.substr(1);
}
else if(FGCRNEGATIVEFORMAT == '14') {
retu = '('+IDCURRENCY+' '+v.substr(1)+')';
}
else if(FGCRNEGATIVEFORMAT == '15') {
retu = '('+v.substr(1)+' '+IDCURRENCY+')';
}
return retu;
//return '- R$ ' + v.substr(1);
}
else {
var FGCRNEGATIVEFORMAT = bc_fgcrpositiveformat;
var retu;
if(FGCRNEGATIVEFORMAT == '0') {
retu = IDCURRENCY+v;
}
else if(FGCRNEGATIVEFORMAT == '1') {
retu = v+IDCURRENCY;
}
if(FGCRNEGATIVEFORMAT == '2') {
retu = IDCURRENCY+' '+v;
}
if(FGCRNEGATIVEFORMAT == '3') {
retu = v+' '+IDCURRENCY;
}
return retu;
}
return "R$ " + v;
}
}
if(Ext.DatePicker){
Ext.apply(Ext.DatePicker.prototype, {
todayText : "Hoy",
minText : "Esta fecha es anterior a la menor fecha",
maxText : "Esta fecha es posterior a la mayor fecha",
disabledDaysText : "",
disabledDatesText : "",
monthNames : Date.monthNames,
dayNames : Date.dayNames,
nextText : 'Próximo mes (Control+Directa)',
prevText : 'Mes anterior (Control+Izquierda)',
monthYearText : 'Eliga un mes (Control+Arriba/Abajo para mover entre los años)',
todayTip : "{0} (Espacio)",
format : "d/m/Y",
okText : " Ok ",
cancelText : "Cancelar",
startDay : 0
});
}
if(Ext.PagingToolbar){
Ext.apply(Ext.PagingToolbar.prototype, {
beforePageText : "Página",
afterPageText : "de {0}",
firstText : "Primera página",
prevText : "Página anterior",
nextText : "Próxima página",
lastText : "Última página",
refreshText : "Recargar",
displayMsg : "{0} a {1} de {2} registro(s)",
emptyMsg : 'No se encontraron registros'
});
}
if(Ext.form.TextField){
Ext.apply(Ext.form.TextField.prototype, {
minLengthText : "El tamaño mínimo para este campo es {0}",
maxLengthText : "El tamaño máximo para este campo es {0}",
blankText : "Campo obligatorio",
regexText : "",
emptyText : null
});
}
if(Ext.form.NumberField){
Ext.apply(Ext.form.NumberField.prototype, {
minText : "El valor mínimo para este campo es {0}",
maxText : "El valor máximo para este campo es {0}",
nanText : "{0} no es un número válido",
decimalPrecision: bc_nrnbdecimaldigits,
decimalSeparator: bc_idnbdecimalsep
});
}
if(Ext.form.DateField){
Ext.apply(Ext.form.DateField.prototype, {
disabledDaysText : "Deshabilitado",
disabledDatesText : "Deshabilitado",
minText : "La fecha de este campo debe ser posterior a {0}",
maxText : "La fecha de este campo debe ser anterior a {0}",
invalidText : "{0} no es una fecha válida - hay que informar en el formato {1}",
format : "d/m/Y",
altFormats : "d/m/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d"
});
}
if(Ext.form.TimeField){
Ext.apply(Ext.form.TimeField.prototype, {
invalidText : "{0} no es una fecha válida - hay que informar en el formato {1}",
format : "",
altFormats : ""
});
}
if(Ext.form.ComboBox){
Ext.apply(Ext.form.ComboBox.prototype, {
loadingText : "Procesando...",
valueNotFoundText : undefined
});
}
if(Ext.form.VTypes){
Ext.apply(Ext.form.VTypes, {
emailText : 'Este campo debe ser una dirección de e-mail válida, en el formato `usuario@dominio.com.br`',
urlText : 'Este campo debe ser una URL',
alphaText : 'Este campo debe contener apenas letras y _',
alphanumText : 'Este campo debe contener apenas letras, números y _'
});
}
if(Ext.form.HtmlEditor){
Ext.apply(Ext.form.HtmlEditor.prototype, {
createLinkText : 'Please enter the URL for the link:',
buttonTips : {
bold : {
title: 'Bold (Ctrl+B)',
text: 'Make the selected text bold.',
cls: 'x-html-editor-tip'
},
italic : {
title: 'Italic (Ctrl+I)',
text: 'Make the selected text italic.',
cls: 'x-html-editor-tip'
},
underline : {
title: 'Underline (Ctrl+U)',
text: 'Underline the selected text.',
cls: 'x-html-editor-tip'
},
increasefontsize : {
title: 'Grow Text',
text: 'Increase the font size.',
cls: 'x-html-editor-tip'
},
decreasefontsize : {
title: 'Shrink Text',
text: 'Decrease the font size.',
cls: 'x-html-editor-tip'
},
backcolor : {
title: 'Text Highlight Color',
text: 'Change the background color of the selected text.',
cls: 'x-html-editor-tip'
},
forecolor : {
title: 'Font Color',
text: 'Change the color of the selected text.',
cls: 'x-html-editor-tip'
},
justifyleft : {
title: 'Align Text Left',
text: 'Align text to the left.',
cls: 'x-html-editor-tip'
},
justifycenter : {
title: 'Center Text',
text: 'Center text in the editor.',
cls: 'x-html-editor-tip'
},
justifyright : {
title: 'Align Text Right',
text: 'Align text to the right.',
cls: 'x-html-editor-tip'
},
insertunorderedlist : {
title: 'Bullet List',
text: 'Start a bulleted list.',
cls: 'x-html-editor-tip'
},
insertorderedlist : {
title: 'Numbered List',
text: 'Start a numbered list.',
cls: 'x-html-editor-tip'
},
createlink : {
title: 'Hyperlink',
text: 'Make the selected text a hyperlink.',
cls: 'x-html-editor-tip'
},
sourceedit : {
title: 'Source Edit',
text: 'Switch to source editing mode.',
cls: 'x-html-editor-tip'
}
}
});
}
if(Ext.grid.GridView){
Ext.apply(Ext.grid.GridView.prototype, {
sortAscText : "Orden ascendente",
sortDescText : "Orden descendente",
lockText : "Bloquear columna",
unlockText : "Desbloquear columna",
columnsText : "Columnas"
});
}
if(Ext.grid.GroupingView){
Ext.apply(Ext.grid.GroupingView.prototype, {
emptyGroupText : "(ninguno)",
groupByText : "Agrupar por este campo",
showGroupsText : "Exhibir agrupado"
});
}
if(Ext.grid.PropertyColumnModel){
Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
nameText : "Nombre",
valueText : "Valor",
dateFormat : "d/m/Y"
});
}
if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){
Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
splitTip : "Arrastre para redimensionar",
collapsibleSplitTip : "Arrastre para redimensionar. Doble clic para esconder."
});
}