/** * */ function createProdTableHeaderLine() { var txt = "Name" + "Typ  " + "Durchlauf Küche" + "Durchlauf Bereitst." + + "Drucker" + "KurznamePreis (A)" + "Preis (B)" + "Preis (C)" + "Steuersatz" + "Audio" + "Verfügbar"; return txt; } function ident(depth) { var txt = ""; var i=0; for (i=0;i" + "" + depthstr + "" + "" + "" + "" + "" + "" + "" + "" + this.createAudioSelection(audiofiles,"audiosel_" + this.id) + "" + this.createAvailSelection("prodavail_" + this.id,PROD_NO,PROD_YES) + "" + this.createAvailSelection("prodfav_" + this.id,PROD_NO,PROD_YES) + ""; return trline; }, insertValuesIntoMenuTable:function() { $("#prodleaf_" + this.id + " input.prodlongname").val(this.longname); $("#prodleaf_" + this.id + " input.prodshortname").val(this.shortname); $("#prodleaf_" + this.id + " input.prodpriceA").val(this.priceA); $("#prodleaf_" + this.id + " input.prodpriceB").val(this.priceB); $("#prodleaf_" + this.id + " input.prodpriceC").val(this.priceC); $("#prodleaf_" + this.id + " input.prodtax").val(this.tax); }, createAudioSelection:function(audiofiles,id) { var txt = ""; return txt; }, createAvailSelection:function(id,text0,text1) { if (this.available == 1) { return ""; } else { return ""; } }, createFavoriteSelection:function(id,text0,text1) { if (this.favorite == 1) { return ""; } else { return ""; } }, createMobileAudioSel:function(audiofiles,id) { var txt = '

' + '' + this.createAudioSelection(audiofiles,id) + '

'; return txt; }, createMobileAvail:function(id,label) { var txt = '

' + '' + this.createAvailSelection(id,PROD_NO,PROD_YES) + '

'; return txt; }, createMobileFavorite:function(id,label) { var txt = '

' + '' + this.createFavoriteSelection(id,PROD_NO,PROD_YES) + '

'; return txt; }, createListStructureLine:function (audiofiles) { var theme="e"; if (this.id.indexOf("n") == 0) { theme="f"; } var line = '
' +'

Test

' + '

' + createInputField("prodlong_" + this.id,"prodlong_input_" + this.id,"longname") + createInputField("prodshort_" + this.id,"prodshort_input_" + this.id,"shortname") + '

' + createInputField("prodpriceA_" + this.id,"prodpriceA_input_" + this.id,"priceA") + createInputField("prodpriceB_" + this.id,"prodpriceB_input_" + this.id,"priceB") + createInputField("prodpriceC_" + this.id,"prodpriceC_input_" + this.id,"priceC") + createInputField("prodtax_" + this.id,"prodtax_input_" + this.id,"tax") + '

' + "
" + this.createMobileAudioSel(audiofiles,"audiosel_" + this.id) + "
" + "
" + this.createMobileAvail("prodavail_" + this.id,PROD_AVAILABLE[lang]) + "
" + "
" + this.createMobileFavorite("prodfav_" + this.id,PROD_FAVORITE[lang]) + "
" if (theme != "f") { line += this.createProdNavArea(); line += createInputOsCmdField("prodextra_" + this.id,"prodextrainput_" + this.id,"extra"); line += "
"; line += createResetApplyArea("prodapply_" + this.id,"prodcancel_" + this.id,null) + '
'; } else { line += this.createApplyArea("prodnew_" + this.id) + ''; } return line; }, insertValuesIntoMenuList:function() { if (this.id.indexOf("n") != 0) { $("#prodheader_" + this.id).html(toHtml(this.longname)); } else { $("#prodheader_" + this.id).html(PROD_NEW_PROD[lang]); } $("#prodlong_" + this.id).html(PROD_LONG_NAME[lang]); $("#prodlong_input_" + this.id).val(this.longname); $("#prodshort_" + this.id).html(PROD_SHORTNAME[lang]); $("#prodshort_input_" + this.id).val(this.shortname); $("#prodpriceA_" + this.id).html(PROD_PRICE[lang] + ' (A)'); $("#prodpriceB_" + this.id).html(PROD_PRICE[lang] + ' (B)'); $("#prodpriceC_" + this.id).html(PROD_PRICE[lang] + ' (C)'); $("#prodtax_" + this.id).html(PROD_TAX[lang]); $("#prodpriceA_input_" + this.id).val(this.priceA.toString().replace(".",decpoint)); $("#prodpriceB_input_" + this.id).val(this.priceB.toString().replace(".",decpoint)); $("#prodpriceC_input_" + this.id).val(this.priceC.toString().replace(".",decpoint)); if (this.tax != "null") { $("#prodtax_input_" + this.id).val(this.tax.toString().replace(".",decpoint)); } $("#availcont_" + this.id).html(this.createMobileAvail("prodavail_" + this.id,PROD_AVAILABLE[lang])); $("#favcont_" + this.id).html(this.createMobileFavorite("prodfav_" + this.id,PROD_FAVORITE[lang])); $("#audiocont_" + this.id).html(this.createMobileAudioSel(audiofiles,"audiosel_" + this.id)); $("#prodextra_" + this.id).html(PROD_ASS_EXTRAS[lang]); $("#prodextra_" + this.id).data("orig_assignedextras",null); $("#prodextra_" + this.id).data("assignedextras",null); }, createApplyArea:function(idApply) { var txt = '

' + '
' + '

'; return txt; }, createProdNavArea:function() { var buttonUp = ''; var buttonDown = ''; var buttonDel = ''; var aText = ''; aText += '

'; aText += '
' + buttonDel + '
'; aText += '
' + buttonUp + '
'; aText += '
' + buttonDown + '
'; aText += '

'; return aText; } }; return product; } function createInputField(idForNameOfField,idForInputField,nameOfInputField) { var txt = '

' + '' + '

'; return txt; } function createInputOsCmdField(idForNameOfField,idForInputField,nameOfInputField) { var txt = '

' + '' + '

'; return txt; } function createResetApplyArea(idApply,idCancel,idDel) { var txt = '

' + '
' + '
' + '

'; } else { txt += 'b">' + '
' + '
' + '
' + '

'; } return txt; } function createProdType(id,name,kind,usekitchen,usesupplydesk,printer) { var prodtype = { id:id, name: name, usekitchen:usekitchen, usesupplydesk:usesupplydesk, kind:kind, printer:printer, createTableStructureLine: function (depth) { var depthstr = ident(depth); var trline = "" + "" + depthstr + "" + "" + this.createTwoValSelection(kind,PROD_FOOD,PROD_DRINKS) + "" + this.createTwoValSelection(usekitchen,PROD_NO,PROD_YES) + "" + this.createTwoValSelection(usesupplydesk,PROD_NO,PROD_YES) + "" + this.createTwoValSelection(printer,PROD_PRINTER_1,PROD_PRINTER_2) + "" + ""; return trline; }, insertValuesIntoMenuTable:function() { $("#prodtype_" + id + " input.typename").val(name); }, createTwoValSelection:function(theVal,text0,text1) { if (theVal == 1) { return ""; } }, createUpperMenuTypeStructure: function() { var txt = '

' + this.name + '

' + "

" + "
" + "
" + "
" + createInputField("typename_" + this.id,"typename_input_" + this.id,"typename_input_" + this.id) + createResetApplyArea("typeapply_" + this.id,"typecancel_" + this.id,"typedel_" + this.id) + '

'; return txt; }, createLowerMenuTypeStructure: function() { var newTypeName = '

'; var newTypeBtn = '

'; var assignBtn = '

'; return newTypeName + newTypeBtn + assignBtn; }, insertValuesIntoMenuList:function() { $("#typename_" + this.id).html(PROD_NAME[lang]); $("#typename_input_" + this.id).val(this.name); $("#dtypekind_" + this.id).html(this.createMobileSel("kind_" + this.id,this.kind,PROD_TYPE,PROD_FOOD,PROD_DRINKS)); $("#dtypeuk_" + this.id).html(this.createMobileSel("usekitchen_" + this.id,this.usekitchen,PROD_KITCHEN_BAR,PROD_NO_PASS_KITCHEN,PROD_PASS_KITCHEN)); $("#dtypeus_" + this.id).html(this.createMobileSel("usesupply_" + this.id,this.usesupplydesk,PROD_SUPPLY,PROD_NO_PASS_SUPPLY,PROD_PASS_SUPPLY)); $("#dtypeprinter_" + this.id).html(this.createMobileSel("printer_" + this.id,this.printer-1,PROD_PRINTER,PROD_PRINTER_1,PROD_PRINTER_2)); }, createMobileSel:function(id,theVal,label,text0,text1) { var txt = '

' + '' + this.createSelection(id,theVal,text0,text1) + '

'; return txt; }, createSelection:function(id,theVal,text0,text1) { if (theVal == 1) { return ""; } else { return ""; } } }; return prodtype; }