Jump to content

Recommended Posts

Posted

Is there a way that the "Unavailable" and "Charging" automatic entries can be changed? I would like to be able to set them to be two sessions each side, as we have Break and Lunch on our booking system (to allow staff to book rooms and equipment at those times.

 

S1 Break S2 Lunch S3 Break S4

Unavail Unavail Bookied Charging Charging Free Free

 

Any ideas?

  • 2 weeks later...
Posted

@TheScarfedOne would you be willing to test something I've been working on, if I can get it to work on my test site. It'll be an advanced feature and require editing an xml file to define rules. I'll try and make one to begin with and see where it goes.

 

Hopefully, it will work the way I want it to.

Posted (edited)

See attached dll.

 

If after you install this dll, you make a temp booking and remove it you should see a new XML file in the ~/App_Data folder called bookingrules.xml

 


  
    
    bookcharging(booking.NextLesson().NextLesson())
    bookcharging(booking.PreviousLesson().PreviousLesson())
  

 

So what is this rule doing?

 

It's asking if the current user is a Domain Admins (User.IsInRole) and if that equals YES (true)

 

It then proceeds to do that the actions, which at the moment are just book or bookcharging (it will remove the bookings that are made from the rules when you remove the booking, or should)

 

I may add more rule actions at a later date.

 

It then uses the current booking, asks for the booking in the next lesson, then the lesson after that to book

 

Does the same the opposite way. If it hits a problem the action will not run, other actions may.

 

 

You can add multiple Conditions And Conditions mean it uses the logical AND, or there is Or which uses the Or

 

The operation that can go on are And, Or, Not, Equals, Null, GT (greater than, int or datetime only), LT (less than, int or datetime only), GTE (greater than or equals), LTE (less than or equals), NotNull, the operations are case sesnsitive

 

You can query against various inbuilt objects:

 


  • Resource (the current resource being used)
  • Booking (the current booking)
  • BookingSystem (the overall booking system)
  • User (the current user object)

 

You do need to have some knowledge of the inners of the booking system, and how some stuff is worded and works, the source code is the best place for that.

 

 

 

 

What do you think?

Edited by nickbro
  • 2 weeks later...
Posted

Hi Nick

 

Sorry - Ive been a bit slack on replying to this one! I tried the above, and the version included in v8.7 - but cant see it logging anything the HAP Event Log on the server; and its not changing an action on the booking system either.

Posted
Hmm that's an odd one, I'll have to look into that. It will only send emails to resource admins, not booking system admins, so you have to have specific admins specified in the admins for the resource as well
Posted
very odd. I've done some changes to the booking system dll today, added a trip function to remove any white spaces, this may, or may not fix the issue though, can you try this attached dll
Posted

Right, before I change the DLL to the one above - heres some info from the event log for you...

 

Failed Action: bookcharging(booking.NextLesson().NextLesson()) System.NullReferenceException: Object reference not set to an instance of an object. at HAP.BookingSystem.BookingCondition.processCondition(Object o, String Condition) at HAP.BookingSystem.BookingCondition.processCondition(String Condition, Booking b, Resource r, BookingSystem bs) at HAP.BookingSystem.BookingRule.ExecuteRule(Booking b, Resource r, BookingSystem bs, Boolean IsRemoveEvent)

Posted (edited)

Using the same code as posted earlier



  
    
    bookcharging(booking.NextLesson().NextLesson())
    bookcharging(booking.PreviousLesson().PreviousLesson())
  

 

The booking gets made, and the emails sent (including Admin one, but it doesnt perform the actions in the rule - the error above is posted twice to the event log)

Edited by TheScarfedOne
  • 5 weeks later...
Posted
No progress as of yet, been working on other bits of HAP+ when I can. Most of my time at the moment is spent producing the timetable September, and all the meetings and work that entails.
  • 1 year later...

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