Selaa lähdekoodia

form style and module fixes

version-14
Rushabh Mehta 14 vuotta sitten
vanhempi
commit
3ee3a7ef4d
4 muutettua tiedostoa jossa 27 lisäystä ja 27 poistoa
  1. +25
    -1
      cgi-bin/webnotes/modules/__init__.py
  2. +0
    -24
      cgi-bin/webnotes/modules/module_manager.py
  3. +1
    -1
      js/form.compressed.js
  4. +1
    -1
      js/widgets/form/form_container.js

+ 25
- 1
cgi-bin/webnotes/modules/__init__.py Näytä tiedosto

@@ -62,4 +62,28 @@ def get_module_path(module):
# get module path by importing the module
modules_path = os.path.join(webnotes.defs.modules_path, scrub(module))
return modules_path
return modules_path
def switch_module(dt, dn, to, frm=None, export=None):
"""
Change the module of the given doctype, if export is true, then also export txt and copy
code files from src
"""
import os
webnotes.conn.sql("update `tab"+dt+"` set module=%s where name=%s", (to, dn))

if export:
export_doc(dt, dn)

# copy code files
if dt in ('DocType', 'Page', 'Search Criteria'):
from_path = os.path.join(get_module_path(frm), scrub(dt), scrub(dn), scrub(dn))
to_path = os.path.join(get_module_path(to), scrub(dt), scrub(dn), scrub(dn))

# make dire if exists
os.system('mkdir -p %s' % os.path.join(get_module_path(to), scrub(dt), scrub(dn)))

for ext in ('py','js','html','css'):
os.system('cp %s %s')



+ 0
- 24
cgi-bin/webnotes/modules/module_manager.py Näytä tiedosto

@@ -1,27 +1,3 @@
#==============================================================================
# script to change the module name in the database & update svn
#==============================================================================

def change_module(dt, dn, from_module, to_module):
import os, webnotes.defs
from webnotes.modules import scrub
# change in db
webnotes.conn.sql("update `tab%s` set module=%s where name=%s" % (dt, '%s', '%s'), (to_module, dn))
# export files
from webnotes.modules.export_module import export_to_files
export_to_files(record_list = [[dt, dn]])
if dt in ['DocType','Page','Search Criteria']:
dt, dn = scrub(dt), scrub(dn)
# svn add
webnotes.msgprint(os.popen("svn add %s" % os.path.join(webnotes.defs.modules_path, scrub(to_module), dt, dn)).read())

# svn remove
webnotes.msgprint(os.popen("svn remove %s" % os.path.join(webnotes.defs.modules_path, scrub(from_module), dt, dn)).read())



#==============================================================================


+ 1
- 1
js/form.compressed.js Näytä tiedosto

@@ -1,5 +1,5 @@

_f.FrmContainer=function(){this.wrapper=page_body.add_page("Forms",function(){},function(){});this.last_displayed=null;$dh(this.wrapper);this.body=$a(this.wrapper,'div');_f.frm_dialog=new _f.FrmDialog();}
_f.FrmContainer=function(){this.wrapper=page_body.add_page("Forms",function(){},function(){});this.last_displayed=null;$dh(this.wrapper);this.body=$a(this.wrapper,'div','frm_container');_f.frm_dialog=new _f.FrmDialog();}
_f.frm_dialog=null;_f.calling_doc_stack=[];_f.temp_access={};_f.FrmDialog=function(){var me=this;this.last_displayed=null;var d=new Dialog(640,null,'Edit Row');this.body=$a(d.body,'div','dialog_frm');$y(d.body,{backgroundColor:'#EEE'});d.done_btn_area=$a(d.body,'div','',{margin:'8px'});me.on_complete=function(){if(me.table_form){me.dialog.hide();}else{var callback=function(r){var dn=cur_frm.docname;if(!r.exc){me.dialog.hide();}
if(me.on_save_callback)
me.on_save_callback(dn);}


+ 1
- 1
js/widgets/form/form_container.js Näytä tiedosto

@@ -5,7 +5,7 @@ _f.FrmContainer = function() {
// create hidden
$dh(this.wrapper);

this.body = $a(this.wrapper,'div');
this.body = $a(this.wrapper,'div','frm_container');
// make by twin
_f.frm_dialog = new _f.FrmDialog();


Ladataan…
Peruuta
Tallenna