OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see .
Author: OpenEyes (info@openeyes.org.uk)
Inheritance: extends BaseActiveRecord
 public function testAssign_Subspecialty_Empty()
 {
     EpisodeSummaryItem::model()->assign(array(), 1);
     $this->assertEquals(array(), EpisodeSummaryItem::model()->enabled(1)->findAll());
 }
 public function actionUpdateEpisodeSummary()
 {
     $item_ids = @$_POST['item_ids'] ? explode(',', $_POST['item_ids']) : array();
     $subspecialty_id = @$_POST['subspecialty_id'] ?: null;
     $tx = Yii::app()->db->beginTransaction();
     EpisodeSummaryItem::model()->assign($item_ids, $subspecialty_id);
     $tx->commit();
     $this->redirect(array('/admin/episodeSummaries', 'subspecialty_id' => $subspecialty_id));
 }
				<div class="data-value highlight">
					<?php 
    echo $episode->eye ? $episode->eye->name : 'None';
    ?>
				</div>
			</section>
		</div>
	</div>

	<?php 
    $summaryItems = array();
    if ($episode->subspecialty) {
        $summaryItems = EpisodeSummaryItem::model()->enabled($episode->subspecialty->id)->findAll();
    }
    if (!$summaryItems) {
        $summaryItems = EpisodeSummaryItem::model()->enabled()->findAll();
    }
    ?>

	<?php 
    if (count($summaryItems)) {
        ?>
		<div class="element element-data event-types">
			<?php 
        foreach ($summaryItems as $summaryItem) {
            Yii::import("{$summaryItem->event_type->class_name}.widgets.{$summaryItem->getClassName()}");
            $widget = $this->createWidget($summaryItem->getClassName(), array('episode' => $episode, 'event_type' => $summaryItem->event_type));
            $className = '';
            if ($widget->collapsible) {
                $className .= 'collapsible';
                if ($widget->openOnPageLoad) {