Changeset 11770


Ignore:
Timestamp:
2006-05-04T16:03:35+12:00 (18 years ago)
Author:
kjdon
Message:

we still output documents even if can't get their date

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/datelistbrowserclass.cpp

    r11638 r11770  
    110110      begin++;
    111111    }
    112     //text_t &date = (*thissection).metadata[date_meta].values[0];
    113 
    114     // bail on this document if it has no date
    115     if (date.empty()) { ++thissection; continue; }
    116 
    117     text_t::const_iterator datebegin = date.begin();
    118     int datesize = date.size();
     112    text_t thisyear = "";
     113    text_t thismonth = "";
     114    if (!date.empty()) {
     115      text_t::const_iterator datebegin = date.begin();
     116      int datesize = date.size();
    119117   
    120     if (datesize < 4) { ++thissection; continue; }
    121     text_t thisyear = substr (datebegin, datebegin+4);
    122     text_t thismonth = "00";
    123     if (datesize >= 6)
    124       thismonth = substr (datebegin+4, datebegin+6);
    125 
     118      if (datesize >=4) {
     119    thisyear = substr (datebegin, datebegin+4);
     120    thismonth = "00";
     121    if (datesize >= 6)
     122      thismonth = substr (datebegin+4, datebegin+6);
     123      }
     124    }
     125   
    126126    text_t link = "<a href=\"_httpdocument_&cl=";
    127127    text_t icon = "_document:iconclosedbook_";
     
    143143    textout << outconvert << "<tr valign=top>";
    144144
    145     if (thisyear != lastyear) {
     145    if (thisyear != "" && thisyear != lastyear) {
    146146      textout << outconvert << "<td><span class=\"date_list_year\">" << thisyear << "</span></td>";
    147147      lastyear = thisyear;
    148     } else
     148    } else {
    149149      textout << outconvert << "<td></td>";
    150    
    151     if (thismonth != lastmonth) {
     150    }
     151    if (thismonth != "" && thismonth != lastmonth) {
    152152      textout << outconvert << disp << ("<td><span class=\"date_list_month\">_textmonth" + thismonth + "_</span></td>");
    153153      lastmonth = thismonth;
    154     } else
     154    } else {
    155155      textout << outconvert << "<td></td>";
    156    
     156    }
    157157    if (!use_table) textout << outconvert << "<td>\n";
    158158
Note: See TracChangeset for help on using the changeset viewer.