Prechádzať zdrojové kódy

Merge branch 'BT9068a' of https://github.com/ilosada/chamilo-lms into ilosada-BT9068a

Yannick Warnier 10 rokov pred
rodič
commit
1a181ed72f

+ 8 - 8
main/document/document.php

@@ -749,13 +749,13 @@ if ($sessionId == 0) {
     if (!file_exists($base_work_dir.'/shared_folder')) {
         $usf_dir_title = get_lang('UserFolders');
         $usf_dir_name = '/shared_folder';
-        $groupId = 0;
+        //$groupId = 0;
         $visibility = 0;
         create_unexisting_directory(
             $courseInfo,
             api_get_user_id(),
             $sessionId,
-            $groupId,
+            0,
             $to_user_id,
             $base_work_dir,
             $usf_dir_name,
@@ -767,13 +767,13 @@ if ($sessionId == 0) {
     if (!file_exists($base_work_dir.'/shared_folder/sf_user_'.$userId)) {
         $usf_dir_title = $userInfo['complete_name'];
         $usf_dir_name = '/shared_folder/sf_user_'.$userId;
-        $groupId = 0;
+        //$groupId = 0;
         $visibility = 1;
         create_unexisting_directory(
             $courseInfo,
             api_get_user_id(),
             $sessionId,
-            $groupId,
+            0,
             $to_user_id,
             $base_work_dir,
             $usf_dir_name,
@@ -786,13 +786,13 @@ if ($sessionId == 0) {
     if (!file_exists($base_work_dir.'/shared_folder_session_'.$sessionId)) {
         $usf_dir_title = get_lang('UserFolders').' ('.api_get_session_name($sessionId).')';
         $usf_dir_name = '/shared_folder_session_'.$sessionId;
-        $groupId = 0;
+        //$groupId = 0;
         $visibility = 0;
         create_unexisting_directory(
             $courseInfo,
             api_get_user_id(),
             $sessionId,
-            $groupId,
+            0,
             $to_user_id,
             $base_work_dir,
             $usf_dir_name,
@@ -804,13 +804,13 @@ if ($sessionId == 0) {
     if (!file_exists($base_work_dir.'/shared_folder_session_'.$sessionId.'/sf_user_'.$userId)) {
         $usf_dir_title = $userInfo['complete_name'].'('.api_get_session_name($sessionId).')';
         $usf_dir_name = '/shared_folder_session_'.$sessionId.'/sf_user_'.$userId;
-        $groupId = 0;
+        //$groupId = 0;
         $visibility = 1;
         create_unexisting_directory(
             $courseInfo,
             $userId,
             $sessionId,
-            $groupId,
+            0,
             $to_user_id,
             $base_work_dir,
             $usf_dir_name,

+ 11 - 9
main/inc/global.inc.php

@@ -115,17 +115,19 @@ if (empty($_configuration['statistics_database']) && $already_installed) {
 global $database_connection;
 // Connect to the server database and select the main chamilo database.
 // When $_configuration['db_persistent_connection'] is set, it is expected to be a boolean type.
+$dbPersistConnection = api_get_configuration_value('db_persistent_connection');
+// $_configuration['db_client_flags'] can be set in configuration.php to pass
+// flags to the DB connection
+$dbFlags = api_get_configuration_value('db_client_flags');
+
 $params = array(
-    'server'        => $_configuration['db_host'],
-    'username'      => $_configuration['db_user'],
-    'password'      => $_configuration['db_password'],
-    'persistent'    => $_configuration['db_persistent_connection']
+    'server' => $_configuration['db_host'],
+    'username' => $_configuration['db_user'],
+    'password' => $_configuration['db_password'],
+    'persistent' => $dbPersistConnection,
+    'client_flags' => $dbFlags,
 );
-// $_configuration['db_client_flags'] can be set in configuration.php to pass 
-// flags to the DB connection
-if (isset($_configuration['db_client_flags']) && !empty($_configuration['db_client_flags'])) {
-    $params['client_flags'] = $_configuration['db_client_flags'];
-}
+
 if (!($conn_return = @Database::connect($params))) {
     $global_error_code = 3;
     // The database server is not available or credentials are invalid.

+ 1 - 1
main/inc/lib/database.lib.php

@@ -411,7 +411,7 @@ class Database
         if (!isset($parameters['new_link'])) {
             $parameters['new_link'] = false;
         }
-        if (!isset($parameters['client_flags'])) {
+        if (!isset($parameters['client_flags']) || empty($parameters['client_flags'])) {
             $parameters['client_flags'] = 0;
         }
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
main/inc/lib/javascript/dimple.v2.1.2.min.js


+ 33 - 0
main/inc/lib/usermanager.lib.php

@@ -3977,6 +3977,39 @@ class UserManager
         }
     }
 
+    /**
+     * @param int $userId
+     * @return array
+     */
+    public static function getDrhListFromUser($userId)
+    {
+        $tblUser = Database::get_main_table(TABLE_MAIN_USER);
+        $tblUserRelUser = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
+        $tblUserRelAccessUrl = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+        $userId = intval($userId);
+
+        $orderBy = null;
+        if (api_is_western_name_order()) {
+            $orderBy .= " ORDER BY firstname, lastname ";
+        } else {
+            $orderBy .= " ORDER BY lastname, firstname ";
+        }
+
+        $sql = "SELECT u.user_id, username, u.firstname, u.lastname
+                FROM $tblUser u
+                INNER JOIN $tblUserRelUser uru ON (uru.friend_user_id = u.user_id)
+                INNER JOIN $tblUserRelAccessUrl a ON (a.user_id = u.user_id)
+                WHERE
+                    access_url_id = ".api_get_current_access_url_id()." AND
+                    uru.user_id = '$userId' AND
+                    relation_type = '".USER_RELATION_TYPE_RRHH."'
+                $orderBy
+                ";
+        $result = Database::query($sql);
+
+        return Database::store_result($result);
+    }
+
     /**
      * get users followed by human resource manager
      * @param int $userId

+ 5 - 0
main/lang/english/trad4all.inc.php

@@ -55,10 +55,14 @@ $BuyCourses = "Buy courses";
 $MySessions = "My sessions";
 $ActivateAudioRecorder = "Activate audio recorder";
 $StartSpeaking = "Start speaking";
+$SessionDurationDescription = "The session duration allows you to set a number of days of access starting from the first access date of the user to the session. This way, you can set a session to 'last for 15 days' instead of starting at a fixed date for all students.";
 $HyperbolicArctangentArctanh = "Hyperbolic arctangent:\t\tarctanh(x)";
+$SessionDurationTitle = "Session duration";
 $ArctangentArctan = "Arctangent:\t\t\tarctan(x)";
 $HyperbolicTangentTanh = "Hyperbolic tangent:\t\ttanh(x)";
 $TangentTan = "Tangent:\t\t\ttan(x)";
+$CoachAndStudent = "Coach and student";
+$Serie = "Series";
 $HyperbolicArccosineArccosh = "Hyperbolic arccosine:\t\tarccosh(x)";
 $ArccosineArccos = "Arccosine:\t\t\tarccos(x)";
 $HyperbolicCosineCosh = "Hyperbolic cosine:\t\tcosh(x)";
@@ -346,6 +350,7 @@ $TooShort = "Too short";
 $CourseCreate = "Create a course";
 $Todo = "To do";
 $UserName = "Username";
+$TimeReportIncludingAllCoursesAndSessionsByTeacher = "Time report including all courses and sessions, by teacher";
 $CategoryMod = "Edit Category";
 $Hide = "Hide";
 $Dear = "Dear";

+ 2 - 0
main/lang/french/trad4all.inc.php

@@ -57,6 +57,7 @@ $HyperbolicArctangentArctanh = "Arctangente hyperbolique:\t\tarctanh(x)";
 $ArctangentArctan = "Arctangente:\t\t\tarctan(x)";
 $HyperbolicTangentTanh = "Tangente hyperbolique:\t\ttanh(x)";
 $TangentTan = "Tangente:\t\t\ttan(x)";
+$CoachAndStudent = "Coach et apprenant";
 $HyperbolicArccosineArccosh = "Arcosinus hyperbolique:\t\tarccosh(x)";
 $ArccosineArccos = "Arccosinus:\t\t\tarccos(x)";
 $HyperbolicCosineCosh = "Cosinus hyperbolique:\t\tcosh(x)";
@@ -345,6 +346,7 @@ $TooShort = "Trop court";
 $CourseCreate = "Créer un cours";
 $Todo = "Suggestions";
 $UserName = "Nom d'utilisateur";
+$TimeReportIncludingAllCoursesAndSessionsByTeacher = "Rapport de temps, incluant tous les cours et sessions, par enseignant";
 $CategoryMod = "Modifier une catégorie";
 $Hide = "Cacher";
 $Dear = "Cher(ère)";

+ 2 - 0
main/lang/spanish/trad4all.inc.php

@@ -59,6 +59,7 @@ $HyperbolicArctangentArctanh = "Arcotangente hiperbólica:\tarctanh(x)";
 $ArctangentArctan = "Arcotangente:\t\t\tarctan(x)";
 $HyperbolicTangentTanh = "Tangente hiperbólica:\t\ttanh(x)";
 $TangentTan = "Tangente:\t\t\ttan(x)";
+$CoachAndStudent = "Tutor y estudiante";
 $HyperbolicArccosineArccosh = "Arcocoseno hiperbólico:\t\tarccosh(x)";
 $ArccosineArccos = "Arcocoseno:\t\t\tarccos(x)";
 $HyperbolicCosineCosh = "Coseno hiperbólico:\t\tcosh(x)";
@@ -346,6 +347,7 @@ $TooShort = "Muy corto";
 $CourseCreate = "Crear un curso";
 $Todo = "Sugerencias";
 $UserName = "Nombre de usuario";
+$TimeReportIncludingAllCoursesAndSessionsByTeacher = "Reporte de tiempo incluyendo todos los cursos y sesiones, por profesor";
 $CategoryMod = "Modificar categoría";
 $Hide = "Ocultar";
 $Dear = "Estimado/a";

+ 1 - 1
main/survey/create_new_survey.php

@@ -149,7 +149,7 @@ $form->addElement('date_picker', 'end_date', get_lang('EndDate'));
 $form->addElement('checkbox', 'anonymous', null, get_lang('Anonymous'));
 $visibleResults = array(
     SURVEY_VISIBLE_TUTOR => get_lang('Coach'),
-    SURVEY_VISIBLE_TUTOR_STUDENT => get_lang('Coach').' '.get_lang('And').' '.get_lang('Student'),
+    SURVEY_VISIBLE_TUTOR_STUDENT => get_lang('CoachAndStudent'),
     SURVEY_VISIBLE_PUBLIC => get_lang('Everyone')
 );
 $form->addElement('select', 'visible_results', get_lang('ResultsVisibility'), $visibleResults);

+ 1 - 1
main/survey/fillsurvey.php

@@ -338,7 +338,7 @@ if (!isset($_GET['show'])) {
     $paged_questions_sec = array();
 
     if (!empty($survey_data['survey_introduction'])) {
-        echo '<div id="survey_content" class="survey_content">'.strip_tags($survey_data['survey_introduction']).'</div>';
+        echo '<div id="survey_content" class="survey_content">'.$survey_data['survey_introduction'].'</div>';
     }
     $limit = 0;
 }

+ 1 - 1
main/survey/reporting.php

@@ -17,7 +17,7 @@ $language_file = 'survey';
 require_once '../inc/global.inc.php';
 require_once 'survey.lib.php';
 $this_section = SECTION_COURSES;
-$cidReq = Security::remove_XSS(api_get_cidreq());
+$cidReq = api_get_cidreq();
 $survey_id = intval($_GET['survey_id']);
 $survey_data = survey_manager::get_survey($survey_id);
 

+ 66 - 55
main/survey/survey.lib.php

@@ -2897,7 +2897,6 @@ class SurveyUtil
      * @todo the pagebreak and comment question types should not be shown => removed from $survey_data before
      * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
      * @version February 2007 - Updated March 2008
-     * @CSS Alex Aragon <alex.aragon@beeznest.com> - update January 2015
      */
     public static function display_question_report($survey_data)
     {
@@ -2909,11 +2908,13 @@ class SurveyUtil
 
         // Determining the offset of the sql statement (the n-th question of the survey)
         $offset = !isset($_GET['question']) ? 0 : intval($_GET['question']);
-        $currentQuestion = isset($_GET['question']) ? $_GET['question'] : 0;
+        $currentQuestion = isset($_GET['question']) ? intval($_GET['question']) : 0;
         $question = array();
+        $surveyId = intval($_GET['survey_id']);
+        $action = Security::remove_XSS($_GET['action']);
 
         echo '<div class="actions">';
-        echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.Security::remove_XSS($_GET['survey_id']).'">'.
+        echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'">'.
             Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ReportingOverview'),'',ICON_SIZE_MEDIUM).'</a>';
         echo '</div>';
 
@@ -2922,12 +2923,12 @@ class SurveyUtil
             /* echo '<ul><li class="disabled"><a href="#">'.get_lang('Question').'</a></li>'; */
 
             if ($currentQuestion != 0 ) {
-                echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset-1).'">'.get_lang('PreviousQuestion').'</a></li>';
+                echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&amp;'.api_get_cidreq().'&amp;survey_id='.$surveyId.'&amp;question='.($offset-1).'">'.get_lang('PreviousQuestion').'</a></li>';
             }
 
                 for ($i = 1; $i <= $survey_data['number_of_questions']; $i++) {
                     if ($offset != $i - 1) {
-                        echo '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . Security::remove_XSS($_GET['action']) . '&amp;' . api_get_cidreq() . '&amp;survey_id=' . Security::remove_XSS($_GET['survey_id']) . '&amp;question=' . ($i - 1) . '">' . $i . '</a></li>';
+                        echo '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?action=' . $action . '&amp;' . api_get_cidreq() . '&amp;survey_id=' . $surveyId . '&amp;question=' . ($i - 1) . '">' . $i . '</a></li>';
                     } else {
                         echo '<li class="disabled"s><a href="#">' . $i . '</a></li>';
                     }
@@ -2936,7 +2937,7 @@ class SurveyUtil
                     }*/
                 }
             if ($currentQuestion < ($survey_data['number_of_questions'] - 1)) {
-                echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;'.api_get_cidreq().'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset+1).'">'.get_lang('NextQuestion').'</li></a>';
+                echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&amp;'.api_get_cidreq().'&amp;survey_id='.$surveyId.'&amp;question='.($offset+1).'">'.get_lang('NextQuestion').'</li></a>';
             }
             echo '</ul>';
             echo '</div>';
@@ -3019,7 +3020,9 @@ class SurveyUtil
                 }
                 array_push($chartData, array('option' => $optionText, 'votes' => $votes));
             }
-            self::drawChart($chartData);
+            echo '<div id="chartContainer" class="span12">';
+            echo self::drawChart($chartData);
+            echo '</div>';
 
             $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
 
@@ -3052,7 +3055,7 @@ class SurveyUtil
                     echo '		<td class="center">'.$value['option_text'].'</td>';
                     echo '		<td class="center">';
                     if ($absolute_number!=0){
-		                echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset).'&amp;viewoption='.$value['question_option_id'].'">'.$absolute_number.'</a>';
+		                echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&amp;survey_id='.$surveyId.'&amp;question='.$offset.'&amp;viewoption='.$value['question_option_id'].'">'.$absolute_number.'</a>';
 		            }else{
 		                 echo '0';
 		            }
@@ -3064,7 +3067,7 @@ class SurveyUtil
                     if ($size > 0) {
                         echo '<div style="border:1px solid #264269; background-color:#aecaf4; height:10px; width:'.$size.'px">&nbsp;</div>';
                     }else{
-                        echo '<div style="text-align: left;">'.get_lang("NoDataRegistered").'</div>';
+                        echo '<div style="text-align: left;">'.get_lang("NoDataAvailable").'</div>';
                     }
                     echo ' </td>';
                     echo ' </tr>';
@@ -3096,7 +3099,7 @@ class SurveyUtil
             echo '<ul>';
             while ($row = Database::fetch_array($result)) {
                 $user_info = api_get_user_info($row['user']);
-                echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&survey_id='.Security::remove_XSS($_GET['survey_id']).'&user='.$row['user'].'">'.$user_info['complete_name'].'</a></li>';
+                echo '<li><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&survey_id='.$surveyId.'&user='.$row['user'].'">'.$user_info['complete_name'].'</a></li>';
             }
             echo '</ul>';
             echo '</div>';
@@ -3163,7 +3166,9 @@ class SurveyUtil
                 );
             }
         }
-        self::drawChart($chartData, true);
+        echo '<div id="chartContainer" class="span12">';
+        echo self::drawChart($chartData, true);
+        echo '</div>';
 
         // Displaying the table: headers
         echo '<table class="data_table">';
@@ -3181,7 +3186,7 @@ class SurveyUtil
                 echo '	<tr>';
                 echo '		<td>'.$value['option_text'].'</td>';
                 echo '		<td>'.$i.'</td>';
-                echo '		<td><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.Security::remove_XSS($_GET['action']).'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset).'&amp;viewoption='.$value['question_option_id'].'&amp;value='.$i.'">'.$absolute_number.'</a></td>';
+                echo '		<td><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action='.$action.'&amp;survey_id='.Security::remove_XSS($_GET['survey_id']).'&amp;question='.Security::remove_XSS($offset).'&amp;viewoption='.$value['question_option_id'].'&amp;value='.$i.'">'.$absolute_number.'</a></td>';
                 echo '		<td>'.round($absolute_number/$number_of_answers*100, 2).' %</td>';
                 echo '		<td>';
                 $size = ($absolute_number/$number_of_answers*100*2);
@@ -4100,7 +4105,9 @@ class SurveyUtil
                 }
             }
             $tableHtml .=  '</table>';
-            self::drawChart($chartData, true);
+            echo '<div id="chartContainer" class="span12">';
+            echo self::drawChart($chartData, true);
+            echo '</div>';
             echo $tableHtml;
         }
     }
