6f024609 by Jeremy Groot

fix to broker sidebar

1 parent 9ad8e1b1
......@@ -145,8 +145,6 @@ if ( class_exists( 'WP_CLI' ) ) {
// }
// syncBrokerListToPosts();
}
function rebuild_brokers_assigment($args ) {
......@@ -249,6 +247,8 @@ if ( class_exists( 'WP_CLI' ) ) {
update_option('broker_list', serialize($new_brokers));
syncBrokerListToPosts();
}
......@@ -334,6 +334,6 @@ if ( class_exists( 'WP_CLI' ) ) {
}
}
WP_CLI::add_command( 'tz_brokers', 'TZ_BROKER_COMMANDS' );
}
\ No newline at end of file
......
......@@ -2,13 +2,14 @@
$individual_assignments = get_field('assignments', 'option');
$user_broker_id = get_user_meta(7525, 'broker_id', true);
$farm_team_1 = get_field('farm_team_1', 'option');
$farm_team_2 = get_field('farm_team_2', 'option');
$commercial_team_1 = get_field('commercial_team_1', 'option');
$commercial_team_2 = get_field('commercial_team_2', 'option');
$commercial_team_3 = get_field('commercial_team_3', 'option');
$user_broker_id = get_user_meta(get_current_user_id(), 'broker_id', true);
// var_dump($user_broker_id);exit;
$farm_team_1 = get_field('farm_1', 'option');
$farm_team_2 = get_field('farm_2', 'option');
$commercial_team_1 = get_field('comm_1', 'option');
$commercial_team_2 = get_field('comm_2', 'option');
$commercial_team_3 = get_field('comme_3', 'option');
// var_dump($commercial_team_2);exit;
$assignment_arr = [['indep'=>[],'personal'=>[],'farm'=>[],'commercial'=>[]]];
......@@ -197,6 +198,7 @@
$cat = $staff_contact['category'];
$sub_cat = $staff_contact['sub_category'];
//Before check for if this is a direct broker assignment and it matches the current user
if($brokerages) {
if(!hasBrokerAssignment($user_broker_id, $brokerages)) {
......