Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1660 - Revert Record Back In Time Shape #1776

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
de28e62
Initial revert record back in time shape
kodinkat Aug 30, 2022
5a94eca
Reformatted dt-posts.php file
kodinkat Sep 5, 2022
c26919e
Support both connection and communication_channel field types
kodinkat Sep 6, 2022
dbdcb6c
Refreshed style.min.css
kodinkat Sep 6, 2022
7684c5c
Ensure all field types revert + Visual updates
kodinkat Sep 14, 2022
4a1b745
Addressed assignment code smell
kodinkat Sep 14, 2022
176bca3
Introduced style css new line
kodinkat Sep 14, 2022
a9f8d2c
Refreshed _main.scss
kodinkat Sep 14, 2022
1b9179a
update package-log
corsacca Sep 14, 2022
7e77a1c
rebuild css
corsacca Sep 14, 2022
ed9e0e5
Merge branch 'master' into 1660-revert-record-back-in-time
corsacca Nov 30, 2022
52d1aa6
phpcbf and and rebuild styles
corsacca Nov 30, 2022
12ff208
revert package lock
corsacca Nov 30, 2022
8f07e12
WIP: Initial shape of refactored core revert logic
kodinkat Dec 6, 2022
efbde1f
Latest revert logic shape - Still testing....
kodinkat Dec 8, 2022
64c6fb8
Resolved communication_channel duplicates + Cleaner exception handlin…
kodinkat Dec 9, 2022
0cc96e4
Better support of user_select blank user- entries
kodinkat Dec 12, 2022
59d04d9
Force show all activities by default + Replaced date range picker wit…
kodinkat Dec 14, 2022
e01fdde
Merge branch 'master' of https://github.com/DiscipleTools/disciple-to…
kodinkat Dec 14, 2022
8ecd0ea
Merge branch 'master' of https://github.com/DiscipleTools/disciple-to…
kodinkat Feb 23, 2023
6d1292f
Sanity checks and final tweaks!
kodinkat Feb 23, 2023
905f272
Addressed formatting code smells
kodinkat Feb 23, 2023
4f83ee0
Merge branch 'master' of https://github.com/DiscipleTools/disciple-to…
kodinkat Feb 28, 2023
e171c09
Merge branch 'master' of https://github.com/DiscipleTools/disciple-to…
kodinkat Mar 2, 2023
059eb87
Added support for link field types
kodinkat Mar 2, 2023
4f71527
Merge branch 'master' of https://github.com/DiscipleTools/disciple-to…
kodinkat Mar 2, 2023
bf323c5
Addressed static member reference code smell
kodinkat Mar 2, 2023
156f8fe
Only load js on details pages
corsacca Mar 3, 2023
b0cc197
Change string translation
corsacca Mar 3, 2023
6dcc857
Addressed snag-list + Additional field sanity checks
kodinkat Mar 6, 2023
6b22d3e
Filter to only show selected day + Suitable revert bot variable name.
kodinkat Mar 7, 2023
b967c41
Ignore permission checks for revert bot during field updates
kodinkat Mar 8, 2023
9b15a9d
Merge branch 'master' of https://github.com/DiscipleTools/disciple-to…
kodinkat Mar 10, 2023
3b4c295
Ensure title/name updates also capture text field type within activit…
kodinkat Mar 10, 2023
829fb5d
Don't trigger notifications on revert
corsacca Mar 14, 2023
f1001e6
Reduced activity endpoint calls on history modal show + Consolidated …
kodinkat Mar 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update package-log
  • Loading branch information
corsacca committed Sep 14, 2022
commit 1b9179a8de89539e4b0432aac82731521e30f559
70 changes: 70 additions & 0 deletions dt-people-groups/people-groups-base.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly.

class Disciple_Tools_People_Groups_Base {
public static $post_type = 'peoplegroups';
public $single_name = 'People Group';
public $plural_name = 'People Groups';

public function __construct() {
//setup post type
add_action( 'after_setup_theme', [ $this, 'after_setup_theme' ], 100 );
add_filter( 'dt_set_roles_and_permissions', [ $this, 'dt_set_roles_and_permissions' ], 20, 1 ); //after contacts
add_filter( 'dt_get_post_type_settings', [ $this, 'dt_get_post_type_settings' ], 20, 2 );

add_filter( 'dt_custom_fields_settings', [ $this, 'dt_custom_fields_settings' ], 10, 2 );

}

public function after_setup_theme(){
$this->single_name = __( 'People Group', 'disciple_tools' );
$this->plural_name = __( 'People Groups', 'disciple_tools' );

if ( class_exists( 'Disciple_Tools_Post_Type_Template' ) ) {
new Disciple_Tools_Post_Type_Template( $this->post_type, $this->single_name, $this->plural_name );
}
}

public function dt_get_post_type_settings( $settings, $post_type ){
if ( $post_type === $this->post_type ){
$settings['label_singular'] = __( 'Starter', 'disciple-tools-plugin-starter-template' );
$settings['label_plural'] = __( 'Starters', 'disciple-tools-plugin-starter-template' );
}
return $settings;
}

public function dt_set_roles_and_permissions( $expected_roles ){

if ( !isset( $expected_roles['multiplier'] ) ){
$expected_roles['multiplier'] = [

'label' => __( 'Multiplier', 'disciple-tools-plugin-starter-template' ),
'description' => 'Interacts with Contacts and Groups',
'permissions' => []
];
}

// if the user can access contact they also can access this post type
foreach ( $expected_roles as $role => $role_value ){
if ( isset( $role_value['permissions']['access_contacts'] ) && $role_value['permissions']['access_contacts'] ){
$expected_roles[$role]['permissions']['access_' . $this->post_type ] = true;
// $expected_roles[$role]['permissions']['create_' . $this->post_type] = true;
// $expected_roles[$role]['permissions']['update_' . $this->post_type] = true;
}
}

if ( isset( $expected_roles['administrator'] ) ){
$expected_roles['administrator']['permissions']['view_any_'.$this->post_type ] = true;
$expected_roles['administrator']['permissions']['update_any_'.$this->post_type ] = true;
$expected_roles['administrator']['permissions']['edit_peoplegroups'] = true;
}
if ( isset( $expected_roles['dt_admin'] ) ){
$expected_roles['dt_admin']['permissions']['view_any_'.$this->post_type ] = true;
$expected_roles['dt_admin']['permissions']['update_any_'.$this->post_type ] = true;
$expected_roles['dt_admin']['permissions']['edit_peoplegroups'] = true;
}
return $expected_roles;
}

}

64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.