nickbro Posted May 28, 2013 Posted May 28, 2013 @Arkaine does the spinner (the quantity) textbox get shown when you book and get the issue with 0 getting submitted? Never mind, found the issue, javascript not parsing the integer in the textbox as an integer, added parseInt()
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Never mind, found the issue, javascript not parsing the integer in the textbox as an integer, added parseInt() Ah ha! That would do it!
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 I've started to show only relevant resources to users (e.g. high school resources to high school teachers, middle school resources to middle school teachers) but the height of each resource shrinks based on what I believe is the total number of resources in the configuration file. #bookingday .body .col, #bookingday #resources div { height: %; } something like 100 / numberOfResourcesInTheConfigFile would become 100 / numberOfResourcesVisibleToTheLoggedInUser An alternative, which I actually like better is to allow the admin to specify a fixed height in setup or configuration.
nickbro Posted May 28, 2013 Posted May 28, 2013 There is a min-height and min-width that it uses, the rest is all percentage based.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 There is a min-height and min-width that it uses, the rest is all percentage based. I'll just change the min-height value in the CSS, but the percentage calculation fix would definitely be nice since it crushes the rows unnecessarily.
nickbro Posted May 28, 2013 Posted May 28, 2013 Ok, give this a try, switched it to use the visible resources, not what's in the config for the percentage calculation
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Have you found the notes bit yet? Ha! Yes, you're quick! It's beautiful! I'm trying to fix a new problem...well, the symptom is the same as an old problem, POST went wonky again. No count.
nickbro Posted May 28, 2013 Posted May 28, 2013 Go to line 479, add these in below: console.log(curres.Quantities.length > 0); console.log(curres.CanShare); console.log(parseInt($("#bfquantspin").val())); console.log(parseInt(curres.Quantities[curres.Quantities.length - 1])); console.log(parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1])); This will enable the debug console to show what's going on when you attempt to book
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 (edited) Go to line 479, add these in below: console.log(curres.Quantities.length > 0); console.log(curres.CanShare); console.log(parseInt($("#bfquantspin").val())); console.log(parseInt(curres.Quantities[curres.Quantities.length - 1])); console.log(parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1])); This will enable the debug console to show what's going on when you attempt to book If I was using an IDE and not Notepad, I would totally do this. As a workaround, I've done this. I don't get anything when it's inside the else if scope, so I added it after. else if (curres.Quantities.length > 0 && curres.CanShare && parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1])) { d += ', "Count": ' + $("#bfquantspin").val(); } alert(curres.Quantities.length > 0); alert(curres.CanShare); alert(parseInt($("#bfquantspin").val())); alert(parseInt(curres.Quantities[curres.Quantities.length - 1])); alert(parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1])); When i enter 18 I get: true true 18 18 false When i enter 16 i get: true true 16 18 true Max is 18, by the way. Edited May 28, 2013 by Arkaine
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Doesn't work even if I change ELSE IF to just ELSE...odd. else /*if (curres.Quantities.length > 0 && curres.CanShare && parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1]))*/ {
nickbro Posted May 28, 2013 Posted May 28, 2013 (edited) If it's the only booking for a room, then the count isn't sent, it's left at 0 which means whole resource booking. Are you trying this currently on a laptop resource. Resource sharing is only supported on a Room resource Edited May 28, 2013 by nickbro
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 If it's the only booking for a room, then the count isn't sent, it's left at 0 which means whole resource booking. Are you trying this currently on a laptop resource. Resource sharing is only supported on a Room resource
nickbro Posted May 28, 2013 Posted May 28, 2013 resource type is other, that may or may not work, tending to think not. console.log is a browser thing, not an IDE thing. If you have firefox, then the console tag in firebug will show stuff logged, same in chrome and IE with the dev tools
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 resource type is other, that may or may not work, tending to think not. Oh, it did before the notes feature was added. Which type should I be using? console.log is a browser thing, not an IDE thing. If you have firefox, then the console tag in firebug will show stuff logged, same in chrome and IE with the dev tools Ah! It wasn't showing up in the Chrome console, I'll try Firefox.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Ah! It wasn't showing up in the Chrome console, I'll try Firefox. Oh, durr, the log didn't show up because I didn't try that outside the ELSE IF scope. I have a few DOH moments myself.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Oh, it did before the notes feature was added. Which type should I be using? Oh, right, you said "Room." Same result though.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Oh, right, you said "Room." Same result though. It is sending the count variable now that I've set the type to room, but now there is no count XML attribute in bookings.xml.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 It is sending the count variable now that I've set the type to room, but now there is no count XML attribute in bookings.xml. Whoops, that wasn't cause and effect. It was sending count as other too...so it does this for both Room and Other.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 I think I'm going cross-eyed with all this code! It appears to be functioning normally client-side (it's sending the count httppostvar). It must be server-side, where it takes the input and writes it to the bookings.xml file because the count XML attribute isn't showing up there.
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 Ok, give this a try, switched it to use the visible resources, not what's in the config for the percentage calculation Just realized you released the new percentage calc. It looks much nicer!
Arkaine Posted May 28, 2013 Author Posted May 28, 2013 (edited) I think I see it! CHS Extranet/HAP.BookingSystem/api.cs : 115 if (booking.Count <= 0) node.SetAttribute("count", booking.Count.ToString()); if (booking.Count >= 0) node.SetAttribute("count", booking.Count.ToString()); Edited May 28, 2013 by Arkaine
Arkaine Posted May 29, 2013 Author Posted May 29, 2013 Did that feature of mine sneak in too? It looks like it did! I see Nick added a "chargingperiods" attribute in version 9.2.0526.0000.
nickbro Posted May 29, 2013 Posted May 29, 2013 I've made your change in the bookingsystem dll, attached is today's alpha release. It also contains a change to myfiles
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now