Browse Source

Merge branch '1.9.x' of ssh://github.com/chamilo/chamilo-lms into chamilo19

Julio Montoya 10 years ago
parent
commit
741f98430b

+ 6 - 6
documentation/changelog.html

@@ -44,7 +44,7 @@
 <p><i>Note: most #wxyz references are issue numbers you can find in <a href="http://support.chamilo.org/projects/chamilo-18/issues" target="_blank">our public bug tracking system</a>. Some references marked BT#xyz are developments made externally for BeezNest customers and integrated into Chamilo. The details of these tasks cannot be seen for confidentiality reasons, but the code change is public and can be reviewed by anyone.</i></p>
 <p>&nbsp;</p>
 
-<h1>Chamilo 1.9.10 - 10th of November, 2014</h1>
+<h1>Chamilo 1.9.10 - Huánuco, 10th of November, 2014</h1>
 <h3>Release notes - summary</h3>
 <p>Chamilo 1.9.10 is a patch version with a few minor bugfixes and a new packaging. This will be packaged and promoted as 1.9.8, but the folder inside the 1.9.8 will be called 1.9.10, with a few changes to this changelog file and a few fixes throughout the code (as such, you can just overwrite previous files to upgrade from 1.9.8, 1.9.8.1 or 1.9.8.2 to 1.9.10).</p>
 <h3>Release name</h3>
