| @@ -179,8 +179,11 @@ | ||
| 179 | 179 | add_action('wp_ajax_wppm_get_notifications',array($this,'wppm_get_notifications_callback')); |
| 180 | 180 | add_action('wp_ajax_wppm_mark_notification_read',array($this,'wppm_mark_notification_as_read')); |
| 181 | 181 | add_action('wp_ajax_wppm_archive_project',array($this,'wppm_archive_project')); |
| 182 | 182 | add_action('wp_ajax_wppm_archieve_project_list',array($this,'wppm_archieve_project_list'),100,1); |
| 183 | + add_action('wp_ajax_wppm_add_new_subtask',array($this,'wppm_add_new_subtask')); | |
| 184 | + add_action('wp_ajax_wppm_remove_subtask',array($this,'wppm_remove_subtask')); | |
| 185 | + add_action('wp_ajax_wppm_convert_subtask_to_task',array($this,'wppm_convert_subtask_to_task')); | |
| 183 | 186 | } |
| 184 | 187 | |
| 185 | 188 | // Load admin scripts |
| 186 | 189 | public function loadScripts(){ |
| @@ -395,8 +398,25 @@ | ||
| 395 | 398 | 'wppm-addons', |
| 396 | 399 | array($this,'wppm_addons') |
| 397 | 400 | ); |
| 398 | 401 | } |
| 402 | + | |
| 403 | + if ( current_user_can('manage_options') || current_user_can('wppm_admin') ) { | |
| 404 | + foreach ( wppm_get_locked_pro_addons_by_placement('menu') as $wppm_addon_key => $wppm_addon ) { | |
| 405 | + add_submenu_page( | |
| 406 | + 'wppm-dashboard', | |
| 407 | + $wppm_addon['label'], | |
| 408 | + $wppm_addon['label'] . ' <span class="wppm-pro-badge" title="' . esc_attr__('Pro feature', 'taskbuilder') . '">' . wppm_pro_badge_svg() . '</span>', | |
| 409 | + 'read', | |
| 410 | + 'wppm-pro-' . $wppm_addon_key, | |
| 411 | + function() use ( $wppm_addon ) { | |
| 412 | + $addon = $wppm_addon; | |
| 413 | + include WPPM_ABSPATH . 'includes/admin/wppm_pro_addon_teaser.php'; | |
| 414 | + } | |
| 415 | + ); | |
| 416 | + } | |
| 417 | + } | |
| 418 | + | |
| 399 | 419 | do_action('wppm_add_submenu_page'); |
| 400 | 420 | } |
| 401 | 421 | |
| 402 | 422 | public function wppm_projects(){ |
| @@ -655,8 +675,23 @@ | ||
| 655 | 675 | include WPPM_ABSPATH.'includes/admin/tasks/open_task/checklist/wppm_add_new_checklist.php'; |
| 656 | 676 | die(); |
| 657 | 677 | } |
| 658 | 678 | |
| 679 | + public function wppm_add_new_subtask(){ | |
| 680 | + include WPPM_ABSPATH.'includes/admin/tasks/open_task/subtask/wppm_add_new_subtask.php'; | |
| 681 | + die(); | |
| 682 | + } | |
| 683 | + | |
| 684 | + public function wppm_remove_subtask(){ | |
| 685 | + include WPPM_ABSPATH.'includes/admin/tasks/open_task/subtask/wppm_remove_subtask.php'; | |
| 686 | + die(); | |
| 687 | + } | |
| 688 | + | |
| 689 | + public function wppm_convert_subtask_to_task(){ | |
| 690 | + include WPPM_ABSPATH.'includes/admin/tasks/open_task/subtask/wppm_convert_subtask_to_task.php'; | |
| 691 | + die(); | |
| 692 | + } | |
| 693 | + | |
| 659 | 694 | public function wppm_add_new_checklist_item(){ |
| 660 | 695 | include WPPM_ABSPATH.'includes/admin/tasks/open_task/checklist/wppm_add_new_checklist_item.php'; |
| 661 | 696 | die(); |
| 662 | 697 | } |
| @@ -1231,14 +1266,17 @@ | ||
| 1231 | 1266 | die(); |
| 1232 | 1267 | } |
| 1233 | 1268 | |
| 1234 | 1269 | public function wppm_add_notification_container(){ |
| 1270 | + $mention_notification = get_option('wppm_default_global_mention_comment_notification',1); | |
| 1271 | + if ( ! $mention_notification ) { | |
| 1272 | + return; | |
| 1273 | + } | |
| 1235 | 1274 | echo |
| 1236 | 1275 | ' <div id="wppm_notification_bell"> |
| 1237 | 1276 | <i class="dashicons dashicons-bell"></i> |
| 1238 | 1277 | <span class="wppm-badge">0</span> |
| 1239 | 1278 | </div> |
| 1240 | - | |
| 1241 | 1279 | <div id="wppm-notification-container"></div>'; |
| 1242 | 1280 | } |
| 1243 | 1281 | |
| 1244 | 1282 | public function wppm_mark_notification_as_read(){ |