Beispiel #1
0
def meeting_on_install(site):
    """ """
    add_observer_role(site)

    # add new map symbols for the meeting
    portal_map = site.getGeoMapTool()
    if portal_map is not None:
        new_map_symbols = [("meeting.png", "Meeting"), ("conference.png", "Conference"), ("workshop.png", "Workshop")]
        for i in range(len(new_map_symbols)):
            new_map_symbols[i] = (
                os.path.join(os.path.dirname(__file__), "www", "map_symbols", new_map_symbols[i][0]),
                new_map_symbols[i][1],
            )

        map_symbols = portal_map.getSymbolsListOrdered()
        map_symbols_titles = [s.title for s in map_symbols]
        new_map_symbols = [nms for nms in new_map_symbols if nms[1] not in map_symbols_titles]

        for filename, symbol_name in new_map_symbols:
            file = open(filename, "r")
            symbol = file.read()
            file.close()

            portal_map.adminAddSymbol(title=symbol_name, picture=symbol)

    configureEmailNotifications(site)
def meeting_on_install(site):
    """ """
    add_observer_role(site)

    # add new map symbols for the meeting
    portal_map = site.getGeoMapTool()
    if portal_map is not None:
        if NETWORK_NAME.lower() == 'eionet':
            new_map_symbols = [('conference.png', 'Conference', 10),
                               ('nrc_meeting.png', 'NRC meeting', 20),
                               ('nrc_webinar.png', 'NRC webinar', 30),
                               ('nfp_meeting.png', 'NFP meeting', 40),
                               ('nfp_webinar.png', 'NFP webinar', 50),
                               ('workshop.png', 'Workshop', 60)]
        else:
            new_map_symbols = [('conference.png', 'Conference', 10),
                               ('workshop.png', 'Workshop', 20)]
        for i in range(len(new_map_symbols)):
            new_map_symbols[i] = (os.path.join(os.path.dirname(__file__),
                                               'www', 'map_symbols',
                                               new_map_symbols[i][0]),
                                  new_map_symbols[i][1],
                                  new_map_symbols[i][2])

        map_symbols = portal_map.getSymbolsListOrdered()
        map_symbols_titles = [s.title for s in map_symbols]
        new_map_symbols = [nms for nms in new_map_symbols
                           if nms[1] not in map_symbols_titles]

        for filename, symbol_name, sortorder in new_map_symbols:
            file = open(filename, 'r')
            symbol = file.read()
            file.close()

            portal_map.adminAddSymbol(title=symbol_name, picture=symbol,
                                      sortorder=sortorder,
                                      id=filename.replace('.png', ''))

    configureEmailNotifications(site)