Changeset 1509

Show
Ignore:
Timestamp:
08/11/07 00:29:17
Author:
douglm
Message:

More rdates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/solr/conf/schema.xml

    r1504 r1509  
    250250          required="false" /> 
    251251 
     252   <field name="summary" type="text" indexed="true" stored="true"/> 
     253   <field name="description" type="text" indexed="true" stored="true"/> 
    252254   <field name="location" type="text" indexed="true" stored="true"/> 
    253255 
    254256   <!-- These are really date fields and should be formatted as above --> 
    255    <field name="creator" type="text" indexed="true" stored="true"/> 
     257   <field name="created" type="text" indexed="true" stored="true"/> 
    256258   <field name="lastmod" type="text" indexed="true" stored="true"/> 
    257259   <field name="startDate" type="text" indexed="true" stored="true"/> 
    258260   <field name="endDate" type="text" indexed="true" stored="true"/> 
    259261   <field name="dueDate" type="text" indexed="true" stored="true"/> 
     262 
     263   <field name="creator" type="text" indexed="true" stored="true"/> 
    260264 
    261265   <field name="category" type="text" indexed="true" stored="true" multiValued="true"/> 
     
    304308 
    305309   <copyField source="created" dest="text"/> 
     310   <copyField source="summary" dest="text"/> 
    306311   <copyField source="description" dest="text"/> 
    307    <copyField source="lastmod" dest="nameSort"/> 
    308    <copyField source="summary" dest="alphaNameSort"/> 
     312   <copyField source="lastmod" dest="text"/> 
    309313   <copyField source="startDate" dest="text"/> 
    310314   <copyField source="endDate" dest="text"/> 
    311315   <copyField source="dueDate" dest="text"/> 
    312    <copyField source="category" dest="category"/> 
     316   <copyField source="category" dest="text"/> 
    313317 
    314318   <!-- <copyField source="manu" dest="manu_exact"/> --> 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r1508 r1509  
    31483148                  </select> 
    31493149                 <xsl:text> </xsl:text> 
    3150      
     3150 
    31513151                  <select name="tzid" id="rdateTzid" class="timezones"> 
    31523152                    <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if> 
     
    31773177                store as UTC 
    31783178              </div> 
    3179      
    3180               <!-- if there are no recurence dates, the following table will show --> 
    3181               <table cellspacing="0" id="bwCurrentRdates"> 
     3179 
     3180              <!-- if there are no recurrence dates, the following table will show --> 
     3181              <table cellspacing="0" class="invisible" id="bwCurrentRdatesNone"> 
    31823182                <tr><th>Recurrence Dates</th></tr> 
    31833183                <tr><td>No recurrence dates</td></tr> 
    31843184              </table> 
    3185                
     3185 
    31863186              <!-- if there are no recurence dates, the following table will show --> 
    3187               <table cellspacing="0" id="bwCurrentRdates"> 
     3187              <table cellspacing="0" class="invisible" id="bwCurrentRdates"> 
    31883188                <tr> 
    31893189                  <th colspan="4">Recurrence Dates</th> 
     
    31963196                </tr> 
    31973197              </table> 
    3198                
     3198 
    31993199              <!-- if there are no recurence dates, the following table will show --> 
    3200               <table cellspacing="0" id="bwCurrentExdatesNone"> 
     3200              <table cellspacing="0" class="invisible" id="bwCurrentExdatesNone"> 
    32013201                <tr><th>Exception Dates</th></tr> 
    32023202                <tr><td>No exception dates</td></tr> 
    32033203              </table> 
    3204                
     3204 
    32053205              <!-- if there are no recurence dates, the following table will show --> 
    3206               <table cellspacing="0" id="bwCurrentExdates"> 
     3206              <table cellspacing="0" class="invisible" id="bwCurrentExdates"> 
    32073207                <tr> 
    32083208                  <th colspan="4">Exception Dates</th> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedework.js

    r1439 r1509  
    2929 
    3030function changeClass(id, newClass) { 
    31   identity = document.getElementById(id); 
     31  var identity = document.getElementById(id); 
     32  if (identity == null) { 
     33    alert("No element with id: " + id + " to set to class: " + newClass); 
     34  } 
    3235  identity.className=newClass; 
    3336} 
     37 
    3438// show hide items using a checkbox 
    3539function swapVisible(obj,id) { 
     
    5862  } 
    5963} 
    60 // show and hide an item based on its current  
     64// show and hide an item based on its current 
    6165// visibility; if visible, hide it; if invisible 
    6266// show it. 
     
    7074// Toggle action icons box visibility at the selected position and 
    7175// set any open action icon boxes to invisible. 
    72 // Action icon boxes are used in the calendar grid - their ids are  
     76// Action icon boxes are used in the calendar grid - their ids are 
    7377// built from a prefix plus the day number; the box identified by zero is the topmost box 
    7478// associated with the "add..." button.  Id's will therefore be prefix-0 through 
     
    148152// launch the calSelect pop-up window for selecting a calendar when creating, 
    149153// editing, and importing events 
    150 // DEPRECATED - can't use pop-ups in current portal environments in a  
     154// DEPRECATED - can't use pop-ups in current portal environments in a 
    151155// portal-agnostic way 
    152156function launchCalSelectWindow(URL) { 
     
    160164} 
    161165// used to update the calendar in various forms from 
    162 // the calSelect pop-up widget.  We must do three things: update the hidden  
     166// the calSelect pop-up widget.  We must do three things: update the hidden 
    163167// calendar input field, update the displayed text, and close widget 
    164168function updateEventFormCalendar(newCalPath,calDisplay) { 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkEventForm.js

    r1508 r1509  
    5959  } 
    6060 
    61   /* row: current table row 
     61  /* varName: NOT GOOD - name of object 
     62   * reqPar: request par for hidden field 
     63   * row: current table row 
    6264   * rdi: index of rdate fro delete 
    6365   */ 
    64   this.toFormRow = function(reqPar, row, rdi) { 
     66  this.toFormRow = function(varName, reqPar, row, rdi) { 
    6567    row.insertCell(0).appendChild(document.createTextNode(this.date)); 
    6668    row.insertCell(1).appendChild(document.createTextNode(this.time)); 
    6769    row.insertCell(2).appendChild(document.createTextNode(this.tzid)); 
    68     row.insertCell(3).innerHTML = "<a href=\"javascript:bwRdates.deleteRdate('" + 
     70    row.insertCell(3).innerHTML = "<a href=\"javascript:" + varName + ".deleteDate('" + 
    6971                                   rdi + "')\">" + rdateDeleteStr + "</a>" + 
    70                                    "<input type='hidden' name='" + reqPar +  
     72                                   "<input type='hidden' name='" + reqPar + 
    7173                                   "' value='" + this.format() + "'/>"; 
    7274  } 
    73    
     75 
    7476  this.format= function() { 
    7577    var res = this.date + "\t" + this.time + "\t"; 
    76      
     78 
    7779    if (this.tzid != null) { 
    7880      res += "\t" + this.tzid; 
    7981    } 
    80      
     82 
    8183    return res; 
    8284  } 
    8385 
    8486  this.equals = function(that) { 
    85     return (that.val = this.val) && (that.tzid = this.tzid); 
    86   } 
    87 
    88  
    89 var bwRdates = new BwREXdates("rdate", "bwCurrentRdates", "bwCurrentRdatesNone", "visible", "invisible", 2); 
    90 var bwExdates = new BwREXdates("exdate", "bwCurrentExdates", "bwCurrentExdatesNone", "visible", "invisible", 2); 
    91  
    92 function BwREXdates(reqPar, tableId, noDatesId, visibleClass, invisibleClass, numHeaderRows) { 
    93   var rdates = new Array(); 
    94  
     87    return this.compareTo(that) == 0; 
     88  } 
     89 
     90  this.compareTo = function(that) { 
     91    var res = compareTo(that.date, this.date); 
     92    if (res != 0) { 
     93      return res; 
     94    } 
     95 
     96    res = compareTo(that.time, this.time); 
     97    if (res != 0) { 
     98      return res; 
     99    } 
     100 
     101    return compareTo(that.tzid, this.tzid); 
     102  } 
     103
     104 
     105function compareTo(thys, that) { 
     106  if (that < thys) { 
     107    return -1; 
     108  } 
     109 
     110  if (that > thys) { 
     111    return 1; 
     112  } 
     113 
     114  return 0; 
     115
     116 
     117function sortCompare(thys, that) { 
     118  return thys.compareTo(that); 
     119
     120 
     121var bwRdates = new BwREXdates("bwRdates", "rdate", "bwCurrentRdates", "bwCurrentRdatesNone", 
     122                              "visible", "invisible", 2); 
     123var bwExdates = new BwREXdates("bwExdates", "exdate", "bwCurrentExdates", "bwCurrentExdatesNone", 
     124                               "visible", "invisible", 2); 
     125 
     126/** Manipulate table of exception or recurrence dates. 
     127 * 
     128 * @param varName: NOT GOOD - name of object 
     129 * @param reqPar:    request parameter we gernate (multi-valued) 
     130 * @param tableId:   id of table we are manipulating 
     131 * @param noDatesId: some info to display when we have nothing 
     132 * @param visibleClass: class to set to make something visible 
     133 * @param invisibleClass: class to set to make something invisible 
     134 * @param numHeaderRows: Number of header rows in the table. 
     135 */ 
     136function BwREXdates(varName, reqPar, tableId, noDatesId, 
     137                    visibleClass, invisibleClass, numHeaderRows) { 
     138  var dates = new Array(); 
     139 
     140  this.varName = varName; 
    95141  this.reqPar = reqPar; 
    96142  this.tableId = tableId; 
     143  this.noDatesId = noDatesId; 
     144  this.visibleClass = visibleClass; 
     145  this.invisibleClass = invisibleClass; 
     146  this.numHeaderRows = numHeaderRows; 
    97147 
    98148  /* val: String: internal date 
     
    104154 
    105155    if (!this.contains(newRdate)) { 
    106       rdates.push(newRdate); 
     156      dates.push(newRdate); 
    107157    } 
    108158  } 
    109159 
    110160  this.contains = function(rdate) { 
    111     for (var j = 0; j < rdates.length; j++) { 
    112       var curRdate = rdates[j]; 
     161    for (var j = 0; j < dates.length; j++) { 
     162      var curRdate = dates[j]; 
    113163      if (curRdate.equals(rdate)) { 
    114164        return true; 
     
    119169  } 
    120170 
    121   // Update the list - expects the browser form object 
     171  // Update the list - 
    122172  this.update = function(date, time, allDay, floating, utc, tzid) { 
    123173    this.addRdate(date, time, allDay, floating, utc, tzid); 
     
    127177  } 
    128178 
    129   this.deleteRdate = function(index) { 
    130     rdates.splice(index, 1); 
     179  this.deleteDate = function(index) { 
     180    dates.splice(index, 1); 
    131181 
    132182    // redraw the display 
     
    138188    try { 
    139189      // get the table body 
    140       var rdTableBody = document.getElementById(this.tableId).tBodies[0]; 
     190      var rdTableBody = document.getElementById(tableId).tBodies[0]; 
    141191 
    142192      // remove existing rows 
    143       for (i = rdTableBody.rows.length - 1; i >= 0; i--) { 
     193      for (i = rdTableBody.rows.length - 1; i >= numHeaderRows; i--) { 
    144194        rdTableBody.deleteRow(i); 
    145195      } 
    146196 
     197      dates.sort(sortCompare); 
     198 
    147199      // recreate the table rows 
    148       for (var j = 0; j < rdates.length; j++) { 
    149         var curRdate = rdates[j]; 
    150         var tr = rdTableBody.insertRow(j); 
    151  
    152         curRdate.toFormRow(this.reqPar, tr, j); 
     200      for (var j = 0; j < dates.length; j++) { 
     201        var curRdate = dates[j]; 
     202        var tr = rdTableBody.insertRow(j + numHeaderRows); 
     203 
     204        curRdate.toFormRow(varName, reqPar, tr, j); 
     205      } 
     206 
     207      if (dates.length == 0) { 
     208        changeClass(tableId, invisibleClass); 
     209        changeClass(noDatesId, visibleClass); 
     210      } else { 
     211        changeClass(tableId, visibleClass); 
     212        changeClass(noDatesId, invisibleClass); 
    153213      } 
    154214    } catch (e) {