@@ -272,9 +272,11 @@ All security issues are published and patches are attached on <a href="https://s
   <li>(a55776c - BT#8189) Fix for users inscription with approval setting</li>
 </ul>
 <h3>Stylesheets and theming</h3>
-Stylesheets have been considerably changed in version 1.9.8, which might require a little update on your side if you have a custom stylesheet. We're sorry about it, but it was really necessary to improve the adaptability of the interface for mobile devices (which we are sure you will appreciate). If you only changed the logo, we recommend you make a copy of an existing Chamilo style (main/css/chamilo*) again, rename it and simply replace the logo then upload the new style. If you have more complex styles, you might want to ask for the assistance of your web designer at the moment you update Chamilo to this version.
 <ul>
   <li>No major style changes in this version, but a lot of visual improvements</li>
+  <li>The possibility to select a template (from main/template/) through the configuration.php file has been added, although no new template is available yet</li>
+  <li>Old question types icons were replaced by new icons</li>
+  <li>Old session "window" icon was replaced by a new icon</li>
 </ul>
 <h3>Web services</h3>
 <ul>
@@ -283,8 +285,7 @@ Stylesheets have been considerably changed in version 1.9.8, which might require
 </ul>
 <h3>Removals</h3>
 <ul>
-  <li>Old question types icons were replaced by new icons</li>
-  <li>Old session "window" icon was replaced by a new icon</li>
+  <li>No removal worth mentioning in this version</li>
 </ul>
 
 
@@ -2172,9 +2173,8 @@ This version of Chamilo only includes a few minor new features:
   <li>Added support for .docx</li>
   <li>Improve group homepage (#2077)</li>
   <li>Added support for global announcement by URL (#1763)</li>
-</li>
-
 </ul>
+
 <h3>Debugging</h3>
 <ul>
   <li>Fixed tools shortcuts crash bug (#3356)</li>

+ 3 - 3
main/inc/lib/main_api.lib.php

@@ -7553,10 +7553,10 @@ function api_get_configuration_value($variable)
 }
 
 /**
- * Returns supported image extensions
- * @return  array   Supported image extensions
+ * Returns supported image extensions in the portal
+ * @return  array   Supported image extensions in the portal
  */
-function getSupportedImageExtensions()
+function api_get_supported_image_extensions()
 {
     $supportedImageExtensions = array('jpg', 'jpeg', 'png', 'gif', 'svg');
     if (version_compare(PHP_VERSION, '5.5.0', '>=')) {

+ 13 - 5
main/inc/lib/social.lib.php

@@ -735,7 +735,7 @@ class SocialManager extends UserManager
         $total_invitations = (!empty($total_invitations) ? Display::badge($total_invitations) : '');
 
         $html = '';
-
+        $active = null;
         if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list', 'waiting_list', 'invite_friends'))) {
 
             $html .= '<div class="well sidebar-nav"><ul class="nav nav-list">';
@@ -1204,7 +1204,7 @@ class SocialManager extends UserManager
         $safeFileName = Database::escape_string($fileAttach['name']);
 
         $extension = strtolower(substr(strrchr($safeFileName, '.'), 1));
-        $allowedTypes = getSupportedImageExtensions();
+        $allowedTypes = api_get_supported_image_extensions();
         if (!in_array($extension, $allowedTypes)) {
             $flag = false;
         } else {
@@ -1413,7 +1413,15 @@ class SocialManager extends UserManager
         return $data;
     }
 
-
+    /**
+     * Returns the formatted header message post
+     * @param   int     $authorId   Author's id
+     * @param   int     $receiverId Receiver's id
+     * @param   array   $users      Author's and receiver's data
+     * @param   array   $message    Message data
+     * @param   boolean $isOwnWall  Determines if the author is in its own social wall or not
+     * @return  string  $html       The formatted header message post
+     */
     private  static function headerMessagePost($authorId, $receiverId, $users, $message, $isOwnWall = false)
     {
         $date = api_get_local_time($message['send_date']);
@@ -1493,7 +1501,7 @@ class SocialManager extends UserManager
      * @param   string  $text       Content text
      * @return  string  $newText    Content text with OpenGraph
      */
-    public function readContentWithOpenGraph($text)
+    public static function readContentWithOpenGraph($text)
     {
         // search link in first line
         $regExUrl = "/(http|https)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
@@ -1519,7 +1527,7 @@ class SocialManager extends UserManager
      * @param $link url
      * @return string data html
      */
-    public function getHtmlByLink($link)
+    public static function getHtmlByLink($link)
     {
         $graph = OpenGraph::fetch($link);
         $title = $graph->title;

+ 4 - 5
main/social/home.php

@@ -44,7 +44,7 @@ if (api_get_setting('profile', 'picture') == 'true') {
             get_lang('DelImage')
         );
     }
-    $allowed_picture_types = getSupportedImageExtensions();
+    $allowed_picture_types = api_get_supported_image_extensions();
     $form->addRule(
         'picture',
         get_lang('OnlyImagesAllowed') . ' (' . implode(
@@ -109,9 +109,9 @@ $socialRightContent .= '
         ' . get_lang('EditProfile') . '
     </a>
     </div></div></div>';
-
+$socialRightInformation = '<div class="span4">';
 if (api_get_setting('allow_skills_tool') == 'true') {
-    $socialRightInformation .= '<div><div class="well_border">';
+    $socialRightInformation .= '<div class="well_border">';
     $skill = new Skill();
     $ranking = $skill->get_user_skill_ranking(api_get_user_id());
     $url = api_get_path(WEB_CODE_PATH) . 'social/skills_ranking.php';
@@ -147,12 +147,11 @@ if (api_get_setting('allow_skills_tool') == 'true') {
     $socialRightInformation .= '</div>';
 }
 
-$socialRightInformation .= '</div>';
 
 //Search box
 $socialRightInformation .= '<div>';
 $socialRightInformation .= UserManager::get_search_form('');
-$socialRightInformation .= '<br />';
+$socialRightInformation .= '<br /></div>';
 
 //Group box by age
 $results = GroupPortalManager::get_groups_by_age(1, false);

+ 5 - 5
main/social/profile.php

@@ -384,7 +384,7 @@ foreach ($sessionList as $session) {
 
 // My friends
 $friend_html = listMyFriends($user_id, $link_shared ,$show_full_profile);
-$social_left_content.= '<div class="well sidebar-nav">' .$friend_html . '</div>';
+$social_left_content = '<div class="well sidebar-nav">' .$friend_html . '</div>';
 
 $personal_info = null;
 if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) {
@@ -425,8 +425,8 @@ if ($show_full_profile) {
     $personal_info .=  '</dl>';
 }
 
-$wallSocialAddPost .= wallSocialAddPost();
-$social_right_content .= SocialManager::social_wrapper_div($wallSocialAddPost, 5);
+$wallSocialAddPost = wallSocialAddPost();
+$social_right_content = SocialManager::social_wrapper_div($wallSocialAddPost, 5);
 
 $social_right_content .= wallSocialPost($my_user_id, $friendId);
 $socialAutoExtendLink = Display::url(
@@ -437,7 +437,7 @@ $socialAutoExtendLink = Display::url(
     )
 );
 
-$socialRightInformation .=  SocialManager::social_wrapper_div($personal_info, 4);
+$socialRightInformation =  SocialManager::social_wrapper_div($personal_info, 4);
 
 //$social_right_content .= SocialManager::social_wrapper_div($wallSocial, 5);
 
@@ -654,7 +654,7 @@ if ($show_full_profile) {
     }
 
 
-    $sessions .=  '<div><h3>'.api_ucfirst(get_lang('MySessions')).'</h3></div>';
+    $sessions =  '<div><h3>'.api_ucfirst(get_lang('MySessions')).'</h3></div>';
     $sessions .=  "<div class='social-content-training'>$htmlSessionList</div>";
     $socialRightInformation .=  SocialManager::social_wrapper_div($sessions, 4);
 

+ 77 - 0
tests/scripts/packaging/gitlog.php

@@ -0,0 +1,77 @@
+<?php
+/**
+ * This script pre-generates a list of commits to generate a changelog in the
+ * form (branch, then commits in HTML form, then a final feedback):
+ *
+ * @example
+ * 1.9.x
+ * <li>(<a href="https://github.com/chamilo/chamilo-lms/commit/7333997ce358870bac139d15816dcaa7dd7794fa">7333997c</a> - <a href="https://task.beeznest.com/issues/8680">BT#8680</a>) Fixing custom lost password to work as classic Chamilo</li>
+ * ...
+ * <li>(<a href="https://github.com/chamilo/chamilo-lms/commit/acdc14c47997315b151efda9a530c47a53100d68">acdc14c4</a> - <a href="https://task.beeznest.com/issues/8676">BT#8676</a>) Adding unique email validation option</li>
+ * Printed 367 commits of 500 requested (others were minor)
+ *
+ * @author Yannick Warnier <yannick.warnier@beeznest.com>
+ */
+/**
+ * Includes a modified version of Git lib by Sebastian Bergmann of PHPUnit
+ * @see https://github.com/ywarnier/git
+ */
+require 'php-git/src/Git.php';
+$repository = __DIR__.'/../..';
+$number = 500; //the number of commits to check (including minor)
+$formatHTML = true;
+
+$git = new \SebastianBergmann\Git\Git($repository);
+echo $git->getCurrentBranch().PHP_EOL;
+
+$logs = $git->getRevisions('DESC', $number);
+$i = 0;
+foreach ($logs as $log) {
+    //echo $log['date']->format('Y-m-d H:i:s').' '.substr($log['sha1'],0,8).PHP_EOL;
+    if (strncasecmp($log['message'], 'Minor', 5) === 0) {
+        //Skip minor messages
+        continue;
+    }
+    $issueLink = '';
+    $matches = array();
+    if (preg_match_all('/((BT)?#(\d){2,5})/', $log['message'], $matches)) {
+        $issue = $matches[0][0];
+        if (substr($issue, 0, 1) == '#') {
+            // not a BeezNest task
+            $num = substr($issue, 1);
+            if ($formatHTML) {
+                $issueLink = ' - <a href="https://support.chamilo.org/issues/' . $num . '">#' . $num . '</a>';
+            } else {
+                $issueLink = ' - ' . $num;
+            }
+        } else {
+            $num = substr($issue, 3);
+            if ($formatHTML) {
+                $issueLink = ' - <a href="https://task.beeznest.com/issues/' . $num . '">BT#' . $num . '</a>';
+            } else {
+                $issueLink = ' - ' . $num;
+            }
+        }
+        if ($hasRefs = stripos($log['message'], ' see '.$issue)) {
+            $log['message'] = substr($log['message'], 0, $hasRefs);
+        }
+        if ($hasRefs = stripos($log['message'], ' - ref')) {
+            $log['message'] = substr($log['message'], 0, $hasRefs);
+        }
+        if ($hasRefs = stripos($log['message'], ' -refs ')) {
+            $log['message'] = substr($log['message'], 0, $hasRefs);
+        }
+        
+    }
+    $commitLink = '';
+    if ($formatHTML) {
+        $commitLink = '<a href="https://github.com/chamilo/chamilo-lms/commit/' . $log['sha1'] . '">' .
+            substr($log['sha1'], 0, 8) . '</a>';
+        echo '<li>('.$commitLink.$issueLink.') '.$log['message'].'</li>'.PHP_EOL;
+    } else {
+        $commitLink = substr($log['sha1'], 0, 8);
+        echo '('.$commitLink.$issueLink.') '.$log['message'].''.PHP_EOL;
+    }
+    $i++;
+}
+echo "Printed $i commits of $number requested (others were minor)".PHP_EOL;