Subversion Repositories DevTools

Rev

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

Rev 6122 Rev 6123
Line 113... Line 113...
113
        $(this).text( showHide ? 'Show Deployable' : 'Show All');
113
        $(this).text( showHide ? 'Show Deployable' : 'Show All');
114
        showHide = !showHide;
114
        showHide = !showHide;
115
        table.ajax.reload();        
115
        table.ajax.reload();        
116
    });
116
    });
117
 
117
 
-
 
118
    $('#ds_clearAll').on("click", function(){
-
 
119
        var msg  = 'Are you sure you want to reset the "Deployable" flag on all packages in this Release?' +
-
 
120
                   '<p>There may be side effects.<p>The flag is a function of the package-version, not the release.' +
-
 
121
                   '<p>Resetting all the flags may affect other Releases and Projects.';
-
 
122
 
-
 
123
        vixConfirm (msg,{
-
 
124
            title:'Reset All Deploy Flags', 
-
 
125
            button: 'Reset All Flags',
-
 
126
            ok : function(){
-
 
127
                getAjaxData (
-
 
128
                    "_json_UpdateVersion.asp",
-
 
129
                    { opr : 'clearAllDeployable',
-
 
130
                      rtag_id : <%=parRtagId%>   
-
 
131
                    },
-
 
132
                    null,
-
 
133
                    function() {table.ajax.reload();}
-
 
134
                    );
-
 
135
                }});
-
 
136
    });
-
 
137
 
-
 
138
 
118
    // Process click on checkboxes within the datatable
139
    // Process click on checkboxes within the datatable
119
    //      this - a DOM node
140
    //      this - a DOM node
120
    //      $(this) - The jquery wrapped node
141
    //      $(this) - The jquery wrapped node
121
    //
142
    //
122
    $('#deploymentstatetable').on( 'click', 'tbody td :checkbox', function () {
143
    $('#deploymentstatetable').on( 'click', 'tbody td :checkbox', function () {
Line 126... Line 147...
126
              pv_id : $(this).data('pvid'), 
147
              pv_id : $(this).data('pvid'), 
127
              deployment_state : this.checked ? 'Y' : '-' 
148
              deployment_state : this.checked ? 'Y' : '-' 
128
            });
149
            });
129
        });
150
        });
130
 
151
 
131
 
-
 
132
	} );
152
	} );
133
 
153
 
134
//  getAjaxData - with error processing
154
//  getAjaxData - with error processing
135
//      url - url to fetch
155
//      url - url to fetch
136
//      data    - additional data to pass to ajax request
156
//      data    - additional data to pass to ajax request
137
//      success - function to call on success
157
//      success - function to call on success
-
 
158
//      always -  function to call at completion
138
function getAjaxData( url, data, success )
159
function getAjaxData( url, data, success, always )
139
{
160
{
140
    clearInfo();
161
    clearInfo();
141
    $("#ds_progressBar").css('visibility', 'visible');
162
    $("#ds_progressBar").css('visibility', 'visible');
142
    $(document.body).css({ 'cursor': 'progress' })
163
    $(document.body).css({ 'cursor': 'progress' })
143
    $.ajax(
164
    $.ajax(
Line 145... Line 166...
145
        url : url,
166
        url : url,
146
        type: "POST",
167
        type: "POST",
147
        data : data,
168
        data : data,
148
        dataType : "json",
169
        dataType : "json",
149
        cache: false,
170
        cache: false,
150
        success:function(data, textStatus, jqXHR)
171
        success:function(data, textStatus, jqXHR) {
151
        {
-
 
152
            //data: return data from server
172
            //data: return data from server
153
            //console.log ("UpdateData", data);
173
            //console.log ("UpdateData", data);
154
            if (data.result != 0)
174
            if (data.result != 0) {
155
            {
-
 
156
                setInfo("Error:" + ((data.error != 0) ? data.emsgSummary : "Reason not given"));
175
                setInfo("Error:" + ((data.error != 0) ? data.emsgSummary : "Reason not given"));
157
                return;
176
                return;
158
            }
177
            }
159
            //  call user success function
178
            //  call user success function
160
            if (jQuery.isFunction(success))
179
            if (jQuery.isFunction(success)) {
161
            {
-
 
162
                success(data);
180
                success(data);
163
            }
181
            }
164
        },
182
        },
165
        error: function(jqXHR, textStatus, errorThrown)
183
        error: function(jqXHR, textStatus, errorThrown) {
166
        {
-
 
167
            setInfo("Error:" + errorThrown);
184
            setInfo("Error:" + errorThrown);
168
            //if fails
185
            //if fails
169
        },
186
        },
170
        complete : function()
187
        complete : function() {
171
        {
-
 
172
            $("#ds_progressBar").css('visibility', 'hidden');
188
            $("#ds_progressBar").css('visibility', 'hidden');
173
            $(document.body).css({ 'cursor': 'auto' })
189
            $(document.body).css({ 'cursor': 'auto' });
-
 
190
            //  call user always function
-
 
191
            if (jQuery.isFunction(always)) {
-
 
192
                always();
-
 
193
            }
174
        }
194
        }
175
    });
195
    });
176
 
196
 
177
function setInfo(txt) {
197
function setInfo(txt) {
178
    $("#ds_info").text( txt);
198
    $("#ds_info").text( txt);
Line 219... Line 239...
219
                                        </thead>
239
                                        </thead>
220
                                        <tbody>
240
                                        <tbody>
221
                                        </tbody>
241
                                        </tbody>
222
                                    </table>
242
                                    </table>
223
                                    <!-- Info / Ajax Progress bar -->
243
                                    <!-- Info / Ajax Progress bar -->
224
                                    <div class='bg_dialog body_txt' style='position:relative;min-height:21px;' >
244
                                    <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
225
                                        <img id='ds_progressBar' style='visibility:hidden;position: absolute;display: block' src='icons/i_processing.gif' width='79' height='14'>
245
                                        <img id='ds_progressBar' style='visibility:hidden;position: absolute;display: block' src='icons/i_processing.gif' width='79' height='14'>
226
                                        <div id='ds_info'  style='position: absolute;'></div>
246
                                        <div id='ds_info'  style='position: absolute;'></div>
227
                                        <div>
247
                                        <div>
228
                                              <button id='ds_refresh' style="display:inline; float:right;">Refresh</button>
248
                                              <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
229
                                              <button id='ds_show' style="display:inline; float:right;">Show Deployable</button>
249
                                              <button id='ds_show'     class='rmbutton' style="display:inline; float:right;">Show Deployable</button>
-
 
250
                                              <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;">Clear All</button>
230
                                        </div>
251
                                        </div>
231
                                    </div>
252
                                    </div>
232
                                </div>
253
                                </div>
233
                            </td>
254
                            </td>
234
                        </tr>
255
                        </tr>