Sourced wnframework-modules from Google Code as erpnext

This commit is contained in:
Pratik Vyas
2011-06-08 14:37:15 +05:30
commit c1e6e4c752
1680 changed files with 162635 additions and 0 deletions

View File

View File

@@ -0,0 +1,55 @@
<div class="layout_wrapper">
<div id="di_header"></div>
<div style="margin: 8px">
<table style="border-collapse: collapse;" border="0">
<tbody>
<tr>
<td style="border: 1px solid #aaaaaa; padding: 4px; width: 60%;">
<form action="index.cgi" enctype="multipart/form-data" method="POST" target="ImportIFrame"> <input name="cmd" type="hidden" value="import_csv" />
<h3 style="background-color: #EEF; padding: 2px;">Step 1. Download Template</h3>
<select id="import_template" style="margin: 10px;"> <option>Select Master...</option> </select>
<div style="margin: 10px; margin-top: 0px;"><input name="overwrite" type="checkbox"/> Over-write records with same name?</div>
<div id="child_tab_lst"></div>
<h3 style="background-color: #EEF; padding: 2px;">Step 2. Upload and Import</h3>
<table style="width: 480px;" border="0" cellspacing="10px">
<tbody>
<tr>
<td width="200px">Select CSV File to be imported</td>
<td><input name="csv_file" type="file" /></td>
</tr>
<tr>
<td width="200px">Date format in source CSV</td>
<td><select name="dateformat"> <option value="yyyy-mm-dd">yyyy-mm-dd</option> <option value="mm/dd/yyyy">mm/dd/yyyy</option> <option value="mm/dd/yy">mm/dd/yy</option> <option value="dd-mm-yyyy">dd-mm-yyyy</option> <option value="dd/mm/yyyy">dd/mm/yyyy</option> </select></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<div id="import_btn"><input type="submit" value="Import" /></div>
</td>
</tr>
</tbody>
</table>
</form>
<div style="background-color: #FFE; padding: 10px; margin: 10px;">
<h3>Data Import Guide</h3>
<ol>
<li>Get the template of the DocType for which you want to import in CSV (Comma seperated values) format.</li>
<li>Fill in the data in the template. You can remove columns that are not relevant</li>
<li>Save the template in CSV format</li>
<li>Select the saved CSV file, identify the date format if any</li>
<li>Click on "Import"</li>
</ol></div>
</td>
<td style="border: 1px solid #AAA; padding: 4px;">
<h3>Import Log:</h3>
<div id="import_result_area">
<iframe src="blank1.html" name="ImportIFrame" style="border: 0px; height: 500px; width: 100%"></iframe>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1,45 @@
pscript['onload_Import Data'] = function() {
//alert(profile.can_get_report);
callback = function(r,rt) {
var h = new PageHeader('di_header','Import Data','Tool to download template and upload data');
var sel = $i('import_template');
if(r.message){
add_sel_options(sel, r.message);
sel.onchange=function(){
$i('child_tab_lst').innerHTML ='';
if(sel.value != 'Select Master...'){
$c_obj('Import Data Control','get_child_lst',sel.value,
function(r,rt){
var me = this;
$y($i('child_tab_lst'),{backgroundColor:'#EEEEEE'})
var desc = $a($i('child_tab_lst'), 'div', '', {padding:'8px'});
desc.innerHTML = "<h4>Please click on following link(s) to download template.</h4>";
var parent = $a($i('child_tab_lst'), 'div');
var tab = make_table(parent,r.message.length,1,'100%',[],{padding:'8px',fontSize:'15px',borderCollapse: 'collapse'});
for(var i=0;i<r.message.length;i++){
var dt= $a($td(tab,i,0), 'span', 'link_type');
dt.innerHTML = r.message[i];
dt.nm = r.message[i];
dt.onclick = function(){
var ovr = $('input[name="overwrite"]:checked').length;
window.location = outUrl + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
}
}
}
);
}
}
}
}
$c_obj('Import Data Control','get_master_lst','',callback);
}

View File

@@ -0,0 +1,106 @@
[
{
'author': None,
'category': 'Standard',
'content': None,
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'doctype': 'Page',
'file_list': None,
'icon': None,
'idx': None,
'keywords': None,
'menu_index': None,
'modified': '2011-05-02 16:28:00',
'modified_by': 'Administrator',
'module': 'Setup',
'name': 'Import Data',
'owner': 'Administrator',
'page_name': 'Import Data',
'page_title': None,
'parent': None,
'parent_node': None,
'parentfield': None,
'parenttype': None,
'publish': None,
'script': None,
'show_in_menu': 0,
'site_description': None,
'standard': 'Yes',
'static_content': None,
'style': None,
'stylesheet': None,
'template': None,
'write_content': None
},
{
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'doctype': 'Page Role',
'idx': 1,
'modified': '2011-05-02 16:28:00',
'modified_by': 'Administrator',
'name': 'PR000224',
'owner': 'Administrator',
'parent': 'Import Data',
'parentfield': 'roles',
'parenttype': 'Page',
'role': 'Administrator'
},
{
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'doctype': 'Page Role',
'idx': 2,
'modified': '2011-05-02 16:28:00',
'modified_by': 'Administrator',
'name': 'PR000225',
'owner': 'harshada@webnotestech.com',
'parent': 'Import Data',
'parentfield': 'roles',
'parenttype': 'Page',
'role': 'System Manager'
},
{
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'doctype': 'Page Role',
'idx': 3,
'modified': '2011-05-02 16:28:00',
'modified_by': 'Administrator',
'name': 'PR000226',
'owner': 'harshada@webnotestech.com',
'parent': 'Import Data',
'parentfield': 'roles',
'parenttype': 'Page',
'role': 'Sales Master Manager'
},
{
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'doctype': 'Page Role',
'idx': 4,
'modified': '2011-05-02 16:28:00',
'modified_by': 'Administrator',
'name': 'PR000227',
'owner': 'harshada@webnotestech.com',
'parent': 'Import Data',
'parentfield': 'roles',
'parenttype': 'Page',
'role': 'Purchase Master Manager'
},
{
'creation': '2010-12-14 10:33:09',
'docstatus': 0,
'doctype': 'Page Role',
'idx': 5,
'modified': '2011-05-02 16:28:00',
'modified_by': 'Administrator',
'name': 'PR000228',
'owner': 'harshada@webnotestech.com',
'parent': 'Import Data',
'parentfield': 'roles',
'parenttype': 'Page',
'role': 'Material Master Manager'
}
]