Example #1
0
echo has_error("yearlevelAlias") ? "has-error" : (has_success("yearlevelAlias") ? "has-success" : "");
?>
">
						<label for="yearlevelAliasinput" class="col-sm-4 control-label">Year Alias</label>
						<div class="col-sm-8">
							<input name="yearlevelAlias" type="text" id="yearlevelAliasinput" class="form-control" value="<?php 
echo set_value("yearlevelAlias", $yearlevelinfo ? $yearlevelinfo->yearlevel_alias : "");
?>
" />
							<?php 
echo has_message("yearlevelAlias") ? '<span class="help-block">' . get_message("yearlevelAlias") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group <?php 
echo has_error("yearlevelDescription") ? "has-error" : (has_success("yearlevelDescription") ? "has-success" : "");
?>
">
						<label for="yearlevelDescriptioninput" class="col-sm-4 control-label">Year level Description</label>
						<div class="col-sm-8">
							<input name="yearlevelDescription" type="text" id="yearlevelDescriptioninput" class="form-control" value="<?php 
echo set_value("yearlevelDescription", $yearlevelinfo ? $yearlevelinfo->yearlevel_description : "");
?>
" />
							<?php 
echo has_message("yearlevelDescription") ? '<span class="help-block">' . get_message("yearlevelDescription") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-4">
Example #2
0
 public function update()
 {
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     $data = $_POST;
     $data['id'] = $id;
     $data['is_complete'] = isset($data['is_complete']) ? SERIES_STATUS_COMPLETE : SERIES_STATUS_ONGOING;
     $obj = $this->Series_model->getById($id);
     $data['thumbnail'] = $obj['thumbnail'];
     $message = $this->validate($data, TRUE);
     if (!empty($message)) {
         set_flash_error($message);
     }
     $listGenre = $this->Genre_model->getAll();
     $defaultGenre = isset($data['genre']) ? $data['genre'] : array();
     $genreSelectbox = selectBox($listGenre, array('Name' => 'genre[]', 'multiple' => 'multiple', 'size' => 10, 'Selected' => $defaultGenre));
     $data['genreSelectbox'] = $genreSelectbox;
     $statusSelectbox = selectBox($this->_config['status'], array('Name' => 'status', 'Selected' => $data['status']));
     $data['statusSelectbox'] = $statusSelectbox;
     $countrySelectbox = selectBox($this->_config['countries'], array('Name' => 'country', 'Selected' => $data['country']));
     $data['countrySelectbox'] = $countrySelectbox;
     $typeSelectbox = selectBox($this->_config['video_type'], array('Name' => 'type', 'Selected' => $data['type']));
     $data['typeSelectbox'] = $typeSelectbox;
     if (!has_error()) {
         $canUpdate = FALSE;
         if (!empty($_FILES) && !empty($_FILES['thumbnail']['tmp_name'])) {
             $result = upload_image($_FILES, SERIE_IMAGE_THUMBNAIL_PATH);
             if ($result['error'] != 0) {
                 $this->layout->title('Edit video');
                 $this->layout->view('admin_series/edit', $data);
             } else {
                 $data['thumbnail'] = $result['fileName'];
                 $this->_deleteImage($id);
                 $canUpdate = TRUE;
             }
         } else {
             $canUpdate = TRUE;
         }
         if ($canUpdate) {
             $id = $this->Series_model->update($id, $data);
             $this->Series_Genre_model->deleteBySeriesId($id);
             if ($data['genre']) {
                 foreach ($data['genre'] as $genreId) {
                     $seriesGenreData = array();
                     $seriesGenreData['genre_id'] = $genreId;
                     $seriesGenreData['series_id'] = $id;
                     $this->Series_Genre_model->insert($seriesGenreData);
                 }
             }
             $url = base_url() . 'admin_series/index';
             set_flash_message($this->lang->line('admin.series.updated'));
             redirect($url);
         }
     } else {
         $this->layout->title('Edit series');
         $this->layout->view('admin_series/edit', $data);
     }
 }
Example #3
0
foreach ($q as $college) {
    echo '<option value="' . htmlspecialchars($college['id']) . '" ';
    if ($user['college_id'] === $college['id']) {
        echo "selected";
    }
    echo ">" . htmlspecialchars($college['name']) . "</option>\n";
}
?>
          </select>
          <?php 
show_error('college');
?>
        </div>

        <div class='form-group col-md-6 <?php 
echo has_error('campus');
?>
'>
          <label>Campus</label>
          <select name='campus' class='form-control'>
            <option value=""> Select Campus </option>
            <?php 
echo "<option value='1' ";
if ($user['campus_id'] == 1) {
    echo "selected='selected'";
}
echo "> Corvallis (Main)</option>";
echo "<option value='2' ";
if ($user['campus_id'] == 2) {
    echo "selected='selected'";
}
Example #4
0
		<div class="panel panel-primary">
			<div class="panel-heading">
				<p class="panel-title">
					Edit curriculum type
				</p>
			</div>
			<div class="panel-body">
				<?php 
$curriculumtypeinfo = isset($curriculumtypeinfo) ? $curriculumtypeinfo : false;
$form_attr = array("class" => "form-horizontal");
$form_hidden = array(sha1("editcurriculumtype") => sha1(random_string("alnum", 5)));
echo form_open("dashboard/curriculums/settings/types/" . ($curriculumtypeinfo ? $curriculumtypeinfo->getCurriculumtypeid() : 0) . "/edit", $form_attr, $form_hidden);
?>
				
					<div class="form-group <?php 
echo has_error("curriculumType") ? "has-error" : (has_success("curriculumType") ? "has-success" : "");
?>
">
						<label for="curriculumTypeinput" class="col-sm-4 control-label">Curriculum type</label>
						<div class="col-sm-8">
							<input name="curriculumType" type="text" id="curriculumTypeinput" class="form-control" value="<?php 
echo set_value("curriculumType", $curriculumtypeinfo ? $curriculumtypeinfo->curriculum_type : "");
?>
" />
							<?php 
echo has_message("curriculumType") ? '<span class="help-block">' . get_message("curriculumType") . '</span>' : "";
?>
						</div>
					</div>
					
					<div class="form-group">
Example #5
0
echo has_error("majorCode") ? "has-error" : (has_success("majorCode") ? "has-success" : "");
?>
">
						<label for="majorCodeinput" class="col-sm-4 control-label">Major Code</label>
						<div class="col-sm-8">
							<input name="majorCode" type="text" id="majorCodeinput" class="form-control" value="<?php 
