Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timelineview now shows the name and groups - better overview, if you … #340

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
phpunit*.phar
phpunit*.phar
.idea/*
6 changes: 3 additions & 3 deletions app/code/community/Aoe/Scheduler/Block/Adminhtml/Timeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ public function getNowline()


/**
* Get all available job codes
* Get all available jobs
*
* @return array
*/
public function getAvailableJobCodes()
public function getAvailableJobs()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets be non breaking by keeping the old method.

{
return array_keys($this->schedules);
return $this->schedules;
}


Expand Down
13 changes: 10 additions & 3 deletions app/code/community/Aoe/Scheduler/Model/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
* @method Aoe_Scheduler_Model_Job setParameters($parameters)
* @method string getParameters()
* @method Aoe_Scheduler_Model_Job setGroups($groups)
* @method string getGroups()
* @method Aoe_Scheduler_Model_Job setOnSuccess($onSuccess)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove setOnSuccess and getOnSuccess? these methods are being used

* @method string getOnSuccess()
* @method array getGroups()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getgroups can be removed from here as it's implemented below.

* @method Aoe_Scheduler_Model_Job load($jobCode)
* @method Aoe_Scheduler_Model_Resource_Job getResource()
* @method Aoe_Scheduler_Model_Resource_Job_Collection getCollection()
Expand Down Expand Up @@ -55,6 +53,15 @@ public function getName()
return $name;
}

public function getGroups()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add doc comment with return type

{
$groups = $this->getData('groups');
if (empty($groups)) {
$groups = $this->getJobCode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like it. Its surprising to get jobCode from getGroups getter.
I also don't see a benefit of this change.
In the template you do

if ($_groups !== $_jobCode):
                                echo $this->__('<b>Crongroups:</b> ') . $_groups;
                            endif;

which can be simplified to "if ($_groups):" once you remove adding of $this->getJobCode(); to groups, right?

}
return $groups;
}

/**
* @param bool $flag
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* @var $this Aoe_Scheduler_Block_Adminhtml_Timeline */
$_helper = $this->helper('aoe_scheduler/data');
/* @var $_helper Aoe_Scheduler_Helper_Data */
$_jobCodes = $this->getAvailableJobCodes(); /* @var $_jobCodes array */
$_jobs = $this->getAvailableJobs(); /* @var $_jobs array */
?>

<div class="content-header">
Expand All @@ -16,7 +16,7 @@ $_jobCodes = $this->getAvailableJobCodes(); /* @var $_jobCodes array */

<div id="maincontainer">

<?php if (count($_jobCodes) > 0): ?>
<?php if (count($_jobs) > 0): ?>

<div id="contentwrapper">
<div id="contentcolumn">
Expand All @@ -33,10 +33,9 @@ $_jobCodes = $this->getAvailableJobCodes(); /* @var $_jobCodes array */
</div>
</div>

<?php foreach ($_jobCodes as $jobCode): /* @var $jobCode string */ ?>
<?php $_schedules = $this->getSchedulesForCode($jobCode); ?>
<?php foreach ($_jobs as $_jobCode => $_schedules): /* @var $_jobCode string */ /* @var $_schedules array */ ?>
<div class="row">
<div class="timeline timeline_<?php echo $jobCode; ?>">
<div class="timeline timeline_<?php echo $_jobCode; ?>">
<?php foreach ($_schedules as $_schedule): /* @var $_schedule Aoe_Scheduler_Model_Schedule */ ?>
<?php echo $this->getGanttDivAttributes($_schedule); ?>
<?php echo $this->getLayout()->createBlock('aoe_scheduler/adminhtml_timelineDetail')->setSchedule($_schedule)->toHtml(); ?>
Expand All @@ -58,10 +57,21 @@ $_jobCodes = $this->getAvailableJobCodes(); /* @var $_jobCodes array */
- <?php echo $_helper->decorateTime($this->getEndtime(), true, 'Y-m-d H:i'); ?></div>
</div>

<?php foreach ($_jobCodes as $jobCode): /* @var $jobCode string */ ?>
<?php foreach ($_jobs as $_jobCode => $_schedules): /* @var $_jobCode string */ /* @var $_schedules array */ ?>
<div class="row">
<div class="configuration">
<?php echo $jobCode; ?>
<div class="timeline-row-info">
<?php
$_schedule = reset($_schedules);
$_name = $_schedule->getJob()->getName();
$_groups = $_schedule->getJob()->getGroups();
if ($_name !== $_jobCode):
echo $this->__('<b>Name:</b> ') . $_name . "<br>";
endif;
echo $this->__('<b>Job Code:</b> ') . $_jobCode . "<br>";
if ($_groups !== $_jobCode):
echo $this->__('<b>Crongroups:</b> ') . $_groups;
endif;
?>
</div>
</div>
<?php endforeach; ?>
Expand All @@ -72,4 +82,4 @@ $_jobCodes = $this->getAvailableJobCodes(); /* @var $_jobCodes array */
<?php echo $this->__('No tasks found.'); ?>
<?php endif; ?>

</div><!-- id="maincontainer" -->
</div><!-- id="maincontainer" -->
Binary file added doc/images/groups-and-names-in-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#Forked

Add the Name and the Crongroup Name in the Timelineview. Better overview, if you have many jobs and groups.

![Groups and Names in Timeline](doc/images/groups-and-names-in-timeline.png)

###

<img align="right" style="float: right; height: 200px;" src="doc/images/Aoe_Scheduler_Icon.png">

# AOE Scheduler for Magento
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
margin-left: -100%;
}

.configuration {
padding: 5px;
}

#leftcolumn .row {
background-color: #F6F6F6;
border-right: 1px solid #DADFE0;
height: 40px;
padding: 5px;
}

#leftcolumn .row.hours {
background-color: transparent;
height: 20px;
text-align: right;
padding-right: 5px;
padding: 0 5px;
font-size: 10px;
}

Expand All @@ -49,7 +48,7 @@ div.row {
border-bottom: 1px solid #DADFE0;
padding: 0;
margin: 0;
height: 40px;
height: 50px;
}

div.timeline-box {
Expand All @@ -66,6 +65,11 @@ div.timeline {
position: relative;
}

.timeline-row-info {
font-size: 10px;
line-height: 12px;
}

div.hours {
height: 20px;
}
Expand Down Expand Up @@ -128,7 +132,7 @@ div.hours {

.task, .estimation {
position: absolute;
height: 24px;
height: 34px;
top: 8px;
cursor: default;
}
Expand All @@ -141,20 +145,17 @@ div.hours {

.details-headline.error, .task.error,
.details-headline.killed, .task.killed,
.details-headline.died, .task.died,
.details-headline.gone, .task.gone { background-color: #E41300; }

.details-headline.success, .task.success,
.details-headline.repeat, .task.repeat { background-color: #36B963; }
.details-headline.success, .task.success { background-color: #36B963; }
.details-headline.nothing, .task.nothing { background-color: #92D6A9; }
.details-headline.pending, .task.pending { background-color: #A9ABA8; }
.details-headline.missed, .task.missed { background-color: #F75300; }
.details-headline.skipped, .task.skipped { background-color: #F75300; }
.details-headline.running, .task.running { background-color: #FE9D00 !important; }
.details-headline.running, .task.running { background-image: url(../Images/animation.gif); background-position: center; background-repeat: repeat-x; }

.estimation { background-color: #B1C5D1; }
.estimation { background-image: url(../Images/animation2.gif); background-position: center; background-repeat: repeat-x; }


div.task.active, div.task:hover { background-color: #00A2FA; }
div.task.active, div.task:hover { background-color: #00A2FA; }