Revision 818

Date:
2021/05/11 00:24:14
Author:
ahitrov
Revision Log:
Pickup can use multiple classes

Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/core/comps/contenido/components/inputs/pickup.msn

     
    10 10 </td><td width="94%" class="td">
    11 11 <input type="text" name="<% $name %>_docname" id="<% $name %>_docname"
    12 12 value="<% ref $doc ? $doc->name : '' | h %>" onclick="lookfor_<% $name %>()"
    13 data-id="<% ref $doc ? $doc->id : '' %>" data-class="<% ref $doc ? $doc->class : '' %>"
    13 14 style="width:100%; color:blue; text-decoration:underline;" readonly>
    14 15 </td><td width="1%" class="td"><a href="#top"
    15 16 onclick="search_<% $name %>();">
     
    41 42 }
    42 43
    43 44 function lookfor_<% $name %>() {
    44 var id = document.getElementById('<% $name %>_value').value;
    45 var $doc = $('#<% $name %>_docname');
    46 var id = $doc.data('id');
    47 var Class = $doc.data('class');
    45 48 if (id) {
    46 % if ( exists $prop->{lookup_opts}{class} ) {
    47 var Class = '<% $prop->{lookup_opts}{class} %>';
    48 49 var Uri = 'document.html?id=' + id + '&class=' + Class;
    49 % } elsif ( exists $prop->{lookup_opts}{table} ) {
    50 var Class = '<% $prop->{lookup_opts}{table} %>';
    51 var Uri = 'document.html?id=' + id + '&table=' + Class;
    52 % }
    53 50 var Width = screen.width;
    54 51 var Height = screen.height;
    55 52 window.open(Uri,'Interface','width='+Width+',height='+Height+',top=0,left=0,location=1,menubar=1,resizable=0,scrollbars=1,status=1,titlebar=1,toolbar=1,directories=1,hotkeys=1');
     
    79 76
    80 77 </script>
    81 78 <%args>
    79
    82 80 $object
    83 81 $name => undef
    84 82 $check => undef
    85 83 $prop => {}
    84
    86 85 </%args>
    87 86 <%init>
    88 87
     
    94 93 }
    95 94 $lookup_string = '/contenido/find_document.html?nf='.$name.'_docname&vf='.$name.'_value';
    96 95 while ( my ($param, $value) = each %{ $prop->{lookup_opts} } ) {
    97 $lookup_string .= '&'.$param.'='.$value;
    96 if ( ref $value eq 'ARRAY' ) {
    97 $lookup_string .= '&'.join('&', map{ $param.'='.$_ } @$value);
    98 } else {
    99 $lookup_string .= '&'.$param.'='.$value;
    100 }
    98 101 }
    99 102 } else {
    100 103 $error = 'Похоже неверное описание lookup_opts в документе';