echo set_value("majorCode", $majorinfo ? $majorinfo->major_code : "");
?>
" />
							<?php 
echo has_message("majorCode") ? '<span class="help-block">' . get_message("majorCode") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group <?php 
echo has_error("majorDescription") ? "has-error" : (has_success("majorDescription") ? "has-success" : "");
?>
">
						<label for="majorDescriptioninput" class="col-sm-4 control-label">Major Description</label>
						<div class="col-sm-8">
							<?php 
$majorDescriptioninput = array('name' => 'majorDescription', 'class' => "form-control", 'id' => 'majorDescriptioninput', 'value' => set_value("majorDescription", $majorinfo ? $majorinfo->major_description : ""), 'rows' => '3');
echo form_textarea($majorDescriptioninput);
?>
							<?php 
echo has_message("majorDescription") ? '<span class="help-block">' . get_message("majorDescription") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-4">
Example #6
0
         }
     }
     $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/courses/groups?section=manage&id=" . $COURSE_ID . "&gid=" . $GROUP_ID . "\\'', 5000)";
     break;
 case 'managetutors':
     $query = "DELETE FROM `course_group_contacts` WHERE `cgroup_id` = " . $db->qstr($GROUP_ID);
     if ($db->Execute($query)) {
         if (is_array($PROCESSED["associated_tutors"]) && count($PROCESSED["associated_tutors"])) {
             foreach ($PROCESSED["associated_tutors"] as $contact_order => $proxy_id) {
                 $contact_details = array("cgroup_id" => $GROUP_ID, "proxy_id" => $proxy_id, "contact_order" => (int) $contact_order, "updated_date" => time(), "updated_by" => $ENTRADA_USER->getID());
                 if (!$db->AutoExecute("course_group_contacts", $contact_details, "INSERT")) {
                     add_error("There was an error while trying to attach an <strong>Associated Tutor</strong> to this course group.<br /><br />The system administrator was informed of this error; please try again later.");
                     application_log("error", "Unable to insert a new course_group_contact record while managing a course group. Database said: " . $db->ErrorMsg());
                 }
             }
             if (!has_error()) {
                 add_success("Successfully updated the tutors for the selected course group.");
             }
         } else {
             add_success("Successfully removed all tutors from the selected course group.");
         }
     } else {
         add_error("There was an error while trying to remove the <strong>Associated Tutor(s)</strong> from this course group.<br /><br />The system administrator was informed of this error; please try again later.");
         application_log("error", "Unable to remove a course_group_contact record while managing a course group. Database said: " . $db->ErrorMsg());
     }
     $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/courses/groups?section=manage&id=" . $COURSE_ID . "&gid=" . $GROUP_ID . "\\'', 5000)";
     break;
 case 'delete':
     $removed = array();
     foreach ($GROUP_IDS as $group_id) {
         if ($group_id = (int) $group_id) {
Example #7
0
        echo '<option value="' . $subjectinfo->getSubjectid() . '" ' . (has_value("cssubjectUnit") ? get_value("cssubjectId") == $subjectinfo->getSubjectid() ? ' selected = "selected" ' : "" : set_select("cssubjectId", $subjectinfo->getSubjectid())) . '>';
        echo $subjectinfo->subject_code . " ( " . $subjectinfo->subject_description . " )";
        echo '</option>';
    }
}
?>
						</select>
						<span class="help-block"><?php 
echo has_message("cssubjectId") ? get_message("cssubjectId") : "";
?>
</span>
					</div>
				</div>
				
				<div class="form-group  <?php 
echo has_error("cssubjectUnit", "has-error", has_success("cssubjectUnit", "has-success"));
?>
">
					<label for="subjectUnitinput" class=" control-label col-sm-4">Unit</label>
					<div class="col-sm-5">
						<div class="input-group input-append spinner" data-trigger="spinner">
							<input value="<?php 
echo has_value("cssubjectUnit") ? get_value("cssubjectUnit") : set_value("cssubjectUnit", 0);
?>
" type="text" class="form-control" name="cssubjectUnit" id="subjectUnitinput"  data-max="10" data-min="0" data-step="1" data-rule="quantity" />

							<span class="input-group-addon add-on"> 
								<a href="#" class="spin-up" data-spin="up">
									<span class="glyphicon glyphicon-triangle-top icon-sort-up"></span>
								</a> 
								<a href="#" class="spin-down" data-spin="down">
