some images I probably won't add to cvs, and bucket deletion confirmation
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 05:05:44 +0000 (05:05 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 05:05:44 +0000 (05:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3157 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_buckets.js
Open-ILS/xul/staff_client/server/cat/copy_buckets_overlay.xul

index e73731a..8e9e97e 100644 (file)
@@ -12,6 +12,7 @@ cat.copy_buckets = function (params) {
 cat.copy_buckets.prototype = {
        'selection_list1' : [],
        'selection_list2' : [],
+       'bucket_id_name_map' : {},
 
        'init' : function( params ) {
 
@@ -105,6 +106,7 @@ cat.copy_buckets.prototype = {
                                                                                [ obj.session, obj.data.list.au[0].id() ]
                                                                        ).copy,
                                                                        function(o) {
+                                                                               obj.bucket_id_name_map[ o.id() ] = o.name();
                                                                                return [ o.name(), o.id() ];
                                                                        }
                                                                );
@@ -239,6 +241,10 @@ cat.copy_buckets.prototype = {
                                                function() {
                                                        try {
                                                                var bucket = obj.controller.view.bucket_menulist.value;
+                                                               var name = obj.bucket_id_name_map[ bucket ];
+                                                               var conf = prompt('To delete this bucket, re-type its name:','','Delete Bucket');
+                                                               if (conf != name) return;
+                                                               obj.list2.clear();
                                                                var robj = obj.network.simple_request('BUCKET_DELETE',[obj.session,'copy',bucket]);
                                                                if (typeof robj == 'object') throw robj;
                                                                obj.controller.render('copy_buckets_menulist_placeholder');
index c38158f..fddbd3f 100644 (file)
 </vbox>
 
 <hbox id="pending_buckets_bottom_ui">
-       <button label="Add All Copies above to bucket below" id="copy_buckets_add" accesskey="A"/>
-       <button label="Add Selected Copies above to bucket below" id="copy_buckets_sel_add" accesskey=""/>
+       <spacer flex="1"/>
+       <button label="Add All" id="copy_buckets_add" accesskey="A" image="/xul/server/skin/media/images/down_arrow.gif"/>
+       <button label="Add Selected" id="copy_buckets_sel_add" accesskey="" image="/xul/server/skin/media/images/down_arrow.gif"/>
 </hbox>
 
 <hbox id="copy_buckets_top_ui">
        <label value="Select:"/>
        <hbox id="copy_buckets_menulist_placeholder" />
-       <spacer flex="1"/>
        <button id="copy_buckets_new_bucket" label="New Bucket"/>
        <button id="copy_buckets_delete_bucket" label="Delete Bucket"/>
-       <button id="copy_buckets_delete_item" label="Delete Item" disabled="true"/>
+       <spacer flex="1"/>
+       <button id="copy_buckets_delete_item" label="Delete Selected" disabled="true" image="/xul/server/skin/media/images/icon_delete.gif"/>
+       <button id="copy_buckets_export" label="Add Selected" image="/xul/server/skin/media/images/up_arrow.gif"/>
 </hbox>
 
 <hbox id="copy_buckets_bottom_ui">
        <button id="copy_buckets_print" label="Print" command="cmd_copy_buckets_print" accesskey="P"/>
        <button id="copy_buckets_reprint" label="Print Last" command="cmd_copy_buckets_reprint" accesskey_disabled="L"/>
        <spacer flex="1"/>
-       <button id="copy_buckets_export" label="Add Selected Copies to Temp Space above"/>
        <button id="copy_buckets_done" label="Done" command="cmd_copy_buckets_done" accesskey="D"/>
 </hbox>