# ticket_change

author: anonymous
field: comment
oldvalue: 1
newvalue:
  {{{
  #!html
  <a href="http://www.1webspace.biz/furniture/furniture-search/index.html">Furniture</a>
  <a href="http://www.1webspace.biz/furniture/furniture-search/index1.html">Ashley Furniture Store</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/furniture-store.htm">Furniture Store</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/office-furniture.htm">Office Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/ashley-furniture.htm">Ashley Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/bedroom-furniture.htm"> Bedroom Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/patio-furniture.htm">Patio Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/value-city-furniture.htm">Value City Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/furniture-dealer-new.htm">Furniture Dealer New</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/kid-furniture.htm">Kid Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/outdoor-furniture.htm Outdoor"> Furniture</a> 
  <a href="http://www.1webspace.biz/furniture/furniture-search/map.html">Furniture Search!</a> 
  }}}


# report

title: Active Tickets
description:
  * List all active tickets by priority.
  * Color each row based on priority.

query:
  SELECT p.value AS __color__,
     id AS ticket, summary, component, version, milestone, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY p.value, milestone, t.type, time


title: Active Tickets by Version
query:
  SELECT p.value AS __color__,
     version AS __group__,
     id AS ticket, summary, component, version, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (version IS NULL),version, p.value, t.type, time

description:
  This report shows how to color results by priority,
  while grouping results by version.

  Last modification time, description and reporter are included as hidden fields
  for useful RSS export.


title: Active Tickets by Milestone
query:
  SELECT p.value AS __color__,
     milestone||' Release' AS __group__,
     id AS ticket, summary, component, version, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (milestone IS NULL),milestone, p.value, t.type, time

description:
  This report shows how to color results by priority,
  while grouping results by milestone.

  Last modification time, description and reporter are included as hidden fields
  for useful RSS export.


title: Assigned, Active Tickets by Owner
description: List assigned tickets, group by ticket owner, sorted by priority.
query:
  SELECT p.value AS __color__,
     owner AS __group__,
     id AS ticket, summary, component, milestone, t.type AS type, time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status = 'assigned'
    ORDER BY owner, p.value, t.type, time


title: Assigned, Active Tickets by Owner (Full Description)
query:
  SELECT p.value AS __color__,
     owner AS __group__,
     id AS ticket, summary, component, milestone, t.type AS type, time AS created,
     description AS _description_,
     changetime AS _changetime, reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status = 'assigned'
    ORDER BY owner, p.value, t.type, time

description:
  List tickets assigned, group by ticket owner.
  This report demonstrates the use of full-row display.


title: All Tickets By Milestone (Including closed)
description: A more complex example to show how to make advanced reports.
query:
  SELECT p.value AS __color__,
     t.milestone AS __group__,
     (CASE status 
        WHEN 'closed' THEN 'color: #777; background: #ddd; border-color: #ccc;'
        ELSE 
          (CASE owner WHEN $USER THEN 'font-weight: bold' END)
      END) AS __style__,
     id AS ticket, summary, component, status, 
     resolution,version, t.type AS type, priority, owner,
     changetime AS modified,
     time AS _time,reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), 
          (CASE status WHEN 'closed' THEN modified ELSE (-1)*p.value END) DESC


title: My Tickets
query:
  SELECT p.value AS __color__,
     (CASE status WHEN 'assigned' THEN 'Assigned' ELSE 'Owned' END) AS __group__,
     id AS ticket, summary, component, version, milestone,
     t.type AS type, priority, time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE t.status <> 'closed' AND owner = $USER
    ORDER BY (status = 'assigned') DESC, p.value, milestone, t.type, time

description:
  This report demonstrates the use of the automatically set 
  USER dynamic variable, replaced with the username of the
  logged in user when executed.


