Line # Revision Author
1 195 ahitrov <& "/contenido/components/title.msn", title=>'�������� ������' &>
2 <style>
3 <!--
4 body {margin:5px;}
5 -->
6 </style>
7
8 % if (ref $document) {
9 % ### Source is available
10 % ######################################################
11
12 <script language="JavaScript">
13 <!--
14 function DeleteDest ()
15 {
16 oSelect = document.forms['destform'].elements[0];
17 for (j = 0; j < oSelect.options.length; j++) {
18 if (!oSelect.options[j].selected) {
19 oSelect.options[j] = null;
20 }
21 }
22 return true;
23 }
24
25 function SelectAllDest ()
26 {
27 oSelect = document.forms['destform'].elements[0];
28 // oSelect.setExpression('multiple', true);
29 // document.recalc(true);
30 for (j = 0; j < oSelect.options.length; j++) {
31 oSelect.options[j].selected = true;
32 }
33 return true;
34 }
35
36 function CheckDest ()
37 {
38 oSelect = document.forms['destform'].elements[0];
39 if ( oSelect.options.length ) {
40 return true;
41 } else {
42 alert ('�� ������ �� ���� ��������');
43 return false;
44 }
45 }
46
47 //-->
48 </script>
49
50 %
51 % my @properties = $document->structure();
52 % my ($prop) = grep { $_->{'attr'} eq 'status' } @properties;
53 % my ($status) = grep { $_->[0] == $document->status } @{ $m->comp( '/contenido/components/inputs/status.msn', prop => $prop, object=>$document, name => $prop->{attr}, mode => 'get') };
54 % $status = $status->[1];
55 <table width="100%" border="0" align="center"><tr><td>
56 <fieldset>
57 <legend>��������</legend>
58 <table class="tform" width="100%">
59 <tr valign="top"><td><b>��������:</b>
60 </td><td><a href="/contenido/document.html?id=<% $document->id %>&class=<% $document->class %>" target="_top"><% $document->name %></a>
61 </td></tr>
62 <tr valign="top"><td><b>�����:</b>
63 </td><td><% $document->class %>
64 </td></tr>
65 <tr valign="top"><td><b>������:</b>
66 </td><td><% $status %>
67 </td></tr>
68 </table>
69 </fieldset>
70
71 <fieldset>
72 <legend>������ ������</legend>
73 <table class="tform" width="100%">
74 <tr><td>
75 <form action="link_add.html" name="destform" target="_top" method="post" onsubmit="return CheckDest();">
76 <select multiple name="destinations" size="20" style="width:100%">
77 </select>
78 <p>� ��������� ����� ��������� ������ ���������� ���������.</p>
79 <input type="hidden" name="class" value="<% $class %>">
80 <input type="hidden" name="source_id" value="<% $source_id %>">
81 <input type="hidden" name="source_class" value="<% $source_class %>">
82 <input type="button" value="�������� ���" onclick="SelectAllDest();">
83 <input type="button" value="������� ������" onclick="DeleteDest();">
84 <input type="submit" value="������� ���������">
85 </form>
86 </td></tr>
87 </table>
88 </fieldset>
89
90 </td></tr></table>
91
92 %#<pre><% Dumper(\@properties) %></pre>
93
94 % }else{
95 % ### Source is not available
96 % ######################################################
97 %
98
99 <script language="JavaScript">
100 <!--
101 function AddSource (Value, Name)
102 {
103 // alert (Name);
104
105 var oSelect = parent.frames.destfrm.document.forms['sourceform'].elements[0];
106 var Found = 0;
107 for(j=0; j < oSelect.options.length; j++) {
108 if (oSelect.options[j].value == Value) {
109 Found = 1;
110 }
111 }
112 if (!Found) {
113 var oOption = document.createElement("OPTION");
114 oOption.text=Name;
115 oOption.value=Value;
116 oOption.selected=true;
117 oSelect.options.add(oOption);
118 }
119 return false;
120 }
121 //-->
122 </script>
123
124 <& /contenido/components/link_browse.msn,
125 class => $class,
126 source_class => $source_class,
127 p => $p,
128 use_section => $use_section,
129 alpha => $alpha,
130 alpha_search => $alpha_search,
131 search => $search,
132 search_by => $search_by,
133 restrict_class => $restrict_class,
134 &>
135
136 % }
137
138 </body>
139 </html>
140 <%args>
141 $class => ''
142 $source_class => ''
143 $source_id => ''
144 $dest_class => ''
145 $dest_id => ''
146 $save => 0
147 $status => 0
148
149 $p => 1
150 $restrict_class => undef
151 $use_section => undef
152 $alpha => undef
153 $alpha_search => undef
154 $search_by => undef
155 $search => undef
156
157 </%args>
158 <%init>
159
160 my $document;
161
162 if ($source_id) {
163 $document = $keeper->get_document_by_id ($source_id,
164 class => $source_class,
165 );
166 } else {
167 $source_class = $class->available_sources;
168 }
169
170 </%init>