Exemplo n.º 1
0
 /**
  * @param int $servicecontractid
  * @return mixed[]
  */
 private static function getContractTotalDetailedMgr($servicecontractid, $provDaysByType)
 {
     $detailledMgr = NULL;
     if (0 != $servicecontractid) {
         $contract = ServiceContractCache::getInstance()->getServiceContract($servicecontractid);
         $issueSelection = new IssueSelection("Total");
         // sidetasks
         $sidetasksPerCategory = $contract->getSidetasksPerCategoryType(true);
         foreach ($sidetasksPerCategory as $id => $iSel) {
             if (is_numeric($id) && Project::cat_st_inactivity == $id) {
                 continue;
             }
             $issueSelection->addIssueList($iSel->getIssueList());
         }
         // tasks
         $cmdsetsIssueSelection = $contract->getIssueSelection(CommandSet::type_general, Command::type_general);
         $issueSelection->addIssueList($cmdsetsIssueSelection->getIssueList());
         // provisions
         foreach ($provDaysByType as $nbDays) {
             $issueSelection->addProvision($nbDays);
         }
         #echo 'TotalSideTasks provision = '.$issueSelection->getProvision().'<br>';
         $detailledMgr = SmartyTools::getIssueSelectionDetailedMgr($issueSelection);
         $detailledMgr['name'] = $issueSelection->name;
     }
     return $detailledMgr;
 }