version 1.1340, 2020/03/15 23:04:15
|
version 1.1343, 2020/06/09 21:32:32
|
Line 15229 Inputs:
|
Line 15229 Inputs:
|
|
|
from - Sender's email address |
from - Sender's email address |
|
|
|
replyto - Reply-To email address |
|
|
to - Email address of recipient |
to - Email address of recipient |
|
|
subject - Subject of email |
subject - Subject of email |
Line 15239 cc_string - Carbon copy email ad
|
Line 15241 cc_string - Carbon copy email ad
|
|
|
bcc - Blind carbon copy email address |
bcc - Blind carbon copy email address |
|
|
type - File type of attachment |
|
|
|
attachment_path - Path of file to be attached |
attachment_path - Path of file to be attached |
|
|
file_name - Name of file to be attached |
file_name - Name of file to be attached |
Line 15257 attachment_text - The body of an attac
|
Line 15257 attachment_text - The body of an attac
|
############################################################ |
############################################################ |
|
|
sub mime_email { |
sub mime_email { |
my ($from, $to, $subject, $body, $cc_string, $bcc, $attachment_path, |
my ($from,$replyto,$to,$subject,$body,$cc_string,$bcc,$attachment_path, |
$file_name, $attachment_text) = @_; |
$file_name,$attachment_text) = @_; |
|
|
my $msg = MIME::Lite->new( |
my $msg = MIME::Lite->new( |
From => $from, |
From => $from, |
To => $to, |
To => $to, |
Line 15266 sub mime_email {
|
Line 15267 sub mime_email {
|
Type =>'TEXT', |
Type =>'TEXT', |
Data => $body, |
Data => $body, |
); |
); |
|
if ($replyto ne '') { |
|
$msg->add("Reply-To" => $replyto); |
|
} |
if ($cc_string ne '') { |
if ($cc_string ne '') { |
$msg->add("Cc" => $cc_string); |
$msg->add("Cc" => $cc_string); |
} |
} |
Line 16059 sub construct_course {
|
Line 16063 sub construct_course {
|
$outcome .= $clonemsg.$linefeed; |
$outcome .= $clonemsg.$linefeed; |
my %oldcenv=&Apache::lonnet::dump('environment',$$crsudom,$$crsunum); |
my %oldcenv=&Apache::lonnet::dump('environment',$$crsudom,$$crsunum); |
# Copy all files |
# Copy all files |
&Apache::lonclonecourse::copycoursefiles($cloneid,$$courseid,$args->{'datemode'},$args->{'dateshift'}); |
&Apache::lonclonecourse::copycoursefiles($cloneid,$$courseid,$args->{'datemode'}, |
|
$args->{'dateshift'},$args->{'crscode'}); |
# Restore URL |
# Restore URL |
$cenv{'url'}=$oldcenv{'url'}; |
$cenv{'url'}=$oldcenv{'url'}; |
# Restore title |
# Restore title |
Line 16326 sub construct_course {
|
Line 16331 sub construct_course {
|
# Open all assignments |
# Open all assignments |
# |
# |
if ($args->{'openall'}) { |
if ($args->{'openall'}) { |
|
my $opendate = time; |
|
if ($args->{'openallfrom'} =~ /^\d+$/) { |
|
$opendate = $args->{'openallfrom'}; |
|
} |
my $storeunder=$$crsudom.'_'.$$crsunum.'.0.opendate'; |
my $storeunder=$$crsudom.'_'.$$crsunum.'.0.opendate'; |
my %storecontent = ($storeunder => time, |
my %storecontent = ($storeunder => $opendate, |
$storeunder.'.type' => 'date_start'); |
$storeunder.'.type' => 'date_start'); |
|
$outcome .= &mt('All assignments open starting [_1]', |
$outcome .= &mt('Opening all assignments').': '.&Apache::lonnet::cput |
&Apache::lonlocal::locallocaltime($opendate)).': '. |
('resourcedata',\%storecontent,$$crsudom,$$crsunum).$linefeed; |
&Apache::lonnet::cput |
|
('resourcedata',\%storecontent,$$crsudom,$$crsunum).$linefeed; |
} |
} |
# |
# |
# Set first page |
# Set first page |