By default, SudoWorkspace ships with 5 predefined statuses: Not Started, In Progress, On Hold, Cancelled, Finished, but you can inject new statuses with a simple action hook to fit your needs.
We assume that you have some basic knowledge of reading php code for this article, but it won’t be that hard if you don’t have it. You can just copy and paste the code and adjust the keys for your needs (see below key explanation).
In this example, you will add 1 new project status with the name Planning
In application/helpers a create file my_functions_helper.php and add the following code:
application/helpers
my_functions_helper.php
<?php
hooks()->add_filter('before_get_project_statuses','my_add_custom_project_status');
function my_add_custom_project_status($current_statuses){
// Push new status to the current statuses
$current_statuses[] = array(
'id'=>50, // new status with id 50
'color'=>'#989898',
'name'=>'Planning',
'order'=>10,
'filter_default'=>true, // true or false
);
// Return the statuses
return $current_statuses;
}
<?php
hooks()->add_filter('before_get_project_statuses','my_add_custom_project_status');
function my_add_custom_project_status($current_statuses){
// Push new status to the current statuses
$current_statuses[] = array(
'id'=>50, // new status with id 50
'color'=>'#989898',
'name'=>'Planning',
'order'=>10,
'filter_default'=>true, // true or false
);
// Return the statuses
return $current_statuses;
}
<?php
hooks()->add_filter('before_get_project_statuses','my_add_custom_project_status');
function my_add_custom_project_status($current_statuses){
// Push new status to the current statuses
$current_statuses[] = array(
'id'=>50, // new status with id 50
'color'=>'#989898',
'name'=>'Planning',
'order'=>10,
'filter_default'=>true, // true or false
);
// Return the statuses
return $current_statuses;
}