Subversion Repositories DevTools

Rev

Rev 5102 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5102 Rev 5103
Line 8... Line 8...
8
%>
8
%>
9
<%
9
<%
10
Option explicit
10
Option explicit
11
' Good idea to set when using redirect
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
12
Response.Expires = 0   ' always load the page, dont store
-
 
13
' Determine mode of operation
-
 
14
' inReleaseMode: true:  Have rtag_id and proj_id, so we need to determine the sdk  
-
 
15
'                false: Have sdk_id so we need to determine the release
-
 
16
Dim inReleaseMode : inReleaseMode = Request("proj_id") <> "" AND  Request("rtag_id") <> "" 
13
%>
17
%>
14
<!--#include file="common/conf.asp"-->
18
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
19
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
20
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
21
<!--#include file="common/qstr.asp"-->
Line 62... Line 66...
62
 
66
 
63
function clearInfo(txt) {
67
function clearInfo(txt) {
64
    $("#sdkv_info").text(" ").removeClass("error");
68
    $("#sdkv_info").text(" ").removeClass("error");
65
}
69
}
66
 
70
 
67
$.validate({
-
 
68
    form: '#fNewSdkVersion',
-
 
69
    validateOnBlur : false,
71
// Form Validation processing
70
    onSuccess : function(f) {
72
//      Load in the required JavaScript support
71
        processSdkForm(f);
73
$.getScript("jquery/form-validator/jquery.form-validator.min.js", registerValidation);
72
    },
-
 
73
 
74
 
-
 
75
function registerValidation()
74
});
76
{
-
 
77
    $.validate({
-
 
78
        form: '#fNewSdkVersion',
-
 
79
        validateOnBlur : false,
-
 
80
        onSuccess : function(f) {
-
 
81
            processSdkForm(f);
-
 
82
        },
75
 
83
 
-
 
84
    });
-
 
85
}
76
// Severe Error processing
86
// Severe Error processing
77
//  Disable all the inputs on a form
87
//  Disable all the inputs on a form
78
//  Hide dialog buttons marked to be hidden
88
//  Hide dialog buttons marked to be hidden
79
//  All the user can do is read the error message and close the form
89
//  All the user can do is read the error message and close the form
80
function disableForm()
90
function disableForm()
Line 90... Line 100...
90
//          Close the dialog form
100
//          Close the dialog form
91
//          Trigger a custom event
101
//          Trigger a custom event
92
//              Users can use this event to refresh any table being displayed
102
//              Users can use this event to refresh any table being displayed
93
function processSdkForm(f)
103
function processSdkForm(f)
94
{
104
{
-
 
105
<%If inReleaseMode Then%>
-
 
106
    //  Enable the disabled fieldset so that the values within are sent as a part of the form
-
 
107
    $("#sel_base_release").prop("disabled", false);
-
 
108
<%End If%>
-
 
109
 
95
    getAjaxData (
110
    getAjaxData (
96
        "sdk_opr_json.asp",
111
        "sdk_opr_json.asp",
97
        f.serializeArray(),
112
        f.serializeArray(),
98
        function(data){
113
        function(data){
99
            f.dialog( "close" );
114
            f.dialog( "close" );
-
 
115
<%If inReleaseMode Then%>
-
 
116
            window.location.href = "sdk_main_page.asp#url=sdk_details.asp&sdktag_id=" + data.SDKTAG_ID;
-
 
117
<%Else%>
100
            $("#sdk_versions").trigger('sdkVersionAdded');
118
            $("#sdk_versions").trigger('sdkVersionAdded');
-
 
119
<%End If%>
-
 
120
            
101
        });    
121
        });    
102
};
122
};
103
 
123
 
104
//  Attach a function to the submit event
124
//  Attach a function to the submit event
105
//  Allows local processing
125
//  Allows local processing
106
$( "#fNewSdkVersion" ).submit(function(e) {
126
$( "#fNewSdkVersion" ).submit(function(e) {
107
        e.preventDefault(); //STOP default action
127
        e.preventDefault(); //STOP default action
108
        return false;
128
        return false;
109
        });
129
        });
110
 
130
 
111
function populateProjects(){
131
function populateProjects(proj_id, rtag_id){
112
    getAjaxData (
132
    getAjaxData (
113
        "sdk_opr_json.asp",
133
        "sdk_opr_json.asp",
114
        { action: "getProjectList" },
134
        { action: "getProjectList" },
115
        function(data){
135
        function(data){
116
            // Populate selection
136
            // Populate selection
117
            var $options = $("#sel_project").empty();
137
            var $options = $("#sel_project").empty();
118
            $options.append($("<option />").val(null).text('Select One'));
138
            $options.append($("<option selected disabled/>").val(null).text('Select One'));
119
            $.each(data.aaData, function (index, value) {
139
            $.each(data.aaData, function (index, value) {
120
                $options.append($("<option />").val(value.PROJ_ID).text(value.PROJ_NAME));
140
                $options.append($("<option />").val(value.PROJ_ID).text(value.PROJ_NAME));
121
            });
141
            });
122
            //$options[0].selectedIndex = 0
-
 
123
            //populateReleases( $options.val())
-
 
124
 
-
 
125
            populateReleases( null, null); 
-
 
126
 
142
 
-
 
143
            populateReleases( proj_id, rtag_id); 
127
        });    
144
        });    
128
};
145
};
129
 
