Okay
  Public Ticket #1017776
Project Creation
Closed

Comments

  •  2
    Felice started the conversation

    Hi,

    It's possible to display in the project members my friends only and not all members registered?

    Waiting for reply

    Regards

  •  524
    Antonio replied

    Hi Felice,

    Do you mean during the creation process or just when an user display the project by frontend?

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi Antonio,

    I mean during the creation process in the frontend.

    Waiting for reply

    Regards

  •  524
    Antonio replied

    Hi Felice,

    That's possible but it requires a tricky customization. It's very very simple, but is tricky because it isn't possible to override this behavior by the child theme, so you need to add these 2 lines after every update of the theme.

    Open the file \woffice\inc\classes\Woffice_Frontend.php, search for this block:

    /**
     * Project Members select
     */
    $project_members = (!empty($post_id) && function_exists( 'fw_get_db_post_option' ) ) ? fw_get_db_post_option($post_id, 'project_members') : array();
    $html .= '

    '; $html .= ''; $html .= ''. __( 'If it\'s empty, all members\'ll be allowed to see it (leave empty for groups projects)', 'woffice' ). ''; $html .= ''; $tt_users_obj = get_users( array( 'fields' => array( 'ID', 'user_nicename', 'display_name' ) ) ); foreach ( $tt_users_obj as $tt_user ) { $selected = (in_array($tt_user->ID, $project_members)) ? "selected" : ""; $html .= '' . woffice_get_name_to_display( $tt_user->ID ) . ''; } $html .= ''; $html .= '

    ';

    and add this check:

    if(!bp_is_friend($tt_user))
        continue;

    In this way:

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi,
    I tried but it's don't work.
    I want to able to choose only my friends during project creation

    Waiting for reply
    Regards

    Attached files:  Schermata 2017-01-12 alle 22.50.45.jpg

  •  524
    Antonio replied

    Hi Felice,

    I am sorry, my bad. The code to add is:

    if(!bp_is_friend($tt_user->ID))
     continue;

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi,
    the code don't work yet. I always see all website members in the project creation.
    Waiting for reply
    Kind Regards

  •  524
    Antonio replied

    Hi Felice,

    I am very sorry for the double mistake, my intention isn't waste your time. I was sure of the behavior of the function used, which has lead me to the mistake.

    The right code to add is this one, I tested it on my side and it works well.

    if(bp_is_friend($tt_user->ID) != 'is_friend')
     continue;

    However, I just realized that there is a problem with this customization: if an user hasn't any friend, the box will be empty, but a project without any members is created, then all the members of the site will be able to access to that project.

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi Antonio, thank you. Now the creation project work correctly.

    Now I've an other problem. I want to make the website public. 

    With this option it's not possible to set the Login Page as Home Page because there is a problem after the login: the website don't make the redirect and display an error

    IS It possible to make the website public and to use login page as Home Page?

    Waiting for reply

    Kind Regards

  •  524
    Antonio replied

    Hi Felice,

    Unfortunately that's not possible, but I am sure that we can achieve what you goal if you explain me exactly what you need.

    If you set the login page as home page, then all users will see just the homepage as first page, without the chance to navigate the site, also if it is public so I cannot see the sense of it.

    Do you want that only certain sections of the site are public?

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi Antonio,

    I want to make public the post section.

    I modify the login page and I inserted in the left section a map with the post location. If I click on post or project location, I don't see it, but the website redirect to login page.

    You can check it at following page www.r-ange.it

    Waiting for reply

    Kind Regards

  •  524
    Antonio replied

    Hi Felice,

    You can procede in this way:

    1) Set the site as private:

    2) Exclude all pages you can from the "EXCLUDED PAGES" field (you can only exclude wordpress pages created by you, not genearted page, so only the project listing or blog listing):

    3) To force to public the single projects you can use this code:

    function woffice_redirect_user_additional_check( $redirect ) {
        
        if ( is_singular('project') ) {
            return false;
        }
        
        return $redirect;
    }
    add_filter('woffice_redirect_user_additional_check', 'woffice_redirect_user_additional_check');

    I hope that I haven't missed anything, otherwise please come back to me

    Best Regards,
    Antonio.

  •  8
    Ho replied

    Dear Antonio, 

    Projects are awesome. However, for large site the user selection is very impractical and because of that we can't use it :( 

    What would be quite awesome is to add users in a same way as you would when composing email (I attached image for clarification).
    I would use the same logic for selecting the project Category - if we have 100s or even 1000s of groups - selecting one or few can be nightmare.  

    Thank you for the consideration :)

    Attached files:  Screen Shot 2017-01-16 at 19.17.22.png

  •  524
    Antonio replied

    Hi Ho,

    Please create a new ticket if you don't have to write something about the exact issue of the current one. Unfortunately this is the current behavior of the users selection. It will be improved of course but I cannot provide an ETA at moment, I am sorry.

    Also I would anticipate that we are developing a new project manager plugin, which will solve all this little-but-frustrating current issues. Also there, I am not able to provide an ETA, but I can ensure you that you will like it

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi,

    Thank you. The website work correctly :) 

    Regards

  •  8
    Ho replied

    First of all, sorry for posting my previous comment ;) 

    Second, I can't wait for the new projects manager! I'll quietly wait for it ;) Thank you :)) 

  •  524
    Antonio replied

    You are welcome guys

    Best Regards,
    Antonio.

  •  2
    Felice replied

    Hi,

    If the user isn't logged can't display the blog categories. If i click on them i redirected to login page

    You can check it at following link:

    r-ange.it

    Waiting for reply

    Kind Regards

  •  524
    Antonio replied

    Hi Felice,

    Can you please send me a WP access in a private reply so that I can investigate more?

    Thank you

    Best Regards,
    Antonio.

  •   Felice replied privately
  •  452
    François replied

    Hello, 

    Sorry I don't understand the issue: 

    "If the user isn't logged can't display the blog categories. If i click on them i redirected to login page"

    May you rephrase please

    Kind Regards,

    François 

    Looking for visibility? Be featured on Woffice.io