From 39d386a629fad4a768b37ba701cc70c4eaac871b Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sat, 28 Feb 2015 23:13:02 +0600 Subject: [PATCH 1/5] Added total builds count to index and project page --- PHPCI/Controller/HomeController.php | 15 ++++++++++----- PHPCI/Controller/ProjectController.php | 2 +- PHPCI/View/Project/view.phtml | 3 +-- PHPCI/View/SummaryTable.phtml | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/PHPCI/Controller/HomeController.php b/PHPCI/Controller/HomeController.php index 2455e709..8b57db58 100644 --- a/PHPCI/Controller/HomeController.php +++ b/PHPCI/Controller/HomeController.php @@ -98,12 +98,16 @@ class HomeController extends \PHPCI\Controller protected function getSummaryHtml($projects) { $summaryBuilds = array(); - $successes = array(); - $failures = array(); + $successes = array(); + $failures = array(); + $counts = array(); foreach ($projects['items'] as $project) { $summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($project->getId()); + $count = $this->buildStore->getWhere(array('project_id' => $project->getId()), 1, 0, array(), array('id' => 'DESC')); + $counts[$project->getId()] = $count['count']; + $success = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_SUCCESS); $failure = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_FAILED); @@ -112,10 +116,11 @@ class HomeController extends \PHPCI\Controller } $summaryView = new b8\View('SummaryTable'); - $summaryView->projects = $projects['items']; - $summaryView->builds = $summaryBuilds; + $summaryView->projects = $projects['items']; + $summaryView->builds = $summaryBuilds; $summaryView->successful = $successes; - $summaryView->failed = $failures; + $summaryView->failed = $failures; + $summaryView->counts = $counts; return $summaryView->render(); } diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 285982a1..3a55f49b 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -86,7 +86,7 @@ class ProjectController extends PHPCI\Controller $this->view->builds = $builds[0]; $this->view->total = $builds[1]; $this->view->project = $project; - $this->view->branch = urldecode($branch); + $this->view->branch = urldecode($branch); $this->view->branches = $this->projectStore->getKnownBranches($projectId); $this->view->page = $page; $this->view->pages = $pages; diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml index 0bfd5e59..900349c8 100644 --- a/PHPCI/View/Project/view.phtml +++ b/PHPCI/View/Project/view.phtml @@ -36,8 +36,7 @@
- -

+

()

