From e5969ab4be3b0ade7962c31a1ecf9883f6b35087 Mon Sep 17 00:00:00 2001 From: James Moon Date: Wed, 4 May 2011 15:44:10 -0700 Subject: [PATCH] CC-2232:Automatically fill in show name Notes: 1. Not sure if "Untitled Show 1" would be the best name. What if "Untilted Show 1" already exist? There is no easy way of keeping track of the numbers. So wouldn't it be better to just use "Untitled Show"? 2. There is no easy way to figure out if the current form is opened for "update" or "add".( We can check the text on the button if it says "add" or "update" button, but it's always bad to rely on any UI text. So the new code will focus and higlight name text on both update and create new case for now. --- airtime_mvc/application/forms/AddShowWhat.php | 3 ++- .../public/js/airtime/schedule/full-calendar-functions.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowWhat.php b/airtime_mvc/application/forms/AddShowWhat.php index b3e78d192..482c522dd 100644 --- a/airtime_mvc/application/forms/AddShowWhat.php +++ b/airtime_mvc/application/forms/AddShowWhat.php @@ -17,7 +17,8 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm 'class' => 'input_text', 'required' => true, 'filters' => array('StringTrim'), - 'validators' => array('NotEmpty') + 'validators' => array('NotEmpty'), + 'value' => 'Untitled Show 1' )); // Add URL element diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index 5330bc693..3eaaaa13f 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -18,7 +18,11 @@ function openAddShowForm() { $("#schedule_calendar").width(y-z-50); $("#schedule_calendar").fullCalendar('render'); } - $("#schedule-show-what").show(); + $("#schedule-show-what").show(0, function(){ + $add_show_name = $("#add_show_name"); + $add_show_name.focus(); + $add_show_name.select(); + }); } }