Exemple #1
0
        $skill->set_value('skillName', $_POST["other_new_skill_name"]);
        // description for now can be the same as the name
        $skill->set_value('skillDescription', $_POST["other_new_skill_name"]);
    } else {
        $failed = TRUE;
    }
    if ($failed == FALSE && $skill->skill_exists() == FALSE) {
        $skill->save();
    }
}
if ($_POST["delete_skill"]) {
    $skill = new skill();
    if ($_POST["new_skill_name"] != "") {
        $skill->set_id($_POST["new_skill_name"]);
        $skill->delete();
    }
}
$skill_classes = skill::get_skill_classes();
$skill_classes[""] = ">> OTHER >>";
$TPL["new_skill_classes"] = page::select_options($skill_classes, $_POST["skill_class"]);
$skills = skill::get_skills();
// if a skill class is selected and a skill that is not in that class is also selected, clear the skill as this is what the filter options will do
if ($skill_class && !in_array($skills[$_POST["skill"]], $skills)) {
    $_POST["skill"] = "";
}
$skills[""] = ">> NEW >>";
$TPL["new_skills"] = page::select_options($skills, $_POST["skill"]);
$TPL["main_alloc_title"] = "Edit Skills - " . APPLICATION_NAME;
if ($current_user->have_perm(PERM_PERSON_READ_MANAGEMENT)) {
    include_template("templates/personSkillAdd.tpl");
}
Exemple #2
0
 function load_person_filter($_FORM)
 {
     global $TPL;
     $current_user =& singleton("current_user");
     $db = new db_alloc();
     $_FORM["showSkills"] and $rtn["show_skills_checked"] = " checked";
     $_FORM["showHours"] and $rtn["show_hours_checked"] = " checked";
     $_FORM["personActive"] and $rtn["show_all_users_checked"] = " checked";
     $employee_expertise = array("" => "Any Expertise", "Novice" => "Novice", "Junior" => "Junior", "Intermediate" => "Intermediate", "Advanced" => "Advanced", "Senior" => "Senior");
     $rtn["employee_expertise"] = page::select_options($employee_expertise, $_FORM["expertise"]);
     $skill_classes = skill::get_skill_classes();
     $rtn["skill_classes"] = page::select_options($skill_classes, $_FORM["skill_class"]);
     $skills = skill::get_skills();
     // if a skill class is selected and a skill that is not in that class is also selected,
     // clear the skill as this is what the filter options will do
     if ($skill_class && !in_array($skills[$_FORM["skill"]], $skills)) {
         $_FORM["skill"] = "";
     }
     $rtn["skills"] = page::select_options($skills, $_FORM["skill"]);
     return $rtn;
 }