# HG changeset patch # User Matti Hamalainen # Date 1386221052 -7200 # Node ID 8b8b0a83233bac35c61ae89903b03e1b951962a0 # Parent 357b81e39ab34a2d4ef064744c73a01530e35239 Add compo entry show position buttons to individual compos. diff -r 357b81e39ab3 -r 8b8b0a83233b admajax.php --- a/admajax.php Wed Dec 04 19:52:23 2013 +0200 +++ b/admajax.php Thu Dec 05 07:24:12 2013 +0200 @@ -380,12 +380,16 @@ $showMode = stGetDisplayVar("showMode"); echo "
\n". + "
\n". "Active mode:\n". stGetShowModeButton(SMODE_ROTATE, "Slide rotation", $showMode)."\n". stGetShowModeButton(SMODE_COMPO, "Compo mode", $showMode)."\n". stGetFormButtonInput("syscheck", "", "", " Perform system check ", "performSystemCheck()")."\n". stGetFormButtonInput("generate", "", "", " Add missing show positions ", "generateEntryPositions(0, 1)")."\n". - stGetFormButtonInput("regenerate", "", "", " ReGenerate show positions ", "generateEntryPositions(0, 0)")."\n". + stGetFormButtonInput("regenerate", "", "", " ReGenerate ALL show positions ", "generateEntryPositions(0, 0)")."\n". + "
\n". + "
\n". + "
\n". "
\n"; break; @@ -655,7 +659,16 @@ $prefix = "ne"; echo "

#".$id." - ".chentities($compo["name"]). - " (".$nentries." entries)

\n". + " (".$nentries." entries)\n"; + + if ($nentries > 0) + { + echo + stGetFormButtonInput("generate", "", "", " Add missing show positions ", "generateEntryPositions(".$id.", 1)")."\n". + stGetFormButtonInput("regenerate", "", "", " ReGenerate show positions ", "generateEntryPositions(".$id.", 0)")."\n"; + } + + echo "
\n". " \n". " \n". diff -r 357b81e39ab3 -r 8b8b0a83233b admin.php --- a/admin.php Wed Dec 04 19:52:23 2013 +0200 +++ b/admin.php Thu Dec 05 07:24:12 2013 +0200 @@ -475,16 +475,25 @@ function generateEntryPositions(id, patch) { + var msuccess = function (data) + { + refreshDispatchCM(id); + } + var mcb_ok = function (data) { if (id == 0) jsSendPOSTRequest("action=randomize&type=all&patch="+patch); else - jsSendPOSTRequest("action=randomize&type=compo&id="+id+"&patch="+patch); + jsSendPOSTRequest("action=randomize&type=compo&id="+id+"&patch="+patch, msuccess); } if (patch == 0) - jsConfirmBox("Are you _sure_ you want to delete and regenerate entry show positions? This will completely annihilate all current show positions!", mcb_ok, 0, 0); + { + jsConfirmBox("Are you sure you want to delete and regenerate entry show positions "+ + (id == 0 ? "for ALL compos" : "for this compo") +"? "+ + "This will completely annihilate current show position numbers!", mcb_ok, 0, 0); + } else mcb_ok(0); }