diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index 07d4fb684..7eab349a0 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -196,6 +196,8 @@ class Application_Model_ShowBuilder { $row = $this->defaultRowArray; $row["footer"] = true; + $row["instance"] = intval($p_item["si_id"]); + $this->getRowTimestamp($p_item, $row); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); $contentDT = $this->contentDT; diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index d0839d14b..22c108026 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -515,14 +515,18 @@ var AIRTIME = (function(AIRTIME){ var prev = ui.item.prev(); //can't add items outside of shows. - if (prev.hasClass("sb-footer") - || prev.find("td:first").hasClass("dataTables_empty") + if (prev.find("td:first").hasClass("dataTables_empty") || prev.length === 0) { alert("Cannot schedule outside a show."); ui.item.remove(); return; } + //if item is added after a footer, add the item after the last item in the show. + if (prev.hasClass("sb-footer")) { + prev = prev.prev(); + } + aItemData = []; oPrevData = prev.data("aData");