[open-ils-commits] r15623 - in trunk/Open-ILS/web: css/skin/default js/ui/default/acq/common templates/default/acq/common (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Feb 22 17:23:39 EST 2010


Author: senator
Date: 2010-02-22 17:23:33 -0500 (Mon, 22 Feb 2010)
New Revision: 15623

Modified:
   trunk/Open-ILS/web/css/skin/default/acq.css
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
   trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
Acq: optionally associate an alert with lineitem note when creating the latter.


Modified: trunk/Open-ILS/web/css/skin/default/acq.css
===================================================================
--- trunk/Open-ILS/web/css/skin/default/acq.css	2010-02-22 21:45:59 UTC (rev 15622)
+++ trunk/Open-ILS/web/css/skin/default/acq.css	2010-02-22 22:23:33 UTC (rev 15623)
@@ -140,6 +140,7 @@
 .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;}

Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-02-22 21:45:59 UTC (rev 15622)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-02-22 22:23:33 UTC (rev 15623)
@@ -311,12 +311,30 @@
     };
 
 
+    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 @@
             note.isnew(true);
             note.value(value);
             note.lineitem(li.id());
+            if (acqLitNoteAlertSelector.item)
+                note.alert_text(Number(acqLitNoteAlertSelector.item.id));
+
             self.updateLiNotes(li, note);
         }
 

Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2010-02-22 21:45:59 UTC (rev 15622)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2010-02-22 22:23:33 UTC (rev 15623)
@@ -142,9 +142,14 @@
                         <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>
                         </div>



More information about the open-ils-commits mailing list