| @@ -96,8 +96,9 @@ | ||
| 96 | 96 | users VARCHAR( 200 ) NULL DEFAULT '0', |
| 97 | 97 | date_created datetime, |
| 98 | 98 | task_auth_code LONGTEXT NULL DEFAULT NULL, |
| 99 | 99 | active int(11) DEFAULT 1, |
| 100 | + parent_task_id integer NOT NULL DEFAULT 0, | |
| 100 | 101 | PRIMARY KEY (id) |
| 101 | 102 | );"; |
| 102 | 103 | dbDelta( $sql ); |
| 103 | 104 | |
| @@ -185,13 +186,23 @@ | ||
| 185 | 186 | comment_id integer, |
| 186 | 187 | comment_type VARCHAR(200) NOT NULL, |
| 187 | 188 | PRIMARY KEY (id) |
| 188 | 189 | );"; |
| 190 | + dbDelta( $sql ); | |
| 191 | + $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_notifications ( | |
| 192 | + id BIGINT AUTO_INCREMENT PRIMARY KEY, | |
| 193 | + user_id INT, | |
| 194 | + message TEXT, | |
| 195 | + link TEXT, | |
| 196 | + is_read TINYINT DEFAULT 0, | |
| 197 | + notification_type VARCHAR(200) NOT NULL, | |
| 198 | + created_at DATETIME DEFAULT CURRENT_TIMESTAMP | |
| 199 | + );"; | |
| 189 | 200 | dbDelta( $sql ); |
| 190 | 201 | } |
| 191 | 202 | |
| 192 | 203 | public function upgrade(){ |
| 193 | - global $wpdb; | |
| 204 | + global $wpdb,$wppmfunction; | |
| 194 | 205 | $installed_version = get_option( 'wppm_version' ); |
| 195 | 206 | $installed_version = $installed_version ? $installed_version : 0; |
| 196 | 207 | if($installed_version < '1.0.0'){ |
| 197 | 208 | //User Roles |
| @@ -198,12 +209,12 @@ | ||
| 198 | 209 | $user_role = get_option('wppm_user_role'); |
| 199 | 210 | if(empty($user_role)){ |
| 200 | 211 | $user_role = array( |
| 201 | 212 | 1 => array( |
| 202 | - 'label' => __('manager','taskbuilder'), | |
| 213 | + 'label' => esc_html__('manager','taskbuilder'), | |
| 203 | 214 | ), |
| 204 | 215 | 2 => array( |
| 205 | - 'label' => __('co-worker','taskbuilder'), | |
| 216 | + 'label' => esc_html__('co-worker','taskbuilder'), | |
| 206 | 217 | ) |
| 207 | 218 | ); |
| 208 | 219 | update_option('wppm_user_role',$user_role); |
| 209 | 220 | } |
| @@ -212,46 +223,46 @@ | ||
| 212 | 223 | if(empty($wppm_email_notificatins)){ |
| 213 | 224 | $wppm_email_notificatins = array( |
| 214 | 225 | 1=>array( |
| 215 | 226 | 'type'=>'new_project', |
| 216 | - 'subject'=>__('New project has been created:{project_name}','taskbuilder'), | |
| 217 | - 'body'=>__('<p><strong>{user_name}</strong> assigned project to you.</p> <p>Below are details of the project :</p><p><strong> Assign to:-</strong>{project_assigned_users}</p><p><strong> Start Date:-</strong>{project_start_date} </p><p> <strong> End Date:- </strong> {project_end_date} </p> <p><strong>Description:-</strong>{project_description}</p>','taskbuilder'), | |
| 227 | + 'subject'=>esc_html__('New project has been created:{project_name}','taskbuilder'), | |
| 228 | + 'body'=>esc_html__('<p><strong>{user_name}</strong> assigned project to you.</p> <p>Below are details of the project :</p><p><strong> Assign to:-</strong>{project_assigned_users}</p><p><strong> Start Date:-</strong>{project_start_date} </p><p> <strong> End Date:- </strong> {project_end_date} </p> <p><strong>Description:-</strong>{project_description}</p>','taskbuilder'), | |
| 218 | 229 | 'recipients'=>array(1,2) |
| 219 | 230 | ), |
| 220 | 231 | 2=>array( |
| 221 | 232 | 'type'=>'new_task', |
| 222 | - 'subject'=>__('New task has been created: {task_name}','taskbuilder'), | |
| 223 | - 'body'=>__('<p><strong>{user_name}</strong> assigned task to you.</p><p>Below are details of the task :</p> <p><strong>Assign to:-</strong>{task_assigned_users} </p><p><strong> Start Date:-</strong>{task_start_date}</p><p><strong>End Date:-</strong>{task_end_date} </p><p> <strong>Description:-</strong>{task_description}</p>','taskbuilder'), | |
| 233 | + 'subject'=>esc_html__('New task has been created: {task_name}','taskbuilder'), | |
| 234 | + 'body'=>esc_html__('<p><strong>{user_name}</strong> assigned task to you.</p><p>Below are details of the task :</p> <p><strong>Assign to:-</strong>{task_assigned_users} </p><p><strong> Start Date:-</strong>{task_start_date}</p><p><strong>End Date:-</strong>{task_end_date} </p><p> <strong>Description:-</strong>{task_description}</p>','taskbuilder'), | |
| 224 | 235 | 'recipients'=>array(1,2) |
| 225 | 236 | ), |
| 226 | 237 | 3=>array( |
| 227 | 238 | 'type'=>'change_project_status', |
| 228 | - 'subject'=>__('{project_name} Project\'s status has been changed from {old_project_status} to {new_project_status}','taskbuilder'), | |
| 229 | - 'body'=>__('<p><strong>{user_name}</strong> changed project\'s status to <strong>{new_project_status}</strong> </p> <p>Below are details of the project:</p><p><strong>Assign to:- </strong> {project_assigned_users}</p><p><strong>Start Date:-</strong>{project_start_date} </p> <p><strong>End Date:-</strong>{project_end_date} </p> <p><strong>Description:-</strong>{project_description}</p>','taskbuilder'), | |
| 239 | + 'subject'=>esc_html__('{project_name} Project\'s status has been changed from {old_project_status} to {new_project_status}','taskbuilder'), | |
| 240 | + 'body'=>esc_html__('<p><strong>{user_name}</strong> changed project\'s status to <strong>{new_project_status}</strong> </p> <p>Below are details of the project:</p><p><strong>Assign to:- </strong> {project_assigned_users}</p><p><strong>Start Date:-</strong>{project_start_date} </p> <p><strong>End Date:-</strong>{project_end_date} </p> <p><strong>Description:-</strong>{project_description}</p>','taskbuilder'), | |
| 230 | 241 | 'recipients'=>array(1,2) |
| 231 | 242 | ), |
| 232 | 243 | 4=>array( |
| 233 | 244 | 'type'=>'change_task_status', |
| 234 | - 'subject'=>__('{task_name} Task\'s status has been changed from {old_task_status} to {new_task_status}','taskbuilder'), | |
| 235 | - 'body'=>__('<p><strong>{user_name}</strong> changed task status to <strong>{new_task_status} </strong><p> Below are details of the task:</p> <p><strong>Assign to:-</strong>{task_assigned_users} </p> <p><strong>Start Date:-</strong>{task_start_date}</p><p><strong>End Date:-</strong>{task_end_date} </p> <p><strong>Description:-</strong>{task_description}</p>','taskbuilder'), | |
| 245 | + 'subject'=>esc_html__('{task_name} Task\'s status has been changed from {old_task_status} to {new_task_status}','taskbuilder'), | |
| 246 | + 'body'=>esc_html__('<p><strong>{user_name}</strong> changed task status to <strong>{new_task_status} </strong><p> Below are details of the task:</p> <p><strong>Assign to:-</strong>{task_assigned_users} </p> <p><strong>Start Date:-</strong>{task_start_date}</p><p><strong>End Date:-</strong>{task_end_date} </p> <p><strong>Description:-</strong>{task_description}</p>','taskbuilder'), | |
| 236 | 247 | 'recipients'=>array(1,2) |
| 237 | 248 | ), |
| 238 | 249 | 5=>array( |
| 239 | 250 | 'type'=>'change_project_assign_users', |
| 240 | - 'subject'=>__('{project_name} Project\'s assigned users changed from {previously_assigned_project_users} to {project_assigned_users}','taskbuilder'), | |
| 241 | - 'body'=>__('<p><strong>{user_name}</strong> changed project\'s assign users to <strong> {project_assigned_users}</strong></p> <p>Below are details of the project :</p><p><strong> Assign to:-</strong>{project_assigned_users}</p><p><strong> Start Date:-</strong>{project_start_date} </p><p> <strong> End Date:- </strong> {project_end_date} </p> <p><strong>Description:-</strong>{project_description}</p>','taskbuilder'), | |
| 251 | + 'subject'=>esc_html__('{project_name} Project\'s assigned users changed from {previously_assigned_project_users} to {project_assigned_users}','taskbuilder'), | |
| 252 | + 'body'=>esc_html__('<p><strong>{user_name}</strong> changed project\'s assign users to <strong> {project_assigned_users}</strong></p> <p>Below are details of the project :</p><p><strong> Assign to:-</strong>{project_assigned_users}</p><p><strong> Start Date:-</strong>{project_start_date} </p><p> <strong> End Date:- </strong> {project_end_date} </p> <p><strong>Description:-</strong>{project_description}</p>','taskbuilder'), | |
| 242 | 253 | 'recipients'=>array(1,2) |
| 243 | 254 | ), |
| 244 | 255 | 6=>array( |
| 245 | 256 | 'type'=>'change_task_assign_users', |
| 246 | - 'subject'=>__('{task_name} Task\'s assigned users change from {previously_assigned_task_users} to {task_assigned_users}','taskbuilder'), | |
| 247 | - 'body'=>__('<p><strong>{user_name}</strong> changed task\'s assign users to <strong>{task_assigned_users}</strong></p><p>Below are details of the task :</p> <p><strong>Assign to:-</strong>{task_assigned_users} </p><p><strong> Start Date:-</strong>{task_start_date}</p><p><strong>End Date:-</strong>{task_end_date} </p><p> <strong>Description:-</strong>{task_description}</p>','taskbuilder'), | |
| 257 | + 'subject'=>esc_html__('{task_name} Task\'s assigned users change from {previously_assigned_task_users} to {task_assigned_users}','taskbuilder'), | |
| 258 | + 'body'=>esc_html__('<p><strong>{user_name}</strong> changed task\'s assign users to <strong>{task_assigned_users}</strong></p><p>Below are details of the task :</p> <p><strong>Assign to:-</strong>{task_assigned_users} </p><p><strong> Start Date:-</strong>{task_start_date}</p><p><strong>End Date:-</strong>{task_end_date} </p><p> <strong>Description:-</strong>{task_description}</p>','taskbuilder'), | |
| 248 | 259 | 'recipients'=>array(1,2) |
| 249 | 260 | ), |
| 250 | 261 | 7=>array( |
| 251 | 262 | 'type'=>'new_discussion', |
| 252 | - 'subject'=>__('[{project_name}][{task_name}] {last_comment_user_name} started new discussion:','taskbuilder'), | |
| 253 | - 'body'=>__('<p><strong>{last_comment_user_name}</strong> wrote:</p> <p>{comment_body}</p>','taskbuilder'), | |
| 263 | + 'subject'=>esc_html__('[{project_name}][{task_name}] {last_comment_user_name} started new discussion:','taskbuilder'), | |
| 264 | + 'body'=>esc_html__('<p><strong>{last_comment_user_name}</strong> wrote:</p> <p>{comment_body}</p>','taskbuilder'), | |
| 254 | 265 | 'recipients'=>array(1,2) |
| 255 | 266 | ) |
| 256 | 267 | ); |
| 257 | 268 | update_option('wppm_email_notification',$wppm_email_notificatins); |
| @@ -260,12 +271,12 @@ | ||
| 260 | 271 | update_option('wppm_default_task_list_view',1); |
| 261 | 272 | |
| 262 | 273 | $default_statuses = $wpdb->get_var("select count(*) from {$wpdb->prefix}wppm_project_statuses"); |
| 263 | 274 | if (empty($default_statuses)) { |
| 264 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 1,'name' => __('New','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 265 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 2,'name' => __('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 266 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 3,'name' => __('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 267 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 4,'name' => __('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 275 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 1,'name' => esc_html__('New','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 276 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 2,'name' => esc_html__('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 277 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 3,'name' => esc_html__('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 278 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 4,'name' => esc_html__('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 268 | 279 | } |
| 269 | 280 | $wppm_default_project_status = get_option('wppm_default_project_status',true); |
| 270 | 281 | if($wppm_default_project_status == ''){ |
| 271 | 282 | update_option('wppm_default_project_status',1); |
| @@ -271,12 +282,12 @@ | ||
| 271 | 282 | update_option('wppm_default_project_status',1); |
| 272 | 283 | } |
| 273 | 284 | $default_task_statuses = $wpdb->get_var("select count(*) from {$wpdb->prefix}wppm_task_statuses"); |
| 274 | 285 | if (empty($default_task_statuses)) { |
| 275 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 1,'name' => __('Todo','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 276 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 2,'name' => __('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 277 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 3,'name' => __('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 278 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 4,'name' => __('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 286 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 1,'name' => esc_html__('Todo','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 287 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 2,'name' => esc_html__('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 288 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 3,'name' => esc_html__('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 289 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 4,'name' => esc_html__('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 279 | 290 | } |
| 280 | 291 | $wppm_default_task_status = get_option('wppm_default_task_status',true); |
| 281 | 292 | if($wppm_default_task_status == ''){ |
| 282 | 293 | update_option('wppm_default_task_status',1); |
| @@ -302,10 +313,10 @@ | ||
| 302 | 313 | $wppm_email_notificatins = get_option('wppm_email_notification'); |
| 303 | 314 | if(!empty($wppm_email_notificatins) && !isset($wppm_email_notificatins[8])){ |
| 304 | 315 | $wppm_email_notificatins[8] = array( |
| 305 | 316 | 'type'=>'new_proj_discussion', |
| 306 | - 'subject'=>__('[{project_name}] {last_proj_comment_user_name} started new discussion:','taskbuilder'), | |
| 307 | - 'body'=>__('<p><strong>{last_proj_comment_user_name}</strong> wrote:</p> <p>{proj_comment_body}</p>','taskbuilder'), | |
| 317 | + 'subject'=>esc_html__('[{project_name}] {last_proj_comment_user_name} started new discussion:','taskbuilder'), | |
| 318 | + 'body'=>esc_html__('<p><strong>{last_proj_comment_user_name}</strong> wrote:</p> <p>{proj_comment_body}</p>','taskbuilder'), | |
| 308 | 319 | 'recipients'=>array(1,2) |
| 309 | 320 | ); |
| 310 | 321 | update_option('wppm_email_notification',$wppm_email_notificatins); |
| 311 | 322 | } |
| @@ -311,8 +322,11 @@ | ||
| 311 | 322 | } |
| 312 | 323 | update_option( |
| 313 | 324 | 'wppm-ap-project-list', |
| 314 | 325 | array( |
| 326 | + 'list-header-button-background-color' => '#0052CC', | |
| 327 | + 'list-header-button-hover-color' => '#0065ff', | |
| 328 | + 'list-header-button-text-color' => '#fff', | |
| 315 | 329 | 'list-header-background-color' => '#304FFE', |
| 316 | 330 | 'list-header-text-color' => '#fff', |
| 317 | 331 | 'list-item-odd-background-color' => '#fff', |
| 318 | 332 | 'list-item-odd-text-color' => '#2C3E50', |
| @@ -474,9 +488,148 @@ | ||
| 474 | 488 | $wppm_print_settings = array( |
| 475 | 489 | 'wppm_print_body_font_size' => 10); |
| 476 | 490 | update_option('wppm_print_settings',$wppm_print_settings); |
| 477 | 491 | } |
| 492 | + if($installed_version < '5.0.2'){ | |
| 493 | + $table_name = $wpdb->prefix . 'wppm_checklist_items'; | |
| 494 | + $column_name = 'load_order'; | |
| 495 | + $column_type = 'INT(11) NOT NULL DEFAULT 1'; | |
| 478 | 496 | |
| 497 | + $column_exists = $wpdb->get_var( | |
| 498 | + $wpdb->prepare( | |
| 499 | + "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 500 | + $column_name | |
| 501 | + ) | |
| 502 | + ); | |
| 503 | + | |
| 504 | + if ( null === $column_exists ) { | |
| 505 | + | |
| 506 | + // Column name and type are hardcoded, not user input. | |
| 507 | + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 508 | + $wpdb->query( | |
| 509 | + "ALTER TABLE `$table_name` | |
| 510 | + ADD `$column_name` $column_type" | |
| 511 | + ); | |
| 512 | + } | |
| 513 | + $table_name = $wpdb->prefix . 'wppm_task'; | |
| 514 | + $cl_name = 'is_archived'; | |
| 515 | + $cl_type = 'TINYINT(1) DEFAULT 0'; | |
| 516 | + | |
| 517 | + $cl_exists = $wpdb->get_var( | |
| 518 | + $wpdb->prepare( | |
| 519 | + "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 520 | + $cl_name | |
| 521 | + ) | |
| 522 | + ); | |
| 523 | + | |
| 524 | + if ( null === $cl_exists ) { | |
| 525 | + | |
| 526 | + $sql = sprintf( | |
| 527 | + 'ALTER TABLE `%s` ADD `%s` %s', | |
| 528 | + $table_name, | |
| 529 | + $cl_name, | |
| 530 | + $cl_type | |
| 531 | + ); | |
| 532 | + | |
| 533 | + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Safe: identifiers are hardcoded. | |
| 534 | + $wpdb->query( $sql ); | |
| 535 | + } | |
| 536 | + } | |
| 537 | + if($installed_version < '5.0.3'){ | |
| 538 | + update_option('wppm_display_time_duration_project',0); | |
| 539 | + update_option('wppm_display_time_duration_task',0); | |
| 540 | + | |
| 541 | + } | |
| 542 | + if($installed_version < '5.0.6'){ | |
| 543 | + update_option('wppm_show_update_notice', 1); | |
| 544 | + $user_role = get_option('wppm_user_role'); | |
| 545 | + if (!isset($user_role[3])) { | |
| 546 | + $user_role[3] = array( | |
| 547 | + 'label' => esc_html__('Client', 'taskbuilder'), | |
| 548 | + ); | |
| 549 | + } | |
| 550 | + update_option('wppm_user_role', $user_role); | |
| 551 | + } | |
| 552 | + if($installed_version < '6.0.0'){ | |
| 553 | + $table_name = $wpdb->prefix . 'wppm_project'; | |
| 554 | + $column_name = 'project_auth_code'; | |
| 555 | + $column_type = 'LONGTEXT NULL DEFAULT NULL'; | |
| 556 | + $column_exists = $wpdb->get_var( | |
| 557 | + $wpdb->prepare( | |
| 558 | + "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 559 | + $column_name | |
| 560 | + ) | |
| 561 | + ); | |
| 562 | + if ( empty( $column_exists ) ) { | |
| 563 | + // Column name and type are hardcoded, not user input. | |
| 564 | + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 565 | + $wpdb->query( | |
| 566 | + "ALTER TABLE `$table_name` | |
| 567 | + ADD `$column_name` $column_type" | |
| 568 | + ); | |
| 569 | + } | |
| 570 | + $projects = $wpdb->get_results( | |
| 571 | + "SELECT id FROM {$wpdb->prefix}wppm_project | |
| 572 | + WHERE project_auth_code IS NULL OR project_auth_code = ''" | |
| 573 | + ); | |
| 574 | + foreach ( $projects as $project ) { | |
| 575 | + $wpdb->update( | |
| 576 | + "{$wpdb->prefix}wppm_project", | |
| 577 | + array( | |
| 578 | + 'project_auth_code' => $wppmfunction->getRandomString(10), | |
| 579 | + ), | |
| 580 | + array( | |
| 581 | + 'id' => $project->id, | |
| 582 | + ), | |
| 583 | + array('%s'), | |
| 584 | + array('%d') | |
| 585 | + ); | |
| 586 | + } | |
| 587 | + $table_name = $wpdb->prefix . 'wppm_project'; | |
| 588 | + $cl_name = 'is_archived'; | |
| 589 | + $cl_type = 'TINYINT(1) DEFAULT 0'; | |
| 590 | + $cl_exists = $wpdb->get_var( | |
| 591 | + $wpdb->prepare( | |
| 592 | + "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 593 | + $cl_name | |
| 594 | + ) | |
| 595 | + ); | |
| 596 | + if ( empty( $cl_exists ) ) { | |
| 597 | + $sql = sprintf( | |
| 598 | + 'ALTER TABLE `%s` ADD `%s` %s', | |
| 599 | + $table_name, | |
| 600 | + $cl_name, | |
| 601 | + $cl_type | |
| 602 | + ); | |
| 603 | + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Safe: identifiers are hardcoded. | |
| 604 | + $wpdb->query( $sql ); | |
| 605 | + } | |
| 606 | + } | |
| 607 | + if($installed_version < '6.0.6'){ | |
| 608 | + update_option('wppm_default_global_mention_comment_notification', 1); | |
| 609 | + $project_list_settings = get_option( 'wppm-ap-project-list', array() ); | |
| 610 | + $project_list_settings['list-header-button-background-color'] = '#0052CC'; | |
| 611 | + $project_list_settings['list-header-button-hover-color'] = '#0065ff'; | |
| 612 | + $project_list_settings['list-header-button-text-color'] = '#fff'; | |
| 613 | + update_option( 'wppm-ap-project-list', $project_list_settings ); | |
| 614 | + $table_name = $wpdb->prefix . 'wppm_task'; | |
| 615 | + $column_name = 'parent_task_id'; | |
| 616 | + $column_type = 'INT(11) NOT NULL DEFAULT 0'; | |
| 617 | + $column_exists = $wpdb->get_var( | |
| 618 | + $wpdb->prepare( | |
| 619 | + "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 620 | + $column_name | |
| 621 | + ) | |
| 622 | + ); | |
| 623 | + if ( empty( $column_exists ) ) { | |
| 624 | + // Column name and type are hardcoded, not user input. | |
| 625 | + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 626 | + $wpdb->query( | |
| 627 | + "ALTER TABLE `$table_name` | |
| 628 | + ADD `$column_name` $column_type" | |
| 629 | + ); | |
| 630 | + } | |
| 631 | + } | |
| 479 | 632 | // update wppm_version option to plugin version |
| 480 | 633 | update_option( 'wppm_version', WPPM_VERSION ); |
| 481 | 634 | } |
| 482 | 635 | } |
| @@ -482,5 +635,5 @@ | ||
| 482 | 635 | } |
| 483 | 636 | |
| 484 | 637 | endif; |
| 485 | 638 | |
| 486 | -new WPPM_Install(); | |
| 639 | +new WPPM_Install(); | |