You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.9 KiB

  1. // Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
  2. //
  3. // MIT License (MIT)
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a
  6. // copy of this software and associated documentation files (the "Software"),
  7. // to deal in the Software without restriction, including without limitation
  8. // the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. // and/or sell copies of the Software, and to permit persons to whom the
  10. // Software is furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  19. // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  20. // OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. //
  22. function loadreport(dt, rep_name, onload) {
  23. if(rep_name)
  24. wn.set_route('Report', dt, rep_name);
  25. else
  26. wn.set_route('Report', dt);
  27. }
  28. function loaddoc(doctype, name, onload) {
  29. wn.model.with_doctype(doctype, function() {
  30. if(locals.DocType[doctype].in_dialog) {
  31. _f.edit_record(doctype, name);
  32. } else {
  33. wn.set_route('Form', doctype, name);
  34. }
  35. })
  36. }
  37. var load_doc = loaddoc;
  38. function new_doc(doctype, in_form) {
  39. wn.model.with_doctype(doctype, function() {
  40. var new_name = wn.model.make_new_doc_and_get_name(doctype);
  41. wn.set_route("Form", doctype, new_name);
  42. })
  43. }
  44. var newdoc = new_doc;
  45. var pscript={};
  46. function loadpage(page_name, call_back, no_history) {
  47. wn.set_route(page_name);
  48. }
  49. function loaddocbrowser(dt) {
  50. wn.set_route('List', dt);
  51. }