From 6d5febe4f708df836513d9feadd198b173e9398c Mon Sep 17 00:00:00 2001 From: Naomi Date: Tue, 20 Aug 2013 15:18:05 -0400 Subject: [PATCH] getting rid of characters from a field name that may cause problems. --- .../application/controllers/PlayouthistoryController.php | 1 - .../js/airtime/playouthistory/configuretemplate.js | 3 +-- .../public/js/airtime/playouthistory/historytable.js | 9 +++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/controllers/PlayouthistoryController.php b/airtime_mvc/application/controllers/PlayouthistoryController.php index 7f3bc0f6d..6427b9acc 100644 --- a/airtime_mvc/application/controllers/PlayouthistoryController.php +++ b/airtime_mvc/application/controllers/PlayouthistoryController.php @@ -125,7 +125,6 @@ class PlayouthistoryController extends Zend_Controller_Action $endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC")); $historyService = new Application_Service_HistoryService(); - //$r = $historyService->getListView($startsDT, $endsDT, $params); $r = $historyService->getPlayedItemData($startsDT, $endsDT, $params); $this->view->sEcho = $r["sEcho"]; diff --git a/airtime_mvc/public/js/airtime/playouthistory/configuretemplate.js b/airtime_mvc/public/js/airtime/playouthistory/configuretemplate.js index 8f54c9879..50223732f 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/configuretemplate.js +++ b/airtime_mvc/public/js/airtime/playouthistory/configuretemplate.js @@ -90,8 +90,7 @@ var AIRTIME = (function(AIRTIME) { label = $div.find("input").val(), name; - name = label.replace(" ", ""); - name = name.toLowerCase(); + name = label.toLowerCase().replace(/[^a-z0-9]+/g, ""); var config = { name: name, diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js index f8bf2cb9b..ea209976e 100644 --- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js +++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js @@ -485,12 +485,13 @@ var AIRTIME = (function(AIRTIME) { build: function($el, e) { var items = {}, callback, - $tr; + $tr, + editUrl, + deleteUrl; $tr = $el.parents("tr"); - - var editUrl = $tr.data("url-edit"); - var deleteUrl = $tr.data("url-delete"); + editUrl = $tr.data("url-edit"); + deleteUrl = $tr.data("url-delete"); if (editUrl !== undefined) {