瀏覽代碼

UI changes for ScheduledAnnouncement.

jmontoyaa 7 年之前
父節點
當前提交
bf076cd88f

+ 5 - 3
main/inc/lib/ScheduledAnnouncement.php

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

+ 5 - 8
main/session/resume_session.php

@@ -18,12 +18,6 @@ use Chamilo\CoreBundle\Entity\Session,
 $cidReset = true;
 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)
 $this_section = SECTION_PLATFORM_ADMIN;
 
@@ -36,7 +30,10 @@ if (empty($sessionId)) {
 SessionManager::protectSession($sessionId);
 
 $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';
 
@@ -362,7 +359,7 @@ if (!empty($sessionInfo['promotion_id'])) {
 $programmedAnnouncement = new ScheduledAnnouncement();
 $programmedAnnouncement = $programmedAnnouncement->allowed();
 
-$tpl = new Template(get_lang('Session'));
+$tpl = new Template($tool_name);
 $tpl->assign('session_header', $sessionHeader);
 $tpl->assign('title', $sessionTitle);
 $tpl->assign('general_coach', $generalCoach);

+ 22 - 10
main/session/scheduled_announcement.php

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

+ 8 - 8
main/session/session_edit.php

@@ -55,7 +55,6 @@ if (!empty($sessionInfo['coach_access_end_date'])) {
 $id_coach = $sessionInfo['id_coach'];
 $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' => "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;
 
 if (api_is_multiple_url_enabled()) {
-	$table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
-	$access_url_id = api_get_current_access_url_id();
-	if ($access_url_id != -1) {
-		$sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
-		        FROM $tbl_user u
+    $table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+    $access_url_id = api_get_current_access_url_id();
+    if ($access_url_id != -1) {
+        $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
+                FROM $tbl_user u
                 INNER JOIN $table_access_url_rel_user url_rel_user
                 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);
@@ -157,6 +156,7 @@ if ($form->validate()) {
     if ($params['access'] == 1) {
         $duration = null;
     }
+
     $description = $params['description'];
     $showDescription = isset($params['show_description']) ? 1 : 0;
     $sendSubscriptionNotification = isset($params['send_subscription_notification']);