diff --git a/feca_mailshots_plugin/src/Admin/DownloadPdfAdminPage.php b/feca_mailshots_plugin/src/Admin/DownloadPdfAdminPage.php index ae3bf41..edcfe6f 100644 --- a/feca_mailshots_plugin/src/Admin/DownloadPdfAdminPage.php +++ b/feca_mailshots_plugin/src/Admin/DownloadPdfAdminPage.php @@ -112,6 +112,13 @@ final class DownloadPdfAdminPage echo 'var zip=document.getElementById("feca-download-zip-btn");'; echo 'var progress=document.getElementById("feca-download-progress");'; echo 'var shadow=document.getElementById("feca-download-format-shadow");'; + echo 'var mailshotSelect=document.getElementById("dp_mailshot_id");'; + echo 'var selectedKey="fecaMailshotsSelectedMailshotId";'; + echo 'function hasOption(value){if(!mailshotSelect){return false;}for(var i=0;i'; echo ''; echo ''; - echo ''; + echo ''; echo ''; if (!empty($preview['errors'])) { diff --git a/feca_mailshots_plugin/src/Admin/ReviewRecipientsAdminPage.php b/feca_mailshots_plugin/src/Admin/ReviewRecipientsAdminPage.php index cb0dffb..0029d76 100644 --- a/feca_mailshots_plugin/src/Admin/ReviewRecipientsAdminPage.php +++ b/feca_mailshots_plugin/src/Admin/ReviewRecipientsAdminPage.php @@ -116,6 +116,7 @@ var headRow=document.getElementById("rr_head_row"); var bodyEl=document.getElementById("rr_body"); var loadMoreBtn=document.getElementById("rr_load_more"); var storagePrefix="fecaReviewRecipientsSelection::"; +var selectedSourceStorageKey="fecaReviewRecipientsSelectedSource"; var state={source:"",filter:"",sortBy:"",sortDirection:"asc",selectedKeys:{},rows:[],columns:[],count:0,offset:0,hasMore:false,loading:false,errors:[]}; function text(v){if(v===null||v===undefined){return "";}if(typeof v==="string"){return v;}if(typeof v==="number"||typeof v==="boolean"){return String(v);}try{return JSON.stringify(v);}catch(_){return String(v);}} function clearErr(){errEl.classList.add("feca-hidden");errEl.textContent="";} @@ -123,6 +124,9 @@ function showErr(msg){errEl.classList.remove("feca-hidden");errEl.textContent=ms function status(msg){statusEl.textContent=msg||"";} function setColumnWidths(cols){var widthPx=170;var c="";for(var i=0;i";}colsEl.innerHTML=c;} function sourceStorageKey(src){return storagePrefix+String(src||"");} +function sourceExists(src){if(!src){return false;}var opts=sourceSel?sourceSel.options:[];for(var i=0;i'; diff --git a/feca_mailshots_plugin/src/Admin/RunMailshotAdminPage.php b/feca_mailshots_plugin/src/Admin/RunMailshotAdminPage.php index 49ac12a..aa0721a 100644 --- a/feca_mailshots_plugin/src/Admin/RunMailshotAdminPage.php +++ b/feca_mailshots_plugin/src/Admin/RunMailshotAdminPage.php @@ -126,7 +126,7 @@ final class RunMailshotAdminPage echo '
'; echo '
'; echo ''; - echo ''; foreach ($mailshots as $m) { $id = (int) ($m['id'] ?? 0); $sel = $id === $selectedMailshotId ? ' selected' : ''; @@ -138,6 +138,16 @@ final class RunMailshotAdminPage } echo '
'; echo ''; + echo ''; if (!empty($recipientSummary['ok'])) { echo '

Recipient rows: ' . (int) ($recipientSummary['count'] ?? 0) . '

'; } elseif (!empty($recipientSummary['errors']) && is_array($recipientSummary['errors'])) {