| 1 |
8 |
ahitrov@rambler.ru |
<script type="text/javascript"> |
| 2 |
|
|
<!-- |
| 3 |
421 |
ahitrov |
function checkbox_common_toggle ( sClassSelector ) { |
| 4 |
|
|
$('.' + sClassSelector).each(function(){ |
| 5 |
|
|
var oField = $(this)[0]; |
| 6 |
8 |
ahitrov@rambler.ru |
if ( oField.checked ) { |
| 7 |
|
|
oField.checked = 0; |
| 8 |
|
|
} else { |
| 9 |
|
|
oField.checked = 1; |
| 10 |
|
|
} |
| 11 |
421 |
ahitrov |
}); |
| 12 |
8 |
ahitrov@rambler.ru |
} |
| 13 |
386 |
ahitrov |
% if ( @inline_pickups ) { |
| 14 |
522 |
ahitrov |
$(document).ready(function() { |
| 15 |
386 |
ahitrov |
% foreach my $pickup ( @inline_pickups ) { |
| 16 |
|
|
% my $lookup_opts = $pickup->{lookup_opts}; |
| 17 |
|
|
% my $search_opts = join( '&', map { $_.'='.$lookup_opts->{$_} } keys %$lookup_opts ); |
| 18 |
|
|
|
| 19 |
|
|
$('.autocomplete_<% $pickup->{attr} %>').autocomplete({ |
| 20 |
|
|
minLength : 2, |
| 21 |
|
|
source : '/contenido/ajax/document_search.html?<% $search_opts %>', |
| 22 |
|
|
select : function( event, ui ) |
| 23 |
|
|
{ |
| 24 |
|
|
var sStoreId = $(this).attr('rel'); |
| 25 |
|
|
var item = ui.item; |
| 26 |
|
|
// alert(mydump(item)); |
| 27 |
|
|
$('#' + sStoreId).val( item.id ); |
| 28 |
|
|
// $(this).val(item.label); |
| 29 |
|
|
// alert( $('#' + sStoreId).val() ); |
| 30 |
|
|
}, |
| 31 |
|
|
change : function( event, ui ) |
| 32 |
|
|
{ |
| 33 |
|
|
var sStoreId = $(this).attr('rel'); |
| 34 |
|
|
var sValue = $(this).val(); |
| 35 |
|
|
if ( sValue == '' ) { |
| 36 |
|
|
$('#' + sStoreId).val(''); |
| 37 |
|
|
} |
| 38 |
|
|
} |
| 39 |
|
|
}); |
| 40 |
|
|
|
| 41 |
|
|
% } |
| 42 |
|
|
}); |
| 43 |
|
|
% } |
| 44 |
|
|
|
| 45 |
|
|
|
| 46 |
|
|
function mydump(arr,level) { |
| 47 |
|
|
var dumped_text = ""; |
| 48 |
|
|
if(!level) level = 0; |
| 49 |
|
|
|
| 50 |
|
|
var level_padding = ""; |
| 51 |
|
|
for(var j=0;j<level+1;j++) level_padding += " "; |
| 52 |
|
|
|
| 53 |
|
|
if(typeof(arr) == 'object') { |
| 54 |
|
|
for(var item in arr) { |
| 55 |
|
|
var value = arr[item]; |
| 56 |
|
|
|
| 57 |
|
|
if(typeof(value) == 'object') { |
| 58 |
|
|
dumped_text += level_padding + "'" + item + "' ...\n"; |
| 59 |
|
|
dumped_text += mydump(value,level+1); |
| 60 |
|
|
} else { |
| 61 |
|
|
dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n"; |
| 62 |
|
|
} |
| 63 |
|
|
} |
| 64 |
|
|
} else { |
| 65 |
|
|
dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; |
| 66 |
|
|
} |
| 67 |
|
|
return dumped_text; |
| 68 |
|
|
} |
| 69 |
|
|
|
| 70 |
|
|
|
| 71 |
8 |
ahitrov@rambler.ru |
//--> |
| 72 |
|
|
</script> |
| 73 |
|
|
<form name="section_browse" action="sections.html" method="POST"> |
| 74 |
|
|
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tlistdocs"> |
| 75 |
|
|
<tr bgcolor="#efefef"> |
| 76 |
421 |
ahitrov |
<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> |
| 77 |
8 |
ahitrov@rambler.ru |
% |
| 78 |
|
|
% foreach (@$columns) { |
| 79 |
421 |
ahitrov |
<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> |
| 84 |
8 |
ahitrov@rambler.ru |
% } |
| 85 |
|
|
% |
| 86 |
|
|
</tr> |
| 87 |
|
|
% |
| 88 |
|
|
% unless (@$documents) { |
| 89 |
|
|
<tr><td align="center" colspan="<% scalar @$columns %>">Документы не найдены</td></tr> |
| 90 |
|
|
% } |
| 91 |
|
|
% foreach my $document (@$documents) { |
| 92 |
|
|
% |
| 93 |
|
|
% next unless ref($document); |
| 94 |
|
|
% my $document_access = $user->section_accesses($user, $document->section); |
| 95 |
|
|
% |
| 96 |
|
|
<tr valign="top"> |
| 97 |
|
|
<td nowrap>\ |
| 98 |
|
|
% if ($document_access == 2) { |
| 99 |
|
|
% $delete_status = 1; |
| 100 |
421 |
ahitrov |
<input type="checkbox" class="common-check" name="<% 'delete_'.$document->id.'_id' %>"> |
| 101 |
8 |
ahitrov@rambler.ru |
% } else { |
| 102 |
|
|
|
| 103 |
|
|
% } |
| 104 |
|
|
</td> |
| 105 |
|
|
% |
| 106 |
|
|
% for my $col (@$columns) { |
| 107 |
|
|
% if ($col->{attr} eq '_sort_') { |
| 108 |
|
|
% |
| 109 |
|
|
<td width="20px"><% $document->{sorder} %> <a |
| 110 |
|
|
href="document_move.html?id=<% $document->{id} %>&move=up&s=<% $id %><% $params_unsection ? '&'.$params_unsection : '' %>"><img |
| 111 |
|
|
src="/contenido/i/ico-up-9x10.gif" border=0 alt="Переместить документ на шаг вверх"></a> <a |
| 112 |
|
|
href="document_move.html?id=<% $document->{id} %>&move=down&s=<% $id %><% $params_unsection ? '&'.$params_unsection : '' %>"><img |
| 113 |
|
|
src="/contenido/i/ico-down-9x10.gif" border=0 alt="Переместить документ на шаг вниз"></a>\ |
| 114 |
|
|
% |
| 115 |
|
|
% } elsif ($col->{attr} eq 'dtime') { |
| 116 |
|
|
% |
| 117 |
|
|
<td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{dtime} &>\ |
| 118 |
|
|
% |
| 119 |
|
|
% if ($document->{ctime} ne $document->{mtime}) { |
| 120 |
|
|
% my $colortime = '#c66'; |
| 121 |
|
|
% |
| 122 |
|
|
<div style="color:<% $colortime %>;"><& "/contenido/components/show_dtime.msn", dtime=>$document->{mtime} &></div>\ |
| 123 |
|
|
% |
| 124 |
|
|
% } |
| 125 |
|
|
% |
| 126 |
|
|
% } elsif ($col->{attr} eq 'name') { |
| 127 |
|
|
% |
| 128 |
|
|
<td><span<% $document->contenido_status_style ? ' style="' . $document->contenido_status_style . '"' : '' %> class="<% $document->status ? '':'hiddensect' %>">\ |
| 129 |
|
|
% |
| 130 |
|
|
% my $name=$document->name ? $document->name : 'Безымянный документ N'.$document->id; |
| 131 |
|
|
% if ($document_access == 2) { |
| 132 |
|
|
% |
| 133 |
522 |
ahitrov |
<a<% $document->contenido_status_style ? ' style="' . $document->contenido_status_style . '"' : '' %> href="document.html?id=<% $document->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>"><% $name | h %></a>\ |
| 134 |
8 |
ahitrov@rambler.ru |
% |
| 135 |
|
|
% } else { |
| 136 |
|
|
% |
| 137 |
395 |
ahitrov |
<% $name | h %>\ |
| 138 |
8 |
ahitrov@rambler.ru |
% |
| 139 |
|
|
% } |
| 140 |
|
|
% |
| 141 |
|
|
</span>\ |
| 142 |
|
|
% |
| 143 |
|
|
% } elsif ($col->{attr} eq 'id') { |
| 144 |
|
|
% |
| 145 |
|
|
<td><span class="<% $document->status ? '':'hiddensect' %>">\ |
| 146 |
|
|
% if ($document_access == 2) { |
| 147 |
|
|
<a href="document.html?id=<% $document->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>"><% $document->id %> </a>\ |
| 148 |
|
|
% } else { |
| 149 |
|
|
<% $document->id %> \ |
| 150 |
|
|
% } |
| 151 |
|
|
</span>\ |
| 152 |
|
|
% |
| 153 |
|
|
% } elsif ( exists $col->{inline} && $col->{inline} ) { |
| 154 |
|
|
% $inline_status = 1; |
| 155 |
|
|
% my $attr = $col->{attr}; |
| 156 |
|
|
% if ( $col->{type} =~ /^(string|integer|float)$/ && $col->{inline} ) { |
| 157 |
|
|
% my $style = $col->{inline_style} ? $col->{inline_style} : ($col->{type} =~ /^(integer|float)$/ ? 'text-align:right; ' : '' ); |
| 158 |
505 |
ahitrov |
% $style .= $col->{inline_width} ? ' width:'.$col->{inline_width}.'px; ' : ' width:65px; '; |
| 159 |
|
|
<td><input type="text" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr |h %>" style="<% $style %>"> |
| 160 |
522 |
ahitrov |
% } elsif ($col->{type} eq 'checkbox') { |
| 161 |
|
|
% my $checked = $document->$attr ? ' checked' : ''; |
| 162 |
|
|
<td align="center"><input type="checkbox" class="<% $attr %>-check" name="<% 'update_'.$document->id.'_'.$attr %>"<% $checked %>> |
| 163 |
505 |
ahitrov |
% } elsif ($col->{type} eq 'text') { |
| 164 |
|
|
% my $style = $col->{inline_style} ? $col->{inline_style} : ''; |
| 165 |
|
|
% $style .= $col->{inline_width} ? ' width:'.$col->{inline_width}.'px; ' : ' width:100px; '; |
| 166 |
|
|
% $style .= $col->{inline_height} ? ' width:'.$col->{inline_height}.'px; ' : ' height:70px; '; |
| 167 |
|
|
% my $value = $document->$attr; |
| 168 |
|
|
% for ( $value ) { |
| 169 |
|
|
% s/</</sgi; |
| 170 |
|
|
% s/>/>/sgi; |
| 171 |
|
|
% } |
| 172 |
|
|
<td><textarea name="<% 'update_'.$document->id.'_'.$attr %>" style="<% $style %>"><% $value %></textarea> |
| 173 |
8 |
ahitrov@rambler.ru |
% } elsif ($col->{type} eq 'select') { |
| 174 |
|
|
% my $options = {}; |
| 175 |
|
|
% if ($toopi && (ref($toopi) eq 'HASH') && (exists($toopi->{$document->class}))) { |
| 176 |
|
|
% %{ $options } = %{ $toopi->{$document->class} }; |
| 177 |
|
|
% } |
| 178 |
|
|
% my $values = $options->{$col->{attr}}; |
| 179 |
532 |
ahitrov |
<td><select name="<% 'update_'.$document->id.'_'.$attr %>" autocomplete="off"> |
| 180 |
8 |
ahitrov@rambler.ru |
% if ( ref $values eq 'ARRAY' ) { |
| 181 |
|
|
% foreach my $val ( @$values ) { |
| 182 |
|
|
% my $selected = $val eq $document->$attr ? ' selected' : ''; |
| 183 |
|
|
<option value="<% $val %>"<% $selected %>><% $val %> |
| 184 |
|
|
% } |
| 185 |
|
|
% } |
| 186 |
|
|
</select> |
| 187 |
|
|
% } elsif ($col->{type} eq 'status') { |
| 188 |
|
|
% my $cases = $col->{cases}; |
| 189 |
|
|
% if ( ref $cases eq 'ARRAY' ) { |
| 190 |
532 |
ahitrov |
<td><select name="<% 'update_'.$document->id.'_'.$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : '' %> <% $col->{inline_style} || '' %>" autocomplete="off"> |
| 191 |
8 |
ahitrov@rambler.ru |
% foreach my $case ( @$cases ) { |
| 192 |
|
|
% my $selected = $case->[0] eq $document->$attr ? ' selected' : ''; |
| 193 |
|
|
<option value="<% $case->[0] %>"<% $selected %>><% $case->[1] %> |
| 194 |
|
|
% } |
| 195 |
|
|
</select> |
| 196 |
|
|
% } |
| 197 |
386 |
ahitrov |
% } elsif ($col->{type} eq 'pickup' || $col->{type} eq 'autocomplete') { |
| 198 |
|
|
% my %opts = %{ $col->{lookup_opts} }; |
| 199 |
|
|
% my $doc; |
| 200 |
|
|
% if ( $document->$attr ) { |
| 201 |
|
|
% $doc = $keeper->get_document_by_id( $document->$attr, %opts ); |
| 202 |
|
|
% } |
| 203 |
395 |
ahitrov |
<td><input type="hidden" name="<% 'update_'.$document->id.'_'.$attr %>" id="<% 'update_'.$document->id.'_'.$attr %>" value="<% ($document->$attr || '') |h %>"> |
| 204 |
|
|
<input type="text" class="<% 'autocomplete_'.$attr %>" id="<% 'autocomplete_'.$document->id.'_'.$attr %>" value="<% (ref $doc ? $doc->name : '') |h %>" |
| 205 |
392 |
ahitrov |
title="<% defined $document->$attr ? 'Значение: '.$document->$attr : '' %>" |
| 206 |
|
|
rel="<% 'update_'.$document->id.'_'.$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : '' %> <% $col->{inline_style} || '' %>" |
| 207 |
395 |
ahitrov |
old-value="<% (ref $doc ? $doc->name : '') |h %>" onfocus="" onblur=""> |
| 208 |
386 |
ahitrov |
% } elsif ($col->{type} eq 'lookup') { |
| 209 |
|
|
% my %opts = %{ $col->{lookup_opts} }; |
| 210 |
|
|
% delete $opts{search_by} if exists $opts{search_by}; |
| 211 |
|
|
% my $docs; |
| 212 |
|
|
% if ( exists $lookup_elements{$col->{attr}} ) { |
| 213 |
|
|
% $docs = $lookup_elements{$col->{attr}}; |
| 214 |
|
|
% } else { |
| 215 |
|
|
% $docs = $keeper->get_documents( %opts, return_mode => 'array_ref', names => 1 ); |
| 216 |
|
|
% $lookup_elements{$col->{attr}} = $docs; |
| 217 |
|
|
% } |
| 218 |
|
|
% if ( ref $docs eq 'ARRAY' && @$docs ) { |
| 219 |
532 |
ahitrov |
<td><select name="<% 'update_'.$document->id.'_'.$attr %>" style="<% $col->{inline_width} ? 'width:'.$col->{inline_width}.'px;' : '' %> <% $col->{inline_style} || '' %>" autocomplete="off"> |
| 220 |
386 |
ahitrov |
<option value="<% $col->{allow_null} ? '' : 0 %>"></option> |
| 221 |
|
|
% foreach my $case ( @$docs ) { |
| 222 |
|
|
% my $selected = $case->[0] eq $document->$attr ? ' selected' : ''; |
| 223 |
|
|
<option value="<% $case->[0] %>"<% $selected %>><% $case->[1] %> |
| 224 |
|
|
% } |
| 225 |
|
|
</select> |
| 226 |
|
|
% } else { |
| 227 |
522 |
ahitrov |
<td><% $document->$attr %><input type="hidden" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr |h %>">\ |
| 228 |
386 |
ahitrov |
% } |
| 229 |
505 |
ahitrov |
% } else { |
| 230 |
522 |
ahitrov |
<td><% $document->$attr %><input type="hidden" name="<% 'update_'.$document->id.'_'.$attr %>" value="<% $document->$attr |h %>">\ |
| 231 |
8 |
ahitrov@rambler.ru |
% } |
| 232 |
|
|
% |
| 233 |
|
|
% } elsif ($col->{attr} eq 'class') { |
| 234 |
|
|
% |
| 235 |
|
|
<td><% $document->class_name %> <font color="#999999">(<% $document->class %>)</font>\ |
| 236 |
|
|
% |
| 237 |
|
|
% } elsif ($col->{type} eq 'datetime') { |
| 238 |
|
|
% |
| 239 |
|
|
<td nowrap><& "/contenido/components/show_dtime.msn", dtime=>$document->{$col->{attr}} &>\ |
| 240 |
|
|
% |
| 241 |
|
|
% } elsif ($col->{attr} eq '_act_') { |
| 242 |
|
|
% |
| 243 |
|
|
<td nowrap>\ |
| 244 |
|
|
% if ($document_access == 2) { |
| 245 |
|
|
% |
| 246 |
|
|
<a href="document.html?id=<% $document->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>" title="Редактировать документ"><img |
| 247 |
|
|
src="/contenido/i/actions/edit.gif" width="15" height="17" alt="Редактировать документ" align="absmiddle" border="0" hspace="1"></a>\ |
| 248 |
|
|
<a href="document.html?clone=1&id=<% $document->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>" title="Копировать документ"><img |
| 249 |
|
|
src="/contenido/i/actions/copy.gif" width="15" height="17" alt="Копировать документ" align="absmiddle" border="0" hspace="1"></a>\ |
| 250 |
|
|
<a href="confirm.html?id=<% $document->id %>&action=documents_deletion&from=<% $section->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>" title="Удалить документ"><img |
| 251 |
|
|
src="/contenido/i/actions/delete.gif" width="14" height="17" alt="Удалить документ" align="absmiddle" border="0" hspace="1"></a>\ |
| 252 |
|
|
% if ( $document->status != 0 ) { |
| 253 |
|
|
<a href="document.html?deactivate=1&id=<% $document->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>" title="Скрыть/деактивировать документ"><img |
| 254 |
|
|
src="/contenido/i/actions/deactivate.gif" width="14" height="17" alt="Скрыть/деактивировать документ" align="absmiddle" border="0" hspace="1"></a>\ |
| 255 |
|
|
% } |
| 256 |
|
|
% if ( $document->status != 1 ) { |
| 257 |
|
|
<a href="document.html?activate=1&id=<% $document->id %>&class=<% $document->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>" title="Присвоить документу статус=1"><img |
| 258 |
|
|
src="/contenido/i/actions/activate.gif" width="14" height="17" alt="Присвоить документу статус=1" align="absmiddle" border="0" hspace="1"></a>\ |
| 259 |
|
|
% } |
| 260 |
|
|
<br>\ |
| 261 |
|
|
% |
| 262 |
|
|
% } else { |
| 263 |
|
|
\ |
| 264 |
|
|
% } |
| 265 |
|
|
% if ( $inline_status ) { |
| 266 |
|
|
<input type="hidden" name="update_<% $document->id %>_class" value="<% $document->class %>"> |
| 267 |
|
|
% } |
| 268 |
|
|
% if ( $delete_status ) { |
| 269 |
|
|
<input type="hidden" name="delete_<% $document->id %>_class" value="<% $document->class %>"> |
| 270 |
|
|
% } |
| 271 |
|
|
% |
| 272 |
|
|
% } else { |
| 273 |
439 |
ahitrov |
% my $attr = $col->{attr}; |
| 274 |
8 |
ahitrov@rambler.ru |
% if ($col->{type} eq 'date') { |
| 275 |
|
|
% my $date=$document->{$col->{attr}}; |
| 276 |
|
|
% $date=~/(\d{4}-\d{2}-\d{2})/; |
| 277 |
|
|
<td nowrap align="right"><% $1 || ' ' %>\ |
| 278 |
|
|
% } elsif ($col->{type} eq 'datetime') { |
| 279 |
|
|
<td nowrap align="right"><% $document->{$col->{attr}} || ' ' %>\ |
| 280 |
|
|
% } elsif ($col->{type} eq 'integer') { |
| 281 |
|
|
<td align="right"><% $document->{$col->{attr}} %> \ |
| 282 |
386 |
ahitrov |
% } elsif ($col->{type} eq 'lookup' || $col->{type} eq 'pickup' || $col->{type} eq 'autocomplete') { |
| 283 |
8 |
ahitrov@rambler.ru |
<td align="left">\ |
| 284 |
|
|
% my $id = $document->{$col->{attr}}; |
| 285 |
|
|
% if ($id) { |
| 286 |
|
|
% my ($doc)=$keeper->get_documents( ( ref($col->{lookup_opts}) ? %{$col->{lookup_opts}} : () ), id=>$id); |
| 287 |
|
|
% if ($doc) { |
| 288 |
|
|
<a href="document.html?id=<% $doc->id %>&class=<% $doc->class %><% $params_unclassed ? '&'.$params_unclassed : '' %>"><% $doc->name || $doc->id %></a> \ |
| 289 |
|
|
% } else { |
| 290 |
|
|
<span class="hiddensect"><% $document->{$col->{attr}} %>???</span>\ |
| 291 |
|
|
% } |
| 292 |
|
|
% } else { |
| 293 |
|
|
<span class="hiddensect">NULL</span>\ |
| 294 |
|
|
% } |
| 295 |
439 |
ahitrov |
% } elsif ($col->{type} eq 'checkbox') { |
| 296 |
|
|
<td align="center"><% $document->$attr ? '<img src="/contenido/i/checked-16x16.png" width="16" height="16">' : ' ' %>\ |
| 297 |
8 |
ahitrov@rambler.ru |
% } elsif ($col->{type} eq 'status') { |
| 298 |
|
|
% my $status_map = ref $col->{cases} eq 'ARRAY' ? $col->{cases} : $keeper->default_status(); |
| 299 |
|
|
% my ($doc_status) = grep { $_->[0] eq $document->{$col->{attr}} } @$status_map; |
| 300 |
|
|
% $doc_status ||= [$document->{$col->{attr}}, 'Неизвестный']; |
| 301 |
|
|
<td nowrap><% $doc_status->[1].'('.$doc_status->[0].')' %>\ |
| 302 |
|
|
% } else { |
| 303 |
439 |
ahitrov |
<td><% defined($document->$attr) ? $document->$attr : ' ' %>\ |
| 304 |
8 |
ahitrov@rambler.ru |
% } |
| 305 |
|
|
% } |
| 306 |
|
|
</td> |
| 307 |
|
|
% |
| 308 |
|
|
% } #- for @columns |
| 309 |
|
|
% |
| 310 |
|
|
</tr> |
| 311 |
|
|
% } #- foreach @documents |
| 312 |
|
|
</table> |
| 313 |
|
|
<input type="hidden" name="id" value="<% $section->id %>"> |
| 314 |
|
|
% if ( ref $filter eq 'HASH' ) { |
| 315 |
|
|
% while ( my ($key, $value) = each %$filter ) { |
| 316 |
|
|
% next if $key eq 's'; |
| 317 |
|
|
<input type="hidden" name="<% $key %>" value="<% $value |h %>"> |
| 318 |
|
|
% } |
| 319 |
|
|
% } |
| 320 |
522 |
ahitrov |
% if ( $section->default_document_class || $section->default_table_class ) { |
| 321 |
|
|
<div style="display:inline-block; width:45%; margin:10px 0; min-height:80px; vertical-align:top;"> |
| 322 |
|
|
<& /contenido/components/inputs/parent.msn, name => 'tree', check => $section->id, style => 'width:100%;' &> |
| 323 |
|
|
<div style="text-align:left; margin-top:5px;"> |
| 324 |
|
|
<input type="submit" name="move" value="Перенести" class="input_btn"><input |
| 325 |
|
|
type="submit" name="link" value="Привязать" class="input_btn"><input |
| 326 |
|
|
type="submit" name="unlink" value="Отвязать от текущей" class="input_btn" onclick="return confirm('Объекты, не привязанные к другим секциям могут быть потеряны');"> |
| 327 |
|
|
</div> |
| 328 |
|
|
</div> |
| 329 |
|
|
% } |
| 330 |
8 |
ahitrov@rambler.ru |
% if ( $inline_status || $delete_status ) { |
| 331 |
522 |
ahitrov |
<div style="display:inline-block; width:45%; text-align:right; margin:5px; padding-top:29px; vertical-align:top;"> |
| 332 |
8 |
ahitrov@rambler.ru |
% if ( $inline_status ) { |
| 333 |
522 |
ahitrov |
<input type="submit" name="update" value="Сохранить изменения" class="input_btn">\ |
| 334 |
8 |
ahitrov@rambler.ru |
% } |
| 335 |
|
|
% if ( $delete_status ) { |
| 336 |
|
|
<input type="submit" name="delete" value="Удалить выбранные" class="input_btn" onclick="return confirm('Все отмеченные позиции будут удалены');"> |
| 337 |
|
|
% } |
| 338 |
|
|
</div> |
| 339 |
|
|
% } |
| 340 |
386 |
ahitrov |
<br clear="all"> |
| 341 |
8 |
ahitrov@rambler.ru |
</form> |
| 342 |
|
|
<%args> |
| 343 |
|
|
|
| 344 |
|
|
$section => undef |
| 345 |
|
|
$documents => undef |
| 346 |
|
|
$columns => undef |
| 347 |
|
|
$id => undef |
| 348 |
|
|
$filter => undef |
| 349 |
|
|
|
| 350 |
|
|
</%args> |
| 351 |
|
|
<%init> |
| 352 |
|
|
|
| 353 |
|
|
return unless ref $documents eq 'ARRAY'; |
| 354 |
|
|
return unless ref $columns eq 'ARRAY'; |
| 355 |
|
|
return unless ref $section; |
| 356 |
|
|
|
| 357 |
|
|
my $toopi = $project->documents(); |
| 358 |
|
|
my $inline_status = 0; |
| 359 |
|
|
my $delete_status = 0; |
| 360 |
|
|
my $params = ref $filter eq 'HASH' ? join ('&', map { $_.'='.$filter->{$_} } keys %$filter ) : ''; |
| 361 |
|
|
my $params_unclassed = ref $filter eq 'HASH' ? join ('&', map { $_.'='.$filter->{$_} } grep { $_ ne 'class' } keys %$filter ) : ''; |
| 362 |
|
|
my $params_unsection = ref $filter eq 'HASH' ? join ('&', map { $_.'='.$filter->{$_} } grep { $_ ne 's' } keys %$filter ) : ''; |
| 363 |
|
|
|
| 364 |
386 |
ahitrov |
my %lookup_elements; |
| 365 |
|
|
my @inline_pickups = grep { exists $_->{inline} && ($_->{type} eq 'pickup' || $_->{type} eq 'autocomplete') } @$columns; |
| 366 |
8 |
ahitrov@rambler.ru |
|
| 367 |
|
|
</%init> |