Subversion Repositories DevTools

Rev

Rev 6879 | Rev 6986 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6879 Rev 6977
Line 119... Line 119...
119
        End If
119
        End If
120
    Next
120
    Next
121
    
121
    
122
End Function
122
End Function
123
'-----------------------------------------------------------------------------------------------------------------------------------
123
'-----------------------------------------------------------------------------------------------------------------------------------
124
Function Set_Row_Style ( sLink, pvid )
124
Function Set_Row_Style ( sClass, pvid )
125
    Set_Row_Style = "onMouseOver='this.style.cursor=""pointer""' onClick='selectVersion("""& sLink &""",event)' "
125
    Set_Row_Style = "class='pointer selectVersion "& sClass &"' data-pvid='" & pvid &"'"
126
End Function
126
End Function
127
'-----------------------------------------------------------------------------------------------------------------------------------
127
'-----------------------------------------------------------------------------------------------------------------------------------
128
%>
128
%>
129
<!--#include file="_jquery_includes.asp"-->
129
<!--#include file="_jquery_includes.asp"-->
130
<script language="JavaScript" type="text/JavaScript">
130
<script language="JavaScript" type="text/JavaScript">
Line 161... Line 161...
161
    });
161
    });
162
 
162
 
163
    return false;
163
    return false;
164
}
164
}
165
 
165
 
166
//  This function is invoked when the user clicks within a row
-
 
167
//  The click will re-load and reposition the version history to the selected version
-
 
168
//  The problem is that the 'Destroy Version' interacts with this.
-
 
169
//  Also the mailto operation interacts with this
-
 
170
//  Solution: The DestroyVersion is an image within a 'td'. 
-
 
171
//            If the 'td' has a class of nogo, then don't navigate
-
 
172
function selectVersion(href,event)
-
 
173
{
-
 
174
    if (! ($(event.target).closest('td').hasClass('nogo') || $(event.target).closest('span').hasClass('mailto')) ) {
-
 
175
        location.href = href;
-
 
176
    }
-
 
177
}
-
 
178
 
-
 
179
//  Encode data into URL
-
 
180
function encodeData(data) {
-
 
181
    return Object.keys(data).map(function(key) {
-
 
182
        return [key, data[key]].map(encodeURIComponent).join("=");
-
 
183
    }).join("&");
-
 
184
} 
-
 
185
 
-
 
186
// Destroy a package version
-
 
187
function DestroyVersion(pvid, idx) {
-
 
188
    var data = {
-
 
189
        pv_id       : pvid,
-
 
190
        bfile       : "<%=ScriptName%>",
-
 
191
        rtag_id     : "<%=parRtag_id%>",
-
 
192
        FLuser_name : "<%=parFLuser_name%>",
-
 
193
        FLpkg_version : "<%=parFLpkg_version%>",
-
 
194
        rfile       : "<%=parRfile%>",
-
 
195
        pkg_id      : "<%=parPkg_id%>",
-
 
196
        OLDpv_id    : "<%=parOLDpv_id%>",
-
 
197
        index       : idx 
-
 
198
         
-
 
199
    };
-
 
200
    MM_openVixIFrame('_destroy_package.asp?' + encodeData(data), 'Destroy Package Version')
-
 
201
}
-
 
202
 
-
 
203
//  Scroll to package
166
//  Scroll to package
204
//  Order of preference
167
//  Order of preference
205
//      index   - location of last package deleted
168
//      index   - location of last package deleted
206
//      index-1 - Near last pakage deleted
169
//      index-1 - Near last pakage deleted
207
//      pvid    - PVID being viewed
170
//      pvid    - PVID being viewed
Line 232... Line 195...
232
        var h = screen.height;
195
        var h = screen.height;
233
        MM_findObj("LayerVersions").style.height = (h-300)/2 +"px";
196
        MM_findObj("LayerVersions").style.height = (h-300)/2 +"px";
234
        MM_findObj("LayerDetails").style.height = (h-300)/2 +"px";
197
        MM_findObj("LayerDetails").style.height = (h-300)/2 +"px";
235
    } catch(e) {
198
    } catch(e) {
236
    }
199
    }
-
 
200
}
237
}   
201
   
-
 
202
//  Attach events   
-
 
203
$(document).ready(function() {
-
 
204
 
-
 
205
    //  This function is invoked when the user clicks within a row
-
 
206
    //  The click will re-load and reposition the version history to the selected version
-
 
207
    //  The problem is that the 'Destroy Version' interacts with this.
-
 
208
    //  Also the mailto operation interacts with this
-
 
209
    //  Solution: The DestroyVersion is an image within a 'td'. 
-
 
210
    //            If the 'td' has a class of nogo, then don't navigate
-
 
211
    $('.selectVersion').on('click', function () {
-
 
212
 
-
 
213
        if ($(event.target).closest('td').hasClass('nogo') || $(event.target).closest('span').hasClass('mailto') ) {
-
 
214
            return;
-
 
215
        }
-
 
216
 
-
 
217
        var tr = $(this).closest('tr');
-
 
218
        var pvid = $(tr).data('pvid');
-
 
219
        var isaPatch = $(tr).hasClass('isaPatch');
-
 
220
        var URLstring = <%="'" & Persists_Query_String_Trim( "","index,pv_id" ) & "'" %>;
-
 
221
        var script;
-
 
222
 
-
 
223
        if ( isaPatch ) {
-
 
224
            script = '_wform_versions_history_release_notes.asp';
-
 
225
        } else {
-
 
226
            script = <%= "'" & scriptName & "'" %>
-
 
227
        }
-
 
228
        URLstring = script + '?' + URLstring + 'pv_id=' + pvid;
-
 
229
        location.href = URLstring; 
-
 
230
    });
-
 
231
 
-
 
232
    //  This function will add a listener to allow a user to download the Release Notes
-
 
233
    //  If the target does not exist, then it will redirect to a 404 error :(
-
 
234
    $('.downloadNotes').on('click', function (){
-
 
235
        var notes = $(this).data('rnote');
-
 
236
        var tr = $(this).closest('tr');
-
 
237
        var pvid = $(tr).data('pvid');
-
 
238
        var URLstring = <%="'" & HTTP_PKG_ARCHIVE & "'" %> + notes;
-
 
239
 
-
 
240
        //  Open in a new window
-
 
241
        window.open(URLstring, '_blank');
-
 
242
    });
-
 
243
 
-
 
244
    //  Add a listener for destroyVersion events
-
 
245
    $('.destroyVersion').on('click', function (){
-
 
246
    var tr = $(this).closest('tr');
-
 
247
    var pvid = $(tr).data('pvid');
-
 
248
    var idx = $(tr).data('idx');
-
 
249
 
-
 
250
    var data = {
-
 
251
        pv_id       : pvid,
-
 
252
        bfile       : "<%=ScriptName%>",
-
 
253
        rtag_id     : "<%=parRtag_id%>",
-
 
254
        FLuser_name : "<%=parFLuser_name%>",
-
 
255
        FLpkg_version : "<%=parFLpkg_version%>",
-
 
256
        rfile       : "<%=parRfile%>",
-
 
257
        pkg_id      : "<%=parPkg_id%>",
-
 
258
        OLDpv_id    : "<%=parOLDpv_id%>",
-
 
259
        index       : idx };
-
 
260
    var param = $.param(data);
-
 
261
    MM_openVixIFrame('_destroy_package.asp?' + param, 'Destroy Package Version')
-
 
262
    });
-
 
263
 
-
 
264
});
238
 
265
 
239
//# sourceURL=_version_browser_1.asp
266
//# sourceURL=_version_browser_1.asp
240
</script>
267
</script>
241
 
268
 
242
      <!--------------- ACTION BUTTONS -------------------------->
269
      <!--------------- ACTION BUTTONS -------------------------->
Line 304... Line 331...
304
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
331
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
305
        <tr>
332
        <tr>
306
          <td class='bg_dialog'> 
333
          <td class='bg_dialog'> 
307
            <div id="LayerVersions" style="height: 350px; width:100vw; overflow: auto;" name="LayerVersions"> 
334
            <div id="LayerVersions" style="height: 350px; width:100vw; overflow: auto;" name="LayerVersions"> 
308
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
335
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
309
                <tr>
336
                <thead>
310
                  <td width="1" nowrap background="images/bg_action_dark.gif"><img src="images/spacer.gif" width="15" height="10"></td>
337
                  <th width="1" nowrap background="images/bg_action_dark.gif"><img src="images/spacer.gif" width="15" height="10"></th>
311
                  <td width="1" nowrap background="images/bg_action_dark.gif">&nbsp;</td>
338
                  <th width="1" nowrap background="images/bg_action_dark.gif">&nbsp;</th>
312
                  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Version&nbsp;&nbsp;<br><input name="FLpkg_version" type="text" class="form_ifilter" value="<%=parFLpkg_version%>" size="15"></td>
339
                  <th width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Version&nbsp;&nbsp;<br><input name="FLpkg_version" type="text" class="form_ifilter" value="<%=parFLpkg_version%>" size="15"></th>
313
                  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Mod. Date&nbsp;&nbsp;</td>
340
                  <th width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Mod. Date&nbsp;&nbsp;</th>
314
                  <td width="100%" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Reason for this version</td>
341
                  <th width="100%" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Reason for this version</th>
315
                  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Modified&nbsp;&nbsp;<br><input name="FLuser_name" type="text" class="form_ifilter" value="<%=parFLuser_name%>" size="15"></td>
342
                  <th width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Modified&nbsp;&nbsp;<br><input name="FLuser_name" type="text" class="form_ifilter" value="<%=parFLuser_name%>" size="15"></th>
316
                  <td width="1" nowrap background="images/bg_action_dark.gif"></td>
343
                  <th width="1" nowrap background="images/bg_action_dark.gif"></th>
317
                  <td width="1" nowrap background="images/bg_action_dark.gif"></td>
344
                  <th width="1" nowrap background="images/bg_action_dark.gif"></th>
318
                </tr>
345
                </thead>
319
                <%
346
                <%
320
                Dim aVersions, lastRow, i, objSortHelper, idx
347
                Dim aVersions, lastRow, i, objSortHelper, idx
321
                
348
                
322
                Set rsVB = OraDatabase.DbCreateDynaset( Get_All_Versions ( parPkg_id ), cint(0))
349
                Set rsVB = OraDatabase.DbCreateDynaset( Get_All_Versions ( parPkg_id ), cint(0))
323
                
350
                
Line 364... Line 391...
364
                    fieldReleased_By = emailField(enum_imgUser & aVersions( rsVB.FieldIndex("full_name"), i ), aVersions( rsVB.FieldIndex("user_email"), i ))
391
                    fieldReleased_By = emailField(enum_imgUser & aVersions( rsVB.FieldIndex("full_name"), i ), aVersions( rsVB.FieldIndex("user_email"), i ))
365
                    
392
                    
366
                    ' Full Release Notes availability
393
                    ' Full Release Notes availability
367
                    fieldDownloadFullReleaseNotes = ""
394
                    fieldDownloadFullReleaseNotes = ""
368
                    If NOT IsNull( aVersions( rsVB.FieldIndex("release_notes_info"), i ) ) OR ( InStr( aVersions( rsVB.FieldIndex("release_notes_info"), i ), "MGS:") < 1)  Then
395
                    If NOT IsNull( aVersions( rsVB.FieldIndex("release_notes_info"), i ) ) OR ( InStr( aVersions( rsVB.FieldIndex("release_notes_info"), i ), "MGS:") < 1)  Then
369
                        fieldDownloadFullReleaseNotes = "<a href='"& HTTP_PKG_ARCHIVE & aVersions( rsVB.FieldIndex("release_notes_info"), i ) &"' target='_blank'><img src='images/i_download_small.gif' alt='Download full release notes.' width='16' height='16' hspace='2' border='0'></a>"
396
                        fieldDownloadFullReleaseNotes = "<img src='images/i_download_small.gif' title='Download full release notes.' width='16' height='16' hspace='2' border='0' class='pointer downloadNotes' data-rnote='"&aVersions( rsVB.FieldIndex("release_notes_info"), i )&"'>"
370
                    End If
397
                    End If
371
                    
398
                    
372
                    pvidName = "PVID_"& aVersions( rsVB.FieldIndex("pv_id"), i )
399
                    pvidName = "PVID_"& aVersions( rsVB.FieldIndex("pv_id"), i )
373
                    idxName = "IDX_" & idx
400
                    idxName = "IDX_" & idx
374
                    If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then
401
                    If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then
375
                        URLstring = "_wform_versions_history_release_notes.asp?"& Persists_Query_String_Trim( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ), "index" )
402
                        URLstring = "isaPatch"
376
                    Else
403
                    Else
377
                        URLstring = scriptName &"?"& Persists_Query_String_Trim( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ), "index" )
404
                        URLstring = ""
378
                    End If
405
                    End If
379
                    
406
                    
380
                    ' User can try to delete package iff
407
                    ' User can try to delete package iff
381
                    '   Have suffiecient access (unusual)
408
                    '   Have suffiecient access (unusual)
382
                    '   They created it or own it
409
                    '   They created it or own it
Line 398... Line 425...
398
                        End If
425
                        End If
399
                    End If
426
                    End If
400
                    
427
                    
401
                    ' Set destroy package action
428
                    ' Set destroy package action
402
                    If CanDestroyPackage Then
429
                    If CanDestroyPackage Then
403
                        DestroyPackage = "<span "&_
430
                        DestroyPackage = "<span class='destroyVersion'"&_
404
                                         " title='Destroy this version of the package.' "&_
431
                                         " title='Destroy this version of the package.'> "&_
405
                                         " onClick=DestroyVersion("& aVersions( rsVB.FieldIndex("pv_id"), i ) &"," & idx  &")>" &_
-
 
406
                                         " <img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ><span>"
432
                                         " <img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ><span>"
407
                    Else
433
                    Else
408
                        DestroyPackage = ""
434
                        DestroyPackage = ""
409
                    End If
435
                    End If
410
                %>
436
                %>
411
                <tr id="<%=idxName%>" <%=Set_Row_Style ( URLstring, CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) )%>> 
437
                <tr id='<%=idxName%>' data-idx='<%=idx%>' <%=Set_Row_Style ( URLstring, CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) )%>> 
412
                  <td align="right" background="images/bg_action_dark.gif"><%=imgPointer%><span id="<%=pvidName%>"></span></td>
438
                  <td align="right" background="images/bg_action_dark.gif"><%=imgPointer%><span id="<%=pvidName%>"></span></td>
413
                  <td align="center" valign="top" <%=rowColor%>><%=imgLock%></td>
439
                  <td align="center" valign="top" <%=rowColor%>><%=imgLock%></td>
414
                  <td valign="top" nowrap <%=rowColor%>><a href="<%=URLstring%>" class="txt_linked"><%=aVersions( rsVB.FieldIndex("pkg_version"), i )%></a></td>
440
                  <td valign="top" nowrap <%=rowColor%>><a href="<%=URLstring%>" class="txt_linked"><%=aVersions( rsVB.FieldIndex("pkg_version"), i )%></a></td>
415
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldRelease_Date%></td>
441
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldRelease_Date%></td>
416
                  <td valign="top" <%=rowColor%> class="form_item"><%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%></td>
442
                  <td valign="top" <%=rowColor%> class="form_item"><%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%></td>
417
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldReleased_By%></td>
443
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldReleased_By%></td>
418
                  <td align="center" valign="top" <%=rowColor%>><%=fieldDownloadFullReleaseNotes%></td>
444
                  <td align="center" valign="top" class="nogo" <%=rowColor%>><%=fieldDownloadFullReleaseNotes%></td>
419
                  <td align="center" valign="top" class="nogo" <%=rowColor%>><%=DestroyPackage%></td>
445
                  <td align="center" valign="top" class="nogo" <%=rowColor%>><%=DestroyPackage%></td>
420
                </tr>
446
                </tr>
421
                <%
447
                <%
422
                Next
448
                Next
423
                End If
449
                End If