Changeset 1369

Show
Ignore:
Timestamp:
10/10/06 23:22:17 (4 days ago)
Author:
bobbysmith007
Message:

TimingAndEstimationPlugin:

Working toward postegres compatibility. Removed square brackets and an instance of the sqlite strftime

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • timingandestimationplugin/trunk/timingandestimationplugin/api.py

    r1365 r1369  
    11import re 
    22import dbhelper 
     3import time 
    34from ticket_daemon import * 
    45from usermanual import * 
     
    243244 
    244245    def do_user_man_update(self): 
     246        when = int(time.time()) 
    245247        sql = """ 
    246248        INSERT INTO wiki (name,version,time,author,ipnr,text,comment,readonly) 
    247         VALUES ( %s, %s, strftime('%%s', 'now', 'unixepoch', 'localtime'), 'Timing and Estimation Plugin', '127.0.0.1', %s,'',0) 
     249        VALUES ( %s, %s, %s, 'Timing and Estimation Plugin', '127.0.0.1', %s,'',0) 
    248250        """ 
    249251        dbhelper.execute_non_query(self.env.get_db_cnx(),sql, 
    250252                                   user_manual_wiki_title, 
    251253                                   user_manual_version, 
     254                                   when, 
    252255                                   user_manual_content) 
    253256             
  • timingandestimationplugin/trunk/timingandestimationplugin/reports.py

    r1283 r1369  
    99    "title":"Ticket Work Summary", 
    1010    "reportnumber":None, 
    11     "version":3
     11    "version":4
    1212    "sql":""" 
    1313SELECT ticket as __group__,__style__, ticket,  
    14 newvalue as [Hours-added], time as _time, strtime as [Time-Entered]
     14newvalue as Hours_added, time as _time, strtime as Time_Entered
    1515 _ord 
    1616FROM( 
     
    5454    "title":"Milestone Work Summary", 
    5555    "reportnumber":None, 
    56     "version":3
     56    "version":4
    5757    "sql":""" 
    5858SELECT  
     
    6161  ticket, 
    6262  summary, 
    63   newvalue as [Hours-added]
     63  newvalue as Hours_added
    6464  time as _time, 
    65   strtime as [Last-Updated]
     65  strtime as Last_Updated
    6666 _ord 
    6767FROM( 
     
    114114    "title":"Developer Work Summary", 
    115115    "reportnumber":None, 
    116     "version":3
     116    "version":4
    117117    "sql":""" 
    118118SELECT author as __group__,__style__, ticket,  
    119 newvalue as [Hours-added], time as _time, strtime as [Time-Entered]
     119newvalue as Hours_added, time as _time, strtime as Time_Entered
    120120 _ord 
    121121FROM( 
     
    160160    "title": "Ticket Hours", 
    161161    "reportnumber": None, 
    162     "version":2
     162    "version":3
    163163    "sql": """ 
    164164SELECT __color__,  __style__,  ticket, summary_, component ,version, severity, 
    165  milestone, status, owner, [Estimated-hours], [total-hours], billable 
     165 milestone, status, owner, Estimated_hours, total_hours, billable 
    166166--,created,  modified,         -- ## Dates are formatted 
    167167-- _description_,                    -- ## Uses a full row 
     
    175175       t.id AS ticket, summary AS summary_,             -- ## Break line here 
    176176       component,version, severity, milestone, status, owner, 
    177        EstimatedHours.value as [Estimated-hours]
    178        totalhours.value as [total-hours],  
     177       EstimatedHours.value as Estimated_hours
     178       totalhours.value as total_hours,  
    179179       CASE WHEN billable.value = 1 THEN 'Y' 
    180180            else 'N' 
     
    206206       '' as ticket, 'Time Summary' AS summary_,              
    207207       '' as component,'' as version, '' as severity, '' as  milestone, '' as status, '' as owner, 
    208        SUM(EstimatedHours.value) as [Estimated-hours]
    209        SUM(totalhours.value) as [total-hours]
     208       SUM(EstimatedHours.value) as Estimated_hours
     209       SUM(totalhours.value) as total_hours
    210210       '' as billable, 
    211211       '' as created, '' as modified,         -- ## Dates are formatted 
     
    237237    "title": "Ticket Hours with Description", 
    238238    "reportnumber": None, 
    239     "version":2
     239    "version":3
    240240    "sql": """ 
    241241SELECT __color__,  __style__,  ticket, summary_, component ,version, severity, 
    242  milestone, status, owner, [Estimated-hours], [total-hours], billable 
     242 milestone, status, owner, Estimated_hours, total_hours, billable 
    243243--,created,  modified,         -- ## Dates are formatted 
    244244,_description_ 
     
    252252       t.id AS ticket, summary AS summary_,             -- ## Break line here 
    253253       component,version, severity, milestone, status, owner, 
    254        EstimatedHours.value as [Estimated-hours]
    255        totalhours.value as [total-hours],  
     254       EstimatedHours.value as Estimated_hours
     255       totalhours.value as total_hours,  
    256256       CASE WHEN billable.value = 1 THEN 'Y' 
    257257            else 'N' 
     
    283283       '' as ticket, 'Time Summary' AS summary_,              
    284284       '' as component,'' as version, '' as severity, '' as  milestone, '' as status, '' as owner, 
    285        SUM(EstimatedHours.value) as [Estimated-hours]
    286        SUM(totalhours.value) as [total-hours]
     285       SUM(EstimatedHours.value) as Estimated_hours
     286       SUM(totalhours.value) as total_hours
    287287       '' as billable, 
    288288       '' as created, '' as modified,         -- ## Dates are formatted 
     
    315315    "title":"Ticket Hours Grouped By Component", 
    316316    "reportnumber":None, 
    317     "version":2
     317    "version":3
    318318    "sql": """ 
    319319SELECT __color__, __group__, __style__,  ticket, summary_, component ,version, severity, 
    320  milestone, status, owner, [Estimated-hours], [total-hours], billable 
     320 milestone, status, owner, Estimated_hours, total_hours, billable 
    321321--,created,  modified,         -- ## Dates are formatted 
    322322-- _description_,                    -- ## Uses a full row 
     
    331331       t.id AS ticket, summary AS summary_,             -- ## Break line here 
    332332       component,version, severity, milestone, status, owner, 
    333        EstimatedHours.value as [Estimated-hours]
    334        totalhours.value as [total-hours],  
     333       EstimatedHours.value as Estimated_hours
     334       totalhours.value as total_hours,  
    335335       CASE WHEN billable.value = 1 THEN 'Y' 
    336336            else 'N' 
     
    363363       '' as ticket, 'Time Summary' AS summary_,              
    364364       t.component as component,'' as version, '' as severity, '' as  milestone, '' as status, '' as owner, 
    365        SUM(EstimatedHours.value) as [Estimated-hours]
    366        SUM(totalhours.value) as [total-hours]
     365       SUM(EstimatedHours.value) as Estimated_hours
     366       SUM(totalhours.value) as total_hours
    367367       '' as billable, 
    368368       '' as created, '' as modified,         -- ## Dates are formatted 
     
    396396    "title":"Ticket Hours Grouped By Component with Description", 
    397397    "reportnumber":None, 
    398     "version":2
     398    "version":3
    399399    "sql": """ 
    400400SELECT __color__, __group__, __style__,  ticket, summary_, component ,version, severity, 
    401  milestone, status, owner, [Estimated-hours], [total-hours], billable 
     401 milestone, status, owner, Estimated_hours, total_hours, billable 
    402402--,created,  modified         -- ## Dates are formatted 
    403403,_description_                    -- ## Uses a full row 
     
    412412       t.id AS ticket, summary AS summary_,             -- ## Break line here 
    413413       component,version, severity, milestone, status, owner, 
    414        EstimatedHours.value as [Estimated-hours]
    415        totalhours.value as [total-hours],  
     414       EstimatedHours.value as Estimated_hours
     415       totalhours.value as total_hours,  
    416416       CASE WHEN billable.value = 1 THEN 'Y' 
    417417            else 'N' 
     
    444444       '' as ticket, 'Time Summary' AS summary_,              
    445445       t.component as component,'' as version, '' as severity, '' as  milestone, '' as status, '' as owner, 
    446        SUM(EstimatedHours.value) as [Estimated-hours]
    447        SUM(totalhours.value) as [total-hours]
     446       SUM(EstimatedHours.value) as Estimated_hours
     447       SUM(totalhours.value) as total_hours
    448448       '' as billable, 
    449449       '' as created, '' as modified,         -- ## Dates are formatted 
     
    476476    "title":"Ticket Hours Grouped By Milestone", 
    477477    "reportnumber":None, 
    478     "version":2
     478    "version":3
    479479    "sql": """ 
    480480SELECT __color__, __group__, __style__,  ticket, summary_, component ,version, severity, 
    481  milestone, status, owner, [Estimated-hours], [total-hours], billable 
     481 milestone, status, owner, Estimated_hours, total_hours, billable 
    482482--,created,  modified,         -- ## Dates are formatted 
    483483--,_description_                    -- ## Uses a full row 
     
    492492       t.id AS ticket, summary AS summary_,             -- ## Break line here 
    493493       component,version, severity, milestone, status, owner, 
    494        EstimatedHours.value as [Estimated-hours]
    495        totalhours.value as [total-hours],  
     494       EstimatedHours.value as Estimated_hours
     495       totalhours.value as total_hours,  
    496496       CASE WHEN billable.value = 1 THEN 'Y' 
    497497            else 'N' 
     
    524524       '' as ticket, 'Time Summary' AS summary_,              
    525525       '' as component,'' as version, '' as severity, t.milestone as  milestone, '' as status, '' as owner, 
    526        SUM(EstimatedHours.value) as [Estimated-hours]
    527        SUM(totalhours.value) as [total-hours]
     526       SUM(EstimatedHours.value) as Estimated_hours
     527       SUM(totalhours.value) as total_hours
    528528       '' as billable, 
    529529       '' as created, '' as modified,         -- ## Dates are formatted 
     
    556556    "title":"Ticket Hours Grouped By MileStone with Description", 
    557557    "reportnumber":None, 
    558     "version":2
     558    "version":3
    559559    "sql": """ 
    560560SELECT __color__, __group__, __style__,  ticket, summary_, component ,version, severity, 
    561  milestone, status, owner, [Estimated-hours], [total-hours], billable 
     561 milestone, status, owner, Estimated_hours, total_hours, billable 
    562562--,created,  modified,         -- ## Dates are formatted 
    563563,_description_                    -- ## Uses a full row 
     
    572572       t.id AS ticket, summary AS summary_,             -- ## Break line here 
    573573       component,version, severity, milestone, status, owner, 
    574        EstimatedHours.value as [Estimated-hours]
    575        totalhours.value as [total-hours],  
     574       EstimatedHours.value as Estimated_hours
     575       totalhours.value as total_hours,  
    576576       CASE WHEN billable.value = 1 THEN 'Y' 
    577577            else 'N' 
     
    604604       '' as ticket, 'Time Summary' AS summary_,              
    605605       '' as component,'' as version, '' as severity, t.milestone as  milestone, '' as status, '' as owner, 
    606        SUM(EstimatedHours.value) as [Estimated-hours]
    607        SUM(totalhours.value) as [total-hours]
     606       SUM(EstimatedHours.value) as Estimated_hours
     607       SUM(totalhours.value) as total_hours
    608608       '' as billable, 
    609609       '' as created, '' as modified,         -- ## Dates are formatted 
  • timingandestimationplugin/trunk/timingandestimationplugin/webui.py

    r1365 r1369  
    8080        billing_dates = [] 
    8181        billing_time_sql = """ 
    82         SELECT DISTINCT time as value, str_value as [text] 
     82        SELECT DISTINCT time as value, str_value as text 
    8383        FROM bill_date 
    8484        """ 
     
    8787            billing_info = {'text':text , 'value':value} 
    8888            billing_dates.extend([billing_info]) 
    89         self.log.debug("bill-dates: %s"%billing_dates) 
     89        #self.log.debug("bill-dates: %s"%billing_dates) 
    9090        req.hdf['billing_info.billdates'] = billing_dates 
    9191