From: Kilian Saffran Date: Tue, 20 Aug 2019 10:14:27 +0000 (+0200) Subject: mail and other bugfixes X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=cc54967977aa087b284bd47c4774ee7465825156;p=juridig_lu.git mail and other bugfixes --- diff --git a/backoffice/api/lib/sendemail.pm b/backoffice/api/lib/sendemail.pm index b4249ea..7695a0a 100644 --- a/backoffice/api/lib/sendemail.pm +++ b/backoffice/api/lib/sendemail.pm @@ -77,13 +77,19 @@ sub sendemail(){ my $f = dirname($ENV{SCRIPT_FILENAME}).'/tmp/mailbody_'.$sendto.'.txt'; $f =~ s/\@/_/g; - + my $binsemail = dirname($ENV{'SCRIPT_FILENAME'}).'/sendEmail'; + if (! -e $binsemail){ + $binsemail = dirname($ENV{'SCRIPT_FILENAME'}).'/api/sendEmail'; + if (! -e $binsemail){ + return 256; + } + } - my $cmd= 'perl "'.dirname($ENV{'SCRIPT_FILENAME'}).'/sendEmail" -f '.$tmpl->{mailfrom}.' '; + my $cmd= 'perl "'.$binsemail.'" -f '.$tmpl->{mailfrom}.' '; $cmd .= ' -s "'.$self->{server}.':'.$self->{port}.'" -xu "'.$self->{user}.'" -xp "'.$self->{password}.'" -q '; $cmd .= '-o tls=auto '; $cmd .= '-o message-content-type=html '; - $cmd .= '-o message-charset=utf-8 '; + $cmd .= '-o message-charset=ISO-8859-1 '; $cmd .= '-o message-file='.$f.' '; $cmd .= '-t "'.$sendto.'" '; $cmd .= '-u "'.$subject.'" '; diff --git a/backoffice/api/process.cgi b/backoffice/api/process.cgi index 79eae36..1f8f0b1 100644 --- a/backoffice/api/process.cgi +++ b/backoffice/api/process.cgi @@ -321,7 +321,7 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ elsif($p->{fn} eq "getbilljeeeditor"){ my $sqlins = "INSERT INTO billjeebooking (id_billjeeticket, id_user, bookingtime) VALUES(".$p->{id}.", ".$sess->{id}.", now());"; $db->dbexec($sqlins); - my $sql = "select bt.court,bt.room,to_char(bt.eventdate,'DD.MM.YYYY') as dspdate,eventtype,case when eventtype ='offer' then 'offre' else 'demande' end as dspeventtype,bt.dayperiod,bj.senderemail as recipient from billjeetickets bt join billjee bj on (bt.id_user=bj.id_user and bt.id=".$p->{id}.")"; + my $sql = "select bt.court,bt.room,to_char(bt.eventdate,'DD.MM.YYYY') as dspdate,eventtype,case when eventtype ='offer' then 'offre ded disponibilité' else 'demande de lecture' end as dspeventtype,substring(bt.starttime::TEXT,1,5) as starttime,bj.senderemail as recipient from billjeetickets bt join billjee bj on (bt.id_user=bj.id_user and bt.id=".$p->{id}.")"; my $res = $db->dbquerysorted($sql); if (exists($res->{0})){ $sql = "select msg".$res->{0}->{eventtype}." as bodymsg from billjee where id_user=".$sess->{id}.";"; diff --git a/backoffice/images/.DS_Store b/backoffice/images/.DS_Store deleted file mode 100644 index 2e29f02..0000000 Binary files a/backoffice/images/.DS_Store and /dev/null differ diff --git a/backoffice/index.cgi b/backoffice/index.cgi index c0a53b6..07492d1 100644 --- a/backoffice/index.cgi +++ b/backoffice/index.cgi @@ -170,7 +170,7 @@ if ($skl ne "skeleton/login.tt" && $vars->{page} =~ /^module/){ $template->process($skl,$vars) || die "Template process failed: ", $template->error(), "\n"; -# print "/*".Dumper($vars)."*/"; +#print "/*".Dumper($vars)."*/"; diff --git a/backoffice/tmpl/block/calendar.tt b/backoffice/tmpl/block/calendar.tt index e52e8b8..143797a 100644 --- a/backoffice/tmpl/block/calendar.tt +++ b/backoffice/tmpl/block/calendar.tt @@ -1,3 +1,4 @@ +
sélectionnez un jour, une semaine ou un mois pour visualiser les billets
diff --git a/backoffice/tmpl/block/dlgcontactpublisher.tt b/backoffice/tmpl/block/dlgcontactpublisher.tt index b39dc05..56f6fc0 100644 --- a/backoffice/tmpl/block/dlgcontactpublisher.tt +++ b/backoffice/tmpl/block/dlgcontactpublisher.tt @@ -45,7 +45,7 @@ function save_contact_event(){ function open_mail(data){ if ((data) && (data.contact)){ var ct = data.contact; - var subject= "Concerne juridig.lu "+ct.dspeventtype+": " + ct.dspdate + ' ' + ct.dayperiod + ' - ' + ct.court + ((ct.room)?'(' + ct.room + ')':''); + var subject= "juridig.lu - "+ct.dspeventtype+": " + ct.dspdate + ' ' + ct.starttime + ' - ' + ct.court + ((ct.room)?'(' + ct.room + ')':''); window.location.href="mailto:" + ct.recipient + "?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(ct.bodymsg); }else { diff --git a/backoffice/tmpl/block/dlgdelete.tt b/backoffice/tmpl/block/dlgdelete.tt index 6c0987f..2016fa4 100644 --- a/backoffice/tmpl/block/dlgdelete.tt +++ b/backoffice/tmpl/block/dlgdelete.tt @@ -38,8 +38,12 @@ function send_delete_event(){ function event_deleted(data){ if (data.id){ - document.getElementById('event_' + data.id).remove; + var elem = document.getElementById('event_' + data.id); + elem.parentNode.removeChild(elem); } + return false; } + + \ No newline at end of file diff --git a/backoffice/tmpl/block/toolbar.tt b/backoffice/tmpl/block/toolbar.tt index 3436799..f1cd6b3 100644 --- a/backoffice/tmpl/block/toolbar.tt +++ b/backoffice/tmpl/block/toolbar.tt @@ -2,11 +2,11 @@
diff --git a/backoffice/tmpl/block/topbar.tt b/backoffice/tmpl/block/topbar.tt index e0fcf6c..6327ff0 100644 --- a/backoffice/tmpl/block/topbar.tt +++ b/backoffice/tmpl/block/topbar.tt @@ -14,7 +14,7 @@
'; + card += '

'; res.innerHTML = res.innerHTML + card; } diff --git a/backoffice/tmpl/module/billjee/mybookings.js b/backoffice/tmpl/module/billjee/mybookings.js index 3a6395b..6d5012c 100644 --- a/backoffice/tmpl/module/billjee/mybookings.js +++ b/backoffice/tmpl/module/billjee/mybookings.js @@ -11,7 +11,7 @@ var onlyfuture = false; // "ta-luxembourg":"tribunal d'arrondissement - Luxembourg", // "ta-diekirch":"tribunal d'arrondissement - Diekirch" // } -parent.backoffice.settitle('Mes envois'); +parent.backoffice.settitle('Mes envois
(mes demandes de contact)'); parent.backoffice.setPreference('lastpage','module/[% module %]/mybookings.html'); function initpage(){ loadcalendars(); @@ -34,31 +34,20 @@ function display_results(data){ var card = '
'; card += '

' + data.events[i].dspdate + ' - ' + data.events[i].starttime + ' - ' + data.events[i].court + ' - ' + data.events[i].room +'

'+ - '
' + ((data.events[i].eventtype == 'offer')?'Offre de disponibilité':'Demande de service') + ((data.events[i].id_user != userid)?' de ' + data.events[i].surname + ' ' + data.events[i].prename:'') + '
'+'
'; + '
' + ((data.events[i].eventtype == 'offer')?'Offre de disponibilité - Présence de ':'Demande lecture de billet de ') + data.events[i].surname + ' ' + data.events[i].prename + '
'+'
'; card += '
' + data.events[i].msg + '
'; card += ''; if (data.events[i].bookings){ var bibok = JSON.parse(data.events[i].bookings); card += '
' - card += '

Propose marquée dans juridig.lu le

'; + card += '
'; } diff --git a/backoffice/tmpl/module/billjee/mytickets.js b/backoffice/tmpl/module/billjee/mytickets.js index ca4cdcc..08372ce 100644 --- a/backoffice/tmpl/module/billjee/mytickets.js +++ b/backoffice/tmpl/module/billjee/mytickets.js @@ -34,7 +34,7 @@ function display_results(data){ var card = '
'; card += '

' + data.events[i].dspdate + ' - ' + data.events[i].starttime + ' - ' + data.events[i].court + ' - ' + data.events[i].room +'

'+ - '
' + ((data.events[i].eventtype == 'offer')?'Offre de disponibilité':'Demande de service') + ((data.events[i].id_user != userid)?' de ' + data.events[i].surname + ' ' + data.events[i].prename:'') + '
'+'
'; + '
' + ((data.events[i].eventtype == 'offer')?'Offre de disponibilité - Présence de ':'Demande lecture de billet de ') + data.events[i].surname + ' ' + data.events[i].prename + '
'+'
'; card += '
' + data.events[i].msg + '
'; card += '