Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Curriculum-Request
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
Curriculum-Request
Commits
2d9a4c0d
Commit
2d9a4c0d
authored
14 years ago
by
Tim Steiner
Browse files
Options
Downloads
Patches
Plain Diff
Copy request watchers when forking a compound ACE request
parent
d091d59d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/modules/courses/models/ApprovalActionForkAceModel.php
+16
-0
16 additions, 0 deletions
...ion/modules/courses/models/ApprovalActionForkAceModel.php
with
16 additions
and
0 deletions
application/modules/courses/models/ApprovalActionForkAceModel.php
+
16
−
0
View file @
2d9a4c0d
...
...
@@ -111,6 +111,8 @@ class Courses_ApprovalActionForkAceModel extends Requests_ApprovalActionModel
$newCourses
=
new
Unl_Model_Collection
(
'Courses_CourseModel'
);
$newRequests
=
new
Unl_Model_Collection
(
'Requests_RequestModel'
);
$childParentRequestMap
=
array
();
foreach
(
$requests
as
$request
)
{
// check to see what each of the new request types will be
...
...
@@ -157,6 +159,7 @@ class Courses_ApprovalActionForkAceModel extends Requests_ApprovalActionModel
// create the new request to contain only the ACE data.
$newRequest
=
clone
$request
;
$childParentRequestMap
[]
=
array
(
'child'
=>
$newRequest
,
'parent'
=>
$request
);
if
(
$addAce
)
{
$newRequest
->
setType
(
'AddACEToCourse'
);
}
else
{
...
...
@@ -184,6 +187,19 @@ class Courses_ApprovalActionForkAceModel extends Requests_ApprovalActionModel
Courses_CourseModel
::
save
(
$newCourses
);
// Copy the watchers from the parent requests to the child requests
$db
=
Zend_Registry
::
get
(
'db'
);
foreach
(
$childParentRequestMap
as
$childParentRequests
)
{
$parent
=
$childParentRequests
[
'parent'
];
$child
=
$childParentRequests
[
'child'
];
$sql
=
'INSERT INTO creqRequestWatchers (request, watchingApprovalRole) '
.
$db
->
quoteInto
(
'SELECT ?, watchingApprovalRole '
,
$child
->
getId
())
.
'FROM creqRequestWatchers AS w '
.
$db
->
quoteInto
(
'WHERE w.request=? '
,
$parent
->
getId
());
;
$db
->
query
(
$sql
);
}
// all done... advance all requests and return them for consideration
$allRequests
=
$requests
->
merge
(
$newRequests
);
Requests_ApprovalChainModel
::
advance
(
$requests
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment