adding show instance to the create form if it's already set.
This commit is contained in:
parent
614a8174d5
commit
9c0bee3877
|
@ -12,7 +12,7 @@ class Application_Form_EditHistoryItem extends Application_Form_EditHistory
|
|||
'PrepareElements',
|
||||
array('ViewScript', array('viewScript' => 'form/edit-history-item.phtml'))
|
||||
));
|
||||
|
||||
|
||||
/*
|
||||
$instance = new Zend_Form_Element_Select("instance_id");
|
||||
$instance->setLabel(_("Choose Show Instance"));
|
||||
|
@ -51,10 +51,16 @@ class Application_Form_EditHistoryItem extends Application_Form_EditHistory
|
|||
|
||||
parent::createFromTemplate($template, $required);
|
||||
}
|
||||
|
||||
public function populateShowInstances($possibleInstances) {
|
||||
|
||||
$instance = $this->getElement("instance_id");
|
||||
|
||||
public function populateShowInstances($possibleInstances, $default) {
|
||||
|
||||
$possibleInstances["0"] = _("No Show");
|
||||
|
||||
$instance = new Zend_Form_Element_Select("his_instance_select");
|
||||
//$instance->setLabel(_("Choose Show Instance"));
|
||||
$instance->setMultiOptions($possibleInstances);
|
||||
$instance->setValue($default);
|
||||
$instance->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($instance);
|
||||
}
|
||||
}
|
|
@ -564,7 +564,16 @@ class Application_Service_HistoryService
|
|||
$formValues = array();
|
||||
|
||||
$historyRecord = CcPlayoutHistoryQuery::create()->findPk($id, $this->con);
|
||||
$file = $historyRecord->getCcFiles();
|
||||
$file = $historyRecord->getCcFiles($this->con);
|
||||
$instance = $historyRecord->getCcShowInstances($this->con);
|
||||
|
||||
if (isset($instance)) {
|
||||
$show = $instance->getCcShow($this->con);
|
||||
$selOpts = array();
|
||||
$instance_id = $instance->getDbId();
|
||||
$selOpts[$instance_id] = $show->getDbName();
|
||||
$form->populateShowInstances($selOpts, $instance_id);
|
||||
}
|
||||
|
||||
if (isset($file)) {
|
||||
$f = Application_Model_StoredFile::createWithFile($file, $this->con);
|
||||
|
|
|
@ -45,9 +45,14 @@
|
|||
<label for="<?php echo $name;?>"><?php echo _("Choose Show Instance") ?></label>
|
||||
</div>
|
||||
<div>
|
||||
<?php $select = $form->getElement("his_instance_select"); ?>
|
||||
<?php if (isset($select)): ?>
|
||||
<?php echo $select; ?>
|
||||
<?php else: ?>
|
||||
<select id="his_instance_select">
|
||||
<option value="0"><?php echo _("No Show") ?></option>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
<button class="btn" type="button" id="his_instance_retrieve"><?php echo _("Find") ?></button>
|
||||
</div>
|
||||
</dd>
|
||||
|
|
Loading…
Reference in New Issue