' + html + '
') .appendTo(ul); }; // remove accessibility span (for now) diff --git a/frappe/public/js/frappe/model/create_new.js b/frappe/public/js/frappe/model/create_new.js index b2f0afc2c0..2b56ffe896 100644 --- a/frappe/public/js/frappe/model/create_new.js +++ b/frappe/public/js/frappe/model/create_new.js @@ -66,7 +66,7 @@ $.extend(frappe.model, { doc[f.fieldname] = v; updated.push(f.fieldname); } else if(f.fieldtype == "Select" && f.options - && f.options.substr(0, 5)!="link:" && f.options!="[Select]") { + && f.options!="[Select]") { doc[f.fieldname] = f.options.split("\n")[0]; } } diff --git a/frappe/public/js/lib/jquery/bootstrap_theme/jquery-ui.selected.css b/frappe/public/js/lib/jquery/bootstrap_theme/jquery-ui.selected.css index 1c84dd3704..486f9891cc 100644 --- a/frappe/public/js/lib/jquery/bootstrap_theme/jquery-ui.selected.css +++ b/frappe/public/js/lib/jquery/bootstrap_theme/jquery-ui.selected.css @@ -12,56 +12,56 @@ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { +.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; } -.ui-helper-reset { - margin: 0; - padding: 0; - border: 0; - outline: 0; - line-height: 1.3; - text-decoration: none; - font-size: 100%; - list-style: none; +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } -.ui-helper-clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; +.ui-helper-clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; } -.ui-helper-clearfix { +.ui-helper-clearfix { /*display: inline-block; */ display:block; min-height: 0; /* support: IE7 */ } /* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { - height:1%; +* html .ui-helper-clearfix { + height:1%; } /* end clearfix */ -.ui-helper-zfix { - width: 100%; - height: 100%; - top: 0; - left: 0; - position: absolute; - opacity: 0; - filter:Alpha(Opacity=0); +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); } .ui-front { z-index: 100; @@ -77,11 +77,11 @@ ----------------------------------*/ /* states and images */ -.ui-icon { - display: block; - text-indent: -99999px; - overflow: hidden; - background-repeat: no-repeat; +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; } @@ -89,12 +89,12 @@ ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; +.ui-widget-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } /* @@ -107,72 +107,72 @@ * http://api.jqueryui.com/resizable/ */ -.ui-resizable { +.ui-resizable { position: relative; } -.ui-resizable-handle { +.ui-resizable-handle { position: absolute; font-size: 0.1px; - z-index: 99999; - display: block; + z-index: 99999; + display: block; } -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { - display: none; +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { + display: none; } -.ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0; +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; } -.ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0; +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; } -.ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0; - height: 100%; +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; } -.ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0; - height: 100%; +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; } -.ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; } -.ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; } -.ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; } -.ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; top: -5px; } @@ -185,10 +185,10 @@ * * http://jqueryui.com/selectable/ */ -.ui-selectable-helper { - position: absolute; - z-index: 100; - border:1px dotted black; +.ui-selectable-helper { + position: absolute; + z-index: 100; + border:1px dotted black; } /* @@ -198,17 +198,18 @@ * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * - * + * * * To view and modify this theme, visit http://jqueryui.com/themeroller/ */ /* Component containers ----------------------------------*/ -.ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; } +/*.ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; }*/ .ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../frappe/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; } +/*.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; }*/ +/*.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../frappe/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; }*/ +.ui-widget-content { border: 1px solid #aaaaaa; background-color: #ffffff; color: #404040;} .ui-widget-content a { color: #404040; } .ui-widget-header { font-weight:bold; @@ -514,41 +515,41 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-all, -.ui-corner-top, -.ui-corner-left, -.ui-corner-tl { - -moz-border-radius-topleft: 4px; - -webkit-border-top-left-radius: 4px; - -khtml-border-top-left-radius: 4px; - border-top-left-radius: 4px; +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + -khtml-border-top-left-radius: 4px; + border-top-left-radius: 4px; } -.ui-corner-all, -.ui-corner-top, -.ui-corner-right, -.ui-corner-tr { - -moz-border-radius-topright: 4px; - -webkit-border-top-right-radius: 4px; - -khtml-border-top-right-radius: 4px; - border-top-right-radius: 4px; +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + -khtml-border-top-right-radius: 4px; + border-top-right-radius: 4px; } -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-left, -.ui-corner-bl { - -moz-border-radius-bottomleft: 4px; - -webkit-border-bottom-left-radius: 4px; - -khtml-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + -khtml-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; } -.ui-corner-all, -.ui-corner-bottom, -.ui-corner-right, -.ui-corner-br { - -moz-border-radius-bottomright: 4px; - -webkit-border-bottom-right-radius: 4px; - -khtml-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + -khtml-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; } @@ -562,11 +563,11 @@ * http://jqueryui.com/autocomplete/ */ -.ui-autocomplete { - position: absolute; +.ui-autocomplete { + position: absolute; top: 0; left: 0; - cursor: default; + cursor: default; } /* @@ -685,9 +686,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; } .ui-menu .ui-menu-item a.ui-state-focus, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: 0; +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: 0; color: #ffffff; background: #0064cd; background-color: #0064cd; @@ -695,6 +696,11 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad 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); } +.ui-menu .ui-menu-item a p { margin: 3px 0px; } +.ui-menu .ui-menu-item a .small { color: #555555; } +.ui-menu .ui-menu-item a.ui-state-focus .small, +.ui-menu .ui-menu-item a.ui-state-active .small { color: #ffffff; } + /* Fix problem with border in ui-state-active */ .ui-menu .ui-menu-item a.ui-state-active { padding: 1px .4em; @@ -884,4 +890,4 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad -moz-border-radius: 4px; -khtml-border-radius: 4px; border-radius: 4px; -} \ No newline at end of file +} diff --git a/frappe/test_runner.py b/frappe/test_runner.py index 128961600a..1e66d851ec 100644 --- a/frappe/test_runner.py +++ b/frappe/test_runner.py @@ -114,8 +114,6 @@ def make_test_records(doctype, verbose=0): frappe.connect() for options in get_dependencies(doctype): - if options.startswith("link:"): - options = options[5:] if options == "[Select]": continue diff --git a/frappe/translate.py b/frappe/translate.py index 309f144a46..f4a84f091c 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -196,7 +196,6 @@ def get_messages_from_doctype(name): messages.extend([d.label, d.description]) if d.fieldtype=='Select' and d.options \ - and not d.options.startswith("link:") \ and not d.options.startswith("attach_files:"): options = d.options.split('\n') if not "icon" in options[0]: diff --git a/frappe/utils/datautils.py b/frappe/utils/datautils.py index 0604f021d0..dfc515dfd0 100644 --- a/frappe/utils/datautils.py +++ b/frappe/utils/datautils.py @@ -105,11 +105,7 @@ def check_record(d): frappe.msgprint(_("{0} is required").format(docfield.label), raise_exception=1) if docfield.fieldtype=='Select' and val and docfield.options: - if docfield.options.startswith('link:'): - link_doctype = docfield.options.split(':')[1] - if not frappe.db.exists(link_doctype, val): - frappe.throw(_("{0} {1} must be a valid {2}").format(_(docfield.lable), val, _(link_doctype))) - elif docfield.options == "attach_files:": + if docfield.options == "attach_files:": pass elif val not in docfield.options.split('\n'): diff --git a/frappe/widgets/form/meta.py b/frappe/widgets/form/meta.py index b231fa568f..7209738e0a 100644 --- a/frappe/widgets/form/meta.py +++ b/frappe/widgets/form/meta.py @@ -29,7 +29,6 @@ class FormMeta(Meta): self.load_assets() def load_assets(self): - self.expand_selects() self.add_search_fields() if not self.istable: @@ -88,13 +87,6 @@ class FormMeta(Meta): content = frappe.get_jenv().from_string(content).render() return content - def expand_selects(self): - for df in self.get("fields", {"fieldtype": "Select"}): - if df.options and df.options.startswith("link:"): - df.link_doctype = df.options.split("\n")[0][5:] - df.options = '\n'.join([''] + [o.name for o in frappe.db.sql("""select - name from `tab%s` where docstatus<2 order by name asc""" % df.link_doctype, as_dict=1)]) - def add_search_fields(self): """add search fields found in the doctypes indicated by link fields' options""" for df in self.get("fields", {"fieldtype": "Link", "options":["!=", "[Select]"]}): diff --git a/frappe/widgets/search.py b/frappe/widgets/search.py index 4e45eab0f8..91a89baade 100644 --- a/frappe/widgets/search.py +++ b/frappe/widgets/search.py @@ -88,7 +88,7 @@ def get_std_fields_list(meta, key): def build_for_autosuggest(res): results = [] for r in res: - out = {"value": r[0], "description": ", ".join([cstr(d) for d in r[1:]])} + out = {"value": r[0], "description": ", ".join(list(set(cstr(d) for d in r[1:])))} results.append(out) return results