From 320ddbb790919659ce78e6a5ca5bb0eba2955829 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Wed, 10 Aug 2011 18:09:40 +0200 Subject: [PATCH 1/8] Close meta tag --- application/views/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/header.php b/application/views/header.php index 71adf1f..74a47b3 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -1,7 +1,7 @@ - + ScattPort | Dashboard From 29036cc33964858eb18712de315c755fd5f2a747 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Wed, 10 Aug 2011 18:10:14 +0200 Subject: [PATCH 2/8] Add link to server management --- application/views/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/header.php b/application/views/header.php index 74a47b3..9d77172 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -64,7 +64,7 @@ ?>
  • Administration
  • Date: Wed, 10 Aug 2011 18:10:44 +0200 Subject: [PATCH 3/8] Change path style for site_url helper --- application/views/header.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/views/header.php b/application/views/header.php index 9d77172..d246b99 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -46,9 +46,9 @@ ?>
  • Projekt
  • Global
  • Date: Wed, 10 Aug 2011 20:40:05 +0200 Subject: [PATCH 4/8] Rename server detail view and insert basic infos --- application/controllers/admin/servers.php | 61 ++++++++++++++++++++++ application/views/admin/server/detail.php | 35 +++++++++++++ application/views/admin/server/details.php | 35 ------------- 3 files changed, 96 insertions(+), 35 deletions(-) create mode 100644 application/controllers/admin/servers.php create mode 100644 application/views/admin/server/detail.php delete mode 100644 application/views/admin/server/details.php diff --git a/application/controllers/admin/servers.php b/application/controllers/admin/servers.php new file mode 100644 index 0000000..1fa15be --- /dev/null +++ b/application/controllers/admin/servers.php @@ -0,0 +1,61 @@ + + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * Server management. + * + * @author Karsten Heiken + */ +class Servers extends CI_Controller { + + /** + * Constructor. + */ + function __construct() { + parent::__construct(); + + $this->load->model('server'); + } + + /** + * List all servers. + */ + function index() { + $tpl->servers = $this->server->get()->all; + + $this->load->view('admin/server/list', $tpl); + } + + /** + * Retrieve details of a server. + * + * @param type $server_id + */ + function detail($server_id) { + $tpl->server = $this->server->where('id', $server_id)->get(); + + $this->load->view('admin/server/detail', $tpl); + } + +} \ No newline at end of file diff --git a/application/views/admin/server/detail.php b/application/views/admin/server/detail.php new file mode 100644 index 0000000..5c047e3 --- /dev/null +++ b/application/views/admin/server/detail.php @@ -0,0 +1,35 @@ +load->view('header'); ?> + +
    + +
    +

    Serververwaltung: id?>

    +
    + +
    +

    Miscellaneous

    +

    Location

    +

    location)?>

    + +

    Owner

    +

    Jörg Thomaschewski

    + +

    Technical information

    +

    Hardware & OS

    +

    + CPU: Intel Xeon E5540, 2533 MHz
    + Uptime: 254 Tage, 13 Stunden
    + OS: Debian/GNU 5.0r1
    + Workload: 2.01, 1.05, 0.85 +

    + +

    ScattPort-Statistics

    +

    + Completed jobs: 47
    + Available programs: PYTHA, ABC, DEF +

    +
    + +
    + +load->view('footer'); ?> diff --git a/application/views/admin/server/details.php b/application/views/admin/server/details.php deleted file mode 100644 index 178964a..0000000 --- a/application/views/admin/server/details.php +++ /dev/null @@ -1,35 +0,0 @@ -load->view('header'); ?> - -
    - -
    -

    Serververwaltung

    -
    - - -
    -

    SP-EMD-01

    -

    Standort

    -

    Hochschule Emden, Technikum, Raum E10

    - -

    Besitzer

    -

    Jörg Thomaschewski

    - -

    Serverinformationen

    -

    - Prozessor: Intel Xeon E5540, 2533 MHz
    - Uptime: 254 Tage, 13 Stunden
    - Betriebssystem: Debian/GNU 5.0r1
    - Workload: 2.01, 1.05, 0.85 -

    - -

    ScattPort-Statistik

    -

    - Durchgeführte Berechnungen: 47
    - Verfügbare Programme: PYTHA, ABC, DEF -

    -
    - -
    - -load->view('footer'); ?> From e5b0b6a5eefe7c216b0f7cb2ea4141c4ad2e6b2b Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Wed, 10 Aug 2011 20:40:44 +0200 Subject: [PATCH 5/8] Include admin links into footer --- application/views/footer.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/application/views/footer.php b/application/views/footer.php index 050cf56..c1adceb 100644 --- a/application/views/footer.php +++ b/application/views/footer.php @@ -1,5 +1,16 @@ From 0fe7fd0af7a18db859afc8abf9f04206d7bbecc3 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Wed, 10 Aug 2011 20:42:09 +0200 Subject: [PATCH 6/8] Add language file for server administration --- .../language/english/admin/servers_lang.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 application/language/english/admin/servers_lang.php diff --git a/application/language/english/admin/servers_lang.php b/application/language/english/admin/servers_lang.php new file mode 100644 index 0000000..a470790 --- /dev/null +++ b/application/language/english/admin/servers_lang.php @@ -0,0 +1,43 @@ + + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* + * Headings + */ +$lang['location'] = 'Location'; +$lang['owner'] = 'Owner'; +$lang['actions'] = 'Actions'; +$lang['technical_info'] = 'Technical information'; +$lang['hardware_os'] = 'Hardware & OS'; +$lang['scattport_stats'] = 'ScattPort statistics'; + +/* + * server status + */ +$lang['busy'] = 'busy'; +$lang['offline'] = 'offline'; +$lang['available'] = 'available'; + +$lang['workload'] = 'Workload'; +$lang['completed_jobs'] = 'Completed jobs'; \ No newline at end of file From d1209e98c80c397ca0631ba49f7abce2ff60741a Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Wed, 10 Aug 2011 20:46:43 +0200 Subject: [PATCH 7/8] Implement simple server list --- application/controllers/admin/servers.php | 2 +- application/views/admin/server/list.php | 94 ++++++++++------------- 2 files changed, 40 insertions(+), 56 deletions(-) diff --git a/application/controllers/admin/servers.php b/application/controllers/admin/servers.php index 1fa15be..6379f84 100644 --- a/application/controllers/admin/servers.php +++ b/application/controllers/admin/servers.php @@ -42,7 +42,7 @@ class Servers extends CI_Controller { * List all servers. */ function index() { - $tpl->servers = $this->server->get()->all; + $tpl->servers = $this->server->getAll(); $this->load->view('admin/server/list', $tpl); } diff --git a/application/views/admin/server/list.php b/application/views/admin/server/list.php index 26d3818..b72f29f 100644 --- a/application/views/admin/server/list.php +++ b/application/views/admin/server/list.php @@ -3,66 +3,50 @@
    -

    Serververwaltung

    +

    Server management

    -

    Übersicht aller Server

    +

    List of all available servers

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + 2) { + $server['class'] = "pending"; + $server['status'] = 'busy'; + } else { + $server['class'] = "active"; + $server['status'] = 'available'; + } + } else { + $server['class'] = "closed"; + $server['status'] = "offline"; + } +?> + + + + + + + +
    BezeichnungOrtStatusAktion
    SP-EMD-01Emden, DeutschlandIdleBearbeiten | Entfernen
    SP-EMD-02Emden, DeutschlandAusgelastetBearbeiten | Entfernen
    SP-HB-01Bremen, DeutschlandNicht erreichbarBearbeiten | Entfernen
    SP-HB-02Bremen, DeutschlandIdleBearbeiten | Entfernen
    SP-HB-03Bremen, DeutschlandAusgelastetBearbeiten | Entfernen
    IDLocationStatusActions
    + + Edit | Delete
    - -
    From 6259e5915188ed672ae6f15db9cf7fccbf660ebe Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Thu, 11 Aug 2011 02:38:44 +0200 Subject: [PATCH 8/8] Don't try to get the timestamp from a file if it doesn't exist --- application/core/MY_Lang.php | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/application/core/MY_Lang.php b/application/core/MY_Lang.php index 5716079..99854f9 100644 --- a/application/core/MY_Lang.php +++ b/application/core/MY_Lang.php @@ -44,28 +44,32 @@ class MY_Lang extends CI_Lang { log_message('debug', 'Gettext Class path chosen is: ' . $this->_gettext_path); $filename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '.mo'; - $mtime = filemtime($filename); - $newFilename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '_' . $mtime . '.mo'; + // if there is no language file, we can't load anything + if (file_exists($filename)) { + $mtime = filemtime($filename); - if (!file_exists($newFilename)) { - $dir = scandir(dirname($filename)); - foreach ($dir as $file) { - // remove all the old files - if (!in_array($file, array('.', '..', $this->_gettext_domain . '.po', $this->_gettext_domain . '.mo'))) { - @unlink(dirname($filename) . '/' . $file); + $newFilename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '_' . $mtime . '.mo'; + + if (!file_exists($newFilename)) { + $dir = scandir(dirname($filename)); + foreach ($dir as $file) { + // remove all the old files + if (!in_array($file, array('.', '..', $this->_gettext_domain . '.po', $this->_gettext_domain . '.mo'))) { + @unlink(dirname($filename) . '/' . $file); + } } + + @copy($filename, $newFilename); } - @copy($filename, $newFilename); + $newDomain = $this->_gettext_domain . '_' . $mtime; + + bindtextdomain($newDomain, $this->_gettext_path); + bind_textdomain_codeset($newDomain, "UTF-8"); + textdomain($newDomain); } - - $newDomain = $this->_gettext_domain . '_' . $mtime; - - bindtextdomain($newDomain, $this->_gettext_path); - bind_textdomain_codeset($newDomain, "UTF-8"); - textdomain($newDomain); - + log_message('debug', 'The gettext domain chosen is: '. $this->_gettext_domain); return true;