UI changes for ScheduledAnnouncement.

pull/2487/head
jmontoyaa 8 years ago
parent 3dc7f73940
commit bf076cd88f
  1. 8
      main/inc/lib/ScheduledAnnouncement.php
  2. 13
      main/session/resume_session.php
  3. 32
      main/session/scheduled_announcement.php
  4. 16
      main/session/session_edit.php

@ -68,9 +68,10 @@ class ScheduledAnnouncement extends Model
{ {
// action links // action links
$action = '<div class="actions" style="margin-bottom:20px">'; $action = '<div class="actions" style="margin-bottom:20px">';
$action .= '<a href="scheduled_announcement.php?session_id='.$sessionId.'">'. $action .= Display::url(
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM). Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM),
'</a>'; api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId
);
$action .= '<a href="'.api_get_self().'?action=add&session_id='.$sessionId.'">'. $action .= '<a href="'.api_get_self().'?action=add&session_id='.$sessionId.'">'.
Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
@ -294,6 +295,7 @@ class ScheduledAnnouncement extends Model
'((user_complete_name))' => $userInfo['complete_name'], '((user_complete_name))' => $userInfo['complete_name'],
'((user_first_name))' => $userInfo['firstname'], '((user_first_name))' => $userInfo['firstname'],
'((user_last_name))' => $userInfo['lastname'], '((user_last_name))' => $userInfo['lastname'],
//'((course_title))' => $userInfo['lastname'],
'((lp_progress))' => $progress, '((lp_progress))' => $progress,
]; ];

@ -18,12 +18,6 @@ use Chamilo\CoreBundle\Entity\Session,
$cidReset = true; $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
// setting breadcrumbs
$interbreadcrumb[] = array(
'url' => 'session_list.php',
'name' => get_lang('Sessions'),
);
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
@ -36,7 +30,10 @@ if (empty($sessionId)) {
SessionManager::protectSession($sessionId); SessionManager::protectSession($sessionId);
$tool_name = get_lang('SessionOverview'); $tool_name = get_lang('SessionOverview');
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); $interbreadcrumb[] = array(
'url' => 'session_list.php',
'name' => get_lang('SessionList')
);
$orig_param = '&origin=resume_session'; $orig_param = '&origin=resume_session';
@ -362,7 +359,7 @@ if (!empty($sessionInfo['promotion_id'])) {
$programmedAnnouncement = new ScheduledAnnouncement(); $programmedAnnouncement = new ScheduledAnnouncement();
$programmedAnnouncement = $programmedAnnouncement->allowed(); $programmedAnnouncement = $programmedAnnouncement->allowed();
$tpl = new Template(get_lang('Session')); $tpl = new Template($tool_name);
$tpl->assign('session_header', $sessionHeader); $tpl->assign('session_header', $sessionHeader);
$tpl->assign('title', $sessionTitle); $tpl->assign('title', $sessionTitle);
$tpl->assign('general_coach', $generalCoach); $tpl->assign('general_coach', $generalCoach);

@ -22,24 +22,33 @@ if (!$object->allowed()) {
api_not_allowed(true); api_not_allowed(true);
} }
$sessionUrl = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId;
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();
$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList'));
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => "resume_session.php?id_session=".$sessionId, 'url' => "session_list.php",
"name" => get_lang('SessionOverview') "name" => get_lang('SessionList')
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_self()."?session_id=".$sessionId, 'url' => $sessionUrl,
"name" => get_lang('ScheduledAnnouncements') "name" => get_lang('SessionOverview')
); );
if ($action == 'add') { if ($action == 'add') {
$interbreadcrumb[] = array(
'url' => api_get_self()."?session_id=".$sessionId,
"name" => get_lang('ScheduledAnnouncements')
);
$tool_name = get_lang('Add'); $tool_name = get_lang('Add');
} elseif ($action == 'edit') { } elseif ($action == 'edit') {
$tool_name = get_lang('Edit'); $tool_name = get_lang('Edit');
$interbreadcrumb[] = array(
'url' => api_get_self()."?session_id=".$sessionId,
"name" => get_lang('ScheduledAnnouncements')
);
} else { } else {
$tool_name = ''; $tool_name = get_lang('ScheduledAnnouncements');
} }
switch ($action) { switch ($action) {
@ -102,8 +111,10 @@ switch ($action) {
$content = $object->getGrid($sessionId); $content = $object->getGrid($sessionId);
} else { } else {
$content = '<div class="actions">'; $content = '<div class="actions">';
$content .= '<a href="'.api_get_self().'?session_id='.$sessionId.'">'. $content .= Display::url(
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM),
api_get_self().'?session_id='.$sessionId
);
$content .= '</div>'; $content .= '</div>';
$form->addElement('hidden', 'sec_token'); $form->addElement('hidden', 'sec_token');
@ -206,5 +217,6 @@ $(function() {
</script>'; </script>';
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$tpl->assign('content', $content); $sessionTitle = Display::page_header($sessionInfo['name']);
$tpl->assign('content', $sessionTitle.$content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

@ -55,7 +55,6 @@ if (!empty($sessionInfo['coach_access_end_date'])) {
$id_coach = $sessionInfo['id_coach']; $id_coach = $sessionInfo['id_coach'];
$tool_name = get_lang('EditSession'); $tool_name = get_lang('EditSession');
//$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); $interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview')); $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview'));
@ -71,15 +70,15 @@ $sql = "SELECT user_id,lastname,firstname,username
WHERE status='1'".$order_clause; WHERE status='1'".$order_clause;
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {
$table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_id = api_get_current_access_url_id(); $access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) { if ($access_url_id != -1) {
$sql = "SELECT DISTINCT u.user_id,lastname,firstname,username $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
FROM $tbl_user u FROM $tbl_user u
INNER JOIN $table_access_url_rel_user url_rel_user INNER JOIN $table_access_url_rel_user url_rel_user
ON (url_rel_user.user_id = u.user_id) ON (url_rel_user.user_id = u.user_id)
WHERE status='1' AND access_url_id = '$access_url_id' $order_clause"; WHERE status='1' AND access_url_id = '$access_url_id' $order_clause";
} }
} }
$result = Database::query($sql); $result = Database::query($sql);
@ -157,6 +156,7 @@ if ($form->validate()) {
if ($params['access'] == 1) { if ($params['access'] == 1) {
$duration = null; $duration = null;
} }
$description = $params['description']; $description = $params['description'];
$showDescription = isset($params['show_description']) ? 1 : 0; $showDescription = isset($params['show_description']) ? 1 : 0;
$sendSubscriptionNotification = isset($params['send_subscription_notification']); $sendSubscriptionNotification = isset($params['send_subscription_notification']);

Loading…
Cancel
Save