Browse Source

Merge branch '1.10.x' of github.com:chamilo/chamilo-lms into 1.10.x

jmontoya 9 years ago
parent
commit
1cc473c72e

+ 0 - 1
app/Migrations/Schema/V110/Version20151101082300.php

@@ -252,7 +252,6 @@ class Version20151101082300 extends AbstractMigrationChamilo
         $sessionRelUser->addColumn('moved_to', Type::INTEGER)->setNotnull(false);
         $sessionRelUser->addColumn('moved_status', Type::INTEGER)->setNotnull(false);
         $sessionRelUser->addColumn('moved_at', Type::DATETIME)->setNotnull(false);
-        $sessionRelUser->addColumn('duration', Type::INTEGER)->setNotnull(false);
 
         $sessionRelUser->addIndex(['session_id']);
         $sessionRelUser->addIndex(['user_id']);

+ 15 - 20
app/Resources/public/css/base.css

@@ -2043,7 +2043,6 @@ div.admin_section h4 {
     float: left;
 }
 
-
 .ribbon .rib-success, .ribbon .ribbon-total-success{
     background-color: #768E00;
     background-image: -ms-linear-gradient(top, #9CB80A, #768E00);
@@ -2106,11 +2105,6 @@ div.admin_section h4 {
 .ribbon .rib::before {left: 0;}
 .ribbon .rib::after {right: 0;}
 
-
-.ribbon .success {
-
-}
-
 .ribbon .error {
     color: red;
 }
@@ -2129,28 +2123,30 @@ div.admin_section h4 {
 .exercise_save_now_button, .exercise_button{
     /* padding:5px; */
 }
-
-.time_container_warning {
-    background-color:#FFD700;
-    border:1px solid #B8860B;
-}
-
 /* Exercise clock*/
 .count_down {
     padding: 3px;
-    font-size:22px;
+    font-size:20px;
     font-weight:bold;
-    color:#222;
-    padding: 12px;
+    color:#2E75A3;
+    padding: 5px;
     text-align: center;
-    width:200px;
+    margin-bottom: 10px;
+    background: url(../../main/img/clock-exercise.png) no-repeat center center #FFF;
+    border: 1px solid #DDD;
+    border-radius: 5px;
+}
+.count_down.navbar-fixed-top{
+    border-radius: 0px;
+}
+.time_container_warning {
+    background: url(../../main/img/clock-exercise.png) no-repeat center center #FFD700;
+    border:1px solid #B8860B;
 }
-
 .red_alert {
     color:red;
     font-weight: bold;
 }
-
 #question_feedback {
     -webkit-border-radius: 10px;
     -moz-border-radius: 10px;
@@ -2165,7 +2161,6 @@ div.admin_section h4 {
     margin-top:5px;
     padding:5px;
 }
-
 .userportal-order-courses-link {
     background-color: #F9F9F9;
     border-radius: 10px 10px 10px 10px;
@@ -5023,7 +5018,7 @@ div#chat-remote-video video {
     width: 450px !important;
 }
 .ui-accordion .ui-accordion-content-active{
-
+    overflow: visible;
 }
 .ui-jqgrid-view .ui-widget-content a{
   color:#666666;

+ 2 - 2
main/exercice/exercise.class.php

@@ -5016,8 +5016,8 @@ class Exercise
             get_lang('YouWillBeRedirectedInXSeconds'),
             '<span id="counter_to_redirect" class="red_alert"></span>'
         );
-        $html .= '</div>';
-        $html .= '<div id="exercise_clock_warning" class="well count_down"></div>';
+        $html .= '</div>'; 
+        $html .= '<div id="exercise_clock_warning" class="count_down"></div>';
         return $html;
     }
 

BIN
main/img/clock-exercise.png


+ 46 - 11
main/inc/lib/add_course.lib.inc.php

@@ -875,9 +875,21 @@ class AddCourse
                                     );
                                     $image_id = Database:: insert_id();
 
-                                    Database::query(
-                                        "INSERT INTO $TABLEITEMPROPERTY (c_id, tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility)
-                                        VALUES ($course_id,'document',1,'$now','$now',$image_id,'DocumentAdded',1,NULL,NULL,0)"
+                                    Database::insert(
+                                        $TABLEITEMPROPERTY,
+                                        [
+                                            'c_id' => $course_id,
+                                            'tool' => 'document',
+                                            'insert_user_id' => api_get_user_id(),
+                                            'insert_date' => $now,
+                                            'lastedit_date' => $now,
+                                            'ref' => $image_id,
+                                            'lastedit_type' => 'DocumentAdded',
+                                            'lastedit_user_id' => api_get_user_id(),
+                                            'to_group_id' => null,
+                                            'to_user_id' =>  null,
+                                            'visibility' => 0
+                                        ]
                                     );
                                 }
                             }
@@ -921,11 +933,22 @@ class AddCourse
                                         if ($path_documents . $value['file'] == '/certificates/default.html') {
                                             $example_cert_id = $image_id;
                                         }
-                                        Database::query(
-                                            "INSERT INTO $TABLEITEMPROPERTY (c_id, tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility)
-                                            VALUES ($course_id,'document',1,'$now','$now',$image_id,'DocumentAdded',1,NULL,NULL,1)"
+                                        $docId = Database::insert(
+                                            $TABLEITEMPROPERTY,
+                                            [
+                                                'c_id' => $course_id,
+                                                'tool' => 'document',
+                                                'insert_user_id' => api_get_user_id(),
+                                                'insert_date' => $now,
+                                                'lastedit_date' => $now,
+                                                'ref' => $image_id,
+                                                'lastedit_type' => 'DocumentAdded',
+                                                'lastedit_user_id' => api_get_user_id(),
+                                                'to_group_id' => null,
+                                                'to_user_id' =>  null,
+                                                'visibility' => 1
+                                            ]
                                         );
-                                        $docId = Database:: insert_id();
                                         if ($docId) {
                                             $sql = "UPDATE $TABLEITEMPROPERTY SET id = iid WHERE iid = $docId";
                                             Database::query($sql);
@@ -1146,11 +1169,23 @@ class AddCourse
             $sql = "UPDATE $tableDocument SET id = iid WHERE iid = $docId";
             Database::query($sql);
 
-            Database::query(
-                "INSERT INTO $tableItem (id, c_id, tool,insert_user_id,insert_date,lastedit_date,ref,lastedit_type,lastedit_user_id,to_group_id,to_user_id,visibility)
-                VALUES ($counter, $course_id,'document',1,'$now', '$now', $docId, 'DocumentAdded', 1, NULL, NULL, 0)"
+            $id = Database::insert(
+                $tableItem,
+                [
+                    'id' => $counter,
+                    'c_id' => $course_id,
+                    'tool' => 'document',
+                    'insert_user_id' => api_get_user_id(),
+                    'insert_date' => $now,
+                    'lastedit_date' => $now,
+                    'ref' => $docId,
+                    'lastedit_type' => 'DocumentAdded',
+                    'lastedit_user_id' => api_get_user_id(),
+                    'to_group_id' => null,
+                    'to_user_id' =>  null,
+                    'visibility' => 0
+                ]
             );
-            $id = Database:: insert_id();
             if ($id) {
                 $sql = "UPDATE $tableItem SET id = iid WHERE iid = $id";
                 Database::query($sql);

+ 17 - 2
main/inc/lib/api.lib.php

@@ -7846,8 +7846,8 @@ function api_create_protected_dir($name, $parentDirectory)
  * @param string    sender e-mail
  * @param array     extra headers in form $headers = array($name => $value) to allow parsing
  * @param array     data file (path and filename)
- * @param array     data to attach a file (optional)
  * @param bool      True for attaching a embedded file inside content html (optional)
+ * @param array     Additional parameters
  * @return          returns true if mail was sent
  * @see             class.phpmailer.php
  */
@@ -7968,7 +7968,22 @@ function api_mail_html(
 
     // Attachment ...
     if (!empty($data_file)) {
-        $mail->AddAttachment($data_file['path'], $data_file['filename']);
+        $o = 0;
+        foreach ($data_file as $file_attach) {
+            if (!empty($file_attach['path']) && !empty($file_attach['filename'])) {
+                $mail->AddAttachment($file_attach['path'], $file_attach['filename']);
+            }
+            $o++;
+        }
+    } elseif (is_array($_FILES)) {
+        $data_file = $_FILES;
+        $o = 0;
+        foreach ($data_file as $file_attach) {
+            if (!empty($file_attach['tmp_name']) && !empty($file_attach['name'])) {
+                $mail->AddAttachment($file_attach['tmp_name'], $file_attach['name']);
+            }
+            $o++;
+        }
     }
 
     // Only valid addresses are accepted.

+ 8 - 1
main/inc/lib/message.lib.php

@@ -362,6 +362,12 @@ class MessageManager
             // Load user settings.
             $notification = new Notification();
             $sender_info = api_get_user_info($user_sender_id);
+            
+            // add file attachment additional attributes
+            foreach ($file_attachments as $file_attach) {
+                $file_attachments['path'] = $file_attach['tmp_name'];
+                $file_attachments['filename'] = $file_attach['name'];
+            }
 
             if (empty($group_id)) {
                 $type = Notification::NOTIFICATION_TYPE_MESSAGE;
@@ -373,7 +379,8 @@ class MessageManager
                     array($receiver_user_id),
                     $subject,
                     $content,
-                    $sender_info
+                    $sender_info,
+                    $file_attachments
                 );
             } else {
                 $usergroup = new UserGroup();

+ 4 - 2
main/inc/lib/notification.lib.php

@@ -227,7 +227,8 @@ class Notification extends Model
         $user_list,
         $title,
         $content,
-        $senderInfo = array()
+        $senderInfo = array(),
+        $attachments = array()
     ) {
         $this->type = intval($type);
         $content = $this->formatContent($content, $senderInfo);
@@ -307,7 +308,8 @@ class Notification extends Model
                                 Security::filter_terms($content),
                                 $this->adminName,
                                 $this->adminEmail,
-                                $extraHeaders
+                                $extraHeaders,
+                                $attachments
                             );
                         }
                         $sendDate = api_get_utc_datetime();

+ 3 - 3
main/template/default/layout/header.js.tpl

@@ -232,11 +232,11 @@ $(document).scroll(function() {
         }
 
         if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) {
-            fixed.addClass('subnav-fixed');
+            fixed.addClass('navbar-fixed-top');
             fixed.css('width', '100%');
         } else {
-            fixed.removeClass('subnav-fixed');
-            fixed.css('width', '200px');
+            fixed.removeClass('navbar-fixed-top');
+            fixed.css('width', '100%');
         }
     }