fixed:
- remove a category
- move the elements to another category before deleting the category
* add the delete logic for the categories not sent by the JS to the Restaurant->saveCategories() model
* added a simple UI functionality to trigger the jquery ui buttons hover effects,
* added the delete category button and set a style for it
* added a dialog when the delete category button is clicked, it shows the form for the category that will handle the existing dishes
* created the deleteCategory method that moves the dishes from one category to another and that removes the existing category from the DOM
* fixed a problem with the dish category dialog
* fixing the problem of the admin loading the community and all it's dependencies twice because a naming collition
* replacing $this->community for $this->restaurantCommunity in the admin/restaurant form because of the naming collition
* detecting if the call has been from the admin or from the front end because API calls do not send params
* unifying the return exit in the API _returnRestaurant() action
* sending the $where filters from the API controller instead of detecint it in the models
* sending the $where param in cascade from the API to the Restaurant model to the Category model for the Category->dishes($where) filter
* improving the readability in the bundle where the community is sent, adding documentation about the $view->category variable in the view file
* restored code removed in 49ac22c7d9ac9ccb2845f25fa7963b7225e270cb
* removed the session validation in the model
* saw that the filter could be fetched in the Restaurant->saveDishes(), renamed
a couple of variables to make it more understandable why the filter was removed.
Chrome browsers sort the properties, but Firefox leaves them as defined.
Changed the code to put the elements in an simple array (json array) instead of
associative arrays (json objects) so that the elments are not reordered.
* forces the export for the categories, dishes and options, to be added as a
regular array of items, not as an associative array with the id as key
* added dockblock to help the IDE with the return elements for the exports
* make the dish options to be returned using the return value
* made the SQL query to fetch the options readable
* added the sort value to be stored in the Restaurant model
* added style to the CSS to make it clear what the sort field was used for
* added the sort value to be sent when storing the options
* added the sort field to the option form
* return the categories for a restaurant, order by the sort field
* improved the way the field forms are shown, using the new CSS class labeled-fields
* added the category input fields to be able to rename and resort the category
* changed the JS to add the new fields to the API call to store the category changes
* refactorize the save restaurant controller, to have the save block in it's own private method
* created a flashMessage static method in the Crunchbutton_Session class to handle the "saved" messages as flash messages.
* creating a flashWidget that returns a JQuery UI widget with the message in the session
* added the flashWidget to the restaurant view
* moved the protected _jsonBoolean() method to the Cana_Table as it's something to be used in different models
* moved the protected _mergeWhere() method to the Cana_Table as it's something to be used in different models
* use the _mergeWhere() to show the inactive dishes in the admin
* use the _mergeWhere() to show the inactive notifications in the admin
* added protected _jsonBoolean() metod to turn json boolean values to something Cana_Table understood to disable the items
* added the sort field to the array of data to be send
* improved the way the dish form looks like because of the different fields
* added the sort form field to the admin.js and the sort value to the saveDishes() js action
* changed "Contact Crunchbutton.com: 800-242-1444." to "To contact Crunchbutton, text us back."
* left the way to fetch the phone number for future references
* validates the empty arrays for hours and dishes before trying to save them
* refactorize the Restaurant model to make it more readable
* addign documentation to the save*() methods