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
16821499
Commit
16821499
authored
16 years ago
by
Tim Steiner
Browse files
Options
Downloads
Patches
Plain Diff
Add through-date iACE report.
parent
393c4b4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
application/modules/iace/controllers/ReportsController.php
+83
-0
83 additions, 0 deletions
application/modules/iace/controllers/ReportsController.php
application/modules/iace/views/scripts/reports/through-date.phtml
+41
-0
41 additions, 0 deletions
...ion/modules/iace/views/scripts/reports/through-date.phtml
with
124 additions
and
0 deletions
application/modules/iace/controllers/ReportsController.php
+
83
−
0
View file @
16821499
...
...
@@ -94,4 +94,87 @@ class Iace_ReportsController extends App_Controller_Action
$this
->
view
->
endDate
=
$endDate
->
subDay
(
1
);
}
public
function
throughDateAction
()
{
$filters
=
array
();
$validators
=
array
(
'year'
=>
'Digits'
,
'month'
=>
'Digits'
,
'day'
=>
'Digits'
,
'sort'
=>
'Alpha'
);
$in
=
new
Zend_Filter_Input
(
$filters
,
$validators
,
$this
->
_getAllParams
());
if
(
$in
->
isValid
())
{
$endDate
=
new
Zend_Date
();
$endDate
->
setYear
(
$in
->
year
);
$endDate
->
setMonth
(
$in
->
month
);
$endDate
->
setDay
(
$in
->
day
);
$endDate
->
setHour
(
0
);
$endDate
->
setMinute
(
0
);
$endDate
->
setSecond
(
0
);
$endDate
->
addDay
(
1
);
}
else
{
$endDate
=
new
Zend_Date
(
0
);
}
$db
=
Zend_Registry
::
get
(
'db'
);
$select
=
new
Zend_Db_Select
(
$db
);
$select
->
from
(
array
(
'h'
=>
'creqApprovalHistories'
),
array
(
'time'
));
$select
->
join
(
array
(
'r'
=>
'creqRequests'
),
'h.request = r.requestId'
,
array
(
'r.requestId'
));
$select
->
where
(
'h.approvalActionName = ?'
,
'Make Official'
);
$select
->
where
(
'r.type = 7'
);
$select
->
where
(
'h.time < ?'
,
$endDate
->
getTimestamp
());
$data
=
$select
->
query
()
->
fetchAll
();
$requestIds
=
array
();
$finalizeTimes
=
array
();
foreach
(
$data
as
$row
)
{
$requestIds
[]
=
$row
[
'requestId'
];
$finalizeTimes
[
$row
[
'requestId'
]]
=
$row
[
'time'
];
}
$requests
=
Requests_RequestModel
::
find
(
$requestIds
);
$courses
=
Courses_CourseModel
::
findLatestOfRequest
(
$requests
);
$courses
->
orderBy
(
'getCourseCode'
);
$data
=
new
Unl_Model_Collection
(
'Unl_Model_Array'
);
foreach
(
$courses
as
$requestId
=>
$course
)
{
$request
=
$requests
[
$requestId
];
$finalizeTime
=
$finalizeTimes
[
$request
->
getId
()];
foreach
(
$course
->
getAceOutcomes
()
as
$aceOutcome
)
{
$data
[]
=
new
Unl_Model_Array
(
array
(
'slo'
=>
substr
(
$aceOutcome
[
'slo'
],
3
),
'courseCode'
=>
$course
->
getCourseCode
(),
'college'
=>
$course
->
getCollege
(),
'title'
=>
$course
->
getTitle
(),
'finalizeTime'
=>
$finalizeTime
,
'requestId'
=>
$request
->
getId
()
));
}
}
$session
=
new
Zend_Session_Namespace
(
__CLASS__
);
$sortBy
=
$session
->
sortBy
;
if
(
!
Unl_Util
::
isArray
(
$sortBy
))
{
$sortBy
=
array
();
}
if
(
$in
->
sort
)
{
if
((
$key
=
array_search
(
$in
->
sort
,
$sortBy
))
!==
FALSE
)
{
unset
(
$sortBy
[
$key
]);
}
$sortBy
[]
=
$in
->
sort
;
}
$session
->
sortBy
=
$sortBy
;
foreach
(
$sortBy
as
$sortKey
)
{
$data
->
orderBy
(
'get'
.
$sortKey
);
}
$this
->
_helper
->
layout
->
setLayout
(
'naked-layout'
);
$this
->
view
->
data
=
$data
;
$this
->
view
->
endDate
=
$endDate
->
subDay
(
1
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
application/modules/iace/views/scripts/reports/through-date.phtml
0 → 100644
+
41
−
0
View file @
16821499
<?php
$this
->
headLink
()
->
appendStylesheet
(
$this
->
baseUrl
()
.
'/css/iace/reports/weekly.css'
,
'all'
);
?>
<?php
$this
->
layout
()
->
tagline
=
''
;
?>
<?php
$this
->
layout
()
->
hideMenu
=
true
;
?>
<h2>
ACE Certified Courses
<br
/>
Interim ACE Committee
<br
/>
Updated
<?php
echo
date
(
'F j, Y'
,
$this
->
endDate
->
getTimestamp
());
?>
</h2>
<table>
<tr>
<th><a
href=
"
<?php
echo
$this
->
url
(
array
(
'sort'
=>
'slo'
));
?>
"
>
SLO
</a></th>
<th><a
href=
"
<?php
echo
$this
->
url
(
array
(
'sort'
=>
'course'
));
?>
"
>
Course
</a></th>
<th><a
href=
"
<?php
echo
$this
->
url
(
array
(
'sort'
=>
'college'
));
?>
"
>
College
</a></th>
<th><a
href=
"
<?php
echo
$this
->
url
(
array
(
'sort'
=>
'title'
));
?>
"
>
Title
</a></th>
</tr>
<?php
foreach
(
$this
->
data
as
$record
)
{
?>
<tr
<?php
if
(
$rowCount
++
%
2
)
{
?>
class=
"even"
<?php
}
?>
>
<td>
<a
href=
"
<?php
echo
$this
->
baseUrl
();
?>
/courses/view/print/id/
<?php
echo
$record
->
getRequestId
();
?>
"
>
<?php
echo
$record
->
getSlo
();
?>
</td>
</a>
<td>
<a
href=
"
<?php
echo
$this
->
baseUrl
();
?>
/courses/view/print/id/
<?php
echo
$record
->
getRequestId
();
?>
"
>
<?php
echo
$record
->
getCourseCode
();
?>
</a>
</td>
<td>
<a
href=
"
<?php
echo
$this
->
baseUrl
();
?>
/courses/view/print/id/
<?php
echo
$record
->
getRequestId
();
?>
"
>
<?php
echo
$record
->
getCollege
();
?>
</a>
</td>
<td>
<a
href=
"
<?php
echo
$this
->
baseUrl
();
?>
/courses/view/print/id/
<?php
echo
$record
->
getRequestId
();
?>
"
>
<?php
echo
$record
->
getTitle
();
?>
</a>
</td>
</tr>
<?
}
?>
</table>
\ No newline at end of file
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