From 4d57b8f0456ca37cfc8776fbf28f7b51f70561bc Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 21 Apr 2015 23:23:16 +0200 Subject: [PATCH] Fixed booking wizard display problem at first step. --- src/application/views/appointments/book.php | 112 ++++++++++---------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php index 57e99d8d..f8aaed25 100644 --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -163,70 +163,74 @@

lang->line('step_one_title'); ?>

- - - + $group) { - $group_label = ($key != 'uncategorized') - ? $group[0]['category_name'] : 'Uncategorized'; - - if (count($group) > 0) { - echo ''; - foreach($group as $service) { - echo ''; + foreach($available_services as $service) { + if ($service['category_id'] != NULL) { + if (!isset($grouped_services[$service['category_name']])) { + $grouped_services[$service['category_name']] = array(); + } + + $grouped_services[$service['category_name']][] = $service; + } + } + + // We need the uncategorized services at the end of the list so + // we will use another iteration only for the uncategorized services. + $grouped_services['uncategorized'] = array(); + foreach($available_services as $service) { + if ($service['category_id'] == NULL) { + $grouped_services['uncategorized'][] = $service; } - echo ''; + } + + foreach($grouped_services as $key => $group) { + $group_label = ($key != 'uncategorized') + ? $group[0]['category_name'] : 'Uncategorized'; + + if (count($group) > 0) { + echo ''; + foreach($group as $service) { + echo ''; + } + echo ''; + } + } + } else { + foreach($available_services as $service) { + echo ''; } } - } else { - foreach($available_services as $service) { - echo ''; - } - } - ?> - - - + ?> + +
- +
+ + + +