public function getGanttDivAttributes(Aoe_Scheduler_Model_Schedule $schedule)
    {

        if ($schedule->getStatus() == Aoe_Scheduler_Model_Schedule::STATUS_RUNNING) {
            $duration = time() - strtotime($schedule->getStarttime());
        } else {
            $duration = $schedule->getDuration() ? $schedule->getDuration() : 0;
        }
        $duration = $duration / $this->zoom;
        $duration = ceil($duration / 4) * 4 - 1; // round to numbers dividable by 4, then remove 1 px border
        $duration = max($duration, 3);

        $offset = (strtotime($schedule->getStarttime()) - $this->starttime) / $this->zoom;

        if ($offset < 0) { // cut bar
            $duration += $offset;
            $offset = 0;
        }

        $result = sprintf(
            '<div class="task %s" id="id_%s" style="width: %spx; left: %spx;" ></div>',
            $schedule->getStatus(),
            $schedule->getScheduleId(),
            $duration,
            $offset
        );

        if ($schedule->getStatus() == Aoe_Scheduler_Model_Schedule::STATUS_RUNNING) {
            $offset += $duration;

            $duration = strtotime($schedule->getEta()) - time();
            $duration = $duration / $this->zoom;

            $result = sprintf(
                '<div class="estimation" style="width: %spx; left: %spx;" ></div>',
                $duration,
                $offset
            ) . $result;
        }

        return $result;
    }
public function getGanttDivAttributes(Aoe_Scheduler_Model_Schedule $schedule)
    {

        if ($schedule->getStatus() == Aoe_Scheduler_Model_Schedule::STATUS_RUNNING) {
            $duration = time() - strtotime($schedule->getStarttime());
        } else {
            $duration = $schedule->getDuration() ? $schedule->getDuration() : 0;
        }
        $duration = $duration / $this->zoom;
        $duration = ceil($duration / 4) * 4 - 1; // round to numbers dividable by 4, then remove 1 px border
        $duration = max($duration, 3);

        $offset = (strtotime($schedule->getStarttime()) - $this->starttime) / $this->zoom;

        if ($offset < 0) { // cut bar
            $duration += $offset;
            $offset = 0;
        }

        $result = sprintf(
            '<div class="task %s" id="id_%s" style="width: %spx; left: %spx;" ></div>',
            $schedule->getStatus(),
            $schedule->getScheduleId(),
            $duration,
            $offset
        );

        if ($schedule->getStatus() == Aoe_Scheduler_Model_Schedule::STATUS_RUNNING) {
            $offset += $duration;

            $duration = strtotime($schedule->getEta()) - time();
            $duration = $duration / $this->zoom;

            $result = sprintf(
                '<div class="estimation" style="width: %spx; left: %spx;" ></div>',
                $duration,
                $offset
            ) . $result;
        }

        return $result;
    }
public function getGanttDivAttributes ( Aoe_Scheduler_Model_Schedule $ schedule ) { if ( $ schedule -> getStatus ( ) == Aoe_Scheduler_Model_Schedule :: STATUS_RUNNING ) { $ duration = time ( ) - strtotime ( $ schedule -> getStarttime ( ) ) ; } else { $ duration = $ schedule -> getDuration ( ) ? $ schedule -> getDuration ( ) : 0 ; } $ duration = $ duration / $ this -> zoom ; $ duration = ceil ( $ duration / 4 ) * 4 - 1 ; // round to numbers dividable by 4, then remove 1 px border $ duration = max ( $ duration , 3 ) ; $ offset = ( strtotime ( $ schedule -> getStarttime ( ) ) - $ this -> starttime ) / $ this -> zoom ; if ( $ offset < 0 ) { // cut bar $ duration += $ offset ; $ offset = 0 ; } $ result = sprintf ( '<div class="task %s" id="id_%s" style="width: %spx; left: %spx;" ></div>' , $ schedule -> getStatus ( ) , $ schedule -> getScheduleId ( ) , $ duration , $ offset ) ; if ( $ schedule -> getStatus ( ) == Aoe_Scheduler_Model_Schedule :: STATUS_RUNNING ) { $ offset += $ duration ; $ duration = strtotime ( $ schedule -> getEta ( ) ) - time ( ) ; $ duration = $ duration / $ this -> zoom ; $ result = sprintf ( '<div class="estimation" style="width: %spx; left: %spx;" ></div>' , $ duration , $ offset ) . $ result ; } return $ result ; }
Get attributes for div representing a gantt element

@param Aoe_Scheduler_Model_Schedule $schedule
@return string
Get attributes for div representing a gantt element