changes_only at user profile #280

This commit is contained in:
sbcgua 2016-10-14 10:35:24 +02:00
parent 43da32bb1a
commit ee6eaad06f
2 changed files with 43 additions and 14 deletions

View File

@ -411,6 +411,14 @@ CLASS lcl_persistence_user DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
RETURNING VALUE(rv_hide) TYPE abap_bool
RAISING lcx_exception.
METHODS toggle_changes_only
RETURNING VALUE(rv_changes_only) TYPE abap_bool
RAISING lcx_exception.
METHODS get_changes_only
RETURNING VALUE(rv_changes_only) TYPE abap_bool
RAISING lcx_exception.
PRIVATE SECTION.
CONSTANTS c_type_user TYPE lcl_persistence_db=>ty_type VALUE 'USER'.
@ -429,11 +437,12 @@ CLASS lcl_persistence_user DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
TYPES: ty_repo_config_tt TYPE STANDARD TABLE OF ty_repo_config WITH DEFAULT KEY.
TYPES: BEGIN OF ty_user,
username TYPE string,
email TYPE string,
repo_show TYPE lcl_persistence_repo=>ty_repo-key,
repo_config TYPE ty_repo_config_tt,
hide_files TYPE abap_bool,
username TYPE string,
email TYPE string,
repo_show TYPE lcl_persistence_repo=>ty_repo-key,
repo_config TYPE ty_repo_config_tt,
hide_files TYPE abap_bool,
changes_only TYPE abap_bool,
END OF ty_user.
METHODS constructor
@ -659,6 +668,25 @@ CLASS lcl_persistence_user IMPLEMENTATION.
ENDMETHOD. "get_hide_files
METHOD toggle_changes_only.
DATA ls_user TYPE ty_user.
ls_user = read( ).
ls_user-changes_only = boolc( ls_user-changes_only = abap_false ).
update( ls_user ).
rv_changes_only = ls_user-changes_only.
ENDMETHOD. "toggle_changes_only
METHOD get_changes_only.
rv_changes_only = read( )-changes_only.
ENDMETHOD. "get_changes_only
ENDCLASS.
CLASS lcl_persistence_db IMPLEMENTATION.

View File

@ -280,9 +280,10 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION.
super->constructor( ).
mo_repo ?= io_repo.
mv_cur_dir = '/'. " Root
mv_hide_files = lcl_app=>user( )->get_hide_files( ).
mo_repo ?= io_repo.
mv_cur_dir = '/'. " Root
mv_hide_files = lcl_app=>user( )->get_hide_files( ).
mv_changes_only = lcl_app=>user( )->get_changes_only( ).
ENDMETHOD. "constructor
@ -292,18 +293,18 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION.
CASE iv_action.
WHEN c_actions-toggle_hide_files. " Toggle file diplay
mv_hide_files = lcl_app=>user( )->toggle_hide_files( ).
ev_state = gc_event_state-re_render.
mv_hide_files = lcl_app=>user( )->toggle_hide_files( ).
ev_state = gc_event_state-re_render.
WHEN c_actions-change_dir. " Change dir
lv_path = lcl_html_action_utils=>dir_decode( iv_getdata ).
mv_cur_dir = lcl_path=>change_dir( iv_cur_dir = mv_cur_dir iv_cd = lv_path ).
ev_state = gc_event_state-re_render.
lv_path = lcl_html_action_utils=>dir_decode( iv_getdata ).
mv_cur_dir = lcl_path=>change_dir( iv_cur_dir = mv_cur_dir iv_cd = lv_path ).
ev_state = gc_event_state-re_render.
WHEN c_actions-toggle_folders. " Toggle folder view
mv_show_folders = boolc( mv_show_folders <> abap_true ).
mv_cur_dir = '/'. " Root
ev_state = gc_event_state-re_render.
WHEN c_actions-toggle_changes. " Toggle changes only view
mv_changes_only = boolc( mv_changes_only <> abap_true ).
mv_changes_only = lcl_app=>user( )->toggle_changes_only( ).
ev_state = gc_event_state-re_render.
ENDCASE.