<?php

///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
// VISIBLE AND MANDATORY FIELDS ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

// status
$CFG['globalEntity']['::Task']['status']['mandatory']=false;
$CFG['globalEntity']['::Task']['status']['invisible']=false;
$CFG['globalEntity']['::Task']['status']['validation']= ['list'=> ['notDistributed', 'distributed', 'pending', 'refused', 'inProgress', 'onHold', 'finished']];

// category
$CFG['globalEntity']['::Task']['idCategory']['mandatory']=true;
$CFG['globalEntity']['::Task']['idCategory']['invisible']=false;

// description
$CFG['globalEntity']['::Task']['description']['mandatory']=true;
$CFG['globalEntity']['::Task']['description']['invisible']=false;

// priority
$CFG['globalEntity']['::Task']['priority']['mandatory']=true;
$CFG['globalEntity']['::Task']['priority']['invisible']=false;

// department
$CFG['globalEntity']['::Task']['idDepartment']['mandatory']=true;
$CFG['globalEntity']['::Task']['idDepartment']['invisible']=false;

// office
$CFG['globalEntity']['::Task']['idOffice']['mandatory']=true;
$CFG['globalEntity']['::Task']['idOffice']['invisible']=false;

// assignor
$CFG['globalEntity']['::Task']['idAssignorUser']['mandatory']=false;
$CFG['globalEntity']['::Task']['idAssignorUser']['invisible']=false;

// responsible
$CFG['globalEntity']['::Task']['idResponsibleUser']['mandatory']=false;
$CFG['globalEntity']['::Task']['idResponsibleUser']['invisible']=false;

// free task
$CFG['globalEntity']['::Task']['free']['mandatory']=false;
$CFG['globalEntity']['::Task']['free']['invisible']=false;

// deadline
$CFG['globalEntity']['::Task']['deadline']['mandatory']=true;
$CFG['globalEntity']['::Task']['deadline']['invisible']=false;

// pivot
$CFG['globalEntity']['::Task']['pivot']['mandatory']=false;
$CFG['globalEntity']['::Task']['pivot']['invisible']=false;
$CFG['globalEntity']['::Task']['pivot']['validation']= ['list'=>$CFG['tasks']['pivotsList']];

// // id pivot is linked to pivot, so no need to configure invisibility
$CFG['globalEntity']['::Task']['idPivot']['mandatory']=false;

// operationType
$CFG['globalEntity']['::Task']['idOperationType']['mandatory']=false;
$CFG['globalEntity']['::Task']['idOperationType']['invisible']=false;

// file
$CFG['globalEntity']['::Task']['fileName']['mandatory']=false;
$CFG['globalEntity']['::Task']['fileName']['invisible']=false;

// comments
$CFG['globalEntity']['::Task']['comments']['mandatory']=false;
$CFG['globalEntity']['::Task']['comments']['invisible']=false;


// SPECIAL CONFIGS ////////////////////////////////////////////////////////////////////////////////

// List of reasons for status "refused"
$CFG['globalEntity']['::Task']['_special']['statusReasonsList']['refused'] = ['noTime', 'notInTheOffice', 'other'];

// List of reasons for status "onHold"
$CFG['globalEntity']['::Task']['_special']['statusReasonsList']['onHold']  = ['clientPayment', 'supplierConfirm', 'clientConfirm', 'other'];

// Alert types for notifications
$CFG['globalEntity']['::Task']['_special']['eventTypes'] = ['alert', 'alertEmail'];


