Juan Carlos Raña vor 14 Jahren
Ursprung
Commit
5d12862f0b

+ 8 - 1
documentation/changelog.html

@@ -28,7 +28,7 @@
    <li>Update Google Maps plugin to 1.98 (Feature #1925)</li>
    <li>Add a personal portfolio to Social Network. All users can easy copy some files from several courses in his/her personal portfolio (Feature #1853)</li>
    <li>Students can edit, move and delete documents and drawings; create, move and delete subfolders, create user templates and make personal backups into a course inside his user shared folder (Features #2076, #2484)</li>
-   <li>Learning Path: New LP exercises reports added for teachers and admins (Feature BT#1634)</li>   
+   <li>Learning Path: New LP exercises reports added for teachers and admins (Feature BT#1634)</li>
    <li>Support for displaying vector graphics files (SVG) and multimedia OGG files, facilitating the inclusion of videos and audios in HTML 5 (Feature #2244)</li>
    <li>Admin tool to compare and move scores and tracking from a course to a session course BT#1786</li>
    <li>An optional "Course (training) validation" feature has been implemented. When it is activated, teachers loose ability to create coursers. Teachers fill course requests instead. Then, after approval, the requested courses are created by the platform administrator. (Feature # 2099)</li>
@@ -36,6 +36,13 @@
    <li>Added install/uninstall script possibilities for plugins (BT#1752)</li>
    <li>Integrate svg-edit. Teachers, students (into his/her user folder) and groups can create, edit and import SVG vector graphics online and export to PNG (Feature #2044, #2101,)</li>
    <li>A new plugin for making ASCIIsvg-based mathematical graphics has been created for the online editor (enable it from administrator's section). For using it, browsers should support SVG-technology. See a demo, implemented on TinyMCE: <a href="http://www.imathas.com/editordemo/demo.html" target="_blank">http://www.imathas.com/editordemo/demo.html</a>; for syntax and additional information see <a href="http://www1.chapman.edu/~jipsen/svg/asciisvg.html" target="_blank">http://www1.chapman.edu/~jipsen/svg/asciisvg.html</a>. This plugin uses the library file chamilo/main/inc/lib/asciimath/ASCIIMathML.js which has combined functionality ASCIIMathML + ASCIIsvg (Feature #2132)</li>
+   <li>Feature #2132: In the administrator's section "Administration &gt; Configuration settings &gt; Editor" some settings are to be used as follows:
+     <ul>
+       <li>"ASCIIMathML mathematical editor" - activates the plugin for inserting mathematical formulas;</li>
+       <li>"Mathematical graphics editor ASCIIsvg" - activates the plugin for inserting mathematical graphs;</li>
+       <li>"Load the file ASCIIMathML.js in all the system's pages" - activates the possibility for inserting/showing formulas and graphics outside the "Documents" tool, elsewhere in the system.</li>
+     </ul>
+   </li>
    <li>A new plugin for insert Widgets into your web pages</li>
    <li>Users can use online service to convert your text vozMe in mp3 audio files (Feature #2497)</li>
    <li>Students also can export documents to pdf</li>

+ 1 - 0
documentation/credits.html

@@ -446,6 +446,7 @@ rewritten by
     <ul>
       <li>Peter Jipsen</li>
       <li>David Lippman</li>
+      <li>Mauno Korpelainen for extending the symbol tables within the script ASCIIMathML.js</li>
       <li>Ivan Tcholakov for porting code in Chamilo LMS</li>
       <li>Furio Petrossi for advocacy, reserch and recommendations</li>
     </ul>

+ 63 - 63
documentation/installation_guide.html

@@ -1,22 +1,22 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-	<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<title>Chamilo 1.8.7.1 Installation Guide</title><link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
-	<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
-	<style type="text/css">
-	<!--
-		page { width: 21cm; height: 29.7cm; margin: 2cm }
-		pre { font-family: "Courier New", monospace }
-		p { margin-bottom: 0.21cm }
-		.code {margin: 1em 1em 1em 2em; padding: 0.5em; background-color: rgb(229, 229, 229); vertical-align: top; border: 1px solid #999999;}
-	-->
-	</style>
-	</head>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Chamilo 1.8.7.1 Installation Guide</title><link rel="stylesheet" href="default.css" type="text/css" media="screen,projection" />
+    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
+    <style type="text/css">
+    <!--
+        page { width: 21cm; height: 29.7cm; margin: 2cm }
+        pre { font-family: "Courier New", monospace }
+        p { margin-bottom: 0.21cm }
+        .code {margin: 1em 1em 1em 2em; padding: 0.5em; background-color: rgb(229, 229, 229); vertical-align: top; border: 1px solid #999999;}
+    -->
+    </style>
+    </head>
 <body>
 
 <div id="header1">
-	<h1>Chamilo 1.8.7.1 : Installation Guide</h1>
+    <h1>Chamilo 1.8.7.1 : Installation Guide</h1>
 </div>
 
 <a href="index.html">Documentation</a> &gt; Installation Guide
@@ -223,11 +223,11 @@ To get the best of Chamilo, you need to finetune PHP settings. Consider : <br />
 
 
 <div class="code">
-	  max_execution_time = 300&nbsp;&nbsp;&nbsp; ; Maximum execution time of each script, in seconds<br />
-	  max_input_time = 600 ; Maximum amount of time each script may spend parsing request data<br />
-	  memory_limit = 256M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Maximum amount of memory a script may consume (128MB)<br />
-	  post_max_size = 64M<br />
-	  upload_max_filesize = 100M
+      max_execution_time = 300&nbsp;&nbsp;&nbsp; ; Maximum execution time of each script, in seconds<br />
+      max_input_time = 600 ; Maximum amount of time each script may spend parsing request data<br />
+      memory_limit = 256M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Maximum amount of memory a script may consume (128MB)<br />
+      post_max_size = 64M<br />
+      upload_max_filesize = 100M
 </div>
 
 <p>Some users could meet problems if their PHP settings don't fit
@@ -263,11 +263,11 @@ date.timezone = 'America/New_York'
 
 <p>You might also add the following php modules and packages:</p>
 <ul>
-	<li>php-ctype</li>
-	<li>php-gd</li>
-	<li>php-iconv</li>
-	<li>php-json</li>
-	<li>php-mbstring</li>
+    <li>php-ctype</li>
+    <li>php-gd</li>
+    <li>php-iconv</li>
+    <li>php-json</li>
+    <li>php-mbstring</li>
 </ul>
 <p><a href="http://dev.mysql.com/doc/mysql/en/index.html"></a><br /></p>
 
@@ -559,21 +559,21 @@ The fields used intensively by the Chamlio module are:<br />
 
 <ul>
 
-	<li>uid, which is matched to the username in Chamilo</li>
+    <li>uid, which is matched to the username in Chamilo</li>
 
-	<li>userPassword, which is matched to the user password, although
+    <li>userPassword, which is matched to the user password, although
 this part will only work for non-encrypted passwords for now, but it
 shouldn't be necessary if using the LDAP server as authentication</li>
 
-	<li>ou should end with the year of the person registration or any
+    <li>ou should end with the year of the person registration or any
 criteria you will use to filter users, so that they can be retrieved on
 that criteria</li>
 
-	<li>sn is used as the lastname field in Chamilo</li>
+    <li>sn is used as the lastname field in Chamilo</li>
 
-	<li>givenName is used as the firstname field in Chamilo</li>
+    <li>givenName is used as the firstname field in Chamilo</li>
 
-	<li>mail is used as the email field in Chamilo</li>
+    <li>mail is used as the email field in Chamilo</li>
 </ul>
 
 
@@ -584,20 +584,20 @@ that criteria</li>
 
 You can enable mathematical equations writing inside the Chamilo online editor (FCKEditor) by applying the following steps:
 <ul>
-	<li>1. Configure your Apache installation to add a cgi-bin directory that contains a symbolic link to the mimetex.cgi in <i>chamilo/main/inc/lib/mimetex/</i> (*see below, step 4)</li>
-	<li>2. Reload your Apache configuration</li>
-	<li>3. Edit the online editor's configuration file <i>chamilo/main/inc/lib/fckeditor/myconfig.php</i> and</li>
-	<li>3.1. Enable the mimetex plugin, find the line //$config['LoadPlugin'][] = 'mimetex'; and modify it to be: <b>$config['LoadPlugin'][] = 'mimetex';</b> (remove the double slash)</li>
-	<li>3.2. The additional settings <b>$config['MimetexExecutableInstalled']</b> , <b>$config['MimetexExecutableDetectionMethod']</b>
+    <li>1. Configure your Apache installation to add a cgi-bin directory that contains a symbolic link to the mimetex.cgi in <i>chamilo/main/inc/lib/mimetex/</i> (*see below, step 4)</li>
+    <li>2. Reload your Apache configuration</li>
+    <li>3. Edit the online editor's configuration file <i>chamilo/main/inc/lib/fckeditor/myconfig.php</i> and</li>
+    <li>3.1. Enable the mimetex plugin, find the line //$config['LoadPlugin'][] = 'mimetex'; and modify it to be: <b>$config['LoadPlugin'][] = 'mimetex';</b> (remove the double slash)</li>
+    <li>3.2. The additional settings <b>$config['MimetexExecutableInstalled']</b> , <b>$config['MimetexExecutableDetectionMethod']</b>
 and <b>$config['MimetexExecutableDetectionTimeout']</b> are configured for best probability of automatic detection of the installed on the server file <i>mimetex.cgi</i> or <i>mimetex.exe</i>.
 In rare cases these options might need to be twicked, see the acccompanying comments about these options within the file <i>myconfig.php</i></li>
 
-	<li>3.3. Once the plugin has been activated, almost in all toolbars the corresponding button appears.
+    <li>3.3. Once the plugin has been activated, almost in all toolbars the corresponding button appears.
 If you need to edit some toolbars, see the configuration files (php) within the directory <i>chamilo/main/inc/lib/fckeditor/toolbars/</i> .
 Here is an example:
     <div class="code">$config['ToolbarSets']['Normal'] = array(<br /> &nbsp;&nbsp;array('FitWindow','Bold','Image','Link','PasteWord','MP3',<b>'mimetex'</b>,'Table','Subscript','Superscript','ShowBlocks')<br />);</div>
-	The item <b>'mimetex'</b> represents the button, you may add it to or remove it from any toolbar.<br /><br />
-	</li>
+    The item <b>'mimetex'</b> represents the button, you may add it to or remove it from any toolbar.<br /><br />
+    </li>
     <li>4. To install mimetex executable file, make these changes:</li>
 </ul>
 
@@ -644,46 +644,46 @@ and about the ASCIIMath formula syntax see <a href="http://www1.chapman.edu/~jip
 and <a href="http://dlippman.imathas.com/asciimathtex/AMT.html">http://dlippman.imathas.com/asciimathtex/AMT.html</a>.</p>
 
 <p>For writing ASCIIMath formulas in documents, a correspondent plugin for the online editor should be activated. For doing this,
-see the platform administration section and open the page "Administration &gt; Configuration settings &gt; WYSIWYG Editor".
+see the platform administration section and open the page "Administration &gt; Configuration settings &gt; Editor".
 Enable the setting <strong>"ASCIIMathML mathematical editor"</strong>.</p>
 
 <p>Inside documents, the script ASCIIMathML.js renders mathematical formulas in two altrnative ways:</p>
 <ul>
-	<li>By translation ASCIIMath formula notation into MathML code. MathML standard currently is supported by the following browsers:
-		<ul>
-			<li>Mozilla Firefox, you may consider installing STIX fonts (<a href="http://www.stixfonts.org">http://www.stixfonts.org</a>) on your client machines for nice looking formulas</li>
-			<li>Internet Explorer 6 or higher with the add-on MathPlayer 2.0 or higher (<a href="http://www.dessci.com/en/products/mathplayer">http://www.dessci.com/en/products/mathplayer</a>)</li>
-			<li>Opera 9.5 or higher</li>
-		</ul>
-	</li>
-	<li>For browser that do not support MathML - by translation ASCIIMath formula notation into TeX notation and passing it to
-	an external service. The external service produces and returns an image that contains the formula. This way is so called
-	"image-based fallback".
-	</li>
+    <li>By translation ASCIIMath formula notation into MathML code. MathML standard currently is supported by the following browsers:
+        <ul>
+            <li>Mozilla Firefox, you may consider installing STIX fonts (<a href="http://www.stixfonts.org">http://www.stixfonts.org</a>) on your client machines for nice looking formulas</li>
+            <li>Internet Explorer 6 or higher with the add-on MathPlayer 2.0 or higher (<a href="http://www.dessci.com/en/products/mathplayer">http://www.dessci.com/en/products/mathplayer</a>)</li>
+            <li>Opera 9.5 or higher</li>
+        </ul>
+    </li>
+    <li>For browser that do not support MathML - by translation ASCIIMath formula notation into TeX notation and passing it to
+    an external service. The external service produces and returns an image that contains the formula. This way is so called
+    "image-based fallback".
+    </li>
 </ul>
 
 <p>For providing <strong>image-based fallback</strong> in a production system, you should pick up and install on your server software for TeX rendering, such as:</p>
 <ul>
-	<li>mimeTeX - <a href="http://www.forkosh.dreamhost.com/source_mimetex.html">http://www.forkosh.dreamhost.com/source_mimetex.html</a>.
-	See <a href="#7._Mathematical_formulas">"7. Mathematical formulas with LaTeX"</a> on how to install the mimetex executable file on your server</li>
-	<li>mathTeX - <a href="http://www.forkosh.com/mathtex.html">http://www.forkosh.com/mathtex.html</a>. Browse the site for installation instructions</li>
+    <li>mimeTeX - <a href="http://www.forkosh.dreamhost.com/source_mimetex.html">http://www.forkosh.dreamhost.com/source_mimetex.html</a>.
+    See <a href="#7._Mathematical_formulas">"7. Mathematical formulas with LaTeX"</a> on how to install the mimetex executable file on your server</li>
+    <li>mathTeX - <a href="http://www.forkosh.com/mathtex.html">http://www.forkosh.com/mathtex.html</a>. Browse the site for installation instructions</li>
 </ul>
 
 <p>As an alternative, you may try to use some public services for TeX rendering, such as:</p>
 <ul>
-	<li>MathTran - <a href="http://www.mathtran.org">http://www.mathtran.org</a></li>
-	<li>Google Chart Tools - <a href="http://code.google.com/apis/charttools">http://code.google.com/apis/charttools</a></li>
+    <li>MathTran - <a href="http://www.mathtran.org">http://www.mathtran.org</a></li>
+    <li>Google Chart Tools - <a href="http://code.google.com/apis/charttools">http://code.google.com/apis/charttools</a></li>
 </ul>
 
 <p>Open with a text editor the file <strong>.../chamilo/main/inc/lib/asciimath/ASCIIMathML.js</strong>.
 Find somewhere at the beginning the line that initializes the variable <strong>AMTcgiloc</strong>.
 You may need to alter the setting to be for example:</p>
 <ul>
-	<li><div class="code">var AMTcgiloc = "http://mychamiloserver.org/cgi-bin/mimetex.cgi";</div></li>
-	<li><div class="code">var AMTcgiloc = "http://mychamiloserver.org/cgi-bin/mathtex.cgi";</div></li>
-	<li><div class="code">var AMTcgiloc = "http://www.mathtran.org/cgi-bin/mathtran?tex=";</div></li>
-	<li><div class="code">var AMTcgiloc = "http://chart.apis.google.com/chart?cht=tx&amp;chs=1x0&amp;chl=";</div></li>
-	<li>... or something else</li>
+    <li><div class="code">var AMTcgiloc = "http://mychamiloserver.org/cgi-bin/mimetex.cgi";</div></li>
+    <li><div class="code">var AMTcgiloc = "http://mychamiloserver.org/cgi-bin/mathtex.cgi";</div></li>
+    <li><div class="code">var AMTcgiloc = "http://www.mathtran.org/cgi-bin/mathtran?tex=";</div></li>
+    <li><div class="code">var AMTcgiloc = "http://chart.apis.google.com/chart?cht=tx&amp;chs=1x0&amp;chl=";</div></li>
+    <li>... or something else</li>
 </ul>
 <p>For testing how the variable <strong>AMTcgiloc</strong> may be set, there are some examples (as comments) inside the script.</p>
 <hr style="width: 100%; height: 2px;" />
@@ -701,7 +701,7 @@ You may need to alter the setting to be for example:</p>
 
 <hr />
     <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
-	<a href="http://jigsaw.w3.org/css-validator/">
-		<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
-	</a>
+    <a href="http://jigsaw.w3.org/css-validator/">
+        <img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
+    </a>
 </body></html>

+ 563 - 0
main/admin/add_sessions_to_promotion.php

@@ -0,0 +1,563 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+*   @package chamilo.admin
+*/
+
+// name of the language file that needs to be included
+$language_file=array('admin','registration');
+
+// resetting the course id
+$cidReset=true;
+
+// including some necessary files
+require_once '../inc/global.inc.php';
+require_once '../inc/lib/xajax/xajax.inc.php';
+require_once api_get_path(LIBRARY_PATH).'promotion.lib.php';
+require_once api_get_path(LIBRARY_PATH).'career.lib.php';
+require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
+
+$xajax = new xajax();
+
+//$xajax->debugOn();
+$xajax -> registerFunction ('search_sessions');
+
+// setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+// Access restrictions
+api_protect_admin_script(true);
+
+// setting breadcrumbs
+$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareerAndPromotions'));
+
+// Database Table Definitions
+
+// setting the name of the tool
+$tool_name=get_lang('SubscribeSessionsToPromotions');
+
+$add_type = 'multiple';
+if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+
+//checking for extra field with filter on
+
+function search_sessions($needle,$type) {
+    global $tbl_user,$tbl_session_rel_user,$id_session;
+    $xajax_response = new XajaxResponse();
+    $return = '';
+
+    if (!empty($needle) && !empty($type)) {
+
+        // xajax send utf8 datas... datas in db can be non-utf8 datas
+        $charset = api_get_system_encoding();
+        $needle = Database::escape_string($needle);
+        $needle = api_convert_encoding($needle, $charset, 'utf-8');
+        $user_anonymous=api_get_anonymous_id();
+
+        $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
+        $cond_user_id = '';
+        if (!empty($id_session)) {
+        $id_session = Database::escape_string($id_session);
+            // check id_user from session_rel_user table
+            $sql = 'SELECT id_user FROM '.$tbl_session_rel_user.' WHERE id_session ="'.(int)$id_session.'" AND relation_type<>'.SESSION_RELATION_TYPE_RRHH.' ';
+            $res = Database::query($sql);
+            $user_ids = array();
+            if (Database::num_rows($res) > 0) {
+                while ($row = Database::fetch_row($res)) {
+                    $user_ids[] = (int)$row[0];
+                }
+            }
+            if (count($user_ids) > 0){
+                $cond_user_id = ' AND user.user_id NOT IN('.implode(",",$user_ids).')';
+            }
+        }
+
+        if ($type == 'single') {
+            // search users where username or firstname or lastname begins likes $needle
+            $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
+                    WHERE (username LIKE "'.$needle.'%"
+                    OR firstname LIKE "'.$needle.'%"
+                OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'"   AND user.status<>'.DRH.''.
+                $order_clause.
+                ' LIMIT 11';
+        } else {
+            $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
+                    WHERE '.(api_sort_by_first_name() ? 'firstname' : 'lastname').' LIKE "'.$needle.'%" AND user.status<>'.DRH.' AND user.user_id<>"'.$user_anonymous.'"'.$cond_user_id.
+                    $order_clause;
+        }
+
+        global $_configuration;
+        if ($_configuration['multiple_access_urls']) {
+            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+            $access_url_id = api_get_current_access_url_id();
+            if ($access_url_id != -1){
+                if ($type == 'single') {
+                    $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
+                    INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
+                    WHERE access_url_id = '.$access_url_id.'  AND (username LIKE "'.$needle.'%"
+                    OR firstname LIKE "'.$needle.'%"
+                    OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'" AND user.status<>'.DRH.' '.
+                    $order_clause.
+                    ' LIMIT 11';
+                } else {
+                    $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user
+                    INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
+                    WHERE access_url_id = '.$access_url_id.'
+                    AND '.(api_sort_by_first_name() ? 'firstname' : 'lastname').' LIKE "'.$needle.'%" AND user.status<>'.DRH.' AND user.user_id<>"'.$user_anonymous.'"'.$cond_user_id.
+                    $order_clause;
+                }
+
+            }
+        }
+
+        $rs = Database::query($sql);
+        $i=0;
+        if ($type=='single') {
+            while ($user = Database :: fetch_array($rs)) {
+                $i++;
+                if ($i<=10) {
+                    $person_name = api_get_person_name($user['firstname'], $user['lastname']);
+                    $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />';
+                } else {
+                    $return .= '...<br />';
+                }
+            }
+
+            $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
+
+        } else {
+            global $nosessionUsersList;
+            $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">';
+            while ($user = Database :: fetch_array($rs)) {
+                $person_name = api_get_person_name($user['firstname'], $user['lastname']);
+                $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>';
+            }
+            $return .= '</select>';
+            $xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
+        }
+    }
+
+    return $xajax_response;
+}
+
+$xajax -> processRequests();
+
+$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
+$htmlHeadXtra[] = '
+<script type="text/javascript">
+function add_user_to_session (code, content) {
+
+    document.getElementById("user_to_add").value = "";
+    document.getElementById("ajax_list_users_single").innerHTML = "";
+
+    destination = document.getElementById("session_in_promotion");
+
+    for (i=0;i<destination.length;i++) {
+        if(destination.options[i].text == content) {
+                return false;
+        }
+    }
+
+    destination.options[destination.length] = new Option(content,code);
+    destination.selectedIndex = -1;
+    sortOptions(destination.options);
+}
+function remove_item(origin) {
+    for(var i = 0 ; i<origin.options.length ; i++) {
+        if(origin.options[i].selected) {
+            origin.options[i]=null;
+            i = i-1;
+        }
+    }
+}
+
+function validate_filter() {
+        document.formulaire.add_type.value = \''.$add_type.'\';
+        document.formulaire.form_sent.value=0;
+        document.formulaire.submit();
+}
+</script>';
+
+
+$form_sent=0;
+$errorMsg=$firstLetterUser=$firstLetterSession='';
+$UserList=$SessionList=array();
+$users=$sessions=array();
+$noPHP_SELF=true;
+
+$promotion = new Promotion();
+$id = intval($_GET['id']);
+//echo '<pre>';
+if($_POST['form_sent']) {
+    $form_sent          = $_POST['form_sent'];
+    $firstLetterUser    = $_POST['firstLetterUser'];
+    $firstLetterSession = $_POST['firstLetterSession'];
+    $session_in_promotion_posted       = $_POST['session_in_promotion_name'];     
+    if (!is_array($session_in_promotion_posted)) {
+        $session_in_promotion_posted=array();
+    }
+    if ($form_sent == 1) {
+        //added a parameter to send emails when registering a user        
+        SessionManager::suscribe_sessions_to_promotion($id, $session_in_promotion_posted);
+        header('Location: promotions.php');
+        exit;        
+    }
+}
+
+Display::display_header($tool_name);
+
+$promotion_data = $promotion->get($id);
+$session_list = SessionManager::get_sessions_list();
+
+//api_display_tool_title($tool_name.' ('.$session_info['name'].')');
+$session_not_in_promotion = $session_in_promotion= array();
+
+if (!empty($session_list)) {
+    foreach($session_list as $session) {
+        $promotion_id = $session['promotion_id'];    
+        if (isset($promotion_id) && !empty($promotion_id)) {
+            if ($promotion_id == $id) {                
+                $session_in_promotion[$session['id']] = $session['name'];
+    	    } else {
+    	    	$session_not_in_promotion[$session['id']] = $session['name'];
+    	    } 
+    	} else {
+    		$session_not_in_promotion[$session['id']] = $session['name'];
+    	}
+    }
+}
+$ajax_search = $add_type == 'unique' ? true : false;
+
+if ($ajax_search) {
+    $sql="SELECT user_id, lastname, firstname, username, id_session
+            FROM $tbl_user
+            INNER JOIN $tbl_session_rel_user
+                ON $tbl_session_rel_user.id_user = $tbl_user.user_id AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                AND $tbl_session_rel_user.id_session = ".intval($id_session)."
+                WHERE status<>".DRH." $order_clause";
+
+    if ($_configuration['multiple_access_urls']) {
+        $tbl_user_rel_access_url= 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 u.user_id, lastname, firstname, username, id_session
+            FROM $tbl_user u
+            INNER JOIN $tbl_session_rel_user
+                ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                AND $tbl_session_rel_user.id_session = ".intval($id_session)."
+                INNER JOIN $tbl_user_rel_access_url url_user ON (url_user.user_id=u.user_id)
+                WHERE access_url_id = $access_url_id AND u.status<>".DRH."
+                $order_clause";
+        }
+    }
+    $result=Database::query($sql);
+    $Users=Database::store_result($result);
+    foreach ($Users as $user) {
+        $sessionUsersList[$user['user_id']] = $user ;
+    }
+} else {
+          $sql="SELECT  user_id, lastname, firstname, username, id_session
+            FROM $tbl_user u
+            LEFT JOIN $tbl_session_rel_user
+            ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.id_session = '$id_session' AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+            WHERE u.status<>".DRH."
+        $order_clause";
+       
+        if ($_configuration['multiple_access_urls']) {
+            $tbl_user_rel_access_url= 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  u.user_id, lastname, firstname, username, id_session
+                FROM $tbl_user u
+                LEFT JOIN $tbl_session_rel_user
+                    ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.id_session = '$id_session' AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                INNER JOIN $tbl_user_rel_access_url url_user ON (url_user.user_id=u.user_id)
+                WHERE access_url_id = $access_url_id  $where_filter AND u.status<>".DRH."
+            $order_clause";
+            }
+        }
+
+        $result=Database::query($sql);
+        $Users=Database::store_result($result);
+        //var_dump($_REQUEST['id_session']);
+        foreach ($Users as $user) {
+            if($user['id_session'] != $id_session)
+                $nosessionUsersList[$user['user_id']] = $user ;
+        }
+        $user_anonymous=api_get_anonymous_id();
+        foreach($nosessionUsersList as $key_user_list =>$value_user_list) {
+            if ($nosessionUsersList[$key_user_list]['user_id']==$user_anonymous) {
+                unset($nosessionUsersList[$key_user_list]);
+            }
+        }
+        //filling the correct users in list
+        $sql="SELECT  user_id, lastname, firstname, username, id_session
+            FROM $tbl_user u
+            LEFT JOIN $tbl_session_rel_user
+            ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.id_session = '$id_session' AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+            WHERE u.status<>".DRH." $order_clause";
+
+        if ($_configuration['multiple_access_urls']) {
+            $tbl_user_rel_access_url= 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  u.user_id, lastname, firstname, username, id_session
+                FROM $tbl_user u
+                LEFT JOIN $tbl_session_rel_user
+                    ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.id_session = '$id_session' AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                INNER JOIN $tbl_user_rel_access_url url_user ON (url_user.user_id=u.user_id)
+                WHERE access_url_id = $access_url_id AND u.status<>".DRH."
+                $order_clause";
+            }
+        }
+    $result=Database::query($sql);
+    $Users=Database::store_result($result);
+
+    foreach($Users as $key_user_list =>$value_user_list) {
+        if ($Users[$key_user_list]['user_id']==$user_anonymous) {
+            unset($Users[$key_user_list]);
+            }
+        }
+
+    foreach ($Users as $user) {
+        if($user['id_session'] == $id_session){
+            $sessionUsersList[$user['user_id']] = $user;
+            if (array_key_exists($user['user_id'],$nosessionUsersList))
+                unset($nosessionUsersList[$user['user_id']]);
+        }
+
+    }
+}
+
+if ($add_type == 'multiple') {
+    $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>';
+    $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple');
+} else {
+    $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique');
+    $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
+}
+/*
+<div class="actions">
+    <?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
+</div>
+*/
+?>
+
+
+<?php echo '<div class="row"><div class="form_header">'.$tool_name.' '.$promotion_data['name'].'</div></div><br/>'; ?>
+
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
+
+<?php
+if ($add_type=='multiple') {
+    if (is_array($extra_field_list)) {
+        if (is_array($new_field_list) && count($new_field_list)>0 ) {
+            echo '<h3>'.get_lang('FilterUsers').'</h3>';
+            foreach ($new_field_list as $new_field) {
+                echo $new_field['name'];
+                $varname = 'field_'.$new_field['variable'];
+                echo '&nbsp;<select name="'.$varname.'">';
+                echo '<option value="0">--'.get_lang('Select').'--</option>';
+                foreach ($new_field['data'] as $option) {
+                    $checked='';
+                    if (isset($_POST[$varname])) {
+                        if ($_POST[$varname]==$option[1]) {
+                            $checked = 'selected="true"';
+                        }
+                    }
+                    echo '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>';
+                }
+                echo '</select>';
+                echo '&nbsp;&nbsp;';
+            }
+            echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />';
+            echo '<br /><br />';
+        }
+    }
+}
+echo Display::input('hidden','id',$id);
+echo Display::input('hidden','form_sent','1');
+echo Display::input('hidden','add_type');
+if(!empty($errorMsg)) {
+    Display::display_normal_message($errorMsg); //main API
+}
+?>
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%">
+<!-- Users -->
+<tr>
+  <td align="center"><b><?php echo get_lang('SessionsInPlatform') ?> :</b>
+  </td>
+  <td></td>
+  <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td>
+</tr>
+
+<?php if ($add_type=='multiple') { ?>
+<tr>
+<td align="center">
+
+<?php echo get_lang('FirstLetterSessions'); ?> :
+     <select name="firstLetterUser" onchange = "xajax_search_sessions(this.value,'multiple')" >
+      <option value = "%">--</option>
+      <?php
+        echo Display :: get_alphabet_options();
+      ?>
+     </select>
+</td>
+<td align="center">&nbsp;</td>
+</tr>
+<?php } ?>
+<tr>
+  <td align="center">
+  <div id="content_source">
+      <?php
+      
+      
+      if (!($add_type=='multiple')) {
+        ?>
+        <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
+        <div id="ajax_list_users_single"></div>
+        <?php
+      } else {        
+        echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false);
+      ?>
+      <div id="ajax_list_users_multiple">
+        
+      </div>
+    <?php
+      }
+      unset($nosessionUsersList);
+     ?>
+  </div>
+  </td>
+  <td width="10%" valign="middle" align="center">
+  <?php
+  if ($ajax_search) {
+  ?>
+    <button class="arrowl" type="button" onclick="remove_item(document.getElementById('session_in_promotion'))" ></button>
+  <?php
+  } else {
+  ?>
+    <button class="arrowr" type="button" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))"></button>
+    <br /><br />
+    <button class="arrowl" type="button" onclick="moveItem(document.getElementById('session_in_promotion'), document.getElementById('session_not_in_promotion'))" onclick="moveItem(document.getElementById('session_in_promotion'), document.getElementById('session_not_in_promotion'))"></button>
+    <?php
+  }
+  ?>
+    <br /><br /><br /><br /><br /><br />
+  </td>
+  <td align="center">
+<?php
+
+    echo Display::select('session_in_promotion_name[]', $session_in_promotion, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'),false );
+    unset($sessionUsersList);
+?>
+ </td>
+</tr>
+<tr>
+    <td colspan="3" align="center">
+        <br />
+        <?php
+        echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeSessionsToPromotion').'</button>';
+        ?>
+    </td>
+</tr>
+</table>
+</form>
+
+<script type="text/javascript">
+<!--
+function moveItem(origin , destination){
+
+    for(var i = 0 ; i<origin.options.length ; i++) {
+        if(origin.options[i].selected) {
+            destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+            origin.options[i]=null;
+            i = i-1;
+        }
+    }
+    destination.selectedIndex = -1;
+    sortOptions(destination.options);
+
+}
+
+function sortOptions(options) {
+
+    newOptions = new Array();
+    for (i = 0 ; i<options.length ; i++)
+        newOptions[i] = options[i];
+
+    newOptions = newOptions.sort(mysort);
+    options.length = 0;
+    for(i = 0 ; i < newOptions.length ; i++)
+        options[i] = newOptions[i];
+
+}
+
+function mysort(a, b){
+    if(a.text.toLowerCase() > b.text.toLowerCase()){
+        return 1;
+    }
+    if(a.text.toLowerCase() < b.text.toLowerCase()){
+        return -1;
+    }
+    return 0;
+}
+
+function valide(){
+    var options = document.getElementById('session_in_promotion').options;
+    for (i = 0 ; i<options.length ; i++)
+        options[i].selected = true;
+    document.forms.formulaire.submit();
+}
+
+
+function loadUsersInSelect(select){
+
+    var xhr_object = null;
+
+    if(window.XMLHttpRequest) // Firefox
+        xhr_object = new XMLHttpRequest();
+    else if(window.ActiveXObject) // Internet Explorer
+        xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+    else  // XMLHttpRequest non supporté par le navigateur
+    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+
+    //xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
+    xhr_object.open("POST", "loadUsersInSelect.ajax.php");
+
+    xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+
+
+    nosessionUsers = makepost(document.getElementById('session_not_in_promotion'));
+    sessionUsers = makepost(document.getElementById('session_in_promotion'));
+    nosessionClasses = makepost(document.getElementById('origin_classes'));
+    sessionClasses = makepost(document.getElementById('destination_classes'));
+    xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
+
+    xhr_object.onreadystatechange = function() {
+        if(xhr_object.readyState == 4) {
+            document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
+            //alert(xhr_object.responseText);
+        }
+    }
+}
+
+function makepost(select){
+
+    var options = select.options;
+    var ret = "";
+    for (i = 0 ; i<options.length ; i++)
+        ret = ret + options[i].value +'::'+options[i].text+";;";
+
+    return ret;
+
+}
+-->
+
+</script>
+<?php
+Display::display_footer();

+ 102 - 0
main/admin/career_dashboard.php

@@ -0,0 +1,102 @@
+<?php
+// Language files that should be included.
+$language_file = array('courses', 'index');
+require_once '../inc/global.inc.php';
+$libpath = api_get_path(LIBRARY_PATH);
+require_once $libpath.'course.lib.php';
+//require_once $libpath.'usermanager.lib.php';
+require_once $libpath.'career.lib.php';
+require_once $libpath.'promotion.lib.php';
+require_once $libpath.'sessionmanager.lib.php';
+require_once $libpath.'formvalidator/FormValidator.class.php';
+
+
+require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
+require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
+require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
+
+api_protect_admin_script();
+
+
+$this_section = SECTION_PLATFORM_ADMIN;
+//Tab js
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.css" type="text/css">';
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-1.4.4.min.js" type="text/javascript" language="javascript"></script>'; //jQuery
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.min.js" type="text/javascript" language="javascript"></script>';
+//Grid js
+
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/css/ui.jqgrid.css" type="text/css">';
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript" language="javascript"></script>'; 
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript" language="javascript"></script>';
+
+Display :: display_header($nameTools);
+
+// action links
+echo '<div class="actions" style="margin-bottom:20px">';
+echo '<a href="careers.php">'.Display::return_icon('filenew.gif',get_lang('Add')).get_lang('Careers').'</a>';
+echo '<a href="promotions.php">'.Display::return_icon('filenew.gif',get_lang('Add')).get_lang('Promotions').'</a>';
+  
+echo '</div>';
+
+
+$career = new Career();
+$careers = $career->get_all();
+$column_count = 3;
+$i = 0;
+$grid_js = '';
+$career_array = array();
+if (!empty($careers)) {
+    foreach($careers as $career_item) {        
+        $promotion = new Promotion();
+        //Getting all promotions
+        $promotions = $promotion->get_all_promotions_by_career_id($career_item['id']);
+        $career_content = '';        
+        $promotion_array = array();
+        if (!empty($promotions)) {            
+            foreach($promotions as $promotion_item) {
+                //Getting all sessions from this promotion      
+                $sessions = SessionManager::get_all_sessions_by_promotion($promotion_item['id']); 
+                   
+                $session_list = array();    
+                foreach($sessions as $session_item) {               
+                    $session_list[] = $session_item;
+                }   
+                $promotion_array[$promotion_item['id']] =array('name'=>$promotion_item['name'], 'sessions'=>$session_list);  
+            }
+        }
+        $career_array[$career_item['id']] = array('name'=>$career_item['name'],'promotions'=>$promotion_array);
+    }   
+}
+
+echo '<table class="data_table">';
+
+foreach($career_array as $career_id => $data) {
+    $career     = $data['name'];
+    $promotions = $data['promotions'];    
+    echo '<tr><td style="background-color:#eee" colspan="2">'.$career.'</td></tr>';   
+    foreach($promotions as $promotion) {
+    	 $promotion_name = $promotion['name'];
+         $sessions       = $promotion['sessions'];
+         echo '<tr>';
+         $count = count($sessions);
+         $rowspan = '';
+         if (!empty($count )) {     
+            $count++;
+         	$rowspan = 'rowspan="'.$count.'"';
+         }
+         echo '<td '.$rowspan.'>';        
+         echo $promotion_name;
+         echo '</td>';
+         echo '</tr>';
+      
+      
+         foreach($sessions as $session) {
+             echo '<tr>';
+         	 echo Display::tag('td',$session['name']);
+             echo '</tr>';
+         }
+    }   
+  
+}
+echo '</table>';
+Display::display_footer();

+ 169 - 0
main/admin/careers.php

@@ -0,0 +1,169 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ *  @package chamilo.admin
+ */
+
+/* INITIALIZATION SECTION */
+
+// Language files that need to be included.
+$language_file = array('admin');
+
+$cidReset = true;
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+require_once api_get_path(LIBRARY_PATH).'career.lib.php';
+
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_admin_script();
+
+
+
+// Additional javascript
+//Jquery ui
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.css" type="text/css">';
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-1.4.4.min.js" type="text/javascript" language="javascript"></script>'; //jQuery
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.min.js" type="text/javascript" language="javascript"></script>';
+
+//Grid js
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/css/ui.jqgrid.css" type="text/css">';
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript" language="javascript"></script>'; 
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript" language="javascript"></script>';
+
+// The header.
+Display::display_header($tool_name);
+
+
+// Tool name
+if (isset($_GET['action']) && $_GET['action'] == 'add') {
+    $tool = 'Add';
+    $interbreadcrumb[] = array ('url' => api_get_self(), 'name' => get_lang('Career'));
+}
+if (isset($_GET['action']) && $_GET['action'] == 'editnote') {
+    $tool = 'Modify';
+    $interbreadcrumb[] = array ('url' => api_get_self(), 'name' => get_lang('Career'));
+}
+
+$url            = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_careers';
+$columns        = array(get_lang('Name'),get_lang('Description'),get_lang('Actions'));
+$column_model   = array(array('name'=>'name',           'index'=>'name',        'width'=>'80',   'align'=>'left'),
+                        array('name'=>'description',    'index'=>'description', 'width'=>'500',  'align'=>'left'),
+                        array('name'=>'actions',        'index'=>'actions',     'formatter'=>'action_formatter','width'=>'100',  'align'=>'left'),
+                       );                        
+$extra_params['autowidth'] = 'true'; //use the width of the parent
+$extra_params['height'] = 'auto'; //use the width of the parent
+
+$action_links = 'function action_formatter (cellvalue, options, rowObject) {
+                         return \'<a href="?action=edit&id=\'+options.rowId+\'"><img src="../img/edit.gif" title="'.get_lang('Edit').'"></a><a href="?action=delete&id=\'+options.rowId+\'"><img title="'.get_lang('Delete').'" src="../img/delete.gif"></a>\'; 
+                 }';
+                 
+
+?>
+<script>
+$(function() {    
+    <?php 
+         echo Display::grid_js('careers',  $url,$columns,$column_model,$extra_params,array(), $action_links);       
+    ?> 
+});
+</script>   
+<?php
+// Tool introduction
+Display::display_introduction_section(get_lang('Careers'));
+
+$career = new Career();
+
+// Action handling: Adding a note
+if (isset($_GET['action']) && $_GET['action'] == 'add') {
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
+        api_not_allowed();
+    }
+
+    $_SESSION['notebook_view'] = 'creation_date';
+
+    // Initiate the object
+    $form = new FormValidator('note', 'post', api_get_self().'?action='.Security::remove_XSS($_GET['action']));
+    // Settting the form elements
+    $form->addElement('header', '', get_lang('Add'));
+    $form->addElement('text', 'name', get_lang('name'), array('size' => '95', 'id' => 'name'));
+    //$form->applyFilter('note_title', 'html_filter');
+    $form->addElement('html_editor', 'description', get_lang('Description'), null);
+    $form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
+
+    // Setting the rules
+    $form->addRule('name', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+
+    // The validation or display
+    if ($form->validate()) {
+        $check = Security::check_token('post');
+        if ($check) {
+            $values = $form->exportValues();       
+            $res = $career->save($values);            
+            if ($res) {
+                Display::display_confirmation_message(get_lang('Added'));
+            }
+        }
+        Security::clear_token();
+        $career->display();
+    } else {
+        echo '<div class="actions">';
+        echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png').' '.get_lang('Back').'</a>';
+        echo '</div>';
+        $token = Security::get_token();
+        $form->addElement('hidden', 'sec_token');
+        $form->setConstants(array('sec_token' => $token));
+        $form->display();
+    }
+}// Action handling: Editing a note
+elseif (isset($_GET['action']) && $_GET['action'] == 'edit' && is_numeric($_GET['id'])) {
+    // Initialize the object
+    $form = new FormValidator('career', 'post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.Security::remove_XSS($_GET['id']));
+    // Settting the form elements
+    $form->addElement('header', '', get_lang('Modify'));
+    $form->addElement('hidden', 'id',intval($_GET['id']));
+    $form->addElement('text', 'name', get_lang('Name'), array('size' => '100'));
+    $form->addElement('html_editor', 'description', get_lang('description'), null);
+    $form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+
+    // Setting the defaults
+    $defaults = $career->get($_GET['id']);
+    $form->setDefaults($defaults);
+
+    // Setting the rules
+    $form->addRule('name', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+
+    // The validation or display
+    if ($form->validate()) {
+        $check = Security::check_token('post');
+        if ($check) {
+            $values = $form->exportValues();            
+            $res = $career->update($values);
+            if ($res) {
+                Display::display_confirmation_message(get_lang('Updated'));
+            }
+        }
+        Security::clear_token();
+        $career->display();
+    } else {
+        echo '<div class="actions">';
+        echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png').' '.get_lang('Back').'</a>';
+        echo '</div>';
+        $token = Security::get_token();
+        $form->addElement('hidden', 'sec_token');
+        $form->setConstants(array('sec_token' => $token));
+        $form->display();
+    }
+}
+// Action handling: deleting a note
+elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && is_numeric($_GET['id'])) {
+    $res = $career->delete(Security::remove_XSS($_GET['id']));
+    if ($res) {
+        Display::display_confirmation_message(get_lang('Deleted'));
+    }
+    $career->display();
+} else {
+    $career->display();   
+}
+
+Display :: display_footer();

+ 184 - 0
main/admin/promotions.php

@@ -0,0 +1,184 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+ *  @package chamilo.admin
+ */
+
+// Language files that need to be included.
+$language_file = array('admin');
+
+$cidReset = true;
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+require_once api_get_path(LIBRARY_PATH).'promotion.lib.php';
+require_once api_get_path(LIBRARY_PATH).'career.lib.php';
+
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_admin_script();
+
+//Jquery ui
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.css" type="text/css">';
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-1.4.4.min.js" type="text/javascript" language="javascript"></script>'; //jQuery
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/cupertino/jquery-ui-1.8.7.custom.min.js" type="text/javascript" language="javascript"></script>';
+
+//Grid js
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/css/ui.jqgrid.css" type="text/css">';
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript" language="javascript"></script>'; 
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript" language="javascript"></script>';
+
+// The header.
+Display::display_header($tool_name);
+
+
+// Tool name
+if (isset($_GET['action']) && $_GET['action'] == 'add') {
+    $tool = 'Add';
+    $interbreadcrumb[] = array ('url' => api_get_self(), 'name' => get_lang('Promotion'));
+}
+if (isset($_GET['action']) && $_GET['action'] == 'edit') {
+    $tool = 'Modify';
+    $interbreadcrumb[] = array ('url' => api_get_self(), 'name' => get_lang('Promotion'));
+}
+
+$url            = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_promotions';
+$columns        = array(get_lang('Name'),get_lang('Description'),get_lang('Career'),get_lang('Actions'));
+$column_model   = array(array('name'=>'name',           'index'=>'name',        'width'=>'80',   'align'=>'left'),
+                        array('name'=>'description',    'index'=>'description', 'width'=>'500',  'align'=>'left'),
+                        array('name'=>'career',         'index'=>'career',      'width'=>'100',  'align'=>'left'),
+                        array('name'=>'actions',        'index'=>'actions',     'formatter'=>'action_formatter','width'=>'100',  'align'=>'left'),
+                       );                        
+$extra_params['autowidth'] = 'true'; //use the width of the parent
+//$extra_params['editurl'] = $url; //use the width of the parent
+$extra_params['height'] = 'auto'; //use the width of the parent
+
+$action_links = 'function action_formatter (cellvalue, options, rowObject) {
+                    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'"><img title="'.get_lang('AddSession').'" src="../img/addd.gif"></a> <a href="?action=edit&id=\'+options.rowId+\'"><img src="../img/edit.gif" title="'.get_lang('Edit').'"></a>  <a href="?action=delete&id=\'+options.rowId+\'"><img title="'.get_lang('Delete').'" src="../img/delete.gif"></a>\'; 
+                 }';
+
+?>
+<script>
+$(function() {    
+    <?php 
+         echo Display::grid_js('promotions',  $url,$columns,$column_model,$extra_params,array(), $action_links);       
+    ?> 
+
+});
+</script>   
+<?php
+// Tool introduction
+Display::display_introduction_section(get_lang('Promotions'));
+
+$promotion = new Promotion();
+
+// Action handling: Adding a note
+if (isset($_GET['action']) && $_GET['action'] == 'add') {
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
+        api_not_allowed();
+    }
+
+    // Initiate the object
+    $form = new FormValidator('note', 'post', api_get_self().'?action='.Security::remove_XSS($_GET['action']));
+    // Settting the form elements
+    $form->addElement('header', '', get_lang('Add'));
+    $form->addElement('text', 'name', get_lang('name'), array('size' => '95', 'id' => 'name'));
+    //$form->applyFilter('note_title', 'html_filter');
+    $form->addElement('html_editor', 'description', get_lang('Description'), null);
+    
+    
+    $career = new Career();
+    $careers = $career->get_all();
+    $career_list = array();
+    
+    foreach($careers as $item) {        
+        $career_list[$item['id']] = $item['name'];
+    }
+    $form->addElement('select', 'career_id', get_lang('Career'), $career_list);    
+    $form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="add"');
+    // Setting the rules
+    $form->addRule('name', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+
+    // The validation or display
+    if ($form->validate()) {
+        $check = Security::check_token('post');
+        if ($check) {
+            $values = $form->exportValues();       
+            $res    = $promotion->save($values);            
+            if ($res) {
+                Display::display_confirmation_message(get_lang('Added'));
+            }
+        }
+        Security::clear_token();
+        $promotion->display();
+    } else {
+        echo '<div class="actions">';
+        echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png').' '.get_lang('Back').'</a>';
+        echo '</div>';
+        $token = Security::get_token();
+        $form->addElement('hidden', 'sec_token');
+        $form->setConstants(array('sec_token' => $token));
+        $form->display();
+    }
+}// Action handling: Editing a note
+elseif (isset($_GET['action']) && $_GET['action'] == 'edit' && is_numeric($_GET['id'])) {
+    // Initialize the object
+    //@todo this form should be generated in the class
+    $form = new FormValidator('promotion', 'post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']));
+    // Settting the form elements
+    $form->addElement('header', '', get_lang('Modify'));
+    $form->addElement('hidden', 'id',intval($_GET['id']));
+    $form->addElement('text', 'name', get_lang('Name'), array('size' => '100'));
+    $form->addElement('html_editor', 'description', get_lang('description'), null);
+        
+    $career = new Career();
+    $careers = $career->get_all();
+    $career_list = array();    
+    foreach($careers as $item) {        
+        $career_list[$item['id']] = $item['name'];
+    }
+    $form->addElement('select', 'career_id', get_lang('Career'), $career_list);  
+     
+    $form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+
+    // Setting the defaults
+    $defaults = $promotion->get($_GET['id']);    
+    $form->setDefaults($defaults);
+
+    // Setting the rules
+    $form->addRule('name', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+
+    // The validation or display
+    if ($form->validate()) {
+        $check = Security::check_token('post');
+        if ($check) {
+            $values = $form->exportValues();                    
+            $res = $promotion->update($values);
+            if ($res) {
+                Display::display_confirmation_message(get_lang('Updated'));
+            }
+        }
+        Security::clear_token();
+        $promotion->display();
+    } else {
+        echo '<div class="actions">';
+        echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png').' '.get_lang('Back').'</a>';
+        echo '</div>';
+        $token = Security::get_token();
+        $form->addElement('hidden', 'sec_token');
+        $form->setConstants(array('sec_token' => $token));
+        $form->display();
+    }
+}
+
+// Action handling: deleting a note
+elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && is_numeric($_GET['id'])) {
+    $res = $promotion->delete($_GET['id']);
+    if ($res) {
+        Display::display_confirmation_message(get_lang('Deleted'));
+    }
+    $promotion->display();
+} else {
+    $promotion->display();   
+}
+Display::display_footer();

+ 95 - 0
main/inc/ajax/model.ajax.php

@@ -0,0 +1,95 @@
+<?php
+$action = $_GET['a'];
+
+require_once '../global.inc.php';
+$libpath = api_get_path(LIBRARY_PATH);
+$table = '';
+
+// 1. Setting variables
+
+//Variables needed by jqgrid
+
+$page  = intval($_REQUEST['page']); //page
+$limit = intval($_REQUEST['rows']); // quantity of rows
+$sidx  = intval($_REQUEST['sidx']); //index to filter         
+$sord  = $_REQUEST['sord'];         //asc or desc
+if (!in_array($sord, array('asc','desc'))) {
+    $sord = 'desc';
+}
+// get index row - i.e. user click to sort $sord = $_GET['sord']; 
+// get the direction 
+if(!$sidx) $sidx = 1;
+ 
+ 
+//2. Selecting the count
+switch ($action) {
+    case 'get_careers':        
+        require_once $libpath.'career.lib.php';
+        $obj        = new Career();
+        $count      = $obj->get_count();
+    break;
+    case 'get_promotions':
+       require_once $libpath.'promotion.lib.php';        
+        $obj        = new Promotion();        
+        $count      = $obj->get_count();   
+    break;
+    default:
+        exit;   
+}
+        
+if( $count >0 ) { 
+    $total_pages = ceil($count/$limit); 
+} else { 
+    $total_pages = 0; 
+}
+
+if ($page > $total_pages) { 
+    $page = $total_pages;
+}     
+$start = $limit * $page - $limit; 
+
+//2. Querying the DB
+switch ($action) {
+    case 'get_careers':
+        if ($_REQUEST['oper'] == 'del') {
+            $obj->delete($_REQUEST['id']);
+        }
+        $columns    = $obj->columns;
+        $columns[]  = 'actions';        
+        $result     = Database::select('*', $obj->table, array('order'=>"$sidx $sord", 'LIMIT'=> "$start , $limit"));
+    break;
+    case 'get_promotions':
+        if ($_REQUEST['oper'] == 'del') {
+        	$obj->delete($_REQUEST['id']);
+        }
+        $columns    = $obj->columns;
+        $columns[]  = 'career';
+        $columns[]  = 'actions';                
+        $result     = Database::select('p.id, p.name, p.description, c.name as career', "$obj->table p LEFT JOIN ".Database::get_main_table(TABLE_CAREER)." c  ON c.id = p.career_id ", array('order' =>"$sidx $sord", 'LIMIT'=> "$start , $limit"));       
+    break;
+    default:
+        exit;            
+}
+
+if (in_array($action, array('get_careers','get_promotions'))) {
+    //3. Creating an obj return a json
+    $responce = new stdClass();           
+    $responce->page     = $page; 
+    $responce->total    = $total_pages; 
+    $responce->records  = $count; 
+    $i=0;
+    if (!empty($result)) {
+        foreach($result as $row) {
+             //print_r($row);
+             $responce->rows[$i]['id']=$row['id'];
+             $array = array();
+             foreach($columns as $col) {
+             	$array[] = $row[$col];
+             }                   
+             $responce->rows[$i]['cell']=$array;
+             $i++; 
+        }
+    } 
+    echo json_encode($responce);       
+}
+exit;

+ 12 - 1
main/inc/header.inc.php

@@ -25,6 +25,9 @@ if (api_is_platform_admin()) {
 }
 
 header('Content-Type: text/html; charset='.api_get_system_encoding());
+//show the X-Powered-By header so that parsers can find it
+global $_configuration;
+header('X-Powered-By: '.$_configuration['software_name'].' '.substr($_configuration['system_version'],0,1));
 
 $navigator_info = api_get_navigator();
 //ie6 fix
@@ -32,6 +35,13 @@ if ($navigator_info['name'] == 'Internet Explorer' &&  $navigator_info['version'
     $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix_tilebg.js" type="text/javascript" language="javascript"></script>';
 }
 
+// Include here the script ASCIIMathML.js if you want to show mathematical formulas and graphics
+// not only in the "Documents" tool, but elsewhere in the system. This setting is related to the
+// online editor's plugins 'asciimath' and 'asciisvg'.
+if (api_get_setting('include_asciimathml_script') == 'true') {
+    $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'asciimath/ASCIIMathML.js" type="text/javascript"></script>';
+}
+
 if (isset($httpHeadXtra) && $httpHeadXtra) {
     foreach ($httpHeadXtra as & $thisHttpHead) {
         header($thisHttpHead);
@@ -110,13 +120,14 @@ if ($navigator_info['name']=='Internet Explorer' &&  $navigator_info['version']=
 <script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.js" type="text/javascript" ></script>
 <link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.css" type="text/css" media="projection, screen" />
 <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
-<link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" />
+ <link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" />
 <link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'), ENT_QUOTES); ?>" />
 <link href="http://www.chamilo.org/documentation.php" rel="Help" />
 <link href="http://www.chamilo.org/team.php" rel="Author" />
 <link href="http://www.chamilo.org" rel="Copyright" />
 <link rel="shortcut icon" href="<?php echo api_get_path(WEB_PATH); ?>favicon.ico" type="image/x-icon" />
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo api_get_system_encoding(); ?>" />
+<meta name="Generator" content="<?php echo $_configuration['software_name'].' '.substr($_configuration['system_version'],0,1);?>">
 <script src= "<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/jquery.menu.js" type="text/javascript"></script>
 
 <script type="text/javascript">

+ 28 - 5
main/inc/lib/asciimath/ASCIIMathML.js

@@ -3842,9 +3842,15 @@ function showHideCode(evt) { // called by onclick event
   var obj=evt.target;
   var name = obj.parentNode.getAttribute("name");
   var node = document.getElementById(name+"input");
-  node.style.display = (node.style.display == "none"?"":"none");
-  var node = document.getElementById(name+"button");
-  node.style.display = (node.style.display == "none"?"":"none");
+  // The try-catch block has been added by Ivan Tcholakov, 08-JAN-2011.
+  try {
+  //
+    node.style.display = (node.style.display == "none"?"":"none");
+    var node = document.getElementById(name+"button");
+    node.style.display = (node.style.display == "none"?"":"none");
+  //
+  } catch (ex) { }
+  //
 //  }
 }
 
@@ -3943,8 +3949,13 @@ function initPicture(x_min,x_max,y_min,y_max) { // set up the graph
   node.setAttribute("height",height);
   node.setAttribute("style",backgroundstyle);
   svgpicture.appendChild(node);
-  svgpicture.setAttribute("onmousemove","displayCoord(evt)");
-  svgpicture.setAttribute("onmouseout","removeCoord(evt)");
+  // Modified by Ivan Tcholakov, 08-JAN-2011.
+  // These events are suppressed because for some browsers
+  // the coordinates are not calculated correctly.
+  // TODO: Calculation to be tested and corrected after IE9 release.
+  //svgpicture.setAttribute("onmousemove","displayCoord(evt)");
+  //svgpicture.setAttribute("onmouseout","removeCoord(evt)");
+  //
   svgpicture.setAttribute("onclick","mClick(evt)");
   node = myCreateElementSVG("text"); // used for displayCoord
   node.appendChild(doc.createTextNode(" "));
@@ -4628,6 +4639,12 @@ function displayCoord(evt) {
     var nl = svgroot.childNodes;
     for (var i=0; i<nl.length && nl.item(i).nodeName!="text"; i++);
     var cnode = nl.item(i);
+    // Added by Ivan Tcholakov, 08-JAN-2011.
+    // Suppresing a javasript error that occurs on Opera 11.
+    if (typeof cnode != 'object') {
+        return;
+    }
+    //
     cnode.mtext = mtext;
     cnode.mtext([svgroot.getAttribute("width")-(-7),svgroot.getAttribute("height")-7],"("+getX(evt).toFixed(2)+", "+getY(evt).toFixed(2)+")", "left", "", "11");
 /*    var dnode = nl.item(i+1);
@@ -4641,6 +4658,12 @@ function removeCoord(evt) {
     var nl = svgroot.childNodes;
     for (var i=0; i<nl.length && nl.item(i).nodeName!="text"; i++);
     var cnode = nl.item(i);
+    // Added by Ivan Tcholakov, 08-JAN-2011.
+    // Suppresing a javasript error that occurs on Opera 11.
+    if (typeof cnode != 'object') {
+        return;
+    }
+    //
     cnode.mtext = mtext;
     cnode.mtext([svgroot.getAttribute("width")-0,svgroot.getAttribute("height")-0],"", "aboveleft", "");
 /*    var dnode = nl.item(i+1);

+ 123 - 0
main/inc/lib/career.lib.php

@@ -0,0 +1,123 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+*	This class provides methods for the notebook management.
+*	Include/require it in your code to use its features.
+*	@package chamilo.library
+*/
+
+class Career {
+    
+    var $table;
+    var $columns = array('name','description');
+    
+	public function __construct() {
+        $this->table =  Database::get_main_table(TABLE_CAREER);
+	}
+    
+	/**
+	 * a little bit of javascript to display a prettier warning when deleting a note
+	 *
+	 * @return unknown
+	 *
+	 */
+	function javascript_notebook()
+	{
+		return "<script type=\"text/javascript\">
+				function confirmation (name)
+				{
+					if (confirm(\" ". get_lang("NoteConfirmDelete") ." \"+ name + \" ?\"))
+						{return true;}
+					else
+						{return false;}
+				}
+				</script>";
+	}
+
+	/**
+	 * Saves an element into the DB
+	 *
+	 * @param array $values
+	 * @return bool
+	 *
+	 */
+	function save($values) {
+		/*if (!is_array($values) or empty($values['note_title'])) { 
+			return false; 
+		}*/		        
+        unset($values['submit']);
+        $id = Database::insert($this->table, $values);        
+		if (is_numeric($id)){
+			return $id;
+		}
+	}
+    
+    /**
+     * Gets an element
+     */
+	function get($id) {
+		if (empty($id)) { return array(); }		
+        $result = Database::select('*',$this->table, array('where'=>array('id = ?'=>intval($id))),'first');
+        return $result;
+	}
+    
+    function get_all() {
+    	return $careers = Database::select('*',$this->table);
+    }
+    
+    /**
+     * Get the count of elements
+     */
+    function get_count() {        
+        $row = Database::select('count(*) as count', $this->table, array(),'first');
+        return $row['count'];
+    }
+    
+
+	/**
+	 * Updates the obj in the database
+	 *
+	 * @param array $values
+	 *
+	 */
+	function update($values) {
+		/*if (!is_array($values) or empty($values['note_title'])) {
+			return false;
+		}*/
+        unset($values['submit']);
+		$table = Database :: get_main_table(TABLE_CAREER);
+        $id = $values['id'];
+        unset($values['id']);
+        $result = Database::update($this->table, $values, array('id = ?'=>$id));		
+        if ($result != 1){
+            return false;
+        }       
+        return true;
+	}
+    
+    /**
+     * Delets an item
+     */
+	function delete($id) {
+		if (empty($id) or $id != strval(intval($id))) { return false; }
+		// Database table definition
+		$result = Database :: delete($this->table, array('id = ?' => $id));        
+        if ($result != 1){
+        	return false;
+        }		
+		return true;
+	}
+    
+    /**
+     * Displays the title + grid
+     */
+	function display() {
+		// action links
+		echo '<div class="actions" style="margin-bottom:20px">';
+        echo '<a href="career_dashboard.php">'.Display::return_icon('back.png',get_lang('Back')).get_lang('Back').'</a>';     	
+		echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('filenew.gif',get_lang('Add')).get_lang('Add').'</a>';        				
+		echo '</div>';   
+        echo Display::grid_html('careers');  
+	}    
+}

+ 15 - 2
main/inc/lib/fckeditor/myconfig.php

@@ -188,7 +188,10 @@ if ((api_get_setting('math_mimetex') == 'true')) {
 // After enabling it, this plugin is configured to work with full-page html documents out-of-the box.
 // Browser compatibility: Internet Explorer 6.0+ with MathPlayer plugin, Mozilla Firefox 2.0+, Opera 9.5+
 if ((api_get_setting('math_asciimathML') == 'true')) {
-    $config['LoadPlugin'][] = 'asciimath';
+    // The following additional conditions are mandatory for correct working of the plugin. Please, don't alter them.
+    if ($this->Config['FullPage'] || api_get_setting('include_asciimathml_script') == 'true') {
+        $config['LoadPlugin'][] = 'asciimath';
+    }
 }
 
 // asciisvg: A plugin for drawing mathematical graphics on svg-enabled browsers.
@@ -197,7 +200,17 @@ if ((api_get_setting('math_asciimathML') == 'true')) {
 // if there is no security restriction (script-tag should not be filtered, by default this is valid for teachers).
 // Internet Explorer 8 (or prior) needs Adobe SVG Viewer installed, see http://www.adobe.com/svg/viewer/install/
 if ((api_get_setting('enabled_asciisvg') == 'true')) {
-    $config['LoadPlugin'][] = 'asciisvg';
+    // The following additional conditions are mandatory for correct working of the plugin. Please, don't alter them.
+    if ($this->Config['FullPage'] || api_get_setting('include_asciimathml_script') == 'true') {
+        $config['LoadPlugin'][] = 'asciisvg';
+    }
+}
+
+// Yet another mandatory condition for proper working of the plugins 'asciimath' and 'asciisvg'.
+if (api_get_setting('include_asciimathml_script') == 'true') {
+    // The automatic content parsing should be disabled on this case, otherwise content would be damaged.
+    // The editor does the necessary parsing within its separate iframe.
+    echo '<script type="text/javascript">var translateOnLoad = false ;</script>';
 }
 
 // WIRIS: plugin for inserting mathematical formulas

+ 10 - 10
main/inc/lib/fckeditor/toolbars/default/introduction.php

@@ -9,22 +9,22 @@
 
 // This is the visible toolbar set when the editor has "normal" size.
 $config['ToolbarSets']['Normal'] = array(
-	array('NewPage','FitWindow','-','PasteWord','-','Undo','Redo','-','SelectAll'),
-	array('Link','Unlink','Anchor'),
-	array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
-	array('Table','SpecialChar'),
-	array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
-	'/',
-	array('Style','FontFormat','FontName','FontSize'),
-	array('Bold','Italic','Underline'),
-	array('JustifyLeft','JustifyCenter','JustifyRight')
+    array('NewPage','FitWindow','-','PasteWord','-','Undo','Redo','-','SelectAll'),
+    array('Link','Unlink','Anchor'),
+    array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath','asciisvg'),
+    array('Table','SpecialChar'),
+    array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+    '/',
+    array('Style','FontFormat','FontName','FontSize'),
+    array('Bold','Italic','Underline'),
+    array('JustifyLeft','JustifyCenter','JustifyRight')
 );
 
 // This is the visible toolbar set when the editor is maximized.
 // If it has not been defined, then the toolbar set for the "normal" size is used.
 /*
 $config['ToolbarSets']['Maximized'] = array(
-	array('FitWindow','-') // ...
+    array('FitWindow','-') // ...
 );
 */
 

+ 23 - 23
main/inc/lib/fckeditor/toolbars/extended/introduction.php

@@ -12,41 +12,41 @@
 
 // Hide/show SpellCheck buttom
 if ((api_get_setting('allow_spellcheck') == 'true')) {
-	$VSpellCheck='SpellCheck';
+    $VSpellCheck='SpellCheck';
 }
 else{
-	$VSpellCheck='';	
+    $VSpellCheck='';
 }
 
 // This is the visible toolbar set when the editor has "normal" size.
 $config['ToolbarSets']['Normal'] = array(
-	array('Save','NewPage','Templates','-','PasteWord'),
-	array('Undo','Redo'),
-	array('Link','Image','flvPlayer','Table','mimetex'),
-	array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'),
-	array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
-	array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'),
-	array('FitWindow')
+    array('Save','NewPage','Templates','-','PasteWord'),
+    array('Undo','Redo'),
+    array('Link','Image','flvPlayer','Table','mimetex','asciimath','asciisvg'),
+    array('UnorderedList','OrderedList','Rule','-','Outdent','Indent'),
+    array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
+    array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'),
+    array('FitWindow')
 );
 
 // This is the visible toolbar set when the editor is maximized.
 // If it has not been defined, then the toolbar set for the "normal" size is used.
 $config['ToolbarSets']['Maximized'] = array(
-	array('Save','NewPage','Templates','-','Preview','Print'),
-	array('Cut','Copy','Paste','PasteText','PasteWord'),
-	array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'),
-	array('Link','Unlink','Anchor','Glossary'),
-	array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'),
+    array('Save','NewPage','Templates','-','Preview','Print'),
+    array('Cut','Copy','Paste','PasteText','PasteWord'),
+    array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'),
+    array('Link','Unlink','Anchor','Glossary'),
+    array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','asciimath','asciisvg','fckeditor_wiris_openFormulaEditor','fckeditor_wiris_openCAS'),
 '/',
-	array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'),
-	array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'),
-	array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),	
-	array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'),
-	array($VSpellCheck),	
-	array('Style','FontFormat','FontName','FontSize'),	
-	array('PageBreak','ShowBlocks','Source'),
-	array('FitWindow')
-	
+    array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'),
+    array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'),
+    array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
+    array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'),
+    array($VSpellCheck),
+    array('Style','FontFormat','FontName','FontSize'),
+    array('PageBreak','ShowBlocks','Source'),
+    array('FitWindow')
+
 );
 
 // Sets whether the toolbar can be collapsed/expanded or not.

+ 121 - 0
main/inc/lib/promotion.lib.php

@@ -0,0 +1,121 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+/**
+*	This class provides methods for the promotion management.
+*	Include/require it in your code to use its features.
+*	@package chamilo.library
+*/
+
+class Promotion {
+    
+    var $table;
+    var $columns = array('name','description');
+    
+	public function __construct() {
+        $this->table =  Database::get_main_table(TABLE_PROMOTION);
+	}
+    
+	/**
+	 * a little bit of javascript to display a prettier warning when deleting a note
+	 *
+     *	 */
+	function javascript_notebook()
+	{
+		return "<script type=\"text/javascript\">
+				function confirmation (name)
+				{
+					if (confirm(\" ". get_lang("NoteConfirmDelete") ." \"+ name + \" ?\"))
+						{return true;}
+					else
+						{return false;}
+				}
+				</script>";
+	}
+
+
+    /**
+     * Saves an element into the DB
+     *
+     * @param array $values
+     * @return bool
+     *
+     */
+	function save($values) {
+		/*if (!is_array($values) or empty($values['note_title'])) { 
+			return false; 
+		}*/		        
+        unset($values['submit']);
+        $id = Database::insert($this->table, $values);        
+		if (is_numeric($id)){
+			return $id;
+		}
+	}
+     /**
+     * Gets an element
+     */
+	function get($id) {
+		if (empty($id)) { return array(); }		
+        $result = Database::select('*',$this->table, array('where'=>array('id = ?'=>intval($id))),'first');
+		return $result;
+	}
+    
+     /**
+     * Get the count of elements
+     */
+    function get_count() {        
+        $row = Database::select('count(*) as count', $this->table, array(),'first');
+        return $row['count'];
+    }
+    
+    function get_all_promotions_by_career_id($career_id) {        
+        return Database::select('*', $this->table, array('where'=>array('career_id = ?'=>$career_id)));
+    }
+    
+    /**
+     * Updates the obj in the database
+     *
+     * @param array $values
+     *
+     */
+	function update($values) {
+		/*if (!is_array($values) or empty($values['note_title'])) {
+			return false;
+		}*/
+        unset($values['submit']);
+        $id = $values['id'];		
+        unset($values['id']);        
+        $result = Database::update($this->table, $values, array('id =  ?'=>$id));		
+        if ($result != 1){
+            return false;
+        }       
+        return true;
+	}
+    
+    /**
+     * Delets an item
+     */
+	function delete($id) {
+		if (empty($id) or $id != strval(intval($id))) { return false; }
+		// Database table definition
+		$result = Database :: delete($this->table, array('id = ?' => $id));        
+        if ($result != 1){
+        	return false;
+        }		
+		return true;
+	}
+    
+    /**
+     * Displays the title + grid
+     */
+	function display() {
+		// action links
+		echo '<div class="actions" style="margin-bottom:20px">';
+        echo '<a href="career_dashboard.php">'.Display::return_icon('back.png',get_lang('Back')).get_lang('Back').'</a>';
+		echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('filenew.gif',get_lang('Add')).get_lang('Add').'</a>';	
+		echo '</div>';
+        echo Display::grid_html('promotions');  
+	}
+    
+ 
+}

+ 4 - 1
main/inc/lib/sessionmanager.lib.php

@@ -1213,6 +1213,10 @@ class SessionManager {
      * @return  array a list with an user list
      */
     public static function get_users_by_session($id) {
+        if (empty($id)) {
+            return array();
+        }
+        $id = intval($id);
         $tbl_user                           = Database::get_main_table(TABLE_MAIN_USER);
         $tbl_session_rel_user               = Database::get_main_table(TABLE_MAIN_SESSION_USER);
         $order_clause ='';
@@ -1221,7 +1225,6 @@ class SessionManager {
         INNER JOIN '.$tbl_session_rel_user.'
             ON '.$tbl_user.'.user_id = '.$tbl_session_rel_user.'.id_user 
             AND '.$tbl_session_rel_user.'.id_session = '.$id.$order_clause;
-
         $result=Database::query($sql);
         //$users=Database::store_result($result);
         while ($row = Database::fetch_array($result,'ASSOC')) {

+ 40 - 2
main/inc/lib/text.lib.php

@@ -281,6 +281,44 @@ function api_fgetcsv($handle, $length = null, $delimiter = ',', $enclosure = '"'
 }
 
 
+/* Functions for supporting ASCIIMathML mathematical formulas and ASCIIsvg maathematical graphics */
+
+/**
+ * Dectects ASCIIMathML formula presence within a given html text.
+ * @param string $html      The input html text.
+ * @return bool             Returns TRUE when there is a formula found or FALSE otherwise.
+ */
+function api_contains_asciimathml($html) {
+    if (!preg_match_all('/<span[^>]*class\s*=\s*[\'"](.*?)[\'"][^>]*>/mi', $html, $matches)) {
+        return false;
+    }
+    foreach ($matches[1] as $string) {
+        $string = ' '.str_replace(',', ' ', $string).' ';
+        if (preg_match('/\sAM\s/m', $string)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+/**
+ * Dectects ASCIIsvg graphics presence within a given html text.
+ * @param string $html      The input html text.
+ * @return bool             Returns TRUE when there is a graph found or FALSE otherwise.
+ */
+function api_contains_asciisvg($html) {
+    if (!preg_match_all('/<embed([^>]*?)>/mi', $html, $matches)) {
+        return false;
+    }
+    foreach ($matches[1] as $string) {
+        $string = ' '.str_replace(',', ' ', $string).' ';
+        if (preg_match('/sscr\s*=\s*[\'"](.*?)[\'"]/m', $string)) {
+            return true;
+        }
+    }
+    return false;
+}
+
 /* Miscellaneous text processing functions */
 
 /**
@@ -583,10 +621,10 @@ function get_last_week() {
  */
 function get_week_from_day($date) {
     if (!empty($date)) {
-	   $time = api_strtotime($date,'UTC');
+       $time = api_strtotime($date,'UTC');
        return date('W', $date);
     } else {
-    	return date('W');
+        return date('W');
     }
 }
 

+ 54 - 47
main/inc/reduced_header.inc.php

@@ -17,10 +17,17 @@
 
 header('Content-Type: text/html; charset='.api_get_system_encoding());
 
+// Include here the script ASCIIMathML.js if you want to show mathematical formulas and graphics
+// not only in the "Documents" tool, but elsewhere in the system. This setting is related to the
+// online editor's plugins 'asciimath' and 'asciisvg'.
+if (api_get_setting('include_asciimathml_script') == 'true') {
+    $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'asciimath/ASCIIMathML.js" type="text/javascript"></script>';
+}
+
 if (isset($httpHeadXtra) && $httpHeadXtra) {
-	foreach ($httpHeadXtra as & $thisHttpHead) {
-		header($thisHttpHead);
-	}
+    foreach ($httpHeadXtra as & $thisHttpHead) {
+        header($thisHttpHead);
+    }
 }
 
 // Get language iso-code for this page - ignore errors
@@ -36,11 +43,11 @@ $document_language = api_get_language_isocode();
 <title>
 <?php
 if (!empty($nameTools)) {
-	echo $nameTools.' - ';
+    echo $nameTools.' - ';
 }
 
 if (!empty($_course['official_code'])) {
-	echo $_course['official_code'].' - ';
+    echo $_course['official_code'].' - ';
 }
 
 echo api_get_setting('siteName');
@@ -58,27 +65,27 @@ $my_style = api_get_visual_theme();
 
 // Sets the css reference it is call from lp_nav.php, lp_toc.php, lp_message, lp_log.php
 if (!empty($scorm_css_header)) {
-	if (!empty($my_style)) {
-		$scorm_css = api_get_path(WEB_CSS_PATH).$my_style.'/scorm.css';
-		$scormfs_css = api_get_path(WEB_CSS_PATH).$my_style.'/scormfs.css';
-	} else {
-		$scorm_css = 'scorm.css';
-		$scormfs_css = 'scormfs.css';
-	}
-
-	if (!empty($display_mode) && $display_mode == 'fullscreen') {
-		$htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
-							/*<![CDATA[*/
-							@import "'.$scormfs_css.'";
-							/*]]>*/
-							</style>';
-	} else {
-		$htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
-							/*<![CDATA[*/
-							@import "'.$scorm_css.'";
-							/*]]>*/
-							</style>';
-	}
+    if (!empty($my_style)) {
+        $scorm_css = api_get_path(WEB_CSS_PATH).$my_style.'/scorm.css';
+        $scormfs_css = api_get_path(WEB_CSS_PATH).$my_style.'/scormfs.css';
+    } else {
+        $scorm_css = 'scorm.css';
+        $scormfs_css = 'scormfs.css';
+    }
+
+    if (!empty($display_mode) && $display_mode == 'fullscreen') {
+        $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
+                            /*<![CDATA[*/
+                            @import "'.$scormfs_css.'";
+                            /*]]>*/
+                            </style>';
+    } else {
+        $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
+                            /*<![CDATA[*/
+                            @import "'.$scorm_css.'";
+                            /*]]>*/
+                            </style>';
+    }
 }
 
 
@@ -107,33 +114,33 @@ if ($my_style != '') {
 // This is a patch for the "__flash__removeCallback" bug, see FS#4378.
 if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.userAgent.toLowerCase().indexOf( 'opera' ) == -1 ) )
 {
-	window.attachEvent( 'onunload', function()
-		{
-			window['__flash__removeCallback'] = function ( instance, name )
-			{
-				try
-				{
-					if ( instance )
-					{
-						instance[name] = null ;
-					}
-				}
-				catch ( flashEx )
-				{
-
-				}
-			} ;
-		}
-	) ;
+    window.attachEvent( 'onunload', function()
+        {
+            window['__flash__removeCallback'] = function ( instance, name )
+            {
+                try
+                {
+                    if ( instance )
+                    {
+                        instance[name] = null ;
+                    }
+                }
+                catch ( flashEx )
+                {
+
+                }
+            } ;
+        }
+    ) ;
 }
 //]]>
 </script>
 
 <?php
 if (isset($htmlHeadXtra) && $htmlHeadXtra) {
-	foreach ($htmlHeadXtra as & $this_html_head) {
-		echo $this_html_head;
-	}
+    foreach ($htmlHeadXtra as & $this_html_head) {
+        echo $this_html_head;
+    }
 }
 ?>
 </head>

+ 13 - 11
main/install/db_main.sql

@@ -752,6 +752,7 @@ VALUES
 ('math_mimetex',NULL,'radio','Editor','false','MathMimetexTitle','MathMimetexComment',NULL,NULL, 0),
 ('math_asciimathML',NULL,'radio','Editor','false','MathASCIImathMLTitle','MathASCIImathMLComment',NULL,NULL, 0),
 ('enabled_asciisvg',NULL,'radio','Editor','false','AsciiSvgTitle','AsciiSvgComment',NULL,NULL, 0),
+('include_asciimathml_script',NULL,'radio','Editor','false','IncludeAsciiMathMlTitle','IncludeAsciiMathMlComment',NULL,NULL, 0),
 ('youtube_for_students',NULL,'radio','Editor','true','YoutubeForStudentsTitle','YoutubeForStudentsComment',NULL,NULL, 0),
 ('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
 ('more_buttons_maximized_mode',NULL,'radio','Editor','true','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0),
@@ -789,9 +790,8 @@ VALUES
 ('show_users_folders',				NULL,'radio',		'Tools',	'true',	'ShowUsersFoldersTitle','ShowUsersFoldersComment',NULL,NULL, 0),
 ('show_default_folders',				NULL,'radio',		'Tools',	'true',	'ShowDefaultFoldersTitle','ShowDefaultFoldersComment',NULL,NULL, 0),
 ('show_chat_folder',				NULL,'radio',		'Tools',	'true',	'ShowChatFolderTitle','ShowChatFolderComment',NULL,NULL, 0),
-'ShowDefaultFoldersTitle','ShowDefaultFoldersComment',NULL,NULL, 0),
 ('enabled_text2audio',				NULL,'radio',		'Tools',	'false',	'Text2AudioTitle','Text2AudioComment',NULL,NULL, 0),
-('chamilo_database_version', 		NULL,'textfield', 	NULL, '1.8.8.13256','DokeosDatabaseVersion','', NULL, NULL, 0);
+('chamilo_database_version', 		NULL,'textfield', 	NULL, '1.8.8.13309','DokeosDatabaseVersion','', NULL, NULL, 0);
 
 
 UNLOCK TABLES;
@@ -990,6 +990,8 @@ VALUES
 ('math_asciimathML','false','No'),
 ('enabled_asciisvg','true','Yes'),
 ('enabled_asciisvg','false','No'),
+('include_asciimathml_script','true','Yes'),
+('include_asciimathml_script','false','No'),
 ('youtube_for_students','true','Yes'),
 ('youtube_for_students','false','No'),
 ('block_copy_paste_for_students','true','Yes'),
@@ -2515,19 +2517,19 @@ CREATE TABLE course_request (
 );
 
 CREATE TABLE career (
-	id INT NOT NULL AUTO_INCREMENT,
-	name VARCHAR(255) NOT NULL ,
-	description TEXT NOT NULL,
-	PRIMARY KEY (id)
+    id INT NOT NULL AUTO_INCREMENT,
+    name VARCHAR(255) NOT NULL ,
+    description TEXT NOT NULL,
+    PRIMARY KEY (id)
 );
 
 
 
 CREATE TABLE promotion (
-	id INT NOT NULL AUTO_INCREMENT,
-	name VARCHAR(255) NOT NULL ,
-	description TEXT NOT NULL,
-	career_id INT NOT NULL,
-	PRIMARY KEY(id)
+    id INT NOT NULL AUTO_INCREMENT,
+    name VARCHAR(255) NOT NULL ,
+    description TEXT NOT NULL,
+    career_id INT NOT NULL,
+    PRIMARY KEY(id)
 );
 

+ 2 - 2
main/install/install.lib.php

@@ -1142,8 +1142,8 @@ function display_requirements($installType, $badUpdatePath, $updatePath = '', $u
             </tr>
             <tr>
                 <td class="requirements-item"><a href="http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-httponly">Cookie HTTP Only</a></td>
-                <td class="requirements-recommended">1</td>
-                <td class="requirements-value">'.check_php_setting('session.cookie_httponly','1').'</td>
+                <td class="requirements-recommended">ON</td>
+                <td class="requirements-value">'.check_php_setting('session.cookie_httponly','ON').'</td>
             </tr>
             <tr>
                 <td class="requirements-item"><a href="http://php.net/manual/ini.core.php#ini.upload-max-filesize">Maximum upload file size</a></td>

+ 4 - 1
main/install/migrate-db-1.8.7-1.8.8-pre.sql

@@ -25,7 +25,7 @@ ALTER TABLE settings_options CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_
 ALTER TABLE user MODIFY COLUMN username VARCHAR(40) NOT NULL;
 
 UPDATE settings_current SET variable='chamilo_database_version' WHERE variable='dokeos_database_version';
-UPDATE settings_current SET selected_value = '1.8.8.13255' WHERE variable = 'chamilo_database_version';
+UPDATE settings_current SET selected_value = '1.8.8.13309' WHERE variable = 'chamilo_database_version';
 
 ALTER TABLE sys_announcement ADD COLUMN access_url_id INT  NOT NULL default 1;
 ALTER TABLE sys_calendar ADD COLUMN access_url_id INT  NOT NULL default 1;
@@ -53,6 +53,9 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('sso_authen
 INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('enabled_asciisvg',NULL,'radio','Editor','false','AsciiSvgTitle','AsciiSvgComment',NULL,NULL, 0);
 INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_asciisvg', 'true', 'Yes');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_asciisvg', 'false', 'No');
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('include_asciimathml_script',NULL,'radio','Editor','false','IncludeAsciiMathMlTitle','IncludeAsciiMathMlComment',NULL,NULL, 0);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('include_asciimathml_script', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('include_asciimathml_script', 'false', 'No');
 INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('enabled_wiris',NULL,'radio','Editor','false','EnabledWirisTitle','EnabledWirisComment',NULL,NULL, 0);
 INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_wiris', 'true', 'Yes');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_wiris', 'false', 'No');

+ 2 - 0
main/lang/bulgarian/admin.inc.php

@@ -1213,4 +1213,6 @@ $CourseValidationTermsAndConditionsLink = "Одобряване на новит
 $CourseValidationTermsAndConditionsLinkComment = "Това е URL на документа \"Условия за ползване\", който е валиден при подаване на заявка за нов курс. Ако адресът тук е зададен, преди потребителят да подаде заявката ще трябва да прочете и да се съгласи с условията за ползаване.<br />Ако активирате модула на Chamilo \"Условия за ползване\" и ако искате неговият URL да бъде използван - оставете в тази настройка празна стойност.";
 $AsciiSvgTitle = "Редактор на математически графики ASCIIsvg";
 $AsciiSvgComment = "Активиране на редактора на математически графики (ASCIIsvg).";
+$IncludeAsciiMathMlTitle = "Да се зарежда скрипта ASCIIMathML.js във всички страници на системата";
+$IncludeAsciiMathMlComment = "Активирайте тази настройка, ако искате математическите формули (ASCIIMathML) и математическите графики (ASCIIsvg) да могат да се показват не само в инструмента \"Документи\", а и във всички останали страници на системата.";
 ?>

+ 5 - 3
main/lang/english/admin.inc.php

@@ -1244,11 +1244,11 @@ $ThisSectionIsOnlyVisibleOnSourceInstalls = "This section is only visible on ins
 $UsersFillingReport = "Users filling report";
 $AllUsersAreAutomaticallyRegistered = "All users are automatically registered";
 $AssignCoach = "Assign coach";
-$chamilo = "chamilo";
-$php = "php";
+$chamilo = "Chamilo";
+$php = "PHP";
 $Off = "Off";
 $minimum = "minimum";
-$webserver = "web server";
+$webserver = "Web server";
 $mysql = "MySQL";
 $Social = "Social";
 $BackupCreated = "Backup created";
@@ -1324,4 +1324,6 @@ $EnabledStudentExport2PDFTitle = "Allow students to export web documents to PDF
 $EnabledStudentExport2PDFComment = "This feature is enabled by default, but in case of server overload abuse it, or specific learning environments, might want to disable it for all courses.";
 $EnabledInsertHtmlTitle = "Allow the insertion of widgets";
 $EnabledInsertHtmlComment = "This allows you to embed on your webpages your favorite videos and applications such as vimeo or slideshare and all sorts of widgets and gadgets";
+$IncludeAsciiMathMlTitle = "Load the file ASCIIMathML.js in all the system's pages";
+$IncludeAsciiMathMlComment = "Activate this setting if you want to show ASCIIMathML-based mathematical formulas and ASCIIsvg-based mathematical graphics not only in the \"Documents\" tool, but elsewhere in the system.";
 ?>

+ 3 - 0
main/tracking/course_session_report.php

@@ -55,6 +55,9 @@ $my_session_list = array();
 foreach($session_list as $sesion_item) {
 	$my_session_list[$sesion_item['id']] = $sesion_item['name'];
 }
+if (count($session_list) == 0) {
+	$my_session_list[0] = get_lang('None');
+}
 $form->addElement('select', 'session_id', get_lang('Sessions'), $my_session_list);
 $form->addElement('style_submit_button','submit',get_lang('Filter'));
 

Datei-Diff unterdrückt, da er zu groß ist
+ 546 - 546
main/wiki/wiki.inc.php


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.