title: Active Tickets, Mine first
query:
  SELECT p.value AS __color__,
     (CASE owner 
       WHEN $USER THEN 'My Tickets' 
       ELSE 'Active Tickets' 
      END) AS __group__,
     id AS ticket, summary, component, version, milestone, t.type AS type, 
     owner, status,
     time AS created,
     changetime AS _changetime, description AS _description,
     reporter AS _reporter
    FROM ticket t
    LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
    WHERE status <> 'closed' 
    ORDER BY (owner = $USER) DESC, p.value, milestone, t.type, time

description:
   * List all active tickets by priority.
   * Show all tickets owned by the logged in user in a group first.


# uwawidget

ts: 1189712922
url: http://www.netvibes.com/api/uwa/examples/digg.html
title: Digg
body: <p>DIGG is Loading ...</p>
style:
  .diggCount {
  width:35px;
  text-align:center;
  font-size:11px;
  background:#FFF299 url(http://www.netvibes.com/modules/digg/digg-box-1-shade-5.gif);
  background-position:1px 1px;
  color:#666;
  }
  .diggCount strong {
  font-weight:bold;
  color:black;
  }
  .diggCount span {
  padding:5px 0;
  display:block;
  background: url(http://www.netvibes.com/modules/digg/digg-box-1-shade-5.gif) bottom right;
  }
  .diggIt {
  font-size:10px;
  color:#0066CC;
  border-color:#0066CC;
  }
  .diggTitle {
  font-weight:bold;
  font-size:12px;
  color:#0066CC !important;
  border-color:#0066CC;
  }

script:
  /* DIGG libary */

  var DIGG = {

    xml: false,
    
    items: [],
    
    query: null,
    
    offset: null,

    parse: function(xml) {
      widget.log('DIGG_parse');
      this.updateTitle();
      this.items = [];
      if(xml) this.xml = xml;
      var entries = this.xml.getElementsByTagName("item");
      var countItem = 0;
      for(var i=0; i < entries.length; i++) {
        var entry = entries[i];
        var title = entry.getElementsByTagName("title")[0].firstChild.nodeValue;
        var description = entry.getElementsByTagName("description")[0].firstChild.nodeValue;
        var link = entry.getElementsByTagName("link")[0].firstChild.nodeValue;
        var diggCounts = entry.getElementsByTagName("diggCount"); // getElementByTagNameNS
        if(!diggCounts[0]) diggCounts = entry.getElementsByTagName("digg:diggCount");
        if(diggCounts) var count = diggCounts[0].firstChild.nodeValue; else var count = 'X';
        if(this.query != null || parseInt(count) >= parseInt(widget.getValue('minimal')) ) { 
            var display = true;
        } else {
            var display = false;
        }
        if(this.query != null
            && title.toLowerCase().indexOf(this.query.toLowerCase()) == -1  
            && description.toLowerCase().indexOf(this.query.toLowerCase()) == -1 ) {  
          display = false;
        }
        if(display == true) { 
          var item = { title: title, description: description, link: link, count: count };
          this.items.push(item);
          countItem++;
        }
      }
      if(this.query != null) {
         widget.setSearchResultCount(countItem);
      }
      this.show();
    },

    getContent: function() {
      widget.log('DIGG_renderer');
      if(this.items.length == 0) {
        return '<p>No Digg news</p>';
      }
      if(widget.getValue('openlinks') == 'true') var target = 'target="_blank"'; else var target = '';
      var content = '<table>';
      var j = 0;
      for(var i = this.offset; i < this.items.length; i++) {
        var item = this.items[i];
        var displayTitle = item.title;
        var displaydescription = item.description;
        // highlighting
        if(this.query != null) {
    		displayTitle = String.highlight(displayTitle, this.query);
    		displaydescription = String.highlight(displaydescription, this.query);			
    	}
        content +=
          '<tr>' +
            '<td style="padding:0 5px 10px 0" align="center" valign="top">' +
              '<div class="diggCount"><span><strong>' + item.count + '</strong><br />diggs</span></div>' +
            '</td>' +
            '<td style="padding:0 5px 10px" valign="top">' + 
              '<a ' + target + ' class="diggTitle" href="' + item.link + '">' + displayTitle + '</a>' +
              '<br />' +
              displaydescription +
            '</td>' +
          '</tr>';
        j++;
        if(j == widget.getValue('limit') ) break
      }
      content += '</table>';
      return content;
    },

    show: function() { 
      widget.log('DIGG_show');
      if(this.offset == null) this.offset = widget.getValue('offset');
      if(!this.offset || this.offset < 0) { this.setOffset(0); }
      var openlinks = widget.getValue('openlinks');
      var limit = widget.getValue('limit');
      var content = this.getContent();
      widget.setBody(content);
      var pager = new UWA.Controls.Pager( { module: this, limit: limit, offset: this.offset, dataArray: this.items } );
      pager.onChange = function(newOffset) {
          this.module.setOffset(newOffset);
          this.module.show();
      }
      widget.addBody( pager.getContent() );
    },

    updateTitle: function() {
      var title = '<a href="http://digg.com/" target="_blank">' + 'Digg</a>';
      var minimal = widget.getValue('minimal');
       var category = widget.getValue('category');
      if(this.query) {
        title += '<em> - ' + _("search") + ' : ' + this.query + '</em>';
      } else if(category && category != 'all') {
        title += '<em> - ' + _("category") + ' : ' + category + '</em>';
      }
      if(minimal && minimal != 0) {
        title += ' - ' + _("%s diggs minimum").s(minimal);
      }
      widget.setTitle(title);
    },
    
    setOffset: function(offset) {
      this.offset = offset;
      if(this.query == null) widget.setValue('offset', offset);
    },
    
    getRssUrl: function(offset) {
      var category = widget.getValue('category');
      if(DIGG.query && DIGG.extended) {
        var rssUrl = 'http://digg.com/rss_search?search='+(DIGG.query)+'&area=all&type=both&age=all'
      } else if(!category || category == 'all') {
        var rssUrl = 'http://digg.com/rss/index.xml';
      } else if(category == 'technology' || category == 'science' || category == 'world_business' || category == 'videos' || category == 'entertainment' || category == 'gaming') {
        var rssUrl = 'http://digg.com/rss/container'+category+'.xml';
      } else {
        var rssUrl = 'http://digg.com/rss/index'+category+'.xml';
      }
      return rssUrl;
    }
    
  }

  /* wigdet bindings */

  widget.onLoad =  function() {
    DIGG.updateTitle();
    UWA.Data.getXml(DIGG.getRssUrl(), DIGG.parse.bind(DIGG) );
  }

  widget.onSearch = function(query, extended) {
      DIGG.offset = 0;
      DIGG.query = query;
      if(extended) {
        DIGG.extended = true;
        widget.onLoad();
      } else if(DIGG.extended) {
        DIGG.extended = null;
        widget.onLoad();
      } else {
        widget.reParse();
      }
  }

  widget.onResetSearch = function() {
      DIGG.offset = widget.getValue('offset');
      DIGG.query = null;
      if(DIGG.extended) {
        DIGG.extended = null;
        widget.onLoad();
      } else {
        widget.reParse();
      }
  }

  widget.onRefresh = function() {
    widget.setBody( _("Loading ...") );
    widget.onLoad();
  }

  widget.reParse = function() {
    if(DIGG.xml) DIGG.parse(); else widget.onLoad();
  }

  widget.rePaint = function() {
    if(DIGG.xml) DIGG.show(); else widget.onLoad();
  }

  widget.onKeyboardAction = function(key) {
    var limit = widget.getValue('limit');
    var offset = widget.getValue('offset');
    var minimal = widget.getValue('minimal');
    if( offset < (DIGG.items.length - limit) && (key == 'n' || key == 'right') ) {
      DIGG.setOffset(parseInt(offset) + parseInt(limit));
      DIGG.show();
    } else if(offset > 0 && (keyCode == 'p' || key == 'left') ) {
      DIGG.setOffset(parseInt(offset) - parseInt(limit));
      DIGG.show();
    } else if(minimal < 1000 && key == 'up') {
      widget.setValue('minimal', parseInt(minimal) + 100);
      DIGG.parse();
    } else if(minimal > 0 && key == 'down') {
      widget.setValue('minimal', parseInt(minimal) - 100);
      DIGG.parse();
    } else if(key >= '0' && key <= '9') {
      widget.setValue('limit', Number(keyCode));
      DIGG.show();
    }
  }


ts: 1189712923
url: http://www.netvibes.com/api/uwa/examples/rssreader.html
title: RSS Reader
body: <p>Loading ...</p>
script:
  var RSSReader = {}

  RSSReader.feed = false;

  RSSReader.display = function(feed) {
      
      widget.log('RSSReader.display');
      
      if(feed) RSSReader.feed = feed;
      
      widget.preferences[1].max = RSSReader.feed.items.length; // little cool hack ;-)
      
      var feedList = widget.createElement('ul');
      feedList.className = 'nv-feedList';
      
      var j = 0;
      
      var search = widget.getValue('search');
      
      for(var i=0; i < RSSReader.feed.items.length; i++) {

          if(j >= widget.getValue('nbTitles')) break;
          
          var item = RSSReader.feed.items[i];
          var li = widget.createElement('li');
          var a = widget.createElement('a');
          a.href = item.link;
          a.target = '_blank';
          var displayTitle = item.title;
          if(search != '') {
              displayTitle = String.highlight(displayTitle, search);
          }
          a.innerHTML = displayTitle;
          
          var title = item.content.stripTags().truncate(255);
          
          a.desc = title;
          a.onmouseover = function() {
              UWA.Utils.setTooltip(this, this.desc, 250);
          }
          li.appendChild(a);
          
          var display = true;
          
          if( search != '' ) {
            if( RSSReader.searchInString(search, item.title) == false && RSSReader.searchInString(search, item.content) == false )
              display = false;
          }
          
          if(display) { feedList.appendChild(li); j++; }
          
      }
      if(widget.getValue('search') != '') {
           widget.setSearchResultCount(j);
      }
      widget.setBody(feedList);
  }

  RSSReader.searchInString = function(query, str) {
    var test = str.toLowerCase().indexOf( query.toLowerCase() );
    if( test != -1 ) return true
    return false;
  }

  widget.onLoad = function() {
    widget.log('RSSReader.onLoad');
    UWA.Data.getFeed(widget.getValue('feedUrl'), RSSReader.display);
  }

  widget.onRefresh = widget.onLoad;

  widget.data.search = ''; // Reset search when the module load

  widget.onSearch = function(query) {
    widget.log('RSSReader.onSearch');
    widget.setValue('search', query);
    if(RSSReader.feed) RSSReader.display();
  }

  widget.onResetSearch = function() {
    widget.log('RSSReader.onResetSearch');
    widget.setValue('search', '');
    if(RSSReader.feed) RSSReader.display();
  }


ts: 1189712923
url: http://dev.coderanger.net/rssreader.html
title: RSS Reader
body: <p>Loading ...</p>
script:
  var RSSReader = {}

  RSSReader.feed = false;

  RSSReader.display = function(feed) {
      
      widget.log('RSSReader.display');
      
      if(feed) RSSReader.feed = feed;
      
      widget.preferences[1].max = RSSReader.feed.items.length; // little cool hack ;-)
      
      var feedList = widget.createElement('ul');
      feedList.className = 'nv-feedList';
      
      var j = 0;
      
      var search = widget.getValue('search');
      
      for(var i=0; i < RSSReader.feed.items.length; i++) {
          console.log('i = '+i)

          if(j >= widget.getValue('limit')) break;
          
          var item = RSSReader.feed.items[i];
          var li = widget.createElement('li');
          var a = widget.createElement('a');
          a.href = item.link;
          a.target = '_blank';
          var displayTitle = item.title;
          if(search != '') {
              displayTitle = String.highlight(displayTitle, search);
          }
          a.innerHTML = displayTitle;
          console.dir(item)
          var title = item.content.stripTags().truncate(255);
          console.debug('2')
          a.desc = title;
          a.onmouseover = function() {
              UWA.Utils.setTooltip(this, this.desc, 250);
          }
          li.appendChild(a);
          
          var display = true;
          
          if( search != '' ) {
            if( RSSReader.searchInString(search, item.title) == false && RSSReader.searchInString(search, item.content) == false )
              display = false;
          }
          
          if(display) { console.debug('adding'); feedList.appendChild(li); j++; }
          
      }
      if(widget.getValue('search') != '') {
           widget.setSearchResultCount(j);
      }
      widget.setBody(feedList);
  }

  RSSReader.searchInString = function(query, str) {
    var test = str.toLowerCase().indexOf( query.toLowerCase() );
    if( test != -1 ) return true
    return false;
  }

  widget.onLoad = function() {
    widget.log('RSSReader.onLoad 2');
    UWA.Data.getFeed(widget.getValue('url'), RSSReader.display);
  }

  widget.onRefresh = widget.onLoad;

  widget.data.search = ''; // Reset search when the module load

  widget.onSearch = function(query) {
    widget.log('RSSReader.onSearch');
    widget.setValue('search', query);
    if(RSSReader.feed) RSSReader.display();
  }

  widget.onResetSearch = function() {
    widget.log('RSSReader.onResetSearch');
    widget.setValue('search', '');
    if(RSSReader.feed) RSSReader.display();
  }


# uwawidget_meta

id: 1
type: prefs
key: limit
value:
  (dp0
  Vname
  p1
  Vlimit
  p2
  sVmin
  p3
  V1
  p4
  sVmax
  p5
  V25
  p6
  sVdefaultValue
  p7
  V3
  p8
  sVlabel
  p9
  VNumber of items to display
  p10
  sVstep
  p11
  V1
  p12
  sVonchange
  p13
  VrePaint
  p14
  sVtype
  p15
  Vrange
  p16
  s.


id: 1
type: prefs
key: minimal
value:
  (dp0
  Vname
  p1
  Vminimal
  p2
  sVmin
  p3
  V0
  p4
  sVmax
  p5
  V1000
  p6
  sVdefaultValue
  p7
  V0
  p8
  sVlabel
  p9
  VMinimum number of diggs
  p10
  sVstep
  p11
  V100
  p12
  sVonchange
  p13
  VreParse
  p14
  sVtype
  p15
  Vrange
  p16
  s.


id: 2
type: prefs
key: url
value:
  (dp0
  VdefaultValue
  p1
  Vhttp://feeds.feedburner.com/NetvibesDevBlog
  p2
  sVtype
  p3
  Vtext
  p4
  sVname
  p5
  Vurl
  p6
  sVlabel
  p7
  VURL
  p8
  s.


id: 2
type: prefs
key: limit
value:
  (dp0
  Vname
  p1
  Vlimit
  p2
  sVmin
  p3
  V1
  p4
  sVmax
  p5
  V25
  p6
  sVdefaultValue
  p7
  V10
  p8
  sVlabel
  p9
  VNumber of items to display
  p10
  sVstep
  p11
  V1
  p12
  sVtype
  p13
  Vrange
  p14
  s.


id: 2
type: prefs
key: feedUrl
value:
  (dp0
  VdefaultValue
  p1
  Vhttp://feeds.feedburner.com/NetvibesDevBlog
  p2
  sVtype
  p3
  Vtext
  p4
  sVname
  p5
  VfeedUrl
  p6
  sVlabel
  p7
  VURL
  p8
  s.


id: 2
type: prefs
key: nbTitles
value:
  (dp0
  Vname
  p1
  VnbTitles
  p2
  sVmin
  p3
  V1
  p4
  sVmax
  p5
  V25
  p6
  sVdefaultValue
  p7
  V10
  p8
  sVlabel
  p9
  VNumber of items to display
  p10
  sVstep
  p11
  V1
  p12
  sVtype
  p13
  Vrange
  p14
  s.


