Add New Task Status

Add New Task Status

NOTE: This feature is available starting from version 1.6.2

By default Our CRM ships with 5 predefined statuses, Not Started, In Progress, Testing, Awaiting Feedback, Complete but you can inject new statuses with simple action hook to fit for your needs.

The statuses Not StartedComplete and In Progress are core statuses and you should not modify these statuses in order everything to work properly.

We assume that you have some basic knowledge of reading php code for this article but won’t be that hard if you don’t have. You can just copy and paste the code and adjust the keys for your needs (see below keys explanation).

In this example you will add 2 new task statuses with name On Hold and Ready For Production

See below examples of code that you must add in application/helpers/my_functions_helper.php file (create the file if don’t exists)

<?php

// Version 2.3.0 and above
hooks()->add_filter('before_get_task_statuses','my_add_custom_task_status');

// Prior to version 2.3.0
// Uncomment the code below and remove the code above if you are using version older then 2.3.0
// add_action('before_get_task_statuses','my_add_custom_task_status');


function my_add_custom_task_status($current_statuses){
    // Push new status to the current statuses
    $current_statuses[] = array(
           'id'=>50, // new status with id 50
           'color'=>'#989898',
           'name'=>'On Hold',
           'order'=>10,
           'filter_default'=>true, // true or false

        );
    // Push another status (delete this code if you need to add only 1 status)
    $current_statuses[] = array(
          'id'=>51, //new status with new id 51
          'color'=>'#be51e0',
          'name'=>'Ready For Production',
          'order'=>11,
          'filter_default'=>true // true or false
        );

    // Return the statuses
    return $current_statuses;
}
The ID for each status must to be unique.
  • id – The id of the task status, its recommended to add higher id number to prevent overlapping the default system id’s for the task statuses. Eq now currently there is task statuses with id 1, 2, 3, 4 and 5 and in a future if new default task statuses is added with an id 6 and you already have injected your own status with id 6 can cause issues. Its not recommended to change the ID after there is tasks that are using the status id.
  • color – Color for this status in hex format.
  • name – The name of the status that will be displayed to users.
  • order – The order of the status, eq for kanban order.
  • filter_default – This option is used if you want to exclude the tasks that are using this status by default to be included in the lists tables. Eq if this option is false when you access the Tasks lists area (main tasks lists or related) by default the tasks that are using to this status wont be shown and you will neeed manually to use the filters to include in the table. A simple example here can be eq if you add status Cancelled, you won’t need cancelled tasks to be shown by default in the table.

After you adjust the code to fit for your needs save the file my_functions_helper.php and you will be able to see your new task statuses.

New Task Status
Task Mark As
    • Related Articles

    • Add New Project Status

      By default Our CRM ships with 5 predefined statuses, Not Started, In Progress, On Hold, Cancelled, Finished but you can inject new statuses with simple action hook to fit for your needs. The statuses Not Started and Finished are core statuses and ...
    • Create New Task

      In order to create a new task, from the main menu navigate to Tasks and click on the New Task button. Subject – Enter the subject for the task in order to easily identify it. Hourly Rate – Set task hourly rate Start Date – Set the date when the task ...
    • Task Timesheets

      Task timesheets is all started timers for specific task, timesheets are stored separately for each task started by the task assignees. To view all task timesheets while the task modal is open click on the timesheets icon. Below this button a table ...
    • Linking task to features

      Task can be linked to any important features in Perfex CRM to keep track of your work and assign important actions to your agents. Go to Tasks menu item from the main admin menu and on the top right button click New Task On the Related to field ...
    • New Survey

      Navigate the the aside menu Utilities and click Surveys – > New Survey. Populate the fields with basic data necessary for the survey then click on the submit button. You will be able to add questions after inserting the survey.