Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/View.hx
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ class View extends sugoi.BaseView {

/**
* human readable date + time
* Note: no optional param — Templo cannot call functions with optional parameters
*/
public function hDate(date:Date, ?year:Bool = false):String {
return Formatting.hDate(date, year);
public function hDate(date:Date):String {
return Formatting.hDate(date);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/controller/Cron.hx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Cron extends Controller {
}
volunteersList += "</ul>";

mail.setSubject(t._("Instructions for the volunteers of the ::date:: distribution", {date: view.hDate(multidistrib.distribStartDate, true)}));
mail.setSubject(t._("Instructions for the volunteers of the ::date:: distribution", {date: Formatting.hDate(multidistrib.distribStartDate, true)}));

// Let's replace all the tokens
var ddate = t._("::date:: from ::startHour:: to ::endHour::", {
Expand Down Expand Up @@ -194,7 +194,7 @@ class Cron extends Controller {
var vacantVolunteerRolesList = "<ul>"
+ Lambda.map(multidistrib.getVacantVolunteerRoles(), function(r) return "<li>" + r.name + "</li>").join("\n")
+ "</ul>";
mail.setSubject("Besoin de volontaires pour la distribution du " + view.hDate(multidistrib.distribStartDate, true));
mail.setSubject("Besoin de volontaires pour la distribution du " + Formatting.hDate(multidistrib.distribStartDate, true));

// Let's replace all the tokens
var ddate = view.dDate(multidistrib.distribStartDate) + " de " + view.hHour(multidistrib.distribStartDate) + " à "
Expand Down Expand Up @@ -595,7 +595,7 @@ class Cron extends Controller {
m.addRecipient(u.user.email, u.user.getName());
if (u.user.email2 != null)
m.addRecipient(u.user.email2);
m.setSubject(t._("Distribution on ::date::", {date: app.view.hDate(u.distrib.distribStartDate, true)}));
m.setSubject(t._("Distribution on ::date::", {date: Formatting.hDate(u.distrib.distribStartDate, true)}));
m.setHtmlBody(app.processTemplate("mail/orderNotif.mtt", {
text: text,
group: group,
Expand Down Expand Up @@ -686,7 +686,7 @@ class Cron extends Controller {
m.addRecipient(user.email, user.getName());
if (user.email2 != null)
m.addRecipient(user.email2);
m.setSubject(t._("Distribution on ::date::", {date: app.view.hDate(md.distribStartDate, true)}));
m.setSubject(t._("Distribution on ::date::", {date: Formatting.hDate(md.distribStartDate, true)}));

m.setHtmlBody(app.processTemplate("mail/orderNotif.mtt", {
text: text,
Expand Down
2 changes: 1 addition & 1 deletion src/service/VolunteerService.hx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class VolunteerService
}
}
}
var date = App.current.view.hDate(multidistrib.distribStartDate, true);
var date = Formatting.hDate(multidistrib.distribStartDate, true);
var subject = t._( "A role has been left for ::date:: distribution",{date:date});
mail.setSubject( subject );
var html = App.current.processTemplate("mail/volunteerUnsuscribed.mtt", { fullname : user.getName(), role : role.name, reason : reason, group: multidistrib.group } );
Expand Down
Loading