TheScarfedOne Posted December 19, 2012 Posted December 19, 2012 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?
nickbro Posted December 19, 2012 Posted December 19, 2012 At the moment, no, I think Paul is working on doing something with the charging rules
TheScarfedOne Posted December 19, 2012 Author Posted December 19, 2012 Great thanks Nick. When you have something that you would like tested on this - give me a nudge and Ill get it on my install.
nickbro Posted January 1, 2013 Posted January 1, 2013 @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.
TheScarfedOne Posted January 1, 2013 Author Posted January 1, 2013 Sure no prob...what needs looking at?
nickbro Posted January 4, 2013 Posted January 4, 2013 (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 January 4, 2013 by nickbro
TheScarfedOne Posted January 17, 2013 Author Posted January 17, 2013 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.
nickbro Posted January 17, 2013 Posted January 17, 2013 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
TheScarfedOne Posted January 17, 2013 Author Posted January 17, 2013 Yep, got me and my team listed by name, with a , and space between each entry. It's weird that we get the cancellations!!
nickbro Posted January 17, 2013 Posted January 17, 2013 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
TheScarfedOne Posted January 21, 2013 Author Posted January 21, 2013 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)
nickbro Posted January 21, 2013 Posted January 21, 2013 Ok, what rules have you defined. Is this stopping the admin emails?
TheScarfedOne Posted January 21, 2013 Author Posted January 21, 2013 (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 January 21, 2013 by TheScarfedOne
nickbro Posted January 23, 2013 Posted January 23, 2013 Ok, I'll have to look into this to see why, it hasn't been fully tested yet
TheScarfedOne Posted January 27, 2013 Author Posted January 27, 2013 No problem, drop me a message if you have a dll you'd like me to test
TheScarfedOne Posted February 25, 2013 Author Posted February 25, 2013 @nickbro, any progress on the booking actions bit? Not seen any movement on this thread...available to test if you need
nickbro Posted February 26, 2013 Posted February 26, 2013 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.
TheScarfedOne Posted February 26, 2013 Author Posted February 26, 2013 Thanks Nick. If there is anything you want me to try... Shout. Great work as always
minimoo Posted March 8, 2014 Posted March 8, 2014 @TheScarfedOne: Done some fixes on this functionality (bookingrules) today - so I can get some ideas on how other people do things - can you eloborate on what you actually needed?
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