Acq: optionally associate an alert with lineitem note when creating the latter.
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Feb 2010 22:23:33 +0000 (22:23 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 22 Feb 2010 22:23:33 +0000 (22:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15623 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/css/skin/default/acq.css
Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/templates/default/acq/common/li_table.tt2

index 3ae2d80..3cea4fb 100644 (file)
@@ -140,6 +140,7 @@ label[for="attr_search_type_scalar"] { vertical-align: top; }
 .acq-lit-note-textarea { border-right: 2px solid #aaa; width:50%;}
 .acq-lit-note-textarea div { padding: 4px; font-weight: bold; }
 #acq-lit-notes-tbody td {padding: 20px 10px 20px 10px; border-bottom:2px solid #aaa;}
+.acq-lit-note-create-row { margin: 6px 0; }
 
 .acq-lit-li-menu-bar {width:99%; text-align:left; border:1px solid #aaa; margin:5px 0px 10px 0px;}
 .acq-lit-li-menu-left {text-align:left; width:300px;}
index 015d867..6f0416a 100644 (file)
@@ -311,12 +311,30 @@ function AcqLiTable() {
     };
 
 
+    this._setAlertStore = function() {
+        acqLitNoteAlertSelector.store = new dojo.data.ItemFileReadStore(
+            {
+                "data": acqliat.toStoreData(
+                    (new openils.PermaCrud()).search(
+                        "acqliat", {"id": {"!=": null}}
+                    )
+                )
+            }
+        );
+        acqLitNoteAlertSelector.setValue(); /* make the store "live" */
+        acqLitNoteAlertSelector._store_ready = true;
+    };
+
     /**
      * Draws and shows the lineitem notes pane
      */
     this.drawLiNotes = function(li) {
         var self = this;
 
+        if (!acqLitNoteAlertSelector._store_ready) {
+            this._setAlertStore();
+        }
+
         li.lineitem_notes(
             li.lineitem_notes().sort(
                 function(a, b) { 
@@ -337,6 +355,9 @@ function AcqLiTable() {
             note.isnew(true);
             note.value(value);
             note.lineitem(li.id());
+            if (acqLitNoteAlertSelector.item)
+                note.alert_text(Number(acqLitNoteAlertSelector.item.id));
+
             self.updateLiNotes(li, note);
         }
 
index 0e3f878..96bdd48 100644 (file)
                         <div dojoType="dijit.form.DropDownButton">
                             <span>New Note</span>
                             <div dojoType="dijit.TooltipDialog">
-                                <div>
-                                    <div jsId='acqLitCreateNoteText' dojoType='dijit.form.Textarea' style='height:5em; width:25em;' name='note'></div>
+                                <div class="acq-lit-note-create-row">
+                                    <label for="acq-lit-create-note-text">Main body of note</label>
+                                    <div jsId='acqLitCreateNoteText' dojoType='dijit.form.Textarea' style='height:5em; width:20em;' name='note' id="acq-lit-create-note-text"></div>
+                                </div>
+                                <div class="acq-lit-note-create-row">
+                                    <label for="acq-lit-note-alert-selector">Optional alert text</label>
+                                    <input id="acq-lit-note-alert-selector" jsId="acqLitNoteAlertSelector" dojoType="dijit.form.FilteringSelect" labelAttr="code" searchAttr="code" required="false" />
                                 </div>
                                 <button jsId='acqLitCreateLiNoteSubmit' dojoType='dijit.form.Button' type="submit">Create</button>
                             </div>