@@ -5330,55 +5337,59 @@ class SurveyUtil
      * @param	boolean	Tells if the chart has a serie. False by default
      * @return	void 	(direct output)
      */
-    static function drawChart($chartData, $hasSerie = false)
+    public static function drawChart($chartData, $hasSerie = false)
     {
-        $htmlChart = '<div id="chartContainer" class="span12">'.
-            api_get_js("d3/d3.v3.4.8.js").'
-            <script src="http://dimplejs.org/dist/dimple.v2.1.0.min.js"></script>
+        $htmlChart = '';
+        if (api_browser_support("svg")) {
+            $htmlChart .= api_get_js("d3/d3.v3.4.8.js");
+            $htmlChart .= api_get_js("dimple.v2.1.2.min.js") . '
             <script type="text/javascript">
             var svg = dimple.newSvg("#chartContainer", "100%", 400);
             var data = [';
-        $serie = array();
-        $order = array();
-        foreach ($chartData as $chartDataElement) {
-            $htmlChart .= '{"';
+            $serie = array();
+            $order = array();
+            foreach ($chartData as $chartDataElement) {
+                $htmlChart .= '{"';
+                if (!$hasSerie) {
+                    $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['option'] . '", "';
+                    array_push($order, $chartDataElement['option']);
+                } else {
+                    if (!is_array($chartDataElement['serie'])) {
+                        $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['serie'] . '", "' .
+                            get_lang("Score") . '":"' . $chartDataElement['option'] . '", "';
+                        array_push($serie, $chartDataElement['serie']);
+                    } else {
+                        $htmlChart .= get_lang("Serie") . '":"' . $chartDataElement['serie'][0] . '", "' .
+                            get_lang("Option") . '":"' . $chartDataElement['serie'][1] . '", "' .
+                            get_lang("Score") . '":"' . $chartDataElement['option'] . '", "';
+                    }
+                }
+                $htmlChart .= get_lang("Votes") . '":"' . $chartDataElement['votes'] .
+                    '"},';
+            }
+            rtrim($htmlChart, ",");
+            $htmlChart .= '];
+                var myChart = new dimple.chart(svg, data);
+                myChart.addMeasureAxis("y", "' . get_lang("Votes") . '");';
             if (!$hasSerie) {
-                $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['option'] . '", "';
-                array_push($order, $chartDataElement['option']);
-            } else if (!is_array($chartDataElement['serie'])) {
-                $htmlChart .= get_lang("Option") . '":"' . $chartDataElement['serie'] . '", "' .
-                    get_lang("Score") . '":"' . $chartDataElement['option'] . '", "';
-                array_push($serie, $chartDataElement['serie']);
+                $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", "' . get_lang("Option") . '");
+                    xAxisCategory.addOrderRule(' . json_encode($order) . ');
+                    myChart.addSeries("' . get_lang("Option") . '", dimple.plot.bar);';
             } else {
-                $htmlChart .= get_lang("Serie") . '":"' . $chartDataElement['serie'][0] . '", "' .
-                    get_lang("Option") . '":"' . $chartDataElement['serie'][1] . '", "' .
-                    get_lang("Score") . '":"' . $chartDataElement['option'] . '", "';
+                if (!is_array($chartDataElement['serie'])) {
+                    $serie = array_values(array_unique($serie));
+                    $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", ["' . get_lang("Option") . '","' . get_lang("Score") . '"]);
+                        xAxisCategory.addOrderRule(' . json_encode($serie) . ');
+                        xAxisCategory.addGroupOrderRule("' . get_lang("Score") . '");
+                        myChart.addSeries("' . get_lang("Option") . '", dimple.plot.bar);';
+                } else {
+                    $htmlChart .= 'myChart.addCategoryAxis("x", ["' . get_lang("Option") . '","' . get_lang("Score") . '"]);
+                        myChart.addSeries("' . get_lang("Serie") . '", dimple.plot.bar);';
+                }
             }
-            $htmlChart .= get_lang("Votes") . '":"' . $chartDataElement['votes'] .
-            '"},';
-        }
-        rtrim($htmlChart, ",");
-        $htmlChart .= '];
-            var myChart = new dimple.chart(svg, data);
-            myChart.addMeasureAxis("y", "'.get_lang("Votes").'");';
-        if (!$hasSerie) {
-            $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", "'.get_lang("Option").'");';
-            $htmlChart .= 'xAxisCategory.addOrderRule('.json_encode($order).');';
-            $htmlChart .= 'myChart.addSeries("'.get_lang("Option").'", dimple.plot.bar);';
-
-        } else if (!is_array($chartDataElement['serie'])) {
-            $serie = array_values(array_unique($serie));
-            $htmlChart .= 'var xAxisCategory = myChart.addCategoryAxis("x", ["'.get_lang("Option").'","'.get_lang("Score").'"]);';
-            $htmlChart .= 'xAxisCategory.addOrderRule('.json_encode($serie).');';
-            $htmlChart .= 'xAxisCategory.addGroupOrderRule("'.get_lang("Score").'");';
-            $htmlChart .= 'myChart.addSeries("'.get_lang("Option").'", dimple.plot.bar);';
-        } else {
-            $htmlChart .= 'myChart.addCategoryAxis("x", ["'.get_lang("Option").'","'.get_lang("Score").'"]);';
-            $htmlChart .= 'myChart.addSeries("'.get_lang("Serie").'", dimple.plot.bar);';
+            $htmlChart .= 'myChart.draw();
+                </script>';
         }
-        $htmlChart .= 'myChart.draw();
-            </script>
-            </div>';
-        echo $htmlChart;
+        return $htmlChart;
     }
 }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov