CC-5636: Php 5.5: Cannot update repeating show's name if that instance is updated
Made all show fields readonly when editing a repeating instance
This commit is contained in:
parent
bbccc2e7d3
commit
e8a8aeaf00
5 changed files with 34 additions and 5 deletions
|
@ -72,4 +72,14 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm
|
||||||
|
|
||||||
return $isValid;
|
return $isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function disable()
|
||||||
|
{
|
||||||
|
$elements = $this->getElements();
|
||||||
|
foreach ($elements as $element) {
|
||||||
|
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||||
|
$element->setAttrib('disabled','disabled');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,4 +75,14 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function makeReadonly()
|
||||||
|
{
|
||||||
|
$elements = $this->getElements();
|
||||||
|
foreach ($elements as $element) {
|
||||||
|
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||||
|
$element->setAttrib('readonly','readonly');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ class Application_Service_CalendarService
|
||||||
if ($isRepeating) {
|
if ($isRepeating) {
|
||||||
if ($populateInstance) {
|
if ($populateInstance) {
|
||||||
$menu["edit"] = array(
|
$menu["edit"] = array(
|
||||||
"name" => _("Edit Show"),
|
"name" => _("Edit This Instance"),
|
||||||
"icon" => "edit",
|
"icon" => "edit",
|
||||||
"url" => $baseUrl."Schedule/populate-repeating-show-instance-form");
|
"url" => $baseUrl."Schedule/populate-repeating-show-instance-form");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -81,9 +81,20 @@ class Application_Service_ShowFormService
|
||||||
$this->populateFormLive($forms["live"]);
|
$this->populateFormLive($forms["live"]);
|
||||||
$this->populateFormStyle($forms["style"]);
|
$this->populateFormStyle($forms["style"]);
|
||||||
|
|
||||||
//no need to populate these forms since the user won't
|
/* Only the field on the 'when' form will get updated so we should
|
||||||
//be able to see them
|
* make all other forms disabled or readonly
|
||||||
|
*
|
||||||
|
* 'what' needs to be readonly because zendform will not validate
|
||||||
|
* if they are disabled
|
||||||
|
*
|
||||||
|
* All other forms can be disabled because we do not update those values
|
||||||
|
* when the user edits a repeating instance
|
||||||
|
*/
|
||||||
|
$forms["what"]->makeReadonly();
|
||||||
$forms["repeats"]->disable();
|
$forms["repeats"]->disable();
|
||||||
|
$forms["who"]->disable();
|
||||||
|
$forms["style"]->disable();
|
||||||
|
$forms["live"]->disable();
|
||||||
$forms["record"]->disable();
|
$forms["record"]->disable();
|
||||||
$forms["rebroadcast"]->disable();
|
$forms["rebroadcast"]->disable();
|
||||||
$forms["abs_rebroadcast"]->disable();
|
$forms["abs_rebroadcast"]->disable();
|
||||||
|
|
|
@ -560,8 +560,6 @@ SQL;
|
||||||
|
|
||||||
$query = Application_Common_Database::prepareAndExecute( $sql,
|
$query = Application_Common_Database::prepareAndExecute( $sql,
|
||||||
array( 'showId' => $this->ccShow->getDbId() ), 'single');
|
array( 'showId' => $this->ccShow->getDbId() ), 'single');
|
||||||
|
|
||||||
Logging::info($query);
|
|
||||||
|
|
||||||
$date = null;
|
$date = null;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue