Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
  • Loading branch information
Alanaktion committed Jan 14, 2016
2 parents 14b6f9b + faa8f2a commit 8569ec9
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
[![Crowdin Chat](https://img.shields.io/badge/Gitter-Join%20Chat-3498DB.svg)](https://gitter.im/Alanaktion/phproject?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Gitter Chat](https://img.shields.io/badge/Gitter-Join%20Chat-3498DB.svg)](https://gitter.im/Alanaktion/phproject?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/2e382a33465448868ca2c0d4b1c937db)](https://www.codacy.com/app/alanaktion/phproject)
![Stability: Releasesd](https://img.shields.io/badge/stability-release-18BC9C.svg)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/phproject/localized.png)](https://crowdin.com/project/phproject)
Expand Down
11 changes: 11 additions & 0 deletions app/helper/diff/renderer/html/base.php
Expand Up @@ -200,6 +200,17 @@ function fixSpaces($spaces=array(''))
return str_repeat('  ', $div).str_repeat(' ', $mod);
}

/**
* Replace tabs in a single line with a number of spaces as defined by the tabSize option.
*
* @param string $line The containing tabs to convert.
* @return string The line with the tabs converted to spaces.
*/
private function expandTabs($line)
{
return str_replace("\t", str_repeat(' ', $this->options['tabSize']), $line);
}

/**
* Make a string containing HTML safe for output on a page.
*
Expand Down
41 changes: 41 additions & 0 deletions app/helper/diff/sequencematcher.php
Expand Up @@ -611,6 +611,18 @@ public function Ratio()
return $this->calculateRatio($matches, count ($this->a) + count ($this->b));
}

/**
* Helper function to calculate the number of matches for Ratio().
*
* @param int $sum The running total for the number of matches.
* @param array $triple Array containing the matching block triple to add to the running total.
* @return int The new running total for the number of matches.
*/
private function ratioReduce($sum, $triple)
{
return $sum + ($triple[count($triple) - 1]);
}

/**
* Quickly return an upper bound ratio for the similarity of the strings.
* This is quicker to compute than Ratio().
Expand Down Expand Up @@ -700,4 +712,33 @@ private function arrayGetDefault($array, $key, $default)
}
}

/**
* Sort an array by the nested arrays it contains. Helper function for getMatchingBlocks
*
* @param array $a First array to compare.
* @param array $b Second array to compare.
* @return int -1, 0 or 1, as expected by the usort function.
*/
private function tupleSort($a, $b)
{
$max = max(count($a), count($b));
for($i = 0; $i < $max; ++$i) {
if($a[$i] < $b[$i]) {
return -1;
}
else if($a[$i] > $b[$i]) {
return 1;
}
}

if(count($a) == $count($b)) {
return 0;
}
else if(count($a) < count($b)) {
return -1;
}
else {
return 1;
}
}
}
4 changes: 2 additions & 2 deletions app/view/backlog/index.html
Expand Up @@ -36,11 +36,11 @@
<ul class="list-group sortable" data-list-id="0">
<repeat group="{{ @backlog }}" value="{{ @project }}">
<li class="list-group-item" data-category="department" data-status="new" id="project_{{ @project.id }}" data-id="{{ @project.id }}">
<span class="badge">{{ @project.priority_name }}</span>
<span class="title">
<a href="{{ @BASE }}/issues/{{ @project.id }}" target="_blank">#{{ @project.id }}</a>&ensp;
{{ @project.name | esc }}
</span>
<span class="badge">{{ @project.priority_name }}</span>
</li>
</repeat>
</ul>
Expand All @@ -60,11 +60,11 @@
<ul class="list-group sortable" data-list-id="{{ @sprint.id }}">
<repeat group="{{ @sprint.projects }}" value="{{ @project }}">
<li class="list-group-item {{ @project.status_closed ? 'completed' : '' }}" data-category="department" data-status="new" id="project_{{ @project.id }}" data-id="{{ @project.id }}">
<span class="badge">{{ @project.priority_name }}</span>
<span class="title">
<a href="{{ @BASE }}/issues/{{ @project.id }}" target="_blank">#{{ @project.id }}</a>&ensp;
{{ @project.name | esc }}
</span>
<span class="badge">{{ @project.priority_name }}</span>
</li>
</repeat>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/view/backlog/old.html
Expand Up @@ -40,11 +40,11 @@
<ul class="list-group sortable" data-list-id="{{ @sprint.id }}">
<repeat group="{{ @sprint.projects }}" value="{{ @project }}">
<li class="list-group-item {{ @project.status_closed ? 'completed' : '' }}" data-category="department" data-status="new" id="project_{{ @project.id }}" data-id="{{ @project.id }}">
<span class="badge">{{ @project.status_name }}</span>
<span class="title">
<a href="{{ @BASE }}/issues/{{ @project.id }}" target="_blank">#{{ @project.id }}</a>&ensp;
{{ @project.name | esc }}
</span>
<span class="badge">{{ @project.status_name }}</span>
</li>
</repeat>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/view/blocks/issue-list.html
Expand Up @@ -226,7 +226,7 @@
<td>{{ !empty(@item.sprint_start_date) ? date("n/j/y", @this->utc2local(@item.sprint_start_date)) : "" }}</td>
<td>{{ ucwords(@item.repeat_cycle) ?: 'None' }}</td>
<td>{{ date("n/j/y", @this->utc2local(@item.created_date)) }}</td>
<td>{{ !empty(@item.due_date) ? date("n/j/y", @this->utc2local(@item.due_date)) : "" }}</td>
<td>{{ !empty(@item.due_date) ? date("n/j/y", strtotime(@item.due_date)) : "" }}</td>
<check if="{{ !empty(@GET.status) && @GET.status != 'open' }}">
<td>{{ !empty(@item.closed_date) ? date("n/j/y", @this->utc2local(@item.closed_date)) : "" }}</td>
</check>
Expand Down
2 changes: 1 addition & 1 deletion app/view/notification/new.html
Expand Up @@ -32,7 +32,7 @@
<li><b>Planned Hours:</b> {{ @issue.hours_total }}</li>
</check>
<check if="{{ strtotime(@issue.due_date) }}">
<li><b>Due Date:</b> {{ date("D, M j, Y", @this->utc2local(@issue.due_date)) }}</li>
<li><b>Due Date:</b> {{ date("D, M j, Y", strtotime(@issue.due_date)) }}</li>
</check>
</ul>

Expand Down

0 comments on commit 8569ec9

Please sign in to comment.