Skip to content
Snippets Groups Projects
edit_course.xhtml 17.93 KiB
<h1>Navigation</h1>
<div>
    <b>Alphabetical: </b>
    <a href="/courseadmin/index<?php echo $this->prevCourseLink; ?>">Previous</a>
    <a href="/courseadmin/index<?php echo $this->nextCourseLink; ?>">Next</a>
</div>

<?php if ($this->parentGeneration || $this->childGenerations->count() > 0) { ?>
<div>
    <b>Generational:</b>
    <?php if ($this->parentGeneration) { ?>
    <a href="/CourseAdmin/index/<?php echo $this->parentGeneration->getPrimaryKey();?>">Parent</a>
    <?php } ?>

    <?php if ($this->childGenerations->count() > 0) { ?>
    Children:
    <?php $i = 0; foreach ($this->childGenerations as $childGeneration) { $i++; ?>
    <a href="/CourseAdmin/index/<?php echo $childGeneration->getPrimaryKey();?>"><?php echo $i; ?></a>
    <?php } ?>
    <?php } ?>
</div>
<?php } ?>

<h1>Edit Course</h1>
<form action="/courseadmin/updatecourse/<?php echo implode('/', $this->uriParams); ?>" method="post">

<input type="hidden" name="courseId" value="<?php echo $this->course->getPrimaryKey(); ?>" />

<h2>Main Details</h2>
<fieldset>
    <fieldset class="three_column">
        <label>
            Subject<br />
            <input type="text" id="subject" name="subject" value="<?php echo htmlentities($this->course->subject); ?>" />
        </label>
        <label>
            Course Number<br />
            <input type="text" id="courseNumber" name="courseNumber" value="<?php echo htmlentities($this->course->courseNumber); ?>" />
        </label>
        <label>
            Course Letter
            <input type="text" id="courseLetter" name="courseLetter" value="<?php echo htmlentities($this->course->courseLetter); ?>" />
        </label>
    </fieldset>

    <h3>Grading</h3>
    <fieldset class="three_column">
        <label>
            Unrestricted
            <input type="radio"
                   class="radio"
                   name="gradingType"
                   value="unrestricted"
                   <?php if($this->course->gradingType == 'unrestricted') { ?>
                   checked="checked"
                   <?php } ?>
                   />
        </label>

        <label>
            Letter Grade Only
            <input type="radio"
                   class="radio"
                   name="gradingType"
                   value="letter grade only"
                   <?php if($this->course->gradingType == 'letter grade only') { ?>
                   checked="checked"
                   <?php } ?>
                   />
        </label>
        <label>
            Pass / No Pass Only
            <input type="radio"
                   class="radio"
                   name="gradingType"
                   value="pass/no pass only"
                   <?php if($this->course->gradingType == 'pass/no pass only') { ?>
                   checked="checked"
                   <?php } ?>
                   />
        </label>
    </fieldset>

    <h3>Delivery Method(s)</h3>
    <fieldset class="three_column">
        <label>
            Classroom
            <input type="checkbox"
                   name="deliveryMethods[]"
                   value="Classroom"
                   <?php if(in_array('Classroom', $this->course->deliveryMethods)) { ?>
                   checked="checked"
                   <?php } ?>
                   />
        </label>
        <label>
            Web
            <input type="checkbox"
                   name="deliveryMethods[]"
                   value="Web"
                   <?php if(in_array('Web', $this->course->deliveryMethods)) { ?>
                   checked="checked"
                   <?php } ?>
                   />
        </label>
        <label>
            Correspondence
            <input type="checkbox"
                   name="deliveryMethods[]"
                   value="Correspondence"
                   <?php if(in_array('Correspondence', $this->course->deliveryMethods)) { ?>
                   checked="checked"
                   <?php } ?>
                   />
        </label>
    </fieldset>

    <fieldset class="three_column">
        <label>
            Title<br />
            <input type="text" id="title" name="title" value="<?php echo htmlentities($this->course->title); ?>" />
        </label>
        <label>
            Integrated Studies
            <input type="hidden" name="integratedStudies" value="no" />
            <input type="checkbox"
                   name="integratedStudies"
                   value="yes"
                   <?php if($this->course->integratedStudies == 'yes') { ?>
                   checked="checked"
                   <?php } ?>
            />
        </label>
    </fieldset>
