Merge branch 'handlerupdate' of github.com:webnotes/erpnext into handlerupdate

This commit is contained in:
Rushabh Mehta 2012-03-21 07:18:41 +01:00
commit f74ef4c64b
41 changed files with 1261 additions and 4654 deletions

View File

@ -8,9 +8,15 @@
"lib/js/wn/require.js",
"lib/js/wn/dom.js",
"lib/js/wn/model.js",
"lib/js/wn/page.js",
"lib/js/wn/misc/user.js",
"lib/js/lib/json2.js",
"lib/js/wn/router.js",
"lib/js/wn/ui/listing.js",
"lib/js/wn/views/container.js",
"lib/js/wn/views/doclistview.js",
"lib/js/wn/views/pageview.js",
"lib/js/wn/views/formview.js",
"lib/js/wn/views/reportview.js",
"lib/js/wn/request.js",
"lib/js/core.js"
]
@ -63,6 +69,7 @@
"lib/css/legacy/sidebar.css",
"lib/css/Aristo/aristo.selected.css",
"lib/css/ui/list.css",
"lib/css/ui/fonts.css",
"lib/css/bootstrap/headings.css",
"lib/css/bootstrap/buttons.css",
"lib/css/bootstrap/navbar.css",
@ -70,7 +77,8 @@
"lib/css/bootstrap/tooltip.css",
"lib/css/bootstrap/label.css",
"lib/css/bootstrap/icons.css",
"erpnext/startup/startup.css"
"lib/css/bootstrap/popover.css",
"erpnext/startup/startup.css"
]
},
@ -89,11 +97,11 @@
"lib/js/legacy/utils/shortcut.js",
"lib/js/legacy/widgets/form/fields.js",
"lib/js/wn/ui/dialog.js",
"lib/js/wn/ui/button.js",
"lib/js/legacy/widgets/dialog.js",
"lib/js/wn/ui/listing.js",
"lib/js/legacy/widgets/layout.js",
"lib/js/legacy/webpage/page_header.js",
"lib/js/legacy/webpage/history.js",
"lib/js/legacy/webpage/search.js",
"lib/js/legacy/webpage/spinner.js",
"lib/js/legacy/webpage/error_console.js",
@ -104,7 +112,6 @@
"lib/js/legacy/wn/widgets/footer.js",
"lib/js/legacy/model/local_data.js",
"lib/js/legacy/model/doclist.js",
"lib/js/legacy/webpage/body.js",
"lib/js/legacy/app.js",
"js/app.js",
"erpnext/startup/startup.js",
@ -132,14 +139,13 @@
"lib/js/legacy/utils/printElement.js",
"lib/js/legacy/widgets/form/fields.js",
"lib/js/wn/ui/dialog.js",
"lib/js/wn/ui/button.js",
"lib/js/legacy/widgets/dialog.js",
"lib/js/legacy/widgets/listing.js",
"lib/js/legacy/widgets/layout.js",
"lib/js/legacy/widgets/tabbedpage.js",
"lib/js/legacy/webpage/page_header.js",
"lib/js/legacy/widgets/tags.js",
"lib/js/legacy/widgets/export_query.js",
"lib/js/legacy/webpage/history.js",
"lib/js/legacy/webpage/search.js",
"lib/js/legacy/webpage/spinner.js",
"lib/js/legacy/webpage/error_console.js",
@ -152,9 +158,8 @@
"lib/js/legacy/model/local_data.js",
"lib/js/legacy/model/doclist.js",
"lib/js/wn/ui/toolbar.min.js:concat",
"lib/js/legacy/webpage/body.js",
"lib/js/legacy/widgets/form/fields.js",
"lib/js/legacy/widgets/form/form_container.js",
"lib/js/legacy/widgets/form/form_dialog.js",
"lib/js/legacy/widgets/form/form_header.js",
"lib/js/legacy/widgets/form/form.js",
"lib/js/legacy/widgets/form/form_fields.js",

View File