diff --git a/PHPCI/View/SummaryTable.phtml b/PHPCI/View/SummaryTable.phtml index 56df6e38..9ddaabb0 100644 --- a/PHPCI/View/SummaryTable.phtml +++ b/PHPCI/View/SummaryTable.phtml @@ -123,7 +123,7 @@ foreach($projects as $project): - + (getId()]; ?>) From ce7479b19b30a5db7518a1c3609da66d06c4ff73 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sat, 28 Feb 2015 23:38:56 +0600 Subject: [PATCH 2/5] Added Date column for builds table in project page. --- PHPCI/Languages/lang.da.php | 1 + PHPCI/Languages/lang.de.php | 1 + PHPCI/Languages/lang.el.php | 1 + PHPCI/Languages/lang.en.php | 1 + PHPCI/Languages/lang.fr.php | 1 + PHPCI/Languages/lang.it.php | 1 + PHPCI/Languages/lang.nl.php | 1 + PHPCI/Languages/lang.pl.php | 1 + PHPCI/Languages/lang.ru.php | 1 + PHPCI/Languages/lang.uk.php | 1 + PHPCI/View/BuildsTable.phtml | 1 + PHPCI/View/Project/view.phtml | 1 + 12 files changed, 12 insertions(+) diff --git a/PHPCI/Languages/lang.da.php b/PHPCI/Languages/lang.da.php index 5ba3d96f..fdf27bc6 100644 --- a/PHPCI/Languages/lang.da.php +++ b/PHPCI/Languages/lang.da.php @@ -126,6 +126,7 @@ i din foretrukne hosting-platform.', 'all_branches' => 'Alle branches', 'builds' => 'Builds', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Projekt', 'commit' => 'Commit', 'branch' => 'Branch', diff --git a/PHPCI/Languages/lang.de.php b/PHPCI/Languages/lang.de.php index bdcc1459..a4b83580 100644 --- a/PHPCI/Languages/lang.de.php +++ b/PHPCI/Languages/lang.de.php @@ -127,6 +127,7 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab 'all_branches' => 'Alle Branches', 'builds' => 'Builds', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Projekt', 'commit' => 'Commit', 'branch' => 'Branch', diff --git a/PHPCI/Languages/lang.el.php b/PHPCI/Languages/lang.el.php index 82b3cf22..bf5649fb 100644 --- a/PHPCI/Languages/lang.el.php +++ b/PHPCI/Languages/lang.el.php @@ -127,6 +127,7 @@ PHPCI', 'all_branches' => 'Όλες οι διακλαδώσεις', 'builds' => 'Κατασκευές', 'id' => 'Αριθμός αναγνώρισης', + 'date' => 'Date', 'project' => 'Έργο', 'commit' => 'Συνεισφορά', 'branch' => 'Διακλάδωση', diff --git a/PHPCI/Languages/lang.en.php b/PHPCI/Languages/lang.en.php index 450be1ef..1e4ffa32 100644 --- a/PHPCI/Languages/lang.en.php +++ b/PHPCI/Languages/lang.en.php @@ -128,6 +128,7 @@ PHPCI', 'all_branches' => 'All Branches', 'builds' => 'Builds', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Project', 'commit' => 'Commit', 'branch' => 'Branch', diff --git a/PHPCI/Languages/lang.fr.php b/PHPCI/Languages/lang.fr.php index 20410684..77e0d0ab 100644 --- a/PHPCI/Languages/lang.fr.php +++ b/PHPCI/Languages/lang.fr.php @@ -127,6 +127,7 @@ PHPCI', 'all_branches' => 'Toutes les branches', 'builds' => 'Builds', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Projet', 'commit' => 'Commit', 'branch' => 'Branche', diff --git a/PHPCI/Languages/lang.it.php b/PHPCI/Languages/lang.it.php index 46ca14fd..50b59040 100644 --- a/PHPCI/Languages/lang.it.php +++ b/PHPCI/Languages/lang.it.php @@ -127,6 +127,7 @@ PHPCI', 'all_branches' => 'Tutti i Branche', 'builds' => 'Builds', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Progetto', 'commit' => 'Commit', 'branch' => 'Branch', diff --git a/PHPCI/Languages/lang.nl.php b/PHPCI/Languages/lang.nl.php index 83d5e317..d62cd4e5 100644 --- a/PHPCI/Languages/lang.nl.php +++ b/PHPCI/Languages/lang.nl.php @@ -127,6 +127,7 @@ van je gekozen source code hosting platform', 'all_branches' => 'Alle brances', 'builds' => 'Builds', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Project', 'commit' => 'Commit', 'branch' => 'Branch', diff --git a/PHPCI/Languages/lang.pl.php b/PHPCI/Languages/lang.pl.php index 9d6de6c8..640ac4e0 100644 --- a/PHPCI/Languages/lang.pl.php +++ b/PHPCI/Languages/lang.pl.php @@ -128,6 +128,7 @@ od wybranego kodu źródłowego platformy hostingowej.', 'all_branches' => 'Wszystkie Gałęzie', 'builds' => 'Budowania', 'id' => 'ID', + 'date' => 'Date', 'project' => 'Projekt', 'commit' => 'Commit', 'branch' => 'Gałąź', diff --git a/PHPCI/Languages/lang.ru.php b/PHPCI/Languages/lang.ru.php index 2f9ab0ee..dba0d934 100644 --- a/PHPCI/Languages/lang.ru.php +++ b/PHPCI/Languages/lang.ru.php @@ -126,6 +126,7 @@ PHPCI', 'all_branches' => 'Все ветки', 'builds' => 'Сборки', 'id' => 'ID', + 'date' => 'Дата', 'project' => 'Проект', 'commit' => 'Коммит', 'branch' => 'Ветка', diff --git a/PHPCI/Languages/lang.uk.php b/PHPCI/Languages/lang.uk.php index 7e4a2191..0fd6d66a 100644 --- a/PHPCI/Languages/lang.uk.php +++ b/PHPCI/Languages/lang.uk.php @@ -126,6 +126,7 @@ PHPCI', 'all_branches' => 'Усі гілки', 'builds' => 'Збірки', 'id' => 'ID', + 'date' => 'Дата', 'project' => 'Проект', 'commit' => 'Комміт', 'branch' => 'Гілка', diff --git a/PHPCI/View/BuildsTable.phtml b/PHPCI/View/BuildsTable.phtml index c9d44930..93ea593b 100644 --- a/PHPCI/View/BuildsTable.phtml +++ b/PHPCI/View/BuildsTable.phtml @@ -39,6 +39,7 @@ switch($build->getStatus()) ?> + + From 09e8331fc5386529bedbf8c6d77320c918bc9022 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Sat, 28 Feb 2015 23:51:04 +0600 Subject: [PATCH 3/5] Code style fix --- PHPCI/Controller/HomeController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PHPCI/Controller/HomeController.php b/PHPCI/Controller/HomeController.php index 8b57db58..d0e5a14b 100644 --- a/PHPCI/Controller/HomeController.php +++ b/PHPCI/Controller/HomeController.php @@ -105,7 +105,13 @@ class HomeController extends \PHPCI\Controller foreach ($projects['items'] as $project) { $summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($project->getId()); - $count = $this->buildStore->getWhere(array('project_id' => $project->getId()), 1, 0, array(), array('id' => 'DESC')); + $count = $this->buildStore->getWhere( + array('project_id' => $project->getId()), + 1, + 0, + array(), + array('id' => 'DESC') + ); $counts[$project->getId()] = $count['count']; $success = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_SUCCESS); From cd76076e95bd2aa3f62ff918cc510dfa0c98933f Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Mon, 2 Mar 2015 08:18:40 +0600 Subject: [PATCH 4/5] Fixed 'date' it lang string --- PHPCI/Languages/lang.it.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHPCI/Languages/lang.it.php b/PHPCI/Languages/lang.it.php index 50b59040..b022068c 100644 --- a/PHPCI/Languages/lang.it.php +++ b/PHPCI/Languages/lang.it.php @@ -127,7 +127,7 @@ PHPCI', 'all_branches' => 'Tutti i Branche', 'builds' => 'Builds', 'id' => 'ID', - 'date' => 'Date', + 'date' => 'Data', 'project' => 'Progetto', 'commit' => 'Commit', 'branch' => 'Branch', From 4493685d8f7937ff572f9f6d2aa24e094c866958 Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Tue, 10 Mar 2015 15:44:33 +0600 Subject: [PATCH 5/5] Fixed 'date' nl lang string --- PHPCI/Languages/lang.nl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHPCI/Languages/lang.nl.php b/PHPCI/Languages/lang.nl.php index d62cd4e5..a4c95b6d 100644 --- a/PHPCI/Languages/lang.nl.php +++ b/PHPCI/Languages/lang.nl.php @@ -127,7 +127,7 @@ van je gekozen source code hosting platform', 'all_branches' => 'Alle brances', 'builds' => 'Builds', 'id' => 'ID', - 'date' => 'Date', + 'date' => 'Datum', 'project' => 'Project', 'commit' => 'Commit', 'branch' => 'Branch',
#getId(), 6, '0', STR_PAD_LEFT); ?>getCreated()->format('Y-m-d H:i:s'); ?> getProject())) { diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml index 900349c8..2e79c017 100644 --- a/PHPCI/View/Project/view.phtml +++ b/PHPCI/View/Project/view.phtml @@ -42,6 +42,7 @@