Changeset 713
- Timestamp:
- 11/02/07 12:21:04 (1 year ago)
- Files:
-
- trunk/app/controllers/customer_controller.rb (modified) (1 diff)
- trunk/app/controllers/customer_interface_controller.rb (modified) (1 diff)
- trunk/app/models/customer.rb (modified) (1 diff)
- trunk/app/models/notification_mailer.rb (modified) (2 diffs)
- trunk/app/models/user.rb (modified) (1 diff)
- trunk/app/models/user_account.rb (modified) (3 diffs)
- trunk/app/views/customer/_create.rhtml (added)
- trunk/app/views/customer_interface/comment_service_request.rhtml (added)
- trunk/app/views/notification_mailer/customer_created_notification.rhtml (added)
- trunk/doc/manual/latex/tex/configuration_section.tex (modified) (1 diff)
- trunk/po/fi_FI/norfello_cmms.po (modified) (42 diffs)
- trunk/public/javascripts/application.js (modified) (2 diffs)
- trunk/test/functional/customer_controller_test.rb (modified) (3 diffs)
- trunk/test/functional/customer_interface_controller_test.rb (modified) (3 diffs)
- trunk/test/unit/notification_mailer_test.rb (modified) (2 diffs)
- trunk/test/unit/user_account_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/customer_controller.rb
r708 r713 49 49 [_('Name'), :text_field, 'name', { :size => 30, :maxlength => 40 } ], 50 50 [_('Description'), :text_field, 'description', { :size => 30, :maxlength => 60 } ], 51 [_('Email address'), :text_field, 'email', { :size => 30, :maxlength => 40 } ],51 [_('Email address'), :text_field, 'email', { :size => 30, :maxlength => 40, :onchange => 'disable_notify_new_user()' } ], 52 52 [_('Phone number'), :text_field, 'phone', { :size => 30, :maxlength => 20 } ], 53 53 [_('City'), :text_field, 'city', { :size => 30, :maxlength => 40 } ], 54 54 [_('Country'), :text_field, 'country', { :size => 30, :maxlength => 40 } ], 55 [_('Language'), :select, 'lang', @language_options] 55 [_('Language'), :select, 'lang', @language_options], 56 [_('Send email notification'), :check_box, 'notify_new_user'] 56 57 ] 57 58 58 common_create(Customer, 'login', {:action => 'list'}, {:action => 'list'} )59 common_create(Customer, 'login', {:action => 'list'}, {:action => 'list'}, 'create') 59 60 end 60 61 trunk/app/controllers/customer_interface_controller.rb
r712 r713 247 247 # 248 248 def comment_service_request 249 @task = Task.find(params[:id] , :conditions => ['state != ?', Task.CLOSED])249 @task = Task.find(params[:id]) 250 250 @title = _('Comment service request %s', @task.to_s) 251 251 252 unless @assets.include?(@task.asset) and @task.task_type and @task.task_type.is_service_request_type 252 unless @assets.include?(@task.asset) and @task.task_type and @task.task_type.is_service_request_type and @task.state != Task.CLOSED 253 253 flash[:error] = _('Service request %s not found!', @task.to_s) 254 254 redirect_to(:action => 'index') trunk/app/models/customer.rb
r712 r713 13 13 belongs_to :service_request_type, :class_name => 'TaskType', :foreign_key => 'service_request_type_id' 14 14 has_many :assets 15 16 event :created, :dispatch_after => :create 15 17 16 18 # Set the name as an alias for the full_name attribute: trunk/app/models/notification_mailer.rb
r654 r713 12 12 # Functions that the ModelObserver runs when corresponding events 13 13 # for tasks take place 14 15 def self.customer_created(customer) 16 return unless customer.instance_of?(Customer) and customer.notify_new_user and customer.email and customer.email != '' 17 deliver_customer_created_notification(customer) 18 end 14 19 15 20 def self.task_created(task) … … 105 110 end 106 111 112 # Method: customer_created_notification 113 # ===================================== 114 # Sends an email notification to a new customer. 115 # 116 # Parameter: 117 # --------- 118 # customer - A <Customer> to whom the email is sent 119 # 120 def customer_created_notification(customer) 121 url = url_for(:host => ApplicationController.host, :controller => 'user', :action => 'login') 122 123 recipients "#{customer.name} <#{customer.email}>" 124 subject localize('NorfelloCMMS - Customer account') 125 from NotificationMailer.email_sender 126 sent_on Time.now 127 body :message => localize("Welcome to using NorfelloCMMS Customer interface.\nYou can login at %s.\n\nYour user account details are:\nUsername: %s\nPassword: %s\nEmail: %s\n\nWe recommend you to change the password when you login for the first time.", url, customer.login, customer.plain_password, customer.email), :automatic_message => localize("This is an automatic email notification from the NorfelloCMMS OS\nrunning at %s.", ApplicationController.host) 128 129 NotificationMailer._info("Mail generated for new customer '#{customer.login}'") 130 end 131 107 132 private 108 133 def localize(msg, *args) trunk/app/models/user.rb
r707 r713 3 3 4 4 class User < UserAccount 5 # Protection 6 attr_protected :full_name # this name is NOT used by this model5 # Protection (these fields are NOT used by this model) 6 attr_protected :full_name, :notify_new_user 7 7 # Validation 8 8 validates_presence_of :first_name, :last_name trunk/app/models/user_account.rb
r708 r713 31 31 validates_length_of :city, :maximum => 40 32 32 # Callbacks 33 before_create :save_plain_password 33 34 before_create :crypt_password 34 35 before_validation_on_update :conserve_password_if_nil … … 44 45 45 46 cattr_accessor :current_user 47 48 # Plain (i.e. not encrypted) password can be read after creation if 49 # the notify_new_user attribute is set to true. Practise extra caution 50 # when using the plain_password attribute. 51 attr_reader :notify_new_user 52 attr_reader :plain_password 53 54 # Method: notify_new_user 55 # ======================= 56 # Sets the notify_new_user attribute. 57 # 58 def notify_new_user=(value) 59 if value == '1' or value == true 60 @notify_new_user = true 61 end 62 end 46 63 47 64 # Updates accessed_at timestamp for +user+, without updating updated_at timestamp. … … 196 213 end 197 214 end 215 216 # Method: save_plain_password 217 # =========================== 218 # Saves the password for later use if the notify_new_user attribute is true. 219 # 220 def save_plain_password 221 @plain_password = self.password if @notify_new_user 222 true 223 end 198 224 end trunk/doc/manual/latex/tex/configuration_section.tex
r707 r713 317 317 You can edit a customer by using the 'Edit' action in 'Actions' column of the customer list. This action can also be used to view all information for a customer and to reset the password. 318 318 \paragraph{Create} 319 You can create a new customer by using the 'Create' function. Fill out the form and push the 'Create' button to submit the information. 319 You can create a new customer by using the 'Create' function. Fill out the form and push the 'Create' button to submit the information. By choosing the 'Send email notification' option you can automatically email the customer account information to a new customer --- you'll have to fill the 'Email address' field for this to work. 320 320 \paragraph{Select service request type} 321 321 The \emph{service request type} is the task type that is used when a customer submits a service request through the 'Customer interface'. By using this action you can select a task type that is used to store the service requests. The default database shipped with NorfelloCMMS OS contains an example service request type named 'Service request from a customer' which you can edit to match your needs in the 'Task types' menu. trunk/po/fi_FI/norfello_cmms.po
r710 r713 2 2 msgstr "" 3 3 "Project-Id-Version: NorfelloCMMS SVN trunk\n" 4 "POT-Creation-Date: 2007-1 0-18 13:52+0300\n"5 "PO-Revision-Date: 2007-1 0-18 14:05+0200\n"4 "POT-Creation-Date: 2007-11-02 11:48+0200\n" 5 "PO-Revision-Date: 2007-11-02 12:12+0200\n" 6 6 "Last-Translator: Markku Oksanen <markku.oksanen@norfello.com>\n" 7 7 "Language-Team: Norfello Ltd. <contact@norfello.com>\n" … … 34 34 msgstr "ei saa olla aikaisempi kuin aloitusaika" 35 35 36 #: app/models/task.rb:1 3736 #: app/models/task.rb:150 37 37 msgid "Task was assigned to you" 38 38 msgstr "Sinulle annettiin tehtÀvÀ" … … 113 113 114 114 #: app/models/form_field.rb:41 115 #: app/controllers/customer_interface_controller.rb:4 4115 #: app/controllers/customer_interface_controller.rb:46 116 116 #: app/controllers/asset_field_controller.rb:113 117 117 msgid "Time" … … 291 291 292 292 #: app/models/attachment_methods.rb:38 293 #: app/helpers/customer_interface_helper.rb:1 09294 #: app/helpers/customer_interface_helper.rb:1 11295 #: app/helpers/customer_interface_helper.rb:1 32296 #: app/helpers/customer_interface_helper.rb:1 34297 #: app/helpers/customer_interface_helper.rb:1 36298 #: app/helpers/customer_interface_helper.rb:1 38299 #: app/helpers/customer_interface_helper.rb:1 40300 #: app/helpers/customer_interface_helper.rb:1 42301 #: app/helpers/customer_interface_helper.rb:1 61302 #: app/controllers/customer_interface_controller.rb:16 0293 #: app/helpers/customer_interface_helper.rb:141 294 #: app/helpers/customer_interface_helper.rb:143 295 #: app/helpers/customer_interface_helper.rb:164 296 #: app/helpers/customer_interface_helper.rb:166 297 #: app/helpers/customer_interface_helper.rb:168 298 #: app/helpers/customer_interface_helper.rb:170 299 #: app/helpers/customer_interface_helper.rb:172 300 #: app/helpers/customer_interface_helper.rb:174 301 #: app/helpers/customer_interface_helper.rb:193 302 #: app/controllers/customer_interface_controller.rb:161 303 303 #: app/views/task/_display_task_event.rhtml:6 304 304 #: app/views/task/_display_task_event.rhtml:8 … … 653 653 msgstr "cmmspohja" 654 654 655 #: app/helpers/customer_interface_helper.rb: 43655 #: app/helpers/customer_interface_helper.rb:71 656 656 #: app/helpers/application_helper.rb:428 657 657 #: app/controllers/form_controller.rb:461 … … 659 659 msgstr "Lomake" 660 660 661 #: app/helpers/customer_interface_helper.rb: 64661 #: app/helpers/customer_interface_helper.rb:96 662 662 #: app/helpers/application_helper.rb:451 663 663 msgid "Task" 664 664 msgstr "TehtÀvÀ" 665 665 666 #: app/helpers/customer_interface_helper.rb:89 666 #: app/helpers/customer_interface_helper.rb:98 667 #: app/controllers/customer_interface_controller.rb:250 668 msgid "Comment service request %s" 669 msgstr "Kommentoi palvelupyyntöÀ %s" 670 671 #: app/helpers/customer_interface_helper.rb:121 667 672 #: app/helpers/application_helper.rb:470 668 673 #: app/controllers/attachment_controller.rb:22 … … 672 677 msgstr "Liitetiedosto" 673 678 674 #: app/helpers/customer_interface_helper.rb:1 09679 #: app/helpers/customer_interface_helper.rb:141 675 680 #: app/views/timeline/_display_event.rhtml:37 676 681 msgid "Filled out by %s" 677 682 msgstr "TÀytetty kÀyttÀjÀn %s toimesta" 678 683 679 #: app/helpers/customer_interface_helper.rb:1 11684 #: app/helpers/customer_interface_helper.rb:143 680 685 #: app/views/timeline/_display_event.rhtml:39 681 686 msgid "Modified by %s" 682 687 msgstr "Muokattu kÀyttÀjÀn %s toimesta" 683 688 684 #: app/helpers/customer_interface_helper.rb:1 32689 #: app/helpers/customer_interface_helper.rb:164 685 690 #: app/views/task/_display_task_event.rhtml:6 686 691 #: app/views/timeline/_display_event.rhtml:14 … … 688 693 msgstr "Luotu kÀyttÀjÀn %s toimesta" 689 694 690 #: app/helpers/customer_interface_helper.rb:1 34695 #: app/helpers/customer_interface_helper.rb:166 691 696 #: app/views/task/_display_task_event.rhtml:8 692 697 #: app/views/timeline/_display_event.rhtml:16 … … 694 699 msgstr "Suljettu kÀyttÀjÀn %s toimesta" 695 700 696 #: app/helpers/customer_interface_helper.rb:1 36701 #: app/helpers/customer_interface_helper.rb:168 697 702 #: app/views/timeline/_display_event.rhtml:18 698 703 msgid "Assigned to %s by %s" 699 704 msgstr "%s asetettu vastuulliseksi kÀyttÀjÀn %s toimesta" 700 705 701 #: app/helpers/customer_interface_helper.rb:1 38706 #: app/helpers/customer_interface_helper.rb:170 702 707 #: app/views/task/_display_task_event.rhtml:12 703 708 #: app/views/timeline/_display_event.rhtml:20 … … 705 710 msgstr "HyvÀksytty kÀyttÀjÀn %s toimesta" 706 711 707 #: app/helpers/customer_interface_helper.rb:1 40712 #: app/helpers/customer_interface_helper.rb:172 708 713 #: app/views/task/_display_task_event.rhtml:14 709 714 #: app/views/timeline/_display_event.rhtml:22 … … 711 716 msgstr "Avattu uudestaan kÀyttÀjÀn %s toimesta" 712 717 713 #: app/helpers/customer_interface_helper.rb:1 42718 #: app/helpers/customer_interface_helper.rb:174 714 719 #: app/views/task/_display_task_event.rhtml:16 715 720 #: app/views/timeline/_display_event.rhtml:24 … … 717 722 msgstr "Kommentti lisÀtty kÀyttÀjÀn %s toimesta" 718 723 719 #: app/helpers/customer_interface_helper.rb:1 61724 #: app/helpers/customer_interface_helper.rb:193 720 725 #: app/views/timeline/_display_event.rhtml:52 721 726 msgid "Uploaded by %s" 722 727 msgstr "Tallennettu kÀyttÀjÀn %s toimesta" 723 728 724 #: app/helpers/customer_interface_helper.rb: 173729 #: app/helpers/customer_interface_helper.rb:205 725 730 #: app/controllers/task_controller.rb:452 726 731 #: app/controllers/overview_controller.rb:59 … … 728 733 msgstr "Uusi" 729 734 730 #: app/helpers/customer_interface_helper.rb: 175735 #: app/helpers/customer_interface_helper.rb:207 731 736 #: app/controllers/task_controller.rb:452 732 737 #: app/controllers/overview_controller.rb:59 … … 735 740 msgstr "Osoitettu työntekijÀlle" 736 741 737 #: app/helpers/customer_interface_helper.rb: 177742 #: app/helpers/customer_interface_helper.rb:209 738 743 #: app/controllers/task_controller.rb:452 739 744 #: app/controllers/overview_controller.rb:59 … … 742 747 msgstr "HyvÀksytty" 743 748 744 #: app/helpers/customer_interface_helper.rb: 179749 #: app/helpers/customer_interface_helper.rb:211 745 750 #: app/controllers/task_controller.rb:452 746 751 #: app/controllers/overview_controller.rb:65 … … 748 753 msgstr "Suljettu" 749 754 750 #: app/helpers/customer_interface_helper.rb: 191751 #: app/views/customer_interface/_item_list.rhtml: 48755 #: app/helpers/customer_interface_helper.rb:223 756 #: app/views/customer_interface/_item_list.rhtml:50 752 757 #: lib/localization.rb:17 753 758 msgid "%Y-%m-%d" 754 759 msgstr "%d.%m.%Y" 755 760 756 #: app/helpers/customer_interface_helper.rb: 191757 #: app/views/customer_interface/_item_list.rhtml: 48761 #: app/helpers/customer_interface_helper.rb:223 762 #: app/views/customer_interface/_item_list.rhtml:50 758 763 msgid "%H:%M" 759 764 msgstr "%H:%M" 760 765 761 #: app/helpers/customer_interface_helper.rb: 193766 #: app/helpers/customer_interface_helper.rb:225 762 767 msgid "by %s" 763 768 msgstr "%s toimesta" … … 927 932 928 933 #: app/controllers/asset_controller.rb:61 929 #: app/controllers/customer_interface_controller.rb:4 5930 #: app/controllers/customer_interface_controller.rb:16 3934 #: app/controllers/customer_interface_controller.rb:47 935 #: app/controllers/customer_interface_controller.rb:164 931 936 #: app/controllers/form_controller.rb:460 932 937 #: app/controllers/task_controller.rb:42 … … 939 944 #: app/views/task/_form.rhtml:51 940 945 #: app/views/form/view.rhtml:13 946 #: app/views/customer_interface/comment_service_request.rhtml:4 941 947 #: app/views/notification_mailer/task_notification.rhtml:5 942 948 #: config/menu.rb:56 … … 950 956 #: app/controllers/task_type_controller.rb:36 951 957 #: app/controllers/task_type_controller.rb:51 958 #: app/controllers/customer_interface_controller.rb:210 952 959 #: app/controllers/user_group_controller.rb:21 953 960 #: app/controllers/user_group_controller.rb:39 … … 959 966 #: app/controllers/customer_controller.rb:27 960 967 #: app/controllers/customer_controller.rb:49 961 #: app/controllers/customer_controller.rb:7 0968 #: app/controllers/customer_controller.rb:71 962 969 #: app/controllers/action_key_controller.rb:24 963 970 #: app/controllers/action_key_controller.rb:33 … … 1040 1047 #: app/controllers/task_type_controller.rb:37 1041 1048 #: app/controllers/task_type_controller.rb:52 1042 #: app/controllers/customer_interface_controller.rb:16 41049 #: app/controllers/customer_interface_controller.rb:165 1043 1050 #: app/controllers/asset_type_controller.rb:45 1044 1051 #: app/controllers/asset_type_controller.rb:55 … … 1046 1053 #: app/controllers/task_controller.rb:398 1047 1054 #: app/controllers/customer_controller.rb:50 1048 #: app/controllers/customer_controller.rb:7 11055 #: app/controllers/customer_controller.rb:72 1049 1056 #: app/controllers/user_controller.rb:99 1050 1057 #: app/controllers/user_controller.rb:111 … … 1224 1231 msgstr "YhtÀÀn tehtÀvÀpohjaa ei ole tallennettu palvelimelle." 1225 1232 1226 #: app/controllers/customer_interface_controller.rb:4 61233 #: app/controllers/customer_interface_controller.rb:48 1227 1234 msgid "Action" 1228 1235 msgstr "Tapahtuma" 1229 1236 1230 #: app/controllers/customer_interface_controller.rb:1 081237 #: app/controllers/customer_interface_controller.rb:110 1231 1238 #: app/controllers/message_controller.rb:21 1232 1239 #: app/views/message/send_message.rhtml:21 … … 1235 1242 msgstr "Aihe" 1236 1243 1237 #: app/controllers/customer_interface_controller.rb:1 091244 #: app/controllers/customer_interface_controller.rb:111 1238 1245 msgid "Status" 1239 1246 msgstr "Tila" 1240 1247 1241 #: app/controllers/customer_interface_controller.rb:11 01248 #: app/controllers/customer_interface_controller.rb:112 1242 1249 msgid "Last updated" 1243 1250 msgstr "Muokattu" 1244 1251 1245 #: app/controllers/customer_interface_controller.rb:15 61246 #: app/views/layouts/customer_interface.rhtml:5 71252 #: app/controllers/customer_interface_controller.rb:158 1253 #: app/views/layouts/customer_interface.rhtml:58 1247 1254 msgid "Submit service request" 1248 1255 msgstr "LÀhetÀ palvelupyyntö" 1249 1256 1250 #: app/controllers/customer_interface_controller.rb:16 21257 #: app/controllers/customer_interface_controller.rb:163 1251 1258 msgid "Summary" 1252 1259 msgstr "Yhteenveto" 1253 1260 1254 #: app/controllers/customer_interface_controller.rb:18 51261 #: app/controllers/customer_interface_controller.rb:186 1255 1262 msgid "Service request %s successfully received" 1256 1263 msgstr "Palvelupyyntö %s vastaanotettu" 1257 1264 1258 #: app/controllers/customer_interface_controller.rb:1 891265 #: app/controllers/customer_interface_controller.rb:190 1259 1266 msgid "Submitting" 1260 1267 msgstr "LÀhetys" 1268 1269 #: app/controllers/customer_interface_controller.rb:198 1270 #: app/views/customer_interface/comment_service_request.rhtml:15 1271 msgid "Submit" 1272 msgstr "LÀhetÀ" 1273 1274 #: app/controllers/customer_interface_controller.rb:206 1275 #: app/controllers/user_controller.rb:313 1276 #: app/views/layouts/customer_interface.rhtml:50 1277 #: config/menu.rb:15 1278 msgid "My information" 1279 msgstr "Omat tiedot" 1280 1281 #: app/controllers/customer_interface_controller.rb:211 1282 #: app/controllers/customer_controller.rb:28 1283 #: app/controllers/customer_controller.rb:46 1284 #: app/controllers/user_controller.rb:28 1285 #: app/controllers/user_controller.rb:48 1286 #: app/controllers/user_controller.rb:280 1287 #: app/controllers/user_controller.rb:317 1288 #: app/views/user/view.rhtml:6 1289 #: app/views/user/search.rhtml:4 1290 #: app/views/user/login.rhtml:34 1291 msgid "Username" 1292 msgstr "KÀyttÀjÀnimi" 1293 1294 #: app/controllers/customer_interface_controller.rb:212 1295 #: app/controllers/customer_controller.rb:51 1296 #: app/controllers/customer_controller.rb:73 1297 #: app/controllers/user_controller.rb:54 1298 #: app/controllers/user_controller.rb:86 1299 #: app/controllers/user_controller.rb:319 1300 #: app/views/user/view.rhtml:18 1301 msgid "Email address" 1302 msgstr "SÀhköpostiosoite" 1303 1304 #: app/controllers/customer_interface_controller.rb:213 1305 #: app/controllers/customer_controller.rb:52 1306 #: app/controllers/customer_controller.rb:74 1307 #: app/controllers/user_controller.rb:55 1308 #: app/controllers/user_controller.rb:87 1309 #: app/controllers/user_controller.rb:320 1310 #: app/views/user/view.rhtml:22 1311 msgid "Phone number" 1312 msgstr "Puhelinnumero" 1313 1314 #: app/controllers/customer_interface_controller.rb:214 1315 #: app/controllers/customer_controller.rb:53 1316 #: app/controllers/customer_controller.rb:75 1317 #: app/controllers/user_controller.rb:57 1318 #: app/controllers/user_controller.rb:89 1319 #: app/controllers/user_controller.rb:322 1320 #: app/views/user/view.rhtml:30 1321 msgid "City" 1322 msgstr "Kaupunki" 1323 1324 #: app/controllers/customer_interface_controller.rb:215 1325 #: app/controllers/customer_controller.rb:54 1326 #: app/controllers/customer_controller.rb:76 1327 #: app/controllers/user_controller.rb:58 1328 #: app/controllers/user_controller.rb:90 1329 #: app/controllers/user_controller.rb:323 1330 #: app/views/user/view.rhtml:34 1331 msgid "Country" 1332 msgstr "Maa" 1333 1334 #: app/controllers/customer_interface_controller.rb:216 1335 #: app/controllers/customer_controller.rb:55 1336 #: app/controllers/customer_controller.rb:77 1337 #: app/controllers/user_controller.rb:93 1338 #: app/controllers/user_controller.rb:326 1339 msgid "Language" 1340 msgstr "Kieli" 1341 1342 #: app/controllers/customer_interface_controller.rb:228 1343 #: app/controllers/user_controller.rb:343 1344 msgid "Your information has been updated" 1345 msgstr "Tiedot pÀivitetty" 1346 1347 #: app/controllers/customer_interface_controller.rb:231 1348 #: app/controllers/user_controller.rb:345 1349 msgid "Unable to update your information" 1350 msgstr "Tietojen pÀivittÀminen epÀonnistui" 1351 1352 #: app/controllers/customer_interface_controller.rb:253 1353 msgid "Service request %s not found!" 1354 msgstr "PalvelupyyntöÀ %s ei löydy!" 1355 1356 #: app/controllers/customer_interface_controller.rb:261 1357 msgid "Comment successfully received" 1358 msgstr "Kommentti vastaanotettu" 1359 1360 #: app/controllers/customer_interface_controller.rb:267 1361 msgid "Comment can't be empty. Please provide one." 1362 msgstr "Kommentti ei voi olla tyhjÀ. Ole hyvÀ ja tÀytÀ se." 1261 1363 1262 1364 #: app/controllers/application.rb:53 … … 1295 1397 msgstr "Salasana vaihdettu" 1296 1398 1297 #: app/controllers/application.rb:43 71399 #: app/controllers/application.rb:438 1298 1400 msgid "Unable to reset password" 1299 1401 msgstr "Salasanan vaihtaminen epÀonnistui" 1402 1403 #: app/controllers/application.rb:459 1404 #: app/views/customer_interface/_edit_my_information.rhtml:1 1405 #: app/views/customer_interface/edit_my_information.rhtml:1 1406 #: config/menu.rb:16 1407 msgid "Change password" 1408 msgstr "Vaihda salasana" 1409 1410 #: app/controllers/application.rb:467 1411 msgid "Your password has been changed" 1412 msgstr "Salasana vaihdettu" 1413 1414 #: app/controllers/application.rb:471 1415 msgid "Unable to change your password" 1416 msgstr "Salasanan vaihtaminen epÀonnistui" 1417 1418 #: app/controllers/application.rb:474 1419 msgid "Invalid password" 1420 msgstr "VÀÀrÀ salasana" 1300 1421 1301 1422 #: app/controllers/data_permission_controller.rb:25 … … 1696 1817 1697 1818 #: app/controllers/task_controller.rb:215 1698 #: app/controllers/customer_controller.rb:11 81819 #: app/controllers/customer_controller.rb:119 1699 1820 msgid "No task types defined." 1700 1821 msgstr "YhtÀÀn tehtÀvÀtyyppiÀ ei ole mÀÀritelty." … … 1830 1951 msgstr "Asiakkaat" 1831 1952 1832 #: app/controllers/customer_controller.rb:281833 #: app/controllers/customer_controller.rb:461834 #: app/controllers/user_controller.rb:281835 #: app/controllers/user_controller.rb:481836 #: app/controllers/user_controller.rb:2801837 #: app/controllers/user_controller.rb:3171838 #: app/views/user/view.rhtml:61839 #: app/views/user/search.rhtml:41840 #: app/views/user/login.rhtml:341841 msgid "Username"1842 msgstr "KÀyttÀjÀnimi"1843 1844 1953 #: app/controllers/customer_controller.rb:29 1845 1954 msgid "Assets" … … 1861 1970 msgstr "Varmista salasana" 1862 1971 1863 #: app/controllers/customer_controller.rb:51 1864 #: app/controllers/customer_controller.rb:72 1865 #: app/controllers/user_controller.rb:54 1866 #: app/controllers/user_controller.rb:86 1867 #: app/controllers/user_controller.rb:319 1868 #: app/views/user/view.rhtml:18 1869 msgid "Email address" 1870 msgstr "SÀhköpostiosoite" 1871 1872 #: app/controllers/customer_controller.rb:52 1873 #: app/controllers/customer_controller.rb:73 1874 #: app/controllers/user_controller.rb:55 1875 #: app/controllers/user_controller.rb:87 1876 #: app/controllers/user_controller.rb:320 1877 #: app/views/user/view.rhtml:22 1878 msgid "Phone number" 1879 msgstr "Puhelinnumero" 1880 1881 #: app/controllers/customer_controller.rb:53 1882 #: app/controllers/customer_controller.rb:74 1883 #: app/controllers/user_controller.rb:57 1884 #: app/controllers/user_controller.rb:89 1885 #: app/controllers/user_controller.rb:322 1886 #: app/views/user/view.rhtml:30 1887 msgid "City" 1888 msgstr "Kaupunki" 1889 1890 #: app/controllers/customer_controller.rb:54 1891 #: app/controllers/customer_controller.rb:75 1892 #: app/controllers/user_controller.rb:58 1893 #: app/controllers/user_controller.rb:90 1894 #: app/controllers/user_controller.rb:323 1895 #: app/views/user/view.rhtml:34 1896 msgid "Country" 1897 msgstr "Maa" 1898 1899 #: app/controllers/customer_controller.rb:55 1900 #: app/controllers/customer_controller.rb:76 1901 #: app/controllers/user_controller.rb:93 1902 #: app/controllers/user_controller.rb:326 1903 msgid "Language" 1904 msgstr "Kieli" 1905 1906 #: app/controllers/customer_controller.rb:67 1972 #: app/controllers/customer_controller.rb:56 1973 msgid "Send email notification" 1974 msgstr "LÀhetÀ sÀhköposti-ilmoitus" 1975 1976 #: app/controllers/customer_controller.rb:68 1907 1977 msgid "Edit customer: %s" 1908 1978 msgstr "Muokkaa asiakasta: %s" 1909 1979 1910 #: app/controllers/customer_controller.rb:8 81980 #: app/controllers/customer_controller.rb:89 1911 1981 msgid "Customer information" 1912 1982 msgstr "Asiakkaan tiedot" 1913 1983 1914 #: app/controllers/customer_controller.rb:11 21984 #: app/controllers/customer_controller.rb:113 1915 1985 msgid "Select a type for service requests" 1916 1986 msgstr "Valitse palvelupyyntöjen tyyppi" … … 2142 2212 msgstr "KÀyttÀjÀn %s tiedot" 2143 2213 2144 #: app/controllers/user_controller.rb:3132145 #: config/menu.rb:152146 msgid "My information"2147 msgstr "Omat tiedot"2148 2149 2214 #: app/controllers/user_controller.rb:324 2150 2215 msgid "Send notification when I'm assigned to task as responsible user" … … 2154 2219 msgid "Send notification when I'm assigned to task as worker" 2155 2220 msgstr "LÀhteÀ ilmoitus kun minut mÀrÀtÀÀn työntekijÀksi tehtÀvÀÀn" 2156 2157 #: app/controllers/user_controller.rb:3432158 msgid "Your information has been updated"2159 msgstr "Tiedot pÀivitetty"2160 2161 #: app/controllers/user_controller.rb:3452162 msgid "Unable to update your information"2163 msgstr "Tietojen pÀivittÀminen epÀonnistui"2164 2165 #: app/controllers/user_controller.rb:3542166 #: config/menu.rb:162167 msgid "Change password"2168 msgstr "Vaihda salasana"2169 2170 #: app/controllers/user_controller.rb:3622171 msgid "Your password has been changed"2172 msgstr "Salasana vaihdettu"2173 2174 #: app/controllers/user_controller.rb:3652175 msgid "Unable to change your password"2176 msgstr "Salasanan vaihtaminen epÀonnistui"2177 2178 #: app/controllers/user_controller.rb:3682179 msgid "Invalid password"2180 msgstr "VÀÀrÀ salasana"2181 2221 2182 2222 #: app/controllers/form_type_controller.rb:19 … … 3078 3118 3079 3119 #: app/views/shared/reset_password.rhtml:6 3080 #: app/views/ user/change_password.rhtml:103120 #: app/views/shared/change_password.rhtml:10 3081 3121 msgid "New password" 3082 3122 msgstr "Uusi salasana" 3083 3123 3084 3124 #: app/views/shared/reset_password.rhtml:10 3085 #: app/views/ user/change_password.rhtml:143125 #: app/views/shared/change_password.rhtml:14 3086 3126 msgid "New password confirmation" 3087 3127 msgstr "Uuden salasanan varmistus" … … 3102 3142 msgid "Reset password" 3103 3143 msgstr "Nollaa salasana" 3144 3145 #: app/views/shared/change_password.rhtml:6 3146 msgid "Old password" 3147 msgstr "Vanha salasana" 3148 3149 #: app/views/shared/change_password.rhtml:18 3150 msgid "Change" 3151 msgstr "Vaihda" 3104 3152 3105 3153 #: app/views/shared/_list_items.rhtml:168 … … 3115 3163 3116 3164 #: app/views/shared/_list_items.rhtml:196 3117 #, fuzzy3118 3165 msgid "Export list:" 3119 msgstr " Raporttilista"3166 msgstr "Vie lista:" 3120 3167 3121 3168 #: app/views/shared/_list_items.rhtml:197 … … 3137 3184 #: app/views/shared/_list_items.rhtml:311 3138 3185 #: app/views/shared/export_items_csv.rhtml:37 3139 #: app/views/customer_interface/_item_list.rhtml:6 23186 #: app/views/customer_interface/_item_list.rhtml:64 3140 3187 msgid "No" 3141 3188 msgstr "Ei" … … 3144 3191 #: app/views/shared/export_items_csv.rhtml:39 3145 3192 #: app/views/form/remove.rhtml:5 3146 #: app/views/customer_interface/_item_list.rhtml:6 43193 #: app/views/customer_interface/_item_list.rhtml:66 3147 3194 msgid "Yes" 3148 3195 msgstr "KyllÀ" … … 3169 3216 msgstr "Kirjaudu sisÀÀn" 3170 3217 3171 #: app/views/user/change_password.rhtml:63172 msgid "Old password"3173 msgstr "Vanha salasana"3174 3175 #: app/views/user/change_password.rhtml:183176 msgid "Change"3177 msgstr "Vaihda"3178 3179 3218 #: app/views/user/edit.rhtml:1 3180 3219 msgid "User information" … … 3214 3253 3215 3254 #: app/views/layouts/mainlevel.rhtml:86 3216 #: app/views/layouts/customer_interface.rhtml: 493255 #: app/views/layouts/customer_interface.rhtml:50 3217 3256 msgid "Logged in as" 3218 3257 msgstr "Kirjauduttu tunnuksella" … … 3320 3359 msgstr "TÀytÀ kuvakenttÀ" 3321 3360 3361 #: app/views/customer_interface/comment_service_request.rhtml:7 3362 msgid "Message" 3363 msgstr "Viesti" 3364 3322 3365 #: app/views/customer_interface/_list_pagination.rhtml:15 3323 3366 msgid "Previous" … … 3329 3372 msgstr "Aikajana" 3330 3373 3331 #: app/views/customer_interface/index.rhtml:1 63374 #: app/views/customer_interface/index.rhtml:17 3332 3375 msgid "My assets" 3333 3376 msgstr "Omat kohteet" 3334 3377 3335 #: app/views/customer_interface/index.rhtml:2 53378 #: app/views/customer_interface/index.rhtml:26 3336 3379 msgid "Open service requests" 3337 3380 msgstr "Avoimet palvelupyynnöt" 3338 3381 3339 #: app/views/customer_interface/index.rhtml:363340 3382 #: app/views/customer_interface/index.rhtml:39 3383 #: app/views/customer_interface/index.rhtml:42 3341 3384 msgid "Statistics" 3342 3385 msgstr "Tilasto" 3343 3386 3344 #: app/views/customer_interface/index.rhtml: 383387 #: app/views/customer_interface/index.rhtml:41 3345 3388 msgid "Open service requests by asset" 3346 3389 msgstr "Avoimet palvelupyynnöt kohteittain" … … 3437 3480 3438 3481 #: config/gettext_hack.rb:- 3482 msgid "customer" 3483 msgstr "asiakas" 3484 3485 #: config/gettext_hack.rb:- 3486 msgid "asset" 3487 msgstr "kohde" 3488 3489 #: config/gettext_hack.rb:- 3490 msgid "Asset|Parent" 3491 msgstr "Vanhempi" 3492 3493 #: config/gettext_hack.rb:- 3494 msgid "Asset|Asset type" 3495 msgstr "Kohdetyyppi" 3496 3497 #: config/gettext_hack.rb:- 3498 msgid "Asset|Created at" 3499 msgstr "Luotu" 3500 3501 #: config/gettext_hack.rb:- 3502 msgid "Asset|Code" 3503 msgstr "Koodi" 3504 3505 #: config/gettext_hack.rb:- 3506 msgid "Asset|Name" 3507 msgstr "Nimi" 3508 3509 #: config/gettext_hack.rb:- 3510 msgid "Asset|Description" 3511 msgstr "Kuvaus" 3512 3513 #: config/gettext_hack.rb:- 3514 msgid "Asset|Lock timeout" 3515 msgstr "Lukon aikakatkaisu" 3516 3517 #: config/gettext_hack.rb:- 3518 msgid "Asset|Lock user" 3519 msgstr "Lukon omistaja" 3520 3521 #: config/gettext_hack.rb:- 3522 msgid "Asset|Use parents permissions" 3523 msgstr "KÀytÀ ylemmÀn kohteen kÀyttöoikeuksia" 3524 3525 #: config/gettext_hack.rb:- 3526 msgid "Asset|Customer" 3527 msgstr "Asiakas" 3528 3529 #: config/gettext_hack.rb:- 3530 msgid "task type" 3531 msgstr "tehtÀvÀtyyppi" 3532 3533 #: config/gettext_hack.rb:- 3534 msgid "TaskType|Name" 3535 msgstr "Nimi" 3536 3537 #: config/gettext_hack.rb:- 3538 msgid "TaskType|Description" 3539 msgstr "Kuvaus" 3540 3541 #: config/gettext_hack.rb:- 3542 msgid "TaskType|Notification email" 3543 msgstr "Ilmoitusten osoite" 3544 3545 #: config/gettext_hack.rb:- 3546 msgid "TaskType|Notify on create" 3547 msgstr "Ilmoita luotaessa" 3548 3549 #: config/gettext_hack.rb:- 3550 msgid "TaskType|Notify on assign" 3551 msgstr "Ilmoita mÀÀrÀtessÀ" 3552 3553 #: config/gettext_hack.rb:- 3554 msgid "TaskType|Notify on accept" 3555 msgstr "Ilmoita hyvÀksyttÀessÀ" 3556 3557 #: config/gettext_hack.rb:- 3558 msgid "TaskType|Notify on close" 3559 msgstr "Ilmoita suljettaessa" 3560 3561 #: config/gettext_hack.rb:- 3562 msgid "TaskType|Notify on open" 3563 msgstr "Ilmoita avattaessa" 3564 3565 #: config/gettext_hack.rb:- 3566 msgid "TaskType|Is service request type" 3567 msgstr "Palvelupyyntöjen tyyppi" 3568 3569 #: config/gettext_hack.rb:- 3439 3570 msgid "form" 3440 3571 msgstr "lomake" … … 3485 3616 3486 3617 #: config/gettext_hack.rb:- 3487 msgid "customer"3488 msgstr "asiakas"3489 3490 #: config/gettext_hack.rb:-3491 3618 msgid "attachment" 3492 3619 msgstr "Liitetiedosto" … … 3627 3754 msgid "Task|Other edit" 3628 3755 msgstr "Muut muokkaus" 3629 3630 #: config/gettext_hack.rb:-3631 msgid "asset"3632 msgstr "kohde"3633 3634 #: config/gettext_hack.rb:-3635 msgid "Asset|Parent"3636 msgstr "Vanhempi"3637 3638 #: config/gettext_hack.rb:-3639 msgid "Asset|Asset type"3640 msgstr "Kohdetyyppi"3641 3642 #: config/gettext_hack.rb:-3643 msgid "Asset|Created at"3644 msgstr "Luotu"3645 3646 #: config/gettext_hack.rb:-3647 msgid "Asset|Code"3648 msgstr "Koodi"3649 3650 #: config/gettext_hack.rb:-3651 msgid "Asset|Name"3652 msgstr "Nimi"3653 3654 #: config/gettext_hack.rb:-3655 msgid "Asset|Description"3656 msgstr "Kuvaus"3657 3658 #: config/gettext_hack.rb:-3659 msgid "Asset|Lock timeout"3660 msgstr "Lukon aikakatkaisu"3661 3662 #: config/gettext_hack.rb:-3663 msgid "Asset|Lock user"3664 msgstr "Lukon omistaja"3665 3666 #: config/gettext_hack.rb:-3667 msgid "Asset|Use parents permissions"3668 msgstr "KÀytÀ ylemmÀn kohteen kÀyttöoikeuksia"3669 3670 #: config/gettext_hack.rb:-3671 msgid "Asset|Customer"3672 msgstr "Asiakas"3673 3674 #: config/gettext_hack.rb:-3675 msgid "task type"3676 msgstr "tehtÀvÀtyyppi"3677 3678 #: config/gettext_hack.rb:-3679 msgid "TaskType|Name"3680 msgstr "Nimi"3681 3682 #: config/gettext_hack.rb:-3683 msgid "TaskType|Description"3684 msgstr "Kuvaus"3685 3686 #: config/gettext_hack.rb:-3687 msgid "TaskType|Notification email"3688 msgstr "Ilmoitusten osoite"3689 3690 #: config/gettext_hack.rb:-3691 msgid "TaskType|Notify on create"3692 msgstr "Ilmoita luotaessa"3693 3694 #: config/gettext_hack.rb:-3695 msgid "TaskType|Notify on assign"3696 msgstr "Ilmoita mÀÀrÀtessÀ"3697 3698 #: config/gettext_hack.rb:-3699 msgid "TaskType|Notify on accept"3700 msgstr "Ilmoita hyvÀksyttÀessÀ"3701 3702 #: config/gettext_hack.rb:-3703 msgid "TaskType|Notify on close"3704 msgstr "Ilmoita suljettaessa"3705 3706 #: config/gettext_hack.rb:-3707 msgid "TaskType|Notify on open"3708 msgstr "Ilmoita avattaessa"3709 3710 #: config/gettext_hack.rb:-3711 msgid "TaskType|Is service request type"3712 msgstr "Palvelupyyntöjen tyyppi"3713 3756 3714 3757 #: config/gettext_hack.rb:23 trunk/public/javascripts/application.js
r509 r713 60 60 * update_field_enabled('foobar') enables #foobar. Otherwise it disables 61 61 * #foobar. 62 * 62 * 63 63 * Parameters: 64 64 * ----------- … … 75 75 field.setAttribute('disabled', 'true'); 76 76 } 77 78 /* Function: disable_notify_new_user 79 * ================================= 80 * Disables/enables the input with id 'model_notify_new_user' 81 * based on the content of the input with id 'model_email'. 82 */ 83 function disable_notify_new_user() 84 { 85 var textField = $('model_email'); 86 var checkBox = $('model_notify_new_user'); 87 88 if (textField.value.length > 0) 89 checkBox.disabled = false; 90 else 91 checkBox.disabled = true; 92 } trunk/test/functional/customer_controller_test.rb
r708 r713 15 15 @task_type = TaskType.create!(:name => 'Test') 16 16 assert @task_type.set_as_service_request_type 17 18 ActionMailer::Base.delivery_method = :test 19 ActionMailer::Base.perform_deliveries = true 20 ActionMailer::Base.deliveries = [] 17 21 end 18 22 … … 47 51 get 'create' 48 52 assert_response :success 53 assert_template 'customer/_create' 49 54 50 55 fields = assigns(:fields) … … 125 130 end 126 131 132 # Method: test_create_and_notify 133 # ============================== 134 # Checks that email notification is sent to new customer when notify_new_user is set. 135 # 136 def test_create_and_notify 137 @keyring.action_keys << create_action_key('customer/create') 138 login('test') 139 140 # Create a valid customer with minimal info 141 attributes = { 142 'login' => 'customer', 143 'password' => 'secret', 144 'password_confirmation' => 'secret', 145 'name' => 'Test', 146 'email' => 'test@example.com', 147 'notify_new_user' => '1' 148 } 149 post 'create', :model => attributes 150 assert_response :redirect 151 assert_redirected_to :controller => 'customer', :action => 'list' 152 153 # Check that the customer was added succesfully and 154 # that authentication works for him. 155 new_customer = UserAccount.authenticate(attributes['login'], attributes['password']) 156 assert_equal true, new_customer.is_a?(Customer) 157 assert_equal assigns(:model), new_customer 158 159 &nbs