def _getSideMenu(self): minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() self._leftMenu = wcomponents.BasicSideMenu(self._getAW().getUser() != None) self._showResponsible = False if minfo.getRoomBookingModuleActive() and CrossLocationDB.isConnected(): self._showResponsible = ( self._getAW().getUser() != None ) and self._getAW().getUser().isResponsibleForRooms() self._roomsOpt = wcomponents.SideMenuSection(_("View Rooms"), \ urlHandlers.UHRoomBookingSearch4Rooms.getURL() ) self._roomSearchOpt = wcomponents.SideMenuItem(_("Search rooms"), urlHandlers.UHRoomBookingSearch4Rooms.getURL(), enabled=True) self._roomMapOpt = wcomponents.SideMenuItem(_("Map of rooms"), urlHandlers.UHRoomBookingMapOfRooms.getURL(), enabled=True) self._myRoomListOpt = wcomponents.SideMenuItem(_("My rooms"), urlHandlers.UHRoomBookingRoomList.getURL( onlyMy = True ), enabled=self._showResponsible) self._bookingsOpt = wcomponents.SideMenuSection(_("View Bookings"), \ urlHandlers.UHRoomBookingSearch4Bookings.getURL()) self._bookARoomOpt = wcomponents.SideMenuItem(_("Book a Room"), \ urlHandlers.UHRoomBookingSearch4Rooms.getURL( forNewBooking = True ), enabled=True) self._bookingListSearchOpt = wcomponents.SideMenuItem(_("Search bookings"), urlHandlers.UHRoomBookingSearch4Bookings.getURL(), enabled=True) self._bookingListCalendarOpt = wcomponents.SideMenuItem(_("Calendar"), urlHandlers.UHRoomBookingBookingList.getURL( today = True, allRooms = True ), enabled=True) self._myBookingListOpt = wcomponents.SideMenuItem(_("My bookings"), urlHandlers.UHRoomBookingBookingList.getURL( onlyMy = True, autoCriteria = True ), enabled=True) self._myPreBookingListOpt = wcomponents.SideMenuItem(_("My PRE-bookings"), urlHandlers.UHRoomBookingBookingList.getURL( onlyMy = True, onlyPrebookings = True, autoCriteria = True ), enabled=True) self._usersBookings = wcomponents.SideMenuItem(_("Bookings in my rooms"), urlHandlers.UHRoomBookingBookingList.getURL( ofMyRooms = True, autoCriteria = True ), enabled=self._showResponsible) self._usersPrebookings = wcomponents.SideMenuItem(_("PRE-bookings in my rooms"), urlHandlers.UHRoomBookingBookingList.getURL( ofMyRooms = True, onlyPrebookings = True, autoCriteria = True ), enabled=self._showResponsible) self._leftMenu.addSection( self._roomsOpt ) self._roomsOpt.addItem( self._roomSearchOpt ) self._roomsOpt.addItem( self._roomMapOpt ) self._roomsOpt.addItem( self._myRoomListOpt ) self._leftMenu.addSection( self._bookingsOpt ) self._bookingsOpt.addItem( self._bookARoomOpt ) self._bookingsOpt.addItem( self._bookingListSearchOpt ) self._bookingsOpt.addItem( self._bookingListCalendarOpt ) self._bookingsOpt.addItem( self._myBookingListOpt ) self._bookingsOpt.addItem( self._myPreBookingListOpt ) self._bookingsOpt.addItem( self._usersBookings ) self._bookingsOpt.addItem( self._usersPrebookings ) return self._leftMenu
def _getSideMenu(self): minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() self._leftMenu = wcomponents.BasicSideMenu(self._getAW().getUser() != None) self._showResponsible = False if minfo.getRoomBookingModuleActive() and CrossLocationDB.isConnected(): self._showResponsible = \ (self._getAW().getUser() != None) and \ (Room.isAvatarResponsibleForRooms(self._getAW().getUser()) \ or self._getAW().getUser().isAdmin() \ or self._getAW().getUser().isRBAdmin()) self._roomsOpt = wcomponents.SideMenuSection(_("View Rooms"), \ urlHandlers.UHRoomBookingSearch4Rooms.getURL() ) self._roomSearchOpt = wcomponents.SideMenuItem(_("Search rooms"), urlHandlers.UHRoomBookingSearch4Rooms.getURL(), enabled=True) self._roomMapOpt = wcomponents.SideMenuItem(_("Map of rooms"), urlHandlers.UHRoomBookingMapOfRooms.getURL(), enabled=True) self._myRoomListOpt = wcomponents.SideMenuItem(_("My rooms"), urlHandlers.UHRoomBookingRoomList.getURL( onlyMy = True ), enabled=self._showResponsible) self._bookingsOpt = wcomponents.SideMenuSection(_("View Bookings"), \ urlHandlers.UHRoomBookingSearch4Bookings.getURL()) self._bookARoomOpt = wcomponents.SideMenuItem(_("Book a Room"), \ urlHandlers.UHRoomBookingSearch4Rooms.getURL( forNewBooking = True ), enabled=True) self._bookingListSearchOpt = wcomponents.SideMenuItem(_("Search bookings"), urlHandlers.UHRoomBookingSearch4Bookings.getURL(), enabled=True) self._bookingListCalendarOpt = wcomponents.SideMenuItem(_("Calendar"), urlHandlers.UHRoomBookingBookingList.getURL( today = True, allRooms = True ), enabled=True) self._myBookingListOpt = wcomponents.SideMenuItem(_("My bookings"), urlHandlers.UHRoomBookingBookingList.getURL( onlyMy = True, autoCriteria = True ), enabled=True) self._myPreBookingListOpt = wcomponents.SideMenuItem(_("My PRE-bookings"), urlHandlers.UHRoomBookingBookingList.getURL( onlyMy = True, onlyPrebookings = True, autoCriteria = True ), enabled=True) self._usersBookings = wcomponents.SideMenuItem(_("Bookings in my rooms"), urlHandlers.UHRoomBookingBookingList.getURL( ofMyRooms = True, autoCriteria = True ), enabled=self._showResponsible) self._usersPrebookings = wcomponents.SideMenuItem(_("PRE-bookings in my rooms"), urlHandlers.UHRoomBookingBookingList.getURL( ofMyRooms = True, onlyPrebookings = True, autoCriteria = True ), enabled=self._showResponsible) self._blockingsOpt = wcomponents.SideMenuSection(_("Room Blocking")) self._usersBlockings = wcomponents.SideMenuItem(_("Blockings for my rooms"), urlHandlers.UHRoomBookingBlockingsMyRooms.getURL( filterState='pending' ), enabled=self._showResponsible) if self._showResponsible: self._myBlockingListOpt = wcomponents.SideMenuItem(_("My blockings"), urlHandlers.UHRoomBookingBlockingList.getURL( onlyMine = True, onlyRecent = True ), enabled=True) else: self._myBlockingListOpt = wcomponents.SideMenuItem(_("Blockings"), urlHandlers.UHRoomBookingBlockingList.getURL( onlyRecent = True ), enabled=True) self._blockRooms = wcomponents.SideMenuItem(_("Block rooms"), urlHandlers.UHRoomBookingBlockingForm.getURL(), enabled=self._showResponsible) if self._rh._getUser().isRBAdmin(): self._adminSect = wcomponents.SideMenuSection(_("Administration"), \ urlHandlers.UHRoomBookingAdmin.getURL() ) self._adminOpt = wcomponents.SideMenuItem(_("Administration"), \ urlHandlers.UHRoomBookingAdmin.getURL() ) self._leftMenu.addSection( self._roomsOpt ) self._roomsOpt.addItem( self._roomSearchOpt ) if Location.getDefaultLocation() and Location.getDefaultLocation().isMapAvailable(): self._roomsOpt.addItem( self._roomMapOpt ) self._roomsOpt.addItem( self._myRoomListOpt ) self._leftMenu.addSection( self._bookingsOpt ) self._bookingsOpt.addItem( self._bookARoomOpt ) self._bookingsOpt.addItem( self._bookingListSearchOpt ) self._bookingsOpt.addItem( self._bookingListCalendarOpt ) self._bookingsOpt.addItem( self._myBookingListOpt ) self._bookingsOpt.addItem( self._myPreBookingListOpt ) self._bookingsOpt.addItem( self._usersBookings ) self._bookingsOpt.addItem( self._usersPrebookings ) self._leftMenu.addSection( self._blockingsOpt ) self._blockingsOpt.addItem( self._blockRooms ) self._blockingsOpt.addItem( self._myBlockingListOpt ) self._blockingsOpt.addItem( self._usersBlockings ) if self._rh._getUser().isRBAdmin(): self._leftMenu.addSection( self._adminSect ) self._adminSect.addItem( self._adminOpt ) return self._leftMenu
def _getSideMenu(self): minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() self._leftMenu = wcomponents.BasicSideMenu( self._getAW().getUser() != None) self._showResponsible = False if minfo.getRoomBookingModuleActive() and CrossLocationDB.isConnected( ): self._showResponsible = \ (self._getAW().getUser() != None) and \ (Room.isAvatarResponsibleForRooms(self._getAW().getUser()) \ or self._getAW().getUser().isAdmin() \ or self._getAW().getUser().isRBAdmin()) self._roomsOpt = wcomponents.SideMenuSection(_("View Rooms"), \ urlHandlers.UHRoomBookingSearch4Rooms.getURL() ) self._roomSearchOpt = wcomponents.SideMenuItem( _("Search rooms"), urlHandlers.UHRoomBookingSearch4Rooms.getURL(), enabled=True) self._roomMapOpt = wcomponents.SideMenuItem( _("Map of rooms"), urlHandlers.UHRoomBookingMapOfRooms.getURL(), enabled=True) self._myRoomListOpt = wcomponents.SideMenuItem( _("My rooms"), urlHandlers.UHRoomBookingRoomList.getURL(onlyMy=True), enabled=self._showResponsible) self._bookingsOpt = wcomponents.SideMenuSection(_("View Bookings"), \ urlHandlers.UHRoomBookingSearch4Bookings.getURL()) self._bookARoomOpt = wcomponents.SideMenuItem(_("Book a Room"), \ urlHandlers.UHRoomBookingSearch4Rooms.getURL( forNewBooking = True ), enabled=True) self._bookingListSearchOpt = wcomponents.SideMenuItem( _("Search bookings"), urlHandlers.UHRoomBookingSearch4Bookings.getURL(), enabled=True) self._bookingListCalendarOpt = wcomponents.SideMenuItem( _("Calendar"), urlHandlers.UHRoomBookingBookingList.getURL(today=True, allRooms=True), enabled=True) self._myBookingListOpt = wcomponents.SideMenuItem( _("My bookings"), urlHandlers.UHRoomBookingBookingList.getURL(onlyMy=True, autoCriteria=True), enabled=True) self._myPreBookingListOpt = wcomponents.SideMenuItem( _("My PRE-bookings"), urlHandlers.UHRoomBookingBookingList.getURL(onlyMy=True, onlyPrebookings=True, autoCriteria=True), enabled=True) self._usersBookings = wcomponents.SideMenuItem( _("Bookings in my rooms"), urlHandlers.UHRoomBookingBookingList.getURL(ofMyRooms=True, autoCriteria=True), enabled=self._showResponsible) self._usersPrebookings = wcomponents.SideMenuItem( _("PRE-bookings in my rooms"), urlHandlers.UHRoomBookingBookingList.getURL(ofMyRooms=True, onlyPrebookings=True, autoCriteria=True), enabled=self._showResponsible) self._blockingsOpt = wcomponents.SideMenuSection(_("Room Blocking")) self._usersBlockings = wcomponents.SideMenuItem( _("Blockings for my rooms"), urlHandlers.UHRoomBookingBlockingsMyRooms.getURL( filterState='pending'), enabled=self._showResponsible) if self._showResponsible: self._myBlockingListOpt = wcomponents.SideMenuItem( _("My blockings"), urlHandlers.UHRoomBookingBlockingList.getURL(onlyMine=True, onlyRecent=True), enabled=True) else: self._myBlockingListOpt = wcomponents.SideMenuItem( _("Blockings"), urlHandlers.UHRoomBookingBlockingList.getURL(onlyRecent=True), enabled=True) self._blockRooms = wcomponents.SideMenuItem( _("Block rooms"), urlHandlers.UHRoomBookingBlockingForm.getURL(), enabled=self._showResponsible) if self._rh._getUser().isRBAdmin(): self._adminSect = wcomponents.SideMenuSection(_("Administration"), \ urlHandlers.UHRoomBookingAdmin.getURL() ) self._adminOpt = wcomponents.SideMenuItem(_("Administration"), \ urlHandlers.UHRoomBookingAdmin.getURL() ) self._leftMenu.addSection(self._roomsOpt) self._roomsOpt.addItem(self._roomSearchOpt) if Location.getDefaultLocation() and Location.getDefaultLocation( ).isMapAvailable(): self._roomsOpt.addItem(self._roomMapOpt) self._roomsOpt.addItem(self._myRoomListOpt) self._leftMenu.addSection(self._bookingsOpt) self._bookingsOpt.addItem(self._bookARoomOpt) self._bookingsOpt.addItem(self._bookingListSearchOpt) self._bookingsOpt.addItem(self._bookingListCalendarOpt) self._bookingsOpt.addItem(self._myBookingListOpt) self._bookingsOpt.addItem(self._myPreBookingListOpt) self._bookingsOpt.addItem(self._usersBookings) self._bookingsOpt.addItem(self._usersPrebookings) self._leftMenu.addSection(self._blockingsOpt) self._blockingsOpt.addItem(self._blockRooms) self._blockingsOpt.addItem(self._myBlockingListOpt) self._blockingsOpt.addItem(self._usersBlockings) if self._rh._getUser().isRBAdmin(): self._leftMenu.addSection(self._adminSect) self._adminSect.addItem(self._adminOpt) return self._leftMenu