diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index 650734e2d..07c6d4290 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -221,6 +221,7 @@ class Application_Model_ShowBuilder { $row["title"] = $p_item["show_name"]; $row["instance"] = intval($p_item["si_id"]); $row["image"] = ''; + $row["id"] = -1; $this->getScheduledStatus($startsEpoch, $endsEpoch, $row); @@ -310,6 +311,7 @@ class Application_Model_ShowBuilder { $row = $this->defaultRowArray; $row["footer"] = true; $row["instance"] = intval($p_item["si_id"]); + $row["id"] = -1; $this->getRowTimestamp($p_item, $row); $showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC")); diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index b5ed74369..434a34d02 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -11,6 +11,7 @@ var AIRTIME = (function(AIRTIME){ $lib, cursors = [], cursorIds = []; + showInstanceIds = []; if (AIRTIME.showbuilder === undefined) { AIRTIME.showbuilder = {}; @@ -212,9 +213,15 @@ var AIRTIME = (function(AIRTIME){ checkError(json); cursorIds = []; + /* We need to keep record of which show the cursor belongs to + * in the case where more than one show is displayed in the show builder + * because header and footer rows have the same id + */ + showInstanceIds = []; cursors = $(".cursor-selected-row"); for (i = 0; i < cursors.length; i++) { cursorIds.push(($(cursors.get(i)).attr("id"))); + showInstanceIds.push(($(cursors.get(i)).attr("si_id"))); } oSchedTable.fnDraw(); @@ -588,6 +595,7 @@ var AIRTIME = (function(AIRTIME){ else { $nRow.addClass("sb-allowed"); $nRow.attr("id", aData.id); + $nRow.attr("si_id", aData.instance); } //status used to colour tracks. @@ -670,7 +678,7 @@ var AIRTIME = (function(AIRTIME){ //re-highlight selected cursors before draw took place for (i = 0; i < cursorIds.length; i++) { - $tr = $table.find("tr[id="+cursorIds[i]+"]"); + $tr = $table.find("tr[id="+cursorIds[i]+"][si_id="+showInstanceIds[i]+"]"); mod.selectCursor($tr); }