146
 
130
function populateReleases(proj_id, rtag_id){
147
function populateReleases(proj_id, rtag_id){
131
    getAjaxData (
148
    getAjaxData (
132
        "sdk_opr_json.asp",
149
        "sdk_opr_json.asp",
133
        { action: "getReleaseList", proj_id : proj_id, rtag_id : rtag_id, mode: $("#chk_release").is(':checked') },
150
        { action: "getReleaseList", proj_id : proj_id, rtag_id : rtag_id, mode: $("#chk_release").is(':checked') },
134
        function(data){
151
        function(data){
135
            // Populate selection
152
            // Populate selection
136
            var $options = $("#sel_release").empty();
153
            var $options = $("#sel_release").empty();
137
            $options.append($("<option />").val(null).text('Select One'));
154
            $options.append($("<option selected disabled/>").val(null).text('Select One'));
138
            $.each(data.aaData, function (index, value) {
155
            $.each(data.aaData, function (index, value) {
139
                $options.append($("<option />").val(value.RTAG_ID).text(value.RTAG_NAME));
156
                $options.append($("<option />").val(value.RTAG_ID).text(value.RTAG_NAME));
140
            });
157
            });
141
            if (rtag_id != null) 
158
            if (rtag_id != null) 
142
                $options.val(rtag_id);
159
                $options.val(rtag_id);
Line 185... Line 202...
185
        }
202
        }
186
    });
203
    });
187
 
204
 
188
}
205
}
189
 
206
 
-
 
207
//  If we have a proj_id and rtag_id, then we need to populate the SDK selector
-
 
208
//  When this is complete we will polulate the rest of the page
-
 
209
//
-
 
210
<%If inReleaseMode Then%>
-
 
211
    getAjaxData (
-
 
212
        "sdk_opr_json.asp",
-
 
213
        { action: "getSdkNames" , proj_id : <%=Request("proj_id")%>},
-
 
214
        function(data){
-
 
215
            // Populate selection
-
 
216
            var $options = $("#sel_sdkname").empty();
-
 
217
            var len = data.aaData.length;
-
 
218
 
-
 
219
            if ( len == 0 ) {
-
 
220
                $options.append($("<option selected disabled/>").val(null).text('None Available'));
-
 
221
                disableForm();
-
 
222
                setInfo("Project not configured for SDKs");
-
 
223
                return;
-
 
224
 
-
 
225
            } else if ( len > 1 ) {
-
 
226
                $options.append($("<option selected disabled/>").val(null).text('Select One'));
-
 
227
            }
-
 
228
            $.each(data.aaData, function (index, value) {
-
 
229
                $options.append($("<option />").val(value.SDK_ID).text(value.SDK_NAME));
-
 
230
            });
-
 
231
 
-
 
232
            //  Display the controlling Project and Release
-
 
233
            populateProjects(<%=Request("proj_id")%>, <%=Request("rtag_id")%>);
-
 
234
 
-
 
235
            if( $options.val() > 0 ) {
-
 
236
                populateSdkVersions( $options.val());
-
 
237
            }
-
 
238
        });
-
 
239
        
-
 
240
$("#sel_sdkname").change(function(){
-
 
241
    populateSdkVersions( $("#sel_sdkname").val());
-
 
242
});
-
 
243
 
-
 
244
function populateSdkVersions(sdk_id){
-
 
245
    getAjaxData (
-
 
246
        "sdk_opr_json.asp",
-
 
247
        { action: "getSdkVersions", sdk_id : sdk_id, active: false, mode : true },
-
 
248
        function(data){
-
 
249
            // Populate selection
-
 
250
            var $options = $("#sel_sdkversion").empty();
-
 
251
            $options.append($("<option selected disabled />").val(null).text('Current Versions'));
-
 
252
            $.each(data.aaData, function (index, value) {
-
 
253
                $options.append($("<option />").val(value.SDKTAG_ID).text(value.SDKTAG_NAME));
-
 
254
            });
-
 
255
        });    
-
 
256
}
-
 
257
    
-
 
258
<%End If%>
-
 
259
 
-
 
260
 
-
 
261
<%If NOT inReleaseMode Then%>
190
//  Get getSdkDetails
262
//  Get getSdkDetails
191
//      When this is complete we will populate the remainder of the page.
263
//      When this is complete we will populate the remainder of the page.
192
getAjaxData (
264
getAjaxData (
193
    "sdk_opr_json.asp",
265
    "sdk_opr_json.asp",
194
    { action: "getSdkDetails", sdk_id : <%=Request("sdk_id")%> },
266
    { action: "getSdkDetails", sdk_id : <%=Request("sdk_id")%> },
Line 197... Line 269...
197
        $("#sdkDetails").val( data.aaData.SDK_NAME);
269
        $("#sdkDetails").val( data.aaData.SDK_NAME);
198
        //  Populate the Projects Drop Down List
270
        //  Populate the Projects Drop Down List
199
        populateProjects();
271
        populateProjects();
200
    });    
