From bknr@bknr.net Thu Aug 30 05:29:35 2007 From: bknr@bknr.net To: bknr-cvs@common-lisp.net Subject: [bknr-cvs] r2171 - in trunk/projects/bos: m2 payment-website/templates/da payment-website/templates/de Date: Thu, 30 Aug 2007 05:29:35 -0400 Message-ID: <20070830092935.B49103C07A@common-lisp.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3668093136005065012==" --===============3668093136005065012== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Author: hhubner Date: 2007-08-30 05:29:34 -0400 (Thu, 30 Aug 2007) New Revision: 2171 Modified: trunk/projects/bos/m2/mail-generator.lisp trunk/projects/bos/payment-website/templates/da/ueberweisung.xml trunk/projects/bos/payment-website/templates/de/ueberweisung.xml Log: Unify XML formatted sponsor records. Modified: trunk/projects/bos/m2/mail-generator.lisp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/projects/bos/m2/mail-generator.lisp 2007-08-30 06:08:39 UTC (rev 21= 70) +++ trunk/projects/bos/m2/mail-generator.lisp 2007-08-30 09:29:34 UTC (rev 21= 71) @@ -27,8 +27,8 @@ text))) =20 (defun mail-info-request (email) - (send-system-mail :subject "Mailinglisten-Eintrag" - :text #?"Bitte in die Info-Mailingliste aufnehmen: + (send-system-mail :subject "Mailing list request" + :text #?"Please enter into the mailing list: =20 =20 $(email) @@ -158,6 +158,20 @@ :encoding :quoted-printable :content string)) =20 +(defparameter *common-element-names* + '(("MC_donationcert-yearly" "donationcert-yearly") + ("MC_sponsorid" "sponsor-id") + ("countryString" "country") + ("postcode" "plz") + ("MC_gift" "gift") + ("cartId" "contract-id"))) + +(defun lookup-element-name (element-name) + "Given an ELEMENT-NAME (which may be either a form field name or a name of= a post parameter from +worldpay), return the common XML element name" + (or (cdr (find element-name *common-element-names* :key #'car :test #'equa= l)) + element-name)) + (defun make-contract-xml-part (id params) (make-instance 'text-mime :type "text" @@ -169,13 +183,16 @@ ~{<~A>~A~A>~} " - (apply #'append (mapcar #'(lambda (cons) - (list (car cons) - (if (find #\Newline (cdr cons)) - (format nil "" (cdr cons)) - (cdr cons)) - (car cons))) - params))))) + (apply #'append + (mapcar #'(lambda (cons) + (destructuring-bind (element-name content) cons + (setf element-name (lookup-element-name element-name)) + (list element-name + (if (find #\Newline content) + (format nil "" content) + content) + element-name))) + params))))) =20 (defun make-vcard-part (id vcard) (make-instance 'text-mime @@ -194,7 +211,7 @@ :encoding :base64 :content (file-contents (contract-pdf-pathname contract :print t= ))))))) (send-system-mail :to (contract-office-email contract) - :subject (format nil "~A-Spenderdaten - Sponsor-ID ~D Contract-ID ~D" + :subject (format nil "~A-Sponsor data - Sponsor-ID ~D Contract-ID ~D" type (store-object-id (contract-sponsor contract)) (store-object-id contract)) @@ -214,12 +231,12 @@ (let ((parts (list (make-html-part (format nil "
-Contract-ID | ~@[~A~] |
Anzahl sqm | ~A |
Number of sqm | ~A |
Name | ~@[~A~] |
Adresse | ~@[~A~] |
Adress | ~@[~A~] |
~@[~A~] |
Contract-ID | ~@[~A~] |
Anzahl sqm | ~A |
Vorname | ~@[~A~] |
Name | ~@[~A~] |
Strasse | ~@[~A~] |
PLZ | ~@[~A~] |
Ort | ~@[~A~] |
Number of sqm | ~A |
Amount | EUR~A |
First name | ~@[~A~] |
Last name | ~@[~A~] |
Street | ~@[~A~] |
Postcode | ~@[~A~] |
City | ~@[~A~] |
~@[~A~] | |
Telefon | ~@[~A~] |
Phone | ~@[~A~] |
Spendenbescheinigung am Jahresende | ~A |
Donation receipt at year's end | ~A |
Zahlungseingang best= =C3=A4tigen
+Acknowledge receipt o= f payment
" contract-id (length (contract-m2s contract)) + (* 3.0 (length (contract-m2s contract))) vorname name strasse plz ort email telefon (if donationcert-yearly "ja" "nein") *website-url* contract-id email)) Modified: trunk/projects/bos/payment-website/templates/da/ueberweisung.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/projects/bos/payment-website/templates/da/ueberweisung.xml 2007-08-= 30 06:08:39 UTC (rev 2170) +++ trunk/projects/bos/payment-website/templates/da/ueberweisung.xml 2007-08-= 30 09:29:34 UTC (rev 2171) @@ -43,6 +43,9 @@ onsubmit=3D"YY_checkform('mailtransfer','vorname','#q','0','Anuller ve= nligst dette felt \'Fornavn\'.','name','#q','0','Anuller venligst dette felt = \'Efternavn\'.','strasse','#q','0','Anuller venligst dette felt \'Gade/Nr.\'.= ','plz','#q','0','Anuller venligst dette felt \'Postnummer\'.','ort','#q','0'= ,'Anuller venligst dette felt \'Kommune\'.');return document.MM_returnValue"> + + +