Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
School of Music Attendance
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tim Steiner
School of Music Attendance
Merge requests
!4
Check for existence of course before importing enrollment or staff assignment.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Check for existence of course before importing enrollment or staff assignment.
check-course-on-import
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Roger Feese
requested to merge
check-course-on-import
into
master
7 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
8e490af8
1 commit,
7 years ago
1 file
+
22
−
15
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
include/functions.inc.php
+
22
−
15
Options
@@ -776,12 +776,14 @@ function load_enrol($db, $filesBaseDir)
);
$findPeople
=
"SELECT nuid FROM people WHERE nuid = ?"
;
$findEnrol
=
"SELECT enrollment_id FROM enrollments WHERE course_id = ? AND nuid = ?"
;
$findEnrol
=
"SELECT enrollment_id FROM enrollments WHERE course_id = ? AND nuid = ?"
;
$findCourse
=
"SELECT course_id FROM courses WHERE course_id = ?"
;
$existingPerson
=
$db
->
GetOne
(
$findPeople
,
array
(
$nuid
));
$existingEnrol
=
$db
->
GetOne
(
$findEnrol
,
array
(
$courseId
,
$nuid
));
$existingEnrol
=
$db
->
GetOne
(
$findEnrol
,
array
(
$courseId
,
$nuid
));
$existingCourse
=
$db
->
GetOne
(
$findCourse
,
array
(
$courseId
));
if
(
$lineItems
[
2
]
!=
'W'
)
{
if
(
$existingCourse
&&
$lineItems
[
2
]
!=
'W'
)
{
if
(
!
$existingPerson
)
{
import_person_from_ldap
(
$nuid
);
@@ -832,23 +834,28 @@ function load_staff($db, $filesBaseDir)
);
$findPeople
=
"SELECT nuid FROM people WHERE nuid = ?"
;
$findStaff
=
"SELECT assignment_id FROM staff_assignments WHERE course_id = ? AND nuid = ?"
;
$findStaff
=
"SELECT assignment_id FROM staff_assignments WHERE course_id = ? AND nuid = ?"
;
$findCourse
=
"SELECT course_id FROM courses WHERE course_id = ?"
;
$existingPerson
=
$db
->
GetOne
(
$findPeople
,
array
(
$nuid
));
$existingStaff
=
$db
->
GetOne
(
$findStaff
,
array
(
$courseId
,
$nuid
));
$existingStaff
=
$db
->
GetOne
(
$findStaff
,
array
(
$courseId
,
$nuid
));
$existingCourse
=
$db
->
GetOne
(
$findCourse
,
array
(
$courseId
));
if
(
!
$existing
Person
)
if
(
$existing
Course
)
{
import_person_from_ldap
(
$nuid
);
}
if
(
!
$existingPerson
)
{
import_person_from_ldap
(
$nuid
);
}
if
(
$existingStaff
)
{
auto_update
(
$db
,
'staff_assignments'
,
$staffData
,
'assignment_id'
,
$existingStaff
[
'assignment_id'
]);
}
else
if
(
$existingPerson
)
{
auto_insert
(
$db
,
'staff_assignments'
,
$staffData
);
if
(
$existingStaff
)
{
auto_update
(
$db
,
'staff_assignments'
,
$staffData
,
'assignment_id'
,
$existingStaff
[
'assignment_id'
]);
}
else
if
(
$existingPerson
)
{
auto_insert
(
$db
,
'staff_assignments'
,
$staffData
);
}
}
}
fclose
(
$handle
);
Loading