Jump to content

Recommended Posts

Posted
@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()

Posted
Never mind, found the issue, javascript not parsing the integer in the textbox as an integer, added parseInt()

Ah ha! That would do it! :)

Posted

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.

Posted
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. :)

Posted
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.

 

httppost.png

Posted

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

Posted (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 by Arkaine
Posted

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]))*/ {

Posted (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 by nickbro
Posted
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

Posted

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

Posted
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.

Posted
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. :)

Posted
Oh, it did before the notes feature was added. Which type should I be using?

Oh, right, you said "Room." Same result though.

Posted
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.

 

Posted
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.

Posted

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.

Posted
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! :)

Posted (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 by Arkaine
Posted
Did that feature of mine sneak in too? :p

It looks like it did! I see Nick added a "chargingperiods" attribute in version 9.2.0526.0000.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...