Browse Source

Minor - adding session info see BT#8814

Julio Montoya 10 years ago
parent
commit
b104f04d4c
2 changed files with 21 additions and 12 deletions
  1. 6 5
      main/inc/lib/attendance.lib.php
  2. 15 7
      main/template/default/export/table_pdf.tpl

+ 6 - 5
main/inc/lib/attendance.lib.php

@@ -1666,7 +1666,7 @@ class Attendance
 			);
 			$row++;
 		}
-		$table->setColAttributes(0, array('style' => 'width:30%'));
+		$table->setColAttributes(0, array('style' => 'width:28%'));
 
 		$row = 1;
 		foreach ($users as $user) {
@@ -1679,15 +1679,16 @@ class Attendance
 			$row++;
 		}
 
-		$tableToString = null;
+		//$tableToString = null;
 
 		//$sessionInfo = api_get_session_info(api_get_session_id());
 		//if (!empty($sessionInfo)) {
-		$tableToString .= '<strong>'.get_lang('PeriodToDisplay').'</strong>: '.
-			sprintf(get_lang('FromDateXToDateY'), $startDate, $endDate);
+		/*$tableToString .= '<strong>'.get_lang('PeriodToDisplay').'</strong>: '.
+			sprintf(get_lang('FromDateXToDateY'), $startDate, $endDate);*/
 		//}
 
-		$tableToString .= $table->toHtml();
+		$tableToString = $table->toHtml();
+
 		$params = array(
 			'filename' => get_lang('Attendance') . '_' . api_get_utc_datetime(),
 			'pdf_title' => get_lang('Attendance'),

+ 15 - 7
main/template/default/export/table_pdf.tpl

@@ -15,17 +15,25 @@
     </tr>
 
     {% if pdf_session_info %}
-    <tr>
-        <td>
-          <strong>{{ "Session" | get_lang }}:</strong> {{ pdf_session_info.name }}
-        </td>
+        <tr>
+            <td>
+              <strong>{{ "Session" | get_lang }}:</strong> {{ pdf_session_info.name }}
+            </td>
 
-        {% if pdf_session_info.description %}
+            {% if pdf_session_info.description %}
+                <td>
+                    <strong>{{ "Description" | get_lang }}:</strong> {{ pdf_session_info.description }}
+                </td>
+            {% endif %}
+        </tr>
+
+        {% if pdf_session_info.date_start != '0000-00-00' and pdf_session_info.date_end != '0000-00-00' %}
+            <tr>
             <td>
-                <strong>{{ "Description" | get_lang }}:</strong> {{ pdf_session_info.description }}
+                <strong>{{ "PeriodToDisplay" | get_lang }}:</strong> {{ "FromDateXToDateY"| get_lang | format(pdf_session_info.date_start, pdf_session_info.date_end ) }}
             </td>
+            </tr>
         {% endif %}
-    </tr>
     {% endif %}
 
     {% if pdf_course_info %}