diff --git a/main/create_course/add_course.php b/main/create_course/add_course.php index df447e4c0d..a31fdd8e81 100644 --- a/main/create_course/add_course.php +++ b/main/create_course/add_course.php @@ -124,15 +124,15 @@ $titular = & $form->add_textfield('tutor_name', array(get_lang('Professor'), nul if ($course_validation_feature) { // Description of the requested course. - $form->addElement('textarea', 'description', get_lang('Description'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); + $form->addElement('textarea', 'description', get_lang('Description'), array('class' => 'span6', 'rows' => '3')); //$form->addRule('description', get_lang('ThisFieldIsRequired'), 'required'); // Objectives of the requested course. - $form->addElement('textarea', 'objetives', get_lang('Objectives'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); + $form->addElement('textarea', 'objetives', get_lang('Objectives'), array('class' => 'span6', 'rows' => '3')); //$form->addRule('objetives', get_lang('ThisFieldIsRequired'), 'required'); // Target audience of the requested course. - $form->addElement('textarea', 'target_audience', get_lang('TargetAudience'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); + $form->addElement('textarea', 'target_audience', get_lang('TargetAudience'), array('class' => 'span6', 'rows' => '3')); //$form->addRule('target_audience', get_lang('ThisFieldIsRequired'), 'required'); } diff --git a/main/css/base.css b/main/css/base.css index bcebdb779f..990dd1d2da 100644 --- a/main/css/base.css +++ b/main/css/base.css @@ -683,10 +683,6 @@ a.personal_agenda:hover, a.personal_agenda:hover { margin-top: 10px; } -.social-background-content { - width:auto; -} - .group_social_item { float:left; width:95%; @@ -1873,18 +1869,14 @@ div.image-social-content center.friend { font-size:12px; font-weight:bold; } -.social-menu-text4 { - font-family:Verdana, Geneva, sans-serif; +.social-menu-text4 { color:#000; - font-weight:normal; - font-size:10px; + font-weight:normal; vertical-align:bottom; } -.social-menu-text-active { - font-family:Verdana, Geneva, sans-serif; +.social-menu-text-active { color:#000; - font-weight:bold; - font-size:10px; + font-weight:bold; vertical-align:bottom; } .social-menu-title-right { @@ -2061,10 +2053,7 @@ border-top: 1px solid #E2E2E2; .social-background-content { z-index:5; - position:relative; - width:185px; - left:-10px; - overflow:hidden; + text-align: center; } .social-background-content .hidden_message { diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index 4627cd19ae..041b14e10a 100644 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -213,8 +213,7 @@ class MessageManager * @param bool sent an email or not (@todo) * @return bool */ - public static function send_message($receiver_user_id, $subject, $content, $file_attachments = array(), $file_comments = array(), $group_id = 0, $parent_id = 0, $edit_message_id = 0, $topic_id = 0) { - global $charset; + public static function send_message($receiver_user_id, $subject, $content, $file_attachments = array(), $file_comments = array(), $group_id = 0, $parent_id = 0, $edit_message_id = 0, $topic_id = 0) { $table_message = Database::get_main_table(TABLE_MESSAGE); $group_id = intval($group_id); $receiver_user_id = intval($receiver_user_id); @@ -243,8 +242,7 @@ class MessageManager //Just in case we replace the and \n and \n\r while saving in the DB $content = str_replace(array("\n", "\n\r"), '
', $content); - $now = api_get_utc_datetime(); - + $now = api_get_utc_datetime(); if (!empty($receiver_user_id) || !empty($group_id)) { // message for user friend @@ -263,7 +261,9 @@ class MessageManager "VALUES ('$user_sender_id', '$receiver_user_id', '1', '".$now."','$clean_subject','$clean_content','$group_id','$parent_id', '".$now."')"; $result = Database::query($query); $inbox_last_id = Database::insert_id(); - } + } + + // Save attachment file for inbox messages if (is_array($file_attachments)) { @@ -299,7 +299,7 @@ class MessageManager $notification = new Notification(); $sender_info = api_get_user_info($user_sender_id); - if (empty($group_id)) { + if (empty($group_id)) { $notification->save_notification(NOTIFICATION_TYPE_MESSAGE, array($receiver_user_id), $subject, $content, $sender_info); } else { $group_info = GroupPortalManager::get_group_data($group_id); diff --git a/main/inc/lib/pear/HTML/QuickForm.php b/main/inc/lib/pear/HTML/QuickForm.php index 7b4491c71d..0c7ad6e422 100644 --- a/main/inc/lib/pear/HTML/QuickForm.php +++ b/main/inc/lib/pear/HTML/QuickForm.php @@ -63,7 +63,8 @@ $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] = 'hierselect' =>array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'), 'autocomplete' =>array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'), 'xbutton' =>array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'), - 'advanced_settings' =>array('HTML/QuickForm/advanced_settings.php','HTML_QuickForm_advanced_settings') + 'advanced_settings' =>array('HTML/QuickForm/advanced_settings.php','HTML_QuickForm_advanced_settings'), + 'label' =>array('HTML/QuickForm/label.php','HTML_QuickForm_label'), ); diff --git a/main/inc/lib/pear/HTML/QuickForm/label.php b/main/inc/lib/pear/HTML/QuickForm/label.php new file mode 100644 index 0000000000..9aebe42bc8 --- /dev/null +++ b/main/inc/lib/pear/HTML/QuickForm/label.php @@ -0,0 +1,64 @@ + + * @version Release: 3.2.11 + * @since 3.0 + * @deprecated Please use the templates rather than add raw HTML via this element + */ +class HTML_QuickForm_label extends HTML_QuickForm_static +{ + // {{{ constructor + + /** + * Class constructor + * + * @param string $text raw HTML to add + * @access public + * @return void + */ + function HTML_QuickForm_label($label, $text) { + $this->HTML_QuickForm_static(null, $label, $text); + $this->_type = 'html'; + } + + // }}} + // {{{ accept() + + /** + * Accepts a renderer + * + * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!) + * @access public + * @return void + */ + function accept(&$renderer) { + $renderer->renderHtml($this); + } + + function toHtml() { + return '
+ +
+ '.HTML_QuickForm_static::toHtml().' +
+
+ + '; + } //end func toHtml + + + + // }}} +} //end class HTML_QuickForm_html diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index b5770bb71b..c938dfece8 100644 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -321,15 +321,15 @@ class SocialManager extends UserManager { if (isset($subject_message) && isset($content_message) && isset($userfriend_id)) { $send_message = MessageManager::send_message($userfriend_id, $subject_message, $content_message); + if ($send_message) { echo Display::display_confirmation_message($succes,true); } else { - echo Display::display_error_message($succes,true); + echo Display::display_error_message(get_lang('ErrorSendingMessage'),true); } return false; } elseif (isset($userfriend_id) && !isset($subject_message)) { - $count_is_true=false; - $count_number_is_true=0; + $count_is_true = false; if (isset($userfriend_id) && $userfriend_id>0) { $message_title = get_lang('Invitation'); $count_is_true = self::send_invitation_friend(api_get_user_id(), $userfriend_id, $message_title, $content_message); @@ -563,7 +563,6 @@ class SocialManager extends UserManager { } $user_info = api_get_user_info($user_id, true); - $show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list', 'browse_groups'); $show_messages = array('messages', 'messages_inbox', 'messages_outbox', 'messages_compose'); @@ -599,12 +598,12 @@ class SocialManager extends UserManager { //$original = GroupPortalManager::get_picture_group($group_id, $group_info['picture_uri'],'',GROUP_IMAGE_SIZE_ORIGINAL); $html .= '
'; - $html .= '
'; + $html .= '
'; + $html .= '
'; $html .= ''; } else { @@ -614,8 +613,8 @@ class SocialManager extends UserManager { $normal_image = $img_array['dir'].$img_array['file'].'?'.uniqid(); //--- User image - $html .= '
'; - $html .= '
'; + + $html .= '
'; - $html .= '
'; + $html .= ''; + } if (!in_array($show, array('shared_profile', 'groups', 'group_edit', 'member_list','waiting_list','invite_friends'))) { diff --git a/main/messages/send_message.php b/main/messages/send_message.php old mode 100755 new mode 100644 index 56cb72f475..5f88f24084 --- a/main/messages/send_message.php +++ b/main/messages/send_message.php @@ -20,8 +20,6 @@ $panel_id = intval($_POST['panel_id']); $content_message = $_POST['txt_content']; $subject_message = $_POST['txt_subject']; - - $user_info = array(); $user_info = api_get_user_info($user_id); @@ -30,7 +28,7 @@ if ($panel_id == 2 || $panel_id == 4 ) { ?>
:

-
+


@@ -42,7 +40,7 @@ if ($panel_id == 2 || $panel_id == 4 ) { ?>  :     :
- :
+ :
    :    

* :

-
:
+
:
diff --git a/main/messages/send_message_to_userfriend.inc.php b/main/messages/send_message_to_userfriend.inc.php index 282c7b6e86..ce844d7bf9 100644 --- a/main/messages/send_message_to_userfriend.inc.php +++ b/main/messages/send_message_to_userfriend.inc.php @@ -22,8 +22,7 @@ if (isset($_REQUEST['user_friend']) ) { // panel=1 send message // panel=2 send invitation $panel=intval($_REQUEST['view_panel']); - $info_user_friend=api_get_user_info($userfriend_id); - + $info_user_friend=api_get_user_info($userfriend_id); } ?>
@@ -31,48 +30,23 @@ if (isset($_REQUEST['user_friend']) ) { if (api_get_setting('allow_message_tool')=='true') { if ($panel == 1) { //normal message - $user_info=api_get_user_info($userfriend_id); ?> -
-
-
- : - -
-
-
-
-
- * : -
-
- -
-
-
-
-
- : -
-
- -
-
-
-
-
-
-
- -
-
-
-'; + $form = new FormValidator('add_user', null, null, null, array('class'=>'form-vertical')); + //$username = api_xml_http_response_encode(get_lang('To')).api_xml_http_response_encode(api_get_person_name($user_info['firstName'], $user_info['lastName'])); + $form->addElement('label', get_lang('To'), api_get_person_name($user_info['firstName'], $user_info['lastName'])); + ////$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required'); + $form->addElement('text', 'subject', get_lang('Subject'), array('id'=>'txt_subject_id','class'=>'span4')); + $form->addElement('textarea', 'message', get_lang('Message'), array('id'=>'txt_area_invite','class'=>'span4')); + $form->addElement('style_submit_button', 'send', get_lang('SendMessage'), array('onclick'=>"action_database_panel('5','".$userfriend_id."')")); + $form->display(); + echo '
'; } else { // friend invitation message ?>
:

-

+

@@ -80,4 +54,4 @@ if (api_get_setting('allow_message_tool')=='true') { } } ?> -
+ \ No newline at end of file diff --git a/main/social/home.php b/main/social/home.php index 7db159b686..b2de9fef8b 100644 --- a/main/social/home.php +++ b/main/social/home.php @@ -69,7 +69,7 @@ $user_info = UserManager :: get_user_info_by_id(api_get_user_id()); $social_left_content = SocialManager::show_social_menu('home'); - $social_right_content .= '
'; + $social_right_content .= '
'; // end social_user_information + //Search box - $social_right_content .= ''; $tpl = new Template(get_lang('Social')); $tpl->assign('social_left_content', $social_left_content); diff --git a/main/social/invitations.php b/main/social/invitations.php index 64da1fc3f8..c855141ab5 100644 --- a/main/social/invitations.php +++ b/main/social/invitations.php @@ -96,101 +96,99 @@ $social_left_content = SocialManager::show_social_menu('invitations'); $social_right_content = '
'; - $list_get_invitation = array(); - $user_id = api_get_user_id(); - - $list_get_invitation = SocialManager::get_list_invitation_of_friends_by_user_id($user_id); - $list_get_invitation_sent = SocialManager::get_list_invitation_sent_by_user_id($user_id); - $pending_invitations = GroupPortalManager::get_groups_by_user($user_id, GROUP_USER_PERMISSION_PENDING_INVITATION); - $number_loop = count($list_get_invitation); - - $total_invitations = $number_loop + count($list_get_invitation_sent) + count($pending_invitations); - - if ($total_invitations == 0 && count($_GET) <= 0) { - $social_right_content .= ''.get_lang('TryAndFindSomeFriends').'

'; - } +$list_get_invitation = array(); +$user_id = api_get_user_id(); + +$list_get_invitation = SocialManager::get_list_invitation_of_friends_by_user_id($user_id); +$list_get_invitation_sent = SocialManager::get_list_invitation_sent_by_user_id($user_id); +$pending_invitations = GroupPortalManager::get_groups_by_user($user_id, GROUP_USER_PERMISSION_PENDING_INVITATION); +$number_loop = count($list_get_invitation); + +$total_invitations = $number_loop + count($list_get_invitation_sent) + count($pending_invitations); + +if ($total_invitations == 0 && count($_GET) <= 0) { + $social_right_content .= ''.get_lang('TryAndFindSomeFriends').'

'; +} if ($number_loop != 0) { $social_right_content .= '

'.get_lang('InvitationReceived').'

'; foreach ($list_get_invitation as $invitation) { - $sender_user_id = $invitation['user_sender_id'] - ?> -
- '; + $picture = UserManager::get_user_picture_path_by_id($sender_user_id,'web',false,true); $friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92); $user_info = api_get_user_info($sender_user_id); $title = Security::remove_XSS($invitation['title'], STUDENT, true); $content = Security::remove_XSS($invitation['content'], STUDENT, true); $date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG); - ?> - + + $social_right_content .= '
- /> + - + '.api_get_person_name($user_info['firstName'], $user_info['lastName']).'
- + '.$title.' : '.$content.'
- + '.get_lang('DateSend').' : '.$date.'
- - + +
-
- '; } } - if (count($list_get_invitation_sent) > 0 ) { - echo '

'.get_lang('InvitationSent').'

'; + $social_right_content .= '

'.get_lang('InvitationSent').'

'; foreach ($list_get_invitation_sent as $invitation) { - $sender_user_id = $invitation['user_receiver_id'];?> -
- + $sender_user_id = $invitation['user_receiver_id']; + + $social_right_content .= '
'; + + $picture = UserManager::get_user_picture_path_by_id($sender_user_id,'web',false,true); + $friends_profile = SocialManager::get_picture_user($sender_user_id, $picture['file'], 92); + $user_info = api_get_user_info($sender_user_id); + + $title = Security::remove_XSS($invitation['title'], STUDENT, true); + $content = Security::remove_XSS($invitation['content'], STUDENT, true); + $date = api_convert_and_format_date($invitation['send_date'], DATE_TIME_FORMAT_LONG); + $social_right_content .= '
- /> + - + '.api_get_person_name($user_info['firstName'], $user_info['lastName']).'
- + '. $title.' : '.$content.'
- + '. get_lang('DateSend').' : '.$date.'
- -
- {$social_left_content} -
+
- \ No newline at end of file