C
C
Cool942018-12-05 15:51:17
CMS
Cool94, 2018-12-05 15:51:17

What is the best way to implement a personal account for project managers?

Good afternoon. It is necessary to implement a personal account for the site, where managers will register and enter data about the clients they bring (full name, UNP, TIN, etc.). And the moderator or general manager should be able to view some statistics for each manager.
Maybe there is a plugin for WP to at least implement this basicly?
Or what is the best way to do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaliy Orlov, 2018-12-05
@orlov0562

I don't know the plugin.
I would make each manager/moderator its own role and access rights (capabilities) and from them I would build interfaces where users with a certain role can do certain actions.

J
Jupiter Max, 2018-12-05
@vardoLP

actually it is full of plug-ins for authorization of users. Well, there you already check the user and show him the desired section of the site.

A
Alexander Sobolev, 2018-12-10
@san_jorich

The best plugin in your case is one written by you for your needs.
Let's start with a breakdown of what's what:
Clients - Custom Post Type 'agency_clients' with arbitrary fields Full name TIN UNP OKVED XZ etc etc etc.
Operations with Clients 'agency_operation' -

Custom Post Type
if ( ! function_exists('agency_operations_post_type') ) {

function agency_operations_post_type() {

    $operations_labels = array(
        'name'                  => _x( 'Логи операций', 'agency_operations' ),
        'singular_name'         => _x( 'Логи операций', 'agency_operations' ),
        'menu_name'             => __( 'Логи операций', 'agency_operations' ),
        'name_admin_bar'        => __( 'Операция', 'agency_operations' ),
        'archives'              => __( 'Завершенные операции', 'agency_operations' ),
        'attributes'            => __( 'Аттрибуты операции', 'agency_operations' ),
        'parent_item_colon'     => __( 'Главная операция:', 'agency_operations' ),
        'all_items'             => __( 'Все Операции', 'agency_operations' ),
        'add_new_item'          => __( 'Добавить новую операцию', 'agency_operations' ),
        'add_new'               => __( 'Добавить новую операцию', 'agency_operations' ),
        'new_item'              => __( 'Новая операция', 'agency_operations' ),
        'edit_item'             => __( 'Редактировать Операцию', 'agency_operations' ),
        'update_item'           => __( 'Обновиить Операцию', 'agency_operations' ),
        'view_item'             => __( 'Просмотеть Операцию', 'agency_operations' ),
        'view_items'            => __( 'Просмотреть Операцию', 'agency_operations' ),
        'search_items'          => __( 'Найти Операцию', 'agency_operations' ),
        'not_found'             => __( 'Операций не проводилось', 'agency_operations' ),
        'not_found_in_trash'    => __( 'Корзина Операций пуста', 'agency_operations' ),
        'featured_image'        => __( 'Изображение Операции', 'agency_operations' ),
        'set_featured_image'    => __( 'Установить изображение Операции', 'agency_operations' ),
        'remove_featured_image' => __( 'Удалить изображение Операции', 'agency_operations' ),
        'use_featured_image'    => __( 'Все изображения Операции', 'agency_operations' ),
        'insert_into_item'      => __( 'Добавить в Объект', 'agency_operations' ),
        'uploaded_to_this_item' => __( 'Прикрепить к этой Операции', 'agency_operations' ),
        'items_list'            => __( 'Лист операций', 'agency_operations' ),
        'items_list_navigation' => __( 'Лист операций', 'agency_operations' ),
        'filter_items_list'     => __( 'Фильтр Операций', 'agency_operations' ),
    );
    $operations_args = array(
        'label'                 => __( 'Логи операций', 'agency_operations' ),
        'description'           => __( 'Логи операций.', 'agency_operations' ),
        'labels'                => $operations_labels,
        'supports'              => array( 'title', 'editor', 'revisions', 'thumbnail' ),
        'taxonomies'            => array( 'agency_operation_type'),
        'hierarchical'          => false,
        'public'                => true,
        'show_ui'               => true,
        'show_in_menu'          => true,
        'menu_position'         => 5,
        'menu_icon'             => 'dashicons-admin-home',
        'show_in_admin_bar'     => true,
        'show_in_nav_menus'     => true,
        'can_export'            => true,
        'has_archive'           => true,
        'exclude_from_search'   => true,
        'publicly_queryable'    => true,
        'capability_type'       => 'page',
    );
    register_post_type( 'agency_operations', $operations_args );

}
add_action( 'init', 'agency_operations_post_type', 0 );

}

with Custom Taxonomy - types of transactions
Manager -
Role
* Роль: Менеджер */ 
register_activation_hook( __FILE__, 'create_manager_role' );
function create_manager_role(){
  $new_role = add_role('amanager', 'Менеджер', array(
      'upload_files' => true,
      'edit_posts' => true,
      'edit_published_posts' => true,
      'publish_posts' => true,
      'read' => true,
      'delete_posts' => false,
      'delete_published_posts' => true,
      'moderate_comments'=> true,
    )
  );  
}
register_deactivation_hook( __FILE__, 'delete_manager_role' );
function delete_manager_role(){  remove_role( 'manager' ); }
.
Catch the actions of managers and publish them in the operation. Combine everything in a simple interface and your task is completed successfully

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question