operations reports.html - wydsodifficult/wydsodifficult.github.io GitHub Wiki
Operations View Reports
Only Access Level 6 is unable to view page contents
Features
- When Page is loaded, shows up to 25 most recent reports
- List of reports are shown in a table
- Table can hide specific columns
- Table is searchable and paginated
- Dedicated Card for searching each field, one section for text and another for dates
- When clicking on a row, a card at the top will show all data relevant
- Inherits everything from Blank Template
Things with ID's
- "view-card": The Card that holds report data when viewed. Only appears when a job is selected.
- "view-report": The type of Report being shown
- "view-report-job-name": Type of the report being shown
- "view-report-job-num": Number of the job for the report being shown
- "view-report-date": Date the report being shown was submitted
- "view-report-time-start": Start time for the report being shown
- "view-report-time-set": Pops up a datetimepicker() to pick a time
- "view-report-time-end": End time for the report being shown
- "view-report-time-total": Total time for the report being shown
- "view-report-contractor": Contractor for the report being shown
- "view-report-foreman": Foreman for the report being shown
- "div-view-report-dpr": Div that holds the DPR Section for the report being shown
- "view-report-dpr-techs-label": Label for "view-report-dpr-techs"
- "view-report-dpr-techs-div": Div for "view-report-dpr-techs"
- "view-report-dpr-techs": Select which employees have been used for the report being shown
- "view-report-tech-hours": Button to set hours for employees chosen in "view-report-dpr-techs"
- "view-report-dpr-techs-hours": Hours for employees for the report being shown
- "view-report-dpr-materials": Materials needed and by when for the report being shown
- "view-report-dpr-hidden-materials": Hidden information about DPR materials
- "view-report-dpr-materials-count": A count keeping track of how many materials lines there are for the report being shown
- "view-report-dpr-performed": Performed tasks for the report being shown
- "view-report-dpr-hidden-performed": Hidden information for performed tasks for the report being shown
- "view-report-dpr-performed-count": Count of how many performed tasks for the report being shown there are
- "view-report-dpr-hidden-progress": Hidden information for progress for the report being shown
- "view-report-dpr-progress-count": Count of how many progress for the report being shown there are
- "view-report-fields": All custom template fields go here
- "loading": Loading animation shown
- "view-hidden-id": The ID of the report being shown
- "button-view-close": Closes the Card for the report being shown
- "button-view-edit": Allows editing of the report being shown
- "button-view-delete": Deletes the report being shown. Asks for a confirmation.
- "view-search": Input field to search all reports by
- "button-search-type": Search all reports by Report Type using "view-search" input
- "button-search-num": Search all reports by Job Num using "view-search" input
- "button-search-by": Search all reports by Submitted By using "view-search" input
- "input-search-date": Input field that pops up a datepicker() used to search all reports
- "input-search-date-alt": Hidden input field that takes "input-search-date" and changes it's format
- "button-search-date-submitted": Search all reports by Submitted By date using "input-search-date" input
- "button-search-date-report": Search all reports by Report Date using "input-search-date-alt" input
- "button-search-normal": Resets shown reports back to last submitted 25
- "view-search-last-input": Last input the reports were searched by
- "view-viewing": Header stating what the user is looking at
- "view-table": Interactive datatable() that shows preview of reports
- "button-view-increase": Increases recent reports viewed by 25
- "button-view-increase-type": Not used. Increases recent searched by type by 25
- "button-view-increase-num": Not used. Increases recent searched by job num by 25
- "button-view-increase-date": Not used. Increases recent searched by date by 25
- "button-view-increase-by": Not used. Increases recent searched by submitted by by 25
- "view-search-count": Keeping track of how many we have searched by so far
- "view-search-last": Id of the last report searched
Function (In Order of Appearance)
- On Document Ready
- Initialize the datatable
- Columns have the ability to get hidddden
- If user access is equal to 6 then table is hidden
- Else grab data from Firebase and put it into datatable
- If user access is greater than 3 then the delete button on viewing is hidden
- $('#button-view-increase')
- Increases normal view by 25 count each time
- $('#button-view-increase-type')
- Increases Type view by 25 count each time
- $('#button-view-increase-num')
- Increases Num view by 25 count each time
- $('#button-view-increase-by')
- Increases Submitted By view by 25 count each time
- $('#button-view-close')
- On click closes Report View
- $('#view-table tbody')
- On click of a row in the datatable, grabs the data about the report in the specified row from firebase and shows it in the view Card
- $('#button-search-type')
- Searches all of firebase by the report type in the search field. Shows 100
- $('#button-search-num')
- Searches all of firebase by the job number in the search field. Shows 100
- $('#button-search-by')
- Searches all of firebase by the submitted by in the search field. Shows 100
- $('#button-search-date-submitted')
- Searched all of firebase by the date submitted chosen by user. Shows 100
- $('#button-search-date-report')
- Searched all of firebase by the report date chosen by user. Shows 100
- $('#button-search-normal')
- Resets the datable back to the 25 most recent reports
- $('#input-search-date')
- When this input is clicked, opens datepicker
- $('#input-search-date-alt')
- Changes format of "input-search-date"
- $('#button-view-delete')
- Deletes report currently being viewed