| @@ -139,18 +139,8 @@ | ||
| 139 | 139 | created_by integer, |
| 140 | 140 | PRIMARY KEY (id) |
| 141 | 141 | );"; |
| 142 | 142 | dbDelta( $sql ); |
| 143 | - $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_comment ( | |
| 144 | - id integer NOT NULL AUTO_INCREMENT, | |
| 145 | - proj_id integer, | |
| 146 | - body LONGTEXT NULL DEFAULT NULL, | |
| 147 | - attachment_ids TINYTEXT NULL DEFAULT NULL, | |
| 148 | - create_time datetime, | |
| 149 | - created_by integer, | |
| 150 | - PRIMARY KEY (id) | |
| 151 | - );"; | |
| 152 | - dbDelta( $sql ); | |
| 153 | 143 | $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_attachments ( |
| 154 | 144 | id BIGINT NOT NULL AUTO_INCREMENT, |
| 155 | 145 | name VARCHAR(200) NOT NULL, |
| 156 | 146 | file_name VARCHAR(200) NOT NULL, |
| @@ -170,24 +160,8 @@ | ||
| 170 | 160 | assigned_by integer, |
| 171 | 161 | PRIMARY KEY (id) |
| 172 | 162 | );"; |
| 173 | 163 | dbDelta( $sql ); |
| 174 | - $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_comment_meta ( | |
| 175 | - id BIGINT NOT NULL AUTO_INCREMENT, | |
| 176 | - proj_id integer, | |
| 177 | - comment_id integer, | |
| 178 | - comment_type VARCHAR(200) NOT NULL, | |
| 179 | - PRIMARY KEY (id) | |
| 180 | - );"; | |
| 181 | - dbDelta( $sql ); | |
| 182 | - $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_task_comment_meta ( | |
| 183 | - id BIGINT NOT NULL AUTO_INCREMENT, | |
| 184 | - task_id integer, | |
| 185 | - comment_id integer, | |
| 186 | - comment_type VARCHAR(200) NOT NULL, | |
| 187 | - PRIMARY KEY (id) | |
| 188 | - );"; | |
| 189 | - dbDelta( $sql ); | |
| 190 | 164 | } |
| 191 | 165 | |
| 192 | 166 | public function upgrade(){ |
| 193 | 167 | global $wpdb; |
| @@ -198,12 +172,12 @@ | ||
| 198 | 172 | $user_role = get_option('wppm_user_role'); |
| 199 | 173 | if(empty($user_role)){ |
| 200 | 174 | $user_role = array( |
| 201 | 175 | 1 => array( |
| 202 | - 'label' => esc_html__('manager','taskbuilder'), | |
| 176 | + 'label' => __('manager','taskbuilder'), | |
| 203 | 177 | ), |
| 204 | 178 | 2 => array( |
| 205 | - 'label' => esc_html__('co-worker','taskbuilder'), | |
| 179 | + 'label' => __('co-worker','taskbuilder'), | |
| 206 | 180 | ) |
| 207 | 181 | ); |
| 208 | 182 | update_option('wppm_user_role',$user_role); |
| 209 | 183 | } |
| @@ -212,46 +186,46 @@ | ||
| 212 | 186 | if(empty($wppm_email_notificatins)){ |
| 213 | 187 | $wppm_email_notificatins = array( |
| 214 | 188 | 1=>array( |
| 215 | 189 | 'type'=>'new_project', |
| 216 | - 'subject'=>esc_html__('New project has been created:{project_name}','taskbuilder'), | |
| 217 | - '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'), | |
| 190 | + 'subject'=>__('New project has been created:{project_name}','taskbuilder'), | |
| 191 | + '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'), | |
| 218 | 192 | 'recipients'=>array(1,2) |
| 219 | 193 | ), |
| 220 | 194 | 2=>array( |
| 221 | 195 | 'type'=>'new_task', |
| 222 | - 'subject'=>esc_html__('New task has been created: {task_name}','taskbuilder'), | |
| 223 | - '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'), | |
| 196 | + 'subject'=>__('New task has been created: {task_name}','taskbuilder'), | |
| 197 | + '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'), | |
| 224 | 198 | 'recipients'=>array(1,2) |
| 225 | 199 | ), |
| 226 | 200 | 3=>array( |
| 227 | 201 | 'type'=>'change_project_status', |
| 228 | - 'subject'=>esc_html__('{project_name} Project\'s status has been changed from {old_project_status} to {new_project_status}','taskbuilder'), | |
| 229 | - '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'), | |
| 202 | + 'subject'=>__('{project_name} Project\'s status has been changed from {old_project_status} to {new_project_status}','taskbuilder'), | |
| 203 | + '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'), | |
| 230 | 204 | 'recipients'=>array(1,2) |
| 231 | 205 | ), |
| 232 | 206 | 4=>array( |
| 233 | 207 | 'type'=>'change_task_status', |
| 234 | - 'subject'=>esc_html__('{task_name} Task\'s status has been changed from {old_task_status} to {new_task_status}','taskbuilder'), | |
| 235 | - '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'), | |
| 208 | + 'subject'=>__('{task_name} Task\'s status has been changed from {old_task_status} to {new_task_status}','taskbuilder'), | |
| 209 | + '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'), | |
| 236 | 210 | 'recipients'=>array(1,2) |
| 237 | 211 | ), |
| 238 | 212 | 5=>array( |
| 239 | 213 | 'type'=>'change_project_assign_users', |
| 240 | - 'subject'=>esc_html__('{project_name} Project\'s assigned users changed from {previously_assigned_project_users} to {project_assigned_users}','taskbuilder'), | |
| 241 | - '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'), | |
| 214 | + 'subject'=>__('{project_name} Project\'s assigned users changed from {previously_assigned_project_users} to {project_assigned_users}','taskbuilder'), | |
| 215 | + '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'), | |
| 242 | 216 | 'recipients'=>array(1,2) |
| 243 | 217 | ), |
| 244 | 218 | 6=>array( |
| 245 | 219 | 'type'=>'change_task_assign_users', |
| 246 | - 'subject'=>esc_html__('{task_name} Task\'s assigned users change from {previously_assigned_task_users} to {task_assigned_users}','taskbuilder'), | |
| 247 | - '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'), | |
| 220 | + 'subject'=>__('{task_name} Task\'s assigned users change from {previously_assigned_task_users} to {task_assigned_users}','taskbuilder'), | |
| 221 | + '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'), | |
| 248 | 222 | 'recipients'=>array(1,2) |
| 249 | 223 | ), |
| 250 | 224 | 7=>array( |
| 251 | 225 | 'type'=>'new_discussion', |
| 252 | - 'subject'=>esc_html__('[{project_name}][{task_name}] {last_comment_user_name} started new discussion:','taskbuilder'), | |
| 253 | - 'body'=>esc_html__('<p><strong>{last_comment_user_name}</strong> wrote:</p> <p>{comment_body}</p>','taskbuilder'), | |
| 226 | + 'subject'=>__('[{project_name}][{task_name}] {last_comment_user_name} started new discussion:','taskbuilder'), | |
| 227 | + 'body'=>__('<p><strong>{last_comment_user_name}</strong> wrote:</p> <p>{comment_body}</p>','taskbuilder'), | |
| 254 | 228 | 'recipients'=>array(1,2) |
| 255 | 229 | ) |
| 256 | 230 | ); |
| 257 | 231 | update_option('wppm_email_notification',$wppm_email_notificatins); |
| @@ -260,12 +234,12 @@ | ||
| 260 | 234 | update_option('wppm_default_task_list_view',1); |
| 261 | 235 | |
| 262 | 236 | $default_statuses = $wpdb->get_var("select count(*) from {$wpdb->prefix}wppm_project_statuses"); |
| 263 | 237 | if (empty($default_statuses)) { |
| 264 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 1,'name' => esc_html__('New','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 265 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 2,'name' => esc_html__('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 266 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 3,'name' => esc_html__('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 267 | - $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 4,'name' => esc_html__('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 238 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 1,'name' => __('New','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 239 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 2,'name' => __('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 240 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 3,'name' => __('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 241 | + $wpdb->insert($wpdb->prefix . "wppm_project_statuses", array('id' => 4,'name' => __('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 268 | 242 | } |
| 269 | 243 | $wppm_default_project_status = get_option('wppm_default_project_status',true); |
| 270 | 244 | if($wppm_default_project_status == ''){ |
| 271 | 245 | update_option('wppm_default_project_status',1); |
| @@ -271,12 +245,12 @@ | ||
| 271 | 245 | update_option('wppm_default_project_status',1); |
| 272 | 246 | } |
| 273 | 247 | $default_task_statuses = $wpdb->get_var("select count(*) from {$wpdb->prefix}wppm_task_statuses"); |
| 274 | 248 | if (empty($default_task_statuses)) { |
| 275 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 1,'name' => esc_html__('Todo','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 276 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 2,'name' => esc_html__('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 277 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 3,'name' => esc_html__('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 278 | - $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 4,'name' => esc_html__('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 249 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 1,'name' => __('Todo','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#306EFF','load_order'=>1)); | |
| 250 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 2,'name' => __('In Progress','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#FCD12A','load_order'=>2)); | |
| 251 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 3,'name' => __('Hold','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#D3D3D3','load_order'=>3)); | |
| 252 | + $wpdb->insert($wpdb->prefix . "wppm_task_statuses",array('id' => 4,'name' => __('Completed','taskbuilder'),'color'=>'#ffffff','bg_color'=>'#5cb85c','load_order'=>4)); | |
| 279 | 253 | } |
| 280 | 254 | $wppm_default_task_status = get_option('wppm_default_task_status',true); |
| 281 | 255 | if($wppm_default_task_status == ''){ |
| 282 | 256 | update_option('wppm_default_task_status',1); |
| @@ -294,238 +268,8 @@ | ||
| 294 | 268 | } |
| 295 | 269 | if($installed_version < '2.0.4'){ |
| 296 | 270 | update_option('wppm_public_projects_permission',0); |
| 297 | 271 | } |
| 298 | - if($installed_version < '2.0.8'){ | |
| 299 | - update_option('wppm_task_time',1); | |
| 300 | - } | |
| 301 | - if($installed_version < '3.0.0'){ | |
| 302 | - $wppm_email_notificatins = get_option('wppm_email_notification'); | |
| 303 | - if(!empty($wppm_email_notificatins) && !isset($wppm_email_notificatins[8])){ | |
| 304 | - $wppm_email_notificatins[8] = array( | |
| 305 | - 'type'=>'new_proj_discussion', | |
| 306 | - 'subject'=>esc_html__('[{project_name}] {last_proj_comment_user_name} started new discussion:','taskbuilder'), | |
| 307 | - 'body'=>esc_html__('<p><strong>{last_proj_comment_user_name}</strong> wrote:</p> <p>{proj_comment_body}</p>','taskbuilder'), | |
| 308 | - 'recipients'=>array(1,2) | |
| 309 | - ); | |
| 310 | - update_option('wppm_email_notification',$wppm_email_notificatins); | |
| 311 | - } | |
| 312 | - update_option( | |
| 313 | - 'wppm-ap-project-list', | |
| 314 | - array( | |
| 315 | - 'list-header-background-color' => '#304FFE', | |
| 316 | - 'list-header-text-color' => '#fff', | |
| 317 | - 'list-item-odd-background-color' => '#fff', | |
| 318 | - 'list-item-odd-text-color' => '#2C3E50', | |
| 319 | - 'list-item-even-background-color' => '#F2F2F2', | |
| 320 | - 'list-item-even-text-color' => '#2C3E50', | |
| 321 | - 'list-item-hover-background-color' => '#F5F5F5', | |
| 322 | - 'list-item-hover-text-color' => '#2C3E50' | |
| 323 | - ) | |
| 324 | - ); | |
| 325 | - update_option( | |
| 326 | - 'wppm-ap-task-list', | |
| 327 | - array( | |
| 328 | - 'list-header-button-background-color'=>'#0052CC', | |
| 329 | - 'list-header-button-hover-color' =>'#0065ff', | |
| 330 | - 'list-header-button-text-color' =>'#fff', | |
| 331 | - 'list-header-background-color' => '#304FFE', | |
| 332 | - 'list-header-text-color' => '#fff', | |
| 333 | - 'list-item-odd-background-color' => '#fff', | |
| 334 | - 'list-item-odd-text-color' => '#2C3E50', | |
| 335 | - 'list-item-even-background-color' => '#F2F2F2', | |
| 336 | - 'list-item-even-text-color' => '#2C3E50', | |
| 337 | - 'list-item-hover-background-color' => '#F5F5F5', | |
| 338 | - 'list-item-hover-text-color' => '#2C3E50', | |
| 339 | - ) | |
| 340 | - ); | |
| 341 | - update_option( | |
| 342 | - 'wppm-ap-individual-project', | |
| 343 | - array( | |
| 344 | - 'menu-button-bg-color' =>'#0052CC', | |
| 345 | - 'menu-button-hover-color' =>'#0065ff', | |
| 346 | - 'menu-button-text-color' =>'#fff', | |
| 347 | - 'comment-primary-color' => '#000000', | |
| 348 | - 'comment-secondary-color' => '#4e4e4e', | |
| 349 | - 'comment-date-color' => '#a8aeb5', | |
| 350 | - 'comment-date-hover-color' => '#000000', | |
| 351 | - 'comment-send-btn-bg-color' => '#5067c5', | |
| 352 | - 'comment-send-btn-color' => '#ffffff', | |
| 353 | - 'widget-header-bg-color' => '#ffffff', | |
| 354 | - 'widget-header-text-color' => '#2C3E50', | |
| 355 | - 'widget-body-bg-color' => '#ffffff', | |
| 356 | - 'widget-body-label-color' => '#9c9c9c', | |
| 357 | - 'widget-body-text-color' => '#2C3E50', | |
| 358 | - ) | |
| 359 | - ); | |
| 360 | - update_option( | |
| 361 | - 'wppm-ap-individual-task', | |
| 362 | - array( | |
| 363 | - 'comment-primary-color' => '#000000', | |
| 364 | - 'comment-secondary-color' => '#4e4e4e', | |
| 365 | - 'comment-date-color' => '#a8aeb5', | |
| 366 | - 'comment-date-hover-color' => '#000000', | |
| 367 | - 'comment-send-btn-bg-color' => '#5067c5', | |
| 368 | - 'comment-send-btn-color' => '#ffffff', | |
| 369 | - 'widget-header-bg-color' => '#ffffff', | |
| 370 | - 'widget-header-text-color' => '#2C3E50', | |
| 371 | - 'widget-body-bg-color' => '#ffffff', | |
| 372 | - 'widget-body-label-color' => '#9c9c9c', | |
| 373 | - 'widget-body-text-color' => '#2C3E50', | |
| 374 | - ) | |
| 375 | - ); | |
| 376 | - update_option( | |
| 377 | - 'wppm-ap-modal', | |
| 378 | - array( | |
| 379 | - 'header-bg-color' => '#ffffff', | |
| 380 | - 'header-text-color' => '#3c434a', | |
| 381 | - 'body-bg-color' => '#fff', | |
| 382 | - 'body-label-color' => '#3c434a', | |
| 383 | - 'body-text-color' => '#555', | |
| 384 | - 'footer-bg-color' => '#F6F6F6', | |
| 385 | - 'action-btn-bg-color' =>'#306EFF', | |
| 386 | - 'action-btn-text-color'=>'#fff', | |
| 387 | - 'z-index' => 900000000, | |
| 388 | - ) | |
| 389 | - ); | |
| 390 | - update_option( | |
| 391 | - 'wppm-ap-grid-view', | |
| 392 | - array( | |
| 393 | - 'menu-button-bg-color' =>'#0052CC', | |
| 394 | - 'menu-button-hover-color' =>'#0065ff', | |
| 395 | - 'menu-button-text-color' =>'#fff', | |
| 396 | - 'grid-background-color' => '#fff', | |
| 397 | - 'grid-header-text-color' => '#2C3E50' | |
| 398 | - ) | |
| 399 | - ); | |
| 400 | - update_option( | |
| 401 | - 'wppm-ap-settings', | |
| 402 | - array( | |
| 403 | - 'tab-background-color' => '#0052CC', | |
| 404 | - 'tab-text-color' => '#fff', | |
| 405 | - 'add-new-button-bg-color' =>'#0052CC', | |
| 406 | - 'add-new-button-text-color' =>'#fff', | |
| 407 | - 'add-new-button-hover-color'=>'#0065ff', | |
| 408 | - 'save-changes-button-bg-color'=>'#306EFF', | |
| 409 | - 'save-changes-button-text-color'=>'#fff' | |
| 410 | - ) | |
| 411 | - ); | |
| 412 | - } | |
| 413 | - if($installed_version < '3.0.1'){ | |
| 414 | - update_option('wppm_default_project_status', 1); | |
| 415 | - update_option('wppm_default_task_status', 1); | |
| 416 | - } | |
| 417 | - if($installed_version < '3.0.5'){ | |
| 418 | - update_option('wppm_tinymce_visibility_open_task',0); | |
| 419 | - update_option('wppm_tinymce_visibility_open_project',0); | |
| 420 | - update_option('wppm_default_email_notification_to_current_user', 1); | |
| 421 | - } | |
| 422 | - if($installed_version < '3.0.6'){ | |
| 423 | - update_option('wppm_allow_coworkers_create_task',1); | |
| 424 | - update_option('wppm_allow_coworkers_add_checklist',1); | |
| 425 | - update_option('wppm_allow_coworkers_assign_users', 0); | |
| 426 | - update_option('wppm_allow_coworkers_change_status', 1); | |
| 427 | - } | |
| 428 | - if($installed_version < '3.0.9'){ | |
| 429 | - update_option('wppm_rich_text_editor',1); | |
| 430 | - update_option( | |
| 431 | - 'wppm_toolbar_actions', | |
| 432 | - array( | |
| 433 | - 'bold' => '1', | |
| 434 | - 'italic' => '1', | |
| 435 | - 'underline' =>'1', | |
| 436 | - 'blockquote' =>'1', | |
| 437 | - 'align'=>'1', | |
| 438 | - 'bullist'=>'1', | |
| 439 | - 'numlist'=>'1', | |
| 440 | - 'rtl'=>'1', | |
| 441 | - 'link'=>'1', | |
| 442 | - 'wppm_insert_editor_img'=>'1', | |
| 443 | - 'forecolor'=>'0', | |
| 444 | - 'backcolor' => '0', | |
| 445 | - 'strikethrough' => '0' | |
| 446 | - ) | |
| 447 | - ); | |
| 448 | - } | |
| 449 | - | |
| 450 | - if($installed_version < '4.0.0'){ | |
| 451 | - update_option( | |
| 452 | - 'wppm-page-settings', | |
| 453 | - array( | |
| 454 | - 'task-url-page' => 0, | |
| 455 | - 'project-url-page' => 0 | |
| 456 | - ) | |
| 457 | - ); | |
| 458 | - } | |
| 459 | - | |
| 460 | - if($installed_version < '4.0.4'){ | |
| 461 | - update_option('wppm_date_setting','Y-m-d h:i:sa'); | |
| 462 | - } | |
| 463 | - | |
| 464 | - if($installed_version < '4.0.5'){ | |
| 465 | - update_option('wppm_hide_completed_status_proj','1'); | |
| 466 | - update_option('wppm_hide_completed_status_task','1'); | |
| 467 | - update_option('wppm_hide_proj_statuses_from_frontend','0'); | |
| 468 | - update_option('wppm_hide_task_statuses_from_frontend','0'); | |
| 469 | - update_option('wppm_proj_hide_comment_section','1'); | |
| 470 | - update_option('wppm_task_hide_comment_section','1'); | |
| 471 | - } | |
| 472 | - | |
| 473 | - if($installed_version < '5.0.0'){ | |
| 474 | - $wppm_print_settings = array( | |
| 475 | - 'wppm_print_body_font_size' => 10); | |
| 476 | - update_option('wppm_print_settings',$wppm_print_settings); | |
| 477 | - } | |
| 478 | - if($installed_version < '5.0.2'){ | |
| 479 | - $table_name = $wpdb->prefix . 'wppm_checklist_items'; | |
| 480 | - $column_name = 'load_order'; | |
| 481 | - $column_type = 'INT(11) NOT NULL DEFAULT 1'; | |
| 482 | - | |
| 483 | - $column_exists = $wpdb->get_var( | |
| 484 | - $wpdb->prepare( | |
| 485 | - "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 486 | - $column_name | |
| 487 | - ) | |
| 488 | - ); | |
| 489 | - | |
| 490 | - if ( null === $column_exists ) { | |
| 491 | - | |
| 492 | - // Column name and type are hardcoded, not user input. | |
| 493 | - // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 494 | - $wpdb->query( | |
| 495 | - "ALTER TABLE `$table_name` | |
| 496 | - ADD `$column_name` $column_type" | |
| 497 | - ); | |
| 498 | - } | |
| 499 | - $table_name = $wpdb->prefix . 'wppm_task'; | |
| 500 | - $cl_name = 'is_archived'; | |
| 501 | - $cl_type = 'TINYINT(1) DEFAULT 0'; | |
| 502 | - | |
| 503 | - $cl_exists = $wpdb->get_var( | |
| 504 | - $wpdb->prepare( | |
| 505 | - "SHOW COLUMNS FROM `$table_name` LIKE %s", | |
| 506 | - $cl_name | |
| 507 | - ) | |
| 508 | - ); | |
| 509 | - | |
| 510 | - if ( null === $cl_exists ) { | |
| 511 | - | |
| 512 | - $sql = sprintf( | |
| 513 | - 'ALTER TABLE `%s` ADD `%s` %s', | |
| 514 | - $table_name, | |
| 515 | - $cl_name, | |
| 516 | - $cl_type | |
| 517 | - ); | |
| 518 | - | |
| 519 | - // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Safe: identifiers are hardcoded. | |
| 520 | - $wpdb->query( $sql ); | |
| 521 | - } | |
| 522 | - } | |
| 523 | - if($installed_version < '5.0.3'){ | |
| 524 | - update_option('wppm_display_time_duration_project',0); | |
| 525 | - update_option('wppm_display_time_duration_task',0); | |
| 526 | - | |
| 527 | - } | |
| 528 | 272 | // update wppm_version option to plugin version |
| 529 | 273 | update_option( 'wppm_version', WPPM_VERSION ); |
| 530 | 274 | } |
| 531 | 275 | } |
| @@ -531,5 +275,5 @@ | ||
| 531 | 275 | } |
| 532 | 276 | |
| 533 | 277 | endif; |
| 534 | 278 | |
| 535 | -new WPPM_Install(); | |
| 279 | +new WPPM_Install(); | |