Discipline Log Entries by Date Range

Custom page that allows an admin to see discipline log entries by date range for the current school. Can be run for the entire student body at that school or just the current selection. It does not look at incident management entries, it only looks at discipline log entries.

1.1 - original version left off entries with no subtypes and this update fixes that problem, also removed case parts in the sql to figure time - formatting it in the output instead

0
Your rating: None

Comments

Code

Matt,

I can't get the consequence drop down box to work correctly. This is the code for the consequence popup from the log entries search screen.

Log Consequence ~[custompopup.consequence.lists.consequence]

Can you help - I don't know what to change in your file from the extra folder.

Nancy

reply - Code

On the drop-down, you need to replace all the references to Discipline_IncidentType with Consequence. The drop-down won't be pretty - it'll just have the codes rather than the words because all the database keeps in the log table is the code. You won't be able to use the custompopup menu coding you referenced because it doesn't have the coding necessary to pass the information from the drop-down to the url.

You'll also need to change the part mentioned in the readme for the where clause (replace lg.Discipline_IncidentType with lg.Consequence), as well as replace lg.Discipline_IncidentType with lg.Consequence in the sql select clause and in the part after the sql that does the output.

Matt

(edited to add 'I added a version of the page with Consequences to the extra's folder')

Matt, Thanks so much -

Matt,

Thanks so much - comparing your file with what I attempted, I see my mistake. I changed the following code:

select name="incidenttype"

I changed "incidenttype" to consequence.

Nancy

Another vote for Consequence

Thanks for another great report. Like Robert, I would like to have the report use the "consequence" field. I did modify the original code using the alternate file that you included in the zip file, but when I click the submit button I get the "page not found - 404" error. Any reason you would know that the consequence field would be causing this problem? If it helps I can supply the code I'm using. Let me know.

Thanks,
Sally A. Simpson
IT Manager
Lakeside Educational Network
Horsham, PA

RE: Another vote for Consequence

The page not found is likely coming from this part of the html:

form name="loginfo" action="/admin/reports/disciplinelog.html" method="POST"

That's the command to tell it where to go after one clicks on the submit button. I originally built the page to just sit in the admin/reports folder and therefore when you click on the submit button it refreshes itself. But if you place the page in another folder, then the folder path has to reflect that location exactly or you get the page not found error. However, lately I've been leaving out folder paths so people can place the customizations in any folder and not worry about tweaking the action part. So if you change it to just (be sure it's within the less than and greater thans - I had to leave them off for the text to display):

form name="loginfo" action="disciplinelog.html" method="POST"

Then you should be okay regardless of which folder you place it in. If you still get the error though, feel free to email me the page and I'll take a look at it.

Consequence Again

I would like to have the consequence print out on the report instead of entry time or grade.
I see that the code for subtype is ~g.valuet;t
so what would the code be for the consequence field? And how do I find out what the code is for other such fields in powerschool that have a drop down menu.

re: consequence again

What you'll need to do is modify the tlist_sql part in the html of the page. There are two parts to modify, the select statement and the output part. In the select statement you could add a reference to lg.consequence - that will pull the data from consequence field in the log table for the entry. Then in the output part, make a reference to ~(lg.consequence) - that will display the data from the field. Likewise, to remove anything, you'll want to remove the reference to it in the select statement and the output part.

As far as code for other drop-downs, you need to look at the html for the page and see what it's referencing. Sometimes you'll find the information in the page itself, but sometimes if it's referencing the database you'll have to look at it in dde or the data dictionary.

Matt

(edited to add 'I added a version of the page with Consequences to the extra's folder')

Consequence

This report is great! Any idea on how to adjust it to search by consequence? We generally need to see things like who's been suspended over a date range, but there's nothing built in for that.

Date Picker

Great page! I added the YUI date picker to the date boxes as seen in admin/yui/popupcal.html. The class add a div tag which creates a block element. I put it in a table to work around it.

Re: Date Picker

Just be careful, the coding for the yui date picker in our testing has had weird results in IE and if you enter a date like 1/1/09 then change the date using the date picker it thinks you mean the date 1/1/0009.

Brian Andle

Make the student name a link.

This would be really helpful. That way we could run this report then select a student to modify the log.

-Guy

RE: Make the student name a link

I added a new folder to the download file called 'links and group function' with a version of the page in it that has the names linked to the student and also has a group functions link at the bottom of the page. The group function link is from the HonorRollSelect customization on PSUG.

Discipline to serve

I was wondering if there is a report that you know of that you can run discipline to serve with the students name, date to serve and hours to serve?

RE: Discipline to serve

How are you tracking the information such as date to serve and hours to serve? Are they just kept in custom fields or in the log someplace?

Is it possible?

I notice you're using the gen table to look up popup values for subtypes. Is it possible to, instead, look up the values for discipline_incidenttype? They don't appear to be in the gen table. There is a similar structure, to inputting them, however (ie, there a short code form, then a text clob that's human-readable).

I have a request from our middle school AP for something exactly like this, except switch out the subtypes for discipline_incidenttype, so I'm trying to modify your page to fit. Without that popup list getting populated however, it's not very useful. I have no idea how you figured out to use the gen table, and I'm fresh out of ideas. Any help is much appreciated.

BTW - as is - your page runs wicked fast!

Thanks!

- J.

RE: Is it possible?

Jay,

I've uploaded a version that looks for incident type instead of subtype. I've added an 'extra' folder to the download and the html file is in that folder. Turns out those types are also in the gen table but not individually like the subtypes. So I made the drop-down to be based on entries in the log table instead. That's good and bad - the good part is it only lists types that have been used, but the bad part is it lists the short code because that's what's recorded with the records and unless a person knows what the abbreviation stands for they may choose the wrong type.

If anyone wants to base the search on something other than subtypes or incident types, the new file may be easier to modify than the original.

Matt

RE: Is it possible?

Works great, thanks! Any chance of adding that awesome links and group function stuff to this one? I'll dig into the subtypes code and see if I can do it myself, but I don't want to reinvent the wheel.

Also - is it possible to join incident codes to their descriptions, or is it impossible because the descriptions only exist in the drop-down list?

how-to add group function

Here's how to add the links and group function to a page. I figured I'd post it so you can try it plus it may come in handy for others who want to do the same on other pages:

1 - make sure you have the student dcid field in the tlist_sql select statement.

2 - create a link on the student name based on the student dcid field. Here's an example from the page in the 'links and group function' folder:

a target="_blank" href="/admin/students/home.html?frn=001~(s.dcid)"

Since the dcid reference comes before the lastfirst reference in the link, make sure the dcid is before lastfirst in the select statement.

3 - from the page mentioned in step #2, copy the section of html coding toward the bottom of the page that starts with 'select students on page customization start' to 'select students on page customization end' and paste it on the page

That's all that's needed to get a working group function on a page. Credit for how this works and the javascript coding to Ken T - I took it from his custom honor roll with student selection page that's in the files section of PSUG.

As far as the join - that would be impossible because as you stated the description is only in the drop-down. You could 'decode' the descriptions using a case statement in the select statement - you'd have to update it though if you add a new incident.

Matt

No Subtypes

Matt,

We don't have any subtypes defined for discipline logs and this seems to be keeping it from working on our 5.2 system. Any suggestions?

Thanks,

-Jeff

RE: No Subtypes

If you're familiar with sql and html, you could customize the page to look based on some other unique feature of your discipline logs, such as author or action taken.

Matt

Should it work without

Should it work without subtypes in the log entries? I was getting no results so I defined one subtype in district setup. Still no luck.

-Jeff

RE: Should it work without

Jeff,

The way the page is built it needs a subtype because of the following in the sql:

INNER JOIN Gen g ON lg.subtype = g.value AND g.name = '-100000' AND g.cat = 'subtype'

I haven't tried this, but if you delete that part and the g.valuet parts in the select statement and the row output, plus the Subtype column heading part, it may work. Or you may be able to change the INNER to OUTER and get it to work instead.

Matt

RE: Should it work without

Thanks for the suggestions, but I could get it to work. I just always come up with a blank list.

-Jeff

RE: Should it work without

Are you trying to run it while in District Office by chance? If so, it could return blank because the sql is built to look at current school only (I'm going to add that to the description on the download page). Otherwise I'm not sure what else to have you try because I made the changes to a copy on my test server and it worked okay with the changes. You can email me your page if you want and I can look it over.

Matt

Great page Matt. One thing

Great page Matt. One thing that I be interested in is the ability to search or select by the Discipline_ActionTaken field. We use this as the consequence that the administrator assigned. This would allow a quick look at detentions, Saturday school, ISS, OSS etc.

Dave Black
Lewis Central Schools

searcy by?

Dave,

Thanks. Are you wanting to search by Discipline_ActionTaken instead of subtypes, or are you wanting to search by both?

Matt

Syndicate content Syndicate content