Example #8
0
         update_progress_bar('records', 50, 100);
         add_to_msg('Sending ' . sizeof($altered_relation['entry_list']) . ' Modified Relationship Records<br>', false);
         $result = $soapclient->call('sync_set_relationships', array('session' => $session, 'module_name' => $sync_module, 'related_module' => $related, 'from_date' => $last_sync, 'to_date' => $start_time, 'sync_entry_list' => $commit_relation, 'deleted' => -1));
     }
     update_progress_bar('records', 100, 100);
 }
 if ($rel_offset > 0 || !has_error($result)) {
     update_progress_bar('records', 0, 100);
     $next_off = $rel_offset + $rel_max;
     add_to_msg('Retrieving Server Relationships - ' . $related . "[{$rel_offset} - {$next_off}] <br>", false);
     if ($clean_sync == 1) {
         $result = $soapclient->call('get_quick_sync_data', array('session' => $session, 'module_name' => $sync_module, 'related_module_name' => $related, 'start' => $rel_offset, 'count' => $rel_max, 'db_type' => $sugar_config['dbconfig']['db_type'], 'deleted' => 2));
     } else {
         $result = $soapclient->call('sync_get_relationships', array('session' => $session, 'module_name' => $sync_module, 'related_module' => $related, 'from_date' => $last_sync, 'to_date' => $start_time, 'offset' => $rel_offset, 'max_results' => $rel_max, 'deleted' => 2));
     }
     if (!has_error($result)) {
         update_progress_bar('records', 50, 100);
         if ($clean_sync == 1) {
             $result_arr = unserialize(base64_decode($result['result']));
             execute_query($sync_module, $result_arr['data']);
             execute_query($sync_module, $result_arr['cstm']);
         } else {
             $list = get_decoded($result['entry_list']);
             $done = client_save_relationships($list);
             add_to_msg('Retrieved ' . $result['result_count'] . ' Records<br>', false);
             add_to_msg('Added ' . $done['add'] . ' Records <br>', false);
             add_to_msg('Modified ' . $done['modify'] . ' Records <br>', false);
         }
         $total_count = $result['total_count'];
         if ($result['next_offset'] < $result['total_count']) {
             store_msg();
Example #9
0
/**
 * Displays all the errors.
 */
function show_errors()
{
    if (has_error()) {
        global $error_list;
        echo '<div class="error">';
        foreach ($error_list as $error) {
            echo $error;
        }
        echo '</div>';
    }
}
Example #10
0
if ($sync_module_index == -1) {
    add_to_msg("Logging Into Server...");
}
$result = $soapclient->call('login', array('user_auth' => sync_get_user_auth_data(), 'application_name' => 'MobileClient'));
if (!has_error($result)) {
    $session = $result['id'];
    $_SESSION['sync_session'] = $session;
    //ensure that this system has not been disabled
    global $sugar_config;
    global $sugar_flavor;
    global $sugar_version;
    $soapclient->setHeaders('sugar_version=' . $sugar_version);
    $result = $soapclient->call('get_system_status', array('session' => $session, 'unique_key' => $sugar_config['unique_key']));
    if (!has_error($result) && $result['id'] == 0) {
        $result = $soapclient->call('get_sugar_flavor', array());
        if (!has_error($result) && $result == $sugar_flavor) {
            if ($sync_module_index == -1) {
                add_to_msg('Updating Files -<b>Please Wait</b>- <br><br>');
                $current_step++;
                update_progress_bar('sync_setup', $current_step, $module_steps);
                if (isset($_REQUEST['new_sync'])) {
                    // run the file sync
                    require_once "include/utils/disc_client_utils.php";
                    $from_sync_client = true;
                    //before we do a file sync we need to install any necessary upgrades
                    $upgrade_applied = get_required_upgrades($soapclient, $session);
                    $results = disc_client_get_zip($soapclient, $session, true, 0, $upgrade_applied);
                    $_REQUEST['do_action'] = 'execute';
                    $_REQUEST['repair_silent'] = true;
                    $current_user->is_admin = 1;
                    echo "<div id='rrresult'></div>\n                                <script>\n                                var xmlhttp=false;\n                                /*@cc_on @*/\n                                /*@if (@_jscript_version >= 5)\n                                // JScript gives us Conditional compilation, we can cope with old IE versions.\n                                // and security blocked creation of the objects.\n                                 try {\n                                  xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n                                 } catch (e) {\n                                  try {\n                                   xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n                                  } catch (E) {\n                                   xmlhttp = false;\n                                  }\n                                 }\n                                @end @*/\n                                if (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n                                    try {\n                                        xmlhttp = new XMLHttpRequest();\n                                    } catch (e) {\n                                        xmlhttp = false;\n                                    }\n                                }\n                                if (!xmlhttp && window.createRequest) {\n                                    try {\n                                        xmlhttp = window.createRequest();\n                                    } catch (e) {\n                                        xmlhttp = false;\n                                    }\n                                }\n                                xmlhttp.onreadystatechange = function() {\n                                            if(xmlhttp.readyState == 4) {\n                                              document.getElementById('rrresult').innerHTML = xmlhttp.responseText;\n                                            }\n                                          }\n                                xmlhttp.open('GET', 'index.php?module=Sync&action=OfflineClientRepair', true);\n                                xmlhttp.send(null);\n                                </script>";
/**
 * routine to display standard status messages, Error, Notice, and Success
 * @param bool $fade true if the messages should fade out
 */
function display_status_messages($fade = false)
{
    echo "<div class=\"status_messages\">";
    if (has_error()) {
        if ($fade) {
            fade_element("out", "display-error-box");
        }
        echo display_error();
    }
    if (has_success()) {
        if ($fade) {
            fade_element("out", "display-success-box");
        }
        echo display_success();
    }
    if (has_notice()) {
        if ($fade) {
            fade_element("out", "display-notice-box");
        }
        echo display_notice();
    }
    echo "</div>";
}
Example #12
0
 public function save()
 {
     $data = $_POST;
     $importType = $this->_config['import_type'];
     unset($importType[IMPORT_TYPE_COUNTRY]);
     $importTypeSelectbox = selectBox($importType, array('Name' => 'import_type_id', 'Selected' => $data['import_type_id']));
     $data['importTypeSelectbox'] = $importTypeSelectbox;
     $typeSelectbox = selectBox($this->_config['video_type'], array('Name' => 'type', 'Selected' => $data['type']));
     $data['typeSelectbox'] = $typeSelectbox;
     $message = $this->validate($data);
     if (!empty($message)) {
         set_flash_error($message);
     }
     if (!has_error()) {
         $siteUrl = strtolower($data['site_url']);
         $id = 0;
         $importTypeId = $data['import_type_id'];
         if (strpos($siteUrl, "dramacool.com/")) {
             if ($importTypeId == IMPORT_TYPE_VIDEO) {
                 $ret = $this->dramaCool->importFromVideoUrl($siteUrl);
             } elseif ($importTypeId == IMPORT_TYPE_SERIES) {
                 $ret = $this->dramaCool->importFromSeriesUrl($siteUrl);
             } elseif ($importTypeId == IMPORT_TYPE_COUNTRY) {
                 die;
                 //$ret = $this->dramaCool->importFromCountryUrl($siteUrl);
             }
             $id = $ret['id'];
         }
         if ($id) {
             $url = base_url() . 'admin_video/show?id=' . $id;
             set_flash_message($this->lang->line('admin.import.success'));
             redirect($url);
         } else {
             set_flash_error($ret['msg']);
             $this->layout->title('Import Data');
             $this->layout->view('import_data/import', $data);
         }
     } else {
         $this->layout->title('Import Data');
         $this->layout->view('import_data/import', $data);
     }
 }
Example #13
0
echo has_error("semesterAlias") ? "has-error" : (has_success("semesterAlias") ? "has-success" : "");
?>
">
						<label for="semesterAliasinput" class="col-sm-4 control-label">Semester Alias</label>
						<div class="col-sm-8">
							<input name="semesterAlias" type="text" id="semesterAliasinput" class="form-control" value="<?php 
echo set_value("semesterAlias");
?>
" />
							<?php 
echo has_message("semesterAlias") ? '<span class="help-block">' . get_message("semesterAlias") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group <?php 
echo has_error("semesterDescription") ? "has-error" : (has_success("semesterDescription") ? "has-success" : "");
?>
">
						<label for="semesterDescriptioninput" class="col-sm-4 control-label">Semester Description</label>
						<div class="col-sm-8">
							<input name="semesterDescription" type="text" id="semesterDescriptioninput" class="form-control" value="<?php 
echo set_value("semesterDescription");
?>
" />
							<?php 
echo has_message("semesterDescription") ? '<span class="help-block">' . get_message("semesterDescription") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-4">
Example #14
0
 public function update_box_item()
 {
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     $data = $_POST;
     $data['id'] = $id;
     $obj = $this->Editor_Box_Item_model->getById($id);
     $data['item_thumbnail'] = $obj['item_thumbnail'];
     $originalThumb = $obj['item_thumbnail'];
     $message = $this->validate_box_item($data, TRUE);
     if (!empty($message)) {
         set_flash_error($message);
     }
     $listBox = $this->Editor_Box_model->getAll();
     $boxSelectbox = selectBox($listBox, array('Name' => 'box_id', 'MainOption' => TRUE, 'Selected' => $data['box_id']));
     $data['boxSelectbox'] = $boxSelectbox;
     if (!has_error()) {
         $isUpload = FALSE;
         $canUpdate = FALSE;
         if (!empty($_FILES) && !empty($_FILES['item_thumbnail']['tmp_name'])) {
             $result = upload_image($_FILES, EDITOR_IMAGE_THUMBNAIL_PATH);
             if ($result['error'] != 0) {
                 $this->layout->title('Edit box item');
                 $this->layout->view('admin_editor/edit_box_item', $data);
             } else {
                 $data['item_thumbnail'] = $result['fileName'];
                 $canUpdate = TRUE;
                 $isUpload = TRUE;
             }
         } else {
             $canUpdate = TRUE;
         }
         if ($canUpdate) {
             $id = $this->Editor_Box_Item_model->update($id, $data);
             if ($isUpload && file_exists(EDITOR_IMAGE_THUMBNAIL_PATH . $originalThumb)) {
                 unlink(EDITOR_IMAGE_THUMBNAIL_PATH . $originalThumb);
             }
             $url = base_url() . 'admin_editor/list_box_item';
             set_flash_message($this->lang->line('admin.box.updated'));
             redirect($url);
         }
     } else {
         $this->layout->title('Edit box item');
         $this->layout->view('admin_editor/list_box_item', $data);
     }
 }
Example #15
0
?>
 help-block"> <i class="  fa fa-exclamation-circle"></i> <span id="usernamefield-message"><?php 
echo has_message("usernamefield") ? get_message("usernamefield") : "";
?>
</span></span>
						
					</div>
					<hr class="margin-top-0 margin-left-15  margin-right-15">
					<div class="margin-bottom-0 form-group form-field-form-group  <?php 
echo has_error("passwordfield") ? "has-error" : (has_success("passwordfield") ? "has-success" : "");
?>
"  id="password-field-form-group">
						<div class="input-group">
							<span class="input-group-btn">
								<button id="password-field-btn"  class="form-field-btn btn  <?php 
echo has_error("passwordfield") ? "btn-danger" : (has_success("passwordfield") ? "btn-success" : "btn-default");
?>
" type="button" onclick="this.form.passwordfield.select();">
								<i class="fa fa-key"></i> 
								<span class="form-field-btn-text "> Password </span>
								</button>
							  </span>
							<?php 
$password = array('name' => 'passwordfield', 'value' => "", 'class' => 'text-center form-control', 'placeholder' => 'Password');
echo form_password($password);
?>
							<span class=" input-group-btn form-field-clear-btn-group" id="password-field-clear-btn-group" >
								<button disabled data-target="password" id="password-field-clear-btn"  class="form-field-clear-btn btn  btn-default" type="button">
									<i class="fa fa-times text-danger"></i> 
								</button>
							 </span>
 private function add_research($user_id)
 {
     $translator = $this->_translator;
     $params = array('details' => FILTER_SANITIZE_STRING);
     $inputs = filter_input_array(INPUT_POST, $params);
     extract($inputs);
     if (!has_error()) {
         if ($user_id && $details) {
             ResearchCitation::create($user_id, $details);
         } else {
             add_error($translator->translate("mspr_insufficient_info"));
         }
     }
 }
Example #17
0
function sync_users($soapclient, $session, $clean = false, $is_conversion = false)
{
    $timedate = TimeDate::getInstance();
    global $current_user;
    $last_sync = '1980-07-09 12:00:00';
    $user_id = $soapclient->call('get_user_id', array('session' => $session));
    if ($user_id == '-1') {
        return false;
    }
    if (!$clean && file_exists('modules/Sync/config.php')) {
        require_once 'modules/Sync/config.php';
        if (isset($sync_info['last_syncUsers'])) {
            $last_sync = $sync_info['last_syncUsers'];
        }
    } else {
        clean_for_sync('Users');
        $clean = true;
    }
    $start_time = $timedate->nowDb();
    $GLOBALS['sugar_config']['disable_team_sanity_check'] = true;
    //rrs: bug 27579. This works fine for most installs, but we had a customer in switzerland and the quotes where being
    //removed from the users.id = '<GUID>' in the where clause causing the query to fail.
    $soapclient->charencoding = false;
    $result = $soapclient->call('sync_get_entries', array('session' => $session, 'module_name' => 'Users', 'from_date' => $last_sync, 'to_date' => $start_time, 'offset' => 0, 'max_results' => -99, 'select_fields' => array(), 'query' => "users.id = '{$user_id}'", 'deleted' => 2));
    add_to_msg('Retrieve Current User Record<br>', true, true);
    if (!has_error($result)) {
        //update_progress_bar('records', 55 , 100);
        add_to_msg('Retrieved ' . $result['result_count'] . ' current User Record<br>', true, true);
        $get_entry_list = get_decoded($result['entry_list']);
        //update_progress_bar('records', 65 , 100);
        $done = save_altered('Users', $get_entry_list);
        //update_progress_bar('records', 100 , 100);
        $offset = 0;
        while (true) {
            $result = $soapclient->call('sync_get_entries', array('session' => $session, 'module_name' => 'Users', 'from_date' => $last_sync, 'to_date' => $start_time, 'offset' => $offset, 'max_results' => 50, 'select_fields' => array('user_name', 'id', 'first_name', 'last_name', 'phone_mobile', 'phone_work', 'employee_status', 'reports_to_id', 'title', 'email1', 'email2', 'deleted', 'status'), 'query' => "users.id != '{$user_id}'", 'deleted' => 2));
            if (!has_error($result)) {
                //update_progress_bar('records', 55 , 100);
                add_to_msg('Retrieved ' . $result['result_count'] . ' Records<br>', true, true);
                $get_entry_list = get_decoded($result['entry_list']);
                //update_progress_bar('records', 65 , 100);
                $done = save_altered('Users', $get_entry_list);
                //update_progress_bar('records', 100 , 100);
                add_to_msg('Added ' . $done['add'] . ' Records <br>', true, true);
                add_to_msg('Modified ' . $done['modify'] . ' Records <br>', true, true);
                add_to_msg('Done<br>', true, true);
                if ($result['next_offset'] > $result['total_count']) {
                    break;
                } else {
                    $offset = $result['next_offset'];
                }
            }
        }
        //end while
        restoreUserPassword($user_id);
        require_once 'modules/Sync/config.php';
        $sync_info['last_syncUsers'] = $start_time;
        add_to_msg('Storing Sync Info<BR>', true, true);
        write_array_to_file('sync_info', $sync_info, 'modules/Sync/config.php');
        if ($clean) {
            //now save the admin account/current user back if it's a clean sync just so we can make sure they still exist
            if (empty($current_user->id)) {
                //retrieve the admin user
                $current_user = BeanFactory::getBean('Users', '1');
            }
            $temp_user = BeanFactory::getBean('Users');
            if (!$temp_user->retrieve($current_user->id)) {
                $current_user->new_with_id = true;
                $current_user->team_exists = true;
            }
            unset($current_user->user_preferences);
            //rrs: bug - 32739
            $current_user->default_team = null;
            if (!isset($is_conversion) || $is_conversion == false) {
                $current_user->save(false);
            }
        }
        $GLOBALS['sugar_config']['disable_team_sanity_check'] = false;
        return true;
    }
    if ($clean) {
        //now save the admin account/current user back if it's a clean sync just so we can make sure they still exist
        $temp_user = BeanFactory::getBean('Users');
        if (!$temp_user->retrieve($current_user->id)) {
            $current_user->new_with_id = true;
            $current_user->team_exists = true;
        }
        unset($current_user->user_preferences);
        //rrs: bug - 32739
        $current_user->default_team = null;
        if (!isset($is_conversion) || $is_conversion == false) {
            $current_user->save(false);
        }
    }
    $GLOBALS['sugar_config']['disable_team_sanity_check'] = false;
    return false;
}
/**
 * adds errors, if found. May modify inputs in the process
 * @param string $type
 * @param array $inputs May modify inputs in the process
 * @param mixed $translator
 */
function process_mspr_inputs($type, array &$inputs, $translator)
{
    switch ($type) {
        case 'studentships':
            if (!($inputs['title'] && $inputs['year'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'clineval':
            if (!($inputs['text'] && $inputs['source'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'internal_awards':
            if (!($inputs['award_id'] && $inputs['year'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'external_awards':
            if (!($inputs['title'] && $inputs['terms'] && $inputs['body'] && $inputs['year'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'contributions':
            if (!($inputs['role'] && $inputs['org_event'] && $inputs['start_year'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'student_run_electives':
            if (!($inputs['group_name'] && $inputs['university'] && $inputs['location'] && $inputs['start_year'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'observerships':
            if (!checkDateFormat($inputs['start'])) {
                add_error($translator->translate("mspr_observership_invalid_dates"));
            } else {
                $parts = date_parse($inputs['start']);
                $start_ts = mktime(0, 0, 0, $parts['month'], $parts['day'], $parts['year']);
                if ($inputs['end'] && checkDateFormat($inputs['end'])) {
                    $parts = date_parse($inputs['end']);
                    $end_ts = mktime(0, 0, 0, $parts['month'], $parts['day'], $parts['year']);
                } else {
                    $end_ts = null;
                }
                $inputs['start'] = $start_ts;
                $inputs['end'] = $end_ts;
            }
            if (!$inputs['preceptor_proxy_id']) {
                $inputs['preceptor_proxy_id'] = null;
            }
            if (!$inputs['preceptor_proxy_id'] && !($inputs['preceptor_firstname'] || $inputs['preceptor_lastname'])) {
                add_error($translator->translate("mspr_observership_preceptor_required"));
            }
            if ($inputs['preceptor_proxy_id'] == -1) {
                //special case for "Various"
                $inputs['preceptor_proxy_id'] = 0;
                //not faculty
                $inputs['preceptor_firstname'] = "Various";
                $inputs['preceptor_lastname'] = "";
            }
            if (!has_error() && !($inputs['title'] && $inputs['site'] && $inputs['location'] && $inputs['start'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'int_acts':
            if (!checkDateFormat($inputs['start'])) {
                add_error($translator->translate("mspr_observership_invalid_dates"));
            } else {
                if (!$inputs['end'] || !checkDateFormat($inputs['end'])) {
                    $inputs['end'] = $inputs['start'];
                }
            }
            if (!has_error() && !($inputs['title'] && $inputs['site'] && $inputs['location'] && $inputs['start'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'critical_enquiry':
        case 'community_based_project':
            if (!($inputs['title'] && $inputs['organization'] && $inputs['location'] && $inputs['supervisor'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
        case 'research_citations':
            if (!$inputs['details'] && !is_array($inputs['research_citations'])) {
                add_error($translator->translate("mspr_insufficient_info"));
            }
            break;
    }
}
Example #19
0
 // Display Content
 switch ($STEP) {
     case 2:
         if ($SUCCESS) {
             echo display_success();
         }
         if ($NOTICE) {
             echo display_notice();
         }
         if ($ERROR) {
             echo display_error();
         }
         break;
     case 1:
     default:
         if (has_error() || has_notice()) {
             echo display_status_messages();
         }
         require_once "javascript/evaluations.js.php";
         $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/objectives.js\"></script>";
         $HEAD[] = "<script type=\"text/javascript\"> var SITE_URL = '" . ENTRADA_URL . "'; </script>";
         if (!in_array($PROCESSED["questiontype_id"], array(2, 4))) {
             $HEAD[] = "\n                <script type=\"text/javascript\">\n                    jQuery(document).ready(function() {\n                        modalDescriptorDialog = new Control.Modal(\$('false-link'), {\n                            position:\t\t'center',\n                            overlayOpacity:\t0.75,\n                            closeOnClick:\t'overlay',\n                            className:\t\t'modal',\n                            fade:\t\t\ttrue,\n                            fadeDuration:\t0.30,\n                            width: 455\n                        });\n                    });\n\n                    function openDescriptorDialog(response_number, erdescriptor_id) {\n                        new Ajax.Request('" . ENTRADA_URL . "/admin/evaluations/questions?section=api-descriptors&response_number='+response_number+'&organisation_id=" . $ENTRADA_USER->getActiveOrganisation() . "&erdescriptor_id='+erdescriptor_id, {\n                            method: 'get',\n                            onComplete: function(transport) {\n                                loaded = [];\n                                modalDescriptorDialog.container.update(transport.responseText);\n                                modalDescriptorDialog.open();\n                            }\n                        });\n                    }\n                </script>";
         }
         if ($PROCESSED["questiontype_id"] == 3) {
             $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/objectives_evaluation_rubric.js\"></script>";
             $HEAD[] = "<script type=\"text/javascript\">\n\t\t\t\tvar modalObjectiveDialog;\n\t\t\t\tvar ajax_url = '';\n\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tmodalObjectiveDialog = new Control.Modal(\$('false-link'), {\n\t\t\t\t\t\tposition:\t\t'center',\n\t\t\t\t\t\toverlayOpacity:\t0.75,\n\t\t\t\t\t\tcloseOnClick:\t'overlay',\n\t\t\t\t\t\tclassName:\t\t'modal',\n\t\t\t\t\t\tfade:\t\t\ttrue,\n\t\t\t\t\t\tfadeDuration:\t0.30,\n\t\t\t\t\t\twidth: 755,\n\t\t\t\t\t\tbeforeOpen: function () {\n\t\t\t\t\t\t\tjQuery('#mapped_objectives').width('55%');\n\t\t\t\t\t\t\tjQuery('#default_objective_notice').hide();\n\t\t\t\t\t\t\tjQuery('#alternate_objective_notice').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tfunction openObjectiveDialog (rownum) {\n\t\t\t\t\tvar url = '" . ENTRADA_URL . "/api/evaluations-objectives-list.api.php?qrow='+rownum+'&ids='+\$('objective_ids_string_'+rownum).value;\n\t\t\t\t\tif (url && (url != ajax_url)) {\n\t\t\t\t\t\tajax_url = url;\n\t\t\t\t\t\tnew Ajax.Request(ajax_url, {\n\t\t\t\t\t\t\tmethod: 'get',\n\t\t\t\t\t\t\tonComplete: function(transport) {\n\t\t\t\t\t\t\t\tloaded = [];\n\t\t\t\t\t\t\t\tmodalObjectiveDialog.container.update(transport.responseText);\n\t\t\t\t\t\t\t\tmodalObjectiveDialog.open();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmodalObjectiveDialog.open();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t</script>";
         } else {
             $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/objectives_evaluation_question.js\"></script>";
         }
         ?>
Example #20
0
echo has_error("classtypeAlias") ? "has-error" : (has_success("classtypeAlias") ? "has-success" : "");
?>
">
						<label for="classtypeAliasinput" class="col-sm-4 control-label">Class type Alias</label>
						<div class="col-sm-8">
							<input name="classtypeAlias" type="text" id="classtypeAliasinput" class="form-control" value="<?php 
echo set_value("classtypeAlias", $classtypeinfo ? $classtypeinfo->class_type_alias : "");
?>
" />
							<?php 
echo has_message("classtypeAlias") ? '<span class="help-block">' . get_message("classtypeAlias") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group <?php 
echo has_error("classtypeDescription") ? "has-error" : (has_success("classtypeDescription") ? "has-success" : "");
?>
">
						<label for="classtypeDescriptioninput" class="col-sm-4 control-label">Class type Description</label>
						<div class="col-sm-8">
							<input name="classtypeDescription" type="text" id="classtypeDescriptioninput" class="form-control" value="<?php 
echo set_value("classtypeDescription", $classtypeinfo ? $classtypeinfo->class_type_description : "");
?>
" />
							<?php 
echo has_message("classtypeDescription") ? '<span class="help-block">' . get_message("classtypeDescription") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-4">
Example #21
0
?>
">
						    <label for="inputCurriculumdescription" class="col-sm-4 control-label">Description</label>
						    <div class="col-sm-7">

						    	 <?php 
$data = array('name' => 'curriculumDescription', 'class' => 'form-control', 'id' => 'inputCurriculumdescription', 'value' => has_value("curriculumDescription") ? get_value("curriculumDescription") : set_value("curriculumDescription"), 'rows' => '3', 'cols' => '');
echo form_textarea($data);
if (has_message("curriculumDescription")) {
    echo '<span class="help-block">' . get_message("curriculumDescription") . '</span>';
}
?>
						    </div>
						</div>
						<div class="form-group  create-curriculum-form-group  <?php 
echo has_error("curriculumYear") ? "has-error" : "";
?>
">
						    <label for="inputcurriculumYear" class="col-sm-4 control-label">Year</label>
						    <div class="col-sm-7">
						    	
						     	<?php 
$ystart = 1970;
$now = mdate("%Y", now());
$yend = $now + 10;
?>
						     	<div class="input-group input-append spinner" data-trigger="spinner">
									<input value="<?php 
echo has_value("curriculumYear") ? get_value("curriculumYear") : set_value("curriculumYear");
?>
" type="text" class="form-control" name="curriculumYear" id="inputCurriculumyear" data-min="0" data-max="<?php 
Example #22
0
 public function update()
 {
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     $data = $_POST;
     $data['id'] = $id;
     $data['status'] = isset($data['is_active']) ? STATUS_SHOW : 0;
     $message = $this->validate($data);
     if (!empty($message)) {
         set_flash_error($message);
     }
     if (!has_error()) {
         $result = $this->Config_model->update($id, $data);
         set_flash_message($this->lang->line('admin.config.updated'));
         $url = base_url() . 'config/index';
         redirect($url);
     } else {
         $this->layout->title('Edit Config');
         $this->layout->view('config/edit', $data);
     }
 }
Example #23
0
echo has_error("subjectCode") ? "has-error" : (has_success("subjectCode") ? "has-success" : "");
?>
">
						<label for="subjectCodeinput" class="col-sm-4 control-label">Subject Code</label>
						<div class="col-sm-8">
							<input name="subjectCode" type="text" id="subjectCodeinput" class="form-control" value="<?php 
echo set_value("subjectCode");
?>
" />
							<?php 
echo has_message("subjectCode") ? '<span class="help-block">' . get_message("subjectCode") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group <?php 
echo has_error("subjectDescription") ? "has-error" : (has_success("subjectDescription") ? "has-success" : "");
?>
">
						<label for="subjectDescriptioninput" class="col-sm-4 control-label">Subject Description</label>
						<div class="col-sm-8">
							<?php 
$subjectDescriptioninput = array('name' => 'subjectDescription', 'class' => "form-control", 'id' => 'subjectDescriptioninput', 'value' => set_value("subjectDescription"), 'rows' => '3');
echo form_textarea($subjectDescriptioninput);
?>
							<?php 
echo has_message("subjectDescription") ? '<span class="help-block">' . get_message("subjectDescription") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-4">
Example #24
0
echo has_error("courseCode") ? "has-error" : (has_success("courseCode") ? "has-success" : "");
?>
">
						<label for="courseCodeinput" class="col-sm-4 control-label">Course Code</label>
						<div class="col-sm-8">
							<input name="courseCode" type="text" id="courseCodeinput" class="form-control" value="<?php 
echo set_value("courseCode", $courseinfo ? $courseinfo->course_code : "");
?>
" />
							<?php 
echo has_message("courseCode") ? '<span class="help-block">' . get_message("courseCode") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group <?php 
echo has_error("courseDescription") ? "has-error" : (has_success("courseDescription") ? "has-success" : "");
?>
">
						<label for="courseDescriptioninput" class="col-sm-4 control-label">Course Description</label>
						<div class="col-sm-8">
							<?php 
$courseDescriptioninput = array('name' => 'courseDescription', 'class' => "form-control", 'id' => 'courseDescriptioninput', 'value' => set_value("courseDescription", $courseinfo ? $courseinfo->course_description : ""), 'rows' => '3');
echo form_textarea($courseDescriptioninput);
?>
							<?php 
echo has_message("courseDescription") ? '<span class="help-block">' . get_message("courseDescription") . '</span>' : "";
?>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-4">
Example #25
0
                    } else {
                        add_error("The selected evaluator [" . get_account_data("wholename", $associated_evaluator) . "] has already completed this evaluation [" . $evaluation_title . "] the maximum number of times, and is therefore unable to attempt it again.");
                    }
                } else {
                    add_error("An evaluator must be selected to request an evaluation be completed for you.");
                }
            } else {
                add_error("A valid evaluation must be selected from the drop-down list to request an evaluation be completed for you.");
            }
        } else {
            add_error("A valid evaluation must be selected from the drop-down list to request an evaluation be completed for you.");
        }
    } else {
        add_error("An evaluation must be selected from the drop-down list to request an evaluation be completed for you.");
    }
    if (has_error()) {
        echo display_error();
    }
    if (isset($notifications_sent) && $notifications_sent) {
        add_success("Successfully requested that " . ($notifications_sent > 1 ? $notifications_sent . " evaluators" : get_account_data("wholename", $associated_evaluator)) . " fill out this evaluation [" . $evaluation_title . "] for you.");
        echo display_success();
    }
}
$evaluation_requests = Models_Evaluation::getTargetRequests($ENTRADA_USER->GetID(), false, false, true);
if ($evaluation_requests) {
    $notice_msg = "The following Evaluation Request Codes are still active but unused: <br />";
    foreach ($evaluation_requests as $evaluation_request) {
        $requestee = get_account_data("wholename", $evaluation_request["target_proxy_id"]);
        $notice_msg .= "<br />" . $evaluation_request["evaluation_title"] . " [" . $requestee . "]: <strong>" . $evaluation_request["request_code"] . "</strong>";
    }
    add_notice($notice_msg);
Example #26
0
?>
">    
            </div>
        <div class="col-md-6">
            <label for='input-campus'> And Campus</label>
            <select id="input-campus" name='campus' class='form-control'>
            <option value=''></option>
            <option value=1>Corvallis (Main)</option>
            <option value=2>Cascades</option>
            <option value=3>Online</option>
            </select>
        </div>  
        </div>      
          <p class="help-block">Set a time and place for your study group to meet. You can always change this later.</p>
          <?php 
if (has_error('place')) {
    echo '<p class="help-block">' . htmlspecialchars($errors['place']);
}
?>

          </div>
    </div>

    <?php 
include 'includes/_footer.php';
?>

    <script>
      "use strict";
      $("#user-input").autocomplete({
        minLength: 2,
Example #27
0
 public function update()
 {
     $id = isset($_POST['id']) ? intval($_POST['id']) : 0;
     $data = $_POST;
     $data['id'] = $id;
     if (isset($data['has_sub'])) {
         $data['has_sub'] = 1;
     } else {
         $data['has_sub'] = 0;
     }
     $message = $this->validate($data, true);
     if (!empty($message)) {
         set_flash_error($message);
     }
     $statusSelectbox = selectBox($this->_config['status'], array('Name' => 'status', 'Selected' => $data['status']));
     $data['statusSelectbox'] = $statusSelectbox;
     $allSeries = $this->Series_model->getAllShort();
     $seriesSelectbox = selectBox($allSeries, array('Name' => 'series_id', 'Selected' => $data['series_id']));
     $data['seriesSelectbox'] = $seriesSelectbox;
     if (!has_error()) {
         $result = $this->Video_model->update($id, $data);
         set_flash_message($this->lang->line('admin.video.updated'));
         $url = base_url() . 'admin_video/index';
         redirect($url);
     } else {
         $this->layout->title('Edit video');
         $this->layout->view('admin_video/edit', $data);
     }
 }
 public function process()
 {
     global $ENTRADA_USER;
     $user = $this->_user;
     $translator = $this->_translator;
     $type = $this->type;
     static $valid = array("studentships" => array("add", "remove", "edit"), "clineval" => array("add", "remove", "edit"), "internal_awards" => array("add", "remove", "edit"), "student_run_electives" => array("add", "remove", "edit"), "observerships" => array("add", "remove", "edit"), "int_acts" => array("add", "remove", "edit"), "external_awards" => array("approve", "unapprove", "reject", "add", "edit"), "contributions" => array("approve", "unapprove", "reject", "add", "edit"), "critical_enquiry" => array("approve", "unapprove", "reject", "add", "edit"), "community_based_project" => array("approve", "unapprove", "reject", "add", "edit"), "research_citations" => array("approve", "unapprove", "reject", "add", "edit", "resequence"));
     $section = filter_input(INPUT_GET, 'mspr-section', FILTER_CALLBACK, array('options' => 'strtolower'));
     if ($section) {
         $params = array('entity_id' => FILTER_VALIDATE_INT, 'action' => array('filter' => FILTER_CALLBACK, 'options' => 'strtolower'), 'comment' => FILTER_SANITIZE_STRING, 'user_id' => FILTER_VALIDATE_INT);
         $inputs = filter_input_array(INPUT_POST, $params);
         extract($inputs);
         if (!$action) {
             add_error($translator->translate("mspr_no_action"));
         }
         if (!array_key_exists($section, $valid)) {
             add_error($translator->translate("mspr_invalid_section"));
         } else {
             if (!in_array($action, $valid[$section])) {
                 add_error($translator->translate("mspr_invalid_action"));
             }
         }
         if ($action == "reject" && MSPR_REJECTION_REASON_REQUIRED) {
             if (!$comment) {
                 add_error($translator->translate("mspr_no_reject_reason"));
             }
         }
         if (!has_error() && in_array($action, array("add", "edit", "resequence"))) {
             $inputs = get_mspr_inputs($section);
             process_mspr_inputs($section, $inputs, $translator);
             //modifies inputs/adds errors
         }
         if (!has_error()) {
             $inputs['user_id'] = $user_id;
             if ($action == "add") {
                 if (AUTO_APPROVE_ADMIN_MSPR_SUBMISSIONS) {
                     $inputs['status'] = 1;
                 }
                 switch ($section) {
                     case "clineval":
                         ClinicalPerformanceEvaluation::create($inputs);
                         break;
                     case "observerships":
                         Observership::create($inputs);
                         break;
                     case 'studentships':
                         Studentship::create($inputs);
                         break;
                     case 'internal_awards':
                         InternalAwardReceipt::create($inputs);
                         break;
                     case 'external_awards':
                         ExternalAwardReceipt::create($inputs);
                         break;
                     case 'contributions':
                         Contribution::create($inputs);
                         break;
                     case 'student_run_electives':
                         StudentRunElective::create($inputs);
                         break;
                     case 'int_acts':
                         InternationalActivity::create($inputs);
                         break;
                     case 'critical_enquiry':
                         if (CriticalEnquiry::get($user_id)) {
                             add_error($translator->translate("mspr_too_many_critical_enquiry"));
                         } else {
                             CriticalEnquiry::create($inputs);
                         }
                         break;
                     case 'community_based_project':
                         if (CommunityBasedProject::get($user_id)) {
                             add_error($translator->translate("mspr_too_many_community_based_project"));
                         } else {
                             CommunityBasedProject::create($inputs);
                         }
                         break;
                     case 'research_citations':
                         ResearchCitation::create($inputs);
                         break;
                 }
             } elseif ($action == "resequence") {
                 switch ($section) {
                     case 'research_citations':
                         ResearchCitations::setSequence($user_id, $inputs['research_citations']);
                         break;
                 }
             } else {
                 //everything else requires an entity
                 if ($entity_id) {
                     $entity = get_mspr_entity($section, $entity_id);
                     if ($entity) {
                         switch ($action) {
                             case "approve":
                                 $entity->approve();
                                 break;
                             case "unapprove":
                                 $entity->unapprove();
                                 break;
                             case "remove":
                                 $entity->delete();
                                 break;
                             case "edit":
                                 if ($entity instanceof Approvable) {
                                     if (AUTO_APPROVE_ADMIN_MSPR_EDITS) {
                                         $inputs['comment'] = "";
                                         $inputs['status'] = 1;
                                     } else {
                                         $inputs['comment'] = $entity->getComment();
                                         $inputs['status'] = $entity->getStatus();
                                     }
                                 }
                                 $entity->update($inputs);
                                 //inputs processed above
                                 break;
                             case "reject":
                                 if (MSPR_REJECTION_SEND_EMAIL) {
                                     $sub_info = get_submission_information($entity);
                                     $reason_type = !$comment ? "noreason" : "reason";
                                     $active_user = User::get($ENTRADA_USER->getID());
                                     if ($active_user && $type) {
                                         submission_rejection_notification($reason_type, array("firstname" => $user->getFirstname(), "lastname" => $user->getLastname(), "email" => $user->getEmail()), array("to_fullname" => $user->getFirstname() . " " . $user->getLastname(), "from_firstname" => $active_user->getFirstname(), "from_lastname" => $active_user->getLastname(), "reason" => clean_input($comment, array("notags", "specialchars")), "submission_details" => $sub_info, "application_name" => APPLICATION_NAME . " MSPR System"));
                                     } else {
                                         add_error($translator->translate("mspr_email_failed"));
                                     }
                                 }
                                 $entity->reject($comment);
                                 break;
                         }
                     } else {
                         add_error($translator->translate("mspr_invalid_entity"));
                     }
                 } else {
                     add_error($translator->translate("mspr_no_entity"));
                 }
             }
         }
         switch ($section) {
             case 'studentships':
                 $studentships = Studentships::get($user);
                 display_status_messages();
                 echo display_studentships($studentships, $type);
                 break;
             case 'clineval':
                 $clinical_evaluation_comments = ClinicalPerformanceEvaluations::get($user);
                 display_status_messages();
                 echo display_clineval($clinical_evaluation_comments, $type);
                 break;
             case 'internal_awards':
                 $internal_awards = InternalAwardReceipts::get($user);
                 display_status_messages();
                 echo display_internal_awards($internal_awards, $type);
                 break;
             case 'external_awards':
                 $external_awards = ExternalAwardReceipts::get($user);
                 display_status_messages();
                 echo display_external_awards($external_awards, $type);
                 break;
             case 'contributions':
                 $contributions = Contributions::get($user);
                 display_status_messages();
                 echo display_contributions($contributions, $type);
                 break;
             case 'student_run_electives':
                 $student_run_electives = StudentRunElectives::get($user);
                 display_status_messages();
                 echo display_student_run_electives($student_run_electives, $type);
                 break;
             case 'observerships':
                 $observerships = Observerships::get($user);
                 display_status_messages();
                 echo display_observerships($observerships, $type);
                 break;
             case 'int_acts':
                 $int_acts = InternationalActivities::get($user);
                 display_status_messages();
                 echo display_international_activities($int_acts, $type);
                 break;
             case 'critical_enquiry':
                 $critical_enquiry = CriticalEnquiry::get($user);
                 display_status_messages();
                 echo display_critical_enquiry($critical_enquiry, $type);
                 break;
             case 'community_based_project':
                 $community_based_project = CommunityBasedProject::get($user);
                 display_status_messages();
                 echo display_community_based_project($community_based_project, $type);
                 break;
             case 'research_citations':
                 $research_citations = ResearchCitations::get($user);
                 display_status_messages();
                 echo display_research_citations($research_citations, $type);
                 break;
         }
     }
 }