Merge 1.10.x

remotes/angel/1.11.x
jmontoyaa 8 years ago
commit adcf90959d
  1. 29
      app/Migrations/Schema/V110/Version20160707131900.php
  2. 5
      main/admin/teachers_time_by_session_report.php
  3. 4
      main/inc/ajax/model.ajax.php
  4. 3
      main/inc/lib/sessionmanager.lib.php
  5. 19
      main/mySpace/session.php
  6. 2
      main/template/default/admin/settings_index.tpl

@ -0,0 +1,29 @@
<?php
/* For licensing terms, see /license.txt */
namespace Application\Migrations\Schema\V110;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
/**
* Fix c_quiz_answer's correct field for id_auto
*/
class Version20160707131900 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql("
ALTER TABLE c_quiz_answer ADD INDEX idx_cqa_q (question_id)");
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
}
}

@ -14,11 +14,14 @@ $cidReset = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php'; require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php';
api_protect_admin_script(); if (!api_is_platform_admin(true) && !api_is_teacher()) {
api_not_allowed(true);
}
$toolName = get_lang('TeacherTimeReportBySession'); $toolName = get_lang('TeacherTimeReportBySession');
$em = Database::getManager(); $em = Database::getManager();
SessionManager::get_sessions_by_user();
$sessionsInfo = SessionManager::get_sessions_list([], ['name']); $sessionsInfo = SessionManager::get_sessions_list([], ['name']);
$session = null; $session = null;

@ -109,6 +109,10 @@ $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false;
$forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false; $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false;
$extra_fields = array(); $extra_fields = array();
if (!empty($searchString)) {
$search = 'true';
}
if (($search || $forceSearch) && ($search !== 'false')) { if (($search || $forceSearch) && ($search !== 'false')) {
$whereCondition = ' 1 = 1 '; $whereCondition = ' 1 = 1 ';
$whereConditionInForm = getWhereClause($searchField, $searchOperator, $searchString); $whereConditionInForm = getWhereClause($searchField, $searchOperator, $searchString);

@ -3853,6 +3853,7 @@ class SessionManager
* Protect a session to be edited. * Protect a session to be edited.
* @param int $id * @param int $id
* @param bool $checkSession * @param bool $checkSession
* @return mixed | bool true if pass the check, api_not_allowed otherwise
*/ */
public static function protectSession($id, $checkSession = true) public static function protectSession($id, $checkSession = true)
{ {
@ -3951,7 +3952,7 @@ class SessionManager
*/ */
public static function allowManageAllSessions() public static function allowManageAllSessions()
{ {
if (api_is_platform_admin()) { if (api_is_platform_admin() || api_is_session_admin()) {
return true; return true;
} }

@ -40,7 +40,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
if (!api_is_session_admin()) { if (!api_is_session_admin()) {
$menu_items[] = Display::url( $menu_items[] = Display::url(
Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH)."auth/my_progress.php" api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
); );
$menu_items[] = Display::url( $menu_items[] = Display::url(
Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
@ -81,11 +81,11 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
$actionsRight = Display::url( $actionsRight = Display::url(
Display::return_icon('printer.png', get_lang('Print'), array(), 32), Display::return_icon('printer.png', get_lang('Print'), array(), 32),
'javascript: void(0);', 'javascript: void(0);',
array('onclick'=>'javascript: window.print();') array('onclick' => 'javascript: window.print();')
); );
$actionsRight .= Display::url( $actionsRight .= Display::url(
Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32),
api_get_self().'?export=csv' api_get_self() . '?export=csv'
); );
} }
@ -97,6 +97,19 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) {
echo Display::page_header(get_lang('YourSessionsList')); echo Display::page_header(get_lang('YourSessionsList'));
} elseif (api_is_teacher()) {
$actionsRight = Display::url(
Display::return_icon('clock.png', get_lang('TeacherTimeReportBySession'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH) . 'admin/teachers_time_by_session_report.php'
);
$toolbar = Display::toolbarAction(
'toolbar-session',
array('', $actionsRight)
);
echo $toolbar;
echo Display::page_header(get_lang('YourSessionsList'));
} else { } else {
$a_sessions = Tracking::get_sessions_coached_by_user($id_coach); $a_sessions = Tracking::get_sessions_coached_by_user($id_coach);
} }

@ -51,7 +51,7 @@ $(document).ready(function() {
{{ block_item.icon }} {{ block_item.label }} {{ block_item.icon }} {{ block_item.label }}
{% if block_item.editable and _u.is_admin %} {% if block_item.editable and _u.is_admin %}
<a class="admin-edit-block pull-right" href="#" data-label="{{ block_item.label }}" title="{{ 'Edit' | get_lang }}" data-id="{{ block_item.class }}"> <a class="admin-edit-block pull-right" href="#" data-label="{{ block_item.label }}" title="{{ 'Edit' | get_lang }}" data-id="{{ block_item.class }}">
<img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}"> <img src="{{ "edit.png"|icon(22) }}" width="22" height="22" alt="{{ "Edit"|get_lang }}" title="{{ "Edit"|get_lang }}" />
</a> </a>
{% endif %} {% endif %}
</div> </div>

Loading…
Cancel
Save