From 53c2e4450519378143ff23f0795344a117132c79 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 6 Apr 2009 21:34:52 +0200 Subject: [PATCH] [svn r19571] Send by email checkbox should be checked by default see FS#3987 --- main/announcements/announcements.php | 171 ++++++++++++--------------- 1 file changed, 77 insertions(+), 94 deletions(-) diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index aaea4abca7..43d17a97b4 100644 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -1,4 +1,4 @@ -\n"; + echo "
\n"; - //this variable defines if the course administrator can send a message to a specific user / group - // or not - //echo "sessiewaarde: ".$_SESSION['select_groupusers']; - if(empty($_SESSION['toolgroup'])){ - + //this variable defines if the course administrator can send a message to a specific user / group + // or not + //echo "sessiewaarde: ".$_SESSION['select_groupusers']; + if (empty($_SESSION['toolgroup'])) { echo "
"; echo get_lang("SentTo").": "; echo ""; if(isset($_GET['id']) && is_array($to)){ echo ' '; - } - elseif(isset($_GET['remind_inactive'])) - { + } elseif(isset($_GET['remind_inactive'])) { $email_ann = '1'; $_SESSION['select_groupusers']="show"; $content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'), 7); $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName')); - } - elseif(isset($_GET['remindallinactives']) && $_GET['remindallinactives']=='true') - { + } elseif(isset($_GET['remindallinactives']) && $_GET['remindallinactives']=='true') { $since = isset($_GET['since']) ? intval($_GET['since']) : 6; $to = Tracking :: get_inactives_students_in_course($_course['id'],$since, $_SESSION['id_session']); - foreach($to as &$user) - { + foreach($to as &$user) { $user = 'USER:'.$user; } $_SESSION['select_groupusers']="show"; $email_ann = '1'; $content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'),$since); - $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName')); - + $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName')); /* //echo ' '; */ - } - else{ + } else { echo get_lang("Everybody"); } echo ""; echo Display::return_icon('group.gif', get_lang('ModifyRecipientList'), array ('align' => 'absmiddle')).''.get_lang('ModifyRecipientList').''; echo "
"; show_to_form($to); - echo "

"; - - if (!isset($announcement_to_modify) ) $announcement_to_modify =""; - if ($announcement_to_modify=='') - { - ($email_ann=='1')?$checked='checked':$checked=''; + if (!isset($announcement_to_modify) ) + $announcement_to_modify =""; + if ($announcement_to_modify=='') { + ($email_ann=='1')?$checked='checked':$checked='checked'; echo " ".get_lang('EmailOption')," : ", "

"; } - }else{ - if (!isset($announcement_to_modify) ) $announcement_to_modify =""; - if ($announcement_to_modify=='') - { + } else { + if (!isset($announcement_to_modify) ) + $announcement_to_modify =""; + if ($announcement_to_modify=='') { + ($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked=''; + echo " ".get_lang('EmailOption')," : ".get_lang('MyGroup'), "

"; echo ''.get_lang('ModifyRecipientList').''; @@ -1119,69 +1110,61 @@ if(!empty($error_message)) echo '

'; } - } - if($surveyid){ - echo get_lang('EmailAddress').": (Comma separated for multiple)
"; - echo get_lang('OnlyThoseAddresses').":
"; - } - echo ""; - echo " ".get_lang('EmailTitle').":
"; - - unset($title_to_modify); - $title_to_modify = null; - - if (!isset($announcement_to_modify) ) $announcement_to_modify =""; - if (!isset($content_to_modify) ) $content_to_modify =""; - if (!isset($title_to_modify)) $title_to_modify = ""; - - echo "
\n"; - if($surveyid){ - $content_to_modify='
'.get_lang('ClickHereToOpenSurvey').'
- '.get_lang('OrCopyPasteUrl').'
- '.api_get_path(WEB_CODE_PATH).'/survey/#page#?temp=#temp#&surveyid=#sid#&uid=#uid#&mail=#mail#&db_name=#db_name '; - } + } + if ($surveyid) { + echo get_lang('EmailAddress').": (Comma separated for multiple)
"; + echo get_lang('OnlyThoseAddresses').":
"; + } + echo ""; + echo " ".get_lang('EmailTitle').":
"; - //api_disp_html_area('newContent',$content_to_modify,'250px'); + unset($title_to_modify); + $title_to_modify = null; - require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php"); + if (!isset($announcement_to_modify) ) $announcement_to_modify =""; + if (!isset($content_to_modify) ) $content_to_modify =""; + if (!isset($title_to_modify)) $title_to_modify = ""; + + echo "
\n"; + if ($surveyid) { + $content_to_modify='
'.get_lang('ClickHereToOpenSurvey').'
+ '.get_lang('OrCopyPasteUrl').'
+ '.api_get_path(WEB_CODE_PATH).'/survey/#page#?temp=#temp#&surveyid=#sid#&uid=#uid#&mail=#mail#&db_name=#db_name '; + } - $oFCKeditor = new FCKeditor('newContent') ; - - $oFCKeditor->Width = '100%'; - $oFCKeditor->Height = '300'; - - if(!api_is_allowed_to_edit()) - { - $oFCKeditor->ToolbarSet = "Announcements_Student"; - } - else - { - $oFCKeditor->ToolbarSet = "Announcements"; - } - - $oFCKeditor->Value = $content_to_modify; - - echo $oFCKeditor->CreateHtml(); + //api_disp_html_area('newContent',$content_to_modify,'250px'); + require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php"); + $oFCKeditor = new FCKeditor('newContent') ; + $oFCKeditor->Width = '100%'; + $oFCKeditor->Height = '300'; + + if (!api_is_allowed_to_edit()) { + $oFCKeditor->ToolbarSet = "Announcements_Student"; + } else { + $oFCKeditor->ToolbarSet = "Announcements"; + } + + $oFCKeditor->Value = $content_to_modify; + echo $oFCKeditor->CreateHtml(); + echo'
'; + if(empty($_SESSION['toolgroup'])) { + echo ''; + //echo '


'; + echo '


'; - echo'
'; - if(empty($_SESSION['toolgroup'])){ - echo ''; - //echo '


'; - echo '


'; - - } - else{ - echo ''; - //echo '


'; - echo '


'; - - } - echo '

'; + } else { + echo ''; + //echo '


'; + echo '


'; + + } + echo '
'; - if((isset($_GET['action']) && isset($_GET['id']) && is_array($to))||isset($_GET['remindallinactives'])||isset($_GET['remind_inactive'])){ - echo ''; - } - } // displayform + if((isset($_GET['action']) && isset($_GET['id']) && is_array($to))||isset($_GET['remindallinactives'])||isset($_GET['remind_inactive'])){ + echo ''; + } +} +// displayform