272
    });    
201
 
273
 
202
 
-
 
203
//  Wire up various controls to auto-populate others
274
//  Wire up various controls to auto-populate others
204
$("#sel_project").change(function(){
275
$("#sel_project").change(function(){
205
    populateReleases( $(this).val(), null);
276
    populateReleases( $(this).val(), null);
206
    });
277
    });
207
 
278
 
208
$("#chk_release").change(function(){
279
$("#chk_release").change(function(){
209
    populateReleases( $("#sel_project").val(), $("#sel_release").val());
280
    populateReleases( $("#sel_project").val(), $("#sel_release").val());
210
});
281
});
-
 
282
<%End If%>
211
 
283
 
212
//# sourceURL=sdk_versions_add.asp
284
//# sourceURL=sdk_versions_add.asp
213
</script>
285
</script>
-
 
286
<link rel="stylesheet" href="jquery/form-validator.css" type="text/css">
214
<form title="Create new SDK Version" id=fNewSdkVersion action="sdk_opr_json.asp" class=td>
287
<form title="Create new SDK Version" id=fNewSdkVersion action="sdk_opr_json.asp" class=td>
215
    
288
    
216
	<div style='min-height:25px;position:relative;'>
289
	<div style='min-height:25px;position:relative;'>
217
        <img id='sdkv_progressBar' src='icons/i_processing.gif' width='79' height='14'style='visibility:hidden;position:absolute;'>
290
        <img id='sdkv_progressBar' src='icons/i_processing.gif' width='79' height='14'style='visibility:hidden;position:absolute;'>
218
        <div id='sdkv_info' style='position:absolute;'></div>
291
        <div id='sdkv_info' style='position:absolute;'></div>
219
    </div>
292
    </div>
220
 
293
 
-
 
294
<%If inReleaseMode Then%>
-
 
295
    <fieldset>
-
 
296
    <legend>SDK</legend>
-
 
297
    <p>SDK Family:
-
 
298
    <br><select id=sel_sdkname name=sdk_id data-validation="required"></select>
-
 
299
    <p>Current Versions: (for reference only)
-
 
300
    <br><select id=sel_sdkversion></select>
-
 
301
    </fieldset>
-
 
302
<%Else%>
221
    <p>SDK:
303
    <p>SDK:
222
    <br><input id=sdkDetails disabled>
304
    <br><input id=sdkDetails disabled>
-
 
305
    <input type="hidden" name="sdk_id" value="<%=Request("sdk_id")%>">
-
 
306
<%End If%>
223
 
307
 
224
    <fieldset>
308
    <fieldset>
225
    <legend>SDK Version</legend>
309
    <legend>SDK Version</legend>
226
    <p>Name:
310
    <p>Name:
227
    <br><input id=sdk_name type="text" name="sdkName" maxlength=50 size=40 data-validation="length,alphanumeric" data-validation-length="min4" data-validation-allowing="_. -">
311
    <br><input id=sdk_name type="text" name="sdkName" maxlength=50 size=40 data-validation="length,alphanumeric" data-validation-length="min4" data-validation-allowing="_. -">
228
 
312
 
229
    <p>Description:
313
    <p>Description:
230
    <br><textarea id=sdk_comment name="sdkComment" cols=40  data-validation="length" data-validation-length="5-4000"></textarea>                                              
314
    <br><textarea id=sdk_comment name="sdkComment" cols=40  data-validation="length" data-validation-length="5-4000"></textarea>                                              
231
    </fieldset>
315
    </fieldset>
232
 
316
 
233
    <fieldset>
317
    <fieldset id="sel_base_release" <%If inReleaseMode Then Response.Write(" disabled")%>>
234
    <legend>Base Release</legend>
318
    <legend>Base Release</legend>
235
    <p>Project:<br>
319
    <br>Project:<br>
236
        <select id=sel_project name=proj_id data-validation="required">
320
        <select id=sel_project name=proj_id data-validation="required">
237
        <option value="">Select One</option>
321
        <option value="">Select One</option>
238
        </select>
322
        </select>
239
 
323
 
240
    <p>Release:<input id=chk_release type=checkbox>Show all versions
324
    <p>Release:<input id=chk_release type=checkbox>Show all versions
Line 242... Line 326...
242
        <select id=sel_release name=rtag_id data-validation="required">
326
        <select id=sel_release name=rtag_id data-validation="required">
243
        <option value="">Select One</option>
327
        <option value="">Select One</option>
244
        </select>
328
        </select>
245
    </fieldset>
329
    </fieldset>
246
 
330
 
247
    <input type="hidden" name="sdk_id" value="<%=Request("sdk_id")%>">
-
 
248
    <input type="hidden" name="action" value="addNewSdkVersion">
331
    <input type="hidden" name="action" value="addNewSdkVersion">
249
</form>
332
</form>
250
 
333