rssidlowski / Hydrants

City of Baltimore Fire Hydrant Inspections
0 stars 0 forks source link

Add Hydrants to City mobile framework #21

Open rssidlowski opened 9 years ago

rssidlowski commented 9 years ago

Similar to what was done for PST need to add the mobile Hydrant Inspection application to the City's mobile framework. Grant access to the following people so they may access the application: Dave McSpaden Marian Batton Amy Purves Regina Sidlowski Heidi Hammel Joe Murk

rssidlowski commented 9 years ago

Need to do the following: 1) create an application in the mobile portal 2) incorporate the icon (to be provided by Tiffany by Wednesday) 3) Include description: Mobile tool for fire hydrant inspection and status tracking.
4) Create admin for access to portal. Note need to have different role for fire dept users. See #16. 5) Create report section

rssidlowski commented 9 years ago

Create in dpwdev first.

jday3 commented 9 years ago

Regarding 4 - Are there multiple roles inside of the application? If so what are they?

5 - Do you mean reports on the portal page?

rssidlowski commented 9 years ago

Just two roles: fire dept and non-fire dept. Yes reports on the portal page - similar to what we have for PST.

jday3 commented 9 years ago

Do you mean the PST reports in the Activity Manager? There are no PST reports in the portal - http://dpwdev.baltimorecity.gov/water/portal/index.aspx#reports

rssidlowski commented 9 years ago

Sorry, yes in the activity manager.

jday3 commented 9 years ago

Cool, is there a list of the different reports you can point me to? Also, what role do you want me to give that list of users? Fire-Dept or Non-Fire-Dept. They can only have one

rssidlowski commented 9 years ago

Here is the list of reports - there are issues for each: 1) Hydrant Inspection Detail 2) Inspections by Date Range 3) Inspections by Organization and Date Range

Is the role for Reports handled separately (under DPW Activity Manager)? If so, create Hyd Reports. Not sure what you mean by only having one role and how it relates to the report role. I thought they were separate and we'd have mobile application role: fire dept and non fire dept and one role for Hyd reports.

jday3 commented 9 years ago

Yes there will be two roles for the mobile app - Non-Fire-Dept and Fire-Dept. Separately there will be a role to access the reports in the Activity Manager.

For the list of users that you gave me at the top of this issue, do you want these users added to the mobile app, reports, or both? If you want to give them access to the mobile app, I'll need to give them either the Fire-Dept role or the Non-Fire-Dept role.

rssidlowski commented 9 years ago

Give these users fire-dept and report: Regina, Heidi, Joe Murk give these users non-fire dept and report: Marian Batton Amy Purves Give these users only non-fire dept Dave McSpaden

jday3 commented 9 years ago

All in the dev environment:

  1. The app is now on the dpw portal under mobile applications. I just re-used an existing icon until we have one made.
  2. I added the application to administration portal with two roles - Non-Fire-Dept and Fire-Dept. @gjmkelly , you will have to use these inside of the mobile app. You will want to use the adminwebapi check_user service like this - http://dpwdev.baltimorecity.gov/water/adminwebapi/api/roles/check_user?appname=hydrants which will return a response like this - {"success":true,"username":"joe.murk","roletype":"fire-dept","fullname":"Joe Murk","title":"GIS Consultant"} You'll also want to use something like this in the index.aspx.cs file to reject users who don't have access to the app
protected void Page_Load(object sender, EventArgs e)
        {
            string username = User.Identity.Name.ToLower();
            if (username.Contains("\\"))
            {
                string[] userSplit = username.Split('\\');
                username = userSplit[1];
            }
            string curl = System.Configuration.ConfigurationManager.AppSettings["checkrolURL"] + username;
            Uri uri = new Uri(curl);
            System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri);
            string un = System.Configuration.ConfigurationManager.AppSettings["username"];
            string pa = System.Configuration.ConfigurationManager.AppSettings["password"];

            request.Credentials = new NetworkCredential(un, pa);
            request.Method = WebRequestMethods.Http.Get;
            HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
            StreamReader reader = new StreamReader(response.GetResponseStream());

            string tmp = reader.ReadToEnd();
            if (!tmp.ToLower().Contains("hydrants"))
            {
                string portalpage = System.Configuration.ConfigurationManager.AppSettings["portalpage"];

                Response.Redirect(portalpage);
            }
            response.Close();
        }
  1. I added the hydrant reports role to the DPW Activity Manager. Currently in the activity manager, when you select Hydrant Reports, it will just show a list of report types. I'll add the actual functionality once the reports are created.