</fieldset>

<h2>Crosslistings</h2>
<fieldset class="three_column">
    <table>
        <tr>
            <th>Subject</th>
            <th>Course Number</th>
            <th>Course Letter</th>
            <th>Remove</th>
        </tr>
        <?php $hasTieIn = false;
        foreach($this->course->crosslistings as $key => $crosslist) {
            if($crosslist->type == 'grad tie-in') { $hasTieIn = true; }
            if($crosslist->type != 'home listing') { ?>
        <tr <?php if($crosslist->type == 'grad tie-in') { ?>class="grad_tie_in_row"<?php } ?>>
            <td> <input type="text"
                        name="crosslistings[<?php echo $key; ?>][subject]"
                        value="<?php echo $crosslist->subject; ?>"
                        <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?>/> </td>
            <td> <input type="text"
                        name="crosslistings[<?php echo $key; ?>][courseNumber]"
                        value="<?php echo $crosslist->courseNumber; ?>"
                        <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?> /> </td>
            <td> <input type="text"
                        name="crosslistings[<?php echo $key; ?>][courseLetter]"
                        value="<?php echo $crosslist->courseLetter; ?>"
                        <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?> /> </td>
            <td class="hidden">
                <input type="hidden"
                       name="crosslistings[<?php echo $key; ?>][type]"
                       value="<?php echo $crosslist->type; ?>" />
            </td>
            <td> <input type="checkbox"
                        name="crosslistings[<?php echo $key; ?>][delete]"
                        value="yes" /> </td>
        </tr>
        <?php } } ?>
        <tr class="hidden_new_record">
            <td> <input disabled="disabled" type="text" name="crosslistings[__key__][subject]" /> </td>
            <td> <input disabled="disabled" type="text" name="crosslistings[__key__][courseNumber]" /> </td>
            <td> <input disabled="disabled" type="text" name="crosslistings[__key__][courseLetter]" /> </td>
            <td class="hidden"> <input disabled="disabled" type="hidden" name="crosslistings[__key__][type]" value="crosslisting" /> </td>
            <td> <a href="#" class="remove_record_button">-</a> </td>
        </tr>
        <tr>
            <td colspan="4">
                <a href="#" class="add_record_button">Add Crosslisting</a>
                <?php if(!$hasTieIn) { ?>
                <a href="#"
                   class="add_record_button"
                   id="add_tie_in_button_<?php echo $this->course->subject
                                                  . '_' . $this->course->courseNumber
                                                  . '_' . $this->course->courseLetter; ?>"
                >
                    Add Graduate Tie-In
                </a>
                <?php } ?>
            </td>
        </tr>
    </table>
</fieldset>

<h2>Credit (leave blank if not defined)</h2>
<fieldset id="credits">
    <div>
        <label>
            Single Values
        </label>
        <input type="text"
               name="credits[1]"
               id="creditsSingleValues"
               value="<?php echo $this->creditsSingleValues; ?>" />
    </div>
    <div>
        <label>Range</label>
        <input type="text"
               name="credits[2]"
               value="<?php echo $this->creditsRangeMin; ?>" /> -
        <input type="text"
               name="credits[3]"
               value="<?php echo $this->creditsRangeMax; ?>" />
    </div>
    <div>
        <label>
            Max per Semester
        </label>
        <input type="text"
               name="credits[4]"
               value="<?php echo $this->creditsMaxPerSemester; ?>" />
    </div>
    <div>
        <label>
            Max per Degree
        </label>
        <input type="text"
               name="credits[5]"
               value="<?php echo $this->creditsMaxPerDegree; ?>" />
    </div>
</fieldset>

