Changeset 743

Show
Ignore:
Timestamp:
01/31/08 21:16:37 (1 year ago)
Author:
markku
Message:

Closes #526.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/task_controller.rb

    r719 r743  
    1313class TaskController < ApplicationController 
    1414  prepend_before_filter :login_required 
     15  before_filter :get_task_for_viewing, :only => [:view, :print_view] 
    1516  skip_before_filter :check_new_service_requests, :only => :list_new_service_requests 
    1617  LOCK_DURATION = 1.hour 
     
    6869 
    6970  def view 
    70     begin 
    71       @task = Task.find(params[:id], :include => [:data_permissions, :asset, :creator, :responsible_user]) 
    72     rescue ActiveRecord::RecordNotFound 
    73       if params[:cmms_link] 
    74         redirect_with_error_message(msg_invalid_link_in_markup("{#{params[:id]}}"), :back) 
    75       else 
    76         redirect_with_error_message(msg_non_existing_data(Task, params[:id]), :action => 'list') 
    77       end 
    78       return 
    79     end 
    80  
    81     unless @task.authorized_to_read? 
    82       redirect_with_error_message(msg_unauthorized_operation(_('read'), "{#{@task.id}}"), :action => 'list') 
    83       return 
    84     end 
    85  
    8671    @wo_title = _('Task %s (%s)', @task.to_s, @task.task_type.name) 
    8772 
     
    424409  end 
    425410 
     411  # Method: print_view 
     412  # ================== 
     413  # Simple view for viewing and printing tasks. 
     414  # 
     415  require_key_for :print_view, 'task/view' 
     416  def print_view 
     417    @title = _('Task %s (%s)', @task.to_s, @task.task_type.name) 
     418    @hide_asset_information = (params[:hide_asset] == '1') 
     419    @hide_history = (params[:hide_history] == '1') 
     420    define_priority_options 
     421    render :layout => false 
     422  end 
     423 
    426424protected 
    427425 
     
    471469                ] 
    472470  end 
     471 
     472  # Method: get_task_for_viewing 
     473  # ============================ 
     474  # Find a task and set @task for viewing it. Unauthorized users are redirected. 
     475  # 
     476  def get_task_for_viewing 
     477    begin 
     478      @task = Task.find(params[:id], :include => [:data_permissions, :asset, :creator, :responsible_user]) 
     479 
     480      unless @task.authorized_to_read? 
     481        redirect_with_error_message(msg_unauthorized_operation(_('read'), "{#{@task.id}}"), :action => 'list') 
     482      end 
     483    rescue ActiveRecord::RecordNotFound 
     484      if params[:cmms_link] 
     485        redirect_with_error_message(msg_invalid_link_in_markup("{#{params[:id]}}"), :back) 
     486      else 
     487        redirect_with_error_message(msg_non_existing_data(Task, params[:id]), :action => 'list') 
     488      end 
     489    end 
     490  end 
    473491end 
  • trunk/app/helpers/application_helper.rb

    r721 r743  
    811811    return select_tag(name, option_tags, options) 
    812812  end 
     813 
     814  # Method: asset_field_value 
     815  # ========================= 
     816  # Format an asset field value for views. 
     817  # 
     818  def asset_field_value(field_value) 
     819    case field_value.asset_field.type_code 
     820      when AssetField::STRING 
     821        from_markup(field_value.value).gsub(/^<p>(.*)<\/p>$/, '\1') 
     822      when AssetField::BOOLEAN 
     823        field_value.value ? _('yes') : _('no') 
     824      when AssetField::TIME, AssetField::DATE, AssetField::DATETIME 
     825        h(format_date(field_value.value)) 
     826      else 
     827        h(field_value.value.to_s) 
     828    end 
     829  end 
    813830end 
  • trunk/app/views/asset/_view_table.rhtml

    r707 r743  
    3232      <th><div><%= h(field_value.asset_field.name) %></div></th> 
    3333      <td> 
    34         <%= 
    35           case field_value.asset_field.type_code 
    36             when AssetField::STRING 
    37               from_markup(field_value.value).gsub(/^<p>(.*)<\/p>$/, '\1') 
    38             when AssetField::BOOLEAN 
    39               field_value.value ? _('yes') : _('no') 
    40             when AssetField::TIME, AssetField::DATE, AssetField::DATETIME 
    41               h(format_date(field_value.value)) 
    42             else 
    43               h(field_value.value.to_s) 
    44           end 
    45         %> 
     34        <%= asset_field_value(field_value) %> 
    4635      </td> 
    4736    </tr> 
  • trunk/app/views/task/view.rhtml

    r729 r743  
    8282    <td><%= link_to(image_tag('16x16/download.png') + _('Download'), 
    8383                    {:action => 'download', :id => @task.id}) %></td> 
     84    <td><%= link_to(image_tag('16x16/print.gif') + _('Printer-friendly'), 
     85                    {:action => 'print_view', :id => @task.id}, :popup => true) %></td> 
    8486  </tr> 
    8587</table> 
  • trunk/po/fi_FI/norfello_cmms.po

    r740 r743  
    22msgstr "" 
    33"Project-Id-Version: NorfelloCMMS SVN trunk\n" 
    4 "POT-Creation-Date: 2008-01-17 16:06+0200\n" 
    5 "PO-Revision-Date: 2008-01-17 16:09+0200\n" 
     4"POT-Creation-Date: 2008-01-31 19:21+0200\n" 
     5"PO-Revision-Date: 2008-01-31 19:33+0200\n" 
    66"Last-Translator: Markku Oksanen <markku.oksanen@norfello.com>\n" 
    77"Language-Team: Norfello Ltd. <contact@norfello.com>\n" 
     
    751751 
    752752#: app/helpers/customer_interface_helper.rb:207 
    753 #: app/controllers/task_controller.rb:451 
     753#: app/controllers/task_controller.rb:449 
    754754#: app/controllers/overview_controller.rb:59 
    755755msgid "New" 
     
    757757 
    758758#: app/helpers/customer_interface_helper.rb:209 
    759 #: app/controllers/task_controller.rb:451 
     759#: app/controllers/task_controller.rb:449 
    760760#: app/controllers/overview_controller.rb:59 
    761761#: app/controllers/overview_controller.rb:65 
     
    764764 
    765765#: app/helpers/customer_interface_helper.rb:211 
    766 #: app/controllers/task_controller.rb:451 
     766#: app/controllers/task_controller.rb:449 
    767767#: app/controllers/overview_controller.rb:59 
    768768#: app/controllers/overview_controller.rb:65 
     
    771771 
    772772#: app/helpers/customer_interface_helper.rb:213 
    773 #: app/controllers/task_controller.rb:451 
     773#: app/controllers/task_controller.rb:449 
    774774#: app/controllers/overview_controller.rb:65 
    775775msgid "Closed" 
     
    897897#: app/views/task/_form.rhtml:96 
    898898#: app/views/task/_form.rhtml:98 
     899#: app/views/task/print_view.rhtml:69 
     900#: app/views/task/print_view.rhtml:71 
    899901#: app/views/task/create.rhtml:39 
    900902msgid "hours" 
     
    905907msgstr "minuuttia" 
    906908 
     909#: app/helpers/application_helper.rb:823 
     910msgid "yes" 
     911msgstr "kyllÀ" 
     912 
     913#: app/helpers/application_helper.rb:823 
     914msgid "no" 
     915msgstr "ei" 
     916 
    907917#: app/helpers/asset_field_helper.rb:52 
    908918#: app/helpers/asset_field_helper.rb:113 
    909 #: app/controllers/task_controller.rb:49 
    910 #: app/controllers/task_controller.rb:468 
     919#: app/controllers/task_controller.rb:50 
     920#: app/controllers/task_controller.rb:466 
    911921#: app/controllers/message_controller.rb:28 
    912922#: app/controllers/keyring_controller.rb:75 
     
    931941 
    932942#: app/controllers/asset_controller.rb:30 
     943#: app/views/task/print_view.rhtml:81 
    933944msgid "Asset information" 
    934945msgstr "Kohteen tiedot " 
     
    943954#: app/controllers/data_permission_controller.rb:53 
    944955#: app/controllers/data_permission_controller.rb:56 
    945 #: app/controllers/task_controller.rb:82 
     956#: app/controllers/task_controller.rb:481 
    946957#: app/controllers/attachment_controller.rb:68 
    947958#: app/controllers/asset_tree_controller.rb:125 
     
    958969#: app/controllers/customer_interface_controller.rb:164 
    959970#: app/controllers/form_controller.rb:479 
    960 #: app/controllers/task_controller.rb:42 
    961 #: app/controllers/task_controller.rb:51 
    962 #: app/controllers/task_controller.rb:283 
    963 #: app/controllers/task_controller.rb:461 
    964 #: app/controllers/task_controller.rb:470 
     971#: app/controllers/task_controller.rb:43 
     972#: app/controllers/task_controller.rb:52 
     973#: app/controllers/task_controller.rb:268 
     974#: app/controllers/task_controller.rb:459 
     975#: app/controllers/task_controller.rb:468 
    965976#: app/controllers/attachment_controller.rb:26 
    966977#: app/views/attachment/view.rhtml:4 
     
    10091020#: app/views/attachment/attach.rhtml:9 
    10101021#: app/views/asset_tree/search.rhtml:4 
     1022#: app/views/task/print_view.rhtml:90 
    10111023#: app/views/form_type/create_step2.rhtml:6 
    10121024#: app/views/form_type/create_step4.rhtml:9 
     
    10381050#: app/controllers/asset_controller.rb:104 
    10391051#: app/controllers/asset_controller.rb:348 
    1040 #: app/controllers/task_controller.rb:35 
     1052#: app/controllers/task_controller.rb:36 
    10411053#: app/controllers/asset_field_controller.rb:22 
    10421054#: app/controllers/asset_field_controller.rb:42 
     
    10541066#: app/controllers/asset_controller.rb:140 
    10551067#: app/controllers/asset_controller.rb:247 
     1068#: app/views/task/print_view.rhtml:86 
    10561069#: app/views/asset/_view_table.rhtml:16 
    10571070msgid "Code" 
     
    10601073#: app/controllers/asset_controller.rb:143 
    10611074#: app/controllers/asset_controller.rb:250 
     1075#: app/views/task/print_view.rhtml:95 
    10621076#: app/views/asset/_view_table.rhtml:25 
    10631077msgid "Customer" 
     
    10721086#: app/controllers/asset_type_controller.rb:46 
    10731087#: app/controllers/asset_type_controller.rb:56 
    1074 #: app/controllers/task_controller.rb:37 
    1075 #: app/controllers/task_controller.rb:459 
     1088#: app/controllers/task_controller.rb:38 
     1089#: app/controllers/task_controller.rb:457 
    10761090#: app/controllers/customer_controller.rb:51 
    10771091#: app/controllers/customer_controller.rb:78 
     
    10791093#: app/controllers/user_controller.rb:112 
    10801094#: app/views/task/_form.rhtml:108 
    1081 #: app/views/asset/_view_table.rhtml:51 
     1095#: app/views/task/print_view.rhtml:73 
     1096#: app/views/task/print_view.rhtml:112 
     1097#: app/views/asset/_view_table.rhtml:40 
    10821098msgid "Description" 
    10831099msgstr "Kuvaus" 
     
    10901106#: app/controllers/asset_controller.rb:182 
    10911107#: app/controllers/form_controller.rb:455 
    1092 #: app/controllers/task_controller.rb:323 
     1108#: app/controllers/task_controller.rb:308 
    10931109#: app/controllers/attachment_controller.rb:128 
    10941110#: app/controllers/type_attachment_controller.rb:120 
     
    11281144#: app/controllers/asset_controller.rb:315 
    11291145#: app/controllers/form_controller.rb:152 
    1130 #: app/controllers/task_controller.rb:164 
    1131 #: app/controllers/task_controller.rb:274 
    1132 #: app/controllers/task_controller.rb:306 
     1146#: app/controllers/task_controller.rb:149 
     1147#: app/controllers/task_controller.rb:259 
     1148#: app/controllers/task_controller.rb:291 
    11331149msgid "edit" 
    11341150msgstr "muokkaa" 
     
    17631779msgstr "Aikajana kohteelle %s" 
    17641780 
    1765 #: app/controllers/task_controller.rb:34 
    1766 #: app/controllers/task_controller.rb:457 
     1781#: app/controllers/task_controller.rb:35 
     1782#: app/controllers/task_controller.rb:455 
    17671783#: app/controllers/asset_type_icon_controller.rb:20 
    17681784msgid "ID" 
    17691785msgstr "ID" 
    17701786 
    1771 #: app/controllers/task_controller.rb:36 
    1772 #: app/controllers/task_controller.rb:458 
     1787#: app/controllers/task_controller.rb:37 
     1788#: app/controllers/task_controller.rb:456 
    17731789#: app/views/task/_form.rhtml:34 
    17741790msgid "State" 
    17751791msgstr "Tila" 
    17761792 
    1777 #: app/controllers/task_controller.rb:38 
     1793#: app/controllers/task_controller.rb:39 
    17781794#: app/views/task/_form.rhtml:79 
     1795#: app/views/task/print_view.rhtml:62 
    17791796#: app/views/task/create.rhtml:26 
    17801797msgid "Priority" 
    17811798msgstr "Prioriteetti" 
    17821799 
    1783 #: app/controllers/task_controller.rb:39 
     1800#: app/controllers/task_controller.rb:40 
    17841801msgid "Responsible worker" 
    17851802msgstr "Työn vastuuhenkilö" 
    17861803 
    1787 #: app/controllers/task_controller.rb:40 
     1804#: app/controllers/task_controller.rb:41 
    17881805#: app/views/task/_form.rhtml:72 
     1806#: app/views/task/print_view.rhtml:58 
    17891807#: app/views/task/create.rhtml:30 
    17901808msgid "Starting time" 
    17911809msgstr "Aloitusaika" 
    17921810 
    1793 #: app/controllers/task_controller.rb:41 
     1811#: app/controllers/task_controller.rb:42 
    17941812#: app/views/task/_form.rhtml:87 
     1813#: app/views/task/print_view.rhtml:64 
    17951814#: app/views/task/create.rhtml:34 
    17961815msgid "Deadline" 
    17971816msgstr "Takaraja" 
    17981817 
    1799 #: app/controllers/task_controller.rb:47 
    1800 #: app/controllers/task_controller.rb:466 
     1818#: app/controllers/task_controller.rb:48 
     1819#: app/controllers/task_controller.rb:464 
    18011820msgid "Select" 
    18021821msgstr "Valitse" 
    18031822 
    1804 #: app/controllers/task_controller.rb:50 
    1805 #: app/controllers/task_controller.rb:297 
    1806 #: app/controllers/task_controller.rb:469 
     1823#: app/controllers/task_controller.rb:51 
     1824#: app/controllers/task_controller.rb:282 
     1825#: app/controllers/task_controller.rb:467 
    18071826#: app/views/asset_tree/_asset_tree.rhtml:51 
    18081827#: app/views/task/view.rhtml:75 
     
    18101829msgstr "SiirrÀ" 
    18111830 
    1812 #: app/controllers/task_controller.rb:55 
     1831#: app/controllers/task_controller.rb:56 
    18131832msgid "Tasks for selected assets in branch %s" 
    18141833msgstr "Haaran %s valittujen kohteiden tehtÀvÀt" 
    18151834 
    1816 #: app/controllers/task_controller.rb:57 
     1835#: app/controllers/task_controller.rb:58 
    18171836msgid "Tasks for asset %s" 
    18181837msgstr "Kohteen %s tehtÀvÀt" 
    18191838 
    1820 #: app/controllers/task_controller.rb:86 
     1839#: app/controllers/task_controller.rb:71 
     1840#: app/controllers/task_controller.rb:417 
    18211841msgid "Task %s (%s)" 
    18221842msgstr "TehtÀvÀ %s (%s)" 
    18231843 
    1824 #: app/controllers/task_controller.rb:95 
     1844#: app/controllers/task_controller.rb:80 
    18251845msgid "You have been removed from the list of workers in this task" 
    18261846msgstr "Sinut on poistettu tÀmÀn tehtÀvÀn työntekijÀlistasta" 
    18271847 
    1828 #: app/controllers/task_controller.rb:96 
     1848#: app/controllers/task_controller.rb:81 
    18291849msgid "You have been added to the list of workers in this task" 
    18301850msgstr "Sinut on lisÀtty tÀmÀn tehtÀvÀn työntekijÀlistaan" 
    18311851 
    1832 #: app/controllers/task_controller.rb:118 
     1852#: app/controllers/task_controller.rb:103 
    18331853msgid "Task accepted" 
    18341854msgstr "TehtÀvÀ hyvÀksytty" 
    18351855 
    1836 #: app/controllers/task_controller.rb:121 
     1856#: app/controllers/task_controller.rb:106 
    18371857msgid "Task closed" 
    18381858msgstr "TehtÀvÀ suljettu" 
    18391859 
    1840 #: app/controllers/task_controller.rb:124 
     1860#: app/controllers/task_controller.rb:109 
    18411861msgid "Task assigned" 
    18421862msgstr "TehtÀvÀ mÀÀrÀtty" 
    18431863 
    1844 #: app/controllers/task_controller.rb:127 
     1864#: app/controllers/task_controller.rb:112 
    18451865msgid "Task reopened" 
    18461866msgstr "TehtÀvÀ avattu uudelleen" 
    18471867 
    1848 #: app/controllers/task_controller.rb:129 
     1868#: app/controllers/task_controller.rb:114 
    18491869msgid "Unknown task action!" 
    18501870msgstr "Tuntematon toiminto tehtÀvÀlle!" 
    18511871 
    1852 #: app/controllers/task_controller.rb:172 
     1872#: app/controllers/task_controller.rb:157 
    18531873msgid "Editing task #%i (%s)" 
    18541874msgstr "Muokataan tehtÀvÀÀ #%i (%s)" 
    18551875 
    1856 #: app/controllers/task_controller.rb:204 
     1876#: app/controllers/task_controller.rb:189 
    18571877msgid "create task" 
    18581878msgstr "Luo tehtÀvÀ" 
    18591879 
    1860 #: app/controllers/task_controller.rb:210 
     1880#: app/controllers/task_controller.rb:195 
    18611881msgid "Create new task" 
    18621882msgstr "Luo uusi tehtÀvÀ" 
    18631883 
    1864 #: app/controllers/task_controller.rb:215 
     1884#: app/controllers/task_controller.rb:200 
    18651885#: app/controllers/customer_controller.rb:130 
    18661886msgid "No task types defined." 
    18671887msgstr "YhtÀÀn tehtÀvÀtyyppiÀ ei ole mÀÀritelty." 
    18681888 
    1869 #: app/controllers/task_controller.rb:243 
     1889#: app/controllers/task_controller.rb:228 
    18701890msgid "New task created" 
    18711891msgstr "Uusi tehtÀvÀ luotu" 
    18721892 
    1873 #: app/controllers/task_controller.rb:279 
     1893#: app/controllers/task_controller.rb:264 
    18741894msgid "Move the task {%i} to a another asset" 
    18751895msgstr "SiirrÀ tehtÀvÀ {%i} toiseen kohteeseen" 
    18761896 
    1877 #: app/controllers/task_controller.rb:289 
     1897#: app/controllers/task_controller.rb:274 
    18781898msgid "The task {%i} moved to the asset %s" 
    18791899msgstr "TehtÀvÀ {%i} siirretty kohteeseen %s" 
    18801900 
    1881 #: app/controllers/task_controller.rb:294 
     1901#: app/controllers/task_controller.rb:279 
    18821902msgid "Unable to move the task {%i} to the asset %s" 
    18831903msgstr "TehtÀvÀn {%i} siirtÀminen kohteeseen %s epÀonnistui" 
    18841904 
    1885 #: app/controllers/task_controller.rb:313 
     1905#: app/controllers/task_controller.rb:298 
    18861906msgid "Unable to move task {%i}" 
    18871907msgstr "TehtÀvÀn {%i} siirtÀminen epÀonnistui" 
    18881908 
    1889 #: app/controllers/task_controller.rb:316 
     1909#: app/controllers/task_controller.rb:301 
    18901910msgid "Moved %d tasks to asset %s" 
    18911911msgstr "Siirrettiin %d tehtÀvÀÀ kohteeseen %s" 
    18921912 
    1893 #: app/controllers/task_controller.rb:331 
     1913#: app/controllers/task_controller.rb:316 
    18941914#: app/controllers/attachment_controller.rb:110 
    18951915#: app/controllers/type_attachment_controller.rb:102 
     
    18971917msgstr "kopioi omalle tietokoneelle" 
    18981918 
    1899 #: app/controllers/task_controller.rb:338 
     1919#: app/controllers/task_controller.rb:323 
    19001920msgid "Template for task type \"%s\" not found" 
    19011921msgstr "TehtÀvÀtyypin \"%s\" tehtÀvÀpohjaa ei löytynyt" 
    19021922 
    1903 #: app/controllers/task_controller.rb:397 
     1923#: app/controllers/task_controller.rb:382 
    19041924msgid "Service requests for selected assets in branch %s" 
    19051925msgstr "Haaran %s valittujen kohteiden palvelupyynnöt" 
    19061926 
    1907 #: app/controllers/task_controller.rb:399 
     1927#: app/controllers/task_controller.rb:384 
    19081928msgid "Service requests for asset %s" 
    19091929msgstr "Kohteen %s palvelupyynnöt" 
    19101930 
    1911 #: app/controllers/task_controller.rb:417 
     1931#: app/controllers/task_controller.rb:402 
    19121932msgid "New service requests" 
    19131933msgstr "Uudet palvelupyynnöt" 
    19141934 
    1915 #: app/controllers/task_controller.rb:441 
     1935#: app/controllers/task_controller.rb:439 
    19161936msgid "Highest" 
    19171937msgstr "Korkein" 
    19181938 
    1919 #: app/controllers/task_controller.rb:442 
     1939#: app/controllers/task_controller.rb:440 
    19201940msgid "Very high" 
    19211941msgstr "ErittÀin korkea" 
    19221942 
    1923 #: app/controllers/task_controller.rb:443 
     1943#: app/controllers/task_controller.rb:441 
    19241944msgid "High" 
    19251945msgstr "Korkea" 
    19261946 
    1927 #: app/controllers/task_controller.rb:444 
     1947#: app/controllers/task_controller.rb:442 
    19281948msgid "Normal" 
    19291949msgstr "Normaali" 
    19301950 
    1931 #: app/controllers/task_controller.rb:445 
     1951#: app/controllers/task_controller.rb:443 
    19321952msgid "Low" 
    19331953msgstr "Matala" 
    19341954 
    1935 #: app/controllers/task_controller.rb:446 
     1955#: app/controllers/task_controller.rb:444 
    19361956msgid "Very low" 
    19371957msgstr "ErittÀin matala" 
    19381958 
    1939 #: app/controllers/task_controller.rb:447 
     1959#: app/controllers/task_controller.rb:445 
    19401960msgid "Lowest" 
    19411961msgstr "Matalin" 
    19421962 
    1943 #: app/controllers/task_controller.rb:460 
     1963#: app/controllers/task_controller.rb:458 
    19441964#: app/views/task/_form.rhtml:59 
     1965#: app/views/task/print_view.rhtml:52 
    19451966#: app/views/shared/_edit_account.rhtml:4 
    19461967msgid "Created at" 
     
    24422463#: app/controllers/type_attachment_controller.rb:23 
    24432464#: app/views/attachment/view.rhtml:9 
     2465#: app/views/task/print_view.rhtml:101 
    24442466msgid "Asset type" 
    24452467msgstr "Kohdetyyppi" 
     
    28832905 
    28842906#: app/views/task/_form.rhtml:45 
     2907#: app/views/task/print_view.rhtml:44 
    28852908#: app/views/task/create.rhtml:13 
    28862909msgid "Short description" 
     
    28882911 
    28892912#: app/views/task/_form.rhtml:55 
     2913#: app/views/task/print_view.rhtml:50 
    28902914msgid "Created by" 
    28912915msgstr "Luonut" 
    28922916 
    28932917#: app/views/task/_form.rhtml:70 
     2918#: app/views/task/print_view.rhtml:56 
    28942919msgid "Responsible user" 
    28952920msgstr "Vastuussa oleva kÀyttÀjÀ" 
    28962921 
    28972922#: app/views/task/_form.rhtml:71 
     2923#: app/views/task/print_view.rhtml:57 
    28982924msgid "accepted" 
    28992925msgstr "hyvÀksytty" 
    29002926 
    29012927#: app/views/task/_form.rhtml:95 
     2928#: app/views/task/print_view.rhtml:68 
    29022929msgid "Initial working<br/>time estimate" 
    2903 msgstr "Alustava<br/>työaika-arvio" 
     2930msgstr "Alustava työaika-arvio" 
    29042931 
    29052932#: app/views/task/_form.rhtml:97 
     2933#: app/views/task/print_view.rhtml:70 
    29062934msgid "Spent working time" 
    29072935msgstr "KÀytetty työaika" 
     
    29753003 
    29763004#: app/views/task/view.rhtml:56 
     3005#: app/views/task/print_view.rhtml:121 
    29773006msgid "Change history" 
    29783007msgstr "Muutoshistoria" 
     
    29823011msgstr "Muuta tietoja" 
    29833012 
     3013#: app/views/task/view.rhtml:84 
     3014msgid "Printer-friendly" 
     3015msgstr "Tulostettava" 
     3016 
    29843017#: app/views/task/_display_task_event.rhtml:10 
    29853018msgid "Assiged to %s by %s" 
    29863019msgstr "%s asetettu vastuulliseksi kÀyttÀjÀn %s toimesta" 
     3020 
     3021#: app/views/task/print_view.rhtml:33 
     3022msgid "Print" 
     3023msgstr "Tulosta" 
     3024 
     3025#: app/views/task/print_view.rhtml:82 
     3026#: app/views/task/print_view.rhtml:122 
     3027msgid "Show" 
     3028msgstr "NÀytÀ" 
     3029 
     3030#: app/views/task/print_view.rhtml:82 
     3031#: app/views/task/print_view.rhtml:122 
     3032msgid "Hide" 
     3033msgstr "Piilota" 
    29873034 
    29883035#: app/views/task/create.rhtml:3 
     
    31923239msgid "Select this asset" 
    31933240msgstr "Valitse tÀmÀ kohde" 
    3194  
    3195 #: app/views/asset/_view_table.rhtml:39 
    3196 msgid "yes" 
    3197 msgstr "kyllÀ" 
    3198  
    3199 #: app/views/asset/_view_table.rhtml:39 
    3200 msgid "no" 
    3201 msgstr "ei" 
    32023241 
    32033242#: app/views/shared/reset_password.rhtml:6 
     
    40954134#~ msgid "Form categories" 
    40964135#~ msgstr "Lomakekategoriat" 
    4097 #~ msgid "Parent" 
    4098 #~ msgstr "Vanhempi" 
    40994136#~ msgid "Form type count" 
    41004137#~ msgstr "Lomaketyyppien lukumÀÀrÀ" 
  • trunk/test/functional/task_controller_test.rb

    r718 r743  
    382382  end 
    383383 
     384  # Method: test_print_view 
     385  # ======================= 
     386  # Cehck that the task printing view (task/print_view) works. 
     387  # 
     388  def test_print_view 
     389    @keyring.action_keys << create_action_key('task/view') 
     390    login('test') 
     391 
     392    task = create_task_in_state(Task.NEW) 
     393 
     394    get 'print_view', :id => task.id 
     395    assert_response :success 
     396    assert_template 'task/print_view' 
     397    assert_equal task, assigns(:task) 
     398    assert_equal false, assigns(:hide_asset_information) 
     399    assert_equal false, assigns(:hide_history) 
     400  end 
     401 
     402  # Method: test_print_view_with_hide_options 
     403  # ========================================= 
     404  # Cehck that the task printing view (task/print_view) works. 
     405  # 
     406  def test_print_view_with_hide_option 
     407    @keyring.action_keys << create_action_key('task/view') 
     408    login('test') 
     409 
     410    task = create_task_in_state(Task.NEW) 
     411 
     412    get 'print_view', :id => task.id, :hide_asset => '1', :hide_history => '1' 
     413    assert_response :success 
     414    assert_template 'task/print_view' 
     415    assert_equal task, assigns(:task) 
     416    assert_equal true, assigns(:hide_asset_information) 
     417    assert_equal true, assigns(:hide_history) 
     418  end 
     419 
     420  # Method: test_print_view_with_show_options 
     421  # ========================================= 
     422  # Cehck that the task printing view (task/print_view) works. 
     423  # 
     424  def test_print_view_with_hide_option 
     425    @keyring.action_keys << create_action_key('task/view') 
     426    login('test') 
     427 
     428    task = create_task_in_state(Task.NEW) 
     429 
     430    get 'print_view', :id => task.id, :hide_asset => '0', :hide_history => '0' 
     431    assert_response :success 
     432    assert_template 'task/print_view' 
     433    assert_equal task, assigns(:task) 
     434    assert_equal false, assigns(:hide_asset_information) 
     435    assert_equal false, assigns(:hide_history) 
     436  end 
     437 
    384438  private 
    385439 

© 2004-2007 Norfello Oy All Rights Reserved