Okay
  Public Ticket #2012486
Woffice Event Calendar
Closed

Comments

  •  6
    Subham started the conversation

    Hi,

    I want to use Woffice Event calendar for a quite different purpose. Is it possible that the admin can view all the user's calendar or something close to this feature?

    By the way please improve your support services.

    Thank you.

  •  606
    François replied

    Hi there, 

    Yes, if it doesn't work that way you can have it working by using this in your child theme's functions.php: 

    /**
     * Register calendar in personal profile menu item
     *
     */
    function woffice_personal_calendar_menu()
    {
        if (get_current_user_id() < 1) {
            return;
        }
        if (!fw_ext('woffice-event')) {
            return;
        }
        bp_core_new_nav_item(array(
            'name'                    => __('Calendar', 'woffice'),
            'slug'                    => 'calendar',
            'default_subnav_slug'     => 'calendar',
            'screen_function'         => 'woffice_personal_calendar_screen',
            'position'                => 20,
            'show_for_displayed_user' => false,
        ));
    }
    /**
     * Title of the calendar
     *
     * @return void
     */
    function woffice_members_page_function_to_show_screen_title()
    {
        _e('My Calendar', 'woffice');
    }
    if (!function_exists('woffice_personal_calendar_screen')) {
        /**
         * We register the screen for Buddypress engine
         *
         * @return null
         */
        function woffice_personal_calendar_screen()
        {
            add_action('bp_template_title', 'woffice_members_page_function_to_show_screen_title');
            add_action('bp_template_content', 'woffice_personal_calendar_content');
            bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
        }
    }

    The 2 first functions will need a different name and the third one must keeps its name. But you can change any thing regarding the Woffice Calendar feature by overriding the functions in your child theme. 

    Sure, we're always looking forward to improving our services, what would you need exactly? 

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  6
    Subham replied

    Hi Francios,

    Thanks for the code, but what exactly is the functionality of the code because I dont see any difference in my site. I am not able to see the calendars of other users. I want to maintain a page where I can see all calendars of the other users. 

  •  606
    François replied

    Hi there, 

    Yes, it's not a changed code, it's just extracted lines from the Woffice theme that you can customize. 

    You can remove this part: 

    if (get_current_user_id() < 1) {
            return;
        }
    

    And check the user's role insteadsmile.png 

    Let me know if you need more details here.

    Have a nice day

    Kind Regards,

    François 

    Want feedback on your awesome site? Get yourself a beta access on our new product Feedier.com here: https://feedier.com/

  •  6
    Subham replied

    Hi, 

    As an admin I want to see the calendars of all the users. So I think that code should work right? Because it is checking the id of the admin which is 1. But unfortunately it’s not working.

  •  239
    Abhishek replied

    Hello,

    It's not necessary for an admin to have id as 1, suppose you have two admins there's no way they can have same id.

    It's checking for proper authentication.

    You need to add a check if the current user is an administrator 

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  •  6
    Subham replied

    Yes you are right. I have used the condition as follows. Will it work?

    if (current_user_can('administrator')) {
            return;
  •  239
    Abhishek replied

    You should use something like this 

    if ( !current_user_can('administrator')) { 
           return;
    }

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.