Revision 421

Date:
2014/02/28 08:17:35
Author:
ahitrov
Revision Log:
Group operations with checkboxes - toggle
Files:

Legend:

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

     
    1 1 <script type="text/javascript">
    2 2 <!--
    3 var aIDs = new Array (<% scalar @$documents ? join (',', map { $_->id } @$documents) : '' %>);
    4 function delete_check () {
    5 for ( var i = 0; i < aIDs.length; i++ ) {
    6 var sFieldName = 'delete_' + aIDs[i] + '_id';
    7 var oField = document.forms['section_browse'].elements[sFieldName];
    3 function checkbox_common_toggle ( sClassSelector ) {
    4 $('.' + sClassSelector).each(function(){
    5 var oField = $(this)[0];
    8 6 if ( oField.checked ) {
    9 7 oField.checked = 0;
    10 8 } else {
    11 9 oField.checked = 1;
    12 10 }
    13 }
    11 });
    14 12 }
    15 13 % if ( @inline_pickups ) {
    16 14 $().ready(function() {
     
    75 73 <form name="section_browse" action="sections.html" method="POST">
    76 74 <table width="100%" border="0" cellpadding="4" cellspacing="0" class="tlistdocs">
    77 75 <tr bgcolor="#efefef">
    78 <th><a href="javascript:delete_check()" onclick="delete_check(); return false;"><img src="/contenido/i/actions/delete.gif" width="14" height="17" alt="Удаление документов" align="absmiddle" border="0" hspace="1"></a></th>
    76 <th><a href="javascript:void(0)" onclick="checkbox_common_toggle('common-check'); return false;"><img src="/contenido/i/checkbox-14x14-green.gif" width="14" height="14" title="Выбор документов для групповых операций" align="absmiddle" border="0" style="margin-left:3px;"></a></th>
    79 77 %
    80 78 % foreach (@$columns) {
    81 <th><% $_->{shortname} || $_->{rusname} %></th>
    79 <th>\
    80 % if ( $_->{inline} && $_->{type} eq 'checkbox' ) {
    81 <a href="javascript:void(0)" onclick="checkbox_common_toggle('<% $_->{attr} %>-check'); return false;"><img src="/contenido/i/checkbox-14x14-green.gif" width="14" height="14" title="Выбор документов для групповых операций" align="absmiddle" border="0" style="margin:0 5px 0 2px;"></a>\
    82 % }
    83 <% $_->{shortname} || $_->{rusname} %></th>
    82 84 % }
    83 85 %
    84 86 </tr>
     
    95 97 <td nowrap>\
    96 98 % if ($document_access == 2) {
    97 99 % $delete_status = 1;
    98 <input type="checkbox" name="<% 'delete_'.$document->id.'_id' %>">
    100 <input type="checkbox" class="common-check" name="<% 'delete_'.$document->id.'_id' %>">
    99 101 % } else {
    100 102 &nbsp;
    101 103 % }
     
    156 158 <td><input type="text" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : 'width:65px; ' %> <% $col->{inline_style} || '' %>">
    157 159 % } elsif ($col->{type} eq 'checkbox') {
    158 160 % my $checked = $document->$attr ? ' checked' : '';
    159 <td align="center"><input type="checkbox" name="<% 'update_'.$document->id.'_'.$attr %>"<% $checked %>>
    161 <td align="center"><input type="checkbox" class="<% $attr %>-check" name="<% 'update_'.$document->id.'_'.$attr %>"<% $checked %>>
    160 162 % } elsif ($col->{type} eq 'select') {
    161 163 % my $options = {};
    162 164 % if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$document->class}))) {