Changeset 743
- Timestamp:
- 01/31/08 21:16:37 (1 year ago)
- Files:
-
- trunk/app/controllers/task_controller.rb (modified) (4 diffs)
- trunk/app/helpers/application_helper.rb (modified) (1 diff)
- trunk/app/views/asset/_view_table.rhtml (modified) (1 diff)
- trunk/app/views/task/print_view.rhtml (added)
- trunk/app/views/task/view.rhtml (modified) (1 diff)
- trunk/po/fi_FI/norfello_cmms.po (modified) (28 diffs)
- trunk/public/images/16x16/print.gif (added)
- trunk/public/stylesheets/print_task.css (added)
- trunk/test/functional/task_controller_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/task_controller.rb
r719 r743 13 13 class TaskController < ApplicationController 14 14 prepend_before_filter :login_required 15 before_filter :get_task_for_viewing, :only => [:view, :print_view] 15 16 skip_before_filter :check_new_service_requests, :only => :list_new_service_requests 16 17 LOCK_DURATION = 1.hour … … 68 69 69 70 def view 70 begin71 @task = Task.find(params[:id], :include => [:data_permissions, :asset, :creator, :responsible_user])72 rescue ActiveRecord::RecordNotFound73 if params[:cmms_link]74 redirect_with_error_message(msg_invalid_link_in_markup("{#{params[:id]}}"), :back)75 else76 redirect_with_error_message(msg_non_existing_data(Task, params[:id]), :action => 'list')77 end78 return79 end80 81 unless @task.authorized_to_read?82 redirect_with_error_message(msg_unauthorized_operation(_('read'), "{#{@task.id}}"), :action => 'list')83 return84 end85 86 71 @wo_title = _('Task %s (%s)', @task.to_s, @task.task_type.name) 87 72 … … 424 409 end 425 410 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 426 424 protected 427 425 … … 471 469 ] 472 470 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 473 491 end trunk/app/helpers/application_helper.rb
r721 r743 811 811 return select_tag(name, option_tags, options) 812 812 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 813 830 end trunk/app/views/asset/_view_table.rhtml
r707 r743 32 32 <th><div><%= h(field_value.asset_field.name) %></div></th> 33 33 <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) %> 46 35 </td> 47 36 </tr> trunk/app/views/task/view.rhtml
r729 r743 82 82 <td><%= link_to(image_tag('16x16/download.png') + _('Download'), 83 83 {: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> 84 86 </tr> 85 87 </table> trunk/po/fi_FI/norfello_cmms.po
r740 r743 2 2 msgstr "" 3 3 "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" 6 6 "Last-Translator: Markku Oksanen <markku.oksanen@norfello.com>\n" 7 7 "Language-Team: Norfello Ltd. <contact@norfello.com>\n" … … 751 751 752 752 #: app/helpers/customer_interface_helper.rb:207 753 #: app/controllers/task_controller.rb:4 51753 #: app/controllers/task_controller.rb:449 754 754 #: app/controllers/overview_controller.rb:59 755 755 msgid "New" … … 757 757 758 758 #: app/helpers/customer_interface_helper.rb:209 759 #: app/controllers/task_controller.rb:4 51759 #: app/controllers/task_controller.rb:449 760 760 #: app/controllers/overview_controller.rb:59 761 761 #: app/controllers/overview_controller.rb:65 … … 764 764 765 765 #: app/helpers/customer_interface_helper.rb:211 766 #: app/controllers/task_controller.rb:4 51766 #: app/controllers/task_controller.rb:449 767 767 #: app/controllers/overview_controller.rb:59 768 768 #: app/controllers/overview_controller.rb:65 … … 771 771 772 772 #: app/helpers/customer_interface_helper.rb:213 773 #: app/controllers/task_controller.rb:4 51773 #: app/controllers/task_controller.rb:449 774 774 #: app/controllers/overview_controller.rb:65 775 775 msgid "Closed" … … 897 897 #: app/views/task/_form.rhtml:96 898 898 #: app/views/task/_form.rhtml:98 899 #: app/views/task/print_view.rhtml:69 900 #: app/views/task/print_view.rhtml:71 899 901 #: app/views/task/create.rhtml:39 900 902 msgid "hours" … … 905 907 msgstr "minuuttia" 906 908 909 #: app/helpers/application_helper.rb:823 910 msgid "yes" 911 msgstr "kyllÀ" 912 913 #: app/helpers/application_helper.rb:823 914 msgid "no" 915 msgstr "ei" 916 907 917 #: app/helpers/asset_field_helper.rb:52 908 918 #: app/helpers/asset_field_helper.rb:113 909 #: app/controllers/task_controller.rb: 49910 #: app/controllers/task_controller.rb:46 8919 #: app/controllers/task_controller.rb:50 920 #: app/controllers/task_controller.rb:466 911 921 #: app/controllers/message_controller.rb:28 912 922 #: app/controllers/keyring_controller.rb:75 … … 931 941 932 942 #: app/controllers/asset_controller.rb:30 943 #: app/views/task/print_view.rhtml:81 933 944 msgid "Asset information" 934 945 msgstr "Kohteen tiedot " … … 943 954 #: app/controllers/data_permission_controller.rb:53 944 955 #: app/controllers/data_permission_controller.rb:56 945 #: app/controllers/task_controller.rb: 82956 #: app/controllers/task_controller.rb:481 946 957 #: app/controllers/attachment_controller.rb:68 947 958 #: app/controllers/asset_tree_controller.rb:125 … … 958 969 #: app/controllers/customer_interface_controller.rb:164 959 970 #: app/controllers/form_controller.rb:479 960 #: app/controllers/task_controller.rb:4 2961 #: app/controllers/task_controller.rb:5 1962 #: app/controllers/task_controller.rb:2 83963 #: app/controllers/task_controller.rb:4 61964 #: app/controllers/task_controller.rb:4 70971 #: 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 965 976 #: app/controllers/attachment_controller.rb:26 966 977 #: app/views/attachment/view.rhtml:4 … … 1009 1020 #: app/views/attachment/attach.rhtml:9 1010 1021 #: app/views/asset_tree/search.rhtml:4 1022 #: app/views/task/print_view.rhtml:90 1011 1023 #: app/views/form_type/create_step2.rhtml:6 1012 1024 #: app/views/form_type/create_step4.rhtml:9 … … 1038 1050 #: app/controllers/asset_controller.rb:104 1039 1051 #: app/controllers/asset_controller.rb:348 1040 #: app/controllers/task_controller.rb:3 51052 #: app/controllers/task_controller.rb:36 1041 1053 #: app/controllers/asset_field_controller.rb:22 1042 1054 #: app/controllers/asset_field_controller.rb:42 … … 1054 1066 #: app/controllers/asset_controller.rb:140 1055 1067 #: app/controllers/asset_controller.rb:247 1068 #: app/views/task/print_view.rhtml:86 1056 1069 #: app/views/asset/_view_table.rhtml:16 1057 1070 msgid "Code" … … 1060 1073 #: app/controllers/asset_controller.rb:143 1061 1074 #: app/controllers/asset_controller.rb:250 1075 #: app/views/task/print_view.rhtml:95 1062 1076 #: app/views/asset/_view_table.rhtml:25 1063 1077 msgid "Customer" … … 1072 1086 #: app/controllers/asset_type_controller.rb:46 1073 1087 #: app/controllers/asset_type_controller.rb:56 1074 #: app/controllers/task_controller.rb:3 71075 #: app/controllers/task_controller.rb:45 91088 #: app/controllers/task_controller.rb:38 1089 #: app/controllers/task_controller.rb:457 1076 1090 #: app/controllers/customer_controller.rb:51 1077 1091 #: app/controllers/customer_controller.rb:78 … … 1079 1093 #: app/controllers/user_controller.rb:112 1080 1094 #: 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 1082 1098 msgid "Description" 1083 1099 msgstr "Kuvaus" … … 1090 1106 #: app/controllers/asset_controller.rb:182 1091 1107 #: app/controllers/form_controller.rb:455 1092 #: app/controllers/task_controller.rb:3 231108 #: app/controllers/task_controller.rb:308 1093 1109 #: app/controllers/attachment_controller.rb:128 1094 1110 #: app/controllers/type_attachment_controller.rb:120 … … 1128 1144 #: app/controllers/asset_controller.rb:315 1129 1145 #: app/controllers/form_controller.rb:152 1130 #: app/controllers/task_controller.rb:1 641131 #: app/controllers/task_controller.rb:2 741132 #: app/controllers/task_controller.rb: 3061146 #: app/controllers/task_controller.rb:149 1147 #: app/controllers/task_controller.rb:259 1148 #: app/controllers/task_controller.rb:291 1133 1149 msgid "edit" 1134 1150 msgstr "muokkaa" … … 1763 1779 msgstr "Aikajana kohteelle %s" 1764 1780 1765 #: app/controllers/task_controller.rb:3 41766 #: app/controllers/task_controller.rb:45 71781 #: app/controllers/task_controller.rb:35 1782 #: app/controllers/task_controller.rb:455 1767 1783 #: app/controllers/asset_type_icon_controller.rb:20 1768 1784 msgid "ID" 1769 1785 msgstr "ID" 1770 1786 1771 #: app/controllers/task_controller.rb:3 61772 #: app/controllers/task_controller.rb:45 81787 #: app/controllers/task_controller.rb:37 1788 #: app/controllers/task_controller.rb:456 1773 1789 #: app/views/task/_form.rhtml:34 1774 1790 msgid "State" 1775 1791 msgstr "Tila" 1776 1792 1777 #: app/controllers/task_controller.rb:3 81793 #: app/controllers/task_controller.rb:39 1778 1794 #: app/views/task/_form.rhtml:79 1795 #: app/views/task/print_view.rhtml:62 1779 1796 #: app/views/task/create.rhtml:26 1780 1797 msgid "Priority" 1781 1798 msgstr "Prioriteetti" 1782 1799 1783 #: app/controllers/task_controller.rb: 391800 #: app/controllers/task_controller.rb:40 1784 1801 msgid "Responsible worker" 1785 1802 msgstr "Työn vastuuhenkilö" 1786 1803 1787 #: app/controllers/task_controller.rb:4 01804 #: app/controllers/task_controller.rb:41 1788 1805 #: app/views/task/_form.rhtml:72 1806 #: app/views/task/print_view.rhtml:58 1789 1807 #: app/views/task/create.rhtml:30 1790 1808 msgid "Starting time" 1791 1809 msgstr "Aloitusaika" 1792 1810 1793 #: app/controllers/task_controller.rb:4 11811 #: app/controllers/task_controller.rb:42 1794 1812 #: app/views/task/_form.rhtml:87 1813 #: app/views/task/print_view.rhtml:64 1795 1814 #: app/views/task/create.rhtml:34 1796 1815 msgid "Deadline" 1797 1816 msgstr "Takaraja" 1798 1817 1799 #: app/controllers/task_controller.rb:4 71800 #: app/controllers/task_controller.rb:46 61818 #: app/controllers/task_controller.rb:48 1819 #: app/controllers/task_controller.rb:464 1801 1820 msgid "Select" 1802 1821 msgstr "Valitse" 1803 1822 1804 #: app/controllers/task_controller.rb:5 01805 #: app/controllers/task_controller.rb:2 971806 #: app/controllers/task_controller.rb:46 91823 #: app/controllers/task_controller.rb:51 1824 #: app/controllers/task_controller.rb:282 1825 #: app/controllers/task_controller.rb:467 1807 1826 #: app/views/asset_tree/_asset_tree.rhtml:51 1808 1827 #: app/views/task/view.rhtml:75 … … 1810 1829 msgstr "SiirrÀ" 1811 1830 1812 #: app/controllers/task_controller.rb:5 51831 #: app/controllers/task_controller.rb:56 1813 1832 msgid "Tasks for selected assets in branch %s" 1814 1833 msgstr "Haaran %s valittujen kohteiden tehtÀvÀt" 1815 1834 1816 #: app/controllers/task_controller.rb:5 71835 #: app/controllers/task_controller.rb:58 1817 1836 msgid "Tasks for asset %s" 1818 1837 msgstr "Kohteen %s tehtÀvÀt" 1819 1838 1820 #: app/controllers/task_controller.rb:86 1839 #: app/controllers/task_controller.rb:71 1840 #: app/controllers/task_controller.rb:417 1821 1841 msgid "Task %s (%s)" 1822 1842 msgstr "TehtÀvÀ %s (%s)" 1823 1843 1824 #: app/controllers/task_controller.rb: 951844 #: app/controllers/task_controller.rb:80 1825 1845 msgid "You have been removed from the list of workers in this task" 1826 1846 msgstr "Sinut on poistettu tÀmÀn tehtÀvÀn työntekijÀlistasta" 1827 1847 1828 #: app/controllers/task_controller.rb: 961848 #: app/controllers/task_controller.rb:81 1829 1849 msgid "You have been added to the list of workers in this task" 1830 1850 msgstr "Sinut on lisÀtty tÀmÀn tehtÀvÀn työntekijÀlistaan" 1831 1851 1832 #: app/controllers/task_controller.rb:1 181852 #: app/controllers/task_controller.rb:103 1833 1853 msgid "Task accepted" 1834 1854 msgstr "TehtÀvÀ hyvÀksytty" 1835 1855 1836 #: app/controllers/task_controller.rb:1 211856 #: app/controllers/task_controller.rb:106 1837 1857 msgid "Task closed" 1838 1858 msgstr "TehtÀvÀ suljettu" 1839 1859 1840 #: app/controllers/task_controller.rb:1 241860 #: app/controllers/task_controller.rb:109 1841 1861 msgid "Task assigned" 1842 1862 msgstr "TehtÀvÀ mÀÀrÀtty" 1843 1863 1844 #: app/controllers/task_controller.rb:1 271864 #: app/controllers/task_controller.rb:112 1845 1865 msgid "Task reopened" 1846 1866 msgstr "TehtÀvÀ avattu uudelleen" 1847 1867 1848 #: app/controllers/task_controller.rb:1 291868 #: app/controllers/task_controller.rb:114 1849 1869 msgid "Unknown task action!" 1850 1870 msgstr "Tuntematon toiminto tehtÀvÀlle!" 1851 1871 1852 #: app/controllers/task_controller.rb:1 721872 #: app/controllers/task_controller.rb:157 1853 1873 msgid "Editing task #%i (%s)" 1854 1874 msgstr "Muokataan tehtÀvÀÀ #%i (%s)" 1855 1875 1856 #: app/controllers/task_controller.rb: 2041876 #: app/controllers/task_controller.rb:189 1857 1877 msgid "create task" 1858 1878 msgstr "Luo tehtÀvÀ" 1859 1879 1860 #: app/controllers/task_controller.rb: 2101880 #: app/controllers/task_controller.rb:195 1861 1881 msgid "Create new task" 1862 1882 msgstr "Luo uusi tehtÀvÀ" 1863 1883 1864 #: app/controllers/task_controller.rb:2 151884 #: app/controllers/task_controller.rb:200 1865 1885 #: app/controllers/customer_controller.rb:130 1866 1886 msgid "No task types defined." 1867 1887 msgstr "YhtÀÀn tehtÀvÀtyyppiÀ ei ole mÀÀritelty." 1868 1888 1869 #: app/controllers/task_controller.rb:2 431889 #: app/controllers/task_controller.rb:228 1870 1890 msgid "New task created" 1871 1891 msgstr "Uusi tehtÀvÀ luotu" 1872 1892 1873 #: app/controllers/task_controller.rb:2 791893 #: app/controllers/task_controller.rb:264 1874 1894 msgid "Move the task {%i} to a another asset" 1875 1895 msgstr "SiirrÀ tehtÀvÀ {%i} toiseen kohteeseen" 1876 1896 1877 #: app/controllers/task_controller.rb:2 891897 #: app/controllers/task_controller.rb:274 1878 1898 msgid "The task {%i} moved to the asset %s" 1879 1899 msgstr "TehtÀvÀ {%i} siirretty kohteeseen %s" 1880 1900 1881 #: app/controllers/task_controller.rb:2 941901 #: app/controllers/task_controller.rb:279 1882 1902 msgid "Unable to move the task {%i} to the asset %s" 1883 1903 msgstr "TehtÀvÀn {%i} siirtÀminen kohteeseen %s epÀonnistui" 1884 1904 1885 #: app/controllers/task_controller.rb: 3131905 #: app/controllers/task_controller.rb:298 1886 1906 msgid "Unable to move task {%i}" 1887 1907 msgstr "TehtÀvÀn {%i} siirtÀminen epÀonnistui" 1888 1908 1889 #: app/controllers/task_controller.rb:3 161909 #: app/controllers/task_controller.rb:301 1890 1910 msgid "Moved %d tasks to asset %s" 1891 1911 msgstr "Siirrettiin %d tehtÀvÀÀ kohteeseen %s" 1892 1912 1893 #: app/controllers/task_controller.rb:3 311913 #: app/controllers/task_controller.rb:316 1894 1914 #: app/controllers/attachment_controller.rb:110 1895 1915 #: app/controllers/type_attachment_controller.rb:102 … … 1897 1917 msgstr "kopioi omalle tietokoneelle" 1898 1918 1899 #: app/controllers/task_controller.rb:3 381919 #: app/controllers/task_controller.rb:323 1900 1920 msgid "Template for task type \"%s\" not found" 1901 1921 msgstr "TehtÀvÀtyypin \"%s\" tehtÀvÀpohjaa ei löytynyt" 1902 1922 1903 #: app/controllers/task_controller.rb:3 971923 #: app/controllers/task_controller.rb:382 1904 1924 msgid "Service requests for selected assets in branch %s" 1905 1925 msgstr "Haaran %s valittujen kohteiden palvelupyynnöt" 1906 1926 1907 #: app/controllers/task_controller.rb:3 991927 #: app/controllers/task_controller.rb:384 1908 1928 msgid "Service requests for asset %s" 1909 1929 msgstr "Kohteen %s palvelupyynnöt" 1910 1930 1911 #: app/controllers/task_controller.rb:4 171931 #: app/controllers/task_controller.rb:402 1912 1932 msgid "New service requests" 1913 1933 msgstr "Uudet palvelupyynnöt" 1914 1934 1915 #: app/controllers/task_controller.rb:4 411935 #: app/controllers/task_controller.rb:439 1916 1936 msgid "Highest" 1917 1937 msgstr "Korkein" 1918 1938 1919 #: app/controllers/task_controller.rb:44 21939 #: app/controllers/task_controller.rb:440 1920 1940 msgid "Very high" 1921 1941 msgstr "ErittÀin korkea" 1922 1942 1923 #: app/controllers/task_controller.rb:44 31943 #: app/controllers/task_controller.rb:441 1924 1944 msgid "High" 1925 1945 msgstr "Korkea" 1926 1946 1927 #: app/controllers/task_controller.rb:44 41947 #: app/controllers/task_controller.rb:442 1928 1948 msgid "Normal" 1929 1949 msgstr "Normaali" 1930 1950 1931 #: app/controllers/task_controller.rb:44 51951 #: app/controllers/task_controller.rb:443 1932 1952 msgid "Low" 1933 1953 msgstr "Matala" 1934 1954 1935 #: app/controllers/task_controller.rb:44 61955 #: app/controllers/task_controller.rb:444 1936 1956 msgid "Very low" 1937 1957 msgstr "ErittÀin matala" 1938 1958 1939 #: app/controllers/task_controller.rb:44 71959 #: app/controllers/task_controller.rb:445 1940 1960 msgid "Lowest" 1941 1961 msgstr "Matalin" 1942 1962 1943 #: app/controllers/task_controller.rb:4 601963 #: app/controllers/task_controller.rb:458 1944 1964 #: app/views/task/_form.rhtml:59 1965 #: app/views/task/print_view.rhtml:52 1945 1966 #: app/views/shared/_edit_account.rhtml:4 1946 1967 msgid "Created at" … … 2442 2463 #: app/controllers/type_attachment_controller.rb:23 2443 2464 #: app/views/attachment/view.rhtml:9 2465 #: app/views/task/print_view.rhtml:101 2444 2466 msgid "Asset type" 2445 2467 msgstr "Kohdetyyppi" … … 2883 2905 2884 2906 #: app/views/task/_form.rhtml:45 2907 #: app/views/task/print_view.rhtml:44 2885 2908 #: app/views/task/create.rhtml:13 2886 2909 msgid "Short description" … … 2888 2911 2889 2912 #: app/views/task/_form.rhtml:55 2913 #: app/views/task/print_view.rhtml:50 2890 2914 msgid "Created by" 2891 2915 msgstr "Luonut" 2892 2916 2893 2917 #: app/views/task/_form.rhtml:70 2918 #: app/views/task/print_view.rhtml:56 2894 2919 msgid "Responsible user" 2895 2920 msgstr "Vastuussa oleva kÀyttÀjÀ" 2896 2921 2897 2922 #: app/views/task/_form.rhtml:71 2923 #: app/views/task/print_view.rhtml:57 2898 2924 msgid "accepted" 2899 2925 msgstr "hyvÀksytty" 2900 2926 2901 2927 #: app/views/task/_form.rhtml:95 2928 #: app/views/task/print_view.rhtml:68 2902 2929 msgid "Initial working<br/>time estimate" 2903 msgstr "Alustava <br/>työaika-arvio"2930 msgstr "Alustava työaika-arvio" 2904 2931 2905 2932 #: app/views/task/_form.rhtml:97 2933 #: app/views/task/print_view.rhtml:70 2906 2934 msgid "Spent working time" 2907 2935 msgstr "KÀytetty työaika" … … 2975 3003 2976 3004 #: app/views/task/view.rhtml:56 3005 #: app/views/task/print_view.rhtml:121 2977 3006 msgid "Change history" 2978 3007 msgstr "Muutoshistoria" … … 2982 3011 msgstr "Muuta tietoja" 2983 3012 3013 #: app/views/task/view.rhtml:84 3014 msgid "Printer-friendly" 3015 msgstr "Tulostettava" 3016 2984 3017 #: app/views/task/_display_task_event.rhtml:10 2985 3018 msgid "Assiged to %s by %s" 2986 3019 msgstr "%s asetettu vastuulliseksi kÀyttÀjÀn %s toimesta" 3020 3021 #: app/views/task/print_view.rhtml:33 3022 msgid "Print" 3023 msgstr "Tulosta" 3024 3025 #: app/views/task/print_view.rhtml:82 3026 #: app/views/task/print_view.rhtml:122 3027 msgid "Show" 3028 msgstr "NÀytÀ" 3029 3030 #: app/views/task/print_view.rhtml:82 3031 #: app/views/task/print_view.rhtml:122 3032 msgid "Hide" 3033 msgstr "Piilota" 2987 3034 2988 3035 #: app/views/task/create.rhtml:3 … … 3192 3239 msgid "Select this asset" 3193 3240 msgstr "Valitse tÀmÀ kohde" 3194 3195 #: app/views/asset/_view_table.rhtml:393196 msgid "yes"3197 msgstr "kyllÀ"3198 3199 #: app/views/asset/_view_table.rhtml:393200 msgid "no"3201 msgstr "ei"3202 3241 3203 3242 #: app/views/shared/reset_password.rhtml:6 … … 4095 4134 #~ msgid "Form categories" 4096 4135 #~ msgstr "Lomakekategoriat" 4097 #~ msgid "Parent"4098 #~ msgstr "Vanhempi"4099 4136 #~ msgid "Form type count" 4100 4137 #~ msgstr "Lomaketyyppien lukumÀÀrÀ" trunk/test/functional/task_controller_test.rb
r718 r743 382 382 end 383 383 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 384 438 private 385 439