+ Post New Thread
Page 5 of 8 FirstFirst 12345678 LastLast
Results 61 to 75 of 109
Home Access Plus+ Thread, Booking System: Split Resources in Projects:; Originally Posted by nickbro Go to line 479, add these in below: Code: console.log(curres.Quantities.length > 0); console.log(curres.CanShare); console.log(parseInt($("#bfquantspin").val())); console.log(parseInt(curres.Quantities[curres.Quantities.length - ...
  1. #61

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by nickbro View Post
    Go to line 479, add these in below:
    Code:
                                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.

    Code:
    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:
    Code:
    true
    true
    18
    18
    false
    When i enter 16 i get:
    Code:
    true
    true
    16
    18
    true
    Max is 18, by the way.
    Last edited by Arkaine; 28th May 2013 at 08:03 PM.

  2. #62

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Doesn't work even if I change ELSE IF to just ELSE...odd.

    Code:
    else /*if (curres.Quantities.length > 0 && curres.CanShare && parseInt($("#bfquantspin").val()) < parseInt(curres.Quantities[curres.Quantities.length - 1]))*/ {

  3. #63
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,520
    Thank Post
    37
    Thanked 501 Times in 432 Posts
    Rep Power
    113
    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
    Last edited by nickbro; 28th May 2013 at 08:07 PM.

  4. #64

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by nickbro View Post
    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
    <resource name="XXX Mac Lab" type="Other" admins="XXX HAP Lab Booking Admins" enabled="True" emailadmins="False" enablecharging="False" showto="XXX Staff,YYY Staff" hidefrom="" years="XXX,Central Office" quantities="18" readonlyto="" readwriteto="" disclaimer="" canshare="True" enablenotes="true" />

  5. #65
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,520
    Thank Post
    37
    Thanked 501 Times in 432 Posts
    Rep Power
    113
    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

  6. #66

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by nickbro View Post
    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?
    Quote Originally Posted by nickbro View Post
    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.

  7. #67

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by Arkaine View Post
    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.

  8. #68

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by Arkaine View Post
    Oh, it did before the notes feature was added. Which type should I be using?
    Oh, right, you said "Room." Same result though.

  9. #69

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by Arkaine View Post
    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.

    HTML Code:
    <Booking date="28/05/2013" lesson="Period 2" room="XXX General Lab" uid="teststaff20130528T153125Z" username="teststaff" name="XXX Art" notes="test" />

  10. #70

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by Arkaine View Post
    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.

    HTML Code:
    <Booking date="28/05/2013" lesson="Period 2" room="XXX General Lab" uid="teststaff20130528T153125Z" username="teststaff" name="XXX Art" notes="test" />
    Whoops, that wasn't cause and effect. It was sending count as other too...so it does this for both Room and Other.

  11. #71

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    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.

  12. #72

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by nickbro View Post
    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!

  13. #73

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I think I see it!

    CHS Extranet/HAP.BookingSystem/api.cs : 115
    Code:
    if (booking.Count <= 0) node.SetAttribute("count", booking.Count.ToString());
    Code:
    if (booking.Count >= 0) node.SetAttribute("count", booking.Count.ToString());
    Last edited by Arkaine; 28th May 2013 at 09:21 PM.

  14. #74

    Join Date
    May 2013
    Posts
    65
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by TheScarfedOne View Post
    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.

  15. #75
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,520
    Thank Post
    37
    Thanked 501 Times in 432 Posts
    Rep Power
    113
    I've made your change in the bookingsystem dll, attached is today's alpha release. It also contains a change to myfiles

SHARE:
+ Post New Thread
Page 5 of 8 FirstFirst 12345678 LastLast

Similar Threads

  1. ICT Resource booking system
    By lew_bob in forum AV and Multimedia Related
    Replies: 8
    Last Post: 19th May 2011, 10:09 AM
  2. Online Resource Booking System
    By SimpleSi in forum Web Development
    Replies: 14
    Last Post: 29th October 2008, 08:34 PM
  3. Online Parental Booking System
    By robknowles in forum MIS Systems
    Replies: 4
    Last Post: 3rd July 2007, 07:52 PM
  4. pc booking systems including my-pc
    By in forum Network and Classroom Management
    Replies: 8
    Last Post: 9th March 2007, 07:28 PM
  5. Online Booking System
    By imullings in forum Educational Software
    Replies: 2
    Last Post: 5th September 2006, 08:10 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •