Compare commits
4 Commits
v21.0.0.OS
...
v21.1.0.OS
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86c572bdd1 | ||
|
|
a0db9da5f4 | ||
|
|
afc069afaa | ||
|
|
a0d77cb944 |
2624
api/Base.js
2624
api/Base.js
File diff suppressed because it is too large
Load Diff
@@ -16,269 +16,265 @@ along with Ice Framework. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ValidationRules = {
|
ValidationRules = {
|
||||||
|
|
||||||
float: function (str) {
|
float: function (str) {
|
||||||
var floatstr = /^[-+]?[0-9]+(\.[0-9]+)?$/;
|
var floatstr = /^[-+]?[0-9]+(\.[0-9]+)?$/;
|
||||||
if (str != null && str.match(floatstr)) {
|
if (str != null && str.match(floatstr)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
number: function (str) {
|
number: function (str) {
|
||||||
var numstr = /^[0-9]+$/;
|
var numstr = /^[0-9]+$/;
|
||||||
if (str != null && str.match(numstr)) {
|
if (str != null && str.match(numstr)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
numberOrEmpty: function (str) {
|
numberOrEmpty: function (str) {
|
||||||
if(str == ""){
|
if(str == ""){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var numstr = /^[0-9]+$/;
|
var numstr = /^[0-9]+$/;
|
||||||
if (str != null && str.match(numstr)) {
|
if (str != null && str.match(numstr)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
email: function (str) {
|
email: function (str) {
|
||||||
var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
|
var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
|
||||||
return str != null && emailPattern.test(str);
|
return str != null && emailPattern.test(str);
|
||||||
},
|
},
|
||||||
|
|
||||||
emailOrEmpty: function (str) {
|
emailOrEmpty: function (str) {
|
||||||
if(str == ""){
|
if(str == ""){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
|
var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
|
||||||
return str != null && emailPattern.test(str);
|
return str != null && emailPattern.test(str);
|
||||||
},
|
},
|
||||||
|
|
||||||
username: function (str) {
|
username: function (str) {
|
||||||
var username = /^[a-zA-Z0-9\.-]+$/;
|
var username = /^[a-zA-Z0-9\.-]+$/;
|
||||||
return str != null && username.test(str);
|
return str != null && username.test(str);
|
||||||
},
|
},
|
||||||
|
|
||||||
input: function (str) {
|
input: function (str) {
|
||||||
if (str != null && str.length > 0) {
|
if (str != null && str.length > 0) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function FormValidation(formId,validateAll,options) {
|
function FormValidation(formId,validateAll,options) {
|
||||||
this.tempOptions = {};
|
this.tempOptions = {};
|
||||||
this.formId = formId;
|
this.formId = formId;
|
||||||
this.formError = false;
|
this.formError = false;
|
||||||
this.formObject = null;
|
this.formObject = null;
|
||||||
this.errorMessages = "";
|
this.errorMessages = "";
|
||||||
this.popupDialog = null;
|
this.popupDialog = null;
|
||||||
this.validateAll = validateAll;
|
this.validateAll = validateAll;
|
||||||
this.errorMap = new Array();
|
this.errorMap = new Array();
|
||||||
|
|
||||||
this.settings = {"thirdPartyPopup":null,"LabelErrorClass":false, "ShowPopup":true};
|
|
||||||
|
|
||||||
this.settings = jQuery.extend(this.settings,options);
|
|
||||||
|
|
||||||
this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload" ,"signature");
|
|
||||||
|
|
||||||
this.validator = ValidationRules;
|
this.settings = {"thirdPartyPopup":null,"LabelErrorClass":false, "ShowPopup":true};
|
||||||
|
|
||||||
|
this.settings = jQuery.extend(this.settings,options);
|
||||||
|
|
||||||
|
this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload" ,"signature");
|
||||||
|
|
||||||
|
this.validator = ValidationRules;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FormValidation.method('clearError' , function(formInput, overrideMessage) {
|
FormValidation.method('clearError' , function(formInput, overrideMessage) {
|
||||||
var id = formInput.attr("id");
|
var id = formInput.attr("id");
|
||||||
$('#'+ this.formId +' #field_'+id).removeClass('error');
|
$('#'+ this.formId +' #field_'+id).removeClass('error');
|
||||||
$('#'+ this.formId +' #help_'+id).html('');
|
$('#'+ this.formId +' #help_'+id).html('');
|
||||||
});
|
});
|
||||||
|
|
||||||
FormValidation.method('addError' , function(formInput, overrideMessage) {
|
|
||||||
this.formError = true;
|
|
||||||
if(formInput.attr("message") != null) {
|
|
||||||
this.errorMessages += (formInput.attr("message") + "\n");
|
|
||||||
this.errorMap[formInput.attr("name")] = formInput.attr("message");
|
|
||||||
}else{
|
|
||||||
this.errorMap[formInput.attr("name")] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
var id = formInput.attr("id");
|
FormValidation.method('addError' , function(formInput, overrideMessage) {
|
||||||
var validation = formInput.attr("validation");
|
this.formError = true;
|
||||||
var message = formInput.attr("validation");
|
if(formInput.attr("message") != null) {
|
||||||
$('#'+ this.formId +' #field_'+id).addClass('error');
|
this.errorMessages += (formInput.attr("message") + "\n");
|
||||||
if(message == undefined || message == null || message == ""){
|
this.errorMap[formInput.attr("name")] = formInput.attr("message");
|
||||||
$('#'+ this.formId +' #help_'+id).html(message);
|
}else{
|
||||||
}else{
|
this.errorMap[formInput.attr("name")] = "";
|
||||||
if(validation == undefined || validation == null || validation == ""){
|
}
|
||||||
$('#'+ this.formId +' #help_'+id).html("Required");
|
|
||||||
}else{
|
var id = formInput.attr("id");
|
||||||
if(validation == "float" || validation == "number"){
|
var validation = formInput.attr("validation");
|
||||||
$('#'+ this.formId +' #help_'+id).html("Number required");
|
var message = formInput.attr("validation");
|
||||||
}else if(validation == "email"){
|
$('#'+ this.formId +' #field_'+id).addClass('error');
|
||||||
$('#'+ this.formId +' #help_'+id).html("Email required");
|
if(message == undefined || message == null || message == ""){
|
||||||
}else{
|
$('#'+ this.formId +' #help_err_'+id).html(message);
|
||||||
$('#'+ this.formId +' #help_'+id).html("Required");
|
}else{
|
||||||
}
|
if(validation == undefined || validation == null || validation == ""){
|
||||||
}
|
$('#'+ this.formId +' #help_err_'+id).html("Required");
|
||||||
}
|
}else{
|
||||||
|
if(validation == "float" || validation == "number"){
|
||||||
|
$('#'+ this.formId +' #help_err_'+id).html("Number required");
|
||||||
|
}else if(validation == "email"){
|
||||||
|
$('#'+ this.formId +' #help_err_'+id).html("Email required");
|
||||||
|
}else{
|
||||||
|
$('#'+ this.formId +' #help_err_'+id).html("Required");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
FormValidation.method('showErrors' , function() {
|
FormValidation.method('showErrors' , function() {
|
||||||
if(this.formError) {
|
if(this.formError) {
|
||||||
if(this.settings['thirdPartyPopup'] != undefined && this.settings['thirdPartyPopup'] != null){
|
if(this.settings['thirdPartyPopup'] != undefined && this.settings['thirdPartyPopup'] != null){
|
||||||
this.settings['thirdPartyPopup'].alert();
|
this.settings['thirdPartyPopup'].alert();
|
||||||
}else{
|
}else{
|
||||||
if(this.settings['ShowPopup'] == true){
|
if(this.settings['ShowPopup'] == true){
|
||||||
if(this.tempOptions['popupTop'] != undefined && this.tempOptions['popupTop'] != null){
|
if(this.tempOptions['popupTop'] != undefined && this.tempOptions['popupTop'] != null){
|
||||||
this.alert("Errors Found",this.errorMessages,this.tempOptions['popupTop']);
|
this.alert("Errors Found",this.errorMessages,this.tempOptions['popupTop']);
|
||||||
}else{
|
}else{
|
||||||
this.alert("Errors Found",this.errorMessages,-1);
|
this.alert("Errors Found",this.errorMessages,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
FormValidation.method('checkValues' , function(options) {
|
FormValidation.method('checkValues' , function(options) {
|
||||||
this.tempOptions = options;
|
this.tempOptions = options;
|
||||||
var that = this;
|
var that = this;
|
||||||
this.formError = false;
|
this.formError = false;
|
||||||
this.errorMessages = "";
|
this.errorMessages = "";
|
||||||
this.formObject = new Object();
|
this.formObject = new Object();
|
||||||
var validate = function (inputObject) {
|
var validate = function (inputObject) {
|
||||||
if(that.settings['LabelErrorClass'] != false){
|
if(that.settings['LabelErrorClass'] != false){
|
||||||
$("label[for='" + name + "']").removeClass(that.settings['LabelErrorClass']);
|
$("label[for='" + name + "']").removeClass(that.settings['LabelErrorClass']);
|
||||||
}
|
}
|
||||||
var id = inputObject.attr("id");
|
var id = inputObject.attr("id");
|
||||||
var name = inputObject.attr("name");
|
var name = inputObject.attr("name");
|
||||||
var type = inputObject.attr("type");
|
var type = inputObject.attr("type");
|
||||||
|
|
||||||
if(inputObject.hasClass('select2-focusser') || inputObject.hasClass('select2-input')){
|
if(inputObject.hasClass('select2-focusser') || inputObject.hasClass('select2-input')){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(jQuery.inArray(type, that.inputTypes ) >= 0) {
|
if(jQuery.inArray(type, that.inputTypes ) >= 0) {
|
||||||
if(inputObject.hasClass('uploadInput')){
|
if(inputObject.hasClass('uploadInput')){
|
||||||
inputValue = inputObject.attr("val");
|
inputValue = inputObject.attr("val");
|
||||||
//}else if(inputObject.hasClass('datetimeInput')){
|
//}else if(inputObject.hasClass('datetimeInput')){
|
||||||
//inputValue = inputObject.getDate()+":00";
|
//inputValue = inputObject.getDate()+":00";
|
||||||
}else{
|
}else{
|
||||||
//inputValue = (type == "radio" || type == "checkbox")?$("input[name='" + name + "']:checked").val():inputObject.val();
|
//inputValue = (type == "radio" || type == "checkbox")?$("input[name='" + name + "']:checked").val():inputObject.val();
|
||||||
|
|
||||||
inputValue = null;
|
inputValue = null;
|
||||||
if(type == "radio" || type == "checkbox"){
|
if(type == "radio" || type == "checkbox"){
|
||||||
inputValue = $("input[name='" + name + "']:checked").val();
|
inputValue = $("input[name='" + name + "']:checked").val();
|
||||||
}else if(inputObject.hasClass('select2Field')){
|
}else if(inputObject.hasClass('select2Field')){
|
||||||
if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
|
if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
|
||||||
inputValue = $('#'+id).select2('data').id;
|
inputValue = $('#'+id).select2('data').id;
|
||||||
}else{
|
}else{
|
||||||
inputValue = "";
|
inputValue = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(inputObject.hasClass('select2Multi')){
|
}else if(inputObject.hasClass('select2Multi')){
|
||||||
if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
|
if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
|
||||||
inputValueObjects = $('#'+id).select2('data');
|
inputValueObjects = $('#'+id).select2('data');
|
||||||
inputValue = [];
|
inputValue = [];
|
||||||
for(var i=0;i<inputValueObjects.length;i++){
|
for(var i=0;i<inputValueObjects.length;i++){
|
||||||
inputValue.push(inputValueObjects[i].id);
|
inputValue.push(inputValueObjects[i].id);
|
||||||
}
|
}
|
||||||
inputValue = JSON.stringify(inputValue);
|
inputValue = JSON.stringify(inputValue);
|
||||||
}else{
|
}else{
|
||||||
inputValue = "";
|
inputValue = "";
|
||||||
}
|
}
|
||||||
}else if(inputObject.hasClass('signatureField')){
|
}else if(inputObject.hasClass('signatureField')){
|
||||||
if($('#'+id).data('signaturePad').isEmpty()){
|
if($('#'+id).data('signaturePad').isEmpty()){
|
||||||
inputValue = '';
|
inputValue = '';
|
||||||
}else{
|
}else{
|
||||||
inputValue = $('#'+id).data('signaturePad').toDataURL();
|
inputValue = $('#'+id).data('signaturePad').toDataURL();
|
||||||
}
|
}
|
||||||
}else if(inputObject.hasClass('simplemde')){
|
}else if(inputObject.hasClass('simplemde')){
|
||||||
inputValue = $('#'+id).data('simplemde').value();
|
inputValue = $('#'+id).data('simplemde').value();
|
||||||
|
|
||||||
}else if(inputObject.hasClass('tinymce')){
|
}else if(inputObject.hasClass('tinymce')){
|
||||||
inputValue = tinyMCE.get(id).getContent({format : 'raw'});
|
inputValue = tinyMCE.get(id).getContent({format : 'raw'});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
inputValue = inputObject.val();
|
inputValue = inputObject.val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var validation = inputObject.attr('validation');
|
|
||||||
var valid = false;
|
|
||||||
|
|
||||||
if(validation != undefined && validation != null && that.validator[validation] != undefined && that.validator[validation] != null){
|
|
||||||
valid = that.validator[validation](inputValue);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
|
|
||||||
if(that.validateAll){
|
var validation = inputObject.attr('validation');
|
||||||
if(validation != undefined && validation != null && validation == "none"){
|
var valid = false;
|
||||||
valid = true;
|
|
||||||
}else{
|
|
||||||
valid = that.validator['input'](inputValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
|
||||||
valid = true;
|
|
||||||
}
|
|
||||||
$(that.formObject).attr(id,inputValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!valid) {
|
|
||||||
that.addError(inputObject, null);
|
|
||||||
}else{
|
|
||||||
that.clearError(inputObject, null);
|
|
||||||
$(that.formObject).attr(id,inputValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
var inputs = $('#'+ this.formId + " :input");
|
if(validation != undefined && validation != null && that.validator[validation] != undefined && that.validator[validation] != null){
|
||||||
|
valid = that.validator[validation](inputValue);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
if(that.validateAll){
|
||||||
|
if(validation != undefined && validation != null && validation == "none"){
|
||||||
|
valid = true;
|
||||||
|
}else{
|
||||||
|
valid = that.validator['input'](inputValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
$(that.formObject).attr(id,inputValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!valid) {
|
||||||
|
that.addError(inputObject, null);
|
||||||
|
}else{
|
||||||
|
that.clearError(inputObject, null);
|
||||||
|
$(that.formObject).attr(id,inputValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
var inputs = $('#'+ this.formId + " :input");
|
||||||
inputs.each(function() {
|
inputs.each(function() {
|
||||||
var that = $(this);
|
var that = $(this);
|
||||||
validate(that);
|
validate(that);
|
||||||
});
|
});
|
||||||
|
|
||||||
inputs = $('#'+ this.formId + " .uploadInput");
|
inputs = $('#'+ this.formId + " .uploadInput");
|
||||||
inputs.each(function() {
|
inputs.each(function() {
|
||||||
var that = $(this);
|
var that = $(this);
|
||||||
validate(that);
|
validate(that);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.showErrors();
|
this.showErrors();
|
||||||
this.tempOptions = {};
|
this.tempOptions = {};
|
||||||
return !this.formError;
|
return !this.formError;
|
||||||
});
|
});
|
||||||
|
|
||||||
FormValidation.method('getFormParameters' , function() {
|
FormValidation.method('getFormParameters' , function() {
|
||||||
return this.formObject;
|
return this.formObject;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
FormValidation.method('alert', function (title,text,top) {
|
FormValidation.method('alert', function (title,text,top) {
|
||||||
alert(text);
|
alert(text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -714,4 +714,23 @@ table.dataTable{
|
|||||||
|
|
||||||
.small-box{
|
.small-box{
|
||||||
box-shadow: 0 2px 5px 0 rgba(0,0,0,.12), 0 2px 10px 0 rgba(0,0,0,.09);
|
box-shadow: 0 2px 5px 0 rgba(0,0,0,.12), 0 2px 10px 0 rgba(0,0,0,.09);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.help-info{
|
||||||
|
font-size: 25px;
|
||||||
|
color: #367fa9;
|
||||||
|
padding-top: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ice-form-error {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ice-form-error-control {
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Language: English\n"
|
|
||||||
"Language-Team: IceHrm\n"
|
|
||||||
"Last-Translator: Thilina Hasantha\n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Project-Id-Version: 18.0\n"
|
|
||||||
"Report-Msgid-Bugs-To: https://icehrm.com\n"
|
|
||||||
556
lang/de.po
556
lang/de.po
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
|||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Language: English\n"
|
|
||||||
"Language-Team: IceHrm\n"
|
|
||||||
"Last-Translator: Thilina Hasantha\n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Project-Id-Version: 18.0\n"
|
|
||||||
"Report-Msgid-Bugs-To: https://icehrm.com\n"
|
|
||||||
19
lang/en.po
19
lang/en.po
@@ -1,13 +1,15 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Language: English\n"
|
|
||||||
"Language-Team: IceHrm\n"
|
|
||||||
"Last-Translator: Thilina Hasantha\n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Project-Id-Version: 18.0\n"
|
"Project-Id-Version: 18.0\n"
|
||||||
"Report-Msgid-Bugs-To: https://icehrm.com\n"
|
"Report-Msgid-Bugs-To: https://icehrm.com\n"
|
||||||
|
"Last-Translator: Thilina Hasantha\n"
|
||||||
|
"Language-Team: IceHrm\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
|
||||||
|
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
|
||||||
|
"Language: English\n"
|
||||||
|
|
||||||
msgid "Save"
|
msgid "Save"
|
||||||
msgstr "Save"
|
msgstr "Save"
|
||||||
@@ -1566,9 +1568,6 @@ msgstr "Loans Taken"
|
|||||||
msgid "Change Leave Status"
|
msgid "Change Leave Status"
|
||||||
msgstr "Change Leave Status"
|
msgstr "Change Leave Status"
|
||||||
|
|
||||||
msgid "Leave Status"
|
|
||||||
msgstr "Leave Status"
|
|
||||||
|
|
||||||
msgid "Status Change Note"
|
msgid "Status Change Note"
|
||||||
msgstr "Status Change Note"
|
msgstr "Status Change Note"
|
||||||
|
|
||||||
@@ -1598,5 +1597,3 @@ msgstr "Apply"
|
|||||||
|
|
||||||
msgid "Back"
|
msgid "Back"
|
||||||
msgstr "Back"
|
msgstr "Back"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3200
lang/es.po
3200
lang/es.po
File diff suppressed because it is too large
Load Diff
3200
lang/fr.po
3200
lang/fr.po
File diff suppressed because it is too large
Load Diff
1601
lang/hi.po
1601
lang/hi.po
File diff suppressed because it is too large
Load Diff
3200
lang/it.po
3200
lang/it.po
File diff suppressed because it is too large
Load Diff
3200
lang/ja.po
3200
lang/ja.po
File diff suppressed because it is too large
Load Diff
3200
lang/pl.po
3200
lang/pl.po
File diff suppressed because it is too large
Load Diff
1601
lang/si.po
1601
lang/si.po
File diff suppressed because it is too large
Load Diff
3200
lang/zh.po
3200
lang/zh.po
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
$migrationList = [];
|
$migrationList = [];
|
||||||
|
$migrationList[] = 'v20180305_210100_drop_si_hi_languages';
|
||||||
$migrationList[] = 'v20171126_200303_swift_mail';
|
$migrationList[] = 'v20171126_200303_swift_mail';
|
||||||
$migrationList[] = 'v20171003_200302_payroll_meta_export';
|
$migrationList[] = 'v20171003_200302_payroll_meta_export';
|
||||||
$migrationList[] = 'v20171003_200301_add_deduction_group_payroll';
|
$migrationList[] = 'v20171003_200301_add_deduction_group_payroll';
|
||||||
|
|||||||
35
migrations/v20180305_210100_drop_si_hi_languages.php
Normal file
35
migrations/v20180305_210100_drop_si_hi_languages.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
namespace Classes\Migration;
|
||||||
|
|
||||||
|
use Metadata\Common\Model\SupportedLanguage;
|
||||||
|
|
||||||
|
class v20180305_210100_drop_si_hi_languages extends AbstractMigration{
|
||||||
|
|
||||||
|
public function up(){
|
||||||
|
|
||||||
|
$supportedLanguage = new SupportedLanguage();
|
||||||
|
$supportedLanguage->Load('name = ?', array('si'));
|
||||||
|
$supportedLanguage->Delete();
|
||||||
|
|
||||||
|
$supportedLanguage = new SupportedLanguage();
|
||||||
|
$supportedLanguage->Load('name = ?', array('hi'));
|
||||||
|
$supportedLanguage->Delete();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(){
|
||||||
|
$supportedLanguage = new SupportedLanguage();
|
||||||
|
$supportedLanguage->name = 'si';
|
||||||
|
$supportedLanguage->description = 'Sinhala';
|
||||||
|
$supportedLanguage->Save();
|
||||||
|
|
||||||
|
$supportedLanguage = new SupportedLanguage();
|
||||||
|
$supportedLanguage->name = 'hi';
|
||||||
|
$supportedLanguage->description = 'Hindi';
|
||||||
|
$supportedLanguage->Save();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -22,6 +22,59 @@ class RoboFile extends \Robo\Tasks
|
|||||||
$this->say("Hello, " . implode(', ', $world));
|
$this->say("Hello, " . implode(', ', $world));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function languageList($client) {
|
||||||
|
$this->includeCientConfig($client);
|
||||||
|
$this->say("Supported Languages for ". $client);
|
||||||
|
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||||
|
$langs = $language->Find('1 = 1');
|
||||||
|
|
||||||
|
$this->say(print_r(array_column($langs, 'name'), true));
|
||||||
|
}
|
||||||
|
|
||||||
|
function languageExport($client) {
|
||||||
|
$this->includeCientConfig($client);
|
||||||
|
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||||
|
$languages = $language->Find('1 = 1 order by id');
|
||||||
|
$data = [];
|
||||||
|
$data[0] = [];
|
||||||
|
$data[0][] = 'Key';
|
||||||
|
foreach ($languages as $lang) {
|
||||||
|
$data[0][] = $lang->name;
|
||||||
|
$trans = \Classes\LanguageManager::getTranslations($lang->name);
|
||||||
|
$trans = json_decode($trans, true)['messages'][''];
|
||||||
|
$count = 1;
|
||||||
|
foreach ($trans as $enVal => $langVal) {
|
||||||
|
if (!isset($data[$count])) {
|
||||||
|
$data[$count] = [];
|
||||||
|
$data[$count][] = $enVal;
|
||||||
|
}
|
||||||
|
$data[$count][] = $langVal[0];
|
||||||
|
$count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$fp = fopen(CLIENT_BASE_PATH.'data/translations.csv', 'w');
|
||||||
|
foreach ($data as $fields) {
|
||||||
|
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||||
|
fputcsv($fp, $fields);
|
||||||
|
}
|
||||||
|
fclose($fp);
|
||||||
|
$this->say('File saved');
|
||||||
|
}
|
||||||
|
|
||||||
|
function languageImport($client, $file) {
|
||||||
|
$this->includeCientConfig($client);
|
||||||
|
|
||||||
|
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||||
|
$languages = $language->Find('1 = 1 order by id');
|
||||||
|
foreach ($languages as $language) {
|
||||||
|
$str = $this->getUpdatedTranslationString($language->name, $file);
|
||||||
|
file_put_contents(
|
||||||
|
__DIR__.'/../lang/'.$language->name.'.po',
|
||||||
|
$str);
|
||||||
|
$this->say('Updated :'.realpath(__DIR__.'/../lang/'.$language->name.'.po'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function migrate($client, $action){
|
function migrate($client, $action){
|
||||||
$this->includeCientConfig($client);
|
$this->includeCientConfig($client);
|
||||||
$this->say("DB Migrating " . $action . " for ". $client);
|
$this->say("DB Migrating " . $action . " for ". $client);
|
||||||
@@ -50,4 +103,44 @@ class RoboFile extends \Robo\Tasks
|
|||||||
}
|
}
|
||||||
$this->say("DB Migration Completed !!!");
|
$this->say("DB Migration Completed !!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $lang
|
||||||
|
* @param $file
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
protected function getUpdatedTranslationString($lang, $file)
|
||||||
|
{
|
||||||
|
$handle = fopen(CLIENT_BASE_PATH . 'data/' . $file, "r");
|
||||||
|
$langColumn = null;
|
||||||
|
/* @var \Gettext\Translations $trans */
|
||||||
|
$trans = \Classes\LanguageManager::getTranslationsObject($lang);
|
||||||
|
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||||
|
if ($langColumn === null) {
|
||||||
|
$currentColumn = 0;
|
||||||
|
foreach ($data as $language) {
|
||||||
|
if ($language === $lang) {
|
||||||
|
$langColumn = $currentColumn;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$currentColumn++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($langColumn === null) {
|
||||||
|
$this->say('Invalid Language');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* @var \Gettext\Translation $tran */
|
||||||
|
$tran = $trans->find('', $data[0]);
|
||||||
|
if ($tran !== false) {
|
||||||
|
$tran->setTranslation($data[$langColumn]);
|
||||||
|
} else {
|
||||||
|
$trans->insert($data[0], $data[$langColumn]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $trans->toPoString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,40 +9,45 @@ use Utils\LogManager;
|
|||||||
|
|
||||||
class LanguageManager
|
class LanguageManager
|
||||||
{
|
{
|
||||||
private static $me = null;
|
private static $me = [];
|
||||||
|
|
||||||
/* @var \Gettext\Translator $translator */
|
/* @var \Gettext\Translator $translator */
|
||||||
private $translator = null;
|
private $translator = null;
|
||||||
|
/* @var \Gettext\Translations $translations */
|
||||||
private $translations = null;
|
private $translations = null;
|
||||||
|
|
||||||
private function __construct()
|
private function __construct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getInstance()
|
private static function getInstance($lang = null)
|
||||||
{
|
{
|
||||||
if (empty(self::$me)) {
|
if ($lang === null) {
|
||||||
self::$me = new LanguageManager();
|
$lang = self::getCurrentLang();
|
||||||
self::$me->loadLanguage();
|
}
|
||||||
|
if (empty(self::$me[$lang])) {
|
||||||
|
self::$me[$lang] = new LanguageManager();
|
||||||
|
self::$me[$lang]->initialize($lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$me;
|
return self::$me[$lang];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadLanguage()
|
private function initialize($lang)
|
||||||
|
{
|
||||||
|
$this->loadLanguage($lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function loadLanguage($lang)
|
||||||
{
|
{
|
||||||
$lang = $this->getCurrentLang();
|
|
||||||
$this->translations = Translations::fromPoFile(APP_BASE_PATH.'lang/'.$lang.'.po');
|
$this->translations = Translations::fromPoFile(APP_BASE_PATH.'lang/'.$lang.'.po');
|
||||||
if (file_exists(APP_BASE_PATH.'lang/'.$lang.'-ext.po')) {
|
|
||||||
$this->translations->addFromPoFile(APP_BASE_PATH.'lang/'.$lang.'-ext.po');
|
|
||||||
}
|
|
||||||
$t = new Translator();
|
$t = new Translator();
|
||||||
$t->loadTranslations($this->translations);
|
$t->loadTranslations($this->translations);
|
||||||
$t->register();
|
$t->register();
|
||||||
$this->translator = $t;
|
$this->translator = $t;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getCurrentLang()
|
private static function getCurrentLang()
|
||||||
{
|
{
|
||||||
$user = BaseService::getInstance()->getCurrentUser();
|
$user = BaseService::getInstance()->getCurrentUser();
|
||||||
if (empty($user) || empty($user->lang) || $user->lang == "NULL") {
|
if (empty($user) || empty($user->lang) || $user->lang == "NULL") {
|
||||||
@@ -56,16 +61,21 @@ class LanguageManager
|
|||||||
if (empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')) {
|
if (empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')) {
|
||||||
$lang = 'en';
|
$lang = 'en';
|
||||||
}
|
}
|
||||||
LogManager::getInstance()->info("Current Language:".$lang);
|
|
||||||
return $lang;
|
return $lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getTranslations()
|
public static function getTranslations($lang = null)
|
||||||
{
|
{
|
||||||
$me = self::getInstance();
|
$me = self::getInstance($lang);
|
||||||
return Json::toString($me->translations);
|
return Json::toString($me->translations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getTranslationsObject($lang = null)
|
||||||
|
{
|
||||||
|
$me = self::getInstance($lang);
|
||||||
|
return $me->translations;
|
||||||
|
}
|
||||||
|
|
||||||
public static function tran($text)
|
public static function tran($text)
|
||||||
{
|
{
|
||||||
$me = self::getInstance();
|
$me = self::getInstance();
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<div id="_id__div" name="_id__div" style="text-align: left;" class="control-label"></div>
|
<div id="_id__div" name="_id__div" style="text-align: left;" class="control-label"></div>
|
||||||
<input id="_id_" name="_id_" type="text" style="text-align: left;display:none" _validation_></input>
|
<input id="_id_" name="_id_" type="text" style="text-align: left;display:none" _validation_></input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
<div class="input-group date datefield" id="_id__date" name="_id__date" data-date="" data-date-format="yyyy-mm-dd">
|
<div class="input-group date datefield" id="_id__date" name="_id__date" data-date="" data-date-format="yyyy-mm-dd">
|
||||||
<span class="add-on input-group-addon"><i class="fa fa-calendar"></i></span>
|
<span class="add-on input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
<input readonly="readonly" id="_id_" name="_id_" class="form-control" size="16" type="text" value="" _validation_>
|
<input readonly="readonly" id="_id_" name="_id_" class="form-control" size="16" type="text" value="" _validation_>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,12 @@
|
|||||||
<i class="fa fa-clock-o"></i>
|
<i class="fa fa-clock-o"></i>
|
||||||
</span>
|
</span>
|
||||||
<input readonly="readonly" data-format="yyyy-MM-dd hh:mm:ss" class="datetimeInput form-control" type="text" id="_id_" name="_id_" size="16" type="text" value="" _validation_></input>
|
<input readonly="readonly" data-format="yyyy-MM-dd hh:mm:ss" class="datetimeInput form-control" type="text" id="_id_" name="_id_" size="16" type="text" value="" _validation_></input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
<button id="_id__remove" onclick="$('#_id_').attr('val','');return false;" class="btn btn-mini btn-inverse" type="button" style="margin-left:30px;margin-top:3px;"><t>Remove</t></button>
|
<button id="_id__remove" onclick="$('#_id_').attr('val','');return false;" class="btn btn-mini btn-inverse" type="button" style="margin-left:30px;margin-top:3px;"><t>Remove</t></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<input class="control-label" id="_id_"/>
|
<input class="control-label" id="_id_"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_"></span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<label id="_id_" name="_id_" style="text-align: left;" class="control-label" _validation_></label>
|
<label id="_id_" name="_id_" style="text-align: left;" class="control-label" _validation_></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_"></span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<canvas class="form-control signatureField" type="signature" id="_id_" name="_id_" _validation_ style="height:120px;"></canvas>
|
<canvas class="form-control signatureField" type="signature" id="_id_" name="_id_" _validation_ style="height:120px;"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<textarea class="form-control simplemde" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
|
<textarea class="form-control simplemde" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<div class="row" id="field__id_">
|
<div class="row" id="field__id_">
|
||||||
<label class="col-sm-3 control-label" for="_id_">_label_</label>
|
<label class="col-sm-3 control-label" for="_id_">_label_</label>
|
||||||
<div class="controls col-sm-6">
|
<div class="controls col-sm-6">
|
||||||
<input class="form-control" type="text" id="_id_" name="_id_" value="" _validation_/>
|
<input class="form-control" type="text" id="_id_" name="_id_" value="" _validation_ _placeholder_/>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<div class="row" id="field__id_">
|
<div class="row" id="field__id_">
|
||||||
<label class="control-label col-sm-3" for="_id_">_label_</label>
|
<label class="control-label col-sm-3" for="_id_">_label_</label>
|
||||||
<div class="controls col-sm-6">
|
<div class="controls col-sm-6">
|
||||||
<textarea class="form-control" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
|
<textarea class="form-control" type="textarea" rows="4" id="_id_" name="_id_" _validation_ _placeholder_></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,12 @@
|
|||||||
<i class="fa fa-clock-o"></i>
|
<i class="fa fa-clock-o"></i>
|
||||||
</span>
|
</span>
|
||||||
<input readonly="readonly" data-format="hh:mm:ss" class="datetimeInput form-control" type="text" id="_id_" name="_id_" size="16" type="text" value="" _validation_></input>
|
<input readonly="readonly" data-format="hh:mm:ss" class="datetimeInput form-control" type="text" id="_id_" name="_id_" size="16" type="text" value="" _validation_></input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<textarea class="form-control tinymce" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
|
<textarea class="form-control tinymce" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls col-sm-3">
|
<div class="controls col-sm-3">
|
||||||
<span class="help-inline control-label" id="help__id_">_helpline_</span>
|
<div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
|
||||||
|
onclick="modJs.showMessage('Tip','_helpline_')"></div>
|
||||||
|
<span id="help_err__id_"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<form class="form-horizontal" id="_id_" role="form">
|
<form class="form-horizontal" id="_id_" role="form">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls ice-form-error-control">
|
||||||
<span class="label label-warning" id="_id__error" style="display:none;"></span>
|
<span class="ice-form-error label label-danger" id="_id__error" style="display:none;"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
_fields_
|
_fields_
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase{
|
if (!class_exists('PHPUnit_Framework_TestCase')) {
|
||||||
|
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TestTemplate extends PHPUnit_Framework_TestCase
|
class TestTemplate extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Created by PhpStorm.
|
|
||||||
* User: Thilina
|
|
||||||
* Date: 9/6/17
|
|
||||||
* Time: 7:22 AM
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Test\Unit;
|
|
||||||
|
|
||||||
use Classes\BaseService;
|
|
||||||
|
|
||||||
class BaseServiceUnit extends \TestTemplate
|
|
||||||
{
|
|
||||||
public function testGet()
|
|
||||||
{
|
|
||||||
$baseService = BaseService::getInstance();
|
|
||||||
// create a user
|
|
||||||
//$user =
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
namespace Test\Unit;
|
namespace Test\Unit;
|
||||||
|
|
||||||
use Classes\LanguageManager;
|
use Classes\LanguageManager;
|
||||||
|
use Gettext\Translations;
|
||||||
|
|
||||||
class LanguageManagerUnit extends \TestTemplate
|
class LanguageManagerUnit extends \TestTemplate
|
||||||
{
|
{
|
||||||
@@ -10,7 +11,7 @@ class LanguageManagerUnit extends \TestTemplate
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTran()
|
public function testTran()
|
||||||
{
|
{
|
||||||
$this->assertEquals('cat', LanguageManager::tran('cat'));
|
$this->assertEquals('cat', LanguageManager::tran('cat'));
|
||||||
@@ -20,4 +21,22 @@ class LanguageManagerUnit extends \TestTemplate
|
|||||||
$this->assertEquals('User Logged In now', LanguageManager::translateTnrText('User <t>Logged In</t> now'));
|
$this->assertEquals('User Logged In now', LanguageManager::translateTnrText('User <t>Logged In</t> now'));
|
||||||
fwrite(STDOUT, __METHOD__ . " End\n");
|
fwrite(STDOUT, __METHOD__ . " End\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetTranslations() {
|
||||||
|
|
||||||
|
$enCount = $this->getTranslationCount('en');
|
||||||
|
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('de'));
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('es'));
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('fr'));
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('it'));
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('ja'));
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('pl'));
|
||||||
|
$this->assertEquals($enCount, $this->getTranslationCount('zh'));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getTranslationCount($lang) {
|
||||||
|
$trans = json_decode(LanguageManager::getTranslations($lang), true);
|
||||||
|
$count = count(array_keys($trans['messages']['']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user