@ -29,7 +29,7 @@ select, input, textarea {
border: 1px solid #ccc;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
font-size: 13px;
font-size: inherit;
padding: 4px;
color: #444;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
@ -41,7 +41,7 @@ textarea {
font-family: inherit;
height: 120px;
width: 90%;
font-size: 12px;
font-size: inherit;
white-space: normal;
}
@ -104,6 +104,15 @@ div.fix_ff_cursor { overflow: auto; }
div.comment { color: #444; }
.small {
font-size: 11px;
}
.help {
margin: 3px 0px;
color: #888;
}
div#body_div {
position: relative;
display: none;
@ -113,15 +122,65 @@ div#body_div {
margin-top: 56px;
}
footer {
.content {
width: 900px;
margin: auto;
margin-bottom: 30px;
position: absolute;
-webkit-transition:all 0.5s ease-in-out;
-moz-transition:all 0.5s ease-in-out;
-o-transition:all 0.5s ease-in-out;
-ms-transition:all 0.5s ease-in-out;
transition:all 0.5s ease-in-out;
}
.background-fade-in {
-webkit-transition: background 1s ease-in; /* property duration timing-function delay */
-moz-transition: background 1s ease-in;
-o-transition: background 1s ease-in;
transition: background 1s ease-in;
}
/* selector for open pages */
#opened-page-selector {
width: 900px;
height: 900px;
position: absolute;
z-index: 100;
opacity: 0;
background-color: #bdf;
}
#opened-page-selector.active {
opacity: 0.6;
cursor: pointer;
}
.popover-container {
height: 400px;
}
footer {
position: absolute;
bottom: 0px;
width: 100%;
}
header .container {
width: 900px;
margin: auto;
}
@media (max-width: 1200px) {
div#body_div, header .container, .content, #opened-page-selector, footer {
width: 900px;
}
}
@media (min-width: 1200px) {
div#body_div, header .container, .content, #opened-page-selector, footer {
width: 1100px;
}
}
div.no_script {
display: none;
}
@ -135,7 +194,6 @@ div.loading_div {
display: none;
text-align: center;
padding: 2px;
font-size: 12px;
border: 1px solid #FF4;
}
@ -160,27 +218,18 @@ div.std-footer-item {
-moz-border-radius: 5px;
border-radius: 5px;
}
.gradient {
background: #ededed; /* Old browsers */
background: -moz-linear-gradient(top, #ededed 0%, #d1d1d1 47%, #b7b7b7 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(47%,#d1d1d1), color-stop(100%,#b7b7b7)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#b7b7b7',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* W3C */
}
.layout_wrapper, .layout-wrapper {
-moz-box-shadow: 1px 1px 8px #555;
-webkit-box-shadow: 1px 1px 8px #555;
box-shadow: 1px 1px 8px #555;
-moz-box-shadow: 0px 0px 6px rgba(0,0,0,0.3);
-webkit-box-shadow: 0px 0px 6px rgba(0,0,0,0.3);
box-shadow: 0px 0px 6px rgba(0,0,0,0.3);
background-color: #fff;
padding: 15px;
margin-bottom: 30px;
}
.layout-wrapper-background {
background-color: #f2f2f2 !important;
background-color: #fafafa !important;
padding: 0px;
}
@ -189,7 +238,7 @@ div.std-footer-item {
float: left;
padding: 15px;
background-color: #FFF;
min-height: 450px;
min-height: 600px;
-moz-box-shadow: 7px 0px 6px -2px #ddd;
-webkit-box-shadow: 7px 0px 6px -2px #ddd;
box-shadow: 7px 0px 6px -2px #ddd;
@ -198,10 +247,10 @@ div.std-footer-item {
.layout-side-section {
width: 22%;
/*float: right;*/
color: #606060;
color: #606060;
overflow-x: hidden;
padding: 15px;
min-height: 450px;
min-height: 600px;
}
/* from bootstrap */
@ -236,12 +285,14 @@ div.std-footer-item {
.avatar-small {
display: inline-block;
min-width: 29px;
width: 24px;
height: 20px;
vertical-align: middle;
overflow: hidden;
margin: 0px 3px;
}
.avatar-small img {
height: 24px;
margin-bottom: -7px;
max-width: 24px;
width: 24px;
}
/*
@ -348,24 +399,6 @@ div.grid_tbarlinks {
}
div.frm_tip_box {
margin: 0px;
padding: 8px;
background-color: #FFC;
display: none;
font-size: 11px;
border: 1px solid #FFB;
}
div.frm_tip_box table {
border-collapse: collapse;
vertical-align: top;
}
td.frm_tray_area {
width: 122px;
}
div.dialog_frm {
position: relative;
margin: 10px;
@ -462,12 +495,6 @@ div.time_field select{
.datainputcell { padding: 2px 0px; }
.field_description, .help {
margin: 3px 0px;
font-size: 11px;
color: #888;
}
.help ol {
padding-left: 19px;
}
@ -476,9 +503,6 @@ div.time_field select{
margin-bottom: 3px;
}
.field_label {
font-size:11px;
}
.input_area input, select, textarea {
font-size: 14px;
padding: 2px;
@ -529,7 +553,6 @@ div.sidebar-comment-wrapper input {
}
div.sidebar-comment-message {
margin-top: 8px;
font-size: 11px;
color: #777;
}
@ -540,7 +563,6 @@ div.sidebar-comment-text {
color: #444;
}
div.sidebar-comment-info {
font-size: 10px;
color: #777;
}
@ -673,17 +695,7 @@ div.sidebar-comment-info {
/*
* lib/css/legacy/listing.css
*/
/* listing 2.0 */
div.listing-more {
margin: 7px 0px 17px 0px;
text-align: center;
display: none;
}
div.listing-toolbar {
margin: 7px 0px;
}
/* SRS */
@ -727,47 +739,6 @@ div.srs_filter_area td {
vertical-align: middle;
}
/* stats */
div.stat-grid {
border: 2px solid #bbb;
background-color: white;
margin-bottom: 19px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
overflow: hidden;
}
div.stat-label {
position: relative;
padding: 3px;
text-align: center;
}
div.stat-label, div.stat-label a {
z-index: 5;
}
div.stat-item {
position: relative;
border-bottom: 1px solid #ddd;
}
div.stat-item:last-child {
border-bottom: 0px solid #ddd;
}
div.stat-bar {
position: absolute;
left: 0px;
background-color: #def;
height: 100%;
z-index: 0;
}
/*
* lib/css/legacy/report.css
*/
@ -1110,9 +1081,8 @@ div.psidebar div.section {
}
div.psidebar div.section-head {
font-size: 12px;
padding: 5px 11px;
border-bottom: 2px solid #444;
border-bottom: 1px solid #aaa;
}
div.psidebar div.section-body {
@ -1124,7 +1094,6 @@ div.psidebar div.section-item {
}
div.psidebar div.section-item, div.psidebar .section-link {
font-size: 11px;
color: #666;
}
@ -1524,7 +1493,6 @@ div.psidebar div.section-item, div.psidebar .section-link {
margin: -1px;
background: #5f83b9;
color: #FFFFFF;
text-shadow: 0px 1px 1px #234386;
border-color: #466086;
-moz-border-radius: 0;
-webkit-border-radius: 0;
@ -1631,14 +1599,33 @@ div.psidebar div.section-item, div.psidebar .section-link {
margin-top: 8px;
}
/* list-row */
div.list-row {
border-bottom: 1px solid #eee;
padding: 3px 0px;
padding: 5px 0px;
}
div.list-row:hover {
background-color: #eef
}
div.list-row .label {
margin-right: 4px;
}
div.list-row table {
table-layout: fixed;
border-collapse: collapse;
width: 100%;
}
div.list-row table td {
overflow: hidden;
padding-right: 3px;
vertical-align: middle;
height: 24px;
max-height: 24px;
}
div.paging-button {
text-align: center;
padding: 11px 0px;
@ -1674,6 +1661,8 @@ div.list_filter input, div.list_filter select {
margin-right: 7px;
}
/* bar */
span.bar-outer {
display: inline-block;
margin: 0px 7px;
@ -1688,12 +1677,77 @@ span.bar-inner {
background-color: #bdf;
height: 100%;
margin-bottom: 2px;
float: left;
}
span.bar-complete {
background-color: green;
background-color: #009900;
}
span.bar-empty {
background-color: #990000;
}
/* stats */
div.stat-wrapper {
margin-bottom: 19px;
}
div.stat-grid {
border: 2px solid #bbb;
background-color: white;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
overflow: hidden;
}
div.stat-label {
position: relative;
padding: 3px;
text-align: center;
}
div.stat-label, div.stat-label a {
z-index: 5;
}
div.stat-item {
position: relative;
border-bottom: 1px solid #ddd;
}
div.stat-item:last-child {
border-bottom: 0px solid #ddd;
}
div.stat-bar {
position: absolute;
left: 0px;
background-color: #def;
height: 100%;
z-index: 0;
}
/*
* lib/css/ui/fonts.css
*/
@font-face {
font-family: 'Pontano Sans';
font-style: normal;
font-weight: 800;
src: url('../lib/css/fonts/pontanosans.woff') format('woff');
}
@font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: normal;
src: local('Droid Sans'), local('DroidSans'), url('../lib/css/fonts/droidsans.woff') format('woff');
}
/*
* lib/css/bootstrap/headings.css
*/
@ -1763,6 +1817,7 @@ h6 {
* lib/css/bootstrap/buttons.css
*/
.close {
font-family: Helvetica, Sans;
float: right;
font-size: 20px;
font-weight: bold;
@ -3314,6 +3369,102 @@ button.btn.small, input[type="submit"].btn.small {
background-position: -456px -118px;
}
/*
* lib/css/bootstrap/popover.css
*/
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1010;
display: none;
padding: 5px;
}
.popover.top {
margin-top: -5px;
}
.popover.right {
margin-left: 5px;
}
.popover.bottom {
margin-top: 5px;
}
.popover.left {
margin-left: -5px;
}
.popover.top .arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid #000000;
}
.popover.right .arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #000000;
}
.popover.bottom .arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid #000000;
}
.popover.left .arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #000000;
}
.popover .arrow {
position: absolute;
width: 0;
height: 0;
}
.popover-inner {
padding: 3px;
width: 280px;
overflow: hidden;
background: #000000;
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
}
.popover-title {
padding: 9px 15px;
line-height: 1;
background-color: #f5f5f5;
border-bottom: 1px solid #eee;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
}
.popover-content {
padding: 14px;
background-color: #ffffff;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
.popover-content p, .popover-content ul, .popover-content ol {
margin-bottom: 0;
}
/*
* erpnext/startup/startup.css
*/

View File

@ -29,7 +29,7 @@ select, input, textarea {
border: 1px solid #ccc;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
font-size: 13px;
font-size: inherit;
padding: 4px;
color: #444;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
@ -41,7 +41,7 @@ textarea {
font-family: inherit;
height: 120px;
width: 90%;
font-size: 12px;
font-size: inherit;
white-space: normal;
}
@ -104,6 +104,15 @@ div.fix_ff_cursor { overflow: auto; }
div.comment { color: #444; }
.small {
font-size: 11px;
}
.help {
margin: 3px 0px;
color: #888;
}
div#body_div {
position: relative;
display: none;
@ -113,15 +122,65 @@ div#body_div {
margin-top: 56px;
}
footer {
.content {
width: 900px;
margin: auto;
margin-bottom: 30px;
position: absolute;
-webkit-transition:all 0.5s ease-in-out;
-moz-transition:all 0.5s ease-in-out;
-o-transition:all 0.5s ease-in-out;
-ms-transition:all 0.5s ease-in-out;
transition:all 0.5s ease-in-out;
}
.background-fade-in {
-webkit-transition: background 1s ease-in; /* property duration timing-function delay */
-moz-transition: background 1s ease-in;
-o-transition: background 1s ease-in;
transition: background 1s ease-in;
}
/* selector for open pages */
#opened-page-selector {
width: 900px;
height: 900px;
position: absolute;
z-index: 100;
opacity: 0;
background-color: #bdf;
}
#opened-page-selector.active {
opacity: 0.6;
cursor: pointer;
}
.popover-container {
height: 400px;
}
footer {
position: absolute;
bottom: 0px;
width: 100%;
}
header .container {
width: 900px;
margin: auto;
}
@media (max-width: 1200px) {
div#body_div, header .container, .content, #opened-page-selector, footer {
width: 900px;
}
}
@media (min-width: 1200px) {
div#body_div, header .container, .content, #opened-page-selector, footer {
width: 1100px;
}
}
div.no_script {
display: none;
}
@ -135,7 +194,6 @@ div.loading_div {
display: none;
text-align: center;
padding: 2px;
font-size: 12px;
border: 1px solid #FF4;
}
@ -160,27 +218,18 @@ div.std-footer-item {
-moz-border-radius: 5px;
border-radius: 5px;
}
.gradient {
background: #ededed; /* Old browsers */
background: -moz-linear-gradient(top, #ededed 0%, #d1d1d1 47%, #b7b7b7 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(47%,#d1d1d1), color-stop(100%,#b7b7b7)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#b7b7b7',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* W3C */
}
.layout_wrapper, .layout-wrapper {
-moz-box-shadow: 1px 1px 8px #555;
-webkit-box-shadow: 1px 1px 8px #555;
box-shadow: 1px 1px 8px #555;
-moz-box-shadow: 0px 0px 6px rgba(0,0,0,0.3);
-webkit-box-shadow: 0px 0px 6px rgba(0,0,0,0.3);
box-shadow: 0px 0px 6px rgba(0,0,0,0.3);
background-color: #fff;
padding: 15px;
margin-bottom: 30px;
}
.layout-wrapper-background {
background-color: #f2f2f2 !important;
background-color: #fafafa !important;
padding: 0px;
}
@ -189,7 +238,7 @@ div.std-footer-item {
float: left;
padding: 15px;
background-color: #FFF;
min-height: 450px;
min-height: 600px;
-moz-box-shadow: 7px 0px 6px -2px #ddd;
-webkit-box-shadow: 7px 0px 6px -2px #ddd;
box-shadow: 7px 0px 6px -2px #ddd;
@ -198,10 +247,10 @@ div.std-footer-item {
.layout-side-section {
width: 22%;
/*float: right;*/
color: #606060;
color: #606060;
overflow-x: hidden;
padding: 15px;
min-height: 450px;
min-height: 600px;
}
/* from bootstrap */
@ -236,12 +285,14 @@ div.std-footer-item {
.avatar-small {
display: inline-block;
min-width: 29px;
width: 24px;
height: 20px;
vertical-align: middle;
overflow: hidden;
margin: 0px 3px;
}
.avatar-small img {
height: 24px;
margin-bottom: -7px;
max-width: 24px;
width: 24px;
}
/*
@ -448,6 +499,7 @@ h6 {
* lib/css/bootstrap/buttons.css
*/
.close {
font-family: Helvetica, Sans;
float: right;
font-size: 20px;
font-weight: bold;

File diff suppressed because it is too large Load Diff

View File

@ -1,629 +0,0 @@
/*
* lib/css/legacy/body.css
*/html {
margin: 0px;
padding: 0px;
}
body {
margin: 0px;
padding: 0px;
font-family: Arial, Helvetica, Sans;
font-size: 12px;
color: #000;
}
/* heading from bootstrap */
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
font-weight: bold;
color: #333333;
text-rendering: optimizelegibility;
margin-bottom: 0.3em;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
font-weight: normal;
color: #999999;
}
h1 {
font-size: 30px;
line-height: 36px;
}
h1 small {
font-size: 18px;
}
h2 {
font-size: 24px;
line-height: 36px;
}
h2 small {
font-size: 18px;
}
h3 {
line-height: 27px;
font-size: 18px;
}
h3 small {
font-size: 14px;
}
h4, h5, h6 {
line-height: 18px;
}
h4 {
font-size: 14px;
}
h4 small {
font-size: 12px;
}
h5 {
font-size: 12px;
}
h6 {
font-size: 11px;
color: #999999;
text-transform: uppercase;
}
pre { margin: 0px; padding: 0px; }
button { margin: 2px; margin-left: 0px; }
label {
padding-top: 15px;
color: #404040;
}
select, input, textarea {
border: 1px solid #AAA;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
font-size: 13px;
padding: 4px;
color: #222;
}
textarea {
font-family: inherit;
height: 120px;
width: 90%;
font-size: 12px;
white-space: normal;
}
table { padding: 0px; border-collapse: 'collapse'}
td {
padding:0px;
margin: 0px;
vertical-align: top;
}
p {
margin: 0px 0px 9px 0px;
line-height: 1.5em;
}
li {
line-height: 1.5em;
}
a:active { outline:none; }
:focus { -moz-outline-style:none; }
table.simpletable { border-collapse: collapse; margin-bottom: 10px;}
table.simpletable td {border: 1pt solid #000; vertical-align: top; padding: 2px; }
div.fix_ff_cursor { overflow: auto; }
/* --- Layout --- */
div.comment { color: #444; }
div#body_div {
position: relative;
display: none;
margin-top: 56px;
padding-right: 7px;
}
div.no_script {
display: none;
}
div.loading_div {
position: absolute;
background-color: #FFFFCC;
z-index: 1999;
right: 5px;
width: 90px;
display: none;
text-align: center;
padding: 2px;
font-size: 12px;
border: 1px solid #FF4;
}
div#head_div { background-color: #FFF; }
#head_banner { background-color: #FFF; }
.link_type {
padding:2px;
color: #00b;
text-decoration: underline;
cursor: pointer;
}
.link_type:hover {
color: #fff !important;
background-color: #07b;
text-decoration: none;
}
div.std-footer {
margin: 13px 0px;
border-top: 1px solid #AAA;
padding: 13px;
}
div.std-footer-item {
margin: 0px 13px 13px 0px;
}
.shadow {
-moz-box-shadow: 0px 2px 2px #888;
-webkit-box-shadow: 0px 2px 2px #888;
box-shadow: 0px 2px 2px #888;
}
.round {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.gradient {
background: #ededed; /* Old browsers */
background: -moz-linear-gradient(top, #ededed 0%, #d1d1d1 47%, #b7b7b7 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(47%,#d1d1d1), color-stop(100%,#b7b7b7)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#b7b7b7',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #ededed 0%,#d1d1d1 47%,#b7b7b7 100%); /* W3C */
}
.header-gradient {
background: #84827c; /* Old browsers */
background: -moz-linear-gradient(top, #84827c 0%, #27211c 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#84827c), color-stop(100%,#27211c)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #84827c 0%,#27211c 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #84827c 0%,#27211c 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #84827c 0%,#27211c 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#84827c', endColorstr='#27211c',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #84827c 0%,#27211c 100%); /* W3C */
color: #FFF;
}
.layout_wrapper {
padding: 15px;
-moz-box-shadow: 1px 1px 6px #AAA;
-webkit-box-shadow: 1px 1px 6px #AAA;
box-shadow: 1px 1px 6px #AAA;
background-color: #FFF;
}
/* from bootstrap */
.container {
margin-left: auto;
margin-right: auto;
zoom: 1;
}
.container:before, .container:after {
display: table;
content: "";
zoom: 1;
}
.container:after {
clear: both;
}
/*
* lib/css/legacy/menus.css
*/
/******** Menus - menu.js ************/
ul.menu_toolbar {
z-index: 30;
padding: 0px;
margin: 0px;
margin-top: 1px;
}
ul.menu_toolbar li {
list-style: none;
margin: 0px;
float: left;
}
.top_menu {
margin: 0px;
padding: 4px;
cursor: pointer;
color: #FFF;
margin-right: 8px;
}
.top_menu_mo {
background-color: #000;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.menu_toolbar_dropdown {
position: absolute;
margin-top: 4px;
margin-left: 8px;
width: 140px;
background-color: #FFF;
color: #000;
display: none;
border: 2px solid #333;
z-index: 31;
overflow-y: auto;
overflow-x: hidden;
}
div.dd_item {
cursor: pointer;
padding: 4px;
background-color: #FFF;
}
div.dd_item_mo { background-color: #FE8; }
/*
* lib/css/legacy/messages.css
*/
/* FLOATING MESSAGE */
.btn-img { cursor: pointer; }
div.fetching { color: #888; text-align:right; }
div.notice {
postion: absolute;
background-color: #000;
-moz-border-radius: 5px; -webkit-border-radius: 5px;
opacity: 0.6;
right: 0;
top: 0;
margin-top: 8px;
z-index: -1;
padding: 8px;
}
/** help **/
.info-box {
background-color: #F8F8F8;
border: 1px solid #CCCCCC;
border-radius: 3px 3px 3px 3px;
line-height: 1.6em;
overflow: auto;
padding: 6px 10px;
margin-bottom: 9px;
}
.help_box, .help-box {
background-color:#FFC;
font-size: 13px;
color: #864;
padding: 7px;
margin: 11px 0px;
border: 1px solid #EEB;
}
.help_box_big {
background-color:#FFC;
color: #864;
padding: 7px;
margin: 7px 0px;
border: 1px solid #EEB;
text-align: center;
font-size: 14px;
}
/*
* lib/css/legacy/dialog.css
*//***** Dialogs *******/
div.dialog_wrapper {
position: absolute;
width: 440px;
display: none;
z-index: 90;
background-color: #FFF;
border: 3px solid #222;
box-shadow:1px 1px 5px #777;
-moz-box-shadow: 1px 1px 5px #777;
-webkit-box-shadow: 1px 1px 5px #777;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.dialog_head {
height: 22px;
padding: 4px;
background-color: #222;
color: #FFF;
}
div.dialog_body {
padding: 8px 4px 16px 4px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.dialog_back {
position: fixed;
display: none;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
background-color: #EEE;
opacity: 0.6;
z-index: 50;
text-align: center;
}
div.dialog_message {
display: none;
position: absolute;
width: 250px;
font-size: 12px;
z-index: 91;
background-color:#FFF;
padding: 12px;
border: 1px solid #444;
}
div.dialog_row {
padding: 8px 8px 0px 8px;
}
div.dialog_row table {
width: 100%;
}
div.dialog_row table td {
}
div.dialog_row input[type="text"], div.dialog_row input[type="password"], div.dialog_row textarea, div.dialog_row select {
width: 80%;
font-size: 14px;
}
div.dialog_row table td textarea {
width: 80%;
height: 200px;
font-size: 12px;
}
/*
* lib/css/legacy/bootstrap-buttons.css
*/.btn.danger,
.alert-message.danger,
.btn.danger:hover,
.alert-message.danger:hover,
.btn.error,
.alert-message.error,
.btn.error:hover,
.alert-message.error:hover,
.btn.success,
.alert-message.success,
.btn.success:hover,
.alert-message.success:hover,
.btn.info,
.alert-message.info,
.btn.info:hover,
.alert-message.info:hover {
color: #ffffff;
}
.btn .close, .alert-message .close {
font-family: Arial, sans-serif;
line-height: 18px;
}
.btn.danger,
.alert-message.danger,
.btn.error,
.alert-message.error {
background-color: #c43c35;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));
background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
background-image: linear-gradient(top, #ee5f5b, #c43c35);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #c43c35 #c43c35 #882a25;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
.btn.success, .alert-message.success {
background-color: #57a957;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957));
background-image: -moz-linear-gradient(top, #62c462, #57a957);
background-image: -ms-linear-gradient(top, #62c462, #57a957);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957));
background-image: -webkit-linear-gradient(top, #62c462, #57a957);
background-image: -o-linear-gradient(top, #62c462, #57a957);
background-image: linear-gradient(top, #62c462, #57a957);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #57a957 #57a957 #3d773d;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
.btn.info, .alert-message.info {
background-color: #339bb9;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9));
background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9));
background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
background-image: linear-gradient(top, #5bc0de, #339bb9);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #339bb9 #339bb9 #22697d;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
.btn {
cursor: pointer;
display: inline-block;
background-color: #e6e6e6;
background-repeat: no-repeat;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
padding: 5px 14px 6px;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
color: #333;
font-size: 11px;
line-height: normal;
border: 1px solid #ccc;
border-bottom-color: #bbb;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-webkit-transition: 0.1s linear all;
-moz-transition: 0.1s linear all;
-ms-transition: 0.1s linear all;
-o-transition: 0.1s linear all;
transition: 0.1s linear all;
}
.btn:hover {
background-position: 0 -15px;
color: #333;
text-decoration: none;
}
.btn:focus {
outline: 1px dotted #666;
}
.btn.primary {
color: #ffffff;
background-color: #0064cd;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
background-image: -o-linear-gradient(top, #049cdb, #0064cd);
background-image: linear-gradient(top, #049cdb, #0064cd);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #0064cd #0064cd #003f81;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
.btn.active, .btn :active {
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn.disabled {
cursor: default;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
filter: alpha(opacity=65);
-khtml-opacity: 0.65;
-moz-opacity: 0.65;
opacity: 0.65;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.btn[disabled] {
cursor: default;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
filter: alpha(opacity=65);
-khtml-opacity: 0.65;
-moz-opacity: 0.65;
opacity: 0.65;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.btn.large {
font-size: 15px;
line-height: normal;
padding: 9px 14px 9px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.btn.small {
padding: 5px 7px 5px;
font-size: 11px;
}
:root .alert-message, :root .btn {
border-radius: 0 \0;
}
button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner {
padding: 0;
border: 0;
}
/* CLose */
.close {
float: right;
color: #000000;
font-size: 15px;
font-weight: bold;
line-height: 13.5px;
margin-bottom: -2px;
text-shadow: 0 1px 0 #ffffff;
filter: alpha(opacity=25);
-khtml-opacity: 0.25;
-moz-opacity: 0.25;
opacity: 0.25;
text-decoration: none;
}
.close:hover {
color: #000000;
text-decoration: none;
filter: alpha(opacity=40);
-khtml-opacity: 0.4;
-moz-opacity: 0.4;
opacity: 0.4;
cursor: pointer;
font-weight: bold;
}

View File

@ -1,411 +0,0 @@
# Module Def, Accounts
[
# These values are common in all dictionaries
{
'creation': '2010-09-25 10:50:37',
'docstatus': 0,
'modified': '2011-12-07 16:18:28',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Module Def Role
{
'doctype': 'Module Def Role',
'name': '__common__',
'parent': 'Accounts',
'parentfield': 'roles',
'parenttype': 'Module Def'
},
# These values are common for all Module Def Item
{
'doctype': 'Module Def Item',
'name': '__common__',
'parent': 'Accounts',
'parentfield': 'items',
'parenttype': 'Module Def'
},
# These values are common for all Module Def
{
'disabled': 'No',
'doctype': u'Module Def',
'doctype_list': 'GL Mapper, Journal Voucher\nGL Mapper, Payable Voucher\nGL Mapper, Receivable Voucher\nDocType Label, Receivable Voucher\nDocType Label, Payable Voucher',
'file_list': 'finance.gif,FileData/00210',
'is_hidden': 'No',
'last_updated_date': '2010-12-08 10:13:30',
'module_desc': 'Data about your payables, receivables and books of accounts',
'module_icon': 'Accounts.gif',
'module_label': 'Accounts',
'module_name': 'Accounts',
'module_seq': 5,
'name': '__common__'
},
# Module Def, Accounts
{
'doctype': u'Module Def',
'name': 'Accounts'
},
# Module Def Item
{
'click_function': "show_chart_browser('Accounts Browser','Account')",
'description': 'Manage your accounts',
'display_name': 'Chart of Accounts',
'doc_name': 'Accounts Browser',
'doc_type': 'Pages',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'click_function': "show_chart_browser('Accounts Browser','Cost Center')",
'description': 'Manage your cost centers',
'display_name': 'Chart of Cost Centers',
'doc_name': 'Accounts Browser',
'doc_type': 'Pages',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Regular journal entry',
'display_name': 'Journal Voucher',
'doc_name': 'Journal Voucher',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'voucher_type\nvoucher_date\nfiscal_year\ntotal_debit\ntotal_credit'
},
# Module Def Item
{
'description': 'Outgoing Invoice to your customers',
'display_name': 'Sales Invoice',
'doc_name': 'Receivable Voucher',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'voucher_date\ndue_date\ndebit_to\ngrand_total\noutstanding_amount'
},
# Module Def Item
{
'description': 'Incoming invoice from your service providers',
'display_name': 'Purchase Invoice',
'doc_name': 'Payable Voucher',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'voucher_date\ncredit_to\nbill_no\ngrand_total\noutstanding_amount'
},
# Module Def Item
{
'description': 'Lease Agreement for Vehicles',
'display_name': 'Lease Agreement',
'doc_name': 'Lease Agreement',
'doc_type': 'Forms',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Profit & Loss and Balance Sheet builder',
'display_name': 'Financial Statements',
'doc_name': 'Financial Statements',
'doc_type': 'Pages',
'doctype': 'Module Def Item',
'icon': 'table.gif'
},
# Module Def Item
{
'description': 'Update your actual clearance dates and find out if bank ledger tallies with your bank statement.',
'display_name': 'Bank Reconciliation',
'doc_name': 'Bank Reconciliation',
'doc_type': 'Single DocType',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Link your invoices and payment vouchers to clear/update outstanding amount',
'display_name': 'Internal Reconciliation',
'doc_name': 'Internal Reconciliation',
'doc_type': 'Single DocType',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'TDS Payment',
'doc_name': 'TDS Payment',
'doc_type': 'Setup Forms',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'TDS Return Acknowledgement',
'doc_name': 'TDS Return Acknowledgement',
'doc_type': 'Setup Forms',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Form 16A',
'doc_name': 'Form 16A',
'doc_type': 'Setup Forms',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Account closing entry (Profit Booking) on any date',
'display_name': 'Period Closing Voucher',
'doc_name': 'Period Closing Voucher',
'doc_type': 'Setup Forms',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'You can export balance of selected ledgers within a specific period',
'display_name': 'Ledger Balance Export',
'doc_name': 'Ledger Balance Export',
'doc_type': 'Single DocType',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Track C-Form received from customers',
'display_name': 'C-Form',
'doc_name': 'C-Form',
'doc_type': 'Setup Forms',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'General Ledger',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Accounts Receivable',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Accounts Payable',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Bank Reconciliation Statement',
'doc_name': 'Journal Voucher Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Trial Balance',
'doc_name': 'Account',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Sales Register',
'doc_name': 'Receivable Voucher',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Purchase Register',
'doc_name': 'Payable Voucher',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Bank Clearance report',
'doc_name': 'Journal Voucher Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Monthly Ledger Summary Report',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Collection Report',
'doc_name': 'Journal Voucher Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Total amout collection for a period - Customerwise',
'doc_name': 'Account',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Payment Report',
'doc_name': 'Journal Voucher Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Itemwise Sales Register',
'doc_name': 'RV Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Itemwise Purchase Register',
'doc_name': 'PV Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Cost Center wise Expense',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'TDS Return',
'doc_name': 'TDS Payment Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Budget Variance Report',
'doc_name': 'Budget Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Payment Receipt Report',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Track total commission given to your Business Associate',
'display_name': 'Business Associate Commission Report',
'doc_name': 'Receivable Voucher',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Lease Agreement List',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Lease Monthly Future Installment Inflows',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Lease Overdue Age Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Lease Overdue List',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Lease Receipts Client Wise',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Lease Yearly Future Installment Inflows',
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Voucher wise tax details',
'doc_name': 'RV Tax Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Accounts Manager'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Accounts User'
}
]

View File

@ -1,26 +0,0 @@
# Role, Accounts Manager
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:08:51',
'docstatus': 0,
'modified': '2009-03-19 14:57:46',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Role
{
'doctype': 'Role',
'module': 'Accounts',
'name': '__common__',
'role_name': 'Accounts Manager'
},
# Role, Accounts Manager
{
'doctype': 'Role',
'name': 'Accounts Manager'
}
]

View File

@ -1,26 +0,0 @@
# Role, Accounts User
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:08:51',
'docstatus': 0,
'modified': '2010-04-08 12:05:21',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Role
{
'doctype': 'Role',
'module': 'Accounts',
'name': '__common__',
'role_name': 'Accounts User'
},
# Role, Accounts User
{
'doctype': 'Role',
'name': 'Accounts User'
}
]

View File

@ -18,6 +18,11 @@ import webnotes
from webnotes.utils import flt
from webnotes.model.code import get_obj
install_docs = [
{"doctype":"Role", "name":"Accounts Manager"},
{"doctype":"Role", "name":"Accounts User"}
]
@webnotes.whitelist()
def get_default_bank_account():
"""

View File

@ -1,13 +1,34 @@
wn.doclistviews['Journal Voucher'] = wn.pages.ListView.extend({
init: function(doctype) {
this._super(doctype);
wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({
init: function(d) {
this._super(d);
this.fields = this.fields.concat([
'`tabJournal Voucher`.voucher_type'
'`tabJournal Voucher`.voucher_type',
'`tabJournal Voucher`.remark',
'`tabJournal Voucher`.total_debit'
]);
this.stats = this.stats.concat(['voucher_type']);
},
render: function(row, data) {
this._super(row, data);
this.$main.html(data.voucher_type);
}
prepare_data: function(data) {
this._super(data);
if(!data.remark) data.remark = '';
if(data.remark.length> 30) {
data.remark = '<span title="'+data.remark+'">' + data.remark.substr(0,30)
+ '...</span>';
}
},
columns: [
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '12%', content:'name'},
{width: '15%', content:'voucher_type'},
{width: '38%', content:'tags+remark', css: {'color':'#aaa'}},
{
width: '18%',
content: function(parent, data) {
$(parent).html(sys_defaults.currency + ' ' + fmt_money(data.total_debit))
},
css: {'text-align':'right'}
},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
],
});

View File

@ -0,0 +1,32 @@
// render
wn.doclistviews['Receivable Voucher'] = wn.views.ListView.extend({
init: function(d) {
this._super(d)
this.fields = this.fields.concat([
"`tabReceivable Voucher`.customer",
"ifnull(`tabReceivable Voucher`.outstanding_amount,0) as outstanding_amount",
"ifnull(`tabReceivable Voucher`.grand_total,0) as grand_total",
"`tabReceivable Voucher`.currency",
"ifnull(`tabReceivable Voucher`.grand_total_export,0) as grand_total_export"
]);
},
prepare_data: function(data) {
this._super(data);
data.paid = flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2);
},
columns: [
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '37%', content:'tags+customer', css: {color:'#aaa'}},
{
width: '18%',
content: function(parent, data) {
$(parent).html(data.currency + ' ' + fmt_money(data.grand_total_export))
},
css: {'text-align':'right'}
},
{width: '10%', content: 'paid', type:'bar-graph', label:'Paid'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -1,155 +0,0 @@
# Module Def, Buying
[
# These values are common in all dictionaries
{
'creation': '2011-07-01 17:40:38',
'docstatus': 0,
'modified': '2012-01-10 17:52:19',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Module Def Role
{
'doctype': 'Module Def Role',
'name': '__common__',
'parent': 'Buying',
'parentfield': 'roles',
'parenttype': 'Module Def'
},
# These values are common for all Module Def Item
{
'doctype': 'Module Def Item',
'name': '__common__',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
},
# These values are common for all Module Def
{
'disabled': 'No',
'doctype': u'Module Def',
'doctype_list': 'DocType Mapper, Purchase Receipt-Payable Voucher\nDocType Mapper, Purchase Order-Payable Voucher\nDocType Mapper, Purchase Order-Purchase Receipt\nDocType Mapper, Indent-Purchase Order\nPrint Format, Purchase Order Format\nPrint Format, Purchase Receipt Format\nDocType Label, Indent',
'file_list': 'scm.gif,FileData/00209',
'is_hidden': 'No',
'module_desc': '<p>All details about your Suppliers and past transactions</p>',
'module_icon': 'Buying.gif',
'module_label': 'Buying',
'module_name': 'Buying',
'module_seq': 4,
'name': '__common__'
},
# Module Def, Buying
{
'doctype': u'Module Def',
'name': 'Buying'
},
# Module Def Item
{
'description': 'Your Supplier Database',
'display_name': 'Supplier',
'doc_name': 'Supplier',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'id\nsupplier_type\nsupplier_status\ncompany'
},
# Module Def Item
{
'description': 'Buy requests from various people in your company',
'display_name': 'Indent',
'doc_name': 'Indent',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'status\ntransaction_date\nsales_order_no\nremark'
},
# Module Def Item
{
'description': 'Orders you have placed to your suppliers',
'display_name': 'Purchase Order',
'doc_name': 'Purchase Order',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'status\nsupplier\ntransaction_date\ngrand_total'
},
# Module Def Item
{
'display_name': 'Itemwise Receipt Details',
'doc_name': 'Purchase Receipt Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Purchase in Transit',
'doc_name': 'PV Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Pending PO Items To Receive',
'doc_name': 'PO Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Pending PO Items To Bill',
'doc_name': 'PO Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Itemwise Purchase Details',
'doc_name': 'PO Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'Ledger details of your creditors',
'display_name': "Creditor's Ledger",
'doc_name': 'GL Entry',
'doc_type': 'Reports',
'doctype': 'Module Def Item',
'icon': 'accept.gif'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Purchase User'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Purchase Manager'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Administrator'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Purchase Master Manager'
}
]

View File

@ -58,15 +58,6 @@ cur_frm.cscript.make_address = function() {
parent: cur_frm.fields_dict['Address HTML'].wrapper,
page_length: 2,
new_doctype: "Address",
new_doc_onload: function(dn) {
ndoc = locals["Address"][dn];
ndoc.supplier = cur_frm.doc.name;
ndoc.supplier_name = cur_frm.doc.supplier_name;
ndoc.address_type = 'Office';
},
new_doc_onsave: function(dn) {
cur_frm.address_list.run()
},
get_query: function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
},
@ -100,14 +91,6 @@ cur_frm.cscript.make_contact = function() {
parent: cur_frm.fields_dict['Contact HTML'].wrapper,
page_length: 2,
new_doctype: "Contact",
new_doc_onload: function(dn) {
ndoc = locals["Contact"][dn];
ndoc.supplier = cur_frm.doc.name;
ndoc.supplier_name = cur_frm.doc.supplier_name;
},
new_doc_onsave: function(dn) {
cur_frm.contact_list.run()
},
get_query: function() {
return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc"
},
@ -128,6 +111,7 @@ cur_frm.cscript.make_contact = function() {
// make purchase order list
cur_frm.cscript.make_po_list = function(parent, doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','25%','20%','25%','25%'];
lst.colnames = ['Sr.','Id','Status','PO Date','Grand Total'];
@ -142,6 +126,7 @@ cur_frm.cscript.make_po_list = function(parent, doc){
// make purchase receipt list
cur_frm.cscript.make_pr_list = function(parent,doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','20%','20%','20%','15%','20%'];
lst.colnames = ['Sr.','Id','Status','Receipt Date','% Billed','Grand Total'];
@ -156,6 +141,7 @@ cur_frm.cscript.make_pr_list = function(parent,doc){
// make purchase invoice list
cur_frm.cscript.make_pi_list = function(parent,doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','20%','20%','20%','15%','20%'];
lst.colnames = ['Sr.','Id','Posting Date','Credit To','Bill Date','Grand Total'];

View File

@ -46,10 +46,10 @@
width: 56px;
height: 56px;
border: 4px solid white;
box-shadow: 0 0 10px 1px black;
-moz-box-shadow: 0 0 10px 1px black;
-webkit-box-shadow: 0 0 10px 1px black;
-o-box-shadow: 0 0 10px 1px black;
box-shadow: 0 0 4px 1px black;
-moz-box-shadow: 0 0 4px 1px black;
-webkit-box-shadow: 0 0 4px 1px black;
-o-box-shadow: 0 0 4px 1px black;
margin: auto;
}
@ -65,14 +65,14 @@
/*font-size: 12px;*/
padding-top: 10px;
text-align: center;
text-shadow: 1px 1px 5px #000, 3px 3px 5px #000;
text-shadow: 0px 0px 3px #000, 0px 0px 3px #000, 0px 0px 2px #000;
}
/* Hover and click effects */
.case-border:hover, .circle:hover, .hover-effect {
box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important;
-moz-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important;
-webkit-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important;
box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important;
-moz-box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important;
-webkit-box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important;
-o-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important;
}
@ -105,10 +105,10 @@
margin-top: -74px;
margin-right: 10px;
border: 2px solid white;
box-shadow: 0 0 10px 1px black;
-moz-box-shadow: 0 0 10px 1px black;
-webkit-box-shadow: 0 0 10px 1px black;
-o-box-shadow: 0 0 10px 1px black;
box-shadow: 0 0 4px 1px black;
-moz-box-shadow: 0 0 4px 1px black;
-webkit-box-shadow: 0 0 4px 1px black;
-o-box-shadow: 0 0 4px 1px black;
}
.circle-text {

View File

@ -600,7 +600,7 @@ pscript.home_make_status = function() {
// get values
$c_page('home', 'event_updates', 'get_status_details', user,
function(r,rt) {
//page_body.wntoolbar.set_new_comments(r.message.unread_messages);
//wn.container.wntoolbar.set_new_comments(r.message.unread_messages);
// render online users
pscript.online_users_obj.render(r.message.online_users);

View File

@ -72,15 +72,6 @@ cur_frm.cscript.make_address = function() {
parent: cur_frm.fields_dict['Address HTML'].wrapper,
page_length: 2,
new_doctype: "Address",
new_doc_onload: function(dn) {
ndoc = locals["Address"][dn];
ndoc.customer = cur_frm.doc.name;
ndoc.customer_name = cur_frm.doc.customer_name;
ndoc.address_type = 'Office';
},
new_doc_onsave: function(dn) {
cur_frm.address_list.run()
},
get_query: function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
},
@ -114,17 +105,6 @@ cur_frm.cscript.make_contact = function() {
parent: cur_frm.fields_dict['Contact HTML'].wrapper,
page_length: 2,
new_doctype: "Contact",
new_doc_onload: function(dn) {
ndoc = locals["Contact"][dn];
ndoc.customer = cur_frm.doc.name;
ndoc.customer_name = cur_frm.doc.customer_name;
if(cur_frm.doc.customer_type == 'Individual') {
ndoc.first_name = cur_frm.doc.customer_name;
}
},
new_doc_onsave: function(dn) {
cur_frm.contact_list.run()
},
get_query: function() {
return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc"
},
@ -174,6 +154,7 @@ cur_frm.fields_dict['lead_name'].get_query = function(doc,dt,dn){
// make quotation list
// --------------------
cur_frm.cscript.make_qtn_list = function(parent,doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','20%','20%','20%','20%','15%'];
@ -191,6 +172,8 @@ cur_frm.cscript.make_qtn_list = function(parent,doc){
// make so list
// -------------
cur_frm.cscript.make_so_list = function(parent,doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','20%','20%','30%','25%'];
lst.colnames = ['Sr.','Id','Status','Sales Order Date','Grand Total'];
@ -207,6 +190,8 @@ cur_frm.cscript.make_so_list = function(parent,doc){
// make dn list
// -------------
cur_frm.cscript.make_dn_list = function(parent,doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','20%','20%','20%','20%','15%'];
lst.colnames = ['Sr.','Id','Status','Delivery Note Date','Territory','Grand Total'];
@ -223,6 +208,8 @@ cur_frm.cscript.make_dn_list = function(parent,doc){
// make si list
// -------------
cur_frm.cscript.make_si_list = function(parent,doc){
wn.require('lib/js/legacy/widgets/listing.js');
var lst = new Listing();
lst.colwidths = ['5%','20%','20%','20%','20%','15%'];
lst.colnames = ['Sr.','Id','Posting Date','Due Date','Debit To','Grand Total'];

View File

@ -1,7 +1,7 @@
// render
wn.doclistviews['Sales Order'] = wn.pages.ListView.extend({
init: function(doctype) {
this._super(doctype)
wn.doclistviews['Sales Order'] = wn.views.ListView.extend({
init: function(d) {
this._super(d)
this.fields = this.fields.concat([
"`tabSales Order`.customer_name",
"ifnull(`tabSales Order`.per_delivered,0) as per_delivered",
@ -9,40 +9,24 @@ wn.doclistviews['Sales Order'] = wn.pages.ListView.extend({
"`tabSales Order`.currency",
"ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export"
]);
this.stats = this.stats.concat(['status']);
},
render: function(row, data, listobj) {
// bar color for billed
data.bar_class_delivered = ''; data.bar_class_billed = '';
if(data.per_delivered == 100) data.bar_class_delivered = 'bar-complete';
if(data.per_billed == 100) data.bar_class_billed = 'bar-complete';
// lock for docstatus
data.icon = '';
data.item_color = 'grey';
if(data.docstatus==0) {
data.customer_name = '[Draft] ' + data.customer_name;
} else if(data.docstatus==1) {
data.icon = ' <i class="icon-lock" title="Submitted"></i>';
data.item_color = 'blue';
} else if(data.docstatus==2) {
data.icon = ' <i class="icon-remove" title="Cancelled"></i>';
data.item_color = 'red';
}
this._super(row, data);
this.$main.html(repl('<span style="color:%(item_color)s">%(customer_name)s</span>\
<span class="bar-outer" style="width: 30px; float: right" \
title="%(per_delivered)s% Delivered">\
<span class="bar-inner %(bar_class_delivered)s" \
style="width: %(per_delivered)s%;"></span>\
</span>\
<span class="bar-outer" style="width: 30px; float: right" \
title="%(per_billed)s% Billed">\
<span class="bar-inner %(bar_class_billed)s" \
style="width: %(per_billed)s%;"></span>\
</span>\
<span style="color:#444; float: right;">%(currency)s %(grand_total_export)s</span>\
', data))
}
columns: [
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
{width: '37%', content:'tags+customer_name', css: {color:'#aaa'}},
{
width: '18%',
content: function(parent, data) {
$(parent).html(data.currency + ' ' + fmt_money(data.grand_total_export))
},
css: {'text-align':'right'}
},
{width: '8%', content: 'per_delivered', type:'bar-graph', label:'Delivered'},
{width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'},
{width: '10%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -1,14 +1,6 @@
// common partner functions
// =========================
/*
// make shipping list body
// ------------------------
cur_frm.cscript.make_sl_body = function(){
cur_frm.fields_dict['Shipping HTML'].wrapper.innerHTML = '';
cur_frm.shipping_html = $a(cur_frm.fields_dict['Shipping HTML'].wrapper,'div');
}
*/
// make history list body
// -----------------------
@ -18,35 +10,6 @@ cur_frm.cscript.make_hl_body = function(){
}
/*
// set shipping list message
// --------------------------
cur_frm.cscript.set_sl_msg = function(doc){
cur_frm.shipping_html.innerHTML = 'Shipping Address Details will appear only when you save the ' + doc.doctype.toLowerCase();
}
*/
/*
// set history list message
// -------------------------
cur_frm.cscript.set_hl_msg = function(doc){
cur_frm.history_html.innerHTML= 'History Details will appear only when you save the ' + doc.doctype.toLowerCase();
}
*/
/*
// make shipping address
// -------------
cur_frm.cscript.make_shipping_address = function(doc, dt, dn){
cur_frm.shipping_html.innerHTML = '';
var dsn = cur_frm.doc.customer_name;
var dsa = cur_frm.doc.address;
cl = new AddressList(cur_frm.shipping_html,dt,dn,dsn,dsa);
}
*/
// make history
// -------------
cur_frm.cscript.make_history = function(doc,dt,dn){
@ -157,406 +120,4 @@ if(cur_frm.fields_dict['territory']){
cur_frm.fields_dict['territory'].get_query = function(doc,dt,dn) {
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}
}
// =======================================================================================================
// contact list
// --------------
ContactList = function(parent,dt,dn,dsn){
var me = this;
this.dt = dt;
this.dn = dn;
this.dsn = dsn ? dsn : dn;
this.wrapper = $a(parent,'div');
me.get_list();
}
// add contact
// ------------
ContactList.prototype.add_contact = function(){
var me = this;
// onload - set default values
var cont = LocalDB.create('Contact');
var c = locals['Contact'][cont];
if(me.dt == 'Customer') {
c.is_customer = 1;
c.customer = me.dn;
c.customer_name = me.dsn;
}
else if(me.dt == 'Supplier'){
c.is_supplier = 1;
c.supplier = me.dn;
c.supplier_name = me.dsn;
}
else if(me.dt == 'Sales Partner'){
c.is_sales_partner = 1;
c.sales_partner = me.dn;
//c.sales_partner_name = me.dsn;
}
loaddoc('Contact',c.name);
}
// get contact list
// -----------------
ContactList.prototype.get_list = function(){
var me = this;
me.make_list();
var dt = me.dt.toLowerCase().split(' ').join('_');
// build query
me.lst.get_query = function(){
this.query = repl("select name, first_name, last_name, concat_ws(' ', first_name, last_name), email_id, contact_no, department, designation, is_primary_contact, has_login, disable_login from tabContact where %(dt)s = '%(dn)s' and docstatus != 2",{'dt':dt, 'dn':me.dn});
this.query_max = repl("select count(name) from tabContact where %(dt)s = '%(dn)s' and docstatus != 2",{'dt':dt, 'dn':me.dn});
}
// render list ui
me.lst.show_cell = function(cell,ri,ci,d){
me.render_list(cell,ri,ci,d);
}
// run query
me.lst.run();
// onrun
me.lst.onrun = function(){
if(!this.has_data()){
this.rec_label.innerHTML = '';
$a(this.rec_label,'span').innerHTML = "You do not have any contact. ";
$($a(this.rec_label,'span')).html('Add a new contact').addClass('link_type').click(function(){ me.add_contact(); });
$dh(this.results);
}
else{
$ds(this.results);
}
}
}
// make list
// -----------
ContactList.prototype.make_list = function(){
var me = this;
var l = new Listing();
l.colwidths = ['5%','30%','30%','20%','20%'];
l.colnames = ['Sr.','Contact Name','Email Id','Contact No', 'Action'];
l.page_len = 10;
me.lst = l;
l.make(me.wrapper);
// Add contact button
me.add_btn = $btn(l.btn_area,'+ Add Contact', function(){ me.add_contact();}, {fontWeight:'bold'});
}
// make contact cell
// ------------------
ContactList.prototype.render_list = function(cell,ri,ci,d){
var me = this;
// name
if(ci == 0){
var nm = $a($a(cell,'div'),'span','',{cursor:'pointer'});
nm.innerHTML = d[ri][3];
nm.id = d[ri][0];
nm.onclick = function(){
loaddoc('Contact', this.id);
// on save callback - refresh list
}
// department and designation
var des = d[ri][7] ? d[ri][7] : '';
var dep = d[ri][6] ? d[ri][6] : '';
var sp = $a(cell,'div','comment');
sp.innerHTML = des + (dep ? (', ' + dep) : '');
}
// email id, contact no, department, designation
// -----------------------------------------------------
if(ci == 1) cell.innerHTML = d[ri][4] ? d[ri][4] : '-';
if(ci == 2) cell.innerHTML = d[ri][5] ? d[ri][5] : '-';
// actions
// --------------------------------------
if(ci== 3) me.make_actions(cell,ri,ci,d);
}
// make actions
// ---------------
ContactList.prototype.make_actions = function(cell,ri,ci,d){
var me = this;
var tab = make_table(cell,1,2,'100%',['40%','60%']);
// Edit and Delete
var t = make_table($td(tab,0,0),1,2);
var edit = $a($td(t,0,0),'div','wn-icon ic-doc_edit');
$(edit).click(function(){ loaddoc('Contact',d[ri][0]); });
edit.setAttribute('title','Edit');
// Below code should be uncommented once customer/venodr invitation process is stable
// ===========================================================================
/*
var del = $a($td(t,0,1),'div','wn-icon ic-trash');
$(del).click(function(){ me.delete_contact(d[ri][0],d[ri][4]) });
set_custom_tooltip(del, 'Delete');
// Invite, Enable and Disable - Integrate after gateway logic incorporated
if(d[ri][9] == 'Yes') {
if(d[ri][10] == 'Yes'){
var enb = $a($td(tab,0,1),'div','wn-icon ic-checkmark');
$(enb).click(function(){ me.enable_login(d[ri][0], d[ri][4]); });
}
else{
var dsb = $a($td(tab,0,1),'div','wn-icon ic-delete');
$(dsb).click(function(){ me.disable_login(d[ri][0], d[ri][4]) });
}
}
else{
var inv = $a($td(tab,0,1),'div','wn-icon ic-mail');
$(inv).click(function(){ me.invite_contact(d[ri][0], d[ri][4], d[ri][1], d[ri][2]) });
}*/
}
// enable login
// ----------------------------------------------------------
ContactList.prototype.enable_login = function(id, email_id){
var me = this;
var callback = function(r,rt){
me.get_list();
if(!r.exc) msgprint('Login for contact enabled',1);
else errprint(r.exc);
}
var args = {};
args.contact = id;
args.email = email_id;
$c_obj('Contact Control','enable_login',JSON.stringify(args),callback);
}
// disable login
// -------------------------------------------------------------
ContactList.prototype.disable_login = function(id, email_id){
var me = this;
var callback = function(r,rt){
me.get_list();
if(!r.exc) msgprint('Login for contact disabled',1);
else errprint(r.exc);
}
var args = {};
args.contact = id;
args.email = email_id;
$c_obj('Contact Control','disable_login',JSON.stringify(args),callback);
}
// delete contact
// -----------------
ContactList.prototype.delete_contact = function(id,email_id,has_login){
var me = this;
var callback = function(r,rt){
me.get_list();
if(!r.exc) msgprint('Contact deleted successfully');
else errprint(r.exc);
}
var args = {};
args.contact = id;
args.email = email_id;
args.has_login = has_login;
$c_obj('Contact Control','delete_contact',JSON.stringify(args),callback);
}
// invite user
// --------------------------------------------------------
ContactList.prototype.invite_contact = function(id,email_id,first_name,last_name){
var me = this;
if(!email_id){
msgprint("Please add email id and save the contact first. You can then invite contact to view transactions.")
}
else{
var callback = function(r,rt){
if(!r.exc) msgprint('Invitation sent');
else errprint(r.exc);
}
var args = {
'contact' : id,
'email' : email_id,
'first_name' : first_name ? first_name : '',
'last_name' : last_name ? last_name : '',
'usert_type' : 'Partner'
};
$c_obj('Contact Control','invite_contact',JSON.stringify(args),callback);
}
}
// address list
// --------------
AddressList = function(parent,dt,dn,dsn,dsa){
var me = this;
this.dt = dt;
this.dn = dn;
this.dsn = dsn ? dsn : dn;
this.dsa = dsa ? dsa : '';
this.wrapper = $a(parent,'div');
me.get_addr_list();
}
// add contact
// ------------
AddressList.prototype.add_address = function(){
var me = this;
// onload - set default values
var addr = LocalDB.create('Shipping Address');
var a = locals['Shipping Address'][addr];
a.customer = me.dn;
a.customer_name = me.dsn;
a.customer_address = me.dsa;
loaddoc('Shipping Address',a.name);
}
// get address list
// -----------------
AddressList.prototype.get_addr_list = function(){
var me = this;
me.make_addr_list();
var dt = me.dt.toLowerCase().split(' ').join('_');
// build query
me.lst.get_query = function(){
this.query = repl("select name, ship_to, shipping_address, is_primary_address, shipping_details from `tabShipping Address` where %(dt)s = '%(dn)s' and docstatus != 2",{'dt':dt, 'dn':me.dn});
this.query_max = repl("select count(name) from `tabShipping Address` where %(dt)s = '%(dn)s'",{'dt':dt, 'dn':me.dn});
}
// render list ui
me.lst.show_cell = function(cell,ri,ci,d){
me.render_list(cell,ri,ci,d);
}
// run query
me.lst.run();
// onrun
me.lst.onrun = function(){
if(!this.has_data()){
this.rec_label.innerHTML = '';
$a(this.rec_label,'span').innerHTML = "You do not have any shipping address.";
$($a(this.rec_label,'span')).html('Add a new address').addClass('link_type').click(function(){ me.add_address(); });
$dh(this.results);
}
else{
$ds(this.results);
}
}
}
// make list
// -----------
AddressList.prototype.make_addr_list = function(){
var me = this;
var l = new Listing();
l.colwidths = ['5%', '15%', '25%','10%','35%','10%'];
l.colnames = ['Sr.', 'Ship To', 'Shipping Address','Primary Address', 'Shipping Details', 'Action'];
l.page_len = 10;
me.lst = l;
l.make(me.wrapper);
// Add address button
me.add_btn = $btn(l.btn_area,'+ Add Address', function(){ me.add_address();}, {fontWeight:'bold'});
}
// make address cell
// ------------------
AddressList.prototype.render_list = function(cell,ri,ci,d){
var me = this;
// name
if(ci == 0){
var nm = $a($a(cell,'div'),'span','',{cursor:'pointer'});
nm.innerHTML = d[ri][1];
nm.id = d[ri][0];
nm.onclick = function(){
loaddoc('Shipping Address', this.id);
}
}
// shipping address, primary address, shipping details
// ----------------------------------------------------
if(ci == 1) cell.innerHTML = d[ri][2] ? d[ri][2] : '-';
if(ci == 2) cell.innerHTML = d[ri][3] ? d[ri][3] : '-';
if(ci == 3) cell.innerHTML = d[ri][4] ? d[ri][4] : '-';
// actions
// --------------------------------------
if(ci== 4) me.make_actions(cell,ri,ci,d);
}
// make actions
// ---------------
AddressList.prototype.make_actions = function(cell,ri,ci,d){
var me = this;
var tab = make_table(cell,1,2,'100%',['40%','60%']);
// Edit and Delete
var t = make_table($td(tab,0,0),1,2);
var edit = $a($td(t,0,0),'div','wn-icon ic-doc_edit');
$(edit).click(function(){ loaddoc('Shipping Address',d[ri][0]); });
edit.setAttribute('title','Edit');
}
}

View File

@ -51,15 +51,7 @@ cur_frm.cscript.make_address = function() {
cur_frm.address_list = new wn.ui.Listing({
parent: cur_frm.fields_dict['Address HTML'].wrapper,
page_length: 2,
new_doctype: "Address",
new_doc_onload: function(dn) {
ndoc = locals["Address"][dn];
ndoc.sales_partner = cur_frm.doc.name;
ndoc.address_type = 'Office';
},
new_doc_onsave: function(dn) {
cur_frm.address_list.run()
},
new_doctype: "Address",
get_query: function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
},
@ -84,13 +76,6 @@ cur_frm.cscript.make_contact = function() {
parent: cur_frm.fields_dict['Contact HTML'].wrapper,
page_length: 2,
new_doctype: "Contact",
new_doc_onload: function(dn) {
ndoc = locals["Contact"][dn];
ndoc.sales_partner = cur_frm.doc.name;
},
new_doc_onsave: function(dn) {
cur_frm.contact_list.run()
},
get_query: function() {
return "select name, first_name, last_name, email_id, phone, mobile_no, department, designation, is_primary_contact from tabContact where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_contact desc"
},

View File

@ -85,7 +85,7 @@ erpnext.complete_setup = function() {
wn.boot.user_info[user].fullname = user_fullname;
d.hide();
$('header').toggle(true);
page_body.wntoolbar.set_user_name();
wn.container.wntoolbar.set_user_name();
});
}

View File

@ -48,7 +48,7 @@ erpnext.toolbar.setup = function() {
$('#toolbar-user').append('<li><a href="#billing">Billing</a></li>')
}
$.extend(page_body.wntoolbar, {
$.extend(wn.container.wntoolbar, {
set_new_comments: function(new_comments) {
var navbar_nc = $('.navbar-new-comments');
if(new_comments && new_comments.length>0) {
@ -66,7 +66,7 @@ erpnext.toolbar.setup = function() {
}
});
page_body.wntoolbar.set_new_comments();
wn.container.wntoolbar.set_new_comments();
}
erpnext.toolbar.add_modules = function() {

View File

@ -73,8 +73,8 @@ erpnext.startup.start = function() {
// border to the body
// ------------------
$('footer').html('<div class="web-footer erpnext-footer">\
<a href="#!attributions">ERPNext | Attributions and License</a></div>');
//$('footer').html('<div class="web-footer erpnext-footer">\
// <a href="#!attributions">ERPNext | Attributions and License</a></div>');
// complete registration
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
@ -107,14 +107,14 @@ show_chart_browser = function(nm, chart_type){
var update_messages = function(reset) {
// Updates Team Messages
if(inList(['Guest'], user)) { return; }
if(inList(['Guest'], user) || !wn.session_alive) { return; }
if(!reset) {
$c_page('home', 'event_updates', 'get_global_status_messages', null,
function(r,rt) {
if(!r.exc) {
// This function is defined in toolbar.js
page_body.wntoolbar.set_new_comments(r.message.unread_messages);
wn.container.wntoolbar.set_new_comments(r.message.unread_messages);
var show_in_circle = function(parent_id, msg) {
var parent = $('#'+parent_id);
@ -139,7 +139,7 @@ var update_messages = function(reset) {
}
);
} else {
page_body.wntoolbar.set_new_comments(0);
wn.container.wntoolbar.set_new_comments(0);
$('#unread_messages').toggle(false);
}
}

View File

@ -1 +0,0 @@
[{'modified_by': 'Administrator', 'name': 'Ticket', 'parent': None, 'dt_label': 'Task', 'creation': '2010-06-28 12:55:47', 'modified': '2010-06-28 12:55:47', 'module': 'Accounts', 'doctype': 'DocType Label', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'dt': 'Ticket', 'parentfield': None}]

View File

@ -1,149 +0,0 @@
# Module Def, Support
[
# These values are common in all dictionaries
{
'creation': '2011-07-01 17:42:15',
'docstatus': 0,
'modified': '2011-10-10 16:59:49',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Module Def Role
{
'doctype': 'Module Def Role',
'name': '__common__',
'parent': 'Support',
'parentfield': 'roles',
'parenttype': 'Module Def'
},
# These values are common for all Module Def Item
{
'doctype': 'Module Def Item',
'name': '__common__',
'parent': 'Support',
'parentfield': 'items',
'parenttype': 'Module Def'
},
# These values are common for all Module Def
{
'disabled': 'No',
'doctype': u'Module Def',
'doctype_list': 'DocType Label, Ticket',
'is_hidden': 'No',
'module_desc': 'Manage maintenance quotes, orders, schedule etc.',
'module_icon': 'Maintenance.gif',
'module_label': 'Support',
'module_name': 'Support',
'module_seq': 8,
'name': '__common__'
},
# Module Def, Support
{
'doctype': u'Module Def',
'name': 'Support'
},
# Module Def Item
{
'description': "Database of Support Ticket's raised by Customers",
'display_name': 'Support Ticket',
'doc_name': 'Support Ticket',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'status\nopening_date\ncustomer\nallocated_to'
},
# Module Def Item
{
'description': 'Create schedule based on maintenance order',
'display_name': 'Maintenance Schedule',
'doc_name': 'Maintenance Schedule',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'status\ntransaction_date\ncustomer\nsales_order_no'
},
# Module Def Item
{
'description': 'Database of issues raised your Customers',
'display_name': 'Customer Issue',
'doc_name': 'Customer Issue',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'status\ncomplaint_date\ncustomer\nallocated_to\nallocated_on'
},
# Module Def Item
{
'display_name': 'Maintenance Visit',
'doc_name': 'Maintenance Visit',
'doc_type': 'Forms',
'doctype': 'Module Def Item',
'fields': 'status\nmntc_date\ncustomer\nmaintenance_type\ncompletion_status'
},
# Module Def Item
{
'description': 'List of all scheduled mainteance. You can filter by sales person, date, serial no etc. ',
'display_name': 'Maintenance Schedule Details',
'doc_name': 'Maintenance Schedule Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'description': 'List of all issues raised by customer',
'display_name': 'Customer Issues',
'doc_name': 'Customer Issue',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Warranty/AMC Expiry Details',
'doc_name': 'Serial No',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Warranty/AMC Summary',
'doc_name': 'Serial No',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'Maintenance Orderwise Pending Amount To Bill',
'doc_name': 'Sales Order Detail',
'doc_type': 'Reports',
'doctype': 'Module Def Item'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Administrator'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Maintenance User'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Maintenance Manager'
}
]

View File

@ -1,26 +0,0 @@
# Role, Maintenance Manager
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:08:51',
'docstatus': 0,
'modified': '2010-07-22 15:19:33',
'modified_by': 'Administrator',
'owner': 'ashwini@webnotestech.com'
},
# These values are common for all Role
{
'doctype': 'Role',
'module': 'Support',
'name': '__common__',
'role_name': 'Maintenance Manager'
},
# Role, Maintenance Manager
{
'doctype': 'Role',
'name': 'Maintenance Manager'
}
]

View File

@ -1,26 +0,0 @@
# Role, Maintenance User
[
# These values are common in all dictionaries
{
'creation': '2010-08-08 17:08:51',
'docstatus': 0,
'modified': '2010-07-22 15:19:19',
'modified_by': 'Administrator',
'owner': 'ashwini@webnotestech.com'
},
# These values are common for all Role
{
'doctype': 'Role',
'module': 'Support',
'name': '__common__',
'role_name': 'Maintenance User'
},
# Role, Maintenance User
{
'doctype': 'Role',
'name': 'Maintenance User'
}
]

View File

@ -1,26 +0,0 @@
# Role, Support Manager
[
# These values are common in all dictionaries
{
'creation': '2010-12-28 17:02:39',
'docstatus': 0,
'modified': '2010-12-28 15:17:40',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Role
{
'doctype': 'Role',
'module': 'Support',
'name': '__common__',
'role_name': 'Support Manager'
},
# Role, Support Manager
{
'doctype': 'Role',
'name': 'Support Manager'
}
]

View File

@ -1,26 +0,0 @@
# Role, Support Team
[
# These values are common in all dictionaries
{
'creation': '2010-12-28 17:02:39',
'docstatus': 0,
'modified': '2010-12-28 15:19:11',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Role
{
'doctype': 'Role',
'module': 'Support',
'name': '__common__',
'role_name': 'Support Team'
},
# Role, Support Team
{
'doctype': 'Role',
'name': 'Support Team'
}
]

View File

@ -0,0 +1,6 @@
install_docs = [
{'doctype':'Role', 'name':'Support Team'},
{'doctype':'Role', 'name':'Support Manager'},
{'doctype':'Role', 'name':'Maintenance User'},
{'doctype':'Role', 'name':'Maintenance Manager'}
]

View File

@ -0,0 +1,44 @@
// render
wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
init: function(d) {
this._super(d)
this.fields = this.fields.concat([
"`tabSupport Ticket`.status",
"`tabSupport Ticket`.subject",
"`tabSupport Ticket`.description"
]);
this.stats = this.stats.concat(['status']);
},
prepare_data: function(data) {
this._super(data);
if(data.status=='Open' || data.status=='To Reply') {
data.label_type = 'important'
}
else if(data.status=='Closed') {
data.label_type = 'success'
}
else if(data.status=='Hold') {
data.label_type = 'info'
}
else if(data.status=='Waiting for Customer') {
data.label_type = 'info'
}
data.status_html = repl('<span class="label label-%(label_type)s">%(status)s</span>', data);
// description
if(data.description && data.description.length > 30) {
data.description = '<span title="'+data.description+'">' + data.description.substr(0,30) + '...</span>';
}
},
columns: [
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '12%', content:'name'},
{width: '8%', content:'status_html'},
{width: '62%', content:'tags+subject+description', css: {color:'#aaa'}},
{width: '10%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});

View File

@ -17,5 +17,28 @@
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name');
if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name');
var route = wn.get_route();
if(route[1]=='Supplier') {
var supplier = locals.Supplier[route[2]]
doc.supplier = supplier.name;
doc.supplier_name = supplier.supplier_name;
doc.address_type = 'Office';
} else if(route[1]=='Customer') {
var customer = locals.Customer[route[2]]
doc.supplier = customer.name;
doc.customer_name = customer.customer_name;
doc.address_type = 'Office';
} else if(route[1]=='Sales Partner') {
var sp = locals['Sales Partner'][route[2]];
doc.sales_partner = sp.name;
ndoc.address_type = 'Office';
}
}
cur_frm.cscript.hide_dialog = function() {
var route = wn.get_route();
cur_frm.address_list.run();
}

View File

@ -18,54 +18,28 @@
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name');
if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name');
}
/*
//---------- on refresh ----------------------
cur_frm.cscript.refresh = function(doc,cdt,cdn){
}
//------------- Trigger on customer ---------------------
cur_frm.cscript.is_customer = function(doc,cdt,cdn){
if(!doc.is_customer){
doc.customer = doc.customer_name = doc.customer_address = doc.customer_group = '';
refresh_many(['customer','customer_name','customer_address','customer_group']);
var route = wn.get_route();
if(route[1]=='Supplier') {
var supplier = locals.Supplier[route[2]]
doc.supplier = supplier.name;
doc.supplier_name = supplier.supplier_name;
} else if(route[1]=='Customer') {
var customer = locals.Customer[route[2]];
doc.customer = customer.name;
doc.customer_name = customer.customer_name;
if(customer.customer_type == 'Individual') {
doc.first_name = customer.customer_name;
}
} else if(route[1]=='Sales Partner') {
var sp = locals['Sales Partner'][route[2]];
doc.sales_partner = sp.name;
}
}
//------------- Trigger on supplier -----------------------
cur_frm.cscript.is_supplier = function(doc,cdt,cdn){
if(!doc.is_supplier){
doc.supplier = doc.supplier_name = doc.supplier_address = doc.supplier_type = '';
refresh_many(['supplier','supplier_address','supplier_name','supplier_type']);
}
}
//--------------- Trigger on sales partner ---------------------
cur_frm.cscript.is_sales_partner = function(doc,cdt,cdn){
if(!doc.is_sales_partner){
doc.sales_partner = doc.sales_partner_address = doc.partner_type = '';
refresh_many(['sales_partner','sales_partner_address','partner_type']);
}
cur_frm.cscript.hide_dialog = function() {
var route = wn.get_route();
cur_frm.contact_list.run();
}
//----------- Trigger on supplier name ------------------------
cur_frm.cscript.supplier = function(doc,cdt,cdn){
arg = {'dt':'Supplier','dn':doc.supplier,'nm':'supplier_name','fld':'supplier_address','type':'supplier_type'};
get_server_fields('get_address',docstring(arg),'',doc,cdt,cdn,1);
}
//------------ Trigger on customer name ------------------------
cur_frm.cscript.customer = function(doc,cdt,cdn){
arg = {'dt':'Customer','dn':doc.customer,'nm':'customer_name','fld':'customer_address','type':'customer_group'};
get_server_fields('get_address',docstring(arg),'',doc,cdt,cdn,1);
}
//------------ Trigger on sales partner ------------------------
cur_frm.cscript.sales_partner = function(doc,cdt,cdn){
arg = {'dt':'Sales Partner','dn':doc.sales_partner,'nm':'partner_name','fld':'sales_partner_address','type':'partner_type'};
get_server_fields('get_address',docstring(arg),'',doc,cdt,cdn,1);
}
*/

View File

@ -24,7 +24,11 @@ pscript.onload_calendar = function(wrapper) {
if(!erpnext.calendar) {
erpnext.calendar = new Calendar();
erpnext.calendar.init(wrapper);
rename_observers.push(erpnext.calendar);
var me = this;
$(document).bind('rename', function(event, dt, old_name, new_name) {
erpnext.calendar.rename_notify(dt, old_name, new_name)
});
}
}
@ -63,7 +67,7 @@ Calendar.prototype.init=function (parent) {
Calendar.prototype.rename_notify = function(dt, old_name, new_name) {
// calendar
if(dt = 'Event'){
if(dt = 'Event'){
if(this.events_by_name[old_name]) {
delete this.events_by_name[old_name];
}

View File

@ -76,7 +76,7 @@ erpnext.messages = {
// check for updates every 5 seconds if page is active
refresh: function() {
setTimeout(erpnext.messages.refresh, 10000);
if(page_body.cur_page_label != 'messages') return;
if(wn.container.page.label != 'messages') return;
erpnext.messages.show();
},
get_contact: function() {

View File

@ -5,13 +5,19 @@ body {
background-color: #{{ doc.background_color }};
{% endif %}
{% if doc.font %}
font-family: {{ doc.font }} !important;
font-family: '{{ doc.font }}', Verdana, Sans !important;
{% endif %}
{% if doc.font_size %}
font-size: {{ doc.font_size }} !important;
{% endif %}
}
{% if doc.font_size %}
.small {
font-size: {{ doc.small_font_size }} !important;
}
{% endif %}
{% if doc.footer_font_color %}
footer {
color: {{ doc.footer_font_color }};
@ -26,6 +32,6 @@ footer a, footer a:visited, footer a:hover {
{% if doc.heading_font %}
h1, h2, h3, h4, h5 {
font-family: {{ doc.heading_font}} !important;
font-family: '{{ doc.heading_font}}', Arial, 'Helvetica Neue' !important;
}
{% endif %}

View File

@ -25,9 +25,13 @@ class DocType:
with open('erpnext/website/doctype/style_settings/custom_template.css', 'r') as f:
temp = Template(f.read())
self.doc.small_font_size = str(int(self.doc.font_size[:-2])-2) + 'px'
self.doc.custom_css = temp.render(doc = self.doc)
from webnotes.session_cache import clear_cache
clear_cache('Guest')
del self.doc.fields['small_font_size']

View File

@ -5,150 +5,150 @@
{
'creation': '2012-02-02 09:57:25',
'docstatus': 0,
'modified': '2012-02-02 10:47:38',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-03-21 10:53:38',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1328159294',
'_last_update': u'1330594969',
'allow_attach': 1,
'colour': 'White:FFF',
'description': 'Set your background color, font and image (tiled)',
'colour': u'White:FFF',
'description': u'Set your background color, font and image (tiled)',
'doctype': 'DocType',
'issingle': 1,
'max_attachments': 1,
'module': 'Website',
'module': u'Website',
'name': '__common__',
'section_style': 'Simple',
'section_style': u'Simple',
'show_in_menu': 0,
'version': 9
'version': 15
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Style Settings',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'Style Settings',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'name': '__common__',
'parent': 'Style Settings',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'Style Settings',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1,
'role': 'Website Manager'
'role': u'Website Manager'
},
# DocType, Style Settings
{
'doctype': 'DocType',
'name': 'Style Settings'
'name': u'Style Settings'
},
# DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'permlevel': 0,
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'permlevel': 1
},
# DocField
{
'colour': 'White:FFF',
'description': 'Solid background color (default light gray)',
'doctype': 'DocField',
'fieldname': 'background_color',
'fieldtype': 'Data',
'label': 'Background Color',
'colour': u'White:FFF',
'description': u'Solid background color (default light gray)',
'doctype': u'DocField',
'fieldname': u'background_color',
'fieldtype': u'Data',
'label': u'Background Color',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'If image is selected, color will be ignored (attach first)',
'doctype': 'DocField',
'fieldname': 'background_image',
'fieldtype': 'Select',
'label': 'Background Image',
'options': 'attach_files:',
'colour': u'White:FFF',
'description': u'If image is selected, color will be ignored (attach first)',
'doctype': u'DocField',
'fieldname': u'background_image',
'fieldtype': u'Select',
'label': u'Background Image',
'options': u'attach_files:',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'font',
'fieldtype': 'Select',
'label': 'Font',
'options': '\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma',
'doctype': u'DocField',
'fieldname': u'font',
'fieldtype': u'Select',
'label': u'Font',
'options': u'\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma\nPontano Sans\nDroid Sans\nGill Sans',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'font_size',
'fieldtype': 'Select',
'label': 'Font Size',
'options': '\n12px\n13px\n14px',
'doctype': u'DocField',
'fieldname': u'font_size',
'fieldtype': u'Select',
'label': u'Font Size',
'options': u'\n12px\n13px\n14px\n15px\n16px',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'heading_font',
'fieldtype': 'Select',
'label': 'Heaing Font',
'options': '\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma',
'doctype': u'DocField',
'fieldname': u'heading_font',
'fieldtype': u'Select',
'label': u'Heading Font',
'options': u'\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma\nPontano Sans\nDroid Sans\nGill Sans',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Select a white footer foreground color if you have a dark background',
'doctype': 'DocField',
'fieldname': 'footer_font_color',
'fieldtype': 'Select',
'label': 'Footer Font Color',
'options': '\nwhite',
'colour': u'White:FFF',
'description': u'Select a white footer foreground color if you have a dark background',
'doctype': u'DocField',
'fieldname': u'footer_font_color',
'fieldtype': u'Select',
'label': u'Footer Font Color',
'options': u'\nwhite',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'description': 'Auto generated',
'doctype': 'DocField',
'fieldname': 'custom_css',
'fieldtype': 'Code',
'label': 'Custom CSS',
'colour': u'White:FFF',
'description': u'Auto generated',
'doctype': u'DocField',
'fieldname': u'custom_css',
'fieldtype': u'Code',
'label': u'Custom CSS',
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_list',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': 'File List',
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1

View File

@ -112,6 +112,6 @@ erpnext.Footer = Class.extend({
});
$(document).bind('startup', function() {
erpnext.footer = new erpnext.Footer();
erpnext.navbar.navbar = new erpnext.navbar.navbar();
// erpnext.footer = new erpnext.Footer();
// erpnext.navbar.navbar = new erpnext.navbar.navbar();
})

File diff suppressed because it is too large Load Diff

View File

@ -12,22 +12,6 @@
*/
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
// manage history
// load pages via ajax
// setup the history adapter
// if settings no_history is set, no history will be bound
// this can be used to make it work with legacy
$(document).bind('ready', function() {
// standard page openener
$(window).bind('hashchange', function() {
if(wn.settings.no_history)
return;
// load the state on the browser
wn.page.set(location.hash);
});
})
/*
@ -91,8 +75,7 @@ localStorage.setItem('_version_number',window._version_number);}}}
wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src))
return true},add:function(src,txt){if('localStorage'in window){localStorage.setItem(src,txt);}},get:function(src){return localStorage.getItem(src);},extn:function(src){if(src.indexOf('?')!=-1){src=src.split('?').slice(-1)[0];}
return src.split('.').slice(-1)[0];},load:function(src){var t=src;$.ajax({url:t,data:{q:Math.floor(Math.random()*1000)},dataType:'text',success:function(txt){wn.assets.add(src,txt);},async:false})},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);}
var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
document.getElementsByTagName('head')[0].appendChild(se);},cgi:function(txt,src){wn.dom.eval(txt)}}}
var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){wn.dom.set_style(txt);},cgi:function(txt,src){wn.dom.eval(txt)}}}
/*
* lib/js/wn/require.js
*/
@ -102,7 +85,9 @@ var l=items.length;for(var i=0;i<l;i++){var src=items[i];if(!(src in wn.assets.e
* lib/js/wn/dom.js
*/
wn.provide('wn.dom');wn.dom.by_id=function(id){return document.getElementById(id);}
wn.dom.eval=function(txt){var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);}
wn.dom.eval=function(txt){if(!txt)return;var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);}
wn.dom.set_style=function(txt){if(!txt)return;var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
document.getElementsByTagName('head')[0].appendChild(se);}
wn.dom.add=function(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=wn.dom.by_id(parent);var c=document.createElement(newtag);if(parent)
parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img')
c.src=className
@ -114,14 +99,7 @@ wn.get_cookie=function(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind==
/*
* lib/js/wn/model.js
*/
wn.provide('wn.model');wn.model.no_value_type=['Section Break','Column Break','HTML','Table','Button','Image'];wn.model.can_delete=function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}
/*
* lib/js/wn/page.js
*/
wn.page={set:function(src){var new_selection=$('.inner div.content[_src="'+src+'"]');if(!new_selection.length){wn.assets.execute(src);new_selection=$('.inner div.content[_src="'+src+'"]');}
$('.inner .current_page').removeClass('current_page');new_selection.addClass('current_page');var title=$('nav ul li a[href*="'+src+'"]').attr('title')||'No Title'
state=window.location.hash;if(state!=src){window.location.hash=state;}
else{document.title=title;}}}
wn.provide('wn.model');wn.model={no_value_type:['Section Break','Column Break','HTML','Table','Button','Image'],new_names:{},with_doctype:function(doctype,callback){if(locals.DocType[doctype]){callback();}else{wn.call({method:'webnotes.widgets.form.load.getdoctype',args:{doctype:doctype},callback:callback});}},with_doc:function(doctype,name,callback){if(!name)name=doctype;if(locals[doctype]&&locals[doctype][name]){callback(name);}else{if(name&&name.indexOf('New '+doctype)!=-1){name=LocalDB.create(doctype);callback(name);}else{wn.call({method:'webnotes.widgets.form.load.getdoc',args:{doctype:doctype,name:name},callback:function(r){callback(name);}});}}},can_delete:function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}}
/*
* lib/js/wn/misc/user.js
*/
@ -131,6 +109,8 @@ if(!wn.boot.user_info[uid])return def
if(!wn.boot.user_info[uid].fullname)
wn.boot.user_info[uid].fullname=uid;if(!wn.boot.user_info[uid].image)
wn.boot.user_info[uid].image=def.image;return wn.boot.user_info[uid];}
wn.session_alive=true;$(document).bind('mousemove',function(){wn.session_alive=true;if(wn.session_alive_timeout)
clearTimeout(wn.session_alive_timeout);wn.session_alive_timeout=setTimeout('wn.session_alive=false;',30000);})
/*
* lib/js/lib/json2.js
*/
@ -159,6 +139,207 @@ text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());
/*
* lib/js/wn/router.js
*/
wn.route=function(){wn._cur_route=window.location.hash;route=wn.get_route();switch(route[0]){case"List":wn.views.doclistview.show(route[1]);break;case"Form":if(route.length>3){route[2]=route.splice(2).join('/');}
wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}}
wn.get_route=function(route){if(!route)
route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return $.map(route.split('/'),function(r){return decodeURIComponent(r);});}
wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;}
wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route)
return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}});
/*
* lib/js/wn/ui/listing.js
*/
wn.provide('wn.ui');wn.ui.Listing=Class.extend({init:function(opts){this.opts=opts||{};this.page_length=20;this.start=0;this.data=[];if(opts){this.make();}},prepare_opts:function(){if(this.opts.new_doctype){if(wn.boot.profile.can_read.indexOf(this.opts.new_doctype)==-1){this.opts.new_doctype=null;}else{this.opts.new_doctype=get_doctype_label(this.opts.new_doctype);}}
if(!this.opts.no_result_message){this.opts.no_result_message='Nothing to show'}},make:function(opts){if(opts){this.opts=opts;}
this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
<div class="wnlist">\
<h3 class="title hide">%(title)s</h3>\
\
<div class="list-filters hide">\
<div class="show_filters well">\
<div>\
<button class="btn btn-small add-filter-btn">\
<i class="icon-plus"></i> Add Filter</button>\
</div>\
<div class="filter_area"></div>\
</div>\
</div>\
\
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
<div class="list-toolbar">\
<a class="btn btn-small btn-refresh btn-info">\
<i class="icon-refresh icon-white"></i> Refresh</a>\
<a class="btn btn-small btn-new">\
<i class="icon-plus"></i> New</a>\
<a class="btn btn-small btn-filter">\
<i class="icon-search"></i> Filter</a>\
</div>\
<img src="lib/images/ui/button-load.gif" \
class="img-load" style="float: left;"/>\
</div><div style="clear:both"></div>\
\
<div class="no-result help hide">\
%(no_result_message)s\
</div>\
\
<div class="result">\
<div class="result-list"></div>\
<div class="result-grid hide"></div>\
</div>\
\
<div class="paging-button">\
<button class="btn btn-small btn-more hide">More...</div>\
</div>\
</div>\
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();}
if(!me.show_filters){this.$w.find('.btn-filter').remove();}
if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();}
this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){this.$w.find('.list-toolbar').addClass('btn-group')}
if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
this.onrun=a0;if(a0&&a0.callback)
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading,btn:this.run_btn});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
if(this.args)
$.extend(args,this.args)
if(this.get_args){$.extend(args,this.get_args());}
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
this.start+=m;if(values.length>=this.page_length)
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
values.push(f.get_value());})
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
return this.filters[i];}}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.fields_by_name={};this.make();this.make_options();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('<div class="list_filter">\
<select class="fieldname_select"></select>\
<select class="condition">\
<option value="=">Equals</option>\
<option value="like">Like</option>\
<option value=">=">Greater or equals</option>\
<option value=">=">Less or equals</option>\
<option value=">">Greater than</option>\
<option value="<">Less than</option>\
<option value="in">In</option>\
<option value="!=">Not equals</option>\
</select>\
<span class="filter_field"></span>\
<a class="close">&times;</a>\
</div>');this.$w=this.flist.$w.find('.list_filter:last-child');this.$select=this.$w.find('.fieldname_select');},make_options:function(){if(this.filter_fields){for(var i in this.filter_fields)
this.add_field_option(this.filter_fields[i])}else{this.render_field_select();}},set_events:function(){var me=this;this.$w.find('.fieldname_select').bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);}
if(value){me.flist.listobj.run();}
me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if($(this).val()=='in'){me.set_field(me.field.df.fieldname,'Data');if(!me.field.desc_area)
me.field.desc_area=$a(me.field.wrapper,'span','help',null,'values separated by comma');}else{me.set_field(me.field.df.fieldname);}});if(me.fieldname){this.set_values(me.fieldname,me.condition,me.value);}else{me.set_field('name');}},set_values:function(fieldname,condition,value){this.set_field(fieldname);if(condition)this.$w.find('.condition').val(condition).change();if(value)this.field.set_input(value)},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;}
if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('<option>',{value:df.fieldname,table:table}).text(label));me.fields_by_name[df.fieldname]=df;}},set_field:function(fieldname,fieldtype){var me=this;var cur=me.field?{fieldname:me.field.df.fieldname,fieldtype:me.field.df.fieldtype}:{}
var df=me.fields_by_name[fieldname];this.set_fieldtype(df,fieldtype);if(me.field&&cur.fieldname==fieldname&&df.fieldtype==cur.fieldtype){return;}
me.$w.find('.fieldname_select').val(fieldname);var field_area=me.$w.find('.filter_field').empty().get(0);f=make_field(df,null,field_area,null,0,1);f.df.single_select=1;f.not_in_form=1;f.with_label=0;f.refresh();me.field=f;this.set_default_condition(df,fieldtype);$(me.field.wrapper).find(':input').keydown(function(ev){if(ev.which==13){me.flist.listobj.run();}})},set_fieldtype:function(df,fieldtype){if(df.original_type)
df.fieldtype=df.original_type;else
df.original_type=df.fieldtype;df.description='';df.reqd=0;if(fieldtype){df.fieldtype=fieldtype;return;}
if(df.fieldtype=='Check'){df.fieldtype='Select';df.options='No\nYes';}else if(['Text','Text Editor','Code','Link'].indexOf(df.fieldtype)!=-1){df.fieldtype='Data';}},set_default_condition:function(df,fieldtype){if(!fieldtype){if(df.fieldtype=='Data'){this.$w.find('.condition').val('like');}else{this.$w.find('.condition').val('=');}}},get_value:function(){var me=this;var val=me.field.get_value();var cond=me.$w.find('.condition').val();if(me.field.df.original_type=='Check'){val=(val=='Yes'?1:0);}
if(cond=='like'){val=val+'%';}
return[me.$w.find('.fieldname_select option:selected').attr('table'),me.field.df.fieldname,me.$w.find('.condition').val(),val];}});
/*
* lib/js/wn/views/container.js
*/
wn.provide('wn.pages');wn.provide('wn.views');wn.views.Container=Class.extend({init:function(){this.container=$('#body_div').get(0);this.page=null;this.pagewidth=$('#body_div').width();this.opened=[];this.pagemargin=50;},add_page:function(label,onshow,onhide){var page=$('<div class="content"></div>').css('left',this.pagewidth+this.pagemargin+'px').appendTo(this.container).get(0);if(onshow)
$(page).bind('show',onshow);if(onshow)
$(page).bind('hide',onhide);page.label=label;wn.pages[label]=page;return page;},change_to:function(label){var me=this;if(label.tagName){var page=label;}else{var page=wn.pages[label];}
if(!page){console.log('Page not found '+label);return;}
if(this.page){this.move_left(page);$(this.page).trigger('hide');this.opened.push(this.page);if(!this.opened_selector)
this.select_opened_page();}
this.page=page;$(this.page).css('left','0px').css('top','0px');$(this.page).trigger('show');this.page._route=window.location.hash;document.title=this.page.label;this.stack();return this.page;},move_left:function(page){$(page).css('left',(-1*(this.pagewidth+this.pagemargin))+'px');},stack:function(){var me=this;var l=-1*(this.pagewidth+this.pagemargin);var i=0;this.opened=$.map(this.opened,function(p,i){if(p!=me.page)return p;});var pcontent=[];$.map(this.opened,function(p,i){$(p).css('left',l-(i*2)+'px').css('top',(i*2)+'px').css('z-index',i);});},build_open_links:function(p){var open_links=[];var me=this;$.each(me.opened.concat([me.page]),function(i,p){var route=wn.get_route(p._route);if(route[0]=='Form'){var openlist=keys(wn.views.formview[route[1]].frm.opendocs).sort();$.each(openlist,function(i,v){if(me.page!=p||(me.page==p&&me.page.frm.docname!=v)){open_links.push(repl('<p><a href="#!Form/%(dt)s/%(dn)s">%(dn)s (%(dt)s)</a></p>',{dt:route[1],dn:v}));}});}else{if(me.page!=p){open_links.push(repl('<p><a href="%(route)s">%(label)s</a></p>',{route:p._route,label:p.label}));}}});return open_links;},select_opened_page:function(){var me=this;this.opened_selector=$('<div id="opened-page-selector">\
<div class="popover-container"></div></div>').appendTo(this.container).hover(function(){$(this).toggleClass('active')}).click(function(){$('#opened-page-selector .popover-container').attr('data-content',me.build_open_links().reverse().join(''));$(this).find('.popover-container').popover('show');me.popoveropen=true;return false;})
this.opened_selector.find('.popover-container').popover({title:"Open Pages",trigger:'manual',delay:0});$(document).click(function(){if(me.popoveropen){$('#opened-page-selector .popover-container').popover('hide');me.popoveropen=false;}})
this.move_left(this.opened_selector);},show:function(label){return this.change_to(label);}});
/*
* lib/js/wn/views/doclistview.js
*/
wn.provide('wn.views.doclistview');wn.provide('wn.doclistviews');wn.views.doclistview.pages={};wn.views.doclistview.show=function(doctype){var pagename=doctype+' List';var doctype=get_label_doctype(doctype);wn.model.with_doctype(doctype,function(){var page=wn.views.doclistview.pages[pagename];if(!page){var page=wn.container.add_page(pagename);page.doclistview=new wn.views.DocListView(doctype,page);wn.views.doclistview.pages[pagename]=page;}
document.title=page.doclistview.label;wn.container.change_to(pagename);})}
wn.views.DocListView=wn.ui.Listing.extend({init:function(doctype,page){this.doctype=doctype;this.$page=$(page);this.label=get_doctype_label(doctype);this.label=(this.label.toLowerCase().substr(-4)=='list')?this.label:(this.label+' List');this.make_page();this.setup();},make_page:function(){var me=this;this.$page.html(repl('<div class="layout-wrapper layout-wrapper-background">\
<div class="layout-main-section">\
<a class="close" onclick="window.history.back();">&times;</a>\
<h1>%(label)s</h1>\
<hr>\
<div class="wnlist-area"><div class="help">Loading...</div></div>\
</div>\
<div class="layout-side-section">\
<div class="stat-wrapper show-docstatus hide">\
<h4>Show</h4>\
<div><input data-docstatus="0" type="checkbox" checked="checked" /> Drafts</div>\
<div><input data-docstatus="1" type="checkbox" checked="checked" /> Submitted</div>\
<div><input data-docstatus="2" type="checkbox" /> Cancelled</div>\
</div>\
</div>\
<div style="clear: both"></div>\
</div>',{label:this.label}));},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1
else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);}
this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,columns:this.listview.fields});this.run();},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('<a class="btn btn-small btn-delete">\
<i class="icon-remove"></i> Delete</a>',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;}
me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this
wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(r.message,function(field,stat){me.render_stat(field,stat);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('<div class="stat-wrapper"><h4>Tags</h4>\
<div class="help small"><i>No records tagged.</i><br><br> \
To add a tag, open the document and click on \
"Add Tag" on the sidebar</div></div>');}
return;}
var label=fields[this.doctype][field]?fields[this.doctype][field].label:field;if(label=='_user_tags')label='Tags';var $w=$('<div class="stat-wrapper">\
<h4>'+label+'</h4>\
<div class="stat-grid">\
</div>\
</div>');stat=stat.sort(function(a,b){return b[1]-a[1]});var sum=0;$.each(stat,function(i,v){sum=sum+v[1];})
$.each(stat,function(i,v){me.render_stat_item(i,v,sum,field).appendTo($w.find('.stat-grid'));});$w.appendTo(this.$page.find('.layout-side-section'));},render_stat_item:function(i,v,max,field){var me=this;var args={}
args.label=v[0];args.width=flt(v[1])/max*100;args.count=v[1];args.field=field;$item=$(repl('<div class="stat-item">\
<div class="stat-bar" style="width: %(width)s%"></div>\
<div class="stat-label">\
<a href="#" data-label="%(label)s" data-field="%(field)s">\
%(label)s</a> \
(%(count)s)</div>\
</div>',args));this.setup_stat_item_click($item);return $item;},setup_stat_item_click:function($item){var me=this;$item.find('a').click(function(){var fieldname=$(this).attr('data-field');var label=$(this).attr('data-label');me.set_filter(fieldname,label);return false;});},set_filter:function(fieldname,label){var filter=this.filter_list.get_filter(fieldname);if(filter){var v=filter.field.get_value();if(v.indexOf(label)!=-1){return false;}else{if(fieldname=='_user_tags'){this.filter_list.add_filter(fieldname,'like','%'+label);}else{filter.set_values(fieldname,'in',v+', '+label);}}}else{if(fieldname=='_user_tags'){this.filter_list.add_filter(fieldname,'like','%'+label);}else{this.filter_list.add_filter(fieldname,'=',label);}}
this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}},columns:[{width:'5%',content:'check'},{width:'5%',content:'avatar'},{width:'5%',content:'docstatus',css:{"text-align":"center"}},{width:'30%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'10%',content:'modified',css:{'text-align':'right','color':'#777'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});}
if(opts.content.indexOf&&opts.content.indexOf('+')!=-1){$.map(opts.content.split('+'),function(v){me.render_column(data,parent,{content:v});});return;}
if(typeof opts.content=='function'){opts.content(parent,data);}
else if(opts.content=='name'){$(parent).html(repl('<a href="#!Form/%(doctype)s/%(name)s">%(name)s</a>',data));}
else if(opts.content=='avatar'){$(parent).html(repl('<span class="avatar-small"><img src="%(avatar)s" \
title="%(fullname)s"/></span>',data));}
else if(opts.content=='check'){$(parent).html('<input class="list-delete" type="checkbox">');$(parent).find('input').data('name',data.name);}
else if(opts.content=='docstatus'){$(parent).html(repl('<span class="docstatus"><i class="%(docstatus_icon)s" \
title="%(docstatus_title)s"></i></span>',data));}
else if(opts.content=='tags'){this.add_user_tags(parent,data);}
else if(opts.content=='modified'){$(parent).append(data.when);}
else if(opts.type=='bar-graph'){args={percent:data[opts.content],fully_delivered:(data[opts.content]>99?'bar-complete':''),label:opts.label}
$(parent).html(repl('<span class="bar-outer" style="width: 30px; float: right" \
title="%(percent)s% %(label)s">\
<span class="bar-inner %(fully_delivered)s" \
style="width: %(percent)s%;"></span>\
</span>',args));}
else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('<td style="width: %(width)s"></td>',v);});var tr=$(row).html('<table><tbody><tr>'+rowhtml+'</tr></tbody></table>').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;data.when=dateutil.str_to_user(data.modified).split(' ')[0];if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('<span class="label label-info" style="cursor: pointer">'
+strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}}})
/*
* lib/js/wn/views/pageview.js
*/
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){wn.views.pageview.with_page(name,function(){if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
wn.container.change_to(name);});}}
wn.views.Page=Class.extend({init:function(name){this.name=name;this.render();},render:function(){var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style);this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');});},trigger:function(event){var me=this;try{if(pscript[event+'_'+this.name]){pscript[event+'_'+this.name](me.wrapper);}
if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}}})
/*
* lib/js/wn/views/formview.js
*/
wn.provide('wn.views.formview');wn.views.formview={show:function(dt,dn){if(wn.model.new_names[dn])
dn=wn.model.new_names[dn];wn.model.with_doctype(dt,function(){wn.model.with_doc(dt,dn,function(dn){if(!wn.views.formview[dt]){wn.views.formview[dt]=wn.container.add_page('Form - '+dt);wn.views.formview[dt].frm=new _f.Frm(dt,wn.views.formview[dt]);}
wn.container.change_to('Form - '+dt);wn.views.formview[dt].frm.refresh(dn);});})}}
/*
* lib/js/wn/views/reportview.js
*/
wn.views.reportview={show:function(dt,rep_name){wn.require('lib/js/legacy/report.compressed.js');dt=get_label_doctype(dt);if(!_r.rb_con){_r.rb_con=new _r.ReportContainer();}
_r.rb_con.set_dt(dt,function(rb){if(rep_name){var t=rb.current_loaded;rb.load_criteria(rep_name);if(onload)
onload(rb);if((rb.dt)&&(!rb.dt.has_data()||rb.current_loaded!=t))
rb.dt.run();}
if(!rb.forbidden){wn.container.change_to('Report Builder');}});}}
/*
* lib/js/wn/request.js
*/
@ -169,7 +350,8 @@ if(r.server_messages)msgprint(r.server_messages)
if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});msgprint('Unable to complete request: '+textStatus)
if(opts.error)opts.error(xhr)}})}
wn.call=function(opts){var args=opts.args||{};if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
wn.call=function(opts){var args=$.extend({},opts.args)
if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
for(key in args){if(args[key]&&typeof args[key]!='string'){args[key]=JSON.stringify(args[key]);}}
wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,freeze:opts.freeze,show_spinner:!opts.no_spinner});}
/*
@ -182,11 +364,11 @@ wn.versions.check();$(document).bind('ready',function(){var base=window.location
* lib/js/legacy/globals.js
*/
wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;
wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;
/*
* lib/js/legacy/utils/datatype.js
*/
var startup_list=[];wn.utils.full_name=function(fn,ln){return fn+(ln?' ':'')+(ln?ln:'')}
wn.utils.full_name=function(fn,ln){return fn+(ln?' ':'')+(ln?ln:'')}
function fmt_money(v){if(v==null||v=='')return'0.00';v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v)){return'';}else{var cp=wn.control_panel;var val=2;if(cp.currency_format=='Millions')val=3;v=v.toFixed(2);var delimiter=",";amount=v+'';var a=amount.split('.',2)
var d=a[1];var i=parseInt(a[0]);if(isNaN(i)){return'';}
var minus='';if(v<0){minus='-';}
@ -301,7 +483,7 @@ span.set_working=function(){this.disabled=1;$di(this.loading_img);}
span.done_working=function(){this.disabled=0;$dh(this.loading_img);}
return span;}}
function $ln(parent,label,onclick,style){return wn.ele.link({parent:parent,label:label,onclick:onclick,style:style})}
function $btn(parent,label,onclick,style,css_class,is_ajax){wn.require('lib/js/wn/ui/button.js');if(css_class==='green')css_class='btn-info';return new wn.ui.Button({parent:parent,label:label,onclick:onclick,style:style,is_ajax:is_ajax,css_class:css_class}).btn;}
function $btn(parent,label,onclick,style,css_class,is_ajax){if(css_class==='green')css_class='btn-info';return new wn.ui.Button({parent:parent,label:label,onclick:onclick,style:style,is_ajax:is_ajax,css_class:css_class}).btn;}
$item_normal=function(ele){$y(ele,{padding:'6px 8px',cursor:'pointer',marginRight:'8px',whiteSpace:'nowrap',overflow:'hidden',borderBottom:'1px solid #DDD'});$bg(ele,'#FFF');$fg(ele,'#000');}
$item_active=function(ele){$bg(ele,'#FE8');$fg(ele,'#000');}
$item_selected=function(ele){$bg(ele,'#777');$fg(ele,'#FFF');}
@ -351,8 +533,7 @@ var cmin=c;var cmax=c;if(c=='*'){cmin=0;cmax=tab.rows[0].cells.length-1;}
if(c.search&&c.search('-')!=-1){c=c.split('-');rmin=cint(c[0]);rmax=cint(c[1]);}
for(var ri=rmin;ri<=rmax;ri++){for(var ci=cmin;ci<=cmax;ci++)
$y($td(tab,ri,ci),s);}}
function set_style(txt){var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
document.getElementsByTagName('head')[0].appendChild(se);}
function set_style(txt){wn.dom.set_style(txt);}
function make_table(parent,nr,nc,table_width,widths,cell_style,table_style){var t=$a(parent,'table');t.style.borderCollapse='collapse';if(table_width)t.style.width=table_width;if(cell_style)t.cell_style=cell_style;for(var ri=0;ri<nr;ri++){var r=t.insertRow(ri);for(var ci=0;ci<nc;ci++){var c=r.insertCell(ci);if(ri==0&&widths&&widths[ci]){c.style.width=widths[ci];}
if(cell_style){for(var s in cell_style)c.style[s]=cell_style[s];}}}
t.append_row=function(){return append_row(this);}
@ -427,7 +608,7 @@ var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable','
Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent)
this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else
this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
if(this.with_label){this.label_span=$a(this.label_area,'span','field_label')
if(this.with_label){this.label_span=$a(this.label_area,'span','small')
this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'})
$dh(this.label_area);}
if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));}
@ -436,9 +617,9 @@ if(this.onmake)this.onmake();}
Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML']
if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}}
Field.prototype.set_label=function(){if(this.with_label&&this.label_area&&this.label!=this.df.label){this.label_span.innerHTML=this.df.label;this.label=this.df.label;}}
Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help','',this.df.description)
Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help small','',this.df.description)
if(in_list(['Text Editor','Code'],this.df.fieldtype))
$(this.desc_area).addClass('field_description_top');}}
$(this.desc_area).addClass('help small');}}
Field.prototype.get_status=function(){if(this.in_filter)this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';}
if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary')
ret='None';if(cint(this.df.hidden))
@ -466,8 +647,7 @@ this.set_input(_f.get_value(this.doctype,this.docname,this.df.fieldname));this.r
Field.prototype.refresh_label_icon=function(){if(this.df.reqd){if(this.get_value&&is_null(this.get_value())){if(this.label_icon)$ds(this.label_icon);$(this.txt?this.txt:this.input).addClass('field-to-update')}else{if(this.label_icon)$dh(this.label_icon);$(this.txt?this.txt:this.input).removeClass('field-to-update')}}}
Field.prototype.set=function(val){if(this.not_in_form)
return;if((!this.docname)&&this.grid){this.docname=this.grid.add_newrow();}
if(in_list(['Data','Text','Small Text','Code'],this.df.fieldtype))
val=clean_smart_quotes(val);var set_val=val;if(this.validate)set_val=this.validate(val);_f.set_value(this.doctype,this.docname,this.df.fieldname,set_val);this.value=val;}
var set_val=val;if(this.validate)set_val=this.validate(val);_f.set_value(this.doctype,this.docname,this.df.fieldname,set_val);this.value=val;}
Field.prototype.set_input=function(val){this.value=val;if(this.input&&this.input.set_input){if(val==null)this.input.set_input('');else this.input.set_input(val);}
var disp_val=val;if(val==null)disp_val='';this.set_disp(disp_val);}
Field.prototype.run_trigger=function(){this.refresh_label_icon();if(this.df.reqd&&this.get_value&&!is_null(this.get_value())&&this.set_as_error)
@ -532,7 +712,8 @@ if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val)
me.set(val);if(_f.cur_grid_cell)
_f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
var fetch='';if(cur_frm.fetch_dict[me.df.fieldname])
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(selector&&selector.display)return;if(r.message=='Ok'){if(r.fetch_values)
fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(selector&&selector.display)return;if(r.message=='Ok'){if($(me.txt).val()!=val){me.set_input(val);}
if(r.fetch_values)
me.set_fetch_values(r.fetch_values);me.run_trigger();}else{var astr='';if(in_list(profile.can_create,me.df.options))astr=repl('<br><br><span class="link_type" onclick="newdoc(\'%(dt)s\')">Click here</span> to create a new %(dtl)s',{dt:me.df.options,dtl:get_doctype_label(me.df.options)})
msgprint(repl('error:<b>%(val)s</b> is not a valid %(dt)s.<br><br>You must first create a new %(dt)s <b>%(val)s</b> and then select its value. To find an existing %(dt)s, click on the magnifying glass next to the field.%(add)s',{val:me.txt.value,dt:get_doctype_label(me.df.options),add:astr}));me.txt.value='';me.set('');}});}
LinkField.prototype.set_fetch_values=function(fetch_values){var fl=cur_frm.fetch_dict[this.df.fieldname].fields;var changed_fields=[];for(var i=0;i<fl.length;i++){if(locals[this.doctype][this.docname][fl[i]]!=fetch_values[i]){locals[this.doctype][this.docname][fl[i]]=fetch_values[i];if(!this.grid){refresh_field(fl[i]);changed_fields.push(fl[i]);}}}
@ -565,7 +746,7 @@ this.get_value=function(){return this.input.value;}}
var text_dialog;function make_text_dialog(){var d=new Dialog(520,410,'Edit Text');d.make_body([['Text','Enter Text'],['HTML','Description'],['Button','Update']]);d.widgets['Update'].onclick=function(){var t=this.dialog;t.field.set(t.widgets['Enter Text'].value);t.hide();}
d.onshow=function(){this.widgets['Enter Text'].style.height='300px';var v=_f.get_value(this.field.doctype,this.field.docname,this.field.df.fieldname);this.widgets['Enter Text'].value=v==null?'':v;this.widgets['Enter Text'].focus();this.widgets['Description'].innerHTML=''
if(this.field.df.description)
$a(this.widgets['Description'],'div','field_description','',this.field.df.description);}
$a(this.widgets['Description'],'div','help small','',this.field.df.description);}
d.onhide=function(){if(_f.cur_grid_cell)
_f.cur_grid_cell.grid.cell_deselect();}
text_dialog=d;}
@ -656,6 +837,15 @@ this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);t
this.no_cancel=function(){$dh(this.cancel_img);}
if(opts)this.make();}
wn.widgets.Dialog.prototype=new wn.widgets.FieldGroup();$(document).bind('keydown',function(e){if(cur_dialog&&!cur_dialog.no_cancel_flag&&e.which==27){cur_dialog.hide();}});
/*
* lib/js/wn/ui/button.js
*/
wn.ui.Button=function(args){var me=this;$.extend(this,{make:function(){me.btn=wn.dom.add(args.parent,'button','btn btn-small '+(args.css_class||''));me.btn.args=args;me.loading_img=wn.dom.add(me.btn.args.parent,'img','',{margin:'0px 4px -2px 4px',display:'none'});me.loading_img.src='lib/images/ui/button-load.gif';if(args.is_ajax)wn.dom.css(me.btn,{marginRight:'24px'});me.btn.innerHTML=args.label;me.btn.user_onclick=args.onclick;$(me.btn).bind('click',function(){if(!this.disabled&&this.user_onclick)
this.user_onclick(this);})
me.btn.set_working=me.set_working;me.btn.done_working=me.done_working;if(me.btn.args.style)
wn.dom.css(me.btn,args.style);},set_working:function(){me.btn.disabled='disabled';if(me.btn.args.is_ajax){$(me.btn).css('margin-right','0px');}
$(me.loading_img).css('display','inline');},done_working:function(){me.btn.disabled=false;if(me.btn.args.is_ajax){$(me.btn).css('margin-right','24px');}
$(me.loading_img).toggle(false);}});this.make();}
/*
* lib/js/legacy/widgets/dialog.js
*/
@ -685,7 +875,18 @@ if(!this.opts.no_result_message){this.opts.no_result_message='Nothing to show'}}
this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
<div class="wnlist">\
<h3 class="title hide">%(title)s</h3>\
<div style="height: 37px;" class="list-toolbar-wrapper">\
\
<div class="list-filters hide">\
<div class="show_filters well">\
<div>\
<button class="btn btn-small add-filter-btn">\
<i class="icon-plus"></i> Add Filter</button>\
</div>\
<div class="filter_area"></div>\
</div>\
</div>\
\
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
<div class="list-toolbar">\
<a class="btn btn-small btn-refresh btn-info">\
<i class="icon-refresh icon-white"></i> Refresh</a>\
@ -698,16 +899,6 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
class="img-load" style="float: left;"/>\
</div><div style="clear:both"></div>\
\
<div class="list-filters hide">\
<div class="show_filters well">\
<div class="filter_area"></div>\
<div>\
<button class="btn btn-small add-filter-btn">\
<i class="icon-plus"></i> Add Filter</button>\
</div>\
</div>\
</div>\
\
<div class="no-result help hide">\
%(no_result_message)s\
</div>\
@ -722,7 +913,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
</div>\
</div>\
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype,me.new_doc_onload,true,me.new_doc_onsave);})}else{this.$w.find('.btn-new').remove();}
if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();}
if(!me.show_filters){this.$w.find('.btn-filter').remove();}
if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();}
this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){this.$w.find('.list-toolbar').addClass('btn-group')}
@ -737,11 +928,12 @@ if(this.get_args){$.extend(args,this.get_args());}
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
this.start+=m;if(values.length>=this.page_length)
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
values.push(f.get_value());})
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
this.filters=fl;}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.fields_by_name={};this.make();this.make_options();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('<div class="list_filter">\
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
return this.filters[i];}}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.fields_by_name={};this.make();this.make_options();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('<div class="list_filter">\
<select class="fieldname_select"></select>\
<select class="condition">\
<option value="=">Equals</option>\
@ -758,11 +950,14 @@ this.filters=fl;}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this
</div>');this.$w=this.flist.$w.find('.list_filter:last-child');this.$select=this.$w.find('.fieldname_select');},make_options:function(){if(this.filter_fields){for(var i in this.filter_fields)
this.add_field_option(this.filter_fields[i])}else{this.render_field_select();}},set_events:function(){var me=this;this.$w.find('.fieldname_select').bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);}
if(value){me.flist.listobj.run();}
me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if(!me.field.desc_area){me.field.desc_area=$a(me.field.wrapper,'span','help');}
me.field.desc_area.innerHTML='';if($(this).val()=='in'){me.field.desc_area.innerHTML='Multiple values, separated by a comma'}});if(me.fieldname){me.set_field(me.fieldname);if(me.condition)me.$w.find('.condition').val(me.condition).change();if(me.value)me.field.set_input(me.value)}else{me.set_field('name');}},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;}
if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('<option>',{value:df.fieldname,table:table}).text(label));me.fields_by_name[df.fieldname]=df;}},set_field:function(fieldname){var me=this;me.$w.find('.fieldname_select').val(fieldname);wn.require('lib/js/legacy/widgets/form/fields.js');var field_area=me.$w.find('.filter_field').empty().get(0);var df=me.fields_by_name[fieldname];df.original_type=df.fieldtype;df.description='';df.reqd=0;if(df.fieldtype=='Check'){df.fieldtype='Select';df.options='No\nYes';}else if(['Text','Text Editor','Code','Link'].indexOf(df.fieldtype)!=-1){df.fieldtype='Data';}
f=make_field(me.fields_by_name[fieldname],null,field_area,null,0,1);f.df.single_select=1;f.not_in_form=1;f.with_label=0;f.refresh();me.field=f;if(df.fieldtype=='Data'){me.$w.find('.condition').val('like');}else{me.$w.find('.condition').val('=');}
$(me.field.wrapper).find(':input').keydown(function(ev){if(ev.which==13){me.flist.listobj.run();}})},get_value:function(){var me=this;var val=me.field.get_value();var cond=me.$w.find('.condition').val();if(me.field.df.original_type=='Check'){val=(val=='Yes'?1:0);}
me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if($(this).val()=='in'){me.set_field(me.field.df.fieldname,'Data');if(!me.field.desc_area)
me.field.desc_area=$a(me.field.wrapper,'span','help',null,'values separated by comma');}else{me.set_field(me.field.df.fieldname);}});if(me.fieldname){this.set_values(me.fieldname,me.condition,me.value);}else{me.set_field('name');}},set_values:function(fieldname,condition,value){this.set_field(fieldname);if(condition)this.$w.find('.condition').val(condition).change();if(value)this.field.set_input(value)},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;}
if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('<option>',{value:df.fieldname,table:table}).text(label));me.fields_by_name[df.fieldname]=df;}},set_field:function(fieldname,fieldtype){var me=this;var cur=me.field?{fieldname:me.field.df.fieldname,fieldtype:me.field.df.fieldtype}:{}
var df=me.fields_by_name[fieldname];this.set_fieldtype(df,fieldtype);if(me.field&&cur.fieldname==fieldname&&df.fieldtype==cur.fieldtype){return;}
me.$w.find('.fieldname_select').val(fieldname);var field_area=me.$w.find('.filter_field').empty().get(0);f=make_field(df,null,field_area,null,0,1);f.df.single_select=1;f.not_in_form=1;f.with_label=0;f.refresh();me.field=f;this.set_default_condition(df,fieldtype);$(me.field.wrapper).find(':input').keydown(function(ev){if(ev.which==13){me.flist.listobj.run();}})},set_fieldtype:function(df,fieldtype){if(df.original_type)
df.fieldtype=df.original_type;else
df.original_type=df.fieldtype;df.description='';df.reqd=0;if(fieldtype){df.fieldtype=fieldtype;return;}
if(df.fieldtype=='Check'){df.fieldtype='Select';df.options='No\nYes';}else if(['Text','Text Editor','Code','Link'].indexOf(df.fieldtype)!=-1){df.fieldtype='Data';}},set_default_condition:function(df,fieldtype){if(!fieldtype){if(df.fieldtype=='Data'){this.$w.find('.condition').val('like');}else{this.$w.find('.condition').val('=');}}},get_value:function(){var me=this;var val=me.field.get_value();var cond=me.$w.find('.condition').val();if(me.field.df.original_type=='Check'){val=(val=='Yes'?1:0);}
if(cond=='like'){val=val+'%';}
return[me.$w.find('.fieldname_select option:selected').attr('table'),me.field.df.fieldname,me.$w.find('.condition').val(),val];}});
/*
@ -794,39 +989,13 @@ LayoutCell.prototype.hide=function(){$dh(this.wrapper);}
/*
* lib/js/legacy/webpage/page_header.js
*/
var def_ph_style={wrapper:{marginBottom:'16px',backgroundColor:'#EEE'},main_heading:{},sub_heading:{marginBottom:'8px',color:'#555',display:'none'},separator:{borderTop:'3px solid #777'},toolbar_area:{padding:'3px 0px',display:'none',borderBottom:'1px solid #AAA'}}
var def_ph_style={wrapper:{marginBottom:'16px',backgroundColor:'#EEE'},main_heading:{},sub_heading:{marginBottom:'8px',color:'#555',display:'none'},separator:{borderTop:'1px solid #ddd'},toolbar_area:{padding:'3px 0px',display:'none',borderBottom:'1px solid #ddd'}}
function PageHeader(parent,main_text,sub_text){this.wrapper=$a(parent,'div','page_header');this.t1=make_table($a(this.wrapper,'div','',def_ph_style.wrapper.backgroundColor),1,2,'100%',[null,'100px'],{padding:'2px'});$y(this.t1,{borderCollapse:'collapse'})
this.lhs=$td(this.t1,0,0);this.main_head=$a(this.lhs,'h1','',def_ph_style.main_heading);this.sub_head=$a(this.lhs,'h4','',def_ph_style.sub_heading);this.separator=$a(this.wrapper,'div','',def_ph_style.separator);this.toolbar_area=$a(this.wrapper,'div','',def_ph_style.toolbar_area);this.padding_area=$a(this.wrapper,'div','',{padding:'3px'});$y($td(this.t1,0,1),{textAlign:'right',padding:'3px'});this.close_btn=$a($td(this.t1,0,1),'span','close',{},'&times;');this.close_btn.onclick=function(){nav_obj.show_last_open();};if(main_text)this.main_head.innerHTML=main_text;if(sub_text)this.sub_head.innerHTML=sub_text;this.buttons={};this.buttons2={};}
this.lhs=$td(this.t1,0,0);this.main_head=$a(this.lhs,'h1','',def_ph_style.main_heading);this.sub_head=$a(this.lhs,'h4','',def_ph_style.sub_heading);this.separator=$a(this.wrapper,'div','',def_ph_style.separator);this.toolbar_area=$a(this.wrapper,'div','',def_ph_style.toolbar_area);this.padding_area=$a(this.wrapper,'div','',{padding:'3px'});$y($td(this.t1,0,1),{textAlign:'right',padding:'3px'});this.close_btn=$a($td(this.t1,0,1),'span','close',{},'&times;');this.close_btn.onclick=function(){window.back();};if(main_text)this.main_head.innerHTML=main_text;if(sub_text)this.sub_head.innerHTML=sub_text;this.buttons={};this.buttons2={};}
PageHeader.prototype.add_button=function(label,fn,bold,icon,green){var tb=this.toolbar_area;if(this.buttons[label])return;iconhtml=icon?('<i class="'+icon+'"></i> '):'';var $button=$('<button class="btn btn-small">'+iconhtml+label+'</button>').click(fn).appendTo(tb);if(green){$button.addClass('btn-info');$button.find('i').addClass('icon-white');}
if(bold)$button.css('font-weight','bold');this.buttons[label]=$button.get(0);$ds(this.toolbar_area);return this.buttons[label];}
PageHeader.prototype.clear_toolbar=function(){this.toolbar_area.innerHTML='';this.buttons={};}
PageHeader.prototype.make_buttonset=function(){$(this.toolbar_area).buttonset();}
/*
* lib/js/legacy/webpage/history.js
*/
var nav_obj={}
nav_obj.observers=[];nav_obj.add_observer=function(o){nav_obj.observers.push(o);}
nav_obj.ol=[];nav_obj.open_notify=function(t,dt,dn,no_history){if(nav_obj.ol.length){var tmp=nav_obj.ol[nav_obj.ol.length-1];if(tmp&&tmp[0]==t&&tmp[1]==dt&&tmp[2]==dn)return;}
if(!no_history){var tmp=[];for(var i in nav_obj.ol)
if(!(nav_obj.ol[i][0]==t&&nav_obj.ol[i][1]==dt&&nav_obj.ol[i][2]==dn))tmp.push(nav_obj.ol[i]);nav_obj.ol=tmp;nav_obj.ol.push([t,dt,dn])
en_t=encodeURIComponent(t);en_dt=encodeURIComponent(dt);en_dn=dn?encodeURIComponent(dn):'';if(en_t=='Page'){var id=en_dt+(dn?('/'+en_dn):'')}else{var id=en_t+'/'+en_dt+(dn?('/'+en_dn):'')}
if(nav_obj.on_open)
nav_obj.on_open(id);if(window.location.hash!='!'+id){window.location.hash='!'+id;}}
nav_obj.notify_observers(t,dt,dn);if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}
nav_obj.notify_observers=function(t,dt,dn){for(var i=0;i<nav_obj.observers.length;i++){var o=nav_obj.observers[i];if(o&&o.notify)o.notify(t,dt,dn);}}
nav_obj.rename_notify=function(dt,oldn,newn){for(var i=0;i<nav_obj.ol.length;i++){var o=nav_obj.ol[i];if(o[1]==dt&&o[2]==oldn)o[2]=newn;}}
nav_obj.show_last_open=function(){var l=nav_obj.ol[nav_obj.ol.length-2];delete nav_obj.ol[nav_obj.ol.length-1];if(!l)loadpage('_home');else if(l[0]=='Page'){loadpage(l[1]);}else if(l[0]=='Report'){loadreport(l[1],l[2]);}else if(l[0]=='Form'){loaddoc(l[1],l[2]);}else if(l[0]=='DocBrowser'||l[0]=='List'){loaddocbrowser(l[1]);}}
var _history_current;function history_get_name(t){var parts=[];if(t.length>=3){for(var i=2;i<t.length;i++){parts.push(t[i]);}}
return parts.join('/')}
nav_obj.get_page=function(loc){if(!loc)loc=window.location.hash;if(loc.substr(0,1)=='#'){loc=loc.substr(1);}
if(loc.substr(0,1)=='!'){loc=loc.substr(1);}
if(!in_list(['Page/','Form/','Repor','DocBr','List/','List2'],loc.substr(0,5))){loc='Page/'+loc;}
return loc.split('/');}
function historyChange(newLocation){var t=nav_obj.get_page(newLocation)
for(var i=0;i<t.length;i++)
t[i]=decodeURIComponent(t[i]);if(nav_obj.ol.length){var c=nav_obj.ol[nav_obj.ol.length-1];if(t.length==2){if(c[0]==t[0]&&c[1]==t[1])return;}else{if(c[0]==t[0]&&c[1]==t[1]&&c[2]==t[2])return;}}
if(t[2])
var docname=history_get_name(t);if(t[0]=='Form'){_history_current=newLocation;if(docname.substr(0,3)=='New'&&!(locals[t[1]]&&locals[t[1]][docname])){newdoc(t[1]);}else{loaddoc(t[1],docname);}}else if(t[0]=='Report'){_history_current=newLocation;loadreport(t[1],docname);}else if(t[0]=='Page'){_history_current=newLocation;loadpage(t[1]);}else if(t[0]=='Application'){_history_current=newLocation;loadapp(t[1]);}else if(t[0]=='DocBrowser'||t[0]=='List'){_history_current=newLocation;loaddocbrowser(t[1]);}else if(t[0]=='List2'){_history_current=newLocation;loaddocbrowser2(t[1]);}};$(window).bind('hashchange',function(){historyChange(location.hash);});
/*
* lib/js/legacy/webpage/search.js
*/
@ -872,52 +1041,24 @@ function unfreeze(){if(!fcount)return;fcount--;if(!fcount){$dh(dialog_back);}}
*/
var err_console;var err_list=[];function errprint(t){if(!err_list)err_list=[];err_list.push('<pre style="font-family: Courier, Fixed; font-size: 11px; \
border-bottom: 1px solid #AAA; overflow: auto; width: 90%;">'+t+'</pre>');}
function setup_err_console(){err_console=new Dialog(640,480,'Error Console')
$(document).bind('startup',function(){err_console=new Dialog(640,480,'Error Console')
err_console.make_body([['HTML','Error List'],['Button','Clear'],['HTML','Error Report']]);var span=$a(err_console.widgets['Error Report'],'span','link_type');span.innerHTML='Send Error Report';span.onclick=function(){msg=prompt('How / where did you get the error [optional]')
var call_back=function(r,rt){err_console.hide();msgprint("Error Report Sent")}
$c('webnotes.utils.send_error_report',{'err_msg':err_console.rows['Error List'].innerHTML,'msg':msg},call_back);}
err_console.widgets['Clear'].onclick=function(){err_list=[];err_console.rows['Error List'].innerHTML='';err_console.hide();}
err_console.onshow=function(){err_console.rows['Error List'].innerHTML='<div style="padding: 16px; height: 360px; width: 90%; overflow: auto;">'
+err_list.join('<div style="height: 10px; margin-bottom: 10px; border-bottom: 1px solid #AAA"></div>')+'</div>';}}
startup_list.push(setup_err_console);
+err_list.join('<div style="height: 10px; margin-bottom: 10px; border-bottom: 1px solid #AAA"></div>')+'</div>';}});
/*
* lib/js/legacy/webpage/loaders.js
*/
function loadreport(dt,rep_name,onload,menuitem,reset_report){wn.require('lib/js/legacy/report.compressed.js');dt=get_label_doctype(dt);var show_report_builder=function(){if(!_r.rb_con){_r.rb_con=new _r.ReportContainer();}
_r.rb_con.set_dt(dt,function(rb){if(rep_name){var t=rb.current_loaded;rb.load_criteria(rep_name);if(onload)
onload(rb);if((rb.dt)&&(!rb.dt.has_data()||rb.current_loaded!=t))
rb.dt.run();}else{if(reset_report){rb.reset_report();}}
if(!rb.forbidden){page_body.change_to('Report Builder');nav_obj.open_notify('Report',dt,rep_name);}});}
show_report_builder();}
var load_doc=loaddoc;function loaddoc(doctype,name,onload,menuitem,from_archive){doctype=get_label_doctype(doctype);if(frms['DocType']&&frms['DocType'].opendocs[doctype]){msgprint("Cannot open an instance of \""+doctype+"\" when the DocType is open.");return;}
if(doctype=='DocType'&&frms[name]){msgprint("Cannot open DocType \""+name+"\" when its instance is open.");return;}
var show_form=function(f){if(!_f.frm_con){_f.frm_con=new _f.FrmContainer();}
if(!frms[doctype]){_f.add_frm(doctype,show_doc,name,from_archive);}else if(LocalDB.is_doc_loaded(doctype,name)){show_doc();}else{$c('webnotes.widgets.form.load.getdoc',{'name':name,'doctype':doctype,'user':user,'from_archive':(from_archive?1:0)},show_doc,null,null);}}
var show_doc=function(r,rt){if(locals[doctype]&&locals[doctype][name]){var frm=frms[doctype];frm.refresh(name);if(!frm.in_dialog)
nav_obj.open_notify('Form',doctype,name);if(onload)onload();}else{if(r.exc){msgprint('There were errors while loading '+doctype+' '+name);}
loadpage('_home');}}
show_form();}
function new_doc(doctype,onload,in_dialog,on_save_callback,cdt,cdn,cnic){doctype=get_label_doctype(doctype);if(!doctype){if(cur_frm)doctype=cur_frm.doctype;else return;}
var show_doc=function(){frm=frms[doctype];if(frm.perm[0][CREATE]==1){if(frm.meta.issingle){var dn=doctype;LocalDB.set_default_values(locals[doctype][doctype]);}else
var dn=LocalDB.create(doctype);if(onload)onload(dn);if(frm.in_dialog){var fd=_f.frm_dialog;fd.cdt=cdt;fd.cdn=cdn;fd.cnic=cnic;fd.on_save_callback=on_save_callback;}else{nav_obj.open_notify('Form',doctype,dn);}
frm.refresh(dn);}else{msgprint('error:Not Allowed To Create '+doctype+'\nContact your Admin for help');}}
var show_form=function(){if(!_f.frm_con){_f.frm_con=new _f.FrmContainer();}
if(!frms[doctype])
_f.add_frm(doctype,show_doc);else
show_doc(frms[doctype]);}
show_form();}
var newdoc=new_doc;var pscript={};var cur_page;function loadpage(page_name,call_back,no_history){if(!page_name)return;if(page_name=='_home')
page_name=home_page;var fn=function(r,rt){if(wn.pages[page_name]){var p=wn.pages[page_name]
page_body.change_to(page_name);}else{var p=render_page(page_name);if(!p)return;}
cur_page=page_name;if(call_back)call_back();scroll(0,0);pscript.update_page_history(page_name,no_history)
try{if(pscript['refresh_'+page_name])pscript['refresh_'+page_name]();}catch(e){console.log(e);}}
if(get_local('Page',page_name)||wn.pages[page_name])
fn();else{args=get_url_dict();args.name=page_name;$c('webnotes.widgets.page.getpage',args,fn);}}
pscript.update_page_history=function(page_name,no_history){var arg=null;var t=null;if(window.location.hash){var t=nav_obj.get_page(window.location.hash)}else if(get_url_arg('page')){var t=nav_obj.get_page(get_url_arg('page'))}
if(t&&t[1]==page_name)arg=t[2];nav_obj.open_notify('Page',page_name,arg,no_history);}
var doc_browser_page;function loaddocbrowser(dt,label,fields){wn.require('lib/js/legacy/webpage/docbrowser.js');dt=get_label_doctype(dt);if(!doc_browser_page)
doc_browser_page=new ItemBrowserPage();doc_browser_page.show(dt,label,fields);nav_obj.open_notify('List',dt,'');}
function loaddocbrowser2(dt,label,fields){wn.pages.doclistview.show(dt);return;}
function loadreport(dt,rep_name,onload){if(rep_name)
wn.set_route('Report',dt,rep_name);else
wn.set_route('Report',dt);}
function loaddoc(doctype,name,onload){doctype=get_label_doctype(doctype);wn.model.with_doctype(doctype,function(){if(locals.DocType[doctype].in_dialog){console.log(1)
_f.edit_record(doctype,name);}else{wn.set_route('Form',doctype,name);}})}
var load_doc=loaddoc;function new_doc(doctype,onload,in_dialog,on_save_callback,cdt,cdn,cnic){doctype=get_label_doctype(doctype);wn.model.with_doctype(doctype,function(){if(locals.DocType[doctype].in_dialog){_f.edit_record(doctype,'New '+doctype);}else{wn.set_route('Form',doctype,'New '+doctype);}})}
var newdoc=new_doc;var pscript={};function loadpage(page_name,call_back,no_history){wn.set_route(page_name);}
function loaddocbrowser(dt){wn.set_route('List',dt);}
/*
* lib/js/legacy/webpage/uploader.js
*/
@ -933,13 +1074,13 @@ function Page(page_name,content){var me=this;this.name=page_name;this.trigger=fu
pscript[event+'_'+this.name](me.wrapper);if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}}
this.page_show=function(){set_title(me.doc.title?me.doc.title:me.name);if(!me.onload_complete){me.trigger('onload');me.onload_complete=true;}
me.trigger('onshow');cur_frm=null;}
this.wrapper=page_body.add_page(page_name,this.page_show);this.cont=this.wrapper
this.wrapper=wn.container.add_page(page_name,this.page_show);this.cont=this.wrapper
if(content)
this.wrapper.innerHTML=content;return this;}
function render_page(page_name,menuitem){if(!page_name)return;if((!locals['Page'])||(!locals['Page'][page_name])){loadpage('_home');return;}
var pdoc=locals['Page'][page_name];if(pdoc.style)set_style(pdoc.style)
var p=new Page(page_name,pdoc._Page__content?pdoc._Page__content:pdoc.content);var script=pdoc.__script?pdoc.__script:pdoc.script;p.doc=pdoc;if(script){eval(script);}
page_body.change_to(page_name);return p;}
wn.container.change_to(page_name);return p;}
function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)}
$c('webnotes.widgets.page.getpage',{'name':page_name},fn);}
/*
@ -967,14 +1108,11 @@ LocalDB.sync=function(list){if(list._kl)list=expand_doclist(list);for(var i=0;i<
d.name=LocalDB.get_localname(d.doctype);LocalDB.add(d.doctype,d.name);locals[d.doctype][d.name]=d;if(d.doctype=='DocType'){fields_list[d.name]=[];}else if(d.doctype=='DocField'){if(!d.parent){alert('Error: No parent specified for field "'+d.label+'"');}
if(!fields_list[d.parent])fields_list[d.parent]=[];fields_list[d.parent][fields_list[d.parent].length]=d;if(!fields[d.parent])
fields[d.parent]={};if(d.fieldname){fields[d.parent][d.fieldname]=d;}else if(d.label){fields[d.parent][d.label]=d;}}
if(d.localname)
notify_rename_observers(d.doctype,d.localname,d.name);}}
if(d.localname){wn.model.new_names[d.localname]=d.name;$(document).trigger('rename',[d.doctype,d.localname,d.name]);delete locals[d.doctype][d.localname];}}}
local_name_idx={};LocalDB.get_localname=function(doctype){if(!local_name_idx[doctype])local_name_idx[doctype]=1;var n='New '+get_doctype_label(doctype)+' '+local_name_idx[doctype];local_name_idx[doctype]++;return n;}
LocalDB.set_default_values=function(doc){var doctype=doc.doctype;var docfields=fields_list[doctype];if(!docfields){return;}
var fields_to_refresh=[];for(var fid=0;fid<docfields.length;fid++){var f=docfields[fid];if(!in_list(no_value_fields,f.fieldtype)&&doc[f.fieldname]==null){var v=LocalDB.get_default_value(f.fieldname,f.fieldtype,f['default']);if(v){doc[f.fieldname]=v;fields_to_refresh.push(f.fieldname);}}}
return fields_to_refresh;}
LocalDB.is_doc_loaded=function(dt,dn){var exists=false;if(locals[dt]&&locals[dt][dn])exists=true;if(exists&&dt=='DocType'&&!locals[dt][dn].__islocal&&!frms[dt])
exists=false;return exists;}
function check_perm_match(p,dt,dn){if(!dn)return true;var out=false;if(p.match){if(user_defaults[p.match]){for(var i=0;i<user_defaults[p.match].length;i++){if(user_defaults[p.match][i]==locals[dt][dn][p.match]){return true;}}
return false;}else if(!locals[dt][dn][p.match]){return true;}else{return false;}}else{return true;}}
function get_perm(doctype,dn,ignore_submit){var perm=[[0,0],];if(in_list(user_roles,'Administrator'))perm[0][READ]=1;var plist=getchildren('DocPerm',doctype,'permissions','DocType');for(var pidx in plist){var p=plist[pidx];var pl=cint(p.permlevel?p.permlevel:0);if(in_list(user_roles,p.role)){if(check_perm_match(p,doctype,dn)){if(!perm[pl])perm[pl]=[];if(!perm[pl][READ]){if(cint(p.read))perm[pl][READ]=1;else perm[pl][READ]=0;}
@ -1003,9 +1141,6 @@ var df=get_field(dt,key);if(df&&((!from_amend&&cint(df.no_copy)==1)||in_list(Loc
return locals[dt][newdoc];}
function make_doclist(dt,dn,deleted){var dl=[];dl[0]=locals[dt][dn];for(var ndt in locals){if(locals[ndt]){for(var ndn in locals[ndt]){var doc=locals[ndt][ndn];if(doc&&doc.parenttype==dt&&(doc.parent==dn||(deleted&&doc.__oldparent==dn))){dl[dl.length]=doc;}}}}
return dl;}
var rename_observers=[];function notify_rename_observers(dt,old_name,new_name){try{delete locals[dt][old_name];}catch(e){alert("[rename_from_local] No Document for: "+old_name);}
for(var i=0;i<rename_observers.length;i++){if(rename_observers[i])
rename_observers[i].rename_notify(dt,old_name,new_name);}}
var Meta={};var local_dt={};Meta.make_local_dt=function(dt,dn){var dl=make_doclist('DocType',dt);if(!local_dt[dt])local_dt[dt]={};if(!local_dt[dt][dn])local_dt[dt][dn]={};for(var i=0;i<dl.length;i++){var d=dl[i];if(d.doctype=='DocField'){var key=d.fieldname?d.fieldname:d.label;local_dt[dt][dn][key]=copy_dict(d);}}}
Meta.get_field=function(dt,fn,dn){if(dn&&local_dt[dt]&&local_dt[dt][dn]){return local_dt[dt][dn][fn];}else{if(fields[dt])var d=fields[dt][fn];if(d)return d;}
return{};}
@ -1033,7 +1168,6 @@ function zip(k,v){var obj={};for(var i=0;i<k.length;i++){obj[k[i]]=v[i];}
return obj;}
function save_doclist(dt,dn,save_action,onsave,onerr){var doc=locals[dt][dn];var doctype=locals['DocType'][dt];var tmplist=[];var doclist=make_doclist(dt,dn,1);var all_clear=true;if(save_action!='Cancel'){for(var n in doclist){var tmp=check_required(doclist[n].doctype,doclist[n].name,doclist[0].doctype);if(doclist[n].docstatus+''!='2'&&all_clear)
all_clear=tmp;}}
var f=frms[dt];if(f&&!all_clear){if(f)f.savingflag=false;return'Error';}
var _save=function(){$c('webnotes.widgets.form.save.savedocs',{'docs':compress_doclist(doclist),'docname':dn,'action':save_action,'user':user},function(r,rtxt){if(f){f.savingflag=false;}
if(r.saved){if(onsave)onsave(r);}else{if(onerr)onerr(r);}},function(){if(f){f.savingflag=false;}},0,(f?'Saving...':''));}
if(doc.__islocal&&(doctype&&doctype.autoname&&doctype.autoname.toLowerCase()=='prompt')){var newname=prompt('Enter the name of the new '+dt,'');if(newname){doc.__newname=strip(newname);_save();}else{msgprint('Not Saved');onerr();}}else{_save();}}
@ -1041,35 +1175,19 @@ function check_required(dt,dn,parent_dt){var doc=locals[dt][dn];if(doc.docstatus
if(all_clear)all_clear=false;}}
if(errfld.length)msgprint('<b>Mandatory fields required in '+
(doc.parenttype?(fields[doc.parenttype][doc.parentfield].label+' (Table)'):get_doctype_label(doc.doctype))+':</b>\n'+errfld.join('\n'));return all_clear;}
/*
* lib/js/legacy/webpage/body.js
*/
wn.provide('wn.pages');function Body(){this.left_sidebar=null;this.right_sidebar=null;this.status_area=null;var me=this;page_body=this;this.ready=function(){$dh('startup_div');$ds('body_div');}
this.setup_page_areas=function(){this.center=this.body;this.center.header=$a(this.center,'div');this.center.body=$a(this.center,'div');this.center.loading=$a(this.center,'div','',{margin:'200px 0px',fontSize:'14px',color:'#999',textAlign:'center'});this.center.loading.innerHTML='Loading...'}
this.run_startup_code=function(){$(document).trigger('startup');try{if(this.cp.custom_startup_code)
eval(this.cp.custom_startup_code);}catch(e){errprint(e);}}
this.setup=function(){this.cp=wn.control_panel;this.wrapper=$a($i('body_div'),'div');this.body=$a(this.wrapper,'div');this.setup_page_areas();if(user=='Guest')user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){this.wntoolbar=new wn.ui.toolbar.Toolbar();}
if(this.cp.page_width)
$y(this.wrapper,{width:cint(this.cp.page_width)+'px'});}
this.cur_page=null;this.add_page=function(label,onshow,onhide){var c=$a(this.center.body,'div');if(onshow)
c.page_show=onshow;if(onhide)
c.page_hide=onhide;wn.pages[label]=c;$dh(c);return c;}
this.change_to=function(label){$dh(this.center.loading);if(me.cur_page&&wn.pages[label]!=me.cur_page){if(me.cur_page.page_hide)
me.cur_page.page_hide();$dh(me.cur_page);}
me.cur_page=wn.pages[label];me.cur_page_label=label;$(me.cur_page).fadeIn();if(me.cur_page.page_show)
me.cur_page.page_show(me.cur_page);}
this.set_session_changed=function(){if(this.session_message_set)return;var div=$a($i('body_div').parentNode,'div','',{textAlign:'center',fontSize:'14px',margin:'150px auto'});$dh('body_div');div.innerHTML='This session has been changed. Please <span class="link_type" onclick="window.location.reload()">refresh</span> to continue';this.session_message_set=1;}
this.setup();}
/*
* lib/js/legacy/app.js
*/
var popup_cont;var session={};if(!wn)var wn={};function startup(){popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
wn.control_panel=r.control_panel;}
var setup_history=function(r){rename_observers.push(nav_obj);}
var callback=function(r,rt){if(r.exc)console.log(r.exc);setup_globals(r);setup_history();var a=new Body();page_body.run_startup_code();for(var i=0;i<startup_list.length;i++){startup_list[i]();}
var t=to_open();if(t){historyChange(t);}else if(home_page){loadpage(home_page);}
page_body.ready();}
var setup_viewport=function(){wn.container=new wn.views.Container();if(user=='Guest')
user_defaults.hide_webnotes_toolbar=1;if(!cint(user_defaults.hide_webnotes_toolbar)||user=='Administrator'){wn.container.wntoolbar=new wn.ui.toolbar.Toolbar();}
$(document).trigger('startup');try{if(wn.control_panel.custom_startup_code)
eval(wn.control_panel.custom_startup_code);}catch(e){errprint(e);}
var t=to_open();if(t){window.location.hash=t;}else if(home_page){loadpage(home_page);}
wn.route();$dh('startup_div');$ds('body_div');}
var callback=function(r,rt){if(r.exc)console.log(r.exc);setup_globals(r);setup_viewport();}
if(wn.boot){LocalDB.sync(wn.boot.docs);callback(wn.boot,'');if(wn.boot.error_messages)
console.log(wn.boot.error_messages)
if(wn.boot.server_messages)
@ -1109,16 +1227,15 @@ if(inList(user_roles,'System Manager'))is_system_manager=1;}
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);}
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
<a href="#!attributions">ERPNext | Attributions and License</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
$('#startup_div').toggle(false);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
else if(nm=='Accounts Browser')
pscript.make_chart(chart_type);}
loadpage(nm,call_back);}
var update_messages=function(reset){if(inList(['Guest'],user)){return;}
if(!reset){$c_page('home','event_updates','get_global_status_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message.unread_messages);var show_in_circle=function(parent_id,msg){var parent=$('#'+parent_id);if(parent){if(msg){parent.find('span:first').text(msg);parent.toggle(true);}else{parent.toggle(false);}}}
show_in_circle('unread_messages',r.message.unread_messages.length);show_in_circle('open_support_tickets',r.message.open_support_tickets);show_in_circle('things_todo',r.message.things_todo);show_in_circle('todays_events',r.message.todays_events);}else{clearInterval(wn.updates.id);}});}else{page_body.wntoolbar.set_new_comments(0);$('#unread_messages').toggle(false);}}
var update_messages=function(reset){if(inList(['Guest'],user)||!wn.session_alive){return;}
if(!reset){$c_page('home','event_updates','get_global_status_messages',null,function(r,rt){if(!r.exc){wn.container.wntoolbar.set_new_comments(r.message.unread_messages);var show_in_circle=function(parent_id,msg){var parent=$('#'+parent_id);if(parent){if(msg){parent.find('span:first').text(msg);parent.toggle(true);}else{parent.toggle(false);}}}
show_in_circle('unread_messages',r.message.unread_messages.length);show_in_circle('open_support_tickets',r.message.open_support_tickets);show_in_circle('things_todo',r.message.things_todo);show_in_circle('todays_events',r.message.todays_events);}else{clearInterval(wn.updates.id);}});}else{wn.container.wntoolbar.set_new_comments(0);$('#unread_messages').toggle(false);}}
erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);}
wn.updates.id=setInterval(update_messages,60000);}
erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat;}',{src:src}))}
@ -1150,4 +1267,4 @@ item.route=item.url||item.custom_page;$parent_li.find('.dropdown-menu').append(r
<a href="https://erpnext.com">erpnext.com</a></div>\
</div>',wn.boot.website_settings));this.make_items();},make_items:function(){var items=wn.boot.website_menus
for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='footer_items'){item.route=item.url||item.custom_page;$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
data-label="%(label)s">%(label)s</a></li>',item))}}}});$(document).bind('startup',function(){erpnext.footer=new erpnext.Footer();erpnext.navbar.navbar=new erpnext.navbar.navbar();})
data-label="%(label)s">%(label)s</a></li>',item))}}}});$(document).bind('startup',function(){})

View File

@ -1 +1 @@
1049
1291