From: Andrew V. <av...@us...> - 2005-03-10 18:05:33
|
Update of /cvsroot/mailmanager/mailmanager/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17167/www Modified Files: Tag: db-backend Tickets.zpt master.zpt Log Message: Some early experiments. Produces a working Tickets screen which can be sorted and viewed by status or assigned user. Requires the FileSystemSite product and a PostgreSQL connection called mailmanager_db Index: Tickets.zpt =================================================================== RCS file: /cvsroot/mailmanager/mailmanager/www/Tickets.zpt,v retrieving revision 1.40 retrieving revision 1.40.2.1 diff -u -d -r1.40 -r1.40.2.1 --- Tickets.zpt 23 Dec 2004 23:11:42 -0000 1.40 +++ Tickets.zpt 10 Mar 2005 18:05:17 -0000 1.40.2.1 @@ -8,7 +8,7 @@ view request/SESSION/view | string:all; svd python:test(view=='search', request.SESSION.get('search', {}), request.SESSION); sort_on svd/sort_on | string:id; - sort_order svd/sort_order | string:descending; + sort_order svd/sort_order | string:desc; results python:here.listTickets(request); num_tickets python:len(results); start python:max(min(int(request.SESSION.get('start', 0)), num_tickets-1), 0) / here.batch_size * here.batch_size; @@ -160,7 +160,7 @@ <a href="setSort?column=id"> <tal:i18n i18n:translate="ticket">Ticket</tal:i18n> <img tal:condition="python:sort_on == 'id'" - tal:attributes="src python:test(sort_order=='ascending', + tal:attributes="src python:test(sort_order=='asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -172,7 +172,7 @@ <a href="setSort?column=status"> <tal:i18n i18n:translate="status">Status </tal:i18n><img tal:condition="python:sort_on == 'status'" - tal:attributes="src python:test(sort_order=='ascending', + tal:attributes="src python:test(sort_order=='asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -184,7 +184,7 @@ <a href="setSort?column=assigned"> <tal:i18n i18n:translate="assigned">Assigned</tal:i18n> <img tal:condition="python:sort_on == 'assigned'" - tal:attributes="src python:test(sort_order=='ascending', + tal:attributes="src python:test(sort_order=='asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -193,10 +193,10 @@ </td> <td id="table_head_nav" tal:condition="here/display_column/title"> - <a href="setSort?column=title"> + <a href="setSort?column=subject"> <tal:i18n i18n:translate="subject">Subject</tal:i18n> <img - tal:condition="python:sort_on == 'title'" - tal:attributes="src python:test(sort_order=='ascending', + tal:condition="python:sort_on == 'subject'" + tal:attributes="src python:test(sort_order=='asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -205,9 +205,9 @@ </td> <td id="table_head_nav" tal:condition="here/display_column/from_name"> - <a href="setSort?column=from_name_words"> - <tal:i18n i18n:translate="from">From</tal:i18n> <img tal:condition="python:sort_on == 'from_name_words'" - tal:attributes="src python:test(sort_order == 'ascending', + <a href="setSort?column=from_name"> + <tal:i18n i18n:translate="from">From</tal:i18n> <img tal:condition="python:sort_on == 'from_name'" + tal:attributes="src python:test(sort_order == 'asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -219,7 +219,7 @@ <a href="setSort?column=date_opened"> <tal:i18n i18n:translate="time">TIME</tal:i18n> <img tal:condition="python:sort_on == 'date_opened'" - tal:attributes="src python:test(sort_order == 'ascending', + tal:attributes="src python:test(sort_order == 'asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -231,7 +231,7 @@ <a href="setSort?column=date_opened"> <tal:i18n i18n:translate="date">Date</tal:i18n> <img tal:condition="python:sort_on == 'date_opened'" - tal:attributes="src python:test(sort_order == 'ascending', + tal:attributes="src python:test(sort_order == 'asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -243,7 +243,7 @@ <a href="setSort?column=priority"> <tal:i18n i18n:translate="priority">Priority</tal:i18n> <img tal:condition="python:sort_on == 'priority'" - tal:attributes="src python:test(sort_order=='ascending', + tal:attributes="src python:test(sort_order=='asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" @@ -256,7 +256,7 @@ <span tal:replace="python:here.category_labels[cat]"> Category </span> <img tal:condition="python:sort_on == 'category%d' % cat" - tal:attributes="src python:test(sort_order=='ascending', + tal:attributes="src python:test(sort_order=='asc', 'images/arrow_up.gif', 'images/arrow_down.gif'); alt python:sort_order.capitalize()" height="7" width="9" border="0" hspace="5" /> @@ -274,58 +274,58 @@ tal:attributes="value ticket/id" /> </td> <td tal:condition="here/display_column/ticket_id"> - <a tal:attributes="href ticket/getURL" - tal:content="ticket/id"> + <a tal:attributes="href ticket/id" + tal:content="python:'%06d' % ticket.id"> 000004 </a> </td> <td tal:condition="here/display_column/status"> - <a tal:define="stat python:here.displayStatus(ticket['respond_by'], ticket['status'], ticket['responded_on_time'])" - tal:attributes="href ticket/getURL"> + <a tal:define="stat ticket/status" + tal:attributes="href ticket/id"> <img tal:attributes="src string:images/status_$stat.gif; alt stat" height="15" width="57" border="0" /> </a> </td> <td tal:condition="here/display_column/assigned"> - <a tal:attributes="href ticket/getURL" + <a tal:attributes="href ticket/id" tal:content="ticket/assigned"> Assigned </a> </td> <td tal:condition="here/display_column/title"> - <a tal:attributes="href ticket/getURL" - tal:content="ticket/title"> + <a tal:attributes="href ticket/id" + tal:content="ticket/subject"> Subject </a> </td> <td tal:condition="here/display_column/from_name"> - <a tal:attributes="href ticket/getURL" + <a tal:attributes="href ticket/id" tal:content="ticket/from_name"> From </a> </td> <td tal:condition="here/display_column/time"> - <a tal:attributes="href ticket/getURL" + <a tal:attributes="href ticket/id" tal:content="python:here.displayTime('%H:%M', ticket.date_opened.timeTime())"> 12:45 </a> </td> <td tal:condition="here/display_column/date"> - <a tal:attributes="href ticket/getURL" + <a tal:attributes="href ticket/id" tal:content="python:here.displayTime(here.dateFormat(), ticket.date_opened.timeTime())"> 11.07.72 </a> </td> <td tal:condition="here/display_column/priority"> - <a tal:attributes="href ticket/getURL"> + <a tal:attributes="href ticket/id"> <img tal:repeat="dot python:range(ticket['priority'])" src="images/icon_priority.gif" height="10" width="10" border="0" alt="*" hspace="1" /> </a> </td> <td tal:repeat="cat python:[i for i in range(len(here.category_on)) if here.display_column['category%d' % i]]"> - <a tal:attributes="href ticket/getURL" + <a tal:attributes="href ticket/id" tal:content="python:getattr(ticket, 'category%d' % cat)"> Category </a> Index: master.zpt =================================================================== RCS file: /cvsroot/mailmanager/mailmanager/www/master.zpt,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -u -d -r1.30 -r1.30.2.1 --- master.zpt 25 Jan 2005 09:02:50 -0000 1.30 +++ master.zpt 10 Mar 2005 18:05:18 -0000 1.30.2.1 @@ -42,10 +42,10 @@ <option value=""> Show All </option> - <option tal:repeat="item python:sequence.sort(here.agents.keys())" - tal:attributes="value item; - selected python:assigned == item" - tal:content="item"> + <option tal:repeat="item here/sql/listUsers" + tal:attributes="value item/username; + selected python:item.username == assigned" + tal:content="item/username"> username </option> </select> |