From 2d3a9b3f61124347c69d02f7010ad55d78edb17d Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Wed, 26 Apr 2017 18:35:15 -0500 Subject: [PATCH] Improvement of appearance of promotions and careers --- app/Resources/public/css/base.css | 46 ++++++++++++ main/admin/career_dashboard.php | 113 ++++++++++-------------------- 2 files changed, 84 insertions(+), 75 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index f336534e89..b27704f13f 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -5534,6 +5534,52 @@ div#chat-remote-video video { .report_section .table{ font-size: 12px; } +.promotions{ + border-bottom: 1px solid #DDD; + margin-top: 30px; +} +.career p{ + padding-left: 10px; +} +.promotions .title{ + font-size: 16px; + background-color: #DFDFDF; +} +.promotions .cycles{ + background-color: #F3F3F3; + text-align: center; + vertical-align: middle; + text-transform: uppercase; + border-right: 1px solid #DDD; +} +.promotions .cycles h4{ + font-size: 14px; + font-weight: bold; +} +.promotions .cycles a{ + color: #66666C; +} +.promotions .cycles a:hover{ + color: initial; +} +.promotions .courses{ + background-color: #FAFAFA; + vertical-align: middle; + border-right: 1px solid #DDD; +} +.promotions .promo{ + background-color: #D1D1D1; + text-align: center; + text-transform: uppercase; + vertical-align: middle; +} +.promotions .promo h4 { + font-size: 18px; + font-weight: bold; +} +.promotions .promo h4 a{ + color: #666; +} /* CSS for the view by session My Course tab */ .session-view-block { font-size : 14px; diff --git a/main/admin/career_dashboard.php b/main/admin/career_dashboard.php index 50afd79174..1421eff957 100755 --- a/main/admin/career_dashboard.php +++ b/main/admin/career_dashboard.php @@ -26,9 +26,11 @@ $interbreadcrumb[] = array( 'url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions') ); +$tpl = new Template(get_lang('CareersAndPromotions')); Display :: display_header(null); +$html = null; $form = new FormValidator('filter_form', 'GET', api_get_self()); $career = new Career(); @@ -58,16 +60,31 @@ $form->addSelect( $form->addButtonSearch(get_lang('Filter')); // action links -echo '
'; - echo ''. - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).''; - echo ''. - Display::return_icon('career.png', get_lang('Careers'), '', ICON_SIZE_MEDIUM).''; - echo ''. - Display::return_icon('promotion.png', get_lang('Promotions'), '', ICON_SIZE_MEDIUM).''; -echo '
'; - -$form->display(); +$actionleft = Display::url( + Display::return_icon( + 'back.png', + get_lang('BackTo').' '.get_lang('PlatformAdmin'), + null, + ICON_SIZE_MEDIUM + ), '../admin/index.php'); +$actionleft .= Display::url( + Display::return_icon( + 'career.png', + get_lang('Careers'), + null, + ICON_SIZE_MEDIUM), + 'careers.php'); +$actionleft .= Display::url( + Display::return_icon( + 'promotion.png', + get_lang('Promotions'), + null, + ICON_SIZE_MEDIUM), + 'promotions.php'); + +$actions = Display::toolbarAction('toolbar-career', array( 0 => $actionleft)); + +$html .= $form->return_form(); $careers = $career->get_all($condition); //only status =1 @@ -75,6 +92,7 @@ $column_count = 3; $i = 0; $grid_js = ''; $career_array = array(); + if (!empty($careers)) { foreach ($careers as $career_item) { $promotion = new Promotion(); @@ -106,6 +124,7 @@ if (!empty($careers)) { ); } $promotion_array[$promotion_item['id']] = array( + 'id' => $promotion_item['id'], 'name' => $promotion_item['name'], 'sessions' => $session_list, ); @@ -115,73 +134,17 @@ if (!empty($careers)) { 'name' => $career_item['name'], 'promotions' => $promotion_array, ); + $careerList = array( + 'promotions' => $promotion_array, + ); + $careers[$career_item['id']]['career'] = $careerList; } } -echo ''; - -if (!empty($career_array)) { - foreach ($career_array as $career_id => $data) { - $career = $data['name']; - $promotions = $data['promotions']; - $career = Display::url($career, 'careers.php?action=edit&id='.$career_id); - $career = Display::tag('h4', $career); - echo ''; - if (!empty($promotions)) { - foreach ($promotions as $promotion_id => $promotion) { - $promotion_name = $promotion['name']; - $promotion_url = Display::url($promotion_name, 'promotions.php?action=edit&id='.$promotion_id); - $sessions = $promotion['sessions']; - $count = count($promotion['sessions']); - $rowspan = ''; - if (!empty($count)) { - $rowspan = 'rowspan="'.$count.'"'; - } +$tpl->assign('actions', $actions); +$tpl->assign('form_filter', $html); +$tpl->assign('data', $careers); +$layout = $tpl->get_template('admin/career_dashboard.tpl'); +$tpl->display($layout); - echo ''. - ''; - - $first = true; - if (!empty($sessions)) { - foreach ($sessions as $session) { - $url = Display::url( - $session['data']['name'], - '../session/resume_session.php?id_session='.$session['data']['id'] - ); - // Tricky TR because of "rowspan" in previous TD - only - // use TR if not on the first line - if (!$first) { - echo ''; - } else { - $first = false; - } - // Session name - echo Display::tag('td', $url, array('style' => 'border-right:1px solid #aaa;')); - echo ''; - echo ''; - } - } - echo ''; - } - } - } -} -echo '
'.$career.'
'. - Display::tag('h5', $promotion_url). - '
'; - // Courses - echo '
    '; - if (!empty($session['courses'])) { - foreach ($session['courses'] as $course) { - echo '
  • '; - $url = Display::url( - $course['title'], - api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.$session['data']['id'] - ); - echo $url; - echo '
  • '; - } - } - echo '
'; - echo '
'; Display::display_footer();