Index: openacs-4/packages/recruiting/dotlrn-recruiting.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/Attic/dotlrn-recruiting.info,v diff -u -r1.6 -r1.7 --- openacs-4/packages/recruiting/dotlrn-recruiting.info 2 Aug 2002 18:53:56 -0000 1.6 +++ openacs-4/packages/recruiting/dotlrn-recruiting.info 7 Aug 2002 23:39:19 -0000 1.7 @@ -25,7 +25,11 @@ + + + + @@ -52,13 +56,20 @@ + + + + + + + @@ -73,6 +84,7 @@ + Index: openacs-4/packages/recruiting/sql/postgresql/recruiting-api-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/sql/postgresql/recruiting-api-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/recruiting/sql/postgresql/recruiting-api-create.sql 2 Aug 2002 16:48:26 -0000 1.4 +++ openacs-4/packages/recruiting/sql/postgresql/recruiting-api-create.sql 7 Aug 2002 23:39:19 -0000 1.5 @@ -71,7 +71,9 @@ p_status_type_id alias for $1; begin - update recruiting_status_types set enabled_p=''f'' where status_type_id = p_status_type_id; + update recruiting_status_types + set enabled_p=''f'' + where status_type_id = p_status_type_id; return 1; @@ -84,7 +86,9 @@ p_status_type_id alias for $1; begin - update recruiting_status_types set enabled_p=''t'' where status_type_id = p_status_type_id; + update recruiting_status_types + set enabled_p=''t'' + where status_type_id = p_status_type_id; return 1; @@ -149,7 +153,9 @@ p_criteria_id alias for $1; begin - update recruiting_criteria set enabled_p=''f'' where criteria_id = p_criteria_id; + update recruiting_criteria + set enabled_p=''f'' + where criteria_id = p_criteria_id; return 1; @@ -162,7 +168,9 @@ p_criteria_id alias for $1; begin - update recruiting_criteria set enabled_p=''t'' where criteria_id = p_criteria_id; + update recruiting_criteria + set enabled_p=''t'' + where criteria_id = p_criteria_id; return 1; @@ -181,43 +189,30 @@ end;' language 'plpgsql'; -select define_function_args('recruiting_candidate__new','candidate_id,package_id,first_name,last_name,address1,address2,city,state,zip,zip_plus_four,country,home_phone,cell_phone,email,status,creation_user,creation_ip'); -create function recruiting_candidate__new(integer,integer,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,integer,integer,varchar) +select define_function_args('recruiting_candidate__new','candidate_id,package_id,address1,address2,city,state,zip,zip_plus_four,country,home_phone,cell_phone,email,status,creation_user,creation_ip'); +create function recruiting_candidate__new(integer,integer,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,integer,integer,varchar) returns integer as ' declare p_candidate_id alias for $1; p_package_id alias for $2; - p_first_name alias for $3; - p_last_name alias for $4; - p_address1 alias for $5; - p_address2 alias for $6; - p_city alias for $7; - p_state alias for $8; - p_zip alias for $9; - p_zip_plus_four alias for $10; - p_country alias for $11; - p_home_phone alias for $12; - p_cell_phone alias for $13; - p_email alias for $14; - p_status alias for $15; - p_creation_user alias for $16; - p_creation_ip alias for $17; - v_candidate_id integer; + p_address1 alias for $3; + p_address2 alias for $4; + p_city alias for $5; + p_state alias for $6; + p_zip alias for $7; + p_zip_plus_four alias for $8; + p_country alias for $9; + p_home_phone alias for $10; + p_cell_phone alias for $11; + p_email alias for $12; + p_status alias for $13; + p_creation_user alias for $14; + p_creation_ip alias for $15; begin - v_candidate_id := acs_object__new( - p_candidate_id, - ''recruiting_candidate'', - now(), - p_creation_user, - p_creation_ip, - p_package_id); - - insert into recruiting_candidates + insert into recruiting_candidates_all (candidate_id, package_id, - first_name, - last_name, address1, address2, city, @@ -229,10 +224,8 @@ cell_phone, email, status) - values(v_candidate_id, + values(p_candidate_id, p_package_id, - p_first_name, - p_last_name, p_address1, p_address2, p_city, @@ -245,7 +238,7 @@ p_email, p_status); - return v_candidate_id; + return p_candidate_id; end;' language 'plpgsql'; @@ -258,7 +251,7 @@ delete from recruiting_candidates where candidate_id = p_candidate_id; - perform acs_object__delete(p_candidate_id); + perform person__delete(p_candidate_id); return 1; Index: openacs-4/packages/recruiting/sql/postgresql/recruiting-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/sql/postgresql/recruiting-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/recruiting/sql/postgresql/recruiting-create.sql 2 Aug 2002 16:48:26 -0000 1.5 +++ openacs-4/packages/recruiting/sql/postgresql/recruiting-create.sql 7 Aug 2002 23:39:19 -0000 1.6 @@ -91,11 +91,11 @@ 'recruiting_criteria__name' ); -create table recruiting_candidates ( +create table recruiting_candidates_all ( -- this is a full fledged acs_object candidate_id integer constraint recruiting_candidate_id_fk - references acs_objects(object_id) + references persons(person_id) constraint recruiting_candidate_pk primary key, package_id integer @@ -105,8 +105,6 @@ not null, -- address info - first_name varchar(256), - last_name varchar(256), address1 varchar(2048), address2 varchar(2048), city varchar(1024), @@ -124,14 +122,55 @@ constraint recruiting_status_fk references recruiting_status_types(status_type_id) constraint recruiting_status_nn - not null + not null, + archived_p boolean default 'f' ); +create view recruiting_candidates as + select c.candidate_id, + c.package_id, + p.first_names as first_name, + p.last_name, + c.address1, + c.address2, + c.city, c.state, + c.zip, + c.zip_plus_four, + c.country, + c.home_phone, + c.cell_phone, + c.email, + c.status + from recruiting_candidates_all c, + persons p + where c.candidate_id = p.person_id + and c.archived_p = 'f'; + +create view archived_recruiting_candidates as + select c.candidate_id, + c.package_id, + p.first_names as first_name, + p.last_name, + c.address1, + c.address2, + c.city, c.state, + c.zip, + c.zip_plus_four, + c.country, + c.home_phone, + c.cell_phone, + c.email, + c.status + from recruiting_candidates_all c, + persons p + where c.candidate_id = p.person_id + and c.archived_p = 't'; + select acs_object_type__create_type ( 'recruiting_candidate', 'Recruiting Candidate', 'Recruiting Candidates', - 'acs_object', + 'person', 'recruiting_candidates', 'candidate_id', 'recruiting_candidate', @@ -156,7 +195,7 @@ interviewer_id integer references users(user_id), candidate_id integer - references recruiting_candidates(candidate_id), + references recruiting_candidates_all(candidate_id), should_hire_p boolean, comment varchar(8000) ); Index: openacs-4/packages/recruiting/sql/postgresql/recruiting-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/sql/postgresql/recruiting-drop.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/recruiting/sql/postgresql/recruiting-drop.sql 29 Jul 2002 23:38:09 -0000 1.2 +++ openacs-4/packages/recruiting/sql/postgresql/recruiting-drop.sql 7 Aug 2002 23:39:19 -0000 1.3 @@ -27,15 +27,22 @@ \i recruiting-api-drop.sql +delete from acs_objects where object_type = 'recruiting_rating'; +delete from acs_objects where object_type = 'recruiting_interview'; +delete from acs_objects where object_type = 'recruiting_candidate'; +delete from acs_objects where object_type = 'recruiting_criteria'; +delete from acs_objects where object_type = 'recruiting_status_type'; + select acs_object_type__drop_type('recruiting_rating', 't'); select acs_object_type__drop_type('recruiting_interview', 't'); select acs_object_type__drop_type('recruiting_candidate', 't'); select acs_object_type__drop_type('recruiting_criteria', 't'); select acs_object_type__drop_type('recruiting_status_type', 't'); - drop table recruiting_ratings; drop table recruiting_interviews; -drop table recruiting_candidates; +drop view recruiting_candidates; +drop view archived_recruiting_candidates; +drop table recruiting_candidates_all; drop table recruiting_criteria; drop table recruiting_status_types; Index: openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs-postgresql.xql 2 Aug 2002 16:48:26 -0000 1.6 +++ openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs-postgresql.xql 7 Aug 2002 23:39:19 -0000 1.7 @@ -25,7 +25,7 @@ - + update recruiting_status_types set short_desc = :short_desc, @@ -86,11 +86,27 @@ - delete from recruiting_candidates + delete from recruiting_candidates_all where candidate_id = :candidate_id + + + update recruiting_candidates_all + set archived_p = 't' + where candidate_id = :candidate_id + + + + + + update recruiting_candidates_all + set archived_p = 'f' + where candidate_id = :candidate_id + + + select package_id, @@ -116,10 +132,8 @@ - update recruiting_candidates - set first_name = :first_name, - last_name = :last_name, - address1 = :address1, + update recruiting_candidates_all + set address1 = :address1, address2 = :address2, city = :city, state = :state, Index: openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs.tcl 2 Aug 2002 18:53:56 -0000 1.8 +++ openacs-4/packages/recruiting/tcl/dotlrn-recruiting-procs.tcl 7 Aug 2002 23:39:19 -0000 1.9 @@ -196,6 +196,7 @@ } ad_proc -public new { + {-candidate_id:required} {-first_name:required} {-last_name:required} {-address1:required} @@ -219,6 +220,7 @@ } set extra_vars [ns_set create] + ns_set put $extra_vars candidate_id $candidate_id ns_set put $extra_vars package_id $package_id ns_set put $extra_vars first_name $first_name ns_set put $extra_vars last_name $last_name @@ -249,6 +251,22 @@ db_dml delete_candidate {} } + ad_proc -public archive { + {-candidate_id:required} + } { + archive a candidate + } { + db_dml archive_candidate {} + } + + ad_proc -public unarchive { + {-candidate_id:required} + } { + unarchive a candidate + } { + db_dml unarchive_candidate {} + } + ad_proc -public get { {-candidate_id:required} } { @@ -296,6 +314,11 @@ } { update a candidate } { + person::update \ + -person_id $candidate_id \ + -first_names $first_name \ + -last_name $last_name + db_dml update_candidate {} } Index: openacs-4/packages/recruiting/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/recruiting/www/index.adp 1 Aug 2002 21:18:09 -0000 1.1 +++ openacs-4/packages/recruiting/www/index.adp 7 Aug 2002 23:39:19 -0000 1.2 @@ -1,8 +1,4 @@ @context_bar@ -
<%= [table::outputTable summary] %> - -<%= [table::outputTable options] %> -
Index: openacs-4/packages/recruiting/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/recruiting/www/index.tcl 1 Aug 2002 21:18:09 -0000 1.1 +++ openacs-4/packages/recruiting/www/index.tcl 7 Aug 2002 23:39:19 -0000 1.2 @@ -16,16 +16,12 @@ if {$new_interviews} { table::addUnsortedRow summary [list "You have $new_interviews new interviews to complete."] +} else { + table::addUnsortedRow summary [list "You don't have any new interviews to complete."] } + if {$old_interviews} { - table::addUnsortedRow summary [list "You have $old_interviews completed interviews."] + table::addUnsortedRow summary [list "You may view your $old_interviews completed interviews."] } -if {!($old_interviews || $new_interviews)} { - table::addUnsortedRow summary [list "You have no recruiting summary."] -} - -table::setTitle options "Options" -table::addUnsortedRow options [list "There are currently no options"] - set context_bar [list "Recruiting"] Index: openacs-4/packages/recruiting/www/admin/#assign-candidate-interview-3.tcl# =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/#assign-candidate-interview-3.tcl#,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/#assign-candidate-interview-3.tcl# 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,16 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: #assign-candidate-interview-3.tcl#,v 1.1 2002/08/07 23:39:19 chak Exp $ +} { + candidate_id:notnull + search_user_id:notnull +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + Index: openacs-4/packages/recruiting/www/admin/archive-candidate.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/archive-candidate.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/archive-candidate.adp 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,5 @@ + +@context_bar@ + +<%= [table::outputTable archive] %> + Index: openacs-4/packages/recruiting/www/admin/archive-candidate.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/archive-candidate.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/archive-candidate.adp~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,5 @@ + +@context_bar@ + +<%= [table::outputTable delete] %> + Index: openacs-4/packages/recruiting/www/admin/archive-candidate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/archive-candidate.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/archive-candidate.tcl 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: archive-candidate.tcl,v 1.1 2002/08/07 23:39:19 chak Exp $ +} { + candidate_id:notnull + referrer:notnull + {archive_p "notyet"} +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +if {$archive_p == "notyet"} { + + array set candidate_info [recruiting_candidate::get -candidate_id $candidate_id] + + table::setTitle archive "Archiving $candidate_info(first_name) $candidate_info(last_name)" + table::setForm archive [ns_conn url] + table::addUnsortedRow archive [list "

Archiving a candidate will hide all their information from users of the system other than administrators such as yourself.
You will be able to unarchive the user at a later date if you so desire.

Are you sure you want to archive $candidate_info(first_name) $candidate_info(last_name)?.


[export_form_vars referrer candidate_id]

"] + + set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] [list "list-candidates" "Candidates"] "Archive Candidate"] + + ad_return_template + +} else { + + if {$archive_p == "Yes"} { + recruiting_candidate::archive -candidate_id $candidate_id + ns_returnredirect list-candidates + } else { + ns_returnredirect [ns_urldecode $referrer] + } + +} Index: openacs-4/packages/recruiting/www/admin/archive-candidate.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/archive-candidate.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/archive-candidate.tcl~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: archive-candidate.tcl~,v 1.1 2002/08/07 23:39:19 chak Exp $ +} { + candidate_id:notnull + referrer:notnull + {delete_p "notyet"} +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +if {$delete_p == "notyet"} { + + array set candidate_info [recruiting_candidate::get -candidate_id $candidate_id] + + table::setTitle delete "Deleting $candidate_info(first_name) $candidate_info(last_name)" + table::setForm delete [ns_conn url] + table::addUnsortedRow delete [list "

This will completely remove this candidate and all their information from the system.
If instead all you want to do is make this candidate invisible, archive them instead.
Are you sure you want to delete $candidate_info(first_name) $candidate_info(last_name)?.


[export_form_vars referrer candidate_id]

"] + + set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] [list "list-candidates" "Candidates"] "Delete Candidate"] + + ad_return_template + +} else { + + if {$delete_p == "Yes"} { + recruiting_candidate::delete -candidate_id $candidate_id + ns_returnredirect list-candidates + } else { + ns_returnredirect [ns_urldecode $referrer] + } + +} Index: openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.adp 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,4 @@ + +@context_bar@ + + Index: openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/assign-candidate-interview-2.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.adp~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,17 @@ + + + +@context_bar@ + + + + + + There are no candidate status types defined. You must define a status type before creating candidates. + + + Index: openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.tcl 31 Jul 2002 23:54:00 -0000 1.1 +++ openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.tcl 7 Aug 2002 23:39:19 -0000 1.2 @@ -12,11 +12,64 @@ } set package_id [ad_conn package_id] + +set node_id [ad_conn node_id] +set package_url [site_node::get_url -node_id $node_id] + set user_id [ad_verify_and_get_user_id] -recruiting_interview::new \ +array set candidate_info [recruiting_candidate::get -candidate_id $candidate_id] + +form create msg +element create msg subject \ + -label "Subject:" \ + -datatype text \ + -widget text \ + -html {size 50} \ + -value "New recruiting interview assignment for you" + +element create msg body \ + -label "Email:" \ + -datatype text \ + -widget textarea \ + -html {rows 10 cols 60 wrap soft} \ + -value " + +Dear [person::name -person_id $search_user_id], + +Please interview [person::name -person_id $candidate_id] at your earliest convenience. When you have completed the interview, please go to [ad_parameter -package_id [ad_acs_kernel_id] SystemURL ""]$package_url and rate the candidate. + +Thank you, +[person::name -person_id $user_id]" + +element create msg candidate_id \ + -widget hidden \ + -value $candidate_id + +element create msg search_user_id\ + -widget hidden \ + -value $search_user_id + +if {[form is_valid msg]} { + form get_values msg \ + subject body + + set sender_email [db_string get_sender_email {}] + set interviewer_email [db_string get_interviewer_email {}] + + catch {ns_sendmail $interviewer_email $sender_email "$subject" "$body"} message_send_errors + + recruiting_interview::new \ -interviewer_id $search_user_id \ -candidate_id $candidate_id \ -package_id $package_id -ns_returnredirect view-one-candidate?[export_vars candidate_id] + ns_returnredirect view-one-candidate?[export_vars candidate_id] + ad_script_abort +} + +set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] [list "list-candidates" "Candidates"] [list "view-one-candidate?[export_vars candidate_id]" "One Candidate"] "Assign Interview"] + +ad_return_template + + Index: openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/assign-candidate-interview-2.xql 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + select email as interviewer_email + from registered_users + where user_id=:search_user_id + + + + + + select email as sender_email + from registered_users + where user_id=:user_id + + + + Index: openacs-4/packages/recruiting/www/admin/change-candidate-status.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/change-candidate-status.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/recruiting/www/admin/change-candidate-status.xql 2 Aug 2002 18:53:56 -0000 1.1 +++ openacs-4/packages/recruiting/www/admin/change-candidate-status.xql 7 Aug 2002 23:39:19 -0000 1.2 @@ -3,7 +3,7 @@ - update recruiting_candidates + update recruiting_candidates_all set status = :status where candidate_id = :candidate_id Index: openacs-4/packages/recruiting/www/admin/delete-candidate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/delete-candidate.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/recruiting/www/admin/delete-candidate.tcl 2 Aug 2002 18:53:56 -0000 1.2 +++ openacs-4/packages/recruiting/www/admin/delete-candidate.tcl 7 Aug 2002 23:39:19 -0000 1.3 @@ -21,7 +21,7 @@ table::setTitle delete "Deleting $candidate_info(first_name) $candidate_info(last_name)" table::setForm delete [ns_conn url] - table::addUnsortedRow delete [list "

Are you sure you want to delete $candidate_info(first_name) $candidate_info(last_name)?

[export_form_vars referrer candidate_id]
"] + table::addUnsortedRow delete [list "

This will completely remove this candidate and all their information from the system.
If instead all you want to do is make this candidate invisible, archive them instead.
Are you sure you want to delete $candidate_info(first_name) $candidate_info(last_name)?.


[export_form_vars referrer candidate_id]

"] set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] [list "list-candidates" "Candidates"] "Delete Candidate"] Index: openacs-4/packages/recruiting/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/index.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/recruiting/www/admin/index.adp 31 Jul 2002 23:54:00 -0000 1.3 +++ openacs-4/packages/recruiting/www/admin/index.adp 7 Aug 2002 23:39:19 -0000 1.4 @@ -1,8 +1,8 @@ @context_bar@ -
+
<%= [table::outputTable summary] %> - -<%= [table::outputTable options] %> + +<%= [table::outputTable setup] %>
Index: openacs-4/packages/recruiting/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/recruiting/www/admin/index.tcl 31 Jul 2002 23:54:00 -0000 1.2 +++ openacs-4/packages/recruiting/www/admin/index.tcl 7 Aug 2002 23:39:19 -0000 1.3 @@ -11,12 +11,32 @@ set package_id [ad_conn package_id] set user_id [ad_verify_and_get_user_id] -table::setTitle options "Recruiting Administration Options" -table::addUnsortedRow options [list "Candidate Administration"] -table::addUnsortedRow options [list "Candidate status types"] -table::addUnsortedRow options [list "Interview criteria Administration"] +db_1row status_types_defined_p {} +db_1row criteria_defined_p {} +if {!$status_types_defined_p} { + set status_types_msg "
There are no status types defined. You must defined status types before you can add and adminster candidates." +} else { + set status_types_msg "" +} + +if {!$criteria_defined_p} { + set criteria_msg "
No interviews criteria has been defined. You should define some interview criteria before you begin assigning interviews." +} else { + set criteria_msg "" +} + +table::setTitle setup "Setup" +table::addUnsortedRow setup [list "Candidate status types$status_types_msg"] +table::addUnsortedRow setup [list "Interview criteria$criteria_msg"] + +db_1row get_num_candidates {} +db_1row get_pending_interviews {} +db_1row get_num_archived_candidates {} + table::setTitle summary "Summary Information" -table::addUnsortedRow summary [list "Summary Info will go here"] +table::addUnsortedRow summary [list "Candidates: $num_candidates" "(candidate administration)"] +table::addUnsortedRow summary [list "Pending Interviews: $pending_interviews" "(view interviews)"] +table::addUnsortedRow summary [list "$num_archived_candidates candidates have been archived" "(view archived candidates)"] set context_bar [list [list "../" "Recruiting"] "Admin"] Index: openacs-4/packages/recruiting/www/admin/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/index.xql 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,44 @@ + + + + + + select count(*) as status_types_defined_p + from recruiting_status_types + where enabled_p = 't'; + + + + + + select count(*) as criteria_defined_p + from recruiting_criteria + where enabled_p = 't'; + + + + + + select count(*) as num_candidates + from recruiting_candidates + + + + + + select count(*) as pending_interviews + from recruiting_interviews i + where (select count(*) + from recruiting_ratings r + where r.interview_id = i.interview_id) = 0 + + + + + + select count(*) as num_archived_candidates + from archived_recruiting_candidates + + + + Index: openacs-4/packages/recruiting/www/admin/index.xql~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/index.xql~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/index.xql~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,37 @@ + + + + + + select count(*) as status_types_defined_p + from recruiting_status_types + where enabled_p = 't'; + + + + + + select count(*) as criteria_defined_p + from recruiting_critera + where enabled_p = 't'; + + + + + + select count(*) as num_candidates + from recruiting_candidates + + + + + + select count(*) as pending_interviews + from recruiting_interviews i + where (select count(*) + from recruiting_ratings r + where r.interview_id = i.interview_id) = 0 + + + + Index: openacs-4/packages/recruiting/www/admin/list-archived-candidates.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-archived-candidates.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-archived-candidates.adp 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,5 @@ + +@context_bar@ + +<%= [table::outputTable archived] %> + Index: openacs-4/packages/recruiting/www/admin/list-archived-candidates.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/list-archived-candidates.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-archived-candidates.adp~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,11 @@ + +@context_bar@ + + + +
+<%= [table::outputTable candidates] %> + +<%= [table::outputTable options] %> +
+ Index: openacs-4/packages/recruiting/www/admin/list-archived-candidates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-archived-candidates.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-archived-candidates.tcl 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,28 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: list-archived-candidates.tcl,v 1.1 2002/08/07 23:39:19 chak Exp $ +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +table::setTitle archived "Archived Candidates" +table::setColumnHeadings archived [list "Name" "Location" "Status"] +db_foreach get_archived_candidates {} { + table::addSortableRow archived [list "$candidate_name
($email)" \ + "$city, $state" \ + "$status" \ + "(unarchive)"] +} if_no_rows { + table::addSortableRow archived [list "There are no archived candidates. You may go back to administration or view unarchived candidates."] +} + + +set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] "Archived Candidates"] + +ad_return_template Index: openacs-4/packages/recruiting/www/admin/list-archived-candidates.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/list-archived-candidates.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-archived-candidates.tcl~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,34 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: list-archived-candidates.tcl~,v 1.1 2002/08/07 23:39:19 chak Exp $ +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +set referrer [ns_urlencode [ns_conn url]] + +table::setTitle candidates "Recruiting Candidates" +table::setColumnHeadings candidates [list "Name" "Location" "Status" "Interviews"] +table::setColumnAlignment candidates [list left left left center left] +db_foreach get_candidates {} { + table::addSortableRow candidates [list "$first_name $last_name
($email)" \ + "$city, $state" \ + "$status" \ + "$num_completed_interviews out of $num_interviews
completed" \ + "(details) (Delete this candidate)"] +} if_no_rows { + table::addSortableRow candidates [list "No Candidates"] +} + +table::setTitle options "Options" +table::addUnsortedRow options [list "Add a new candidate"] + +set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] "Candidates"] + +ad_return_template Index: openacs-4/packages/recruiting/www/admin/list-archived-candidates.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-archived-candidates.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-archived-candidates.xql 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,19 @@ + + + + + + select c.candidate_id, + c.last_name||', '||c.first_name as candidate_name, + c.city, + c.state, + c.email, + s.short_desc as status + from archived_recruiting_candidates c, + recruiting_status_types s + where c.status = s.status_type_id + order by c.last_name + + + + Index: openacs-4/packages/recruiting/www/admin/list-archived-candidates.xql~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/list-archived-candidates.xql~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-archived-candidates.xql~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + select c.candidate_id, + c.first_name, + c.last_name, + c.city, + c.state, + c.email, + s.short_desc as status, + (select count(*) + from recruiting_interviews i + where i.candidate_id = c.candidate_id) as num_interviews, + (select count(*) from recruiting_interviews i + where i.candidate_id = c.candidate_id + and (select count(*) + from recruiting_ratings r + where r.interview_id = i.interview_id) != 0) as num_completed_interviews + from recruiting_candidates c, + recruiting_status_types s + where c.status = s.status_type_id + order by c.last_name + + + + Index: openacs-4/packages/recruiting/www/admin/list-candidates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-candidates.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/recruiting/www/admin/list-candidates.tcl 2 Aug 2002 16:48:26 -0000 1.5 +++ openacs-4/packages/recruiting/www/admin/list-candidates.tcl 7 Aug 2002 23:39:19 -0000 1.6 @@ -28,6 +28,7 @@ table::setTitle options "Options" table::addUnsortedRow options [list "Add a new candidate"] +table::addUnsortedRow options [list "View archived candidates"] set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] "Candidates"] Index: openacs-4/packages/recruiting/www/admin/list-interviews.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-interviews.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-interviews.adp 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,4 @@ + +@context_bar@ + +<%= [table::outputTable interviews] %> Index: openacs-4/packages/recruiting/www/admin/list-interviews.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/list-interviews.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-interviews.adp~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,8 @@ + +@context_bar@ + +
+<%= [table::outputTable summary] %> + +<%= [table::outputTable setup] %> +
Index: openacs-4/packages/recruiting/www/admin/list-interviews.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-interviews.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-interviews.tcl 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: list-interviews.tcl,v 1.1 2002/08/07 23:39:19 chak Exp $ +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +table::setTitle interviews "Pending Interviews" +table::setColumnHeadings interviews [list "Candidate" "Interviewer" "Assigned"] +db_foreach pending_interviews {} { + table::addSortableRow interviews [list "$candidate_name" "$interviewer_name" "$assigned_date"] +} if_no_rows { + table::addSortableRow interviews [list "There are no pending interviews"] +} + +set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] "Pending Interviews"] Index: openacs-4/packages/recruiting/www/admin/list-interviews.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/list-interviews.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-interviews.tcl~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,20 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: list-interviews.tcl~,v 1.1 2002/08/07 23:39:19 chak Exp $ +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +table::setTitle interviews "Pending Interviews" +table::setColumnHeadings interviews [list "Candidate" "Interviewer" "Assigned"] +db_foreach pending_interviews { + table::addSortableRow interviews [list "$candidate_name" "$interviewer_name" "$assigned_date"] +} + +set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] "Pending Interviews"] Index: openacs-4/packages/recruiting/www/admin/list-interviews.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/list-interviews.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-interviews.xql 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,24 @@ + + + + + + select u.user_id as interviewer_id, + u.first_names||' '||u.last_name as interviewer_name, + c.candidate_id, + c.first_name||' '||c.last_name as candidate_name, + date(a.creation_date) as assigned_date + from registered_users u, + recruiting_candidates c, + recruiting_interviews i, + acs_objects a + where i.interviewer_id = u.user_id + and i.candidate_id = c.candidate_id + and i.interview_id = a.object_id + and (select count(*) + from recruiting_ratings r + where r.interview_id = i.interview_id) = 0; + + + + Index: openacs-4/packages/recruiting/www/admin/list-interviews.xql~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/list-interviews.xql~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/list-interviews.xql~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,9 @@ + + + + + + + + + Index: openacs-4/packages/recruiting/www/admin/new-candidate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/new-candidate.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/recruiting/www/admin/new-candidate.tcl 2 Aug 2002 18:53:56 -0000 1.4 +++ openacs-4/packages/recruiting/www/admin/new-candidate.tcl 7 Aug 2002 23:39:19 -0000 1.5 @@ -108,7 +108,12 @@ home_phone cell_phone \ email status + set person_id [person::new \ + -first_names $first_name \ + -last_name $last_name] + recruiting_candidate::new \ + -candidate_id $person_id \ -first_name $first_name \ -last_name $last_name \ -address1 $address1 \ @@ -123,7 +128,7 @@ -email $email \ -status $status - ad_returnredirect list-candidates + ns_returnredirect list-candidates ad_script_abort } Index: openacs-4/packages/recruiting/www/admin/unarchive-candidate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/unarchive-candidate.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/unarchive-candidate.tcl 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,18 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: unarchive-candidate.tcl,v 1.1 2002/08/07 23:39:19 chak Exp $ +} { + candidate_id:notnull +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + +recruiting_candidate::unarchive -candidate_id $candidate_id + +ns_returnredirect list-archived-candidates Index: openacs-4/packages/recruiting/www/admin/unarchive-candidate.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/Attic/unarchive-candidate.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/recruiting/www/admin/unarchive-candidate.tcl~ 7 Aug 2002 23:39:19 -0000 1.1 @@ -0,0 +1,15 @@ +ad_page_contract { + recruiting admin interface + access admin function such as: criteria specification + and interviewee status types + + @author chak (chak@openforce.net) + @creation-date 2002-07-30 + @version $Id: unarchive-candidate.tcl~,v 1.1 2002/08/07 23:39:19 chak Exp $ +} { + candidate_id:notnull +} + +set package_id [ad_conn package_id] +set user_id [ad_verify_and_get_user_id] + Index: openacs-4/packages/recruiting/www/admin/view-one-candidate.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/view-one-candidate.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/recruiting/www/admin/view-one-candidate.adp 31 Jul 2002 23:54:00 -0000 1.1 +++ openacs-4/packages/recruiting/www/admin/view-one-candidate.adp 7 Aug 2002 23:39:19 -0000 1.2 @@ -5,6 +5,8 @@
<%= [table::outputTable candidate] %>

+<%= [table::outputTable resume] %> +

<%= [table::outputTable interviews] %>

<%= [table::outputTable options] %> Index: openacs-4/packages/recruiting/www/admin/view-one-candidate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/view-one-candidate.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/recruiting/www/admin/view-one-candidate.tcl 2 Aug 2002 18:53:56 -0000 1.6 +++ openacs-4/packages/recruiting/www/admin/view-one-candidate.tcl 7 Aug 2002 23:39:19 -0000 1.7 @@ -41,19 +41,17 @@ table::setTitle interviews "Interviews for this candidate" table::setColumnHeadings interviews [list \ "Interviewer" \ - "Ratings" \ + "Completed?" \ "Average Rating" \ "Recommends Hiring" ] -table::setColumnAlignment interviews [list left left center center] - +table::setColumnAlignment interviews [list left center center center] table::setExportVars interviews [export_vars candidate_id] - db_foreach get_interviews {} { table::addUnsortedRow interviews [list \ "$last_name, $first_names" \ - "$num_ratings out of $possible_ratings" \ + "$completed_p" \ "[db_string get_average_rating {}]" \ "[db_string get_should_hire_p {}]" \ "(view ratings) @@ -68,8 +66,15 @@ table::addUnsortedRow options [list "Edit Information"] table::addUnsortedRow options [list "Change Status"] table::addUnsortedRow options [list "Assign Interview"] +table::addUnsortedRow options [list "Archive this candidate"] table::addUnsortedRow options [list "Delete this candidate"] +set attach_url [attachments::add_attachment_url -object_id $candidate_id -return_url "[ns_conn url]?[export_vars candidate_id]"] + +table::setTitle resume "Resume" +table::addUnsortedRow resume [list "No resume uploaded. (upload a resume)"] + + set context_bar [list [list "../" "Recruiting"] [list "index" "Admin"] [list "list-candidates" "Candidates"] "One Candidate"] ad_return_template Index: openacs-4/packages/recruiting/www/admin/view-one-candidate.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/recruiting/www/admin/view-one-candidate.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/recruiting/www/admin/view-one-candidate.xql 1 Aug 2002 22:14:37 -0000 1.2 +++ openacs-4/packages/recruiting/www/admin/view-one-candidate.xql 7 Aug 2002 23:39:19 -0000 1.3 @@ -6,9 +6,13 @@ p.person_id, p.first_names, p.last_name, - (select count(*) - from recruiting_ratings r - where r.interview_id = i.interview_id) as num_ratings + (CASE + WHEN (select count(*) + from recruiting_ratings r + where r.interview_id = i.interview_id) = 0 + THEN 'No' + ELSE 'Yes' + END) as completed_p from persons p, recruiting_interviews i where i.interviewer_id = p.person_id