| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 3 |
|
| 4 |
if ( ! class_exists( 'WPPM_Install' ) ) : |
| 5 |
|
| 6 |
final class WPPM_Install { |
| 7 |
public function __construct() { |
| 8 |
$this->check_version(); |
| 9 |
} |
| 10 |
/** |
| 11 |
* Check version of Taskbuilder |
| 12 |
*/ |
| 13 |
public function check_version(){ |
| 14 |
$installed_version = get_option( 'wppm_version' ); |
| 15 |
if( $installed_version != WPPM_VERSION ){ |
| 16 |
$this->create_db_tables(); |
| 17 |
add_action( 'init', array($this,'upgrade'), 101 ); |
| 18 |
} |
| 19 |
} |
| 20 |
/**** Create mysql tables****/ |
| 21 |
public function create_db_tables() { |
| 22 |
global $wpdb; |
| 23 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
| 24 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project ( |
| 25 |
id integer NOT NULL AUTO_INCREMENT, |
| 26 |
created_by integer, |
| 27 |
project_name VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 28 |
description LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 29 |
start_date datetime, |
| 30 |
end_date datetime, |
| 31 |
status integer, |
| 32 |
cat_id integer, |
| 33 |
users VARCHAR( 200 ) NULL DEFAULT '0', |
| 34 |
date_created datetime, |
| 35 |
PRIMARY KEY (id) |
| 36 |
);"; |
| 37 |
dbDelta( $sql ); |
| 38 |
|
| 39 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_meta ( |
| 40 |
id integer NOT NULL AUTO_INCREMENT, |
| 41 |
project_id integer, |
| 42 |
meta_key LONGTEXT NULL DEFAULT NULL, |
| 43 |
meta_value LONGTEXT NULL DEFAULT NULL, |
| 44 |
PRIMARY KEY (id) |
| 45 |
);"; |
| 46 |
dbDelta( $sql ); |
| 47 |
|
| 48 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_categories ( |
| 49 |
id integer NOT NULL AUTO_INCREMENT, |
| 50 |
name TINYTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 51 |
load_order int(11) NOT NULL DEFAULT '1', |
| 52 |
PRIMARY KEY (id) |
| 53 |
);"; |
| 54 |
dbDelta( $sql ); |
| 55 |
|
| 56 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_statuses ( |
| 57 |
id bigint(20) NOT NULL AUTO_INCREMENT, |
| 58 |
name varchar(200) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 59 |
color varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 60 |
bg_color varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 61 |
load_order int(11) NOT NULL DEFAULT '1', |
| 62 |
PRIMARY KEY (id) |
| 63 |
);"; |
| 64 |
dbDelta( $sql ); |
| 65 |
|
| 66 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_task_statuses ( |
| 67 |
id bigint(20) NOT NULL AUTO_INCREMENT, |
| 68 |
name varchar(200) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 69 |
color varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 70 |
bg_color varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 71 |
load_order int(11) NOT NULL DEFAULT '1', |
| 72 |
PRIMARY KEY (id) |
| 73 |
);"; |
| 74 |
dbDelta( $sql ); |
| 75 |
|
| 76 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_task_priorities ( |
| 77 |
id bigint(20) NOT NULL AUTO_INCREMENT, |
| 78 |
name varchar(200) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 79 |
color varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 80 |
bg_color varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL, |
| 81 |
load_order int(11) NOT NULL DEFAULT '1', |
| 82 |
PRIMARY KEY (id) |
| 83 |
);"; |
| 84 |
dbDelta( $sql ); |
| 85 |
|
| 86 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_task ( |
| 87 |
id integer NOT NULL AUTO_INCREMENT, |
| 88 |
created_by integer, |
| 89 |
task_name VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 90 |
description LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 91 |
project integer, |
| 92 |
start_date datetime, |
| 93 |
end_date datetime, |
| 94 |
status integer, |
| 95 |
priority integer, |
| 96 |
users VARCHAR( 200 ) NULL DEFAULT '0', |
| 97 |
date_created datetime, |
| 98 |
task_auth_code LONGTEXT NULL DEFAULT NULL, |
| 99 |
active int(11) DEFAULT 1, |
| 100 |
PRIMARY KEY (id) |
| 101 |
);"; |
| 102 |
dbDelta( $sql ); |
| 103 |
|
| 104 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_task_meta ( |
| 105 |
id integer NOT NULL AUTO_INCREMENT, |
| 106 |
task_id integer, |
| 107 |
meta_key LONGTEXT NULL DEFAULT NULL, |
| 108 |
meta_value LONGTEXT NULL DEFAULT NULL, |
| 109 |
PRIMARY KEY (id) |
| 110 |
);"; |
| 111 |
dbDelta( $sql ); |
| 112 |
|
| 113 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_checklist ( |
| 114 |
id integer NOT NULL AUTO_INCREMENT, |
| 115 |
task_id integer, |
| 116 |
checklist_name VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 117 |
created_by integer, |
| 118 |
PRIMARY KEY (id) |
| 119 |
);"; |
| 120 |
dbDelta( $sql ); |
| 121 |
|
| 122 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_checklist_items ( |
| 123 |
id integer NOT NULL AUTO_INCREMENT, |
| 124 |
checklist_id integer, |
| 125 |
item_name VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 126 |
checked integer, |
| 127 |
members VARCHAR( 200 ) NULL DEFAULT '0', |
| 128 |
due_date datetime, |
| 129 |
PRIMARY KEY (id) |
| 130 |
);"; |
| 131 |
dbDelta( $sql ); |
| 132 |
|
| 133 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_task_comment ( |
| 134 |
id integer NOT NULL AUTO_INCREMENT, |
| 135 |
task_id integer, |
| 136 |
body LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 137 |
attachment_ids TINYTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
| 138 |
create_time datetime, |
| 139 |
created_by integer, |
| 140 |
PRIMARY KEY (id) |
| 141 |
);"; |
| 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 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_attachments ( |
| 154 |
id BIGINT NOT NULL AUTO_INCREMENT, |
| 155 |
name VARCHAR(200) NOT NULL, |
| 156 |
file_name VARCHAR(200) NOT NULL, |
| 157 |
file_path VARCHAR(500) NOT NULL, |
| 158 |
is_image INT(1) NOT NULL DEFAULT 0, |
| 159 |
is_active INT(1) NOT NULL DEFAULT 0, |
| 160 |
is_uploaded INT(1) NOT NULL DEFAULT 0, |
| 161 |
date_created DATETIME NOT NULL, |
| 162 |
PRIMARY KEY (id) |
| 163 |
);"; |
| 164 |
dbDelta( $sql ); |
| 165 |
$sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}wppm_project_users ( |
| 166 |
id BIGINT NOT NULL AUTO_INCREMENT, |
| 167 |
proj_id integer, |
| 168 |
user_id integer, |
| 169 |
role_id integer, |
| 170 |
assigned_by integer, |
| 171 |
PRIMARY KEY (id) |
| 172 |
);"; |
| 173 |
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 |
} |
| 191 |
|
| 192 |
public function upgrade(){ |
| 193 |
global $wpdb; |
| 194 |
$installed_version = get_option( 'wppm_version' ); |
| 195 |
$installed_version = $installed_version ? $installed_version : 0; |
| 196 |
if($installed_version < '1.0.0'){ |
| 197 |
//User Roles |
| 198 |
$user_role = get_option('wppm_user_role'); |
| 199 |
if(empty($user_role)){ |
| 200 |
$user_role = array( |
| 201 |
1 => array( |
| 202 |
'label' => __('manager','taskbuilder'), |
| 203 |
), |
| 204 |
2 => array( |
| 205 |
'label' => __('co-worker','taskbuilder'), |
| 206 |
) |
| 207 |
); |
| 208 |
update_option('wppm_user_role',$user_role); |
| 209 |
} |
| 210 |
|
| 211 |
$wppm_email_notificatins = get_option('wppm_email_notification'); |
| 212 |
if(empty($wppm_email_notificatins)){ |
| 213 |
$wppm_email_notificatins = array( |
| 214 |
1=>array( |
| 215 |
'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'), |
| 218 |
'recipients'=>array(1,2) |
| 219 |
), |
| 220 |
2=>array( |
| 221 |
'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'), |
| 224 |
'recipients'=>array(1,2) |
| 225 |
), |
| 226 |
3=>array( |
| 227 |
'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'), |
| 230 |
'recipients'=>array(1,2) |
| 231 |
), |
| 232 |
4=>array( |
| 233 |
'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'), |
| 236 |
'recipients'=>array(1,2) |
| 237 |
), |
| 238 |
5=>array( |
| 239 |
'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'), |
| 242 |
'recipients'=>array(1,2) |
| 243 |
), |
| 244 |
6=>array( |
| 245 |
'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'), |
| 248 |
'recipients'=>array(1,2) |
| 249 |
), |
| 250 |
7=>array( |
| 251 |
'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'), |
| 254 |
'recipients'=>array(1,2) |
| 255 |
) |
| 256 |
); |
| 257 |
update_option('wppm_email_notification',$wppm_email_notificatins); |
| 258 |
} |
| 259 |
|
| 260 |
update_option('wppm_default_task_list_view',1); |
| 261 |
|
| 262 |
$default_statuses = $wpdb->get_var("select count(*) from {$wpdb->prefix}wppm_project_statuses"); |
| 263 |
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)); |
| 268 |
} |
| 269 |
$wppm_default_project_status = get_option('wppm_default_project_status',true); |
| 270 |
if($wppm_default_project_status == ''){ |
| 271 |
update_option('wppm_default_project_status',1); |
| 272 |
} |
| 273 |
$default_task_statuses = $wpdb->get_var("select count(*) from {$wpdb->prefix}wppm_task_statuses"); |
| 274 |
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)); |
| 279 |
} |
| 280 |
$wppm_default_task_status = get_option('wppm_default_task_status',true); |
| 281 |
if($wppm_default_task_status == ''){ |
| 282 |
update_option('wppm_default_task_status',1); |
| 283 |
} |
| 284 |
} |
| 285 |
if($installed_version < '1.0.2'){ |
| 286 |
update_option('wppm_project_time', 1); |
| 287 |
} |
| 288 |
if($installed_version < '2.0.0'){ |
| 289 |
update_option('wppm_default_project_date', 1); |
| 290 |
update_option('wppm_default_task_date', 1); |
| 291 |
} |
| 292 |
if($installed_version < '2.0.2'){ |
| 293 |
update_option('wppm_default_edit_tasks_permission', 0); |
| 294 |
} |
| 295 |
if($installed_version < '2.0.4'){ |
| 296 |
update_option('wppm_public_projects_permission',0); |
| 297 |
} |
| 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'=>__('[{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'), |
| 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 |
// update wppm_version option to plugin version |
| 465 |
update_option( 'wppm_version', WPPM_VERSION ); |
| 466 |
} |
| 467 |
} |
| 468 |
|
| 469 |
endif; |
| 470 |
|
| 471 |
new WPPM_Install(); |
| 472 |
|