aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
AgeCommit message (Collapse)Author
2018-03-12Refs #6133: Async exportsZog
2018-03-12Refs #6133; Add options on the Exports, and forward them tu the UXZog
2018-03-12refs #6133; Add some basic specsZog
2018-03-12Refs #6133; First Crud for exportsZog
2018-03-12Refs #6133; Fix specsZog
2018-03-07AutocompleteLines: Sanitize `:q` param in `LIKE` operatorTeddy Wing
Johan made a number of good points here: > * I think this belongs in the model > * I would rather use a named parameter here > `.where('lines.number LIKE :q OR lines.names LIKE :q ...', q: > "%#{params[:q]}%")` > * You should defiitely escape the params before passing it to your db. > `sanitize_sql_like` seems like the best choice here I wasn't thinking about sanitisation at all and just assumed the `?`s in the prepared statement would take care of it for me. But obviously, we're passing `%`s in the param, so users can of course do the same thing. Protect against this using the `ActiveRecord::Sanitization#sanitize_sql_like` method. This is a private class method, so in order to use it we have to call it from inside the `Chouette::Line` model. And of course the named parameters are a no-brainer. At the time, I had seen that `Array` splat somewhere else in the codebase and just blindly copied the format, forgetting that named parameters even existed. Refs #5889
2018-03-07AutocompleteLinesController: Move filter SQL string inside queryTeddy Wing
Get rid of the heredoc to allow us to put the string inside the argument to the function directly and thus make the query more readable by putting it in context. Refs #5889
2018-03-07AutocompleteLinesController: Include company name in filterTeddy Wing
The `#display_name` used in the drop-down on `ReferentialVehicleJourneys#index` includes the line's company name. Include this as a field to filter lines by. Additionally, use `%query%` filtering everywhere. It's going to be slower, but will produce the same behaviour for all fields for consistency and is easier for searching by company name when you might want to filter by a term in the middle of the name. Refs #5889
2018-03-07ReferentialVehicleJourneys#index: Make lines filter asynchronousTeddy Wing
Instead of doing a complex query to get the lines available to filter on, just get all the lines in the current referential. We then filter those by what was typed into the select2 box and asynchronously respond with line options in a new JSON autocomplete controller. Here we're only providing the option to filter by `number` and `name` field on the line. I'd like to filter by everything in the `#display_name`. I don't think the objectid is going to be easy to integrate into the SQL query but I'd like to add the company part. It's possible we could do the objectid filter in Ruby instead of the database query. Refs #5889
2018-03-05Refs #5855 Avoid creation of CCBlocks duplicates in the same CCSetcedricnjanga
2018-03-05Simplify ccblock uniqueness validationcedricnjanga
2018-03-05Refs #5855 Avoid creation of CCBlocks duplicates in the same CCSetcedricnjanga
2018-03-04Refs #3562 Small change in controller to match routescedricnjanga
2018-03-02Refs #3562 Take review into account and clean a little bitcedricnjanga
2018-03-02Refs Refs #3562 Add workbench CCSET affectationcedricnjanga
2018-03-02Merge pull request #295 from af83/5865-validate-referential-cloningLuc Donnet
5865 Ensure user is allowed to duplicate a referential
2018-03-01Refs #5940; Add missing flash after Calendar creationZog
2018-03-01Refs #6056 Add pagination to ComplianceCheckSet#indexcedricnjanga
2018-02-27Merge pull request #339 from af83/5878-fix-ComplianceChecksController-showLuc Donnet
5878 Add ComplianceCheck#show
2018-02-27Fix prerequisite access for compliance_check and compliance_control Refs ↵Luc Donnet
#5878 @1
2018-02-27Refs #5878; Refactor ComplianceChecksControllerZog
Use InheritedResources helpers
2018-02-27Merge pull request #321 from af83/5979_change_export_csv_filenamesLuc Donnet
Refs #5979 Change export CSV filenames to have a readable date in it
2018-02-27Don't use all compliance_control_set from stif organisation. We will use ↵5950_allow_user_to_see_ccset_from_other_organisationLuc Donnet
later compliance_control_set selected by stif organisatoon Refs #5950 @2
2018-02-23Refs #5950 Fix 404 error when user wants to see CCSet from other organisation :cedricnjanga
- remove begin_association_chain in controller - Change collecyion to only see user organisayion CCSet and STIF CCSet - add policy for show action
2018-02-23Refs 5878; Add ComplianceCheck#showZog
2018-02-22Return false in has_feature? when no organisation is defined. Refs #6007Alban Peignier
2018-02-21Refs #5865 @1h; Ensure user is allowed to duplicate a referential before ↵Zog
doing so I also changed the way 403 errors are handled, to properly respond with a 403 HTTP code
2018-02-20Refs #5979 Change export CSV filenames to have a readable date in it5979_change_export_csv_filenamescedricnjanga
2018-02-20Refs #5901; Makes TimeTable search accent insensitiveZog
2018-02-20Merge pull request #308 from ↵Alban Peignier
af83/5911-stops-filter-on-referential-journeys-index Better stops filters on ReferentialVJs#index. Refs #5911
2018-02-20Merge pull request #294 from af83/5863-use-shallow-urls-for-referentialsLuc Donnet
5863 Remove workbench id from the querystring
2018-02-20Refs #5863 @6h; Remove workbench id from the querystringZog
Infer it when possible, and use a nested otherwise
2018-02-20Replace current_workgroup by referential.workgroup. Refs #5867Alban Peignier
2018-02-19Search VehicleJourneys with one StopArea or two ordered StopAreas. Refs #5911Alban Peignier
2018-02-19Refs #5911 @2h; Better stops filters on ReferentialVJs#indexZog
2018-02-19Merge pull request #303 from af83/5899-use-waiting-time-in-schedulesAlban Peignier
Use waiting_time in schedules computation. Refs #5899
2018-02-19Merge pull request #309 from af83/5919-make-coluns-sortableAlban Peignier
Make ReferentialVJs#index sortable. Refs #5919
2018-02-19Add direction in ReferentialVehicleJourneysController#parse_order for ↵5919-make-coluns-sortableAlban Peignier
'normal' sort. Refs #5919
2018-02-19Merge pull request #305 from af83/5903-fix-VJS-editorLuc Donnet
Fix CustomField loading when no workgroup is available
2018-02-13Refs #5919 @0.5h; Make ReferentialVJs#index sortableZog
2018-02-13Refs #5707; Add specsZog
2018-02-13Refs #5707 update the global status method to avoid unacessary db requestscedricnjanga
2018-02-13Refs #5707 Add status to the application to track 'blocked objects'cedricnjanga
2018-02-12Refs #5903; Fix CustomField loading when no workgroup is available5903-fix-VJS-editorZog
2018-02-12Refs #5899 @1h; Use waiting_time in schedules computation5899-use-waiting-time-in-schedulesZog
2018-02-12Merge pull request #292 from af83/5709_fix_ccset_sortingJohan Van Ryseghem
5709 fix ccset sorting
2018-02-09Add table name in unaccent request (to avoid problem with ↵Alban Peignier
Referential#stop_areas has_many through. Refs #5824
2018-02-09Refs #5669; Add a preview for snapshots for easier debuggingZog
2018-02-07Refs #5709 Fix CCSet index table builder sorting & add show button in gear ↵5709_fix_ccset_sortingcedricnjanga
menu link
2018-02-07Remove workgroup support5683-add_workgroup_id_to_calendarscedricnjanga