= Blue Print - Resource Select / Add = [[TOC]] == Purpose == In Sahana many resources refer to other resources, eg: * An Office refers to an Organisation * A Warehouse refers to a Location * An Assessment refers to a Staff Member (person) We need to have a method to enter these referenced inputs which includes: * Auto-completing typed text * Searching a detailed list of resources * Allows adding new resources, while also also minimising duplicates This should all take place in a user friendly workflow. == Design == This design has been based around the location resource, as it is one of the most complex. A number of these features are unique to the location resource, and these have been noted. === Field === [[Image(Field Select.jpg, width=500)]] * Display a "Select" Button (the button isn't clear in the image) next to the field to open the Select Pop-Up. * The field should have an autocomplete which searches the "represent" of the location. * For locations the represent should include some information about the parent of that location, eg. Manserha, Abbottabad, Khyber Pakhtunkhwa (Town, District, Province). This could be a deployment setting. * The organisation represent should include the Acronym of the Orgaisation. If the text entered doesn't match an existing location, then the "Select" button should change to "Select or Add":[[BR]] [[Image(Field Select or Add.jpg, width=600)]] === Select Pop-Up === The Select Pop-Up gives the user a better interface to search for the correct location, and has a button to go to the Add Pop-Up FB: Recommend that Add button unhides the Add Tab & Hides the others (no server-side call) ==== List ==== * More detailed information on each location * Ability to do more advanced searches for locations (like http://www.drrprojects.net/drrp/drrpp/project/list) [[Image(Select List.jpg, width=600)]][[BR]] There should be a column of "select" buttons which will close this pop-up and populate the main form with the location selected. ==== Map ==== ''This feature is not just for Locations, but for any resource referring to a location, eg. Warehouses, Offices, Assessments... ''[[BR]] FB: This would have to open out at default map portal view since we have no hints on anything closer, so is likely to be pretty zoomed-out. * Show all current locations (with pop-ups that indicate what resources are associated with that location). If this is a map for another resource (warehouse, office, assessment...), it would be good to have an option for showing: * Just the locations of that resource * All locations (with pop-ups that indicate what resources are associated with that location) [[Image(Select Map.jpg, width=600)]][[BR]] If the "select" button is pressed this pop-up will close and populate the main form with the location selected. === Add Pop-Up === This would be a type of wizard that guided the user through the process. FB: Recommend that the Wizard pages are Tabs that are Hidden/Unhidden (no server-side calls) ==== 1. Type (Level) ==== ''This feature might be unique to locations, although it might be useful to display customised details forms based on a type/category for other resources (Organisations, People..)''[[BR]] FB: Normal end-users can normally only add 'Generic' locations in which case this 1st screen should be skipped...[[BR]] [[Image(Add Type.jpg, width=600)]] ==== 2. Details ==== This form could create multiple records for the different levels (you might add a district and a village at the same time)[[BR]] It is designed this way, because this is the way people are used to entering address. The fields can autocomplete when text is entered and autofill & disable the fields for levels below them if that location has a parent[[BR]] [[Image(Add Details.jpg, width=600)]] FB: Adding the District & Village at the same time adds a *lot* of complexity (e.g. duplicate detection for these) & means that we don' get the opportunity to ente the extra fields on these. [[BR]] This is also completely in opposition to the Taiwan requirements. ==== 3.Map Coordinates ==== This form would be specific to locations (FB: Why? If this is a resource with associated location then it should have this form too, no?). * ? represents possible coordinates as calculated from Geocoder * Display other locations too (just points or polygons too?) * Have an option to select current location using HTML5 !GeoLocator * Have an option to skip this step [[Image(Add Map Coord.jpg, width=600)]] ==== 4. Confirm / Check for Duplicates ==== 1. This would be some sort of algorithm to search for similarity between the new record and existing records (using text fields &/or lat/lon). This step could be skipped if none are found. 2. Similar records would be listed and the user could select one of those instead 3. Or add a new one. 4. Close the pop-up and go back to the main form. [[Image(Add Confirm.jpg, width=600)]] == Recommendations == ???