From 805a2fa265d366fcbaf2bc03de55b7a19c9e1425 Mon Sep 17 00:00:00 2001 From: Nikola Petrov Date: Wed, 6 May 2026 23:30:00 +0200 Subject: [PATCH] mcmahon WIP --- go-form-plugin/export/mcmahon-help.php | 2215 ++++++++++++++++++++++++ go-form-plugin/export/mcmahon.php | 47 +- go-form-plugin/export/opengotha.php | 1 - 3 files changed, 2245 insertions(+), 18 deletions(-) create mode 100644 go-form-plugin/export/mcmahon-help.php diff --git a/go-form-plugin/export/mcmahon-help.php b/go-form-plugin/export/mcmahon-help.php new file mode 100644 index 0000000..be453f7 --- /dev/null +++ b/go-form-plugin/export/mcmahon-help.php @@ -0,0 +1,2215 @@ + + + 5 + 1 + false + false + false + 2050 + false + false + false + 35k + false + 9d + 0 + false + false + true + false + true + false + true + true + 1d + false + true + -2 + true + 9 + true + false + 19 + true + true + true + true + true + false + false + true + 12 + 205 + 205 + UTF-8 + + true + UTF-8 + MacMahon 3.10 + MacMahon 3.10 + true + false + false + true + 0 + true + + SOS + + false + 2 + true + true + false + true + 3 + true + true + false + SansSerif + 9 + 0 + 0 + 2 + true + 28 + SansSerif + 10 + 0 + 0 + 3 + true + 35 + + true + true + false + true + true + false + true + true + true + true + false + true + true + 12 + 205 + 0 + true + 1 + + ScoreX + + + SOS + + + SOSOS + + + + ac + Ascension Island + + + ad + Andorra + + + ae + United Arab Emirates + + + af + Afghanistan + + + ag + Antigua and Barbuda + + + ai + Anguilla + + + al + Albania + + + am + Armenia + + + an + Netherlands Antilles + + + ao + Angola + + + aq + Antarctica + + + ar + Argentina + + + as + American Samoa + + + at + Austria + + + au + Australia + + + aw + Aruba + + + ax + Åland + + + az + Azerbaijan + + + ba + Bosnia and Herzegovina + + + bb + Barbados + + + bd + Bangladesh + + + be + Belgium + + + bf + Burkina Faso + + + bg + Bulgaria + + + bh + Bahrain + + + bi + Burundi + + + bj + Benin + + + bm + Bermuda + + + bn + Brunei Darussalam + + + bo + Bolivia + + + br + Brazil + + + bs + Bahamas + + + bt + Bhutan + + + bv + Bouvet Island + + + bw + Botswana + + + by + Belarus + + + bz + Belize + + + ca + Canada + + + cc + Cocos (Keeling) Islands + + + cd + Democratic Republic of the Congo + + + cf + Central African Republic + + + cg + Republic of the Congo + + + ch + Switzerland + + + ci + Côte d\'Ivoire + + + ck + Cook Islands + + + cl + Chile + + + cm + Cameroon + + + cn + People\'s Republic of China + + + co + Colombia + + + cr + Costa Rica + + + cs + Czechoslovakia + + + cu + Cuba + + + cv + Cape Verde + + + cx + Christmas Island + + + cy + Cyprus + + + cz + Czech Republic + + + de + Germany + + Aachen + AC + + + Altenkirchen (Westerwald) + AK + + + Aschaffenburg + AB + + + Augsburg + A + + + Bad Doberan + DBR + + + Bad Kreuznach + KH + + + Bad Segeberg + SE + + + Bautzen + BZ + + + Bayreuth + BT + + + Bergheim/Rhein-Erft-Kreis + BM + + + Bergisch Gladbach/Rheinisch-Bergischer Kreis + GL + + + Berlin + B + + + Bielefeld + BI + + + Böblingen + BB + + + Bochum + BO + + + Bonn + BN + + + Borken + BOR + + + Bottrop + Bot + + + Braunschweig + BS + + + Bremen/Bremerhaven + HB + + + Castrop-Rauxel + CAS + + + Chemnitz + C + + + Clausthal-Zellerfeld + CLZ + + + Coburg + CO + + + Cottbus + CB + + + Darmstadt + DA + + + Detmold + DT + + + Diepholz + DH + + + Dingolfing-Landau + DGF + + + Dinslaken + DIN + + + Dippoldiswalde/Weißeritzkreis + DW + + + Döbeln (Landkreis) + DL + + + Donau-Ries + DON + + + Dortmund + DO + + + Dresden + DD + + + Duisburg + DU + + + Düren + DN + + + Düsseldorf + D + + + Ebersberg + EBE + + + Eisenach + EA + + + Eisenhüttenstadt + EH + + + Emden + EMD + + + Erding + ED + + + Erlangen + ER + + + Essen + E + + + Euskirchen + EU + + + Flensburg + FL + + + Forchheim + FO + + + Frankfurt + F + + + Frankfurt (Oder) + FF + + + Freiburg/Breisgau-Hochschwarzwald + FR + + + Freudenstadt + FDS + + + Friedberg/Wetteraukreis + FB + + + Friedrichshafen/Bodenseekreis + FN + + + Fulda + FD + + + Fürstenfeldbruck + FFB + + + Gelsenkirchen + GE + + + Gießen + GI + + + Gifhorn + GF + + + Göppingen + GP + + + Göttingen + GOE + + + Greifswald + HGW + + + Greiz + GRZ + + + Gummersbach/Oberbergischer Kreis + GM + + + Gütersloh + GT + + + Hagen (Westfalen) + HA + + + Hamburg + HH + + + Hameln-Pyrmont + HM + + + Hanau + HU + + + Hannover + H + + + Heidelberg/Rhein-Neckar-Kreis + HD + + + Heilbronn (Neckar) + HN + + + Helmstedt + HE + + + Heppenheim (Bergstraße) + HP + + + Herford + HF + + + Hildesheim + HI + + + Höxter + HX + + + Ilmenau + IL + + + Itzehoe + IZ + + + Jena + J + + + Kaiserslautern + KL + + + Kamenz + KM + + + Karlsruhe + KA + + + Kassel + KS + + + Kaufbeuren + KF + + + Kiel + KI + + + Koblenz + KO + + + Köln + K + + + Konstanz + KN + + + Korbach/Waldeck-Frankenberg + KB + + + Krefeld + KR + + + Landau + LD + + + Landkreis Dahme-Spreewald + LDS + + + Landkreis Mansfeld-Südharz + MSH + + + Landkreis Oder-Spree + LOS + + + Landshut + LA + + + Langerwehe + LGW + + + Leer + LER + + + Leipzig + L + + + Lemgo + LE + + + Leverkusen + LEV + + + Lippstadt + LP + + + Löbau + LOEB + + + Lübeck + HL + + + Ludwigsburg + LB + + + Ludwigshafen (Rhein) + LU + + + Lüneburg + LG + + + Magdeburg + MD + + + Mainz + MZ + + + Mannheim + MA + + + Marburg (Lahn) + MR + + + Meerbusch + MEE + + + Meschede/Hochsauerlandkreis + HSK + + + Mettmann + ME + + + Mittweida + MW + + + Mönchengladbach + MG + + + München + M + + + Münster + MS + + + Neubrandenburg + NB + + + Neunkirchen (Saarland) + NK + + + Nienburg + NI + + + Nordhausen + NDH + + + Nürnberg + N + + + Nürtingen + NT + + + Oberhausen + OB + + + Offenbach + OF + + + Oldenburg + OL + + + Olpe + OE + + + Osnabrück + OS + + + Paderborn + PB + + + Passau + PA + + + Peine + PE + + + Pforzheim + PF + + + Pinneberg + PI + + + Potsdam + P + + + Rathenow/Havelland + HVL + + + Ratingen + RAT + + + Recklinghausen + RE + + + Rendsburg-Eckernförde + RD + + + Reutlingen + RT + + + Rosenheim + RO + + + Rostock + HRO + + + Roth (Rednitz) + RH + + + Saalfeld + SLF + + + Saarbrücken + SB + + + Saarlouis + SLS + + + Salzgitter + SZ + + + Schaumburg/Stadthagen + SHG + + + Schleiz + SCZ + + + Schleswig + SL + + + Schwäbisch Gmünd + GD + + + Schwedt (Oder) + SDT + + + Schweinfurt + SW + + + Schwerin + SN + + + Siegburg + SU + + + Siegen + SI + + + Solingen + SG + + + Soltau-Fallingbostel + SFA + + + Spree-Neiße + SPN + + + Stade + STD + + + Steinfurt + ST + + + Stralsund + HST + + + Stuttgart + S + + + Syke + SY + + + Teltow-Fläming + TF + + + Torgau + TG + + + Trier + TR + + + Uelzen + UE + + + Ulm + UL + + + Unna + UN + + + Wanne-Eickel + WAN + + + Weimar + WE + + + Wiesbaden + WI + + + Wilhelmshaven + WHV + + + Winsen (Luhe) + WL + + + Witten (Ruhr) + WIT + + + Wolfenbüttel + WF + + + Wolfsburg + WOB + + + Worms + WO + + + Wuppertal + W + + + Zittau + ZI + + + + dj + Djibouti + + + dk + Denmark + + + dm + Dominica + + + do + Dominican Republic + + + dz + Algeria + + + ec + Ecuador + + + ee + Estonia + + + eg + Egypt + + + er + Eritrea + + + es + Spain + + Agoca + Agoc + + + Alicante + Ala + + + Alicante + Ali + + + AmaGo + AMaG + + + Barcelona + Bar + + + Barcelona + Barc + + + Bilbao + Bil + + + Bilbao + Bilb + + + Cadiz + Cad + + + Cadiz + Cadi + + + Canarias + CAN + + + Cordoba + Cor + + + Cordoba + Cord + + + Granada + Gra + + + Granada + Gran + + + Huelva + Hue + + + Huelva + Huel + + + Madrid + Mad + + + Madrid + Madr + + + Malaga + Mal + + + Malaga + Mala + + + Murcia + Mur + + + NamBan + Nam + + + NamBan + NamB + + + Pedra + Pedr + + + Sevilla + Sev + + + Sevilla + Sevi + + + Tengen + Ten + + + Tengen + Teng + + + UbicuoKiin + Ubic + + + Zaragoza + Zar + + + + et + Ethiopia + + + eu + European Union + + + fi + Finland + + + fj + Fiji + + + fk + Falkland Islands + + + fm + Federated States of Micronesia + + + fo + Faroe Islands + + + fr + France + + + ga + Gabon + + + gb + United Kingdom + + + gd + Grenada + + + ge + Georgia + + + gf + French Guiana + + + gg + Guernsey + + + gh + Ghana + + + gi + Gibraltar + + + gl + Greenland + + + gm + The Gambia + + + gn + Guinea + + + gp + Guadeloupe + + + gq + Equatorial Guinea + + + gr + Greece + + + gs + South Georgia and the South Sandwich Islands + + + gt + Guatemala + + + gu + Guam + + + gw + Guinea-Bissau + + + gy + Guyana + + + hk + Hong Kong + + + hm + Heard Island and McDonald Islands + + + hn + Honduras + + + hr + Croatia + + + ht + Haiti + + + hu + Hungary + + + id + Indonesia + + + ie + Ireland + + + il + Israel + + + im + Isle of Man + + + in + India + + + io + British Indian Ocean Territory + + + iq + Iraq + + + ir + Iran + + + is + Iceland + + + it + Italy + + Alghero + Algh + + + Bari + Bari + + + Belluno + Bell + + + Biella + Biel + + + Bologna + Bolo + + + Brescia + Bres + + + Caserta + Case + + + Como + Como + + + Faenza + Faen + + + Ferrara + Ferr + + + Firenze + Fire + + + Forlì + Forl + + + Frascati + Fras + + + Gaeta + Gaet + + + Genova + Geno + + + Gorizia + Gori + + + Grosseto + Gros + + + Imola + Imol + + + Imperia + Impe + + + La Spezia + LaSp + + + Livorno + Livo + + + Lodi + Lodi + + + Lucca + Lucc + + + Milano + Mila + + + Modena + Mode + + + Napoli + Napo + + + Novara + Nova + + + Padova + Pado + + + Palermo + Pale + + + Parma + Parm + + + Perugia + Peru + + + Pescara + Pesc + + + Piacenza + Piac + + + Pisa + Pisa + + + Pordenone + Pord + + + Prato + Prat + + + Ravenna + Rave + + + Reggio Emilia + RegE + + + Rimini + Rimi + + + Roma + Roma + + + San Marino + S.Mi + + + Sassari + Sass + + + Savona + Savo + + + Siena + Sien + + + Teramo + Tera + + + Thiene + Thie + + + Torino + Tori + + + Tradate + Trad + + + Trento + Tren + + + Treviso + Trev + + + Trieste + Trie + + + Tuenno + Tuen + + + Udine + Udin + + + Urbino + Urbi + + + Varese + Vare + + + Venezia + Vene + + + Verona + vero + + + Vicenza + Vice + + + Viterbo + Vite + + + + je + Jersey + + + jm + Jamaica + + + jo + Jordan + + + jp + Japan + + + ke + Kenya + + + kg + Kyrgyzstan + + + kh + Cambodia + + + ki + Kiribati + + + km + Comoros + + + kn + Saint Kitts and Nevis + + + kp + Democratic People\'s Republic of Korea + + + kr + Republic of Korea + + + kw + Kuwait + + + ky + Cayman Islands + + + kz + Kazakhstan + + + la + Laos + + + lb + Lebanon + + + lc + Saint Lucia + + + li + Liechtenstein + + + lk + Sri Lanka + + + lr + Liberia + + + ls + Lesotho + + + lt + Lithuania + + + lu + Luxembourg + + + lv + Latvia + + + ly + Libya + + + ma + Morocco + + + mc + Monaco + + + md + Moldova + + + me + Montenegro + + + mg + Madagascar + + + mh + Marshall Islands + + + mk + Republic of Macedonia + + + ml + Mali + + + mm + Myanmar + + + mn + Mongolia + + + mo + Macau + + + mp + Northern Mariana Islands + + + mq + Martinique + + + mr + Mauritania + + + ms + Montserrat + + + mt + Malta + + + mu + Mauritius + + + mv + Maldives + + + mw + Malawi + + + mx + Mexico + + + my + Malaysia + + + mz + Mozambique + + + na + Namibia + + + nc + New Caledonia + + + ne + Niger + + + nf + Norfolk Island + + + ng + Nigeria + + + ni + Nicaragua + + + nl + Netherlands + + + no + Norway + + + np + Nepal + + + nr + Nauru + + + nu + Niue + + + nz + New Zealand + + + om + Oman + + + pa + Panama + + + pe + Peru + + + pf + French Polynesia + + + pg + Papua New Guinea + + + ph + Philippines + + + pk + Pakistan + + + pl + Poland + + + pm + Saint-Pierre and Miquelon + + + pn + Pitcairn Islands + + + pr + Puerto Rico + + + ps + Palestinian territories + + + pt + Portugal + + + pw + Palau + + + py + Paraguay + + + qa + Qatar + + + re + Réunion + + + ro + Romania + + + rs + Serbia + + + ru + Russia + + + rw + Rwanda + + + sa + Saudi Arabia + + + sb + Solomon Islands + + + sc + Seychelles + + + sd + Sudan + + + se + Sweden + + + sg + Singapore + + + sh + Saint Helena + + + si + Slovenia + + Ljub + Ljub + + + + sj + Svalbard and Jan Mayen Islands + + + sk + Slovakia + + + sl + Sierra Leone + + + sm + San Marino + + + sn + Senegal + + + so + Somalia + + + sr + Suriname + + + st + São Tomé and Príncipe + + + su + Soviet Union + + + sv + El Salvador + + + sy + Syria + + + sz + Swaziland + + + tc + Turks and Caicos Islands + + + td + Chad + + + tf + French Southern and Antarctic Lands + + + tg + Togo + + + th + Thailand + + + tj + Tajikistan + + + tk + Tokelau + + + tl + East Timor + + + tm + Turkmenistan + + + tn + Tunisia + + + to + Tonga + + + tp + East Timor + + + tr + Turkey + + + tt + Trinidad and Tobago + + + tv + Tuvalu + + + tw + Republic of China (Taiwan) + + + tz + Tanzania + + + ua + Ukraine + + + ug + Uganda + + + uk + United Kingdom + + + us + United States of America + + + uy + Uruguay + + + uz + Uzbekistan + + + va + Vatican City + + + vc + Saint Vincent and the Grenadines + + + ve + Venezuela + + + vg + British Virgin Islands + + + vi + US Virgin Islands + + + vn + Vietnam + + + vu + Vanuatu + + + wf + Wallis and Futuna + + + ws + Samoa + + + ye + Yemen + + + yt + Mayotte + + + za + South Africa + + + zm + Zambia + + + zw + Zimbabwe + '; + +$mcmahonlast = ' + 1 + 2026-05-06 22:15:42 + + + 2 + 2026-05-06 22:15:42 + + + 3 + 2026-05-06 22:15:42 + + + 4 + 2026-05-06 22:15:42 + + + 5 + 2026-05-06 22:15:42 + + +'; \ No newline at end of file diff --git a/go-form-plugin/export/mcmahon.php b/go-form-plugin/export/mcmahon.php index 09ff11d..ebf3c1c 100644 --- a/go-form-plugin/export/mcmahon.php +++ b/go-form-plugin/export/mcmahon.php @@ -11,26 +11,39 @@ $form = go_form_get_form_by_id($form_id); $form_name = $form ? $form->name : 'Unknown Form'; $entries = go_form_get_entries($form_id); -header('Content-Type: text/csv; charset=utf-8'); -header('Content-Disposition: attachment; filename="go-form-' . sanitize_title($form_name) . '-export.csv"'); +header('Content-Type: text/xml; charset=utf-8'); +header('Content-Disposition: attachment; filename="go-form-' . sanitize_title($form_name) . '-export-macmahon.xml"'); $output = fopen('php://output', 'w'); -fputcsv($output, ['ID', 'First Name', 'Last Name', 'Country', 'Club', 'Rank', 'Email', 'EGD Number', 'Comment', 'Date Added']); +include_once 'mcmahon-help.php'; -foreach ($entries as $e) { - global $ranks; - fputcsv($output, [ - $e->id, - $e->first_name, - $e->last_name, - $e->country, - $e->club, - $ranks[$e->rank] ?? '', - $e->email, - $e->egd_number, - $e->comment, - $e->created_at - ]); +fwrite($output, $mcmahonfirst); + +foreach ($entries as $i => $e) { + $rank = $ranks[$e->rank]; + $id = $e->i + 1; + $egd = $e->egd_number ? $e->egd_number : '0'; + $out = " + $id + false + false + false + 0 + false + + false + first_name]]> + last_name]]> + $rank + $e->rating + $e->egd_number + $e->country + $e->club + + "; + fwrite($output, $out); } +fwrite($output, $mcmahonlast); + fclose($output); \ No newline at end of file diff --git a/go-form-plugin/export/opengotha.php b/go-form-plugin/export/opengotha.php index dd80736..61d7bed 100644 --- a/go-form-plugin/export/opengotha.php +++ b/go-form-plugin/export/opengotha.php @@ -18,7 +18,6 @@ $output = fopen('php://output', 'w'); fwrite($output, ''); -$count = count($entries); foreach ($entries as $i => $e) { $rank = $ranks[$e->rank]; $out = "club\" country=\"$e->country\" egfPin=\"$e->egd_number\" ffgLicence=\"\" ffgLicenceStatus=\"\" firstName=\"$e->first_name\" grade=\"$rank\" name=\"$e->last_name\" participating=\"11111111111111111111\" rank=\"$rank\" rating=\"$e->rating\" ratingOrigin=\"\" registeringStatus=\"PRE\" smmsCorrection=\"0\"/>";