diff --git a/application/controllers/admin/parameters.php b/application/controllers/admin/parameters.php index a92f218..3061083 100644 --- a/application/controllers/admin/parameters.php +++ b/application/controllers/admin/parameters.php @@ -52,11 +52,11 @@ class Parameters extends Admin_Controller { } if ($this->form_validation->run('parameters/create') === true) { - $paramName = $this->input->post('name'); + $parameter = $this->input->post('name'); $data = array( 'program_id' => $program['id'], - 'name' => $paramName, + 'name' => $parameter, 'readable' => $this->input->post('readable'), 'unit' => $this->input->post('unit'), 'description' => $this->input->post('description'), @@ -65,7 +65,7 @@ class Parameters extends Admin_Controller { ); if ($this->parameter->create($data)) { - $this->messages->add(sprintf(_("The parameter '%s' has been successfully created."), $paramName), 'success'); + $this->messages->add(sprintf(_("The parameter "%s" has been created successfully."), $parameter), 'success'); redirect('admin/programs/edit/' . $program['id'], 303); } } @@ -148,13 +148,14 @@ class Parameters extends Admin_Controller { ); if ($this->parameter->update($data, $id)) { - $this->messages->add(sprintf(_("The parameter '%s' has been successfully updated."), $parameter['name']), 'success'); - redirect('admin/programs/edit/' . $parameter['program_id'], 303); + $this->messages->add(sprintf(_("The parameter "%s" has been updated successfully."), $parameter['name']), 'success'); } + redirect('admin/programs/edit/' . $parameter['program_id'], 303); } $data = array(); // empty the data array $data['types'] = $this->parameter->getTypes(); + $data['program'] = $this->program->getByID($parameter['program_id']); $data['parameter'] = $parameter; $this->load->view('admin/parameters/edit', $data); @@ -172,7 +173,7 @@ class Parameters extends Admin_Controller { show_404(); } else { if ($this->parameter->delete($parameter['id'])) { - $this->messages->add(_('The selected parameter has been successfully deleted.'), 'success'); + $this->messages->add(_("The selected parameter has been deleted successfully."), 'success'); } redirect('admin/programs/edit/' . $parameter['program_id'], 303); } diff --git a/application/controllers/admin/programs.php b/application/controllers/admin/programs.php index 3c491a7..9aa154f 100644 --- a/application/controllers/admin/programs.php +++ b/application/controllers/admin/programs.php @@ -52,10 +52,10 @@ class Programs extends Admin_Controller { * * @param string $id */ - public function edit($id = '') { - $program = $this->program->getByID($id); + public function edit($programId = '') { + $program = $this->program->getByID($programId); - if (empty($id) || !isset($program['id'])){ + if (empty($programId) || !isset($program['id'])){ show_404(); } @@ -64,12 +64,13 @@ class Programs extends Admin_Controller { 'name' => $this->input->post('name'), 'config_template' => $_POST['config_template'], ); - if ($this->program->update($data, $id)) { - $this->messages->add(sprintf(_("The program '%s' has been updated successfully"), $this->input->post('name')), 'success'); - redirect('admin/programs', 303); + if ($this->program->update($data, $programId)) { + $this->messages->add(sprintf(_("The program "%s" has been updated successfully"), $this->input->post('name')), 'success'); + redirect('admin/programs/edit/' . $program['id'], 303); } } + $data = array(); // empty data array $data['program'] = $program; $data['parameters'] = $this->parameter->getAll($program['id']); diff --git a/application/views/admin/parameters/create.php b/application/views/admin/parameters/create.php index 2aca436..1d1b811 100644 --- a/application/views/admin/parameters/create.php +++ b/application/views/admin/parameters/create.php @@ -3,28 +3,45 @@
-

+

» »

+

  • - - * + *
  • - - * + *
  • +
  • + * +
    + + +
    +
  • +
+

+
  • @@ -39,22 +56,6 @@
  • -
  • - - * -
    - - -
    -
  • @@ -64,7 +65,8 @@

- + +

diff --git a/application/views/admin/parameters/edit.php b/application/views/admin/parameters/edit.php index 1c233b4..b764b9a 100644 --- a/application/views/admin/parameters/edit.php +++ b/application/views/admin/parameters/edit.php @@ -3,28 +3,45 @@
-

+

» »

+

  • - - * + *
  • - - * + *
  • +
  • + * +
    + + +
    +
  • +
+

+
  • @@ -39,22 +56,6 @@
  • -
  • - - * -
    - - -
    -
  • @@ -64,8 +65,8 @@

- - + +

diff --git a/application/views/admin/programs/edit.php b/application/views/admin/programs/edit.php index dcc2213..7120641 100644 --- a/application/views/admin/programs/edit.php +++ b/application/views/admin/programs/edit.php @@ -16,7 +16,7 @@ $(document).ready(function() {
-

+

»

@@ -24,16 +24,14 @@ $(document).ready(function() {

  • - - * + *
  • - - * + *
    @@ -47,11 +45,13 @@ $(document).ready(function() {

- - + +

+
+

@@ -80,22 +80,28 @@ $(document).ready(function() {

- + +

+ +

+

+

-
    -
  • - -
    - - -
    - -
  • -
+
    +
  • + +
    + + +
    + +
  • +
+

- +

diff --git a/application/views/admin/programs/list.php b/application/views/admin/programs/list.php index 19f9e1f..80a803c 100644 --- a/application/views/admin/programs/list.php +++ b/application/views/admin/programs/list.php @@ -8,7 +8,7 @@

- +
@@ -21,15 +21,20 @@ ?> - +
| + | + +
- -

+

+

+ +

diff --git a/assets/css/style.css b/assets/css/style.css index 0e06d0d..1df8f6e 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -590,6 +590,16 @@ a.user_add { padding-left: 30px; } +a.program_add { + background: url(../images/icons/application--plus.png) 10px center no-repeat #f3f3f3; + padding-left: 30px; +} + +a.parameter_add { + background: url(../images/icons/ui-text-field--plus.png) 10px center no-repeat #f3f3f3; + padding-left: 30px; +} + a.results { background: url(../images/icons/blue-folder-open-document-text.png) 10px center no-repeat #f3f3f3; padding-left: 30px; diff --git a/assets/images/icons/ui-text-field--plus.png b/assets/images/icons/ui-text-field--plus.png new file mode 100644 index 0000000..9b99930 Binary files /dev/null and b/assets/images/icons/ui-text-field--plus.png differ