Ejemplo n.º 1
0
 /**
  * @param SmartyHelper $smartyHelper
  * @param CommandSet $commandset
  */
 public static function displayCommandSet(SmartyHelper $smartyHelper, CommandSet $commandset, $isManager, $selectedFilters = '')
 {
     #$smartyHelper->assign('commandsetId', $commandset->getId());
     $smartyHelper->assign('teamid', $commandset->getTeamid());
     $smartyHelper->assign('commandsetName', $commandset->getName());
     $smartyHelper->assign('commandsetReference', $commandset->getReference());
     $smartyHelper->assign('commandsetDesc', $commandset->getDesc());
     $smartyHelper->assign('commandsetBudget', $commandset->getBudgetDays());
     $smartyHelper->assign('commandsetCost', $commandset->getCost());
     $smartyHelper->assign('commandsetCurrency', $commandset->getCurrency());
     if (!is_null($commandset->getDate())) {
         $smartyHelper->assign('commandsetDate', Tools::formatDate("%Y-%m-%d", $commandset->getDate()));
     }
     $smartyHelper->assign('cmdList', self::getCommandSetCommands($commandset->getId(), Command::type_general));
     $smartyHelper->assign('cmdsetDetailedMgr', self::getCommandSetDetailedMgr($commandset->getId(), Command::type_general));
     // Budget
     $cmdList = $commandset->getCommands(Command::type_general);
     $cmdsProvAndMeeCost = 0;
     foreach ($cmdList as $cmd) {
         // TODO math should not be in here !
         $mgrEE = $cmd->getIssueSelection()->mgrEffortEstim;
         $cmdProvAndMeeCost = $mgrEE * $cmd->getAverageDailyRate() + $cmd->getProvisionBudget(TRUE);
         $cmdsProvAndMeeCost += $cmdProvAndMeeCost;
     }
     $smartyHelper->assign('cmdsProvAndMeeCost', $cmdsProvAndMeeCost);
     $color1 = $cmdProvAndMeeCost > $commandset->getCost() ? "fcbdbd" : "bdfcbd";
     $smartyHelper->assign('cmdsProvAndMeeCostColor', $color1);
     //$cmdTotalElapsed = $commandset->getIssueSelection()->getElapsed($cmd->$commandset(), $commandset->getDeadline());
     $csetTotalElapsed = $commandset->getIssueSelection(Command::type_general)->getElapsed();
     $smartyHelper->assign('commandsetTotalElapsed', $csetTotalElapsed);
     $smartyHelper->assign('cmdProvisionList', self::getProvisionList($commandset));
     $smartyHelper->assign('cmdProvisionTotalList', self::getProvisionTotalList($commandset));
     // DetailedChargesIndicator
     $data = self::getDetailedCharges($commandset, $isManager, $selectedFilters);
     foreach ($data as $smartyKey => $smartyVariable) {
         $smartyHelper->assign($smartyKey, $smartyVariable);
     }
 }