<h2>Terms Offered (Remove terms never taught)</h2>
<fieldset class="three_column">
    <label>
        Fall
        <input type="checkbox"
               name="termsOffered[]"
               value="Fall"
               <?php if(in_array('Fall', $this->course->termsOffered)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
    <label>
        Spring
        <input type="checkbox"
               name="termsOffered[]"
               value="Spring"
               <?php if(in_array('Spring', $this->course->termsOffered)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
    <label>
        Summer
        <input type="checkbox"
               name="termsOffered[]"
               value="Summer"
               <?php if(in_array('Summer', $this->course->termsOffered)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
</fieldset>

<h2>Activity</h2>
<fieldset class="two_of_three_column">
    <table>
        <tr>
            <th>Type</th>
            <th>Hours per week</th>
            <th>Remove</th>
        </tr>
        <?php foreach($this->course->activities as $key => $activity) { ?>
        <tr>
            <td>
                <select name="activities[<?php echo $key; ?>][type]">
                    <option value="-1">--Select One--</option>
                    <option value="lec"
                            <?php if($activity->type == 'lec') { ?>selected="selected"<?php } ?>
                    >Lecture</option>
                    <option value="lab"
                            <?php if($activity->type == 'lab') { ?>selected="selected"<?php } ?>
                    >Lab</option>
                    <option value="quz"
                            <?php if($activity->type == 'quz') { ?>selected="selected"<?php } ?>
                    >Quiz</option>
                    <option value="rct"
                            <?php if($activity->type == 'rct') { ?>selected="selected"<?php } ?>
                    >Recitation</option>
                    <option value="stu"
                            <?php if($activity->type == 'stu') { ?>selected="selected"<?php } ?>
                    >Studio</option>
                    <option value="fld"
                            <?php if($activity->type == 'fld') { ?>selected="selected"<?php } ?>
                    >Field</option>
                    <option value="ind"
                            <?php if($activity->type == 'ind') { ?>selected="selected"<?php } ?>
                    >Independent Study</option>
                    <option value="psi"
                            <?php if($activity->type == 'psi') { ?>selected="selected"<?php } ?>
                    >P.S.I.</option>
                </select>
            </td>
            <td> <input type="text"
                        name="activities[<?php echo $key; ?>][hours]"
                        value="<?php echo $activity->hours; ?>" /> </td>
            <td> <input type="checkbox"
                        name="activities[<?php echo $key; ?>][delete]"
                        value="yes" /> </td>
        </tr>
        <?php } ?>
        <tr class="hidden_new_record">
            <td>
                <select disabled="disabled" name="activities[__key__][type]">
                    <option value="-1">--Select One--</option>
                    <option value="lec">Lecture</option>
                    <option value="lab">Lab</option>
                    <option value="quz">Quiz</option>
                    <option value="rct">Recitation</option>
                    <option value="stu">Studio</option>
                    <option value="fld">Field</option>
                    <option value="ind">Independent Study</option>
                    <option value="psi">P.S.I.</option>
                </select>
            </td>
            <td> <input disabled="disabled" type="text" name="activities[__key__][hours]" /> </td>
            <td> <a href="#" class="remove_record_button">-</a> </td>
        </tr>
        <tr>
            <td colspan="3">
                <a href="#" class="add_record_button">Add Activity</a>
            </td>
        </tr>
    </table>
</fieldset>

<h2>Prerequisite</h2>
<fieldset>
    <textarea id="prerequisite" name="prerequisite"><?php echo htmlentities($this->course->prerequisite); ?></textarea>
</fieldset>
<h2>Notes</h2>
<fieldset>
    <textarea id="notes" name="notes"><?php echo htmlentities($this->course->notes); ?></textarea>
</fieldset>
<h2>Description</h2>
<fieldset>
    <textarea id="description" name="description"><?php echo htmlentities($this->course->description); ?></textarea>
</fieldset>

<h2>Campus(es)</h2>
<fieldset class="three_column">
    <label>
        UNL
        <input type="checkbox"
               name="campuses[]"
               value="UNL"
               <?php if(in_array('UNL', $this->course->campuses)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
    <label>
        UNO
        <input type="checkbox"
               name="campuses[]"
               value="UNO"
               <?php if(in_array('UNO', $this->course->campuses)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
    <label>
        UNMC
        <input type="checkbox"
               name="campuses[]"
               value="UNMC"
               <?php if(in_array('UNMC', $this->course->campuses)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
    <label>
        UNK
        <input type="checkbox"
               name="campuses[]"
               value="UNK"
               <?php if(in_array('UNK', $this->course->campuses)) { ?>
               checked="checked"
               <?php } ?>
               />
    </label>
</fieldset>

<h2>Graduate Tie-In</h2>
<fieldset>
    <label>
        Credits<br />
        <input type="text" name="gradTieIn[credits]" value="<?php echo $this->course->gradTieIn->credits; ?>" /><br />
    </label>
    <label>
        Prereq<br />
        <textarea name="gradTieIn[prerequisites]"><?php echo $this->course->gradTieIn->prerequisites; ?></textarea><br />
    </label>
    <label>
        Notes<br />
        <textarea name="gradTieIn[notes]"><?php echo $this->course->gradTieIn->notes; ?></textarea>
    </label>
</fieldset>

<?php /*
<h2>DF Removals (not implemented)</h2>
<table>
    <tr>
        <th>Subject</th>
        <th>Course Number</th>
        <th>Course Letter</th>
        <th>Delete</th>
    </tr>
    <?php foreach($this->course->dfRemovals as $key => $dfRemoval) { ?>
    <tr>
        <td>
            <input type="text" name="crosslistings[<?php echo $dfRemoval->getPrimaryKey(); ?>][subject]" value="<?php echo $crosslisting->subject; ?>" />
        </td>
        <td>
            <input type="text" name="crosslistings[<?php echo $dfRemoval->getPrimaryKey(); ?>][courseNumber]" value="<?php echo $crosslisting->courseNumber; ?>" />
        </td>
        <td>
            <input type="text" name="crosslistings[<?php echo $dfRemoval->getPrimaryKey(); ?>][courseLetter]" value="<?php echo $crosslisting->courseLetter; ?>" />
        </td>
        <td>
            <input type="hidden" name="dfRemovals[<?php echo $dfRemoval->getPrimaryKey(); ?>][delete]" value="no" />
            <input type="checkbox" name="dfRemovals[<?php echo $dfRemoval->getPrimaryKey(); ?>][delete]" value="yes" />
        </td>
    </tr>
    <?php } ?>
</table>
*/ ?>

<?php /*
<h2>Prerequisites (not implemented)</h2>
<table>
    <tr>
        <th>Subject</th>
        <th>Course Number</th>
        <th>Course Letter</th>
        <th>Delete</th>
    </tr>
    <?php foreach($this->course->prerequisites as $key => $prerequisite) { ?>
    <tr>
        <td>
            <input type="text" name="crosslistings[<?php echo $prerequisite->getPrimaryKey(); ?>][subject]" value="<?php echo $crosslisting->subject; ?>" />
        </td>
        <td>
            <input type="text" name="crosslistings[<?php echo $prerequisite->getPrimaryKey(); ?>][courseNumber]" value="<?php echo $crosslisting->courseNumber; ?>" />
        </td>
        <td>
            <input type="text" name="crosslistings[<?php echo $prerequisite->getPrimaryKey(); ?>][courseLetter]" value="<?php echo $crosslisting->courseLetter; ?>" />
        </td>
        <td>
            <input type="hidden" name="prerequisites[<?php echo $prerequisite->getPrimaryKey(); ?>][delete]" value="no" />
            <input type="checkbox" name="prerequisites[<?php echo $prerequisite->getPrimaryKey(); ?>][delete]" value="yes" />
        </td>
    </tr>
    <?php } ?>
</table> */ ?>

<fieldset>
    <h3>Record Type</h3>
    <label>
        Proposed:
        <input type="radio"
               name="type"
               value="proposed"
               <?php if($this->course->type == 'proposed') { ?>checked="checked"<? } ?> />
    </label>
    <label>
        Official:
        <input type="radio"
               name="type"
               value="official"
               <?php if($this->course->type == 'official') { ?>checked="checked"<? } ?> />
    </label>
</fieldset>

<input type="submit" value="Update Course" />

</form>

<form id="delete_course" method="post" action="/CourseAdmin/DeleteCourse/<?php echo $this->course->getPrimaryKey(); ?>">
    <label>
        Enable Delete
        <input type="checkbox" id="enable_delete" />
    </label>
    <input id="submit_delete" type="submit" value="Delete Course" disabled="disabled" />
</form>