/** * prepare.php * * @author Louis SAUNDERS * @copyright 2009-2010 Deuxeos - All rights reserved */ /********************************************************************************************************/ /************* Variables *************/ /********************************************************************************************************/ var hager_gmap_key = "ABQIAAAAOfgcRKQJdyOJYjp5kaQsWxSzlmvSpe8-E45FgfrJYd-o3R5GNBR59EC7BgShqRedmdIfulos8J4Dfw"; var directory_item_per_page = 10; var dir_script = "/skin/js/"; var imageOK_src = "/skin/img/pics/ok.gif"; var imageKO_src = "/skin/img/pics/ko.gif"; _editor_url = "/skin/js/xinha/"; _editor_lang = "it"; var root_url = "http://www.mio-elettricista.ch/"; /********************************************************************************************************/ /************* de_CH VALIDATIONS *************/ /********************************************************************************************************/ var de_CH = new Array(); de_CH["format_date"] = "dmy"; de_CH["format_time"] = "24"; de_CH["dashboard_date"] = "d/m/Y"; de_CH["regex_money"] = /^[0-9 ]+([,]{1}[0-9]+)?$/; de_CH["regex_zipcode"] = /^[0-9]{4}$/; de_CH["regex_date"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/; de_CH["regex_fax"] = /^[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; de_CH["regex_phone"] = /^[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; de_CH["regex_datetime"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s(\d{1,2})\:(\d{1,2})\:(\d{1,2})$/; de_CH["regex_mobile"] = /^(07[6-9])[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; /********************************************************************************************************/ /************* de_CH TEXTS *************/ /********************************************************************************************************/ de_CH["isDate"] = "Data non valida. Esempio: 23/10/2007"; de_CH["isMoney"] = "Deve essere una cifra corretta. Esempio: 1 234,56"; de_CH["isFAX"] = "Numero FAX non corretto. Esempio: 021 644 37 00"; de_CH["isZipCode"] = "CAP non valido. Esempio: 1070"; de_CH["isPhone"] = "Numero di telefono non corretto. Esempio: 021 644 37 00"; de_CH["isDateTime"] = "Formato data non corretto. Esempio: 23/10/2007 14:52:10"; de_CH["isMobilePhone"] = "Numero di cellulare non valido. Esempio: 079 610 03 45"; /********************************************************************************************************/ /************* fr_CH VALIDATIONS *************/ /********************************************************************************************************/ var fr_CH = new Array(); fr_CH["format_date"] = "dmy"; fr_CH["format_time"] = "24"; fr_CH["dashboard_date"] = "d/m/Y"; fr_CH["regex_money"] = /^[0-9 ]+([,]{1}[0-9]+)?$/; fr_CH["regex_zipcode"] = /^[0-9]{4}$/; fr_CH["regex_date"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/; fr_CH["regex_fax"] = /^[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; fr_CH["regex_phone"] = /^[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; fr_CH["regex_datetime"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s(\d{1,2})\:(\d{1,2})\:(\d{1,2})$/; fr_CH["regex_mobile"] = /^(07[6-9])[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; /********************************************************************************************************/ /************* fr_CH TEXTS *************/ /********************************************************************************************************/ fr_CH["isDate"] = "Data non valida. Esempio: 23/10/2007"; fr_CH["isMoney"] = "Deve essere una cifra corretta. Esempio: 1 234,56"; fr_CH["isFAX"] = "Numero FAX non corretto. Esempio: 021 644 37 00"; fr_CH["isZipCode"] = "CAP non valido. Esempio: 1070"; fr_CH["isPhone"] = "Numero di telefono non corretto. Esempio: 021 644 37 00"; fr_CH["isDateTime"] = "Formato data non corretto. Esempio: 23/10/2007 14:52:10"; fr_CH["isMobilePhone"] = "Numero di cellulare non valido. Esempio: 079 610 03 45"; /********************************************************************************************************/ /************* it_CH VALIDATIONS *************/ /********************************************************************************************************/ var it_CH = new Array(); it_CH["format_date"] = "dmy"; it_CH["format_time"] = "24"; it_CH["dashboard_date"] = "d/m/Y"; it_CH["regex_money"] = /^[0-9 ]+([,]{1}[0-9]+)?$/; it_CH["regex_zipcode"] = /^[0-9]{4}$/; it_CH["regex_date"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/; it_CH["regex_fax"] = /^[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; it_CH["regex_phone"] = /^[0-9]{3}[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; it_CH["regex_datetime"] = /^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s(\d{1,2})\:(\d{1,2})\:(\d{1,2})$/; it_CH["regex_mobile"] = /^(07[6-9])[ \.\-]?[0-9]{3}[ \.\-]?[0-9]{2}[ \.\-]?[0-9]{2}$/; /********************************************************************************************************/ /************* it_CH TEXTS *************/ /********************************************************************************************************/ it_CH["isDate"] = "Data non valida. Esempio: 23/10/2007"; it_CH["isMoney"] = "Deve essere una cifra corretta. Esempio: 1 234,56"; it_CH["isFAX"] = "Numero FAX non corretto. Esempio: 021 644 37 00"; it_CH["isZipCode"] = "CAP non valido. Esempio: 1070"; it_CH["isPhone"] = "Numero di telefono non corretto. Esempio: 021 644 37 00"; it_CH["isDateTime"] = "Formato data non corretto. Esempio: 23/10/2007 14:52:10"; it_CH["isMobilePhone"] = "Numero di cellulare non valido. Esempio: 079 610 03 45"; /********************************************************************************************************/ /************* TEXTS *************/ /********************************************************************************************************/ var common = new Array(); common["dashboard_date"] = "d/m/Y"; common["isLanguageCode"] = "Codice non valido. Esempio: en_IT"; common["isEqualLength"] = "La lunghezza deve essere di {0} caratteri"; common["isMaxLength"] = "Length can't be more than {0} caracters"; common["isMinLength"] = "La lunghezza non può essere meno di {0} caratteri"; common["isLengthBetween"] = "La lunghezza deve essere tra {0} e {1} caratteri"; common["isMaxValue"] = "Il valore non può essere maggiore di {0}"; common["isMinValue"] = "Il valore non può essere meno di {0}"; common["isValueBetween"] = "Il valore deve essere compreso tra {0} e {1}"; common["isDateDay"] = "Invalid day"; common["isDateMonth"] = "Mese non corretto"; common["isDateYear"] = "L'anno non è corretto"; common["isYear"] = "L'anno deve essere compreso tra il 1901 ed il 2155"; common["isInteger"] = "Deve essere un valore intero. Esemipio: 1200 o -213"; common["isDouble"] = "Deve essere un valore reale. Esempio: 12.24 o -23,51"; common["isAlpha"] = "Deve essere di tipo alfabetico"; common["isAlNum"] = "Deve essere di tipo alfanumerico"; common["isInsee"] = "Numero INSEE non corretto. Esempio: 1 85 34 33 354 450 45"; common["isApe"] = "Invalid APE number. Example: 25.4Z"; common["isSiret"] = "Numero SIREN non corretto. Esempio: 254 254 254"; common["isSiren"] = "Invalid SIREN number. Example: 254 254 254"; common["isTVA"] = "Numero intercomunitario VAT non corretto. Esempio: FR 02 254 254 254"; common["isEmail"] = "L'e-mail non è valida. Esempio: carlo.rossi@dominio.it"; common["isRootURL"] = "Indirizzo URL non valido. Esempio: http://www.dominio.it"; common["isURL"] = "Invalid URL. Example: http://www.domain.com/company/news/"; common["isExtension"] = "Estensione file non corretta. Esempio: C:myFile.{0}"; common["areExtensions"] = "Estensione file non corretta ({0})"; common["isDateBefore"] = "La data deve essere antecedente al {0}"; common["isDateAfter"] = "La data deve essere successiva al {0}"; common["isDateBetween"] = "La data deve essere tra il {0} ed il {1}"; common["isRadioChecked"] = "Si deve selezionare un valore"; common["isCollectionChecked"] = "Bisogna selezionare almento una voce"; common["isMaxCollectionChecked"] = "Non si possono selezionare più di {0} voci"; common["isCollectionCheckedBetween"] = "La quantità di voci selezionate deve essere compreso tra {0} e {1}"; common["isGroupSelected"] = "Bisogna selezionare almeno una voce"; common["isMaxGroupSelected"] = "Non si possono selezionare più di {0} voci"; common["isGroupSelectedBetween"] = "The number of selected items must be between {0} and {1}"; common["isDateTimeDay"] = "Giorno non corretto"; common["isDateTimeMonth"] = "Il dato del mese non è corretto"; common["isDateTimeYear"] = "L'anno non è corretto"; common["isDateTimeHour"] = "Il dato dell'ora non è corretta"; common["isDateTimeMinute"] = "Il dato dei minuti non è corretto"; common["isDateTimeSecond"] = "Il dato dei secondi non è corretto"; common["isRewrittenURL"] = "URL non corretto."; common["No"] = "No"; common["Ok"] = "OK"; common["Yes"] = "Sì"; common["deleteItem"] = "JS_DELETEITEM"; common["deleteItems"] = "JS_DELETEITEMS"; common["validateForm"] = "Alcuni campi non sono corretti. Si prega di controllare il formulario."; common["incompleteForm"] = "Alcuni campi richiesti sono vuoti. Si prega di controllare il form d'inserimento"; common["emptySelection"] = "JS_EMPTYSELECTION"; common["format_validation"] = "Controllo dati"; common["validateFormTitle"] = "Errore!"; /********************************************************************************************************/ /************* FUNCTIONS *************/ /********************************************************************************************************/ /** * Gets the string associated with the key * * @param lang * @param key */ function getCommonString(key) { try { var ret = common[key]; if (ret === undefined) ret = key; return ret; } catch (ex) {} return key; } /** * Gets the localized string associated with the key * * @param key */ function getLocalizedString(lang, key) { if (lang == "common") return getCommonString(key); try { var ret = eval(lang + "['" + key + "']"); if (ret === undefined) ret = key; return ret; } catch (ex) {} return key; }