/** * */ function createProdTableHeaderLine() { var txt = "Name" + "Typ  " + "Durchlauf Küche" + "Durchlauf Bereitst." + "Drucker" + "KurznamePreis (A)" + "Preis (B)" + "Preis (C)" + "Einheit" + "Anzeige" + "Tage" + "Steuersatz" + "Steuersatz Österreich" + "Audio" + "Verfügbar"; return txt; } function ident(depth) { var txt = ""; var i=0; for (i=0;i" + "" + depthstr + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + this.createTaxAustriaSelection("prodtaxaustriasel_" + this.id) + "" + "" + 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.produnit").val(this.unit); $("#prodleaf_" + this.id + " input.proddisplay").val(this.display); if (this.days == '0123456') { $("#prodleaf_" + this.id + " input.proddays").val(''); } else { $("#prodleaf_" + this.id + " input.proddays").val(this.days); } $("#prodleaf_" + this.id + " input.prodtax").val(this.tax); $("#prodleaf_" + this.id + " input.prodamount").val(this.amount); }, createAudioSelection:function(audiofiles,id) { var txt = ""; return txt; }, createAvailSelection:function(id,text0,text1) { if (this.available == 1) { return ""; } else { return ""; } }, createOption:function(value,selected,txt) { if (value == selected) { return ""; } else { return ""; } }, createTaxAustriaSelection:function(id) { var txt = ""; return txt; }, createUnitSelection:function(id) { var txt = ""; return txt; }, createDisplaySelection:function(id) { var txt = ""; return txt; }, createTaxAustriaSel:function(id) { var visi = "" if (austria == 0) { visi = " style='display:none;' "; } var txt = '

' + '' + this.createTaxAustriaSelection(id) + '

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

' + '' + this.createUnitSelection(id) + '

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

' + '' + this.createDisplaySelection(id) + '

'; return txt; }, 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

' + '

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

' + 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") + "
" + this.createUnitField("produnit_input_" + this.id) + "
" + "
" + this.createDisplayField("proddisplay_input_" + this.id) + "
" + createInputField("proddays_" + this.id,"proddays_input_" + this.id,"days") + createInputField("prodtax_" + this.id,"prodtax_input_" + this.id,"tax") + '

' + createInputField("prodamount_" + this.id,"prodamount_input_" + this.id,"amount") + "
" + this.createTaxAustriaSel("taxaustriasel_" + this.id) + "
" + "
" + 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) + ''; } $("#contprod_" + this.id).html(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)'); $("#produnit_" + this.id).html(PROD_UNIT[lang]); $("#proddisplay_" + this.id).html(PROD_DISPLAY[lang]); $("#proddays_" + this.id).html(PROD_DAYS[lang]); $("#prodtax_" + this.id).html(PROD_TAX[lang]); $("#prodtaxaustria_" + this.id).html(PROD_TAXAUSTRIA[lang]); $("#prodamount_" + this.id).html(PROD_AMOUNT[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)); $("#unitcont_" + this.id).html(this.createUnitField("produnit_input_" + this.id)); $("#displaycont_" + this.id).html(this.createDisplayField("proddisplay_input_" + this.id)); $("#proddisplay_input_" + this.id).val(this.display); if ((this.days == '0123456') || (this.days == null) || (this.days == 'null')) { $("#proddays_input_" + this.id).val(''); } else { $("#proddays_input_" + this.id).val(this.days); } if (this.tax != "null") { $("#prodtax_input_" + this.id).val(this.tax.toString().replace(".",decpoint)); } else { $("#prodtax_input_" + this.id).val(''); } if (this.amount != "null") { $("#prodamount_input_" + this.id).val(this.amount.toString().replace(".",decpoint)); } else { $("#prodamount_input_" + this.id).val(''); } $("#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,fixbind) { var prodtype = { id:id, name: name, usekitchen:usekitchen, usesupplydesk:usesupplydesk, kind:kind, printer:printer, fixbind:fixbind, createTableStructureLine: function (depth) { var depthstr = ident(depth); var trline = "" + "" + depthstr + "" + "" + this.createValSelection(kind,[PROD_FOOD,PROD_DRINKS]) + "" + this.createValSelection(usekitchen,[PROD_NO,PROD_YES]) + "" + this.createValSelection(usesupplydesk,[PROD_NO,PROD_YES]) + "" + this.createValSelection(printer,[PROD_PRINTER_1,PROD_PRINTER_2,PROD_PRINTER_3,PROD_PRINTER_4]) + "" + ""; return trline; }, insertValuesIntoMenuTable:function() { $("#prodtype_" + id + " input.typename").val(name); }, createValSelection:function(theVal,valTextArray) { var txt = ""; }, createUpperMenuTypeStructure: function() { var txt = '

' + this.name + '

' + '' + '

' + '

'; return txt; }, createLowerMenuTypeStructure: function() { var style = ' style="background-color: white;" '; var newTypeName = '

'; var newTypeBtn = '

'; var assignBtn = '

'; var sortAlphaBtn = '

'; return newTypeName + newTypeBtn + assignBtn + sortAlphaBtn; }, 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,PROD_PRINTER_3,PROD_PRINTER_4])); $("#dtypefixbind_" + this.id).html(this.createMobileSel("fixbind_" + this.id,this.fixbind,PROD_PRINTER_PRIO,[PROD_PRINTER_FIXB0,PROD_PRINTER_FIXB1])); }, createMobileSel:function(id,theVal,label,valTextArray) { var txt = '

' + '' + this.createSelection(id,theVal,valTextArray) + '

'; return txt; }, createSelection:function(id,theVal,valTextArray) { var txt = ""; } }; return prodtype; }