You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2011-10-24 11:35:48
|
Revision: 130 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=130&view=rev Author: mennodekker Date: 2011-10-24 11:35:15 +0000 (Mon, 24 Oct 2011) Log Message: ----------- Updated translations, Dutch still needs to be updated (corrected 'port' translation in Dutch) Modified Paths: -------------- trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-10-24 11:30:45 UTC (rev 129) +++ trunk/library/languages/default-en.po 2011-10-24 11:35:15 UTC (rev 130) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-20 17:52+0100\n" +"POT-Creation-Date: 2011-10-24 13:32+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" +"Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -477,7 +477,7 @@ msgid "Cancel" msgstr "Cancel" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:164 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:168 msgid "No data found." msgstr "No data found." @@ -583,7 +583,7 @@ msgstr "Description" #: classes/Gems/Default/ConsentAction.php:68 -#: classes/Gems/Default/DatabaseAction.php:155 +#: classes/Gems/Default/DatabaseAction.php:167 msgid "Order" msgstr "Order" @@ -666,277 +666,277 @@ msgid "No script for %1$s." msgstr "No script for %1$s." -#: classes/Gems/Default/DatabaseAction.php:121 +#: classes/Gems/Default/DatabaseAction.php:133 #, php-format msgid "No rows in %s." msgstr "No rows in %s." -#: classes/Gems/Default/DatabaseAction.php:150 +#: classes/Gems/Default/DatabaseAction.php:162 msgid "Type" msgstr "Type" -#: classes/Gems/Default/DatabaseAction.php:154 +#: classes/Gems/Default/DatabaseAction.php:166 msgid "Group" msgstr "Group" -#: classes/Gems/Default/DatabaseAction.php:156 +#: classes/Gems/Default/DatabaseAction.php:168 msgid "Location" msgstr "Location" -#: classes/Gems/Default/DatabaseAction.php:159 +#: classes/Gems/Default/DatabaseAction.php:171 msgid "Status" msgstr "Status" -#: classes/Gems/Default/DatabaseAction.php:160 +#: classes/Gems/Default/DatabaseAction.php:172 msgid "created" msgstr "created" -#: classes/Gems/Default/DatabaseAction.php:161 +#: classes/Gems/Default/DatabaseAction.php:173 msgid "not created" msgstr "not created" -#: classes/Gems/Default/DatabaseAction.php:162 +#: classes/Gems/Default/DatabaseAction.php:174 msgid "unknown" msgstr "unknown" -#: classes/Gems/Default/DatabaseAction.php:165 +#: classes/Gems/Default/DatabaseAction.php:177 msgid "Script" msgstr "Script" -#: classes/Gems/Default/DatabaseAction.php:167 +#: classes/Gems/Default/DatabaseAction.php:179 msgid "Changed on" msgstr "Changed on" -#: classes/Gems/Default/DatabaseAction.php:184 +#: classes/Gems/Default/DatabaseAction.php:198 msgid "This database object does not exist. You cannot delete it." msgstr "This database object does not exist. You cannot delete it." -#: classes/Gems/Default/DatabaseAction.php:189 +#: classes/Gems/Default/DatabaseAction.php:203 #, php-format msgid "Drop %s" msgstr "Drop %s" -#: classes/Gems/Default/DatabaseAction.php:197 +#: classes/Gems/Default/DatabaseAction.php:211 #, php-format msgid "There are %d rows in the table." msgstr "There are %d rows in the table." -#: classes/Gems/Default/DatabaseAction.php:199 +#: classes/Gems/Default/DatabaseAction.php:213 #, php-format msgid "Drop table with %d rows" msgstr "Drop table with %d rows" -#: classes/Gems/Default/DatabaseAction.php:200 +#: classes/Gems/Default/DatabaseAction.php:214 msgid "Are you really sure?" msgstr "Are you really sure?" -#: classes/Gems/Default/DatabaseAction.php:216 +#: classes/Gems/Default/DatabaseAction.php:230 #, php-format msgid "%1$s %2$s dropped" msgstr "%1$s %2$s dropped" -#: classes/Gems/Default/DatabaseAction.php:221 +#: classes/Gems/Default/DatabaseAction.php:235 msgid " during statement " msgstr " during statement " -#: classes/Gems/Default/DatabaseAction.php:232 +#: classes/Gems/Default/DatabaseAction.php:246 #, php-format msgid "%s no longer exists in the database." msgstr "%s no longer exists in the database." -#: classes/Gems/Default/DatabaseAction.php:235 +#: classes/Gems/Default/DatabaseAction.php:249 #, php-format msgid "%s does not yet exist in the database." msgstr "%s does not yet exist in the database." -#: classes/Gems/Default/DatabaseAction.php:238 +#: classes/Gems/Default/DatabaseAction.php:252 #, php-format msgid "%s object does exist." msgstr "%s object does exist." -#: classes/Gems/Default/DatabaseAction.php:256 +#: classes/Gems/Default/DatabaseAction.php:270 msgid "Object is not a table." msgstr "Object is not a table." -#: classes/Gems/Default/DatabaseAction.php:279 +#: classes/Gems/Default/DatabaseAction.php:293 msgid "Structure" msgstr "Structure" -#: classes/Gems/Default/DatabaseAction.php:288 +#: classes/Gems/Default/DatabaseAction.php:302 msgid "database object" msgid_plural "database objects" msgstr[0] "database object" msgstr[1] "database objects" -#: classes/Gems/Default/DatabaseAction.php:293 +#: classes/Gems/Default/DatabaseAction.php:307 msgid "Database object overview" msgstr "Database object overview" -#: classes/Gems/Default/DatabaseAction.php:302 -#: classes/Gems/Default/DatabaseAction.php:348 +#: classes/Gems/Default/DatabaseAction.php:316 +#: classes/Gems/Default/DatabaseAction.php:362 msgid "Level" msgstr "Level" -#: classes/Gems/Default/DatabaseAction.php:303 -#: classes/Gems/Default/DatabaseAction.php:349 +#: classes/Gems/Default/DatabaseAction.php:317 +#: classes/Gems/Default/DatabaseAction.php:363 msgid "Subtype" msgstr "Subtype" -#: classes/Gems/Default/DatabaseAction.php:305 +#: classes/Gems/Default/DatabaseAction.php:319 msgid "To be executed" msgstr "To be executed" -#: classes/Gems/Default/DatabaseAction.php:306 -#: classes/Gems/Default/DatabaseAction.php:352 +#: classes/Gems/Default/DatabaseAction.php:320 +#: classes/Gems/Default/DatabaseAction.php:366 msgid "Executed" msgstr "Executed" -#: classes/Gems/Default/DatabaseAction.php:307 -#: classes/Gems/Default/DatabaseAction.php:353 +#: classes/Gems/Default/DatabaseAction.php:321 +#: classes/Gems/Default/DatabaseAction.php:367 msgid "Finished" msgstr "Finished" -#: classes/Gems/Default/DatabaseAction.php:310 +#: classes/Gems/Default/DatabaseAction.php:324 msgid "Create the patch table!" msgstr "Create the patch table!" -#: classes/Gems/Default/DatabaseAction.php:312 +#: classes/Gems/Default/DatabaseAction.php:326 #, php-format msgid "%d new or changed patch(es)." msgstr "%d new or changed patch(es)." -#: classes/Gems/Default/DatabaseAction.php:317 +#: classes/Gems/Default/DatabaseAction.php:331 msgid "Gems build" msgstr "Gems build" -#: classes/Gems/Default/DatabaseAction.php:318 +#: classes/Gems/Default/DatabaseAction.php:332 msgid "Database build" msgstr "Database build" -#: classes/Gems/Default/DatabaseAction.php:320 +#: classes/Gems/Default/DatabaseAction.php:334 msgid "Execute level" msgstr "Execute level" -#: classes/Gems/Default/DatabaseAction.php:324 +#: classes/Gems/Default/DatabaseAction.php:338 msgid "Ignore finished" msgstr "Ignore finished" -#: classes/Gems/Default/DatabaseAction.php:325 +#: classes/Gems/Default/DatabaseAction.php:339 msgid "Ignore executed" msgstr "Ignore executed" -#: classes/Gems/Default/DatabaseAction.php:326 +#: classes/Gems/Default/DatabaseAction.php:340 msgid "Show patches" msgstr "Show patches" -#: classes/Gems/Default/DatabaseAction.php:342 +#: classes/Gems/Default/DatabaseAction.php:356 #, php-format msgid "%d patch(es) executed." msgstr "%d patch(es) executed." -#: classes/Gems/Default/DatabaseAction.php:347 +#: classes/Gems/Default/DatabaseAction.php:361 msgid "Patch" msgstr "Patch" -#: classes/Gems/Default/DatabaseAction.php:351 +#: classes/Gems/Default/DatabaseAction.php:365 msgid "Query" msgstr "Query" -#: classes/Gems/Default/DatabaseAction.php:354 +#: classes/Gems/Default/DatabaseAction.php:368 msgid "Result" msgstr "Result" -#: classes/Gems/Default/DatabaseAction.php:378 +#: classes/Gems/Default/DatabaseAction.php:392 msgid "Patch maintenance" msgstr "Patch maintenance" -#: classes/Gems/Default/DatabaseAction.php:382 +#: classes/Gems/Default/DatabaseAction.php:396 msgid "Patch overview" msgstr "Patch overview" -#: classes/Gems/Default/DatabaseAction.php:442 +#: classes/Gems/Default/DatabaseAction.php:458 msgid "This database object does not exist. You cannot create it." msgstr "This database object does not exist. You cannot create it." -#: classes/Gems/Default/DatabaseAction.php:448 +#: classes/Gems/Default/DatabaseAction.php:464 msgid "This database object has no script. You cannot execute it." msgstr "This database object has no script. You cannot execute it." -#: classes/Gems/Default/DatabaseAction.php:459 +#: classes/Gems/Default/DatabaseAction.php:475 #, php-format msgid "Run %s" msgstr "Run %s" -#: classes/Gems/Default/DatabaseAction.php:478 +#: classes/Gems/Default/DatabaseAction.php:494 #, php-format msgid "Starting %d object creation scripts." msgstr "Starting %d object creation scripts." -#: classes/Gems/Default/DatabaseAction.php:483 +#: classes/Gems/Default/DatabaseAction.php:499 #, php-format msgid "Finished %s creation script for object %d of %d" msgstr "Finished %s creation script for object %d of %d" -#: classes/Gems/Default/DatabaseAction.php:487 +#: classes/Gems/Default/DatabaseAction.php:503 msgid "All objects exist. Nothing was executed." msgstr "All objects exist. Nothing was executed." -#: classes/Gems/Default/DatabaseAction.php:493 +#: classes/Gems/Default/DatabaseAction.php:509 msgid "Create not-existing database objects" msgstr "Create not-existing database objects" -#: classes/Gems/Default/DatabaseAction.php:495 +#: classes/Gems/Default/DatabaseAction.php:511 #, php-format msgid "One database object does not exist." msgid_plural "These %d database objects do not exist." msgstr[0] "One database object does not exist." msgstr[1] "These %d database objects do not exist." -#: classes/Gems/Default/DatabaseAction.php:496 +#: classes/Gems/Default/DatabaseAction.php:512 msgid "Are you sure you want to create it?" msgid_plural "Are you sure you want to create them all?" msgstr[0] "Are you sure you want to create it?" msgstr[1] "Are you sure you want to create them all?" -#: classes/Gems/Default/DatabaseAction.php:509 +#: classes/Gems/Default/DatabaseAction.php:525 msgid "All database objects exist. There is nothing to create." msgstr "All database objects exist. There is nothing to create." -#: classes/Gems/Default/DatabaseAction.php:522 +#: classes/Gems/Default/DatabaseAction.php:538 msgid "Separate multiple commands with semicolons (;)." msgstr "Separate multiple commands with semicolons (;)." -#: classes/Gems/Default/DatabaseAction.php:529 +#: classes/Gems/Default/DatabaseAction.php:545 msgid "Run" msgstr "Run" -#: classes/Gems/Default/DatabaseAction.php:538 +#: classes/Gems/Default/DatabaseAction.php:554 msgid "raw" msgstr "raw" -#: classes/Gems/Default/DatabaseAction.php:547 +#: classes/Gems/Default/DatabaseAction.php:563 #, php-format msgid "Result set %s." msgstr "Result set %s." -#: classes/Gems/Default/DatabaseAction.php:570 +#: classes/Gems/Default/DatabaseAction.php:586 msgid "Execute raw SQL" msgstr "Execute raw SQL" -#: classes/Gems/Default/DatabaseAction.php:573 +#: classes/Gems/Default/DatabaseAction.php:589 msgid "Result sets" msgstr "Result sets" -#: classes/Gems/Default/DatabaseAction.php:596 +#: classes/Gems/Default/DatabaseAction.php:614 msgid "This database object does not exist. You cannot view it." msgstr "This database object does not exist. You cannot view it." -#: classes/Gems/Default/DatabaseAction.php:601 +#: classes/Gems/Default/DatabaseAction.php:619 #, php-format msgid "The data in table %s" msgstr "The data in table %s" -#: classes/Gems/Default/DatabaseAction.php:602 +#: classes/Gems/Default/DatabaseAction.php:620 #, php-format msgid "Contents of %s %s" msgstr "Contents of %s %s" @@ -950,6 +950,7 @@ msgstr "Export data" #: classes/Gems/Default/ExportAction.php:155 +#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Survey" @@ -959,6 +960,7 @@ msgstr "%s records found." #: classes/Gems/Default/ExportAction.php:174 +#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -971,6 +973,7 @@ msgstr "Role" #: classes/Gems/Default/GroupAction.php:91 +#: classes/Gems/Default/MailJobAction.php:105 msgid "Active" msgstr "Active" @@ -984,70 +987,70 @@ msgid "Administrative groups" msgstr "Administrative groups" -#: classes/Gems/Default/IndexAction.php:93 +#: classes/Gems/Default/IndexAction.php:98 #, php-format msgid "Login to %s application" msgstr "Login to %s application" -#: classes/Gems/Default/IndexAction.php:97 -#: classes/Gems/Default/IndexAction.php:256 +#: classes/Gems/Default/IndexAction.php:102 +#: classes/Gems/Default/IndexAction.php:270 msgid "Username" msgstr "Username" -#: classes/Gems/Default/IndexAction.php:105 +#: classes/Gems/Default/IndexAction.php:110 #: classes/Gems/Default/MailServerAction.php:88 msgid "Password" msgstr "Password" -#: classes/Gems/Default/IndexAction.php:114 +#: classes/Gems/Default/IndexAction.php:119 msgid "Login" msgstr "Login" -#: classes/Gems/Default/IndexAction.php:121 +#: classes/Gems/Default/IndexAction.php:126 msgid "Enter your token..." msgstr "Enter your token..." -#: classes/Gems/Default/IndexAction.php:161 -#: classes/Gems/Default/IndexAction.php:196 +#: classes/Gems/Default/IndexAction.php:175 +#: classes/Gems/Default/IndexAction.php:210 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:222 +#: classes/Gems/Default/IndexAction.php:236 msgid "Good bye: " msgstr "Good bye: " -#: classes/Gems/Default/IndexAction.php:252 +#: classes/Gems/Default/IndexAction.php:266 #, php-format msgid "Reset password for %s application" msgstr "Reset password for %s application" -#: classes/Gems/Default/IndexAction.php:264 +#: classes/Gems/Default/IndexAction.php:278 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Default/IndexAction.php:288 +#: classes/Gems/Default/IndexAction.php:302 msgid "No such user found or no e-mail address known" msgstr "No such user found or no e-mail address known" -#: classes/Gems/Default/IndexAction.php:290 +#: classes/Gems/Default/IndexAction.php:304 msgid "Reset e-mail already sent, please try again after 24 hours" msgstr "Reset e-mail already sent, please try again after 24 hours" -#: classes/Gems/Default/IndexAction.php:305 +#: classes/Gems/Default/IndexAction.php:319 msgid "Follow the instructions in the e-mail" msgstr "Follow the instructions in the e-mail" -#: classes/Gems/Default/IndexAction.php:307 -#: classes/Gems/Default/IndexAction.php:331 +#: classes/Gems/Default/IndexAction.php:321 +#: classes/Gems/Default/IndexAction.php:345 msgid "Unable to send e-mail" msgstr "Unable to send e-mail" -#: classes/Gems/Default/IndexAction.php:327 +#: classes/Gems/Default/IndexAction.php:341 msgid "An e-mail was sent containing your new password" msgstr "An e-mail was sent containing your new password" -#: classes/Gems/Default/IndexAction.php:335 +#: classes/Gems/Default/IndexAction.php:349 msgid "Unknown request" msgstr "Unknown request" @@ -1121,7 +1124,7 @@ msgstr "Action" #: classes/Gems/Default/LogAction.php:165 -#: classes/Gems/Default/MailAction.php:65 +#: classes/Gems/Default/MailTemplateAction.php:65 msgid "Message" msgstr "Message" @@ -1150,25 +1153,89 @@ msgid "Log maintenance" msgstr "Log maintenance" -#: classes/Gems/Default/MailAction.php:61 -#: classes/Gems/Default/MailLogAction.php:113 -msgid "Subject" -msgstr "Subject" +#: classes/Gems/Default/MailJobAction.php:63 +msgid "No automatic mail jobs found..." +msgstr "No automatic mail jobs found..." -#: classes/Gems/Default/MailAction.php:75 -msgid "(all organizations)" -msgstr "(all organizations)" +#: classes/Gems/Default/MailJobAction.php:73 +msgid "New automatic mail job..." +msgstr "New automatic mail job..." -#: classes/Gems/Default/MailAction.php:94 -msgid "email template" -msgid_plural "email templates" -msgstr[0] "email template" -msgstr[1] "email templates" +#: classes/Gems/Default/MailJobAction.php:101 +#: classes/Gems/Default/MailLogAction.php:116 +msgid "Template" +msgstr "Template" -#: classes/Gems/Default/MailAction.php:99 -msgid "Email templates" -msgstr "Email templates" +#: classes/Gems/Default/MailJobAction.php:102 +msgid "By staff member" +msgstr "By staff member" +#: classes/Gems/Default/MailJobAction.php:104 +msgid "Used for logging and possibly from address." +msgstr "Used for logging and possibly from address." + +#: classes/Gems/Default/MailJobAction.php:107 +msgid "Job is only run when active." +msgstr "Job is only run when active." + +#: classes/Gems/Default/MailJobAction.php:110 +msgid "From address used" +msgstr "From address used" + +#: classes/Gems/Default/MailJobAction.php:112 +msgid "From other" +msgstr "From other" + +#: classes/Gems/Default/MailJobAction.php:113 +#, php-format +msgid "Only when '%s' is '%s'." +msgstr "Only when '%s' is '%s'." + +#: classes/Gems/Default/MailJobAction.php:115 +msgid "Processing Method" +msgstr "Processing Method" + +#: classes/Gems/Default/MailJobAction.php:116 +msgid "Filter for" +msgstr "Filter for" + +#: classes/Gems/Default/MailJobAction.php:132 +msgid "Edit automatic mail job" +msgstr "Edit automatic mail job" + +#: classes/Gems/Default/MailJobAction.php:145 +msgid "First mail" +msgstr "First mail" + +#: classes/Gems/Default/MailJobAction.php:146 +msgid "Reminder" +msgstr "Reminder" + +#: classes/Gems/Default/MailJobAction.php:157 +msgid "Use organizational from address" +msgstr "Use organizational from address" + +#: classes/Gems/Default/MailJobAction.php:160 +#, php-format +msgid "Use site %s address" +msgstr "Use site %s address" + +#: classes/Gems/Default/MailJobAction.php:163 +msgid "Use the 'By staff member' address" +msgstr "Use the 'By staff member' address" + +#: classes/Gems/Default/MailJobAction.php:164 +msgid "Other" +msgstr "Other" + +#: classes/Gems/Default/MailJobAction.php:174 +msgid "Automatic mail jobs" +msgstr "Automatic mail jobs" + +#: classes/Gems/Default/MailJobAction.php:178 +msgid "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." +msgstr "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." + #: classes/Gems/Default/MailLogAction.php:107 msgid "Date sent" msgstr "Date sent" @@ -1189,9 +1256,10 @@ msgid "From address" msgstr "From address" -#: classes/Gems/Default/MailLogAction.php:116 -msgid "Template" -msgstr "Template" +#: classes/Gems/Default/MailLogAction.php:113 +#: classes/Gems/Default/MailTemplateAction.php:61 +msgid "Subject" +msgstr "Subject" #: classes/Gems/Default/MailLogAction.php:129 msgid "Mail Activity Log" @@ -1242,8 +1310,6 @@ msgstr "User ID" #: classes/Gems/Default/MailServerAction.php:90 -#: classes/Gems/Default/OptionAction.php:107 -#: classes/Gems/Default/OptionAction.php:112 msgid "Repeat password" msgstr "Repeat password" @@ -1261,11 +1327,29 @@ msgid "Email servers" msgstr "Email servers" +#: classes/Gems/Default/MailTemplateAction.php:75 +msgid "(all organizations)" +msgstr "(all organizations)" + +#: classes/Gems/Default/MailTemplateAction.php:94 +msgid "email template" +msgid_plural "email templates" +msgstr[0] "email template" +msgstr[1] "email templates" + +#: classes/Gems/Default/MailTemplateAction.php:99 +msgid "Email templates" +msgstr "Email templates" + #: classes/Gems/Default/OptionAction.php:73 +#: classes/Gems/Default/OrganizationAction.php:128 +#: classes/Gems/Default/RespondentAction.php:173 +#: classes/Gems/Default/StaffAction.php:188 msgid "Language" msgstr "Language" #: classes/Gems/Default/OptionAction.php:74 +#: classes/Gems/Default/StaffAction.php:189 msgid "Logout on survey" msgstr "Logout on survey" @@ -1552,7 +1636,6 @@ msgstr "Survey not specified." #: classes/Gems/Default/ProjectTracksAction.php:120 -#: classes/Gems/Default/TrackActionAbstract.php:479 #, php-format msgid "Track %s does not exist." msgstr "Track %s does not exist." @@ -1742,40 +1825,44 @@ msgid "Respondent planning" msgstr "Respondent planning" -#: classes/Gems/Default/RoleAction.php:166 -#: classes/Gems/Default/RoleAction.php:207 +#: classes/Gems/Default/RoleAction.php:174 +#: classes/Gems/Default/RoleAction.php:233 msgid "Parents" msgstr "Parents" -#: classes/Gems/Default/RoleAction.php:185 +#: classes/Gems/Default/RoleAction.php:189 +msgid "Editing `super` is not allowed" +msgstr "Editing `super` is not allowed" + +#: classes/Gems/Default/RoleAction.php:207 msgid "role" msgid_plural "roles" msgstr[0] "role" msgstr[1] "roles" -#: classes/Gems/Default/RoleAction.php:190 +#: classes/Gems/Default/RoleAction.php:212 msgid "Administrative roles" msgstr "Administrative roles" -#: classes/Gems/Default/RoleAction.php:208 -#: classes/Gems/Default/RoleAction.php:224 +#: classes/Gems/Default/RoleAction.php:234 +#: classes/Gems/Default/RoleAction.php:250 msgid "Allowed" msgstr "Allowed" -#: classes/Gems/Default/RoleAction.php:209 -#: classes/Gems/Default/RoleAction.php:225 +#: classes/Gems/Default/RoleAction.php:235 +#: classes/Gems/Default/RoleAction.php:251 msgid "Denied" msgstr "Denied" -#: classes/Gems/Default/RoleAction.php:213 +#: classes/Gems/Default/RoleAction.php:239 msgid "Project role overview" msgstr "Project role overview" -#: classes/Gems/Default/RoleAction.php:223 +#: classes/Gems/Default/RoleAction.php:249 msgid "Privilege" msgstr "Privilege" -#: classes/Gems/Default/RoleAction.php:229 +#: classes/Gems/Default/RoleAction.php:255 msgid "Project privileges" msgstr "Project privileges" @@ -2406,40 +2493,28 @@ msgid "On this test system all mail will be delivered to the from address." msgstr "On this test system all mail will be delivered to the from address." -#: classes/Gems/Email/MultiMailForm.php:73 -msgid "Send multiple mails per respondent, one for each checked token." -msgstr "Send multiple mails per patient, one for each checked token." - -#: classes/Gems/Email/MultiMailForm.php:74 -msgid "Send one mail per respondent, mark all checked tokens as send." -msgstr "Send one mail per patient, mark all checked tokens as send." - #: classes/Gems/Email/MultiMailForm.php:75 -msgid "Send one mail per respondent, mark only mailed tokens as send." -msgstr "Send one mail per patient, mark only mailed tokens as send." - -#: classes/Gems/Email/MultiMailForm.php:79 msgid "Method" msgstr "Method" -#: classes/Gems/Email/MultiMailForm.php:105 +#: classes/Gems/Email/MultiMailForm.php:101 #: classes/Gems/Email/OneMailForm.php:87 msgid "To" msgstr "To" -#: classes/Gems/Email/MultiMailForm.php:126 +#: classes/Gems/Email/MultiMailForm.php:122 msgid "Survey has been taken." msgstr "Survey has been taken." -#: classes/Gems/Email/MultiMailForm.php:129 +#: classes/Gems/Email/MultiMailForm.php:125 msgid "Respondent does not have an e-mail address." msgstr "Patient does not have an e-mail address." -#: classes/Gems/Email/MultiMailForm.php:132 +#: classes/Gems/Email/MultiMailForm.php:128 msgid "Survey cannot be taken by a respondent." msgstr "Survey cannot be taken by a patient." -#: classes/Gems/Email/MultiMailForm.php:134 +#: classes/Gems/Email/MultiMailForm.php:130 msgid "Survey cannot be taken at this moment." msgstr "Survey cannot be taken at this moment." @@ -2504,72 +2579,76 @@ msgstr "Activity Log" #: classes/Gems/Menu/MenuAbstract.php:239 +msgid "Automatic mail" +msgstr "Automatic mail" + +#: classes/Gems/Menu/MenuAbstract.php:242 msgid "Servers" msgstr "Servers" -#: classes/Gems/Menu/MenuAbstract.php:243 +#: classes/Gems/Menu/MenuAbstract.php:246 msgid "Templates" msgstr "Templates" -#: classes/Gems/Menu/MenuAbstract.php:275 +#: classes/Gems/Menu/MenuAbstract.php:278 msgid "By period" msgstr "By period" -#: classes/Gems/Menu/MenuAbstract.php:276 +#: classes/Gems/Menu/MenuAbstract.php:279 msgid "By token" msgstr "By token" -#: classes/Gems/Menu/MenuAbstract.php:277 +#: classes/Gems/Menu/MenuAbstract.php:280 msgid "By respondent" msgstr "By respondent" -#: classes/Gems/Menu/MenuAbstract.php:281 +#: classes/Gems/Menu/MenuAbstract.php:284 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:299 +#: classes/Gems/Menu/MenuAbstract.php:302 msgid "Errors" msgstr "Errors" -#: classes/Gems/Menu/MenuAbstract.php:300 +#: classes/Gems/Menu/MenuAbstract.php:303 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:303 +#: classes/Gems/Menu/MenuAbstract.php:306 msgid "Maintenance mode" msgstr "Maintenance mode" -#: classes/Gems/Menu/MenuAbstract.php:395 +#: classes/Gems/Menu/MenuAbstract.php:398 msgid "Check status" msgstr "Check status" -#: classes/Gems/Menu/MenuAbstract.php:396 +#: classes/Gems/Menu/MenuAbstract.php:399 msgid "Synchronize surveys" msgstr "Synchronize surveys" -#: classes/Gems/Menu/MenuAbstract.php:397 -#: classes/Gems/Menu/MenuAbstract.php:408 +#: classes/Gems/Menu/MenuAbstract.php:400 +#: classes/Gems/Menu/MenuAbstract.php:411 msgid "Check answers" msgstr "Check answers" -#: classes/Gems/Menu/MenuAbstract.php:398 +#: classes/Gems/Menu/MenuAbstract.php:401 msgid "Synchronize all surveys" msgstr "Synchronize all surveys" -#: classes/Gems/Menu/MenuAbstract.php:399 -#: classes/Gems/Menu/MenuAbstract.php:409 +#: classes/Gems/Menu/MenuAbstract.php:402 +#: classes/Gems/Menu/MenuAbstract.php:412 msgid "Check all answers" msgstr "Check all answers" -#: classes/Gems/Menu/MenuAbstract.php:405 +#: classes/Gems/Menu/MenuAbstract.php:408 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:439 +#: classes/Gems/Menu/MenuAbstract.php:442 msgid "Check assignments" msgstr "Check assignments" -#: classes/Gems/Menu/MenuAbstract.php:442 +#: classes/Gems/Menu/MenuAbstract.php:445 msgid "Check all assignments" msgstr "Check all assignments" @@ -3036,10 +3115,12 @@ msgstr "Decrease" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:151 +#: classes/Gems/Util/Translated.php:201 msgid "Female" msgstr "Female" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:152 +#: classes/Gems/Util/Translated.php:201 msgid "Male" msgstr "Male" @@ -3066,11 +3147,6 @@ msgid " (comment)" msgstr " (comment)" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:280 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:329 -msgid "Other" -msgstr "Other" - #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:466 msgid "Free number" msgstr "Free number" @@ -3137,39 +3213,51 @@ msgid "%d days ago" msgstr "%d days ago" -#: classes/Gems/Util/Translated.php:187 +#: classes/Gems/Util/Translated.php:180 +msgid "Send multiple mails per respondent, one for each checked token." +msgstr "Send multiple mails per patient, one for each checked token." + +#: classes/Gems/Util/Translated.php:181 +msgid "Send one mail per respondent, mark all checked tokens as send." +msgstr "Send one mail per patient, mark all checked tokens as send." + +#: classes/Gems/Util/Translated.php:182 +msgid "Send one mail per respondent, mark only mailed tokens as send." +msgstr "Send one mail per patient, mark only mailed tokens as send." + +#: classes/Gems/Util/Translated.php:201 msgid "Unknown" msgstr "Unknown" -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:206 msgid "mr." msgstr "Mr." -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:206 msgid "mrs." msgstr "Mrs." -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:206 msgid "mr./mrs." msgstr "Mr./Mrs." -#: classes/Gems/Util/Translated.php:197 +#: classes/Gems/Util/Translated.php:211 msgid "Mr." msgstr "Mr." -#: classes/Gems/Util/Translated.php:197 +#: classes/Gems/Util/Translated.php:211 msgid "Mrs." msgstr "Mrs." -#: classes/Gems/Util/Translated.php:197 +#: classes/Gems/Util/Translated.php:211 msgid "Mr./Mrs." msgstr "Mr./Mrs." -#: classes/Gems/Util/Translated.php:215 +#: classes/Gems/Util/Translated.php:229 msgid "Yes (forget answers)" msgstr "Yes (forget answers)" -#: classes/Gems/Util/Translated.php:215 +#: classes/Gems/Util/Translated.php:229 msgid "Yes (keep answers)" msgstr "Yes (keep answers)" @@ -3431,7 +3519,6 @@ msgstr "Deleted token %s for survey %s." #: snippets/DeleteTrackTokenSnippet.php:277 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3549,15 +3636,16 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." +#: views/scripts/index/login.phtml:12 +msgid "The Pulse software was made possible thanks to support from " +msgstr "The Pulse software was made possible thanks to support from " + #~ msgid "Activity" #~ msgstr "Activity" #~ msgid "DB Adaptor" #~ msgstr "DB Adaptor" -#~ msgid "The Pulse software was made possible thanks to support from " -#~ msgstr "The Pulse software was made possible thanks to support from " - #~ msgid "ACL" #~ msgstr "ACL" @@ -3851,9 +3939,6 @@ #~ msgid "In progress" #~ msgstr "In progress" -#~ msgid "Reminders" -#~ msgstr "Reminders" - #~ msgid "No tracks assigned to respondent nr: %s" #~ msgstr "No tracks assigned to patient nr: %s" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-10-24 11:30:45 UTC (rev 129) +++ trunk/library/languages/default-nl.po 2011-10-24 11:35:15 UTC (rev 130) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-20 17:53+0100\n" +"POT-Creation-Date: 2011-10-24 13:33+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" +"Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -477,7 +477,7 @@ msgid "Cancel" msgstr "Annuleren" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:164 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:168 msgid "No data found." msgstr "Geen gegevens gevonden." @@ -583,7 +583,7 @@ msgstr "Omschrijving" #: classes/Gems/Default/ConsentAction.php:68 -#: classes/Gems/Default/DatabaseAction.php:155 +#: classes/Gems/Default/DatabaseAction.php:167 msgid "Order" msgstr "Volgorde" @@ -666,277 +666,277 @@ msgid "No script for %1$s." msgstr "Geen script voor %1$s:" -#: classes/Gems/Default/DatabaseAction.php:121 +#: classes/Gems/Default/DatabaseAction.php:133 #, php-format msgid "No rows in %s." msgstr "Geen gegevens in %s." -#: classes/Gems/Default/DatabaseAction.php:150 +#: classes/Gems/Default/DatabaseAction.php:162 msgid "Type" msgstr "Type" -#: classes/Gems/Default/DatabaseAction.php:154 +#: classes/Gems/Default/DatabaseAction.php:166 msgid "Group" msgstr "Groep" -#: classes/Gems/Default/DatabaseAction.php:156 +#: classes/Gems/Default/DatabaseAction.php:168 msgid "Location" msgstr "Locatie" -#: classes/Gems/Default/DatabaseAction.php:159 +#: classes/Gems/Default/DatabaseAction.php:171 msgid "Status" msgstr "Status" -#: classes/Gems/Default/DatabaseAction.php:160 +#: classes/Gems/Default/DatabaseAction.php:172 msgid "created" msgstr "bestaat" -#: classes/Gems/Default/DatabaseAction.php:161 +#: classes/Gems/Default/DatabaseAction.php:173 msgid "not created" msgstr "niet aanwezig" -#: classes/Gems/Default/DatabaseAction.php:162 +#: classes/Gems/Default/DatabaseAction.php:174 msgid "unknown" msgstr "onbekend" -#: classes/Gems/Default/DatabaseAction.php:165 +#: classes/Gems/Default/DatabaseAction.php:177 msgid "Script" msgstr "Script" -#: classes/Gems/Default/DatabaseAction.php:167 +#: classes/Gems/Default/DatabaseAction.php:179 msgid "Changed on" msgstr "Veranderd op" -#: classes/Gems/Default/DatabaseAction.php:184 +#: classes/Gems/Default/DatabaseAction.php:198 msgid "This database object does not exist. You cannot delete it." msgstr "Dit database object bestaat. Het kan dus ook niet verwijderd worden." -#: classes/Gems/Default/DatabaseAction.php:189 +#: classes/Gems/Default/DatabaseAction.php:203 #, php-format msgid "Drop %s" msgstr "Verwijder %s" -#: classes/Gems/Default/DatabaseAction.php:197 +#: classes/Gems/Default/DatabaseAction.php:211 #, php-format msgid "There are %d rows in the table." msgstr "Er zijn %d rijen in deze tabel." -#: classes/Gems/Default/DatabaseAction.php:199 +#: classes/Gems/Default/DatabaseAction.php:213 #, php-format msgid "Drop table with %d rows" msgstr "Tabel met %d rijen aan data verwijderen" -#: classes/Gems/Default/DatabaseAction.php:200 +#: classes/Gems/Default/DatabaseAction.php:214 msgid "Are you really sure?" msgstr "Weet u het heel erg zeker?" -#: classes/Gems/Default/DatabaseAction.php:216 +#: classes/Gems/Default/DatabaseAction.php:230 #, php-format msgid "%1$s %2$s dropped" msgstr "%1$s %2$s verwijderd" -#: classes/Gems/Default/DatabaseAction.php:221 +#: classes/Gems/Default/DatabaseAction.php:235 msgid " during statement " msgstr " tijdens het commando " -#: classes/Gems/Default/DatabaseAction.php:232 +#: classes/Gems/Default/DatabaseAction.php:246 #, php-format msgid "%s no longer exists in the database." msgstr "%s bestaat niet meer in de database." -#: classes/Gems/Default/DatabaseAction.php:235 +#: classes/Gems/Default/DatabaseAction.php:249 #, php-format msgid "%s does not yet exist in the database." msgstr "%s bestaat nog niet in de database." -#: classes/Gems/Default/DatabaseAction.php:238 +#: classes/Gems/Default/DatabaseAction.php:252 #, php-format msgid "%s object does exist." msgstr "%s object bestaat." -#: classes/Gems/Default/DatabaseAction.php:256 +#: classes/Gems/Default/DatabaseAction.php:270 msgid "Object is not a table." msgstr "Niet een tabel object." -#: classes/Gems/Default/DatabaseAction.php:279 +#: classes/Gems/Default/DatabaseAction.php:293 msgid "Structure" msgstr "Structuur" -#: classes/Gems/Default/DatabaseAction.php:288 +#: classes/Gems/Default/DatabaseAction.php:302 msgid "database object" msgid_plural "database objects" msgstr[0] "database object" msgstr[1] "database objects" -#: classes/Gems/Default/DatabaseAction.php:293 +#: classes/Gems/Default/DatabaseAction.php:307 msgid "Database object overview" msgstr "Database object overzicht" -#: classes/Gems/Default/DatabaseAction.php:302 -#: classes/Gems/Default/DatabaseAction.php:348 +#: classes/Gems/Default/DatabaseAction.php:316 +#: classes/Gems/Default/DatabaseAction.php:362 msgid "Level" msgstr "Niveau" -#: classes/Gems/Default/DatabaseAction.php:303 -#: classes/Gems/Default/DatabaseAction.php:349 +#: classes/Gems/Default/DatabaseAction.php:317 +#: classes/Gems/Default/DatabaseAction.php:363 msgid "Subtype" msgstr "Subtype" -#: classes/Gems/Default/DatabaseAction.php:305 +#: classes/Gems/Default/DatabaseAction.php:319 msgid "To be executed" msgstr "Uit te voeren" -#: classes/Gems/Default/DatabaseAction.php:306 -#: classes/Gems/Default/DatabaseAction.php:352 +#: classes/Gems/Default/DatabaseAction.php:320 +#: classes/Gems/Default/DatabaseAction.php:366 msgid "Executed" msgstr "Uitgevoerd" -#: classes/Gems/Default/DatabaseAction.php:307 -#: classes/Gems/Default/DatabaseAction.php:353 +#: classes/Gems/Default/DatabaseAction.php:321 +#: classes/Gems/Default/DatabaseAction.php:367 msgid "Finished" msgstr "Afgerond" -#: classes/Gems/Default/DatabaseAction.php:310 +#: classes/Gems/Default/DatabaseAction.php:324 msgid "Create the patch table!" msgstr "De patch tabel bestaat nog niet!" -#: classes/Gems/Default/DatabaseAction.php:312 +#: classes/Gems/Default/DatabaseAction.php:326 #, php-format msgid "%d new or changed patch(es)." msgstr "%d nieuwe of veranderde patch(es)." -#: classes/Gems/Default/DatabaseAction.php:317 +#: classes/Gems/Default/DatabaseAction.php:331 msgid "Gems build" msgstr "Gems bouwnummer" -#: classes/Gems/Default/DatabaseAction.php:318 +#: classes/Gems/Default/DatabaseAction.php:332 msgid "Database build" msgstr "Database versie" -#: classes/Gems/Default/DatabaseAction.php:320 +#: classes/Gems/Default/DatabaseAction.php:334 msgid "Execute level" msgstr "Uit te voeren versie" -#: classes/Gems/Default/DatabaseAction.php:324 +#: classes/Gems/Default/DatabaseAction.php:338 msgid "Ignore finished" msgstr "Afgeronde patches overslaan" -#: classes/Gems/Default/DatabaseAction.php:325 +#: classes/Gems/Default/DatabaseAction.php:339 msgid "Ignore executed" msgstr "Uitgevoerde patches overslaan" -#: classes/Gems/Default/DatabaseAction.php:326 +#: classes/Gems/Default/DatabaseAction.php:340 msgid "Show patches" msgstr "Toon patches" -#: classes/Gems/Default/DatabaseAction.php:342 +#: classes/Gems/Default/DatabaseAction.php:356 #, php-format msgid "%d patch(es) executed." msgstr "%d patch(es) uitgevoerd." -#: classes/Gems/Default/DatabaseAction.php:347 +#: classes/Gems/Default/DatabaseAction.php:361 msgid "Patch" msgstr "Patch" -#: classes/Gems/Default/DatabaseAction.php:351 +#: classes/Gems/Default/DatabaseAction.php:365 msgid "Query" msgstr "Query" -#: classes/Gems/Default/DatabaseAction.php:354 +#: classes/Gems/Default/DatabaseAction.php:368 msgid "Result" msgstr "Resultaat" -#: classes/Gems/Default/DatabaseAction.php:378 +#: classes/Gems/Default/DatabaseAction.php:392 msgid "Patch maintenance" msgstr "Patch onderhoud" -#: classes/Gems/Default/DatabaseAction.php:382 +#: classes/Gems/Default/DatabaseAction.php:396 msgid "Patch overview" msgstr "Patch overzicht" -#: classes/Gems/Default/DatabaseAction.php:442 +#: classes/Gems/Default/DatabaseAction.php:458 msgid "This database object does not exist. You cannot create it." msgstr "Dit database object bestaat niet en kan ook niet aangemaakt worden." -#: classes/Gems/Default/DatabaseAction.php:448 +#: classes/Gems/Default/DatabaseAction.php:464 msgid "This database object has no script. You cannot execute it." msgstr "Dit database object heeft geen script. Het kan dus ook niet uitgevoerd worden." -#: classes/Gems/Default/DatabaseAction.php:459 +#: classes/Gems/Default/DatabaseAction.php:475 #, php-format msgid "Run %s" msgstr "Voer %s script uit" -#: classes/Gems/Default/DatabaseAction.php:478 +#: classes/Gems/Default/DatabaseAction.php:494 #, php-format msgid "Starting %d object creation scripts." msgstr "Aanvang %d object aanmaak scripts." -#: classes/Gems/Default/DatabaseAction.php:483 +#: classes/Gems/Default/DatabaseAction.php:499 #, php-format msgid "Finished %s creation script for object %d of %d" msgstr "Klaar %s met aanmaak script voor object %d van %d" -#: classes/Gems/Default/DatabaseAction.php:487 +#: classes/Gems/Default/DatabaseAction.php:503 msgid "All objects exist. Nothing was executed." msgstr "Alle objects bestaan. Niets was uitgevoerd." -#: classes/Gems/Default/DatabaseAction.php:493 +#: classes/Gems/Default/DatabaseAction.php:509 msgid "Create not-existing database objects" msgstr "Aanmaak van database objecten die nog niet bestaan" -#: classes/Gems/Default/DatabaseAction.php:495 +#: classes/Gems/Default/DatabaseAction.php:511 #, php-format msgid "One database object does not exist." msgid_plural "These %d database objects do not exist." msgstr[0] "Één object bestaat nog niet in de database." msgstr[1] "%d objecten bestaan nog niet in de database." -#: classes/Gems/Default/DatabaseAction.php:496 +#: classes/Gems/Default/DatabaseAction.php:512 msgid "Are you sure you want to create it?" msgid_plural "Are you sure you want to create them all?" msgstr[0] "Weet je zeker dat je dat object wil aanmaken?" msgstr[1] "Weet je zeker dat je ze allemaal wil aanmaken?" -#: classes/Gems/Default/DatabaseAction.php:509 +#: classes/Gems/Default/DatabaseAction.php:525 msgid "All database objects exist. There is nothing to create." msgstr "Alle database objecten bestaan. Er valt niets te maken." -#: classes/Gems/Default/DatabaseAction.php:522 +#: classes/Gems/Default/DatabaseAction.php:538 msgid "Separate multiple commands with semicolons (;)." msgstr "Scheidt meerdere commando's met punt-comma's (;)." -#: classes/Gems/Default/DatabaseAction.php:529 +#: classes/Gems/Default/DatabaseAction.php:545 msgid "Run" msgstr "Uitvoeren" -#: classes/Gems/Default/DatabaseAction.php:538 +#: classes/Gems/Default/DatabaseAction.php:554 msgid "raw" msgstr "rauw" -#: classes/Gems/Default/DatabaseAction.php:547 +#: classes/Gems/Default/DatabaseAction.php:563 #, php-format msgid "Result set %s." msgstr "Resultaat %s." -#: classes/Gems/Default/DatabaseAction.php:570 +#: classes/Gems/Default/DatabaseAction.php:586 msgid "Execute raw SQL" msgstr "SQL direct uitvoeren" -#: classes/Gems/Default/DatabaseAction.php:573 +#: classes/Gems/Default/DatabaseAction.php:589 msgid "Result sets" msgstr "Resultaten" -#: classes/Gems/Default/DatabaseAction.php:596 +#: classes/Gems/Default/DatabaseAction.php:614 msgid "This database object does not exist. You cannot view it." msgstr "Dit database object bestaat. Het kan dus ook niet bekeken worden." -#: classes/Gems/Default/DatabaseAction.php:601 +#: classes/Gems/Default/DatabaseAction.php:619 #, php-format msgid "The data in table %s" msgstr "De gegevens in tabel %s" -#: classes/Gems/Default/DatabaseAction.php:602 +#: classes/Gems/Default/DatabaseAction.php:620 #, php-format msgid "Contents of %s %s" msgstr "De inhoud van %s %s" @@ -950,6 +950,7 @@ msgstr "Exporteer gegevens" #: classes/Gems/Default/ExportAction.php:155 +#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Vragenlijst" @@ -959,6 +960,7 @@ msgstr "%s records gevonden." #: classes/Gems/Default/ExportAction.php:174 +#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organisatie" @@ -971,6 +973,7 @@ msgstr "Rol" #: classes/Gems/Default/GroupAction.php:91 +#: classes/Gems/Default/MailJobAction.php:105 msgid "Active" msgstr "Actief" @@ -984,70 +987,70 @@ msgid "Administrative groups" msgstr "Beheer groepen" -#: classes/Gems/Default/IndexAction.php:93 +#: classes/Gems/Default/IndexAction.php:98 #, php-format msgid "Login to %s application" msgstr "%s login" -#: classes/Gems/Default/IndexAction.php:97 -#: classes/Gems/Default/IndexAction.php:256 +#: classes/Gems/Default/IndexAction.php:102 +#: classes/Gems/Default/IndexAction.php:270 msgid "Username" msgstr "Gebruikersnaam" -#: classes/Gems/Default/IndexAction.php:105 +#: classes/Gems/Default/IndexAction.php:110 #: classes/Gems/Default/MailServerAction.php:88 msgid "Password" msgstr "Wachtwoord" -#: classes/Gems/Default/IndexAction.php:114 +#: classes/Gems/Default/IndexAction.php:119 msgid "Login" msgstr "Login" -#: classes/Gems/Default/IndexAction.php:121 +#: classes/Gems/Default/IndexAction.php:126 msgid "Enter your token..." msgstr "Voer uw kenmerk in..." -#: classes/Gems/Default/IndexAction.php:161 -#: classes/Gems/Default/IndexAction.php:196 +#: classes/Gems/Default/IndexAction.php:175 +#: classes/Gems/Default/IndexAction.php:210 #, php-format msgid "Login successful, welcome %s." msgstr "Login in orde, welkom %s." -#: classes/Gems/Default/IndexAction.php:222 +#: classes/Gems/Default/IndexAction.php:236 msgid "Good bye: " msgstr "Tot ziens: " -#: classes/Gems/Default/IndexAction.php:252 +#: classes/Gems/Default/IndexAction.php:266 #, php-format msgid "Reset password for %s application" msgstr "Reset wachtwoord voor %s" -#: classes/Gems/Default/IndexAction.php:264 +#: classes/Gems/Default/IndexAction.php:278 msgid "Reset password" msgstr "Reset wachtwoord" -#: classes/Gems/Default/IndexAction.php:288 +#: classes/Gems/Default/IndexAction.php:302 msgid "No such user found or no e-mail address known" msgstr "Gebruiker niet gevonden of e-mail adres onbekend" -#: classes/Gems/Default/IndexAction.php:290 +#: classes/Gems/Default/IndexAction.php:304 msgid "Reset e-mail already sent, please try again after 24 hours" msgstr "E-mail al verzonden, probeer aub na 24 uur opnieuw" -#: classes/Gems/Default/IndexAction.php:305 +#: classes/Gems/Default/IndexAction.php:319 msgid "Follow the instructions in the e-mail" msgstr "Volg de instructies in de aan u verzonden e-mail" -#: classes/Gems/Default/IndexAction.php:307 -#: classes/Gems/Default/IndexAction.php:331 +#: classes/Gems/Default/IndexAction.php:321 +#: classes/Gems/Default/IndexAction.php:345 msgid "Unable to send e-mail" msgstr "Verzenden e-mail mislukt" -#: classes/Gems/Default/IndexAction.php:327 +#: classes/Gems/Default/IndexAction.php:341 msgid "An e-mail was sent containing your new password" msgstr "Er is een e-mail verstuurd met een nieuw wachtwoord" -#: classes/Gems/Default/IndexAction.php:335 +#: classes/Gems/Default/IndexAction.php:349 msgid "Unknown request" msgstr "Onjuist verzoek" @@ -1121,7 +1124,7 @@ msgstr "Actie" #: classes/Gems/Default/LogAction.php:165 -#: classes/Gems/Default/MailAction.php:65 +#: classes/Gems/Default/MailTemplateAction.php:65 msgid "Message" msgstr "Bericht" @@ -1150,25 +1153,92 @@ msgid "Log maintenance" msgstr "Logboek onderhoud" -#: classes/Gems/Default/MailAction.php:61 -#: classes/Gems/Default/MailLogAction.php:113 -msgid "Subject" -msgstr "Onderwerp" +#: classes/Gems/Default/MailJobAction.php:63 +msgid "No automatic mail jobs found..." +msgstr "" -#: classes/Gems/Default/MailAction.php:75 -msgid "(all organizations)" -msgstr "(alle organisaties)" +#: classes/Gems/Default/MailJobAction.php:73 +msgid "New automatic mail job..." +msgstr "" -#: classes/Gems/Default/MailAction.php:94 -msgid "email template" -msgid_plural "email templates" -msgstr[0] "email sjabloon" -msgstr[1] "email sjablonen" +#: classes/Gems/Default/MailJobAction.php:101 +#: classes/Gems/Default/MailLogAction.php:116 +msgid "Template" +msgstr "Sjabloon" -#: classes/Gems/Default/MailAction.php:99 -msgid "Email templates" -msgstr "Email sjabloon" +#: classes/Gems/Default/MailJobAction.php:102 +#, fuzzy +msgid "By staff member" +msgstr "medewerker" +#: classes/Gems/Default/MailJobAction.php:104 +msgid "Used for logging and possibly from address." +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:107 +msgid "Job is only run when active." +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:110 +#, fuzzy +msgid "From address used" +msgstr "Adres van" + +#: classes/Gems/Default/MailJobAction.php:112 +msgid "From other" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:113 +#, php-format +msgid "Only when '%s' is '%s'." +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:115 +msgid "Processing Method" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:116 +msgid "Filter for" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:132 +msgid "Edit automatic mail job" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:145 +#, fuzzy +msgid "First mail" +msgstr "Voornaam" + +#: classes/Gems/Default/MailJobAction.php:146 +msgid "Reminder" +msgstr "Herinnering" + +#: classes/Gems/Default/MailJobAction.php:157 +msgid "Use organizational from address" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:160 +#, php-format +msgid "Use site %s address" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:163 +msgid "Use the 'By staff member' address" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:164 +msgid "Other" +msgstr "Overige" + +#: classes/Gems/Default/MailJobAction.php:174 +msgid "Automatic mail jobs" +msgstr "" + +#: classes/Gems/Default/MailJobAction.php:178 +msgid "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." +msgstr "" + #: classes/Gems/Default/MailLogAction.php:107 msgid "Date sent" msgstr "Verzend datum" @@ -1189,9 +1259,10 @@ msgid "From address" msgstr "Adres van" -#: classes/Gems/Default/MailLogAction.php:116 -msgid "Template" -msgstr "Sjabloon" +#: classes/Gems/Default/MailLogAction.php:113 +#: classes/Gems/Default/MailTemplateAction.php:61 +msgid "Subject" +msgstr "Onderwerp" #: classes/Gems/Default/MailLogAction.php:129 msgid "Mail Activity Log" @@ -1231,7 +1302,7 @@ #: classes/Gems/Default/MailServerAction.php:80 msgid "Port" -msgstr "PoortAfdrukken" +msgstr "Poort" #: classes/Gems/Default/MailServerAction.php:82 msgid "Normal values: 25 for TLS and no encryption, 465 for SSL" @@ -1242,8 +1313,6 @@ msgstr "Gebruikers ID" #: classes/Gems/Default/MailServerAction.php:90 -#: classes/Gems/Default/OptionAction.php:107 -#: classes/Gems/Default/OptionAction.php:112 msgid "Repeat password" msgstr "Herhaal wachtwoord" @@ -1261,11 +1330,29 @@ msgid "Email servers" msgstr "Email servers" +#: classes/Gems/Default/MailTemplateAction.php:75 +msgid "(all organizations)" +msgstr "(alle organisaties)" + +#: classes/Gems/Default/MailTemplateAction.php:94 +msgid "email template" +msgid_plural "email templates" +msgstr[0] "email sjabloon" +msgstr[1] "email sjablonen" + +#: classes/Gems/Default/MailTemplateAction.php:99 +msgid "Email templates" +msgstr "Email sjabloon" + #: classes/Gems/Default/OptionAction.php:73 +#: classes/Gems/Default/OrganizationAction.php:128 +#: classes/Gems/Default/RespondentAction.php:173 +#: classes/Gems/Default/StaffAction.php:188 msgid "Language" msgstr "Taal" #: classes/Gems/Default/OptionAction.php:74 +#: classes/Gems/Default/StaffAction.php:189 msgid "Logout on survey" msgstr "Logout bij beantwoorden vragenlijst" @@ -1552,7 +1639,6 @@ msgstr "Vragenlijst niet opgegeven." #: classes/Gems/Default/ProjectTracksAction.php:120 -#: classes/Gems/Default/TrackActionAbstract.php:479 #, php-format msgid "Track %s does not exist." msgstr "Trajectnummer %s bestaat niet." @@ -1742,40 +1828,44 @@ msgid "Respondent planning" msgstr "Per patiënt plannen" -#: classes/Gems/Default/RoleAction.php:166 -#: classes/Gems/Default/RoleAction.php:207 +#: classes/Gems/Default/RoleAction.php:174 +#: classes/Gems/Default/RoleAction.php:233 msgid "Parents" msgstr "Afgeleid van" -#: classes/Gems/Default/RoleAction.php:185 +#: classes/Gems/Default/RoleAction.php:189 +msgid "Editing `super` is not allowed" +msgstr "Wijzigen van `super` is niet toegestaan" + +#: classes/Gems/Default/RoleAction.php:207 msgid "role" msgid_plural "roles" msgstr[0] "Rol" msgstr[1] "Rollen" -#: classes/Gems/Default/RoleAction.php:190 +#: classes/Gems/Default/RoleAction.php:212 msgid "Administrative roles" msgstr "Beheer rollen en rechten" -#: classes/Gems/Default/RoleAction.php:208 -#: classes/Gems/Default/RoleAction.php:224 +#: classes/Gems/Default/RoleAction.php:234 +#: classes/Gems/Default/RoleAction.php:250 msgid "Allowed" msgstr "Toegestaan" -#: classes/Gems/Default/RoleAction.php:209 -#: classes/Gems/Default/RoleAction.php:225 +#: classes/Gems/Default/RoleAction.php:235 +#: classes/Gems/Default/RoleAction.php:251 msgid "Denied" msgstr "Geweigerd" -#: classes/Gems/Default/RoleAction.php:213 +#: classes/Gems/Default/RoleAction.php:239 msgid "Project role overview" msgstr "Project rollen" -#: classes/Gems/Default/RoleAction.php:223 +#: classes/Gems/Default/RoleAction.php:249 msgid "Privilege" msgstr "Privilége" -#: classes/Gems/Default/RoleAction.php:229 +#: classes/Gems/Default/RoleAction.php:255 msgid "Project privileges" msgstr "Project priviléges" @@ -2406,40 +2496,28 @@ msgid "On this test system all mail will be delivered to the from address." msgstr "Op dit test systeem worden alle emails gestuurd naar het \"van\" adres." -#: classes/Gems/Email/MultiMailForm.php:73 -msgid "Send multiple mails per respondent, one for each checked token." -msgstr "Verstuur meerdere emails per patiënt, één per gekozen kenmerk." - -#: classes/Gems/Email/MultiMailForm.php:74 -msgid "Send one mail per respondent, mark all checked tokens as send." -msgstr "Verstuur één email per patiënt, zet alle gekozen kenmerken op verzonden." - #: classes/Gems/Email/MultiMailForm.php:75 -msgid "Send one mail per respondent, mark only mailed tokens as send." -msgstr "Verstuur één email per patiënt, zet alleen de verzonden kenmerken op verzonden." - -#: classes/Gems/Email/MultiMailForm.php:79 msgid "Method" msgstr "Methode" -#: classes/Gems/Email/MultiMailForm.php:105 +#: classes/Gems/Email/MultiMailForm.php:101 #: classes/Gems/Email/OneMailForm.php:87 msgid "To" msgstr "Aan" -#: classes/Gems/Email/MultiMailForm.php:126 +#: classes/Gems/Email/MultiMailForm.php:122 msgid "Survey has been taken." msgstr "Vragenlijsten is al afgenomen" -#: classes/Gems/Email/MultiMailForm.php:129 +#: classes/Gems/Email/MultiMailForm.php:125 msgid "Respondent does not have an e-mail address." msgstr "Patiënt heeft geen email adres" -#: classes/Gems/Email/MultiMailForm.php:132 +#: classes/Gems/Email/MultiMailForm.php:128 msgid "Survey cannot be taken by a respondent." msgstr "Deze vragenlijst kan niet door een patiënt ingevuld worden." -#: classes/Gems/Email/MultiMailForm.php:134 +#: classes/Gems/Email/MultiMailForm.php:130 msgid "Survey cannot be taken at this moment." msgstr "Deze vragenlijst kan op dit moment niet afgenomen worden." @@ -2504,72 +2582,76 @@ msgstr "Activiteit" #: classes/Gems/Menu/MenuAbstract.php:239 +msgid "Automatic mail" +msgstr "" + +#: classes/Gems/Menu/MenuAbstract.php:242 msgid "Servers" msgstr "Servers" -#: classes/Gems/Menu/MenuAbstract.php:243 +#: classes/Gems/Menu/MenuAbstract.php:246 msgid "Templates" msgstr "Sjablonen" -#: classes/Gems/Menu/MenuAbstract.php:275 +#: classes/Gems/Menu/MenuAbstract.php:278 msgid "By period" msgstr "Per periode" -#: classes/Gems/Menu/MenuAbstract.php:276 +#: classes/Gems/Menu/MenuAbstract.php:279 msgid "By token" msgstr "Per kenmerk" -#: classes/Gems/Menu/MenuAbstract.php:277 +#: classes/Gems/Menu/MenuAbstract.php:280 msgid "By respondent" msgstr "Per patiënt" -#: classes/Gems/Menu/MenuAbstract.php:281 +#: classes/Gems/Menu/MenuAbstract.php:284 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:299 +#: classes/Gems/Menu/MenuAbstract.php:302 msgid "Errors" msgstr "Foutmeldingen" -#: classes/Gems/Menu/MenuAbstract.php:300 +#: classes/Gems/Menu/MenuAbstract.php:303 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:303 +#: classes/Gems/Menu/MenuAbstract.php:306 msgid "Maintenance mode" msgstr "Onderhoudsmodus" -#: classes/Gems/Menu/MenuAbstract.php:395 +#: classes/Gems/Menu/MenuAbstract.php:398 msgid "Check status" msgstr "Status controle" -#: classes/Gems/Menu/MenuAbstract.php:396 +#: classes/Gems/Menu/MenuAbstract.php:399 msgid "Synchronize surveys" msgstr "Synchroniseer vragenlijsten" -#: classes/Gems/Menu/MenuAbstract.php:397 -#: classes/Gems/Menu/MenuAbstract.php:408 +#: classes/Gems/Menu/MenuAbstract.php:400 +#: classes/Gems/Menu/MenuAbstract.php:411 msgid "Check answers" msgstr "Antwoord controle" -#: classes/Gems/Menu/MenuAbstract.php:398 +#: classes/Gems/Menu/MenuAbstract.php:401 msgid "Synchronize all surveys" msgstr "Synchroniseer alle vragenlijsten" -#: classes/Gems/Menu/MenuAbstract.php:399 -#: classes/Gems/Menu/MenuAbstract.php:409 +#: classes/Gems/Menu/MenuAbstract.php:402 +#: classes/Gems/Menu/MenuAbstract.php:412 msgid "Check all answers" msgstr "Controleer alle antwoorden" -#: classes/Gems/Menu/MenuAbstract.php:405 +#: classes/Gems/Menu/MenuAbstract.php:408 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:439 +#: classes/Gems/Menu/MenuAbstract.php:442 msgid "Check assignments" msgstr "Controleer toewijzingen" -#: classes/Gems/Menu/MenuAbstract.php:442 +#: classes/Gems/Menu/MenuAbstract.php:445 msgid "Check all assignments" msgstr "Controleer alle toewijzingen" @@ -3036,10 +3118,12 @@ msgstr "Afnemend" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:151 +#: classes/Gems/Util/Translated.php:201 msgid "Female" msgstr "Vrouw" #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:152 +#: classes/Gems/Util/Translated.php:201 msgid "Male" msgstr "Man" @@ -3066,11 +3150,6 @@ msgid " (comment)" msgstr "(opmerkingen)" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:280 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:329 -msgid "Other" -msgstr "Overige" - #: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:466 msgid "Free number" msgstr "Vrij getal" @@ -3137,39 +3216,51 @@ msgid "%d days ago" msgstr "%d dagen terug" -#: classes/Gems/Util/Translated.php:187 +#: classes/Gems/Util/Translated.php:180 +msgid "Send multiple mails per respondent, one for each checked token." +msgstr "Verstuur meerdere emails per patiënt, één per gekozen kenmerk." + +#: classes/Gems/Util/Translated.php:181 +msgid "Send one mail per respondent, mark all checked tokens as send." +msgstr "Verstuur één email per patiënt, zet alle gekozen kenmerken op verzonden." + +#: classes/Gems/Util/Translated.php:182 +msgid "Send one mail per respondent, mark only mailed tokens as send." +msgstr "Verstuur één email per patiënt, zet alleen de verzonden kenmerken op verzonden." + +#: classes/Gems/Util/Translated.php:201 msgid "Unknown" msgstr "Onbekend" -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:206 msgid "mr." msgstr "meneer" -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:206 msgid "mrs." msgstr "mevrouw" -#: classes/Gems/Util/Translated.php:192 +#: classes/Gems/Util/Translated.php:206 msgid "mr./mrs." msgstr "de heer/mevrouw" -#: classes/Gems/Util/Translated.php:197 +#: classes/Gems/Util/Translated.php:211 msgid "Mr." msgstr "De heer" -#: classes/Gems/Util/Translated.php:197 +#: classes/Gems/Util/Translated.php:211 msgid "Mrs." msgstr "Mevrouw" -#: classes/Gems/Util/Translated.php:197 +#: classes/Gems/Util/Translated.php:211 msgid "Mr./Mrs." msgstr "De heer/Mevrouw" -#: classes/Gems/Util/Translated.php:215 +#: classes/Gems/Util/Translated.php:229 msgid "Yes (forget answers)" msgstr "Ja (vergeet antwoorden)" -#: classes/Gems/Util/Translated.php:215 +#: classes/Gems/Util/Translated.php:229 msgid "Yes (keep answers)" msgstr "Ja (met behoud van antwoorden)" @@ -3431,7 +3522,6 @@ msgstr "Kenmerk %s voor vragenlijsten %s is verwijderd." #: snippets/DeleteTrackTokenSnippet.php:277 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3549,15 +3639,16 @@ msgid "This track can be assigned since %s." msgstr "Dit traject kan sinds %s aan een patiënt toegewezen worden." +#: views/scripts/index/login.phtml:12 +msgid "The Pulse software was made possible thanks to support from " +msgstr "De PULSE software is mede mogelijk gemaakt met steun van " + #~ msgid "Activity" #~ msgstr "Activiteit" #~ msgid "DB Adaptor" #~ msgstr "DB Adaptor" -#~ msgid "The Pulse software was made possible thanks to support from " -#~ msgstr "De PULSE software is mede mogelijk gemaakt met steun van " - #~ msgid "ACL" #~ msgstr "ACL" @@ -3833,9 +3924,6 @@ #~ msgid "In progress" #~ msgstr "Invoer begonnen" -#~ msgid "Reminders" -#~ msgstr "Herinneringen" - #~ msgid "No tracks assigned to respondent nr: %s" #~ msgstr "Geen traject toegewezen aan patiënt nr: %s ." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source developm... [truncated message content] |
From: <gem...@li...> - 2011-10-24 11:30:51
|
Revision: 129 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=129&view=rev Author: mennodekker Date: 2011-10-24 11:30:45 +0000 (Mon, 24 Oct 2011) Log Message: ----------- getStaff now returns only active staff Modified Paths: -------------- trunk/library/classes/Gems/Util/DbLookup.php Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-10-24 11:18:29 UTC (rev 128) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-10-24 11:30:45 UTC (rev 129) @@ -213,13 +213,19 @@ return $roles; } + /** + * Return key/value pairs of all active staff members + * + * @staticvar array $data + * @return array + */ public function getStaff() { static $data; if (! $data) { $data = $this->db->fetchPairs("SELECT gsf_id_user, CONCAT(COALESCE(gsf_last_name, '-'), ', ', COALESCE(gsf_first_name, ''), COALESCE(CONCAT(' ', gsf_surname_prefix), '')) - FROM gems__staff ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); + FROM gems__staff WHERE gsf_active = 1 ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); } return $data; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-24 11:18:36
|
Revision: 128 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=128&view=rev Author: mennodekker Date: 2011-10-24 11:18:29 +0000 (Mon, 24 Oct 2011) Log Message: ----------- Make super and nologin special roles so super always has all privileges Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/RoleAction.php trunk/library/classes/Gems/Roles.php Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-10-24 10:20:26 UTC (rev 127) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-10-24 11:18:29 UTC (rev 128) @@ -61,6 +61,11 @@ public $escort; /** + * @var Gems_Menu + */ + public $menu; + + /** * Extension point, use different auth adapter if needed depending on the provided formValues * * This could be an organization passed in the login-form or something else. @@ -135,8 +140,17 @@ public function loginAction() { + /** + * If already logged in, try to redirect to the first allowed and visible menu item + * if that fails, try to reroute to respondent/index + */ if (isset($this->session->user_id)) { - $this->_reroute(array('controller' => 'respondent')); + if ($menuItem = $this->menu->findFirst(array('allowed' => true, 'visible' => true))) { + $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); + $redirector->gotoRoute($menuItem->toRouteUrl($this->getRequest())); + } else { + $this->_reroute(array('controller' => 'respondent', 'action'=>'index')); + } } $form = $this->_getLoginForm(); Modified: trunk/library/classes/Gems/Default/RoleAction.php =================================================================== --- trunk/library/classes/Gems/Default/RoleAction.php 2011-10-24 10:20:26 UTC (rev 127) +++ trunk/library/classes/Gems/Default/RoleAction.php 2011-10-24 11:18:29 UTC (rev 128) @@ -139,6 +139,14 @@ $data['grl_parents'] = implode(',', $data['grl_parents']); } + //Always add nologin privilege to 'nologin' role + if (isset($data['grl_name']) && $data['grl_name'] == 'nologin') { + $data['grl_privileges'][] = 'pr.nologin'; + } elseif (isset($data['grl_name']) && $data['grl_name'] !== 'nologin') { + //Assign islogin to all other roles + $data['grl_privileges'][] = 'pr.islogin'; + } + if (isset($data['grl_privileges'])) { $data['grl_privileges'] = implode(',', $data['grl_privileges']); } @@ -171,6 +179,20 @@ return $model; } + public function editAction() + { + $model = $this->getModel(); + $data = $model->loadFirst(); + + //If we try to edit super, add an error message and reroute + if (isset($data['grl_name']) && $data['grl_name']=='super') { + $this->addMessage($this->_('Editing `super` is not allowed')); + $this->_reroute(array('action'=>'index'), true); + } + + parent::editAction(); + } + public function formatLongLine($line) { if (strlen($line) > 50) { @@ -195,6 +217,10 @@ $privileges = $this->menu->getUsedPrivileges(); asort($privileges); + //don't allow to edit the pr.nologin and pr.islogin privilege + unset($privileges['pr.nologin']); + unset($privileges['pr.islogin']); + return $privileges; } Modified: trunk/library/classes/Gems/Roles.php =================================================================== --- trunk/library/classes/Gems/Roles.php 2011-10-24 10:20:26 UTC (rev 127) +++ trunk/library/classes/Gems/Roles.php 2011-10-24 11:18:29 UTC (rev 128) @@ -4,7 +4,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -103,7 +103,7 @@ public function getAcl() { return $this->_acl; } - + public static function getInstance() { if (!isset(self::$_instanceOfSelf)) { @@ -124,11 +124,11 @@ $this->loadDbAcl(); } catch (Exception $e) { Gems_Log::getLogger()->logError($e); - + // Reset all roles unset($this->_acl); $this->_acl = new MUtil_Acl(); - + //Voeg standaard rollen en privileges in $this->loadDefaultRoles(); $this->loadDefaultPrivileges(); @@ -137,6 +137,10 @@ $this->loadProjectRoles(); $this->loadProjectPrivileges(); } + + //Now allow super admin all access, except for the actions that have the nologin privilege (->the login action) + $this->_acl->allow('super'); + $this->_acl->deny('super', null, 'pr.nologin'); } public function load() { @@ -154,7 +158,7 @@ $this->build(); } } - + /** * Recursively expands roles into Zend_Acl_Role objects * @param array $roleList @@ -163,31 +167,31 @@ private function _expandRole(&$roleList, $roleName, $depth = 0) { $role = $roleList[$roleName]; - + if (isset($role['marked']) && $role['marked']) { return; } - + // possible circular reference! if ($depth > 5) { throw new Exception("Possible circular reference detected while expanding role '{$roleName}'"); } - + if (!empty($role['grl_parents'])) { $parents = explode(",", $role['grl_parents']); - + foreach ($parents as $parent) { $this->_expandRole($roleList, $parent, $depth + 1); } } else { $parents = array(); } - + $this->addRole(new Zend_Acl_Role($role['grl_name']), $parents); - + $privileges = explode(",", $role['grl_privileges']); $this->addPrivilege($role['grl_name'], $privileges); - + $roleList[$roleName]['marked'] = true; } @@ -199,19 +203,19 @@ $db = Zend_Registry::get('db'); $sql = "SELECT grl_id_role,grl_name,grl_privileges,grl_parents FROM gems__roles"; - + $roles = $db->fetchAll($sql); - + if (empty($roles)) { throw new Exception("No roles stored in db"); } - + $roleList = array_combine(array_map(function($value) { return $value['grl_name']; }, $roles), $roles); - + foreach ($roleList as $role) { $this->_expandRole($roleList, $role['grl_name']); } - + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-24 10:20:34
|
Revision: 127 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=127&view=rev Author: matijsdejong Date: 2011-10-24 10:20:26 +0000 (Mon, 24 Oct 2011) Log Message: ----------- Renamed MailController to MailTemplateController Snippet based browse edit replacement #10 and mails configurable from interface #29 are done, except for removing items and the mail jobs are not yet used. Bug #18 is corrected. Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php trunk/library/configs/db/tables/gems__mail_jobs.300.sql trunk/library/snippets/Generic/ModelItemTableSnippet.php trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Default/MailJobAction.php trunk/library/classes/Gems/Default/MailTemplateAction.php trunk/library/controllers/MailJobController.php trunk/library/controllers/MailTemplateController.php Removed Paths: ------------- trunk/library/classes/Gems/Default/MailAction.php trunk/library/controllers/MailController.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/changelog.txt 2011-10-24 10:20:26 UTC (rev 127) @@ -1,3 +1,7 @@ +Important changes from 1.4.3 => 1.5 +============================================================ +MailController is now claaed MailTemplateController + Important changes from 1.4.2 => 1.4.3 ============================================================ * gtr_organisations renamed to gtr_organizations Deleted: trunk/library/classes/Gems/Default/MailAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailAction.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/classes/Gems/Default/MailAction.php 2011-10-24 10:20:26 UTC (rev 127) @@ -1,130 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @package Gems - * @subpackage Default - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id$ - */ - -/** - * - * @package Gems - * @subpackage Default - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.1 - */ -class Gems_Default_MailAction extends Gems_Controller_BrowseEditAction -{ - /** - * Creates a model for getModel(). Called only for each new $action. - * - * The parameters allow you to easily adapt the model to the current action. The $detailed - * parameter was added, because the most common use of action is a split between detailed - * and summarized actions. - * - * @param boolean $detailed True when the current action is not in $summarizedActions. - * @param string $action The current action. - * $return MUtil_Model_ModelAbstract - */ - public function createModel($detailed, $action) - { - $model = new MUtil_Model_TableModel('gems__mail_templates'); - $model->set('gmt_subject', 'label', $this->_('Subject')); - - if ($detailed) { - $model->set('gmt_body', - 'label', $this->_('Message'), - 'itemDisplay', array('Gems_Email_EmailFormAbstract', 'displayMailText')); - } - - return $model; - } - - public function getAutoSearchElements(MUtil_Model_ModelAbstract $model, array $data) - { - $elements = parent::getAutoSearchElements($model, $data); - $options = array('' => $this->_('(all organizations)')) + $this->util->getDbLookup()->getOrganizations(); - - $elements[] = new Zend_Form_Element_Select('org_id', array('multiOptions' => $options)); - - return $elements; - } - - protected function getDataFilter(array $data) - { - if (isset($data['org_id']) && $data['org_id']) { - $organizationId = intval($data['org_id']); - return array("LOCATE('|$organizationId|', gmt_organizations) > 0"); - } - - return parent::getDataFilter($data); - } - - public function getTopic($count = 1) - { - return $this->plural('email template', 'email templates', $count); - } - - public function getTopicTitle() - { - return $this->_('Email templates'); - } - - protected function processForm($saveLabel = null, $data = null) - { - $model = $this->getModel(); - $isNew = ! $model->applyRequest($this->getRequest())->hasFilter(); - $form = new Gems_Email_MailTemplateForm($this->escort); - - $wasSaved = $form->processRequest($this->_request); - - if ($form->hasMessages()) { - $this->addMessage($form->getMessages()); - } - - if ($wasSaved) { - $this->addMessage(sprintf($this->_('%2$u %1$s saved'), $this->getTopic($wasSaved), $wasSaved)); - $this->afterSaveRoute($form->getValues()); - - } else { - $table = new MUtil_Html_TableElement(array('class' => 'formTable')); - $table->setAsFormLayout($form, true, true); - $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class. - if ($links = $this->createMenuLinks(10)) { - $table->tf(); // Add empty cell, no label - $linksCell = $table->tf($links); - } - - return $form; - } - } -} Added: trunk/library/classes/Gems/Default/MailJobAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailJobAction.php (rev 0) +++ trunk/library/classes/Gems/Default/MailJobAction.php 2011-10-24 10:20:26 UTC (rev 127) @@ -0,0 +1,180 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_Default_MailJobAction extends Gems_Controller_ModelSnippetActionAbstract +{ + /** + * + * @var ArrayObject + */ + public $project; + + + /** + * The automatically filtered result + * + * @param $resetMvc When true only the filtered resulsts + */ + public function autofilterAction($resetMvc = true) + { + $this->autofilterParameters['onEmpty'] = $this->_('No automatic mail jobs found...'); + + parent::autofilterAction($resetMvc); + } + + /** + * Action for showing a create new item page + */ + public function createAction() + { + $this->createEditParameters['formTitle'] = $this->_('New automatic mail job...'); + + parent::createAction(); + } + + /** + * Creates a model for getModel(). Called only for each new $action. + * + * The parameters allow you to easily adapt the model to the current action. The $detailed + * parameter was added, because the most common use of action is a split between detailed + * and summarized actions. + * + * @param boolean $detailed True when the current action is not in $summarizedActions. + * @param string $action The current action. + * @return MUtil_Model_ModelAbstract + */ + protected function createModel($detailed, $action) + { + $dbLookup = $this->util->getDbLookup(); + $dbTracks = $this->util->getTrackData(); + $translated = $this->util->getTranslated(); + $empty = $translated->getEmptyDropdownArray(); + $unselected = array('' => ''); + + $model = new MUtil_Model_TableModel('gems__mail_jobs'); + + Gems_Model::setChangeFieldsByPrefix($model, 'gmj'); + + $model->set('gmj_id_message', 'label', $this->_('Template'), 'multiOptions', $unselected + $dbLookup->getMailTemplates()); + $model->set('gmj_id_user_as', 'label', $this->_('By staff member'), + 'multiOptions', $unselected + $dbLookup->getStaff(), 'default', $this->escort->getCurrentUserId(), + 'description', $this->_('Used for logging and possibly from address.')); + $model->set('gmj_active', 'label', $this->_('Active'), + 'multiOptions', $translated->getYesNo(), 'elementClass', 'Checkbox', 'required', true, + 'description', $this->_('Job is only run when active.')); + + $fromMethods = $unselected + $this->getBulkMailFromOptions(); + $model->set('gmj_from_method', 'label', $this->_('From address used'), 'multiOptions', $fromMethods); + if ($detailed) { + $model->set('gmj_from_fixed', 'label', $this->_('From other'), + 'description', sprintf($this->_("Only when '%s' is '%s'."), $model->get('gmj_from_method', 'label'), end($fromMethods))); + } + $model->set('gmj_process_method', 'label', $this->_('Processing Method'), 'multiOptions', $unselected + $translated->getBulkMailProcessOptions()); + $model->set('gmj_filter_mode', 'label', $this->_('Filter for'), 'multiOptions', $unselected + $this->getBulkMailFilterOptions()); + + if ($detailed) { + $model->set('gmj_id_organization', 'label', $this->_('Organization'), 'multiOptions', $empty + $dbLookup->getOrganizations()); + $model->set('gmj_id_track', 'label', $this->_('Track'), 'multiOptions', $empty + $dbTracks->getAllTracks()); + $model->set('gsu_id_survey', 'label', $this->_('Survey'), 'multiOptions', $empty + $dbTracks->getAllSurveys()); + } + + return $model; + } + + /** + * Action for showing a edit item page + */ + public function editAction() + { + $this->createEditParameters['formTitle'] = $this->_('Edit automatic mail job'); + + parent::editAction(); + } + + /** + * The types of mail filters + * + * @return array + */ + protected function getBulkMailFilterOptions() + { + return array( + 'N' => $this->_('First mail'), + 'R' => $this->_('Reminder'), + ); + } + + /** + * Options for from address use. + * + * @return array + */ + protected function getBulkMailFromOptions() + { + $results['O'] = $this->_('Use organizational from address'); + + if (isset($project->email['site']) && $project->email['site']) { + $results['S'] = sprintf($this->_('Use site %s address'), $project->email['site']); + } + + $results['U'] = $this->_("Use the 'By staff member' address"); + $results['F'] = $this->_('Other'); + + return $results; + } + + /** + * Action for showing a browse page + */ + public function indexAction() + { + $this->html->h3($this->_('Automatic mail jobs')); + + parent::indexAction(); + + $this->html->pInfo($this->_('With automatic mail jobs and a cron job on the server, mails can be sent without manual user action.')); + } +} Copied: trunk/library/classes/Gems/Default/MailTemplateAction.php (from rev 126, trunk/library/classes/Gems/Default/MailAction.php) =================================================================== --- trunk/library/classes/Gems/Default/MailTemplateAction.php (rev 0) +++ trunk/library/classes/Gems/Default/MailTemplateAction.php 2011-10-24 10:20:26 UTC (rev 127) @@ -0,0 +1,130 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 + */ +class Gems_Default_MailTemplateAction extends Gems_Controller_BrowseEditAction +{ + /** + * Creates a model for getModel(). Called only for each new $action. + * + * The parameters allow you to easily adapt the model to the current action. The $detailed + * parameter was added, because the most common use of action is a split between detailed + * and summarized actions. + * + * @param boolean $detailed True when the current action is not in $summarizedActions. + * @param string $action The current action. + * $return MUtil_Model_ModelAbstract + */ + public function createModel($detailed, $action) + { + $model = new MUtil_Model_TableModel('gems__mail_templates'); + $model->set('gmt_subject', 'label', $this->_('Subject')); + + if ($detailed) { + $model->set('gmt_body', + 'label', $this->_('Message'), + 'itemDisplay', array('Gems_Email_EmailFormAbstract', 'displayMailText')); + } + + return $model; + } + + public function getAutoSearchElements(MUtil_Model_ModelAbstract $model, array $data) + { + $elements = parent::getAutoSearchElements($model, $data); + $options = array('' => $this->_('(all organizations)')) + $this->util->getDbLookup()->getOrganizations(); + + $elements[] = new Zend_Form_Element_Select('org_id', array('multiOptions' => $options)); + + return $elements; + } + + protected function getDataFilter(array $data) + { + if (isset($data['org_id']) && $data['org_id']) { + $organizationId = intval($data['org_id']); + return array("LOCATE('|$organizationId|', gmt_organizations) > 0"); + } + + return parent::getDataFilter($data); + } + + public function getTopic($count = 1) + { + return $this->plural('email template', 'email templates', $count); + } + + public function getTopicTitle() + { + return $this->_('Email templates'); + } + + protected function processForm($saveLabel = null, $data = null) + { + $model = $this->getModel(); + $isNew = ! $model->applyRequest($this->getRequest())->hasFilter(); + $form = new Gems_Email_MailTemplateForm($this->escort); + + $wasSaved = $form->processRequest($this->_request); + + if ($form->hasMessages()) { + $this->addMessage($form->getMessages()); + } + + if ($wasSaved) { + $this->addMessage(sprintf($this->_('%2$u %1$s saved'), $this->getTopic($wasSaved), $wasSaved)); + $this->afterSaveRoute($form->getValues()); + + } else { + $table = new MUtil_Html_TableElement(array('class' => 'formTable')); + $table->setAsFormLayout($form, true, true); + $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class. + if ($links = $this->createMenuLinks(10)) { + $table->tf(); // Add empty cell, no label + $linksCell = $table->tf($links); + } + + return $form; + } + } +} Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-24 10:20:26 UTC (rev 127) @@ -235,12 +235,15 @@ $page->addExcelAction(); $page->addShowAction(); - // MAIL Server CONTROLLER + // MAIL JOB CONTROLLER + $page = $setup->addBrowsePage($this->_('Automatic mail'), 'pr.mail.job', 'mail-job'); + + // MAIL SERVER CONTROLLER $page = $setup->addBrowsePage($this->_('Servers'), 'pr.mail.server', 'mail-server'); // $page->addAction($this->_('Test'), 'pr.mail.server.test', 'test')->addParameters(MUtil_Model::REQUEST_ID); // MAIL CONTROLLER - $setup->addBrowsePage($this->_('Templates'), 'pr.mail', 'mail'); + $setup->addBrowsePage($this->_('Templates'), 'pr.mail', 'mail-template'); return $setup; } Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2011-10-24 10:20:26 UTC (rev 127) @@ -3,7 +3,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -14,7 +14,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -25,8 +25,8 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * + * + * * @package Gems * @subpackage Snippets * @author Matijs de Jong <mj...@ma...> @@ -37,13 +37,13 @@ /** * Adds Gems specific display details and helper functions: - * + * * Items set are: * = Default route: 'show' * - Display class: 'formTable' * - Gems_Form use: createForm() * - Table display: beforeDispay() - * + * * Extra helpers are: * - Form title: getTitle() * - Menu helpers: $this->menu, beforeDispay() & getMenuList() @@ -62,21 +62,28 @@ * @var string */ protected $class = 'formTable'; - + /** + * An optional title for the form. replacing the current generic form title. + * + * @var string Optional + */ + protected $formTitle; + + /** * Required - * + * * @var Gems_Menu */ protected $menu; - + /** * The name of the action to forward to after form completion - * + * * @var string */ protected $routeAction = 'show'; - + /** * Perform some actions on the form, right before it is displayed but already populated * @@ -90,7 +97,7 @@ $table->setAsFormLayout($this->_form, true, true); // There is only one row with formLayout, so all in output fields get class. - $table['tbody'][0][0]->appendAttrib('class', $this->labelClass); + $table['tbody'][0][0]->appendAttrib('class', $this->labelClass); if ($links = $this->getMenuList()) { $table->tf(); // Add empty cell, no label @@ -108,7 +115,7 @@ { return $this->menu && parent::checkRegistryRequestsAnswers(); } - + /** * Creates an empty form. Allows overruling in sub-classes. * @@ -119,10 +126,10 @@ { // $form = new Zend_Form($options); $form = new Gems_Form($options); - + return $form; } - + /** * Create the snippets content * @@ -140,13 +147,13 @@ $form = parent::getHtmlOutput($view); $htmlDiv[] = $form; - + return $htmlDiv; } /** * overrule to add your own buttons. - * + * * @return Gems_Menu_MenuList */ protected function getMenuList() @@ -158,14 +165,16 @@ return $links; } - + /** - * + * * @return string The header title to display */ protected function getTitle() { - if ($this->createData) { + if ($this->formTitle) { + return $this->formTitle; + } elseif ($this->createData) { return sprintf($this->_('New %s...'), $this->getTopic()); } else { return sprintf($this->_('Edit %s'), $this->getTopic()); Modified: trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php 2011-10-24 10:20:26 UTC (rev 127) @@ -114,10 +114,19 @@ */ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { + if ($showMenuItem = $this->getShowMenuItem()) { + $bridge->addItemLink($showMenuItem->toActionLinkLower($this->request, $bridge)); + } + // make sure search results are highlighted $this->applyTextMarker(); - return parent::addBrowseTableColumns($bridge, $model); + parent::addBrowseTableColumns($bridge, $model); + + if ($editMenuItem = $this->getEditMenuItem()) { + $bridge->addItemLink($editMenuItem->toActionLinkLower($this->request, $bridge)); + } + } /** @@ -197,17 +206,28 @@ } /** + * Finds a specific active menu item * * @param string $controller * @param string $action * @return Gems_Menu_SubMenuItem */ - public function findMenuItem($controller, $action = 'index') + protected function findMenuItem($controller, $action = 'index') { return $this->menu->find(array('controller' => $controller, 'action' => $action, 'allowed' => true)); } /** + * Returns an edit menu item, if access is allowed by privileges + * + * @return Gems_Menu_SubMenuItem + */ + protected function getEditMenuItem() + { + return $this->findMenuItem($this->request->getControllerName(), 'edit'); + } + + /** * Create the snippets content * * This is a stub function either override getHtmlOutput() or override render() @@ -236,6 +256,16 @@ } /** + * Returns a show menu item, if access is allowed by privileges + * + * @return Gems_Menu_SubMenuItem + */ + protected function getShowMenuItem() + { + return $this->findMenuItem($this->request->getControllerName(), 'show'); + } + + /** * Overrule to implement snippet specific filtering and sorting. * * @param MUtil_Model_ModelAbstract $model Modified: trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-24 10:20:26 UTC (rev 127) @@ -197,7 +197,7 @@ } /** - * Action for showing a create new page + * Action for showing a create new item page */ public function createAction() { Modified: trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2011-10-24 10:20:26 UTC (rev 127) @@ -36,15 +36,15 @@ */ /** - * Abstract class for creating & processing a form based on a model. To use this + * Abstract class for creating & processing a form based on a model. To use this * class either subclass or use the existing default ModelFormSnippet. - * + * * The processForm() method executes e sequence of methods that - * depending on the input display the form or save the form and + * depending on the input display the form or save the form and * redirects the output to another controller/action. * * @see ModelFormSnippet - * + * * @package MUtil * @subpackage Snippets * @copyright Copyright (c) 2011 Erasmus MC @@ -466,6 +466,27 @@ // Default is just go to the index if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) { $this->afterSaveRouteUrl = array($this->request->getActionKey() => $this->routeAction); + + // Set the key identifiers for the route. + // + // Mind you the values may have changed, either because of an edit or + // because a new item was created. + $model = $this->getModel(); + $keys = $model->getKeys(); + if (count($keys) == 1) { + $key = reset($keys); + if (isset($this->formData[$key])) { + $this->afterSaveRouteUrl[MUtil_Model::REQUEST_ID] = $this->formData[$key]; + } + } else { + $i = 1; + foreach ($model->getKeys() as $key) { + if (isset($this->formData[$key])) { + $this->afterSaveRouteUrl[MUtil_Model::REQUEST_ID . $i] = $this->formData[$key]; + } + $i++; + } + } } return $this; Modified: trunk/library/configs/db/tables/gems__mail_jobs.300.sql =================================================================== --- trunk/library/configs/db/tables/gems__mail_jobs.300.sql 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/configs/db/tables/gems__mail_jobs.300.sql 2011-10-24 10:20:26 UTC (rev 127) @@ -1,33 +1,42 @@ CREATE TABLE if not exists gems__mail_jobs ( - gmj_id_message bigint unsigned not null auto_increment, + gmj_id_job bigint unsigned not null auto_increment, - gmj_id_organization bigint unsigned not null - references gems__organizations (gor_id_organization), + gmj_id_message bigint unsigned not null + references gems__mail_templates (gmt_id_message), gmj_id_user_as bigint unsigned not null references gems__staff (gsf_id_user), + gmj_active boolean not null default 1, + -- O Use organization from address -- S Use site from address -- U Use gmj_id_user_as from address + -- F Fixed gmj_from_fixed gmj_from_method varchar(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gmj_from_fixed varchar(254) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, -- M => multiple per respondent, one for each token -- O => One per respondent, mark all tokens as send - -- U / A? => Send only one token, do not mark + -- A => Send only one token, do not mark gmj_process_method varchar(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, -- N => notmailed -- R => reminder gmj_filter_mode varchar(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + -- Optional filters + gmj_id_organization bigint unsigned null references gems__organizations (gor_id_organization), + gmj_id_track int unsigned null references gems__tracks (gtr_id_track), + gsu_id_survey int unsigned null references gems__surveys (gsu_id_survey), + gmj_changed timestamp not null default current_timestamp on update current_timestamp, gmj_changed_by bigint unsigned not null, gmj_created timestamp not null default '0000-00-00 00:00:00', gmj_created_by bigint unsigned not null, - PRIMARY KEY (gmj_id_message) + PRIMARY KEY (gmj_id_job) ) ENGINE=InnoDB AUTO_INCREMENT = 800 Deleted: trunk/library/controllers/MailController.php =================================================================== --- trunk/library/controllers/MailController.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/controllers/MailController.php 2011-10-24 10:20:26 UTC (rev 127) @@ -1,48 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @package Gems - * @subpackage Default - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id$ - */ - -/** - * - * @package Gems - * @subpackage Default - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4.2 - */ -class MailController extends Gems_Default_MailAction -{ -} Added: trunk/library/controllers/MailJobController.php =================================================================== --- trunk/library/controllers/MailJobController.php (rev 0) +++ trunk/library/controllers/MailJobController.php 2011-10-24 10:20:26 UTC (rev 127) @@ -0,0 +1,50 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class MailJobController extends Gems_Default_MailJobAction +{ + +} Copied: trunk/library/controllers/MailTemplateController.php (from rev 126, trunk/library/controllers/MailController.php) =================================================================== --- trunk/library/controllers/MailTemplateController.php (rev 0) +++ trunk/library/controllers/MailTemplateController.php 2011-10-24 10:20:26 UTC (rev 127) @@ -0,0 +1,48 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.2 + */ +class MailTemplateController extends Gems_Default_MailTemplateAction +{ +} Modified: trunk/library/snippets/Generic/ModelItemTableSnippet.php =================================================================== --- trunk/library/snippets/Generic/ModelItemTableSnippet.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/snippets/Generic/ModelItemTableSnippet.php 2011-10-24 10:20:26 UTC (rev 127) @@ -102,6 +102,11 @@ */ protected function addShowTableRows(MUtil_Model_VerticalTableBridge $bridge, MUtil_Model_ModelAbstract $model) { + if ($menuItem = $this->getEditMenuItem()) { + // Add click to edit + $bridge->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->request), '\';'); + } + parent::addShowTableRows($bridge, $model); $controller = $this->request->getControllerName(); @@ -124,4 +129,26 @@ { return $this->model; } + + /** + * Finds a specific active menu item + * + * @param string $controller + * @param string $action + * @return Gems_Menu_SubMenuItem + */ + protected function findMenuItem($controller, $action = 'index') + { + return $this->menu->find(array('controller' => $controller, 'action' => $action, 'allowed' => true)); + } + + /** + * Returns an edit menu item, if access is allowed by privileges + * + * @return Gems_Menu_SubMenuItem + */ + protected function getEditMenuItem() + { + return $this->findMenuItem($this->request->getControllerName(), 'edit'); + } } Modified: trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php =================================================================== --- trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2011-10-21 15:43:06 UTC (rev 126) +++ trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2011-10-24 10:20:26 UTC (rev 127) @@ -59,7 +59,7 @@ */ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { - if ($menuItem = $this->findMenuItem($this->request->getControllerName(), 'show')) { + if ($menuItem = $this->getShowMenuItem()) { $bridge->addItemLink($menuItem->toActionLinkLower($this->request, $bridge)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-21 15:43:14
|
Revision: 126 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=126&view=rev Author: matijsdejong Date: 2011-10-21 15:43:06 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Fix for #28 database actions do not show correctly in menu. Preparations started for #29 and associated #18: configurable automatic mails. Continued working on #10: SnippetAction now has create and edit actions as well. Made MUtil/Controller/ModelSnippetActionAbstract.php independent of MUtil/Controller/ModelActionAbstract.php less code was copied than was left unused and the copied code has been stable for a long time. Modified Paths: -------------- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php trunk/library/classes/Gems/Default/DatabaseAction.php trunk/library/classes/Gems/Email/MultiMailForm.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/Gems/Util/Translated.php trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php trunk/library/configs/db/patches.sql trunk/library/controllers/MailController.php Added Paths: ----------- trunk/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php trunk/library/snippets/Generic/ModelFormSnippet.php Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2011-10-21 15:43:06 UTC (rev 126) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Short description of file * * @package Gems * @subpackage Controller @@ -37,10 +36,8 @@ */ /** - * Short description for class + * Class contains Gems specific adaptations to parent class. * - * Long description for class (if any)... - * * @package Gems * @subpackage Controller * @copyright Copyright (c) 2011 Erasmus MC @@ -50,12 +47,6 @@ abstract class Gems_Controller_ModelSnippetActionAbstract extends MUtil_Controller_ModelSnippetActionAbstract { /** - * - * @var GemsEscort - */ - public $escort; - - /** * The parameters used for the autofilter action. * * @var array Mixed key => value array for snippet initialization @@ -74,6 +65,19 @@ protected $autofilterSnippets = 'Generic_ModelTableSnippet'; /** + * The snippets used for the create and edit actions. + * + * @var mixed String or array of snippets name + */ + protected $createEditSnippets = 'Generic_ModelFormSnippet'; + + /** + * + * @var GemsEscort + */ + public $escort; + + /** * The snippets used for the index action, before those in autofilter * * @var mixed String or array of snippets name Modified: trunk/library/classes/Gems/Default/DatabaseAction.php =================================================================== --- trunk/library/classes/Gems/Default/DatabaseAction.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/classes/Gems/Default/DatabaseAction.php 2011-10-21 15:43:06 UTC (rev 126) @@ -93,6 +93,18 @@ } /** + * Set the parameters needed by the menu. + * + * @param array $data The current model item + */ + private function _setMenuParameters(array $data) + { + $source = $this->menu->getParameterSource(); + $source['script'] = $data['script'] ? true : false; + $source['exists'] = $data['exists'] ? true : false; + } + + /** * Adds elements from the model to the bridge that creates the form. * * Overrule this function to add different elements to the browse table, without @@ -180,6 +192,8 @@ $model = $this->getModel(); $data = $model->applyRequest($this->getRequest())->loadFirst(); + $this->_setMenuParameters($data); + if (! ($data && isset($data['exists']) && $data['exists'])) { $this->addMessage($this->_('This database object does not exist. You cannot delete it.')); $this->html->buttonDiv($this->createMenuLinks(1)); @@ -438,6 +452,8 @@ $model = $this->getModel(); $data = $model->loadFirst(); + $this->_setMenuParameters($data); + if (! ($data && isset($data['exists'], $data['script']) && ($data['exists'] || $data['script']))) { $this->addMessage($this->_('This database object does not exist. You cannot create it.')); $this->html->buttonDiv($this->createMenuLinks(1)); @@ -580,9 +596,9 @@ $model = $this->getModel(); $data = $model->loadFirst(); - $source = $this->menu->getParameterSource(); - $source['script'] = $data['script']; - $source['exists'] = $data['exists']; + if ($data) { + $this->_setMenuParameters($data); + } parent::showAction(); } @@ -592,6 +608,8 @@ $model = $this->getModel(); $data = $model->loadFirst(); + $this->_setMenuParameters($data); + if (! ($data && isset($data['exists']) && $data['exists'])) { $this->addMessage($this->_('This database object does not exist. You cannot view it.')); $this->html->buttonDiv($this->createMenuLinks(1)); Modified: trunk/library/classes/Gems/Email/MultiMailForm.php =================================================================== --- trunk/library/classes/Gems/Email/MultiMailForm.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/classes/Gems/Email/MultiMailForm.php 2011-10-21 15:43:06 UTC (rev 126) @@ -1,31 +1,31 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * @version $Id$ * @package Gems * @subpackage Email @@ -69,15 +69,11 @@ protected function createMethodElement() { - $options = array( - 'M' => $this->escort->_('Send multiple mails per respondent, one for each checked token.'), - 'O' => $this->escort->_('Send one mail per respondent, mark all checked tokens as send.'), - 'A' => $this->escort->_('Send one mail per respondent, mark only mailed tokens as send.'), - ); + $options = $this->escort->getUtil()->getTranslated()->getBulkMailProcessOptions(); return new Zend_Form_Element_Radio('multi_method', array( 'label' => $this->escort->_('Method'), - 'multiOptions' => $options, + 'multiOptions' => $options, 'required' => true, )); } @@ -138,11 +134,11 @@ $title = null; } - return $this->_createMultiOption($tokenData, - $this->mailer->getTokenName($tokenData), - $tokenData['grs_email'], - $tokenData['survey_short'], - $title, + return $this->_createMultiOption($tokenData, + $this->mailer->getTokenName($tokenData), + $tokenData['grs_email'], + $tokenData['survey_short'], + $title, $menuFind); } @@ -202,7 +198,7 @@ $this->tokensData = $tokensData; $this->setTokenData(reset($tokensData)); - + return $this; } } Copied: trunk/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php (from rev 124, trunk/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php) =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php (rev 0) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php 2011-10-21 15:43:06 UTC (rev 126) @@ -0,0 +1,70 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Snippets + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Displays an edit form based on the model the model set through the $model snippet parameter. + * + * If you want to use this class "as is" use the 'Generic_ModelFormSnippet' snippet. + * + * This class is not in the standard snippet loading directories and does not follow + * their naming conventions, but exists only to make it simple to extend this class + * for a specific implementation. + * + * @package MUtil + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_Snippets_ModelFormSnippetGeneric extends Gems_Snippets_ModelFormSnippetAbstract +{ + /** + * + * @var MUtil_Model_ModelAbstract + */ + protected $model; + + /** + * Creates the model + * + * @return MUtil_Model_ModelAbstract + */ + protected function createModel() + { + return $this->model; + } +} Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-10-21 15:43:06 UTC (rev 126) @@ -104,6 +104,33 @@ return $groups; } + /** + * Retrieve an array of groups the user is allowed to assign: his own group and all groups + * he inherits rights from + * + * @return array + */ + public function getAllowedStaffGroups() + { + $groups = $this->getActiveStaffGroups(); + if ($this->session->user_role === 'super') { + return $groups; + + } else { + $rolesAllowed = $this->acl->getRoleAndParents($this->session->user_role); + $roles = $this->db->fetchPairs('SELECT ggp_id_group, ggp_role FROM gems__groups WHERE ggp_group_active=1 AND ggp_staff_members=1 ORDER BY ggp_name'); + $result = array(); + + foreach ($roles as $id => $role) { + if ((in_array($role, $rolesAllowed)) && isset($groups[$id])) { + $result[$id] = $groups[$id]; + } + } + + return $result; + } + } + public function getDefaultGroup() { $groups = $this->getActiveStaffGroups(); @@ -140,7 +167,24 @@ } /** + * Return the available mail templates. * + * @staticvar array $data + * @return array The tempalteId => subject list + */ + public function getMailTemplates() + { + static $data; + + if (! $data) { + $data = $this->db->fetchPairs("SELECT gmt_id_message, gmt_subject FROM gems__mail_templates ORDER BY gmt_subject"); + } + + return $data; + } + + /** + * * @staticvar array $organizations * @return array List of the active organizations */ @@ -192,33 +236,6 @@ return $groups; } - /** - * Retrieve an array of groups the user is allowed to assign: his own group and all groups - * he inherits rights from - * - * @return array - */ - public function getAllowedStaffGroups() - { - $groups = $this->getActiveStaffGroups(); - if ($this->session->user_role === 'super') { - return $groups; - - } else { - $rolesAllowed = $this->acl->getRoleAndParents($this->session->user_role); - $roles = $this->db->fetchPairs('SELECT ggp_id_group, ggp_role FROM gems__groups WHERE ggp_group_active=1 AND ggp_staff_members=1 ORDER BY ggp_name'); - $result = array(); - - foreach ($roles as $id => $role) { - if ((in_array($role, $rolesAllowed)) && isset($groups[$id])) { - $result[$id] = $groups[$id]; - } - } - - return $result; - } - } - public function getUserConsents() { static $consents; Modified: trunk/library/classes/Gems/Util/Translated.php =================================================================== --- trunk/library/classes/Gems/Util/Translated.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/classes/Gems/Util/Translated.php 2011-10-21 15:43:06 UTC (rev 126) @@ -170,6 +170,20 @@ } /** + * The options for bulk mail token processing. + * + * @return array + */ + public function getBulkMailProcessOptions() + { + return array( + 'M' => $this->_('Send multiple mails per respondent, one for each checked token.'), + 'O' => $this->_('Send one mail per respondent, mark all checked tokens as send.'), + 'A' => $this->_('Send one mail per respondent, mark only mailed tokens as send.'), + ); + } + + /** * Get a translated empty value for usage in dropdowns * * On instantiation of the class via Gems_Loader this variable will be populated Modified: trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-21 15:43:06 UTC (rev 126) @@ -46,9 +46,18 @@ * @license New BSD License * @since Class available since version 1.4.2 */ -abstract class MUtil_Controller_ModelSnippetActionAbstract extends MUtil_Controller_ModelActionAbstract +abstract class MUtil_Controller_ModelSnippetActionAbstract extends MUtil_Controller_Action { /** + * Created in createModel(). + * + * Always retrieve using $this->getModel(). + * + * $var MUtil_Model_ModelAbstract $_model The model in use + */ + private $_model; + + /** * The parameters used for the autofilter action. * * @var array Mixed key => value array for snippet initialization @@ -63,6 +72,20 @@ protected $autofilterSnippets = 'ModelTableSnippet'; /** + * The parameters used for the create and edit actions. + * + * @var array Mixed key => value array for snippet initialization + */ + protected $createEditParameters = array(); + + /** + * The snippets used for the create and edit actions. + * + * @var mixed String or array of snippets name + */ + protected $createEditSnippets = 'ModelFormSnippet'; + + /** * The parameters used for the index action minus those in autofilter. * * @var array Mixed key => value array for snippet initialization @@ -111,6 +134,23 @@ public $summarizedActions = array('index', 'autofilter'); /** + * Set to true in so $this->html is created at startup. + * + * @var boolean $useHtmlView true + */ + public $useHtmlView = true; // Overrule parent + + /** + * The request ID value + * + * @return string The request ID value + */ + protected function _getIdParam() + { + return $this->_getParam(MUtil_Model::REQUEST_ID); + } + + /** * Set the action key in request * * Use this when an action is a Ajax action for retrieving @@ -157,6 +197,77 @@ } /** + * Action for showing a create new page + */ + public function createAction() + { + if ($this->createEditSnippets) { + $this->createEditParameters['createData'] = true; + $this->createEditParameters['model'] = $this->getModel(); + $this->createEditParameters['request'] = $this->getRequest(); + + $this->addSnippets($this->createEditSnippets, $this->createEditParameters); + } + } + + /** + * Creates a model for getModel(). Called only for each new $action. + * + * The parameters allow you to easily adapt the model to the current action. The $detailed + * parameter was added, because the most common use of action is a split between detailed + * and summarized actions. + * + * @param boolean $detailed True when the current action is not in $summarizedActions. + * @param string $action The current action. + * @return MUtil_Model_ModelAbstract + */ + abstract protected function createModel($detailed, $action); + + /** + * Action for showing a edit item page + */ + public function editAction() + { + if ($this->createEditSnippets) { + $this->createEditParameters['createData'] = false; + $this->createEditParameters['model'] = $this->getModel(); + $this->createEditParameters['request'] = $this->getRequest(); + + $this->addSnippets($this->createEditSnippets, $this->createEditParameters); + } + } + + /** + * Returns the model for the current $action. + * + * The parameters allow you to easily adapt the model to the current action. The $detailed + * parameter was added, because the most common use of action is a split between detailed + * and summarized actions. + * + * @return MUtil_Model_ModelAbstract + */ + protected function getModel() + { + $request = $this->getRequest(); + $action = null === $request ? '' : $request->getActionName(); + + // Only get new model if there is no model or the model was for a different action + if (! ($this->_model && $this->_model->isMeta('action', $action))) { + $detailed = ! in_array($action, $this->summarizedActions); + + $this->_model = $this->createModel($detailed, $action); + $this->_model->setMeta('action', $action); + + // Detailed models DO NOT USE $_POST for filtering, + // multirow models DO USE $_POST parameters for filtering. + $this->_model->applyRequest($request, $detailed); + } + + return $this->_model; + } + + + /** * Action for showing a browse page */ public function indexAction() @@ -179,7 +290,6 @@ } } - /** * Action for showing an item page */ Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/configs/db/patches.sql 2011-10-21 15:43:06 UTC (rev 126) @@ -211,6 +211,7 @@ -- PATCH: Add mail actions to admin role UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.log') WHERE grl_name = 'admin' AND grl_privileges NOT LIKE '%pr.mail.log%'; UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.mail.server%'; +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.job,pr.mail.job.create,pr.mail.job.delete,pr.mail.job.edit') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.mail.job%'; -- PATCH: Set default for new rounds at days ALTER TABLE `gems__round_periods` CHANGE `grp_valid_after_unit` `grp_valid_after_unit` CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'D', Modified: trunk/library/controllers/MailController.php =================================================================== --- trunk/library/controllers/MailController.php 2011-10-21 13:55:24 UTC (rev 125) +++ trunk/library/controllers/MailController.php 2011-10-21 15:43:06 UTC (rev 126) @@ -1,33 +1,48 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.2 + */ class MailController extends Gems_Default_MailAction { } Copied: trunk/library/snippets/Generic/ModelFormSnippet.php (from rev 124, trunk/library/snippets/Generic/ModelTableSnippet.php) =================================================================== --- trunk/library/snippets/Generic/ModelFormSnippet.php (rev 0) +++ trunk/library/snippets/Generic/ModelFormSnippet.php 2011-10-21 15:43:06 UTC (rev 126) @@ -0,0 +1,50 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Snippets + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Displays an edit form based on the model the model set through the $model snippet parameter. + * + * Usage snippet for Gems_Snippets_ModelTableSnippetGeneric + * + * @package MUtil + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4 + */ +class Generic_ModelFormSnippet extends Gems_Snippets_ModelFormSnippetGeneric +{ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-21 13:55:30
|
Revision: 125 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=125&view=rev Author: matijsdejong Date: 2011-10-21 13:55:24 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Fix for #26, new round timing defaults to Day units. Fix for #27, incorrectly escaped question labels Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php trunk/library/configs/db/patches.sql Modified: trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2011-10-21 12:29:37 UTC (rev 124) +++ trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2011-10-21 13:55:24 UTC (rev 125) @@ -438,7 +438,7 @@ $model->set('grp_valid_for_id', 'label', $this->_('Round used'), 'default', ''); $model->set('grp_valid_for_field', 'label', $this->_('Date used'), 'default', 'gto_valid_from'); $model->set('grp_valid_for_length', 'label', $this->_('Add to date'), 'required', false, 'default', 2); - $model->set('grp_valid_for_unit', 'label', $this->_('Add to date unit'), 'multiOptions', $this->getDateUnitsList(false), 'default', 'M'); + $model->set('grp_valid_for_unit', 'label', $this->_('Add to date unit'), 'multiOptions', $this->getDateUnitsList(false)); // Continue with last round level items $model->set('gro_active'); Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2011-10-21 12:29:37 UTC (rev 124) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2011-10-21 13:55:24 UTC (rev 125) @@ -605,22 +605,22 @@ } if (! isset($oldfld) || ($oldfld['question'] !== $field['question'])) { - $tmpres['label'] = $this->removeHtml($field['question']); + $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['question'])); } // Juggle the labels for sub-questions etc.. if (isset($field['sq_question'])) { if (isset($field['sq_question1'])) { - $field['label'] = sprintf($this->translate->_('%s: %s'), $field['sq_question'], $field['sq_question1']); + $field['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $field['sq_question'], $field['sq_question1'])); } if (! isset($tmpres['label'])) { - $tmpres['label'] = $this->removeHtml($field['sq_question']); + $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); } else { // Add non answered question for grouping $model->set('_' . $name . '_', $tmpres); // "Next" question - $tmpres['label'] = $this->removeHtml($field['sq_question']); + $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); } $tmpres['thClass'] = 'question_sub'; } @@ -826,7 +826,7 @@ * @param string $removeContent Pipe | separated tags from which contect will be stripped * @return string */ - private function removeHtml($s , $keepTags = '' , $removeContent = 'script|style|noframes|select|option'){ + private function removeHtml($s, $keepTags = '' , $removeContent = 'script|style|noframes|select|option'){ /**///prep the string $s = ' ' . $s; Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-21 12:29:37 UTC (rev 124) +++ trunk/library/configs/db/patches.sql 2011-10-21 13:55:24 UTC (rev 125) @@ -211,3 +211,7 @@ -- PATCH: Add mail actions to admin role UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.log') WHERE grl_name = 'admin' AND grl_privileges NOT LIKE '%pr.mail.log%'; UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.mail.server%'; + +-- PATCH: Set default for new rounds at days +ALTER TABLE `gems__round_periods` CHANGE `grp_valid_after_unit` `grp_valid_after_unit` CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'D', + CHANGE `grp_valid_for_unit` `grp_valid_for_unit` CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'D'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-21 12:29:46
|
Revision: 124 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=124&view=rev Author: matijsdejong Date: 2011-10-21 12:29:37 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Merge from trunk r144-r122 Revision Links: -------------- http://gemstracker.svn.sourceforge.net/gemstracker/?rev=144&view=rev http://gemstracker.svn.sourceforge.net/gemstracker/?rev=122&view=rev Modified Paths: -------------- branches/newUser/classes/Gems/Default/MailLogAction.php branches/newUser/classes/Gems/Default/ProjectInformationAction.php branches/newUser/classes/Gems/Default/SourceAction.php branches/newUser/classes/Gems/Menu/MenuAbstract.php branches/newUser/classes/Gems/Menu/SubMenuItem.php branches/newUser/classes/Gems/Snippets/ModelTableSnippetAbstract.php branches/newUser/classes/Gems/Tracker/Survey.php branches/newUser/classes/Gems/Tracker.php branches/newUser/classes/Gems/Util/DatabasePatcher.php branches/newUser/classes/GemsEscort.php branches/newUser/classes/MUtil/Controller/ModelSnippetActionAbstract.php branches/newUser/classes/MUtil/Snippets/ModelTableSnippetAbstract.php branches/newUser/configs/db/patches.sql branches/newUser/configs/db/tables/gems__mail_jobs.300.sql branches/newUser/configs/db/tables/gems__reception_codes.10.sql branches/newUser/configs/db/tables/gems__roles.20.sql branches/newUser/configs/db/tables/gems__surveys.30.sql branches/newUser/controllers/MailLogController.php branches/newUser/languages/default-en.mo branches/newUser/languages/default-en.po branches/newUser/languages/default-nl.mo branches/newUser/languages/default-nl.po branches/newUser/snippets/Generic/ModelItemTableSnippet.php branches/newUser/snippets/Generic/ModelTableSnippet.php Added Paths: ----------- branches/newUser/classes/Gems/Snippets/ModelTableSnippetGeneric.php branches/newUser/snippets/Mail/ branches/newUser/snippets/Mail/Log/ branches/newUser/snippets/Mail/Log/MailLogBrowseSnippet.php Removed Paths: ------------- branches/newUser/classes/Gems/Default/MailLogActionOldStyle.php branches/newUser/snippets/Mail/Log/ branches/newUser/snippets/Mail/Log/MailLogBrowseSnippet.php Property Changed: ---------------- branches/newUser/ Property changes on: branches/newUser ___________________________________________________________________ Added: svn:mergeinfo + /trunk/library:114-122 Modified: branches/newUser/classes/Gems/Default/MailLogAction.php =================================================================== --- branches/newUser/classes/Gems/Default/MailLogAction.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Default/MailLogAction.php 2011-10-21 12:29:37 UTC (rev 124) @@ -37,10 +37,8 @@ */ /** - * Short description for class + * Controller for looking at mail activity * - * Long description for class (if any)... - * * @package Gems * @subpackage Default * @copyright Copyright (c) 2011 Erasmus MC @@ -50,28 +48,12 @@ class Gems_Default_MailLogAction extends Gems_Controller_ModelSnippetActionAbstract { /** - * Adds columns from the model to the bridge that creates the browse table. + * The snippets used for the autofilter action. * - * Adds a button column to the model, if such a button exists in the model. - * - * @param MUtil_Model_TableBridge $bridge - * @param MUtil_Model_ModelAbstract $model - * @rturn void + * @var mixed String or array of snippets name */ - public function addTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) - { - if ($menuItem = $this->firstAllowedMenuItem('show')) { - $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); - } + protected $autofilterSnippets = 'Mail_Log_MailLogBrowseSnippet'; - // Newline placeholder - $br = MUtil_Html::create('br'); - - $bridge->addMultiSort('grco_created', $br, 'respondent_name', $br, 'grco_address'); - $bridge->addMultiSort('grco_id_token', $br, 'assigned_by', $br, 'grco_sender'); - $bridge->addMultiSort('grco_topic'); - } - /** * The automatically filtered result */ @@ -79,7 +61,6 @@ { $filter = array('grco_organization' => $this->escort->getCurrentOrganization()); - $this->autofilterParameters['addTableColumns'] = array($this, 'addTableColumns'); $this->autofilterParameters['extraFilter'] = $filter; $this->autofilterParameters['extraSort'] = array('grco_created' => SORT_DESC); @@ -147,7 +128,6 @@ { $this->html->h3($this->_('Mail Activity Log')); - // MUtil_Echo::track($this->indexParameters); parent::indexAction(); } Deleted: branches/newUser/classes/Gems/Default/MailLogActionOldStyle.php =================================================================== --- branches/newUser/classes/Gems/Default/MailLogActionOldStyle.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Default/MailLogActionOldStyle.php 2011-10-21 12:29:37 UTC (rev 124) @@ -1,150 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file - * - * @package Gems - * @subpackage Default - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ - */ - -/** - * Temprary class until Gems_Controller_ModelSnippetActionAbstract works - * - * @package Gems - * @subpackage Default - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4.2 - */ -class Gems_Default_MailLogActionOldStyle extends Gems_Controller_BrowseEditAction -{ - public $sortKey = array('grco_created' => SORT_DESC); - - /** - * Adds columns from the model to the bridge that creates the browse table. - * - * Adds a button column to the model, if such a button exists in the model. - * - * @param MUtil_Model_TableBridge $bridge - * @param MUtil_Model_ModelAbstract $model - * @rturn void - */ - protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) - { - if ($menuItem = $this->findAllowedMenuItem('show')) { - $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); - } - - // Newline placeholder - $br = MUtil_Html::create('br'); - - $bridge->addMultiSort('grco_created', $br, 'respondent_name', $br, 'grco_address'); - $bridge->addMultiSort('grco_id_token', $br, 'assigned_by', $br, 'grco_sender'); - $bridge->addMultiSort('grco_topic'); - } - - /** - * Creates a model for getModel(). Called only for each new $action. - * - * The parameters allow you to easily adapt the model to the current action. The $detailed - * parameter was added, because the most common use of action is a split between detailed - * and summarized actions. - * - * @param boolean $detailed True when the current action is not in $summarizedActions. - * @param string $action The current action. - * @return MUtil_Model_ModelAbstract - */ - public function createModel($detailed, $action) - { - $model = new Gems_Model_JoinModel('maillog', 'gems__log_respondent_communications'); - - $model->addLeftTable('gems__respondents', array('grco_id_to' => 'grs_id_user')); - $model->addLeftTable('gems__staff', array('grco_id_by' => 'gsf_id_user')); - $model->addLeftTable('gems__mail_templates', array('grco_id_message' => 'gmt_id_message')); - - $model->addColumn( - "TRIM(CONCAT(COALESCE(CONCAT(grs_last_name, ', '), '-, '), COALESCE(CONCAT(grs_first_name, ' '), ''), COALESCE(grs_surname_prefix, '')))", - 'respondent_name'); - $model->addColumn( - "CASE WHEN gems__staff.gsf_id_user IS NULL - THEN '-' - ELSE - CONCAT( - COALESCE(gems__staff.gsf_last_name, ''), - ', ', - COALESCE(gems__staff.gsf_first_name, ''), - COALESCE(CONCAT(' ', gems__staff.gsf_surname_prefix), '') - ) - END", - 'assigned_by'); - - $model->resetOrder(); - - $model->set('grco_created', 'label', $this->_('Date sent')); - $model->set('respondent_name', 'label', $this->_('Receiver')); - $model->set('grco_address', 'label', $this->_('To address'), 'itemDisplay', 'MUtil_Html_AElement::ifmail'); - $model->set('assigned_by', 'label', $this->_('Sender')); - $model->set('grco_sender', 'label', $this->_('From address'), 'itemDisplay', 'MUtil_Html_AElement::ifmail'); - $model->set('grco_id_token', 'label', $this->_('Token')); - $model->set('grco_topic', 'label', $this->_('Subject')); - - if ($detailed) { - $model->set('gmt_subject', 'label', $this->_('Template')); - } else { - $model->set('grco_created', 'formatFunction', $this->util->getTranslated()->formatDate); - } - - return $model; - } - - /** - * Helper function to allow generalized statements about the items in the model. - * - * @param int $count - * @return $string - */ - public function getTopic($count = 1) - { - return $this->plural('Activity Log', 'Activity Logs', $count); - } - - - /** - * Helper function to allow generalized treatment of the header. - * - * return $string - */ - public function getTopicTitle() - { - return $this->_('Mail Activity Log'); - } -} Modified: branches/newUser/classes/Gems/Default/ProjectInformationAction.php =================================================================== --- branches/newUser/classes/Gems/Default/ProjectInformationAction.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Default/ProjectInformationAction.php 2011-10-21 12:29:37 UTC (rev 124) @@ -45,6 +45,18 @@ */ class Gems_Default_ProjectInformationAction extends Gems_Controller_Action { + /** + * + * @var GemsEscort + */ + public $escort; + + /** + * + * @var Gems_Menu + */ + public $menu; + public $useHtmlView = true; protected function _showTable($caption, $data, $nested = false) @@ -132,18 +144,40 @@ $data[$this->_('Server OS')] = php_uname('s'); $data[$this->_('Time on server')] = date('r'); + if (file_exists($this->escort->getMaintenanceLockFilename())) { + $label = $this->_('Turn Maintenance Mode OFF'); + } else { + $label = $this->_('Turn Maintenance Mode ON'); + } + $request = $this->getRequest(); + $buttonList = $this->menu->getMenuList(); + $buttonList->addParameterSources($request) + ->addByController($request->getControllerName(), 'maintenance', $label); + + // $this->html->buttonDiv($buttonList); + $this->_showTable($this->_('Version information'), $data); + + $this->html->buttonDiv($buttonList); } public function maintenanceAction() { - $lockFile = GEMS_ROOT_DIR . '/var/settings/lock.txt'; - if(file_exists($lockFile)) { + $lockFile = $this->escort->getMaintenanceLockFilename(); + if (file_exists($lockFile)) { unlink($lockFile); } else { touch($lockFile); } - $this->_forward('index'); + + // Dump the existing maintenance mode messages. + $this->escort->getMessenger()->clearCurrentMessages(); + $this->escort->getMessenger()->clearMessages(); + MUtil_Echo::out(); + + // Redirect + $request = $this->getRequest(); + $this->_reroute(array($request->getActionKey() => 'index')); } public function phpAction() Modified: branches/newUser/classes/Gems/Default/SourceAction.php =================================================================== --- branches/newUser/classes/Gems/Default/SourceAction.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Default/SourceAction.php 2011-10-21 12:29:37 UTC (rev 124) @@ -76,14 +76,14 @@ } $bridge->addHidden('gso_id_source'); - $bridge->addText('gso_source_name', array('size' => 15, 'minlength' => 4)); + $bridge->addText('gso_source_name', 'description', $this->_('E.g. the name of the project - for single source projects.'), 'size', 15, 'minlength', 4); $bridge->addValidator('gso_source_name', $model->createUniqueValidator('gso_source_name')); - $bridge->addText('gso_ls_url', array('size' => 50)); + $bridge->addText('gso_ls_url', 'description', $this->_('For creating token-survey url.'), 'size', 50); $bridge->addValidator('gso_ls_url', $model->createUniqueValidator('gso_ls_url')); $bridge->addValidator('gso_ls_url', new MUtil_Validate_Url()); $bridge->addSelect('gso_ls_class'); - $bridge->addSelect('gso_ls_adapter'); + $bridge->addSelect('gso_ls_adapter', 'description', $this->_('The database server used by the source.')); $bridge->addText('gso_ls_table_prefix', array('size' => 15, 'description' => $this->_('Do not forget the underscores.'))); $bridge->addText('gso_ls_dbhost', array('size' => 15, 'description' => $in_gems)); @@ -140,15 +140,16 @@ $model = new MUtil_Model_TableModel('gems__sources'); $model->set('gso_source_name', 'label', $this->_('Name')); - $model->set('gso_ls_url', 'label', $this->_('Url'), 'default', 'http://'); + $model->set('gso_ls_url', 'label', $this->_('Source Url'), 'default', 'http://'); $model->set('gso_ls_class', 'label', $this->_('Adaptor class'), 'multiOptions', $tracker->getSourceClasses()); if ($detailed) { - $model->set('gso_ls_adapter', 'label', $this->_('DB Adaptor'), 'multiOptions', $tracker->getSourceDatabaseClasses()); + $model->set('gso_ls_adapter', 'label', $this->_('Database Server'), 'multiOptions', $tracker->getSourceDatabaseClasses(), 'default', substr(get_class($this->db), strlen('Zend_Db_Adapter_'))); $model->set('gso_ls_dbhost', 'label', $this->_('Database host')); $model->set('gso_ls_database', 'label', $this->_('Database')); } + $model->set('gso_ls_table_prefix', 'label', $this->_('Table prefix'), 'default', 'ls__'); $model->set('gso_active', 'default', 0); Modified: branches/newUser/classes/Gems/Menu/MenuAbstract.php =================================================================== --- branches/newUser/classes/Gems/Menu/MenuAbstract.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Menu/MenuAbstract.php 2011-10-21 12:29:37 UTC (rev 124) @@ -230,7 +230,7 @@ // MAIL ACTIVITY CONTROLLER //$setup->addBrowsePage(); - $page = $setup->addPage($this->_('Activity'), 'pr.mail.log', 'mail-log'); + $page = $setup->addPage($this->_('Activity log'), 'pr.mail.log', 'mail-log'); $page->addAutofilterAction(); $page->addExcelAction(); $page->addShowAction(); @@ -300,7 +300,7 @@ $page->addAction($this->_('PHP'), null, 'php'); $page->addAction($this->_('Project'), null, 'project'); $page->addAction($this->_('Session'), null, 'session'); - $page->addAction($this->_('Maintenance mode'), 'pr.maintenance', 'maintenance'); + $page->addButtonOnly($this->_('Maintenance mode'), 'pr.maintenance', 'project-information', 'maintenance'); return $page; } Modified: branches/newUser/classes/Gems/Menu/SubMenuItem.php =================================================================== --- branches/newUser/classes/Gems/Menu/SubMenuItem.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Menu/SubMenuItem.php 2011-10-21 12:29:37 UTC (rev 124) @@ -551,11 +551,12 @@ return $menu; } - public function applyHiddenParameters(Gems_Menu_ParameterSource $source) + public function applyHiddenParameters(Zend_Controller_Request_Abstract $request, Gems_Menu_ParameterSource $source) { if ($this->_hiddenParameters) { - foreach ($this->_hiddenParameters as $key => $name) { - $source[$key] = $name; + foreach ($this->_hiddenParameters as $key => $value) { + $request->setParam($key, $value); + $source[$key] = $value; } } Modified: branches/newUser/classes/Gems/Snippets/ModelTableSnippetAbstract.php =================================================================== --- branches/newUser/classes/Gems/Snippets/ModelTableSnippetAbstract.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Snippets/ModelTableSnippetAbstract.php 2011-10-21 12:29:37 UTC (rev 124) @@ -103,6 +103,24 @@ protected $sortParamDesc = 'dsrt'; /** + * Adds columns from the model to the bridge that creates the browse table. + * + * Overrule this function to add different columns to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_TableBridge $bridge + * @param MUtil_Model_ModelAbstract $model + * @return void + */ + protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) + { + // make sure search results are highlighted + $this->applyTextMarker(); + + return parent::addBrowseTableColumns($bridge, $model); + } + + /** * Add the paginator panel to the table. * * Only called when $this->browse is true. Overrule this function @@ -116,6 +134,30 @@ } /** + * Make sure generic search text results are marked + * + * @return void + */ + protected function applyTextMarker() + { + $model = $this->getModel(); + + $textKey = $model->getTextFilter(); + $filter = $model->getFilter(); + + if (isset($filter[$textKey])) { + $searchText = $filter[$textKey]; + // MUtil_Echo::r('[' . $searchText . ']'); + $marker = new MUtil_Html_Marker($model->getTextSearches($searchText), 'strong', 'UTF-8'); + foreach ($model->getItemNames() as $name) { + if ($model->get($name, 'label')) { + $model->set($name, 'markCallback', array($marker, 'mark')); + } + } + } + } + + /** * Should be called after answering the request to allow the Target * to check if all required registry values have been set correctly. * @@ -204,7 +246,7 @@ $data = $this->requestCache->getProgramParams(); $model->applyParameters($data); - + } else { parent::processFilterAndSort($model); } Copied: branches/newUser/classes/Gems/Snippets/ModelTableSnippetGeneric.php (from rev 122, trunk/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php) =================================================================== --- branches/newUser/classes/Gems/Snippets/ModelTableSnippetGeneric.php (rev 0) +++ branches/newUser/classes/Gems/Snippets/ModelTableSnippetGeneric.php 2011-10-21 12:29:37 UTC (rev 124) @@ -0,0 +1,94 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Snippets + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Displays multiple items from a model in a tabel by row using + * the model set through the $model snippet parameter. + * + * If you want to use this class "as is" use the 'Generic_ModelTableSnippet' snippet. + * + * This class is not in the standard snippet loading directories and does not follow + * their naming conventions, but exists only to make it simple to extend this class + * for a specific implementation. + * + * @package MUtil + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_Snippets_ModelTableSnippetGeneric extends Gems_Snippets_ModelTableSnippetAbstract +{ + /** + * + * @var MUtil_Model_ModelAbstract + */ + protected $model; + + /** + * + * @var Gems_Util + */ + protected $util; + + /** + * Automatically add request cacge + * + * Should be called after answering the request to allow the Target + * to check if all required registry values have been set correctly. + * + * @return boolean False if required are missing. + */ + public function checkRegistryRequestsAnswers() + { + if ($this->util && (! $this->requestCache)) { + $this->requestCache = $this->util->getRequestCache(); + } + + return parent::checkRegistryRequestsAnswers(); + } + + /** + * Creates the model + * + * @return MUtil_Model_ModelAbstract + */ + protected function createModel() + { + return $this->model; + } +} Modified: branches/newUser/classes/Gems/Tracker/Survey.php =================================================================== --- branches/newUser/classes/Gems/Tracker/Survey.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Tracker/Survey.php 2011-10-21 12:29:37 UTC (rev 124) @@ -104,6 +104,26 @@ } /** + * Makes sure the receptioncode data is part of the $this->_gemsData + * + * @param boolean $reload Optional parameter to force reload. + */ + private function _ensureGroupData($reload = false) + { + if ($reload || (! isset($this->_gemsSurvey['ggp_id_group']))) { + $sql = "SELECT * FROM gems__groups WHERE ggp_id_group = ?"; + $code = $this->_gemsSurvey['gsu_id_primary_group']; + + if ($row = $this->db->fetchRow($sql, $code)) { + $this->_gemsSurvey = $row + $this->_gemsSurvey; + } else { + $name = $this->getName(); + throw new Gems_Exception("Group code $code is missing for survey '$name'."); + } + } + } + + /** * Update the survey, both in the database and in memory. * * @param array $values The values that this token should be set to @@ -466,6 +486,20 @@ } /** + * Should this survey be filled in by staff members. + * + * @return boolean + */ + public function isTakenByStaff() + { + if (! isset($this->_gemsSurvey['ggp_staff_members'])) { + $this->_ensureGroupData(); + } + + return (boolean) $this->_gemsSurvey['ggp_staff_members']; + } + + /** * Update the survey, both in the database and in memory. * * @param array $values The values that this token should be set to Modified: branches/newUser/classes/Gems/Tracker.php =================================================================== --- branches/newUser/classes/Gems/Tracker.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Tracker.php 2011-10-21 12:29:37 UTC (rev 124) @@ -73,7 +73,7 @@ * @var array Of classname => description */ protected $_sourceClasses = array( - 'LimeSurvey1m9Database' => 'Lime Survey 1.90 DB', + 'LimeSurvey1m9Database' => 'Lime Survey 1.90 DB', 'LimeSurvey1m91Database' => 'Lime Survey 1.91+ DB', ); @@ -114,29 +114,29 @@ private $_trackEngines = array(); /** + * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. * - * @var Zend_Translate + * @var string $cascade An optional subdirectory where this subclass always loads from. */ - protected $translate; + protected $cascade = 'Tracker'; /** * - * @var Zend_Session + * @var Zend_Db_Adapter_Abstract */ - protected $session; + protected $db; /** - * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. * - * @var string $cascade An optional subdirectory where this subclass always loads from. + * @var Zend_Translate */ - protected $cascade = 'Tracker'; + protected $translate; /** * - * @var Zend_Db_Adapter_Abstract + * @var Zend_Session */ - protected $db; + protected $session; /** * Set to true to get detailed information on all tracker actions @@ -413,12 +413,18 @@ // TODO: this should be moved to Gems_Tracker_Source_SourceInterface, // but do not have time to implement is of minor importance at this moment. - return array( - '' => '-- none --', - 'Mysqli' => 'MySQL', - 'Pdo_Mysql' => 'MySQL (PDO)', - 'Sqlsrv' => 'SQL Server', - 'Pdo_Mssql' => 'SQL Server (PDO)'); + // If the project uses Pdo database, use Pdo classes, otherwise MySQL + if (stripos(get_class($this->db), '_Pdo_')) { + return array( + '' => '-- none --', + 'Pdo_Mysql' => 'MySQL (PDO)', + 'Pdo_Mssql' => 'SQL Server (PDO)'); + } else { + return array( + '' => '-- none --', + 'Mysqli' => 'MySQL', + 'Sqlsrv' => 'SQL Server'); + } } /** Modified: branches/newUser/classes/Gems/Util/DatabasePatcher.php =================================================================== --- branches/newUser/classes/Gems/Util/DatabasePatcher.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/Gems/Util/DatabasePatcher.php 2011-10-21 12:29:37 UTC (rev 124) @@ -1,43 +1,47 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @version $Id$ + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * @package Gems * @subpackage Util + * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License + * @version $Id$ */ /** + * File for checking and executing (new) patches. + * * @package Gems * @subpackage Util * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License + * @since Class available since version 1.1 */ class Gems_Util_DatabasePatcher { @@ -175,6 +179,22 @@ return $executed; } + /** + * New installations should not be trequired to run patches. This esthablishes that level. + * + * @return int The lowest level of patch stored in the database. + */ + protected function getMinimumPatchLevel() + { + static $level; + + if (! $level) { + $level = intval($this->db->fetchOne("SELECT COALESCE(MIN(gpl_level), 1) FROM gems__patch_levels")); + } + + return $level; + } + public function hasPatchFiles() { return (boolean) $this->patch_files; @@ -195,33 +215,36 @@ $tree = MUtil_Ra_Nested::toTree($existing, 'gpa_level', 'gpa_location', 'gpa_name', 'gpa_order'); $changed = 0; $current = new Zend_Db_Expr('CURRENT_TIMESTAMP'); + $minimum = $this->getMinimumPatchLevel(); + // MUtil_Echo::track($minimum); $this->_loadPatches($applicationLevel); foreach ($this->_loaded_patches as $patch) { + if ($minimum <= $patch['gpa_level']) { + $level = $patch['gpa_level']; + $location = $patch['gpa_location']; + $name = $patch['gpa_name']; + $order = $patch['gpa_order']; - $level = $patch['gpa_level']; - $location = $patch['gpa_location']; - $name = $patch['gpa_name']; - $order = $patch['gpa_order']; + // Does it exist? + if (isset($tree[$level][$location][$name][$order])) { + $sql = $patch['gpa_sql']; + if ($sql != $tree[$level][$location][$name][$order]['gpa_sql']) { + $values['gpa_sql'] = $sql; + $values['gpa_executed'] = 0; + $values['gpa_completed'] = 0; + $values['gpa_changed'] = $current; - // Does it exist? - if (isset($tree[$level][$location][$name][$order])) { - $sql = $patch['gpa_sql']; - if ($sql != $tree[$level][$location][$name][$order]['gpa_sql']) { - $values['gpa_sql'] = $sql; - $values['gpa_executed'] = 0; - $values['gpa_completed'] = 0; - $values['gpa_changed'] = $current; + $this->db->update('gems__patches', $values, $this->db->quoteInto('gpa_id_patch = ?', $tree[$level][$location][$name][$order]['gpa_id_patch'])); + $changed++; + } - $this->db->update('gems__patches', $values, $this->db->quoteInto('gpa_id_patch = ?', $tree[$level][$location][$name][$order]['gpa_id_patch'])); + } else { + $patch['gpa_changed'] = $current; + $patch['gpa_created'] = $current; + $this->db->insert('gems__patches', $patch); $changed++; } - - } else { - $patch['gpa_changed'] = $current; - $patch['gpa_created'] = $current; - $this->db->insert('gems__patches', $patch); - $changed++; } } // */ Modified: branches/newUser/classes/GemsEscort.php =================================================================== --- branches/newUser/classes/GemsEscort.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/GemsEscort.php 2011-10-21 12:29:37 UTC (rev 124) @@ -1133,6 +1133,15 @@ } /** + * + * @return string Name of the file that performs the maintenance lock + */ + public function getMaintenanceLockFilename() + { + return GEMS_ROOT_DIR . '/var/settings/lock.txt'; + } + + /** * Retrieve the GemsEscort object * * @return GemsEscort @@ -1523,7 +1532,7 @@ * Check if we are in maintenance mode or not. This is triggeren by a file in the var/settings * directory with the name lock.txt */ - if(file_exists(GEMS_ROOT_DIR . '/var/settings/lock.txt')) { + if (file_exists($this->getMaintenanceLockFilename())) { if ($this->session->user_id && $this->session->user_role !== 'super') { //Still allow logoff so we can relogin as super if (!('index' == $request->getControllerName() && 'logoff' == $request->getActionName())) { @@ -1533,7 +1542,7 @@ $this->_('System is in maintenance mode')); } } else { - $this->getMessenger()->addMessage($this->_('System is in maintenance mode')); + $this->addMessage($this->_('System is in maintenance mode')); MUtil_Echo::r($this->_('System is in maintenance mode')); } } @@ -1598,7 +1607,7 @@ } if (isset($menuItem)) { - $menuItem->applyHiddenParameters($this->menu->getParameterSource()); + $menuItem->applyHiddenParameters($request, $this->menu->getParameterSource()); $this->menu->setCurrent($menuItem); } } Modified: branches/newUser/classes/MUtil/Controller/ModelSnippetActionAbstract.php =================================================================== --- branches/newUser/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-21 12:29:37 UTC (rev 124) @@ -98,6 +98,19 @@ protected $showSnippets = 'ModelVerticalTableSnippet'; /** + * Array of the actions that use a summarized version of the model. + * + * This determines the value of $detailed in createAction(). As it is usually + * less of a problem to use a $detailed model with an action that should use + * a summarized model and I guess there will usually be more detailed actions + * than summarized ones it seems less work to specify these. + * + * @var array $summarizedActions Array of the actions that use a + * summarized version of the model. + */ + public $summarizedActions = array('index', 'autofilter'); + + /** * Set the action key in request * * Use this when an action is a Ajax action for retrieving @@ -137,7 +150,9 @@ } if ($resetMvc && MUtil_Echo::hasOutput()) { - $this->html->raw(MUtil_Echo::out()); + // Lazy call here, because any echo calls in the snippets have not yet been + // performed. so they will appear only in the next call when not lazy. + $this->html->raw(MUtil_Lazy::call(array('MUtil_Echo', 'out'))); } } Modified: branches/newUser/classes/MUtil/Snippets/ModelTableSnippetAbstract.php =================================================================== --- branches/newUser/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2011-10-21 12:29:37 UTC (rev 124) @@ -57,13 +57,6 @@ protected $_marker; /** - * Functional extension: optionally use this function to add the browse columns - * - * @var callable With signature: function(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model, MUtil_Snippets_ModelTableSnippetAbstract $snippet) - */ - public $addTableColumns; - - /** * Url parts added to each link in the resulting table * * @var array @@ -171,11 +164,7 @@ $bridge->setBaseUrl($this->baseUrl); } - if (is_callable($this->addTableColumns)) { - call_user_func($this->addTableColumns, $bridge, $model, $this); - } else { - $this->addBrowseTableColumns($bridge, $model); - } + $this->addBrowseTableColumns($bridge, $model); return $bridge->getTable(); } Modified: branches/newUser/configs/db/patches.sql =================================================================== --- branches/newUser/configs/db/patches.sql 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/configs/db/patches.sql 2011-10-21 12:29:37 UTC (rev 124) @@ -1,4 +1,8 @@ +-- GEMS VERSION: 1 +-- PATCH: Test skip earlier patch levels +SELECT NULL; + -- GEMS VERSION: 27 -- PATCH: Use OK reception code @@ -204,6 +208,10 @@ UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; -- GEMS VERSION: 42 +-- PATCH: Add mail actions to admin role +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.log') WHERE grl_name = 'admin' AND grl_privileges NOT LIKE '%pr.mail.log%'; +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.mail.server%'; + -- PATCH: New user login structure INSERT INTO gems__users (gsu_id_user, gsu_login, gsu_id_organization, gsu_user_class, gsu_active, gsu_password, gsu_failed_logins, gsu_last_failed, gsu_reset_key, gsu_reset_requested, gsu_reset_required, @@ -213,4 +221,4 @@ gr2o_changed, gr2o_changed_by, gr2o_created, gr2o_created_by FROM gems__respondents INNER JOIN gems__respondent2org ON grs_id_user = gr2o_id_user INNER JOIN gems__organizations ON gr2o_id_organization = gor_id_organization - WHERE gor_name = 'HCU / Xpert Clinic'; + WHERE gor_name = 'HCU / Xpert Clinic'; \ No newline at end of file Modified: branches/newUser/configs/db/tables/gems__mail_jobs.300.sql =================================================================== --- branches/newUser/configs/db/tables/gems__mail_jobs.300.sql 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/configs/db/tables/gems__mail_jobs.300.sql 2011-10-21 12:29:37 UTC (rev 124) @@ -4,8 +4,6 @@ gmj_id_organization bigint unsigned not null references gems__organizations (gor_id_organization), - gmj_id_message bigint unsigned not null - references gems__mail_templates (gmt_id_message), gmj_id_user_as bigint unsigned not null references gems__staff (gsf_id_user), Modified: branches/newUser/configs/db/tables/gems__reception_codes.10.sql =================================================================== --- branches/newUser/configs/db/tables/gems__reception_codes.10.sql 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/configs/db/tables/gems__reception_codes.10.sql 2011-10-21 12:29:37 UTC (rev 124) @@ -29,5 +29,5 @@ grc_changed, grc_changed_by, grc_created, grc_created_by) VALUES ('OK', '', 1, 1, 0, 1, 1, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('skip', 'Skipped by calculation', 0, 1, 0, 0, 0, 0, 0, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); + ('skip', 'Skipped by calculation', 0, 1, 0, 0, 0, 0, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); Modified: branches/newUser/configs/db/tables/gems__roles.20.sql =================================================================== --- branches/newUser/configs/db/tables/gems__roles.20.sql 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/configs/db/tables/gems__roles.20.sql 2011-10-21 12:29:37 UTC (rev 124) @@ -32,5 +32,5 @@ ('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.setup,pr.staff,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('physician','physician','','staff', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('researcher','researcher','pr.invitation,pr.result,pr.islogin','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.role.create,pr.role.edit,pr.language,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); + ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.language,pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.role.create,pr.role.edit,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); Modified: branches/newUser/configs/db/tables/gems__surveys.30.sql =================================================================== --- branches/newUser/configs/db/tables/gems__surveys.30.sql 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/configs/db/tables/gems__surveys.30.sql 2011-10-21 12:29:37 UTC (rev 124) @@ -20,7 +20,10 @@ references gems__sources (gso_id_source), gsu_active boolean not null default 0, gsu_status varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + + -- depreciated gsu_staff boolean not null default 0, + -- end depreciated gsu_id_primary_group bigint unsigned null references gems__groups (ggp_id_group), Modified: branches/newUser/controllers/MailLogController.php =================================================================== --- branches/newUser/controllers/MailLogController.php 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/controllers/MailLogController.php 2011-10-21 12:29:37 UTC (rev 124) @@ -42,6 +42,5 @@ * @license New BSD License * @since Class available since version 1.4.2 */ -class MailLogController extends Gems_Default_MailLogActionOldStyle -{ -} +class MailLogController extends Gems_Default_MailLogAction +{ } Modified: branches/newUser/languages/default-en.mo =================================================================== (Binary files differ) Modified: branches/newUser/languages/default-en.po =================================================================== --- branches/newUser/languages/default-en.po 2011-10-21 12:15:43 UTC (rev 123) +++ branches/newUser/languages/default-en.po 2011-10-21 12:29:37 UTC (rev 124) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-17 15:19+0100\n" +"POT-Creation-Date: 2011-10-20 17:52+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Menno Dekker <men...@er...>\n" +"Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -32,44 +32,44 @@ msgid "version" msgstr "version" -#: classes/GemsEscort.php:1410 +#: classes/GemsEscort.php:1419 msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1531 +#: classes/GemsEscort.php:1540 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1533 -#: classes/GemsEscort.php:1536 -#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1542 +#: classes/GemsEscort.php:1545 +#: classes/GemsEscort.php:1546 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1551 +#: classes/GemsEscort.php:1560 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1553 -#: classes/GemsEscort.php:1589 +#: classes/GemsEscort.php:1562 +#: classes/GemsEscort.php:1598 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1569 +#: classes/GemsEscort.php:1578 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1571 +#: classes/GemsEscort.php:1580 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "Access to this page is not allowed for current role: %s." -#: classes/GemsEscort.php:1576 -#: classes/GemsEscort.php:1587 +#: classes/GemsEscort.php:1585 +#: classes/GemsEscort.php:1596 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1577 +#: classes/GemsEscort.php:1586 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -381,7 +381,7 @@ msgid "Birthday" msgstr "Birthday" -#: classes/Gems/Tracker.php:726 +#: classes/Gems/Tracker.php:732 msgid "Checks performed" msgstr "Checks performed" @@ -1151,8 +1151,7 @@ msgstr "Log maintenance" #: classes/Gems/Default/MailAction.php:61 -#: classes/Gems/Default/MailLogAction.php:132 -#: classes/Gems/Default/MailLogActionOldStyle.php:118 +#: classes/Gems/Default/MailLogAction.php:113 msgid "Subject" msgstr "Subject" @@ -1170,51 +1169,38 @@ msgid "Email templates" msgstr "Email templates" -#: classes/Gems/Default/MailLogAction.php:126 -#: classes/Gems/Default/MailLogActionOldStyle.php:112 +#: classes/Gems/Default/MailLogAction.php:107 msgid "Date sent" msgstr "Date sent" -#: classes/Gems/Default/MailLogAction.php:127 -#: classes/Gems/Default/MailLogActionOldStyle.php:113 +#: classes/Gems/Default/MailLogAction.php:108 msgid "Receiver" msgstr "Receiver" -#: classes/Gems/Default/MailLogAction.php:128 -#: classes/Gems/Default/MailLogActionOldStyle.php:114 +#: classes/Gems/Default/MailLogAction.php:109 msgid "To address" msgstr "To address" -#: classes/Gems/Default/MailLogAction.php:129 -#: classes/Gems/Default/MailLogActionOldStyle.php:115 +#: classes/Gems/Default/MailLogAction.php:110 msgid "Sender" msgstr "Sender" -#: classes/Gems/Default/MailLogAction.php:130 -#: classes/Gems/Default/MailLogActionOldStyle.php:116 +#: classes/Gems/Default/MailLogAction.php:111 msgid "From address" msgstr "From address" -#: classes/Gems/Default/MailLogAction.php:135 -#: classes/Gems/Default/MailLogActionOldStyle.php:121 +#: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Template" -#: classes/Gems/Default/MailLogAction.php:148 -#: classes/Gems/Default/MailLogActionOldStyle.php:148 +#: classes/Gems/Default/MailLogAction.php:129 msgid "Mail Activity Log" msgstr "Mail Activity Log" -#: classes/Gems/Default/MailLogAction.php:160 +#: classes/Gems/Default/MailLogAction.php:140 msgid "Show Mail Activity Log item" msgstr "Show Mail Activity Log item" -#: classes/Gems/Default/MailLogActionOldStyle.php:137 -msgid "Activity Log" -msgid_plural "Activity Logs" -msgstr[0] "Activity Log" -msgstr[1] "Activity Logs" - #: classes/Gems/Default/MailServerAction.php:68 msgid "From address [part]" msgstr "From address [part]" @@ -1256,6 +1242,8 @@ msgstr "User ID" #: classes/Gems/Default/MailServerAction.php:90 +#: classes/Gems/Default/OptionAction.php:107 +#: classes/Gems/Default/OptionAction.php:112 msgid "Repeat password" msgstr "Repeat password" @@ -1274,14 +1262,10 @@ msgstr "Email servers" #: classes/Gems/Default/OptionAction.php:73 -#: classes/Gems/Default/OrganizationAction.php:128 -#: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:188 msgid "Language" msgstr "Language" #: classes/Gems/Default/OptionAction.php:74 -#: classes/Gems/Default/StaffAction.php:189 msgid "Logout on survey" msgstr "Logout on survey" @@ -1346,7 +1330,6 @@ msgstr "Invalid organization." #: classes/Gems/Default/OrganizationAction.php:117 -#: classes/Gems/Default/SourceAction.php:143 msgid "Url" msgstr "Url" @@ -1402,107 +1385,115 @@ msgid "Planning overview" msgstr "Planning overview" -#: classes/Gems/Default/ProjectInformationAction.php:71 +#: classes/Gems/Default/ProjectInformationAction.php:83 msgid "empty file" msgstr "empty file" -#: classes/Gems/Default/ProjectInformationAction.php:75 +#: classes/Gems/Default/ProjectInformationAction.php:87 msgid "file not found" msgstr "file not found" -#: classes/Gems/Default/ProjectInformationAction.php:108 +#: classes/Gems/Default/ProjectInformationAction.php:120 msgid "Logged errors" msgstr "Logged errors" -#: classes/Gems/Default/ProjectInformationAction.php:108 +#: classes/Gems/Default/ProjectInformationAction.php:120 msgid "Empty logfile" msgstr "Empty logfile" -#: classes/Gems/Default/ProjectInformationAction.php:113 +#: classes/Gems/Default/ProjectInformationAction.php:125 msgid "Project information" msgstr "Project information" -#: classes/Gems/Default/ProjectInformationAction.php:117 +#: classes/Gems/Default/ProjectInformationAction.php:129 msgid "Project name" msgstr "Project name" -#: classes/Gems/Default/ProjectInformationAction.php:118 +#: classes/Gems/Default/ProjectInformationAction.php:130 msgid "Project version" msgstr "Project version" -#: classes/Gems/Default/ProjectInformationAction.php:119 +#: classes/Gems/Default/ProjectInformationAction.php:131 msgid "Gems version" msgstr "Gems version" -#: classes/Gems/Default/ProjectInformationAction.php:121 +#: classes/Gems/Default/ProjectInformationAction.php:133 msgid "Gems project" msgstr "Gems project" -#: classes/Gems/Default/ProjectInformationAction.php:122 +#: classes/Gems/Default/ProjectInformationAction.php:134 msgid "Gems web directory" msgstr "Gems web directory" -#: classes/Gems/Default/ProjectInformationAction.php:123 +#: classes/Gems/Default/ProjectInformationAction.php:135 msgid "Gems code directory" msgstr "Gems code directory" -#: classes/Gems/Default/ProjectInformationAction.php:124 +#: classes/Gems/Default/ProjectInformationAction.php:136 msgid "Gems project path" msgstr "Gems project path" -#: classes/Gems/Default/ProjectInformationAction.php:125 +#: classes/Gems/Default/ProjectInformationAction.php:137 msgid "MUtil version" msgstr "MUtil version" -#: classes/Gems/Default/ProjectInformationAction.php:126 +#: classes/Gems/Default/ProjectInformationAction.php:138 msgid "Zend version" msgstr "Zend version" -#: classes/Gems/Default/ProjectInformationAction.php:127 +#: classes/Gems/Default/ProjectInformationAction.php:139 msgid "Application environment" msgstr "Application environment" -#: classes/Gems/Default/ProjectInformationAction.php:128 +#: classes/Gems/Default/ProjectInformationAction.php:140 msgid "Application baseuri" msgstr "Application baseuri" -#: classes/Gems/Default/ProjectInformationAction.php:129 +#: classes/Gems/Default/ProjectInformationAction.php:141 msgid "Application directory" msgstr "Application directory" -#: classes/Gems/Default/ProjectInformationAction.php:130 +#: classes/Gems/Default/ProjectInformationAction.php:142 msgid "PHP version" msgstr "PHP version" -#: classes/Gems/Default/ProjectInformationAction.php:131 +#: classes/Gems/Default/ProjectInformationAction.php:143 msgid "Server Hostname" msgstr "Server Hostname" -#: classes/Gems/Default/ProjectInformationAction.php:132 +#: classes/Gems/Default/ProjectInformationAction.php:144 msgid "Server OS" msgstr "Server OS" -#: classes/Gems/Default/ProjectInformationAction.php:133 +#: classes/Gems/Default/ProjectInformationAction.php:145 msgid "Time on server" msgstr "Time on server" -#: classes/Gems/Default/ProjectInformationAction.php:135 +#: classes/Gems/Default/ProjectInformationAction.php:148 +msgid "Turn Maintenance Mode OFF" +msgstr "Turn Maintenance Mode OFF" + +#: classes/Gems/Default/ProjectInformationAction.php:150 +msgid "Turn Maintenance Mode ON" +msgstr "Turn Maintenance Mode ON" + +#: classes/Gems/Default/ProjectInformationAction.php:159 msgid "Version information" msgstr "Version information" -#: classes/Gems/Default/ProjectInformationAction.php:151 +#: classes/Gems/Default/ProjectInformationAction.php:185 msgid "Server PHP Info" msgstr "Server PHP Info" -#: classes/Gems/Default/ProjectInformationAction.php:164 +#: classes/Gems/Default/ProjectInformationAction.php:198 msgid "Project settings" msgstr "Project settings" -#: classes/Gems/Default/ProjectInformationAction.php:171 +#: classes/Gems/Default/ProjectInformationAction.php:205 msgid "Session content" msgstr "Session content" -#: classes/Gems/Default/ProjectInformationAction.php:172 +#: classes/Gems/Default/ProjectInformationAction.php:206 msgid "Session" msgstr "Session" @@ -1561,6 +1552,7 @@ msgstr "Survey not specified." #: classes/Gems/Default/ProjectTracksAction.php:120 +#: classes/Gems/Default/TrackActionAbstract.php:479 #, php-format msgid "Track %s does not exist." msgstr "Track %s does not exist." @@ -1791,6 +1783,18 @@ msgid "Leave empty for the Gems database." msgstr "Leave empty for the Gems database." +#: classes/Gems/Default/SourceAction.php:79 +msgid "E.g. the name of the project - for single source projects." +msgstr "E.g. the name of the project - for single source projects." + +#: classes/Gems/Default/SourceAction.php:81 +msgid "For creating token-survey url." +msgstr "For creating token-survey url." + +#: classes/Gems/Default/SourceAction.php:86 +msgid "The database server used by the source." +msgstr "The database server used by the source." + #: classes/Gems/Default/SourceAction.php:88 msgid "Do not forget the underscores." msgstr "Do not forget the underscores." @@ -1808,63 +1812,67 @@ msgid "Checking survey results for %s source." msgstr "Checking survey res... [truncated message content] |
From: <gem...@li...> - 2011-10-21 12:15:53
|
Revision: 123 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=123&view=rev Author: matijsdejong Date: 2011-10-21 12:15:43 +0000 (Fri, 21 Oct 2011) Log Message: ----------- Saving last changes Added Paths: ----------- branches/newUser/classes/Gems/Model/UserModel.php branches/newUser/classes/Gems/User/ branches/newUser/classes/Gems/User/ProjectSuperUser.php branches/newUser/classes/Gems/User/UserAbstract.php branches/newUser/classes/Gems/User/UserInterface.php branches/newUser/classes/Gems/User/UserLoader.php branches/newUser/configs/db/tables/gems__users.10.sql Added: branches/newUser/classes/Gems/Model/UserModel.php =================================================================== --- branches/newUser/classes/Gems/Model/UserModel.php (rev 0) +++ branches/newUser/classes/Gems/Model/UserModel.php 2011-10-21 12:15:43 UTC (rev 123) @@ -0,0 +1,117 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Model + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Model + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_Model_UserModel extends Gems_Model_JoinModel +{ + /** + * The length of a user id. + * + * @var int + */ + protected $userIdLen = 8; + + /** + * Create a model that joins two or more tables + * + * @param string $name The name of the model + * @param string $secondTable The optional second base table for the model + * @param array $joinFields Array of source->dest primary keys for this join + * @param string $fieldPrefix Prefix to use for change fields (date/userid) + * @param bool $saveable Will changes to this table be saved + */ + public function __construct($name, $secondTable = null, array $joinFields = null, $fieldPrefix = null, $saveable = null) + { + parent::__construct($name, 'gems__users', (null === $saveable ? $fieldPrefix : $saveable)); + + if ($fieldPrefix) { + Gems_Model::setChangeFieldsByPrefix($this, 'gsu'); + } + + if ($secondTable) { + $this->addTable($secondTable, $joinFields, $fieldPrefix, $saveable); + } + } + + /** + * Finds a random unique user id. + * + * @return int + */ + protected function _createUserId() + { + $max = $this->userIdLen; + + do { + $out = mt_rand(1, 9); + for ($i = 1; $i < $this->userIdLen; $i++) { + $out .= mt_rand(0, 9); + } + // Make it a number + $out = intval($out); + + } while ($this->db->fetchOne('SELECT gsu_id_user FROM gems__users WHERE gsu_id_user = ?', $out)); + + return $out; + } + + /** + * Save a single model item. + * + * @param array $newValues The values to store for a single model item. + * @param array $filter If the filter contains old key values these are used + * to decide on update versus insert. + * @return array The values as they are after saving (they may change). + */ + public function save(array $newValues, array $filter = null, array $saveTables = null) + { + if (! (isset($newValues['gsu_id_user']) && $newValues['gsu_id_user'])) { + // Load a new user id if needed + $newValues['gsu_id_user'] = $this->_createUserId(); + } + + parent::save($newValues, $filter, $saveTables); + } +} Property changes on: branches/newUser/classes/Gems/User ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:number + true Added: bugtraq:logregex + #(\d+) Added: branches/newUser/classes/Gems/User/ProjectSuperUser.php =================================================================== --- branches/newUser/classes/Gems/User/ProjectSuperUser.php (rev 0) +++ branches/newUser/classes/Gems/User/ProjectSuperUser.php 2011-10-21 12:15:43 UTC (rev 123) @@ -0,0 +1,120 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_User_ProjectSuperUser extends Gems_User_UserAbstract +{ + const MIN_PASSWORD_LENGTH = 10; + + /** + * The role of this user. + * + * @var string + */ + protected $_role = 'super'; + + /** + * + * @var ArrayObject + */ + protected $project; + + /** + * + * @var Gems_Util_Translated + */ + protected $translated; + + /** + * Check that the password is correct for this user. + * + * @param string $password Unencrypted password + * @return boolean + */ + public function checkPassword($password) + { + if (isset($this->project->admin['pwd']) && ($this->project->admin['pwd'] == $password)) { + if (APPLICATION_ENV === 'production') { + if (strlen($string) < self::MIN_PASSWORD_LENGTH) { + throw new Gems_Exception(sprintf($this->translated->_('The password for the super user should be at least %s characters long on production systems.'), self::MIN_PASSWORD_LENGTH)); + } + } + + return true; + } + + return false; + } + + /** + * Returns true if the role of this user has the given privilege. + * + * @param string $privilege + * @return bool + */ + public function hasPrivilege($privilege) + { + // Overloaded!! + // + // Return true also for any not 'nologin' privilege + return parent::hasPrivilege($privilege) || (! $this->acl) || (! $this->acl->isAllowed('nologin', null, $privilege)); + } + + /** + * Intialize the values for this user. + * + * Skipped when the user is the active user and is stored in the session. + * + * @param string $login_name + * @param int $organization Only used when more than one organization uses this $login_name + * @return boolean False when the object could not load. + */ + protected function initVariables($login_name, $organization) + { + $this->setRole('super'); + return true; + } + +} Added: branches/newUser/classes/Gems/User/UserAbstract.php =================================================================== --- branches/newUser/classes/Gems/User/UserAbstract.php (rev 0) +++ branches/newUser/classes/Gems/User/UserAbstract.php 2011-10-21 12:15:43 UTC (rev 123) @@ -0,0 +1,288 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +abstract class Gems_User_UserAbstract extends Gems_Registry_TargetAbstract implements Gems_User_UserInterface +{ + /** + * + * @var string + */ + private $_login_name; + + /** + * + * @var int + */ + private $_organization_id; + + /** + * + * @var mixed ArrayObject or Zend_Session_Namespace + */ + private $_vars; + + /** + * + * @var MUtil_Acl + */ + protected $acl; + + /** + * The escort session. + * + * For compatibility reasons only. + * + * @var Zend_Session_Namespace + */ + protected $session; + + /** + * + * @param string $login_name + * @param int $organization Only used when more than one organization uses this $login_name + */ + public function __construct($login_name, $organization) + { + $this->_login_name = $login_name; + $this->_organization_id = $organization; + } + + /** + * Returns the session namespace containing user data. + * + * @staticvar Zend_Session_Namespace $session + * @return Zend_Session_Namespace + */ + private static function _getSessionStore() + { + static $session; + + if (! $session) { + $session = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.userdata', true); + } + + return $session; + } + + /** + * The store currently used. + * + * @return mixed ArrayObject or Zend_Session_Namespace + */ + private function _getVariableStore() + { + $loginName = 'loginName'; + $organizationId = 'organizationId'; + + if (! $this->_vars) { + $sessionStore = self::_getSessionStore(); + + if (isset($sessionStore->$loginName, $sessionStore->$organizationId) && ($sessionStore->$loginName == $this->_login_name) && ($sessionStore->$organizationId == $this->_organization_id)) { + $this->_vars = $sessionStore; + $this->_vars->__set($loginName, $this->_login_name); + $this->_vars->__set($organizationId, $this->_organization_id); + } else { + $this->_vars = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); + $this->_vars->offsetSet($loginName, $this->_login_name); + $this->_vars->offsetSet($organizationId, $this->_organization_id); + } + + } + + return $this->_vars; + } + + /** + * Should be called after answering the request to allow the Target + * to check if all required registry values have been set correctly. + * + * @return boolean False if required variables are missing. + */ + public function checkRegistryRequestsAnswers() + { + if ($this->_getVariableStore() instanceof Zend_Session_Namespace) { + $init = true; + } else { + $init = $this->initVariables($this->_login_name, $this->_organization_id); + } + + return $init && parent::checkRegistryRequestsAnswers(); + } + + /** + * + * @return string + */ + protected function getLoginName() + { + return $this->_login_name; + } + + /** + * + * @return int + */ + protected function getOrganizationId() + { + return $this->_organization_id; + } + + /** + * Returns the (current) role of this user. + * + * @return string + */ + public function getRole() + { + return $this->getVar('user_role'); + } + + /** + * Get a value in whatever store is used by this object. + * + * @param string $name + * @return mixed + */ + protected function getVar($name) + { + $store = $this->_getVariableStore(); + + if ($store instanceof Zend_Session_Namespace) { + if ($store->__isset($name)) { + return $store->__get($name); + } + } else { + if ($store->offsetExists($name)) { + return $store->offsetSet($name); + } + } + return null; + } + + /** + * Returns true if the role of this user has the given privilege. + * + * @param string $privilege + * @return bool + */ + public function hasPrivilege($privilege) + { + return (! $this->acl) || $this->acl->isAllowed($this->getRole(), null, $privilege); + } + + /** + * Intialize the values for this user. + * + * Skipped when the user is the active user and is stored in the session. + * + * @param string $login_name + * @param int $organization Only used when more than one organization uses this $login_name + * @return boolean False when the object could not load. + */ + abstract protected function initVariables($login_name, $organization); + + /** + * Set this user as the current user. + * + * This means that the data about this user will be stored in a session. + * + * @return Gems_User_UserAbstract + */ + public function setAsCurrentUser() + { + // Get the current variables + $oldStore = $this->_getVariableStore(); + + // When $oldStore is a Zend_Session_Namespace, then this user is already the current user. + if (! $oldStore instanceof Zend_Session_Namespace) { + $this->_vars = self::_getSessionStore(); + + // Clean up what is there now. + $this->_vars->unsetAll(); + $this->session->unsetAll(); + + foreach ($oldStore as $name => $value) { + $this->_vars->__set($name, $value); + $this->session->__set($name, $value); + } + + } + + return $this; + } + + /** + * Sets the (current) role of this user. + * + * @param string $value Role + * @return Gems_User_UserAbstract (continuation pattern) + */ + protected function setRole($value) + { + $this->setVar('user_role', $value); + + return $this; + } + + /** + * Store a value in whatever store is used by this object. + * + * @param string $name + * @param mixed $value + * @return Gems_User_UserAbstract (continuation pattern) + */ + protected function setVar($name, $value) + { + $store = $this->_getVariableStore(); + + if ($store instanceof Zend_Session_Namespace) { + $store->__set($name, $value); + } else { + $store->offsetSet($name, $value); + } + return $this; + } +} Added: branches/newUser/classes/Gems/User/UserInterface.php =================================================================== --- branches/newUser/classes/Gems/User/UserInterface.php (rev 0) +++ branches/newUser/classes/Gems/User/UserInterface.php 2011-10-21 12:15:43 UTC (rev 123) @@ -0,0 +1,60 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +interface Gems_User_UserInterface +{ + /** + * Check that the password is correct for this user. + * + * @param string $password Unencrypted password + * @return boolean + */ + public function checkPassword($password); + + public function hasPrivilege($privilege); + + public function setAsCurrentUser(); +} Added: branches/newUser/classes/Gems/User/UserLoader.php =================================================================== --- branches/newUser/classes/Gems/User/UserLoader.php (rev 0) +++ branches/newUser/classes/Gems/User/UserLoader.php 2011-10-21 12:15:43 UTC (rev 123) @@ -0,0 +1,85 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Loads users. + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_User_UserLoader extends Gems_Loader_TargetLoaderAbstract +{ + /** + * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. + * + * @var string $cascade An optional subdirectory where this subclass always loads from. + */ + protected $cascade = 'User'; + + /** + * + * @var ArrayObject + */ + protected $project; + + + /** + * + * @param string $login_name + * @param int $organization Only used when more than one organization uses this $login_name + * @return Gems_User_UserInterface + */ + public function getUser($login_name, $organization) + { + if ($this->isProjectUser($login_name)) { + return $this->loadProjectUser($login_name, $organization); + } + } + + protected function isProjectUser($login_name) + { + return isset($this->project->admin['user']) && ($this->project->admin['user'] == $login_name); + } + + protected function loadProjectUser($login_name, $organization) + { + return $this->_getClass('ProjectSuperUser', null, array($login_name, $organization)); + } +} Added: branches/newUser/configs/db/tables/gems__users.10.sql =================================================================== --- branches/newUser/configs/db/tables/gems__users.10.sql (rev 0) +++ branches/newUser/configs/db/tables/gems__users.10.sql 2011-10-21 12:15:43 UTC (rev 123) @@ -0,0 +1,31 @@ + +-- Table containing the users that are allowed to login +-- +CREATE TABLE if not exists gems__users ( + gsu_id_user bigint unsigned not null, + + gsu_login varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gsu_id_organization bigint not null references gems__organizations (gor_id_organization), + + gsu_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gsu_active boolean not null default 1, + + -- Common fields for standard 'store password in Gems' logins + -- Not every gsu_user_class will use them + gsu_password varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gsu_failed_logins int(11) unsigned not null default 0, + gsu_last_failed timestamp null, + gsu_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gsu_reset_requested timestamp null, + gsu_reset_required boolean not null default 0, + + gsu_changed timestamp not null default current_timestamp on update current_timestamp, + gsu_changed_by bigint unsigned not null, + gsu_created timestamp not null, + gsu_created_by bigint unsigned not null, + + PRIMARY KEY(gsu_id_user), + UNIQUE(gsu_login, gsu_id_organization) + ) + ENGINE=InnoDB + CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 16:03:41
|
Revision: 122 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=122&view=rev Author: matijsdejong Date: 2011-10-20 16:03:30 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Continued on ModelSnippetAction (#10): removed functional extension, added the text marker interface and fixed the Echo output. Fixed several roles that I forgot to add for mail activities. Modified Paths: -------------- trunk/library/classes/Gems/Default/MailLogAction.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__roles.20.sql trunk/library/controllers/MailLogController.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po trunk/library/snippets/Generic/ModelItemTableSnippet.php trunk/library/snippets/Generic/ModelTableSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php trunk/library/snippets/Mail/ trunk/library/snippets/Mail/Log/ trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php Removed Paths: ------------- trunk/library/classes/Gems/Default/MailLogActionOldStyle.php Modified: trunk/library/classes/Gems/Default/MailLogAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailLogAction.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/classes/Gems/Default/MailLogAction.php 2011-10-20 16:03:30 UTC (rev 122) @@ -37,10 +37,8 @@ */ /** - * Short description for class + * Controller for looking at mail activity * - * Long description for class (if any)... - * * @package Gems * @subpackage Default * @copyright Copyright (c) 2011 Erasmus MC @@ -50,28 +48,12 @@ class Gems_Default_MailLogAction extends Gems_Controller_ModelSnippetActionAbstract { /** - * Adds columns from the model to the bridge that creates the browse table. + * The snippets used for the autofilter action. * - * Adds a button column to the model, if such a button exists in the model. - * - * @param MUtil_Model_TableBridge $bridge - * @param MUtil_Model_ModelAbstract $model - * @rturn void + * @var mixed String or array of snippets name */ - public function addTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) - { - if ($menuItem = $this->firstAllowedMenuItem('show')) { - $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); - } + protected $autofilterSnippets = 'Mail_Log_MailLogBrowseSnippet'; - // Newline placeholder - $br = MUtil_Html::create('br'); - - $bridge->addMultiSort('grco_created', $br, 'respondent_name', $br, 'grco_address'); - $bridge->addMultiSort('grco_id_token', $br, 'assigned_by', $br, 'grco_sender'); - $bridge->addMultiSort('grco_topic'); - } - /** * The automatically filtered result */ @@ -79,7 +61,6 @@ { $filter = array('grco_organization' => $this->escort->getCurrentOrganization()); - $this->autofilterParameters['addTableColumns'] = array($this, 'addTableColumns'); $this->autofilterParameters['extraFilter'] = $filter; $this->autofilterParameters['extraSort'] = array('grco_created' => SORT_DESC); @@ -147,7 +128,6 @@ { $this->html->h3($this->_('Mail Activity Log')); - // MUtil_Echo::track($this->indexParameters); parent::indexAction(); } Deleted: trunk/library/classes/Gems/Default/MailLogActionOldStyle.php =================================================================== --- trunk/library/classes/Gems/Default/MailLogActionOldStyle.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/classes/Gems/Default/MailLogActionOldStyle.php 2011-10-20 16:03:30 UTC (rev 122) @@ -1,150 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Short description of file - * - * @package Gems - * @subpackage Default - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ - */ - -/** - * Temprary class until Gems_Controller_ModelSnippetActionAbstract works - * - * @package Gems - * @subpackage Default - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4.2 - */ -class Gems_Default_MailLogActionOldStyle extends Gems_Controller_BrowseEditAction -{ - public $sortKey = array('grco_created' => SORT_DESC); - - /** - * Adds columns from the model to the bridge that creates the browse table. - * - * Adds a button column to the model, if such a button exists in the model. - * - * @param MUtil_Model_TableBridge $bridge - * @param MUtil_Model_ModelAbstract $model - * @rturn void - */ - protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) - { - if ($menuItem = $this->findAllowedMenuItem('show')) { - $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); - } - - // Newline placeholder - $br = MUtil_Html::create('br'); - - $bridge->addMultiSort('grco_created', $br, 'respondent_name', $br, 'grco_address'); - $bridge->addMultiSort('grco_id_token', $br, 'assigned_by', $br, 'grco_sender'); - $bridge->addMultiSort('grco_topic'); - } - - /** - * Creates a model for getModel(). Called only for each new $action. - * - * The parameters allow you to easily adapt the model to the current action. The $detailed - * parameter was added, because the most common use of action is a split between detailed - * and summarized actions. - * - * @param boolean $detailed True when the current action is not in $summarizedActions. - * @param string $action The current action. - * @return MUtil_Model_ModelAbstract - */ - public function createModel($detailed, $action) - { - $model = new Gems_Model_JoinModel('maillog', 'gems__log_respondent_communications'); - - $model->addLeftTable('gems__respondents', array('grco_id_to' => 'grs_id_user')); - $model->addLeftTable('gems__staff', array('grco_id_by' => 'gsf_id_user')); - $model->addLeftTable('gems__mail_templates', array('grco_id_message' => 'gmt_id_message')); - - $model->addColumn( - "TRIM(CONCAT(COALESCE(CONCAT(grs_last_name, ', '), '-, '), COALESCE(CONCAT(grs_first_name, ' '), ''), COALESCE(grs_surname_prefix, '')))", - 'respondent_name'); - $model->addColumn( - "CASE WHEN gems__staff.gsf_id_user IS NULL - THEN '-' - ELSE - CONCAT( - COALESCE(gems__staff.gsf_last_name, ''), - ', ', - COALESCE(gems__staff.gsf_first_name, ''), - COALESCE(CONCAT(' ', gems__staff.gsf_surname_prefix), '') - ) - END", - 'assigned_by'); - - $model->resetOrder(); - - $model->set('grco_created', 'label', $this->_('Date sent')); - $model->set('respondent_name', 'label', $this->_('Receiver')); - $model->set('grco_address', 'label', $this->_('To address'), 'itemDisplay', 'MUtil_Html_AElement::ifmail'); - $model->set('assigned_by', 'label', $this->_('Sender')); - $model->set('grco_sender', 'label', $this->_('From address'), 'itemDisplay', 'MUtil_Html_AElement::ifmail'); - $model->set('grco_id_token', 'label', $this->_('Token')); - $model->set('grco_topic', 'label', $this->_('Subject')); - - if ($detailed) { - $model->set('gmt_subject', 'label', $this->_('Template')); - } else { - $model->set('grco_created', 'formatFunction', $this->util->getTranslated()->formatDate); - } - - return $model; - } - - /** - * Helper function to allow generalized statements about the items in the model. - * - * @param int $count - * @return $string - */ - public function getTopic($count = 1) - { - return $this->plural('Activity Log', 'Activity Logs', $count); - } - - - /** - * Helper function to allow generalized treatment of the header. - * - * return $string - */ - public function getTopicTitle() - { - return $this->_('Mail Activity Log'); - } -} Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-20 16:03:30 UTC (rev 122) @@ -230,7 +230,7 @@ // MAIL ACTIVITY CONTROLLER //$setup->addBrowsePage(); - $page = $setup->addPage($this->_('Activity'), 'pr.mail.log', 'mail-log'); + $page = $setup->addPage($this->_('Activity log'), 'pr.mail.log', 'mail-log'); $page->addAutofilterAction(); $page->addExcelAction(); $page->addShowAction(); Modified: trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/classes/Gems/Snippets/ModelTableSnippetAbstract.php 2011-10-20 16:03:30 UTC (rev 122) @@ -103,6 +103,24 @@ protected $sortParamDesc = 'dsrt'; /** + * Adds columns from the model to the bridge that creates the browse table. + * + * Overrule this function to add different columns to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_TableBridge $bridge + * @param MUtil_Model_ModelAbstract $model + * @return void + */ + protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) + { + // make sure search results are highlighted + $this->applyTextMarker(); + + return parent::addBrowseTableColumns($bridge, $model); + } + + /** * Add the paginator panel to the table. * * Only called when $this->browse is true. Overrule this function @@ -116,6 +134,30 @@ } /** + * Make sure generic search text results are marked + * + * @return void + */ + protected function applyTextMarker() + { + $model = $this->getModel(); + + $textKey = $model->getTextFilter(); + $filter = $model->getFilter(); + + if (isset($filter[$textKey])) { + $searchText = $filter[$textKey]; + // MUtil_Echo::r('[' . $searchText . ']'); + $marker = new MUtil_Html_Marker($model->getTextSearches($searchText), 'strong', 'UTF-8'); + foreach ($model->getItemNames() as $name) { + if ($model->get($name, 'label')) { + $model->set($name, 'markCallback', array($marker, 'mark')); + } + } + } + } + + /** * Should be called after answering the request to allow the Target * to check if all required registry values have been set correctly. * @@ -204,7 +246,7 @@ $data = $this->requestCache->getProgramParams(); $model->applyParameters($data); - + } else { parent::processFilterAndSort($model); } Copied: trunk/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php (from rev 114, trunk/library/snippets/Generic/ModelTableSnippet.php) =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php (rev 0) +++ trunk/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php 2011-10-20 16:03:30 UTC (rev 122) @@ -0,0 +1,94 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Snippets + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Displays multiple items from a model in a tabel by row using + * the model set through the $model snippet parameter. + * + * If you want to use this class "as is" use the 'Generic_ModelTableSnippet' snippet. + * + * This class is not in the standard snippet loading directories and does not follow + * their naming conventions, but exists only to make it simple to extend this class + * for a specific implementation. + * + * @package MUtil + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Gems_Snippets_ModelTableSnippetGeneric extends Gems_Snippets_ModelTableSnippetAbstract +{ + /** + * + * @var MUtil_Model_ModelAbstract + */ + protected $model; + + /** + * + * @var Gems_Util + */ + protected $util; + + /** + * Automatically add request cacge + * + * Should be called after answering the request to allow the Target + * to check if all required registry values have been set correctly. + * + * @return boolean False if required are missing. + */ + public function checkRegistryRequestsAnswers() + { + if ($this->util && (! $this->requestCache)) { + $this->requestCache = $this->util->getRequestCache(); + } + + return parent::checkRegistryRequestsAnswers(); + } + + /** + * Creates the model + * + * @return MUtil_Model_ModelAbstract + */ + protected function createModel() + { + return $this->model; + } +} Modified: trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/classes/MUtil/Controller/ModelSnippetActionAbstract.php 2011-10-20 16:03:30 UTC (rev 122) @@ -98,6 +98,19 @@ protected $showSnippets = 'ModelVerticalTableSnippet'; /** + * Array of the actions that use a summarized version of the model. + * + * This determines the value of $detailed in createAction(). As it is usually + * less of a problem to use a $detailed model with an action that should use + * a summarized model and I guess there will usually be more detailed actions + * than summarized ones it seems less work to specify these. + * + * @var array $summarizedActions Array of the actions that use a + * summarized version of the model. + */ + public $summarizedActions = array('index', 'autofilter'); + + /** * Set the action key in request * * Use this when an action is a Ajax action for retrieving @@ -137,7 +150,9 @@ } if ($resetMvc && MUtil_Echo::hasOutput()) { - $this->html->raw(MUtil_Echo::out()); + // Lazy call here, because any echo calls in the snippets have not yet been + // performed. so they will appear only in the next call when not lazy. + $this->html->raw(MUtil_Lazy::call(array('MUtil_Echo', 'out'))); } } Modified: trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2011-10-20 16:03:30 UTC (rev 122) @@ -57,13 +57,6 @@ protected $_marker; /** - * Functional extension: optionally use this function to add the browse columns - * - * @var callable With signature: function(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model, MUtil_Snippets_ModelTableSnippetAbstract $snippet) - */ - public $addTableColumns; - - /** * Url parts added to each link in the resulting table * * @var array @@ -171,11 +164,7 @@ $bridge->setBaseUrl($this->baseUrl); } - if (is_callable($this->addTableColumns)) { - call_user_func($this->addTableColumns, $bridge, $model, $this); - } else { - $this->addBrowseTableColumns($bridge, $model); - } + $this->addBrowseTableColumns($bridge, $model); return $bridge->getTable(); } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/configs/db/patches.sql 2011-10-20 16:03:30 UTC (rev 122) @@ -208,3 +208,6 @@ UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; -- GEMS VERSION: 42 +-- PATCH: Add mail actions to admin role +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.log') WHERE grl_name = 'admin' AND grl_privileges NOT LIKE '%pr.mail.log%'; +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.mail.server%'; Modified: trunk/library/configs/db/tables/gems__roles.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__roles.20.sql 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/configs/db/tables/gems__roles.20.sql 2011-10-20 16:03:30 UTC (rev 122) @@ -32,5 +32,5 @@ ('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.setup,pr.staff,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('physician','physician','','staff', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('researcher','researcher','pr.invitation,pr.result,pr.islogin','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.role.create,pr.role.edit,pr.language,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); + ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.language,pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.role.create,pr.role.edit,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); Modified: trunk/library/controllers/MailLogController.php =================================================================== --- trunk/library/controllers/MailLogController.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/controllers/MailLogController.php 2011-10-20 16:03:30 UTC (rev 122) @@ -42,6 +42,5 @@ * @license New BSD License * @since Class available since version 1.4.2 */ -class MailLogController extends Gems_Default_MailLogActionOldStyle -{ -} +class MailLogController extends Gems_Default_MailLogAction +{ } Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/languages/default-en.po 2011-10-20 16:03:30 UTC (rev 122) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-20 15:30+0100\n" +"POT-Creation-Date: 2011-10-20 17:52+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1151,8 +1151,7 @@ msgstr "Log maintenance" #: classes/Gems/Default/MailAction.php:61 -#: classes/Gems/Default/MailLogAction.php:132 -#: classes/Gems/Default/MailLogActionOldStyle.php:118 +#: classes/Gems/Default/MailLogAction.php:113 msgid "Subject" msgstr "Subject" @@ -1170,51 +1169,38 @@ msgid "Email templates" msgstr "Email templates" -#: classes/Gems/Default/MailLogAction.php:126 -#: classes/Gems/Default/MailLogActionOldStyle.php:112 +#: classes/Gems/Default/MailLogAction.php:107 msgid "Date sent" msgstr "Date sent" -#: classes/Gems/Default/MailLogAction.php:127 -#: classes/Gems/Default/MailLogActionOldStyle.php:113 +#: classes/Gems/Default/MailLogAction.php:108 msgid "Receiver" msgstr "Receiver" -#: classes/Gems/Default/MailLogAction.php:128 -#: classes/Gems/Default/MailLogActionOldStyle.php:114 +#: classes/Gems/Default/MailLogAction.php:109 msgid "To address" msgstr "To address" -#: classes/Gems/Default/MailLogAction.php:129 -#: classes/Gems/Default/MailLogActionOldStyle.php:115 +#: classes/Gems/Default/MailLogAction.php:110 msgid "Sender" msgstr "Sender" -#: classes/Gems/Default/MailLogAction.php:130 -#: classes/Gems/Default/MailLogActionOldStyle.php:116 +#: classes/Gems/Default/MailLogAction.php:111 msgid "From address" msgstr "From address" -#: classes/Gems/Default/MailLogAction.php:135 -#: classes/Gems/Default/MailLogActionOldStyle.php:121 +#: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Template" -#: classes/Gems/Default/MailLogAction.php:148 -#: classes/Gems/Default/MailLogActionOldStyle.php:148 +#: classes/Gems/Default/MailLogAction.php:129 msgid "Mail Activity Log" msgstr "Mail Activity Log" -#: classes/Gems/Default/MailLogAction.php:160 +#: classes/Gems/Default/MailLogAction.php:140 msgid "Show Mail Activity Log item" msgstr "Show Mail Activity Log item" -#: classes/Gems/Default/MailLogActionOldStyle.php:137 -msgid "Activity Log" -msgid_plural "Activity Logs" -msgstr[0] "Activity Log" -msgstr[1] "Activity Logs" - #: classes/Gems/Default/MailServerAction.php:68 msgid "From address [part]" msgstr "From address [part]" @@ -1256,6 +1242,8 @@ msgstr "User ID" #: classes/Gems/Default/MailServerAction.php:90 +#: classes/Gems/Default/OptionAction.php:107 +#: classes/Gems/Default/OptionAction.php:112 msgid "Repeat password" msgstr "Repeat password" @@ -1274,14 +1262,10 @@ msgstr "Email servers" #: classes/Gems/Default/OptionAction.php:73 -#: classes/Gems/Default/OrganizationAction.php:128 -#: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:188 msgid "Language" msgstr "Language" #: classes/Gems/Default/OptionAction.php:74 -#: classes/Gems/Default/StaffAction.php:189 msgid "Logout on survey" msgstr "Logout on survey" @@ -1568,6 +1552,7 @@ msgstr "Survey not specified." #: classes/Gems/Default/ProjectTracksAction.php:120 +#: classes/Gems/Default/TrackActionAbstract.php:479 #, php-format msgid "Track %s does not exist." msgstr "Track %s does not exist." @@ -2515,8 +2500,8 @@ msgstr "Some help for this export" #: classes/Gems/Menu/MenuAbstract.php:233 -msgid "Activity" -msgstr "Activity" +msgid "Activity log" +msgstr "Activity Log" #: classes/Gems/Menu/MenuAbstract.php:239 msgid "Servers" @@ -3564,6 +3549,9 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." +#~ msgid "Activity" +#~ msgstr "Activity" + #~ msgid "DB Adaptor" #~ msgstr "DB Adaptor" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/languages/default-nl.po 2011-10-20 16:03:30 UTC (rev 122) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-20 15:30+0100\n" +"POT-Creation-Date: 2011-10-20 17:53+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1151,8 +1151,7 @@ msgstr "Logboek onderhoud" #: classes/Gems/Default/MailAction.php:61 -#: classes/Gems/Default/MailLogAction.php:132 -#: classes/Gems/Default/MailLogActionOldStyle.php:118 +#: classes/Gems/Default/MailLogAction.php:113 msgid "Subject" msgstr "Onderwerp" @@ -1170,51 +1169,38 @@ msgid "Email templates" msgstr "Email sjabloon" -#: classes/Gems/Default/MailLogAction.php:126 -#: classes/Gems/Default/MailLogActionOldStyle.php:112 +#: classes/Gems/Default/MailLogAction.php:107 msgid "Date sent" msgstr "Verzend datum" -#: classes/Gems/Default/MailLogAction.php:127 -#: classes/Gems/Default/MailLogActionOldStyle.php:113 +#: classes/Gems/Default/MailLogAction.php:108 msgid "Receiver" msgstr "Ontvanger" -#: classes/Gems/Default/MailLogAction.php:128 -#: classes/Gems/Default/MailLogActionOldStyle.php:114 +#: classes/Gems/Default/MailLogAction.php:109 msgid "To address" msgstr "Adres aan" -#: classes/Gems/Default/MailLogAction.php:129 -#: classes/Gems/Default/MailLogActionOldStyle.php:115 +#: classes/Gems/Default/MailLogAction.php:110 msgid "Sender" msgstr "Verzender" -#: classes/Gems/Default/MailLogAction.php:130 -#: classes/Gems/Default/MailLogActionOldStyle.php:116 +#: classes/Gems/Default/MailLogAction.php:111 msgid "From address" msgstr "Adres van" -#: classes/Gems/Default/MailLogAction.php:135 -#: classes/Gems/Default/MailLogActionOldStyle.php:121 +#: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Sjabloon" -#: classes/Gems/Default/MailLogAction.php:148 -#: classes/Gems/Default/MailLogActionOldStyle.php:148 +#: classes/Gems/Default/MailLogAction.php:129 msgid "Mail Activity Log" msgstr "Logboek Mail Activiteit" -#: classes/Gems/Default/MailLogAction.php:160 +#: classes/Gems/Default/MailLogAction.php:140 msgid "Show Mail Activity Log item" msgstr "Toon Logboek Mail item" -#: classes/Gems/Default/MailLogActionOldStyle.php:137 -msgid "Activity Log" -msgid_plural "Activity Logs" -msgstr[0] "Mail Activiteit Log" -msgstr[1] "Mail Activiteiten Logs" - #: classes/Gems/Default/MailServerAction.php:68 msgid "From address [part]" msgstr "Vanaf adres [gedeelte]" @@ -1256,6 +1242,8 @@ msgstr "Gebruikers ID" #: classes/Gems/Default/MailServerAction.php:90 +#: classes/Gems/Default/OptionAction.php:107 +#: classes/Gems/Default/OptionAction.php:112 msgid "Repeat password" msgstr "Herhaal wachtwoord" @@ -1274,14 +1262,10 @@ msgstr "Email servers" #: classes/Gems/Default/OptionAction.php:73 -#: classes/Gems/Default/OrganizationAction.php:128 -#: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:188 msgid "Language" msgstr "Taal" #: classes/Gems/Default/OptionAction.php:74 -#: classes/Gems/Default/StaffAction.php:189 msgid "Logout on survey" msgstr "Logout bij beantwoorden vragenlijst" @@ -1568,6 +1552,7 @@ msgstr "Vragenlijst niet opgegeven." #: classes/Gems/Default/ProjectTracksAction.php:120 +#: classes/Gems/Default/TrackActionAbstract.php:479 #, php-format msgid "Track %s does not exist." msgstr "Trajectnummer %s bestaat niet." @@ -2515,7 +2500,7 @@ msgstr "Uitleg over deze export mogelijkheid" #: classes/Gems/Menu/MenuAbstract.php:233 -msgid "Activity" +msgid "Activity log" msgstr "Activiteit" #: classes/Gems/Menu/MenuAbstract.php:239 @@ -3564,6 +3549,9 @@ msgid "This track can be assigned since %s." msgstr "Dit traject kan sinds %s aan een patiënt toegewezen worden." +#~ msgid "Activity" +#~ msgstr "Activiteit" + #~ msgid "DB Adaptor" #~ msgstr "DB Adaptor" Modified: trunk/library/snippets/Generic/ModelItemTableSnippet.php =================================================================== --- trunk/library/snippets/Generic/ModelItemTableSnippet.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/snippets/Generic/ModelItemTableSnippet.php 2011-10-20 16:03:30 UTC (rev 122) @@ -108,7 +108,7 @@ $menuList = $this->menu->getMenuList(); $menuList->addParameterSources($bridge) - ->addByController($controller) + ->addByController($controller, 'index', $this->_('Cancel')) ->addByController($controller, 'edit') ->addByController($controller, 'delete'); Modified: trunk/library/snippets/Generic/ModelTableSnippet.php =================================================================== --- trunk/library/snippets/Generic/ModelTableSnippet.php 2011-10-20 14:12:29 UTC (rev 121) +++ trunk/library/snippets/Generic/ModelTableSnippet.php 2011-10-20 16:03:30 UTC (rev 122) @@ -39,50 +39,13 @@ * Displays multiple items from a model in a tabel by row using * the model set through the $model snippet parameter. * + * Usage snippet for Gems_Snippets_ModelTableSnippetGeneric + * * @package MUtil * @subpackage Snippets * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.2 + * @since Class available since version 1.4 */ -class Generic_ModelTableSnippet extends Gems_Snippets_ModelTableSnippetAbstract -{ - /** - * - * @var MUtil_Model_ModelAbstract - */ - protected $model; - - /** - * - * @var Gems_Util - */ - protected $util; - - /** - * Automatically add request cacge - * - * Should be called after answering the request to allow the Target - * to check if all required registry values have been set correctly. - * - * @return boolean False if required are missing. - */ - public function checkRegistryRequestsAnswers() - { - if ($this->util && (! $this->requestCache)) { - $this->requestCache = $this->util->getRequestCache(); - } - - return parent::checkRegistryRequestsAnswers(); - } - - /** - * Creates the model - * - * @return MUtil_Model_ModelAbstract - */ - protected function createModel() - { - return $this->model; - } -} +class Generic_ModelTableSnippet extends Gems_Snippets_ModelTableSnippetGeneric +{ } Property changes on: trunk/library/snippets/Mail ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:number + true Added: bugtraq:logregex + #(\d+) Property changes on: trunk/library/snippets/Mail/Log ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:number + true Added: bugtraq:logregex + #(\d+) Added: trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php =================================================================== --- trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php (rev 0) +++ trunk/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2011-10-20 16:03:30 UTC (rev 122) @@ -0,0 +1,76 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Snippets + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Add complex column layout to display. + * + * + * @package Gems + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.4 + */ +class Mail_Log_MailLogBrowseSnippet extends Gems_Snippets_ModelTableSnippetGeneric +{ + /** + * Adds columns from the model to the bridge that creates the browse table. + * + * Overrule this function to add different columns to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_TableBridge $bridge + * @param MUtil_Model_ModelAbstract $model + * @return void + */ + protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) + { + if ($menuItem = $this->findMenuItem($this->request->getControllerName(), 'show')) { + $bridge->addItemLink($menuItem->toActionLinkLower($this->request, $bridge)); + } + + // Newline placeholder + $br = MUtil_Html::create('br'); + + // make sure search results are highlighted + $this->applyTextMarker(); + + $bridge->addMultiSort('grco_created', $br, 'respondent_name', $br, 'grco_address'); + $bridge->addMultiSort('grco_id_token', $br, 'assigned_by', $br, 'grco_sender'); + $bridge->addMultiSort('grco_topic'); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 14:12:38
|
Revision: 121 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=121&view=rev Author: matijsdejong Date: 2011-10-20 14:12:29 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Fix for #25: Ask button showed in between screen. Modified Paths: -------------- trunk/library/classes/Gems/Menu/SubMenuItem.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Menu/SubMenuItem.php =================================================================== --- trunk/library/classes/Gems/Menu/SubMenuItem.php 2011-10-20 13:56:34 UTC (rev 120) +++ trunk/library/classes/Gems/Menu/SubMenuItem.php 2011-10-20 14:12:29 UTC (rev 121) @@ -551,11 +551,12 @@ return $menu; } - public function applyHiddenParameters(Gems_Menu_ParameterSource $source) + public function applyHiddenParameters(Zend_Controller_Request_Abstract $request, Gems_Menu_ParameterSource $source) { if ($this->_hiddenParameters) { - foreach ($this->_hiddenParameters as $key => $name) { - $source[$key] = $name; + foreach ($this->_hiddenParameters as $key => $value) { + $request->setParam($key, $value); + $source[$key] = $value; } } Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-10-20 13:56:34 UTC (rev 120) +++ trunk/library/classes/GemsEscort.php 2011-10-20 14:12:29 UTC (rev 121) @@ -1607,7 +1607,7 @@ } if (isset($menuItem)) { - $menuItem->applyHiddenParameters($this->menu->getParameterSource()); + $menuItem->applyHiddenParameters($request, $this->menu->getParameterSource()); $this->menu->setCurrent($menuItem); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 13:56:42
|
Revision: 120 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=120&view=rev Author: matijsdejong Date: 2011-10-20 13:56:34 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Old patches are not shown for new installations. Modified Paths: -------------- trunk/library/classes/Gems/Util/DatabasePatcher.php trunk/library/configs/db/patches.sql Modified: trunk/library/classes/Gems/Util/DatabasePatcher.php =================================================================== --- trunk/library/classes/Gems/Util/DatabasePatcher.php 2011-10-20 13:30:18 UTC (rev 119) +++ trunk/library/classes/Gems/Util/DatabasePatcher.php 2011-10-20 13:56:34 UTC (rev 120) @@ -1,43 +1,47 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @version $Id$ + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * @package Gems * @subpackage Util + * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License + * @version $Id$ */ /** + * File for checking and executing (new) patches. + * * @package Gems * @subpackage Util * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License + * @since Class available since version 1.1 */ class Gems_Util_DatabasePatcher { @@ -175,6 +179,22 @@ return $executed; } + /** + * New installations should not be trequired to run patches. This esthablishes that level. + * + * @return int The lowest level of patch stored in the database. + */ + protected function getMinimumPatchLevel() + { + static $level; + + if (! $level) { + $level = intval($this->db->fetchOne("SELECT COALESCE(MIN(gpl_level), 1) FROM gems__patch_levels")); + } + + return $level; + } + public function hasPatchFiles() { return (boolean) $this->patch_files; @@ -195,33 +215,36 @@ $tree = MUtil_Ra_Nested::toTree($existing, 'gpa_level', 'gpa_location', 'gpa_name', 'gpa_order'); $changed = 0; $current = new Zend_Db_Expr('CURRENT_TIMESTAMP'); + $minimum = $this->getMinimumPatchLevel(); + // MUtil_Echo::track($minimum); $this->_loadPatches($applicationLevel); foreach ($this->_loaded_patches as $patch) { + if ($minimum <= $patch['gpa_level']) { + $level = $patch['gpa_level']; + $location = $patch['gpa_location']; + $name = $patch['gpa_name']; + $order = $patch['gpa_order']; - $level = $patch['gpa_level']; - $location = $patch['gpa_location']; - $name = $patch['gpa_name']; - $order = $patch['gpa_order']; + // Does it exist? + if (isset($tree[$level][$location][$name][$order])) { + $sql = $patch['gpa_sql']; + if ($sql != $tree[$level][$location][$name][$order]['gpa_sql']) { + $values['gpa_sql'] = $sql; + $values['gpa_executed'] = 0; + $values['gpa_completed'] = 0; + $values['gpa_changed'] = $current; - // Does it exist? - if (isset($tree[$level][$location][$name][$order])) { - $sql = $patch['gpa_sql']; - if ($sql != $tree[$level][$location][$name][$order]['gpa_sql']) { - $values['gpa_sql'] = $sql; - $values['gpa_executed'] = 0; - $values['gpa_completed'] = 0; - $values['gpa_changed'] = $current; + $this->db->update('gems__patches', $values, $this->db->quoteInto('gpa_id_patch = ?', $tree[$level][$location][$name][$order]['gpa_id_patch'])); + $changed++; + } - $this->db->update('gems__patches', $values, $this->db->quoteInto('gpa_id_patch = ?', $tree[$level][$location][$name][$order]['gpa_id_patch'])); + } else { + $patch['gpa_changed'] = $current; + $patch['gpa_created'] = $current; + $this->db->insert('gems__patches', $patch); $changed++; } - - } else { - $patch['gpa_changed'] = $current; - $patch['gpa_created'] = $current; - $this->db->insert('gems__patches', $patch); - $changed++; } } // */ Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-20 13:30:18 UTC (rev 119) +++ trunk/library/configs/db/patches.sql 2011-10-20 13:56:34 UTC (rev 120) @@ -1,4 +1,8 @@ +-- GEMS VERSION: 1 +-- PATCH: Test skip earlier patch levels +SELECT NULL; + -- GEMS VERSION: 27 -- PATCH: Use OK reception code This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 13:30:25
|
Revision: 119 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=119&view=rev Author: matijsdejong Date: 2011-10-20 13:30:18 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Maintenance mode is now a button and works a little bit nicer as per #20. Modified Paths: -------------- trunk/library/classes/Gems/Default/ProjectInformationAction.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/GemsEscort.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/ProjectInformationAction.php =================================================================== --- trunk/library/classes/Gems/Default/ProjectInformationAction.php 2011-10-20 12:56:42 UTC (rev 118) +++ trunk/library/classes/Gems/Default/ProjectInformationAction.php 2011-10-20 13:30:18 UTC (rev 119) @@ -45,6 +45,18 @@ */ class Gems_Default_ProjectInformationAction extends Gems_Controller_Action { + /** + * + * @var GemsEscort + */ + public $escort; + + /** + * + * @var Gems_Menu + */ + public $menu; + public $useHtmlView = true; protected function _showTable($caption, $data, $nested = false) @@ -132,18 +144,40 @@ $data[$this->_('Server OS')] = php_uname('s'); $data[$this->_('Time on server')] = date('r'); + if (file_exists($this->escort->getMaintenanceLockFilename())) { + $label = $this->_('Turn Maintenance Mode OFF'); + } else { + $label = $this->_('Turn Maintenance Mode ON'); + } + $request = $this->getRequest(); + $buttonList = $this->menu->getMenuList(); + $buttonList->addParameterSources($request) + ->addByController($request->getControllerName(), 'maintenance', $label); + + // $this->html->buttonDiv($buttonList); + $this->_showTable($this->_('Version information'), $data); + + $this->html->buttonDiv($buttonList); } public function maintenanceAction() { - $lockFile = GEMS_ROOT_DIR . '/var/settings/lock.txt'; - if(file_exists($lockFile)) { + $lockFile = $this->escort->getMaintenanceLockFilename(); + if (file_exists($lockFile)) { unlink($lockFile); } else { touch($lockFile); } - $this->_forward('index'); + + // Dump the existing maintenance mode messages. + $this->escort->getMessenger()->clearCurrentMessages(); + $this->escort->getMessenger()->clearMessages(); + MUtil_Echo::out(); + + // Redirect + $request = $this->getRequest(); + $this->_reroute(array($request->getActionKey() => 'index')); } public function phpAction() Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-20 12:56:42 UTC (rev 118) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-20 13:30:18 UTC (rev 119) @@ -300,7 +300,7 @@ $page->addAction($this->_('PHP'), null, 'php'); $page->addAction($this->_('Project'), null, 'project'); $page->addAction($this->_('Session'), null, 'session'); - $page->addAction($this->_('Maintenance mode'), 'pr.maintenance', 'maintenance'); + $page->addButtonOnly($this->_('Maintenance mode'), 'pr.maintenance', 'project-information', 'maintenance'); return $page; } Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-10-20 12:56:42 UTC (rev 118) +++ trunk/library/classes/GemsEscort.php 2011-10-20 13:30:18 UTC (rev 119) @@ -1133,6 +1133,15 @@ } /** + * + * @return string Name of the file that performs the maintenance lock + */ + public function getMaintenanceLockFilename() + { + return GEMS_ROOT_DIR . '/var/settings/lock.txt'; + } + + /** * Retrieve the GemsEscort object * * @return GemsEscort @@ -1523,7 +1532,7 @@ * Check if we are in maintenance mode or not. This is triggeren by a file in the var/settings * directory with the name lock.txt */ - if(file_exists(GEMS_ROOT_DIR . '/var/settings/lock.txt')) { + if (file_exists($this->getMaintenanceLockFilename())) { if ($this->session->user_id && $this->session->user_role !== 'super') { //Still allow logoff so we can relogin as super if (!('index' == $request->getControllerName() && 'logoff' == $request->getActionName())) { @@ -1533,7 +1542,7 @@ $this->_('System is in maintenance mode')); } } else { - $this->getMessenger()->addMessage($this->_('System is in maintenance mode')); + $this->addMessage($this->_('System is in maintenance mode')); MUtil_Echo::r($this->_('System is in maintenance mode')); } } Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-10-20 12:56:42 UTC (rev 118) +++ trunk/library/languages/default-en.po 2011-10-20 13:30:18 UTC (rev 119) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-20 14:51+0100\n" +"POT-Creation-Date: 2011-10-20 15:30+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -32,44 +32,44 @@ msgid "version" msgstr "version" -#: classes/GemsEscort.php:1410 +#: classes/GemsEscort.php:1419 msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1531 +#: classes/GemsEscort.php:1540 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1533 -#: classes/GemsEscort.php:1536 -#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1542 +#: classes/GemsEscort.php:1545 +#: classes/GemsEscort.php:1546 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1551 +#: classes/GemsEscort.php:1560 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1553 -#: classes/GemsEscort.php:1589 +#: classes/GemsEscort.php:1562 +#: classes/GemsEscort.php:1598 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1569 +#: classes/GemsEscort.php:1578 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1571 +#: classes/GemsEscort.php:1580 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "Access to this page is not allowed for current role: %s." -#: classes/GemsEscort.php:1576 -#: classes/GemsEscort.php:1587 +#: classes/GemsEscort.php:1585 +#: classes/GemsEscort.php:1596 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1577 +#: classes/GemsEscort.php:1586 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -1401,107 +1401,115 @@ msgid "Planning overview" msgstr "Planning overview" -#: classes/Gems/Default/ProjectInformationAction.php:71 +#: classes/Gems/Default/ProjectInformationAction.php:83 msgid "empty file" msgstr "empty file" -#: classes/Gems/Default/ProjectInformationAction.php:75 +#: classes/Gems/Default/ProjectInformationAction.php:87 msgid "file not found" msgstr "file not found" -#: classes/Gems/Default/ProjectInformationAction.php:108 +#: classes/Gems/Default/ProjectInformationAction.php:120 msgid "Logged errors" msgstr "Logged errors" -#: classes/Gems/Default/ProjectInformationAction.php:108 +#: classes/Gems/Default/ProjectInformationAction.php:120 msgid "Empty logfile" msgstr "Empty logfile" -#: classes/Gems/Default/ProjectInformationAction.php:113 +#: classes/Gems/Default/ProjectInformationAction.php:125 msgid "Project information" msgstr "Project information" -#: classes/Gems/Default/ProjectInformationAction.php:117 +#: classes/Gems/Default/ProjectInformationAction.php:129 msgid "Project name" msgstr "Project name" -#: classes/Gems/Default/ProjectInformationAction.php:118 +#: classes/Gems/Default/ProjectInformationAction.php:130 msgid "Project version" msgstr "Project version" -#: classes/Gems/Default/ProjectInformationAction.php:119 +#: classes/Gems/Default/ProjectInformationAction.php:131 msgid "Gems version" msgstr "Gems version" -#: classes/Gems/Default/ProjectInformationAction.php:121 +#: classes/Gems/Default/ProjectInformationAction.php:133 msgid "Gems project" msgstr "Gems project" -#: classes/Gems/Default/ProjectInformationAction.php:122 +#: classes/Gems/Default/ProjectInformationAction.php:134 msgid "Gems web directory" msgstr "Gems web directory" -#: classes/Gems/Default/ProjectInformationAction.php:123 +#: classes/Gems/Default/ProjectInformationAction.php:135 msgid "Gems code directory" msgstr "Gems code directory" -#: classes/Gems/Default/ProjectInformationAction.php:124 +#: classes/Gems/Default/ProjectInformationAction.php:136 msgid "Gems project path" msgstr "Gems project path" -#: classes/Gems/Default/ProjectInformationAction.php:125 +#: classes/Gems/Default/ProjectInformationAction.php:137 msgid "MUtil version" msgstr "MUtil version" -#: classes/Gems/Default/ProjectInformationAction.php:126 +#: classes/Gems/Default/ProjectInformationAction.php:138 msgid "Zend version" msgstr "Zend version" -#: classes/Gems/Default/ProjectInformationAction.php:127 +#: classes/Gems/Default/ProjectInformationAction.php:139 msgid "Application environment" msgstr "Application environment" -#: classes/Gems/Default/ProjectInformationAction.php:128 +#: classes/Gems/Default/ProjectInformationAction.php:140 msgid "Application baseuri" msgstr "Application baseuri" -#: classes/Gems/Default/ProjectInformationAction.php:129 +#: classes/Gems/Default/ProjectInformationAction.php:141 msgid "Application directory" msgstr "Application directory" -#: classes/Gems/Default/ProjectInformationAction.php:130 +#: classes/Gems/Default/ProjectInformationAction.php:142 msgid "PHP version" msgstr "PHP version" -#: classes/Gems/Default/ProjectInformationAction.php:131 +#: classes/Gems/Default/ProjectInformationAction.php:143 msgid "Server Hostname" msgstr "Server Hostname" -#: classes/Gems/Default/ProjectInformationAction.php:132 +#: classes/Gems/Default/ProjectInformationAction.php:144 msgid "Server OS" msgstr "Server OS" -#: classes/Gems/Default/ProjectInformationAction.php:133 +#: classes/Gems/Default/ProjectInformationAction.php:145 msgid "Time on server" msgstr "Time on server" -#: classes/Gems/Default/ProjectInformationAction.php:135 +#: classes/Gems/Default/ProjectInformationAction.php:148 +msgid "Turn Maintenance Mode OFF" +msgstr "Turn Maintenance Mode OFF" + +#: classes/Gems/Default/ProjectInformationAction.php:150 +msgid "Turn Maintenance Mode ON" +msgstr "Turn Maintenance Mode ON" + +#: classes/Gems/Default/ProjectInformationAction.php:159 msgid "Version information" msgstr "Version information" -#: classes/Gems/Default/ProjectInformationAction.php:151 +#: classes/Gems/Default/ProjectInformationAction.php:185 msgid "Server PHP Info" msgstr "Server PHP Info" -#: classes/Gems/Default/ProjectInformationAction.php:164 +#: classes/Gems/Default/ProjectInformationAction.php:198 msgid "Project settings" msgstr "Project settings" -#: classes/Gems/Default/ProjectInformationAction.php:171 +#: classes/Gems/Default/ProjectInformationAction.php:205 msgid "Session content" msgstr "Session content" -#: classes/Gems/Default/ProjectInformationAction.php:172 +#: classes/Gems/Default/ProjectInformationAction.php:206 msgid "Session" msgstr "Session" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-10-20 12:56:42 UTC (rev 118) +++ trunk/library/languages/default-nl.po 2011-10-20 13:30:18 UTC (rev 119) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-20 14:51+0100\n" +"POT-Creation-Date: 2011-10-20 15:30+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -32,44 +32,44 @@ msgid "version" msgstr "versie" -#: classes/GemsEscort.php:1410 +#: classes/GemsEscort.php:1419 msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer de gegevens en probeer a.u.b. opnieuw." -#: classes/GemsEscort.php:1531 +#: classes/GemsEscort.php:1540 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1533 -#: classes/GemsEscort.php:1536 -#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1542 +#: classes/GemsEscort.php:1545 +#: classes/GemsEscort.php:1546 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1551 +#: classes/GemsEscort.php:1560 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1553 -#: classes/GemsEscort.php:1589 +#: classes/GemsEscort.php:1562 +#: classes/GemsEscort.php:1598 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1569 +#: classes/GemsEscort.php:1578 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1571 +#: classes/GemsEscort.php:1580 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "U heeft geen toegang tot deze pagina. Uw huidige rol is: %s." -#: classes/GemsEscort.php:1576 -#: classes/GemsEscort.php:1587 +#: classes/GemsEscort.php:1585 +#: classes/GemsEscort.php:1596 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1577 +#: classes/GemsEscort.php:1586 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -1401,107 +1401,115 @@ msgid "Planning overview" msgstr "Planning overzicht" -#: classes/Gems/Default/ProjectInformationAction.php:71 +#: classes/Gems/Default/ProjectInformationAction.php:83 msgid "empty file" msgstr "leeg bestand" -#: classes/Gems/Default/ProjectInformationAction.php:75 +#: classes/Gems/Default/ProjectInformationAction.php:87 msgid "file not found" msgstr "bestand niet gevonden" -#: classes/Gems/Default/ProjectInformationAction.php:108 +#: classes/Gems/Default/ProjectInformationAction.php:120 msgid "Logged errors" msgstr "Opgeslagen foutmeldingen" -#: classes/Gems/Default/ProjectInformationAction.php:108 +#: classes/Gems/Default/ProjectInformationAction.php:120 msgid "Empty logfile" msgstr "Verwijder alle foutmeldingen" -#: classes/Gems/Default/ProjectInformationAction.php:113 +#: classes/Gems/Default/ProjectInformationAction.php:125 msgid "Project information" msgstr "Project informatie" -#: classes/Gems/Default/ProjectInformationAction.php:117 +#: classes/Gems/Default/ProjectInformationAction.php:129 msgid "Project name" msgstr "Project naam" -#: classes/Gems/Default/ProjectInformationAction.php:118 +#: classes/Gems/Default/ProjectInformationAction.php:130 msgid "Project version" msgstr "Project versie" -#: classes/Gems/Default/ProjectInformationAction.php:119 +#: classes/Gems/Default/ProjectInformationAction.php:131 msgid "Gems version" msgstr "Gems versie" -#: classes/Gems/Default/ProjectInformationAction.php:121 +#: classes/Gems/Default/ProjectInformationAction.php:133 msgid "Gems project" msgstr "Gems project" -#: classes/Gems/Default/ProjectInformationAction.php:122 +#: classes/Gems/Default/ProjectInformationAction.php:134 msgid "Gems web directory" msgstr "Gems web folder" -#: classes/Gems/Default/ProjectInformationAction.php:123 +#: classes/Gems/Default/ProjectInformationAction.php:135 msgid "Gems code directory" msgstr "Gems code folder" -#: classes/Gems/Default/ProjectInformationAction.php:124 +#: classes/Gems/Default/ProjectInformationAction.php:136 msgid "Gems project path" msgstr "Gems project folder" -#: classes/Gems/Default/ProjectInformationAction.php:125 +#: classes/Gems/Default/ProjectInformationAction.php:137 msgid "MUtil version" msgstr "MUtil versie" -#: classes/Gems/Default/ProjectInformationAction.php:126 +#: classes/Gems/Default/ProjectInformationAction.php:138 msgid "Zend version" msgstr "Zend versie" -#: classes/Gems/Default/ProjectInformationAction.php:127 +#: classes/Gems/Default/ProjectInformationAction.php:139 msgid "Application environment" msgstr "Applicatie omgeving" -#: classes/Gems/Default/ProjectInformationAction.php:128 +#: classes/Gems/Default/ProjectInformationAction.php:140 msgid "Application baseuri" msgstr "Applicatie baseuri" -#: classes/Gems/Default/ProjectInformationAction.php:129 +#: classes/Gems/Default/ProjectInformationAction.php:141 msgid "Application directory" msgstr "Applicatie folder" -#: classes/Gems/Default/ProjectInformationAction.php:130 +#: classes/Gems/Default/ProjectInformationAction.php:142 msgid "PHP version" msgstr "PHP versie" -#: classes/Gems/Default/ProjectInformationAction.php:131 +#: classes/Gems/Default/ProjectInformationAction.php:143 msgid "Server Hostname" msgstr "Webserver naam" -#: classes/Gems/Default/ProjectInformationAction.php:132 +#: classes/Gems/Default/ProjectInformationAction.php:144 msgid "Server OS" msgstr "Server besturingssysteem" -#: classes/Gems/Default/ProjectInformationAction.php:133 +#: classes/Gems/Default/ProjectInformationAction.php:145 msgid "Time on server" msgstr "De tijd op de server" -#: classes/Gems/Default/ProjectInformationAction.php:135 +#: classes/Gems/Default/ProjectInformationAction.php:148 +msgid "Turn Maintenance Mode OFF" +msgstr "Onderhoudsmodus UITzetten" + +#: classes/Gems/Default/ProjectInformationAction.php:150 +msgid "Turn Maintenance Mode ON" +msgstr "Onderhoudsmodus AANzetten" + +#: classes/Gems/Default/ProjectInformationAction.php:159 msgid "Version information" msgstr "Versie informatie" -#: classes/Gems/Default/ProjectInformationAction.php:151 +#: classes/Gems/Default/ProjectInformationAction.php:185 msgid "Server PHP Info" msgstr "Server PHP Info" -#: classes/Gems/Default/ProjectInformationAction.php:164 +#: classes/Gems/Default/ProjectInformationAction.php:198 msgid "Project settings" msgstr "Project instellingen" -#: classes/Gems/Default/ProjectInformationAction.php:171 +#: classes/Gems/Default/ProjectInformationAction.php:205 msgid "Session content" msgstr "Sessie inhoud" -#: classes/Gems/Default/ProjectInformationAction.php:172 +#: classes/Gems/Default/ProjectInformationAction.php:206 msgid "Session" msgstr "Sessie" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 12:56:52
|
Revision: 118 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=118&view=rev Author: matijsdejong Date: 2011-10-20 12:56:42 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Translation fixes for #21 and #22. Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2011-10-20 12:44:50 UTC (rev 117) +++ trunk/library/classes/Gems/Default/SourceAction.php 2011-10-20 12:56:42 UTC (rev 118) @@ -83,7 +83,7 @@ $bridge->addValidator('gso_ls_url', new MUtil_Validate_Url()); $bridge->addSelect('gso_ls_class'); - $bridge->addSelect('gso_ls_adapter', 'description', $this->_('Choose the database used by this source.')); + $bridge->addSelect('gso_ls_adapter', 'description', $this->_('The database server used by the source.')); $bridge->addText('gso_ls_table_prefix', array('size' => 15, 'description' => $this->_('Do not forget the underscores.'))); $bridge->addText('gso_ls_dbhost', array('size' => 15, 'description' => $in_gems)); Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-10-20 12:44:50 UTC (rev 117) +++ trunk/library/languages/default-en.po 2011-10-20 12:56:42 UTC (rev 118) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-17 15:19+0100\n" +"POT-Creation-Date: 2011-10-20 14:51+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Menno Dekker <men...@er...>\n" +"Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -381,7 +381,7 @@ msgid "Birthday" msgstr "Birthday" -#: classes/Gems/Tracker.php:726 +#: classes/Gems/Tracker.php:732 msgid "Checks performed" msgstr "Checks performed" @@ -1346,7 +1346,6 @@ msgstr "Invalid organization." #: classes/Gems/Default/OrganizationAction.php:117 -#: classes/Gems/Default/SourceAction.php:143 msgid "Url" msgstr "Url" @@ -1791,6 +1790,18 @@ msgid "Leave empty for the Gems database." msgstr "Leave empty for the Gems database." +#: classes/Gems/Default/SourceAction.php:79 +msgid "E.g. the name of the project - for single source projects." +msgstr "E.g. the name of the project - for single source projects." + +#: classes/Gems/Default/SourceAction.php:81 +msgid "For creating token-survey url." +msgstr "For creating token-survey url." + +#: classes/Gems/Default/SourceAction.php:86 +msgid "The database server used by the source." +msgstr "The database server used by the source." + #: classes/Gems/Default/SourceAction.php:88 msgid "Do not forget the underscores." msgstr "Do not forget the underscores." @@ -1808,63 +1819,67 @@ msgid "Checking survey results for %s source." msgstr "Checking survey results for %s source." +#: classes/Gems/Default/SourceAction.php:143 +msgid "Source Url" +msgstr "Source Url" + #: classes/Gems/Default/SourceAction.php:145 msgid "Adaptor class" msgstr "Adaptor class" #: classes/Gems/Default/SourceAction.php:147 -msgid "DB Adaptor" -msgstr "DB Adaptor" +msgid "Database Server" +msgstr "Database Server" #: classes/Gems/Default/SourceAction.php:149 msgid "Database host" msgstr "Database host" -#: classes/Gems/Default/SourceAction.php:152 +#: classes/Gems/Default/SourceAction.php:153 msgid "Table prefix" msgstr "Table prefix" -#: classes/Gems/Default/SourceAction.php:156 +#: classes/Gems/Default/SourceAction.php:157 msgid "Last check" msgstr "Last check" -#: classes/Gems/Default/SourceAction.php:189 +#: classes/Gems/Default/SourceAction.php:190 msgid "source" msgid_plural "sources" msgstr[0] "source" msgstr[1] "sources" -#: classes/Gems/Default/SourceAction.php:194 +#: classes/Gems/Default/SourceAction.php:195 msgid "Survey Sources" msgstr "Survey Sources" -#: classes/Gems/Default/SourceAction.php:202 +#: classes/Gems/Default/SourceAction.php:203 msgid "This installation is active." msgstr "This installation is active." -#: classes/Gems/Default/SourceAction.php:204 +#: classes/Gems/Default/SourceAction.php:205 msgid "Inactive installation." msgstr "Inactive installation." -#: classes/Gems/Default/SourceAction.php:217 -#: classes/Gems/Default/SourceAction.php:236 +#: classes/Gems/Default/SourceAction.php:218 +#: classes/Gems/Default/SourceAction.php:237 msgid "No changes." msgstr "No changes." -#: classes/Gems/Default/SourceAction.php:232 +#: classes/Gems/Default/SourceAction.php:233 #, php-format msgid "Synchronization of source %s:" msgstr "Synchronization of source %s:" -#: classes/Gems/Default/SourceAction.php:243 +#: classes/Gems/Default/SourceAction.php:244 msgid "Synchronize all sources of surveys" msgstr "Synchronize all sources of surveys" -#: classes/Gems/Default/SourceAction.php:244 +#: classes/Gems/Default/SourceAction.php:245 msgid "Synchronization will update the status of all surveys imported into this project to the status at the sources." msgstr "Synchronization will update the status of all surveys imported into this project to the status at the sources." -#: classes/Gems/Default/SourceAction.php:251 +#: classes/Gems/Default/SourceAction.php:252 msgid "Are you sure you want to synchronize all survey sources?" msgstr "Are you sure you want to synchronize all survey sources?" @@ -3541,10 +3556,12 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." -#: views/scripts/index/login.phtml:12 -msgid "The Pulse software was made possible thanks to support from " -msgstr "The Pulse software was made possible thanks to support from " +#~ msgid "DB Adaptor" +#~ msgstr "DB Adaptor" +#~ msgid "The Pulse software was made possible thanks to support from " +#~ msgstr "The Pulse software was made possible thanks to support from " + #~ msgid "ACL" #~ msgstr "ACL" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-10-20 12:44:50 UTC (rev 117) +++ trunk/library/languages/default-nl.po 2011-10-20 12:56:42 UTC (rev 118) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-17 15:19+0100\n" +"POT-Creation-Date: 2011-10-20 14:51+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Menno Dekker <men...@er...>\n" +"Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -381,7 +381,7 @@ msgid "Birthday" msgstr "Geboren op" -#: classes/Gems/Tracker.php:726 +#: classes/Gems/Tracker.php:732 msgid "Checks performed" msgstr "Controle uitgevoerd" @@ -1346,7 +1346,6 @@ msgstr "Ongeldige organisatie." #: classes/Gems/Default/OrganizationAction.php:117 -#: classes/Gems/Default/SourceAction.php:143 msgid "Url" msgstr "Url" @@ -1791,6 +1790,18 @@ msgid "Leave empty for the Gems database." msgstr "Leeglaten bij gebruik van de Gems database." +#: classes/Gems/Default/SourceAction.php:79 +msgid "E.g. the name of the project - for single source projects." +msgstr "Bijvoorbeeld de project naam - bij projecten met maar één bron." + +#: classes/Gems/Default/SourceAction.php:81 +msgid "For creating token-survey url." +msgstr "Voor kenmerk-vragenlijst url." + +#: classes/Gems/Default/SourceAction.php:86 +msgid "The database server used by the source." +msgstr "Het merk database server gebruikt door deze bron." + #: classes/Gems/Default/SourceAction.php:88 msgid "Do not forget the underscores." msgstr "Vergeet de underscores niet." @@ -1808,63 +1819,67 @@ msgid "Checking survey results for %s source." msgstr "Controle vragenlijstresultaten voor %s bron." +#: classes/Gems/Default/SourceAction.php:143 +msgid "Source Url" +msgstr "Bron Url" + #: classes/Gems/Default/SourceAction.php:145 msgid "Adaptor class" msgstr "Adaptor klasse" #: classes/Gems/Default/SourceAction.php:147 -msgid "DB Adaptor" -msgstr "DB Adaptor" +msgid "Database Server" +msgstr "Database Server" #: classes/Gems/Default/SourceAction.php:149 msgid "Database host" msgstr "Database machine" -#: classes/Gems/Default/SourceAction.php:152 +#: classes/Gems/Default/SourceAction.php:153 msgid "Table prefix" msgstr "Voorvoegsel tabel" -#: classes/Gems/Default/SourceAction.php:156 +#: classes/Gems/Default/SourceAction.php:157 msgid "Last check" msgstr "Laatste controle" -#: classes/Gems/Default/SourceAction.php:189 +#: classes/Gems/Default/SourceAction.php:190 msgid "source" msgid_plural "sources" msgstr[0] "bron" msgstr[1] "bronnen" -#: classes/Gems/Default/SourceAction.php:194 +#: classes/Gems/Default/SourceAction.php:195 msgid "Survey Sources" msgstr "Bronnen" -#: classes/Gems/Default/SourceAction.php:202 +#: classes/Gems/Default/SourceAction.php:203 msgid "This installation is active." msgstr "Deze installatie is actief" -#: classes/Gems/Default/SourceAction.php:204 +#: classes/Gems/Default/SourceAction.php:205 msgid "Inactive installation." msgstr "Deze installatie is inactief" -#: classes/Gems/Default/SourceAction.php:217 -#: classes/Gems/Default/SourceAction.php:236 +#: classes/Gems/Default/SourceAction.php:218 +#: classes/Gems/Default/SourceAction.php:237 msgid "No changes." msgstr "Geen veranderingen" -#: classes/Gems/Default/SourceAction.php:232 +#: classes/Gems/Default/SourceAction.php:233 #, php-format msgid "Synchronization of source %s:" msgstr "Synchronisatie van %s bron:" -#: classes/Gems/Default/SourceAction.php:243 +#: classes/Gems/Default/SourceAction.php:244 msgid "Synchronize all sources of surveys" msgstr "Synchronizeer alle vragenlijsten bronnen" -#: classes/Gems/Default/SourceAction.php:244 +#: classes/Gems/Default/SourceAction.php:245 msgid "Synchronization will update the status of all surveys imported into this project to the status at the sources." msgstr "Synchronisatie zal de status van alle vragenlijsten in dit project aanpassen aan de status van de bron." -#: classes/Gems/Default/SourceAction.php:251 +#: classes/Gems/Default/SourceAction.php:252 msgid "Are you sure you want to synchronize all survey sources?" msgstr "Weet je zeker dat je alle bronnen wil synchroniseren?" @@ -3541,10 +3556,12 @@ msgid "This track can be assigned since %s." msgstr "Dit traject kan sinds %s aan een patiënt toegewezen worden." -#: views/scripts/index/login.phtml:12 -msgid "The Pulse software was made possible thanks to support from " -msgstr "De PULSE software is mede mogelijk gemaakt met steun van " +#~ msgid "DB Adaptor" +#~ msgstr "DB Adaptor" +#~ msgid "The Pulse software was made possible thanks to support from " +#~ msgstr "De PULSE software is mede mogelijk gemaakt met steun van " + #~ msgid "ACL" #~ msgstr "ACL" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 12:44:57
|
Revision: 117 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=117&view=rev Author: matijsdejong Date: 2011-10-20 12:44:50 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Fixes for #22, clarifying source input. Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2011-10-20 12:18:03 UTC (rev 116) +++ trunk/library/classes/Gems/Default/SourceAction.php 2011-10-20 12:44:50 UTC (rev 117) @@ -76,14 +76,14 @@ } $bridge->addHidden('gso_id_source'); - $bridge->addText('gso_source_name', array('size' => 15, 'minlength' => 4)); + $bridge->addText('gso_source_name', 'description', $this->_('E.g. the name of the project - for single source projects.'), 'size', 15, 'minlength', 4); $bridge->addValidator('gso_source_name', $model->createUniqueValidator('gso_source_name')); - $bridge->addText('gso_ls_url', array('size' => 50)); + $bridge->addText('gso_ls_url', 'description', $this->_('For creating token-survey url.'), 'size', 50); $bridge->addValidator('gso_ls_url', $model->createUniqueValidator('gso_ls_url')); $bridge->addValidator('gso_ls_url', new MUtil_Validate_Url()); $bridge->addSelect('gso_ls_class'); - $bridge->addSelect('gso_ls_adapter', 'description', $this->_('Choose the database used by the source.')); + $bridge->addSelect('gso_ls_adapter', 'description', $this->_('Choose the database used by this source.')); $bridge->addText('gso_ls_table_prefix', array('size' => 15, 'description' => $this->_('Do not forget the underscores.'))); $bridge->addText('gso_ls_dbhost', array('size' => 15, 'description' => $in_gems)); @@ -140,7 +140,7 @@ $model = new MUtil_Model_TableModel('gems__sources'); $model->set('gso_source_name', 'label', $this->_('Name')); - $model->set('gso_ls_url', 'label', $this->_('Url'), 'default', 'http://'); + $model->set('gso_ls_url', 'label', $this->_('Source Url'), 'default', 'http://'); $model->set('gso_ls_class', 'label', $this->_('Adaptor class'), 'multiOptions', $tracker->getSourceClasses()); if ($detailed) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 12:18:09
|
Revision: 116 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=116&view=rev Author: matijsdejong Date: 2011-10-20 12:18:03 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Fix for #21, made db adapter choice more understandable Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Tracker.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2011-10-20 11:10:35 UTC (rev 115) +++ trunk/library/classes/Gems/Default/SourceAction.php 2011-10-20 12:18:03 UTC (rev 116) @@ -83,7 +83,7 @@ $bridge->addValidator('gso_ls_url', new MUtil_Validate_Url()); $bridge->addSelect('gso_ls_class'); - $bridge->addSelect('gso_ls_adapter'); + $bridge->addSelect('gso_ls_adapter', 'description', $this->_('Choose the database used by the source.')); $bridge->addText('gso_ls_table_prefix', array('size' => 15, 'description' => $this->_('Do not forget the underscores.'))); $bridge->addText('gso_ls_dbhost', array('size' => 15, 'description' => $in_gems)); @@ -144,11 +144,12 @@ $model->set('gso_ls_class', 'label', $this->_('Adaptor class'), 'multiOptions', $tracker->getSourceClasses()); if ($detailed) { - $model->set('gso_ls_adapter', 'label', $this->_('DB Adaptor'), 'multiOptions', $tracker->getSourceDatabaseClasses()); + $model->set('gso_ls_adapter', 'label', $this->_('Database Server'), 'multiOptions', $tracker->getSourceDatabaseClasses(), 'default', substr(get_class($this->db), strlen('Zend_Db_Adapter_'))); $model->set('gso_ls_dbhost', 'label', $this->_('Database host')); $model->set('gso_ls_database', 'label', $this->_('Database')); } + $model->set('gso_ls_table_prefix', 'label', $this->_('Table prefix'), 'default', 'ls__'); $model->set('gso_active', 'default', 0); Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2011-10-20 11:10:35 UTC (rev 115) +++ trunk/library/classes/Gems/Tracker.php 2011-10-20 12:18:03 UTC (rev 116) @@ -73,7 +73,7 @@ * @var array Of classname => description */ protected $_sourceClasses = array( - 'LimeSurvey1m9Database' => 'Lime Survey 1.90 DB', + 'LimeSurvey1m9Database' => 'Lime Survey 1.90 DB', 'LimeSurvey1m91Database' => 'Lime Survey 1.91+ DB', ); @@ -114,29 +114,29 @@ private $_trackEngines = array(); /** + * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. * - * @var Zend_Translate + * @var string $cascade An optional subdirectory where this subclass always loads from. */ - protected $translate; + protected $cascade = 'Tracker'; /** * - * @var Zend_Session + * @var Zend_Db_Adapter_Abstract */ - protected $session; + protected $db; /** - * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. * - * @var string $cascade An optional subdirectory where this subclass always loads from. + * @var Zend_Translate */ - protected $cascade = 'Tracker'; + protected $translate; /** * - * @var Zend_Db_Adapter_Abstract + * @var Zend_Session */ - protected $db; + protected $session; /** * Set to true to get detailed information on all tracker actions @@ -413,12 +413,18 @@ // TODO: this should be moved to Gems_Tracker_Source_SourceInterface, // but do not have time to implement is of minor importance at this moment. - return array( - '' => '-- none --', - 'Mysqli' => 'MySQL', - 'Pdo_Mysql' => 'MySQL (PDO)', - 'Sqlsrv' => 'SQL Server', - 'Pdo_Mssql' => 'SQL Server (PDO)'); + // If the project uses Pdo database, use Pdo classes, otherwise MySQL + if (stripos(get_class($this->db), '_Pdo_')) { + return array( + '' => '-- none --', + 'Pdo_Mysql' => 'MySQL (PDO)', + 'Pdo_Mssql' => 'SQL Server (PDO)'); + } else { + return array( + '' => '-- none --', + 'Mysqli' => 'MySQL', + 'Sqlsrv' => 'SQL Server'); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-20 11:10:41
|
Revision: 115 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=115&view=rev Author: matijsdejong Date: 2011-10-20 11:10:35 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Surveys give information based on the group they are assigned on as per #24. Also found database field no longer in use in code. Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Survey.php trunk/library/configs/db/tables/gems__surveys.30.sql Modified: trunk/library/classes/Gems/Tracker/Survey.php =================================================================== --- trunk/library/classes/Gems/Tracker/Survey.php 2011-10-19 18:01:56 UTC (rev 114) +++ trunk/library/classes/Gems/Tracker/Survey.php 2011-10-20 11:10:35 UTC (rev 115) @@ -104,6 +104,26 @@ } /** + * Makes sure the receptioncode data is part of the $this->_gemsData + * + * @param boolean $reload Optional parameter to force reload. + */ + private function _ensureGroupData($reload = false) + { + if ($reload || (! isset($this->_gemsSurvey['ggp_id_group']))) { + $sql = "SELECT * FROM gems__groups WHERE ggp_id_group = ?"; + $code = $this->_gemsSurvey['gsu_id_primary_group']; + + if ($row = $this->db->fetchRow($sql, $code)) { + $this->_gemsSurvey = $row + $this->_gemsSurvey; + } else { + $name = $this->getName(); + throw new Gems_Exception("Group code $code is missing for survey '$name'."); + } + } + } + + /** * Update the survey, both in the database and in memory. * * @param array $values The values that this token should be set to @@ -466,6 +486,20 @@ } /** + * Should this survey be filled in by staff members. + * + * @return boolean + */ + public function isTakenByStaff() + { + if (! isset($this->_gemsSurvey['ggp_staff_members'])) { + $this->_ensureGroupData(); + } + + return (boolean) $this->_gemsSurvey['ggp_staff_members']; + } + + /** * Update the survey, both in the database and in memory. * * @param array $values The values that this token should be set to Modified: trunk/library/configs/db/tables/gems__surveys.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__surveys.30.sql 2011-10-19 18:01:56 UTC (rev 114) +++ trunk/library/configs/db/tables/gems__surveys.30.sql 2011-10-20 11:10:35 UTC (rev 115) @@ -20,7 +20,10 @@ references gems__sources (gso_id_source), gsu_active boolean not null default 0, gsu_status varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + + -- depreciated gsu_staff boolean not null default 0, + -- end depreciated gsu_id_primary_group bigint unsigned null references gems__groups (ggp_id_group), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-19 18:02:02
|
Revision: 114 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=114&view=rev Author: michieltcs Date: 2011-10-19 18:01:56 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Fix small errors related to first-time import Modified Paths: -------------- trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__mail_jobs.300.sql trunk/library/configs/db/tables/gems__reception_codes.10.sql Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-18 16:35:34 UTC (rev 113) +++ trunk/library/configs/db/patches.sql 2011-10-19 18:01:56 UTC (rev 114) @@ -203,4 +203,4 @@ -- PATCH: Assign maintenance mode toggle to super role UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; --- GEMS VERSION: 42 \ No newline at end of file +-- GEMS VERSION: 42 Modified: trunk/library/configs/db/tables/gems__mail_jobs.300.sql =================================================================== --- trunk/library/configs/db/tables/gems__mail_jobs.300.sql 2011-10-18 16:35:34 UTC (rev 113) +++ trunk/library/configs/db/tables/gems__mail_jobs.300.sql 2011-10-19 18:01:56 UTC (rev 114) @@ -4,8 +4,6 @@ gmj_id_organization bigint unsigned not null references gems__organizations (gor_id_organization), - gmj_id_message bigint unsigned not null - references gems__mail_templates (gmt_id_message), gmj_id_user_as bigint unsigned not null references gems__staff (gsf_id_user), Modified: trunk/library/configs/db/tables/gems__reception_codes.10.sql =================================================================== --- trunk/library/configs/db/tables/gems__reception_codes.10.sql 2011-10-18 16:35:34 UTC (rev 113) +++ trunk/library/configs/db/tables/gems__reception_codes.10.sql 2011-10-19 18:01:56 UTC (rev 114) @@ -29,5 +29,5 @@ grc_changed, grc_changed_by, grc_created, grc_created_by) VALUES ('OK', '', 1, 1, 0, 1, 1, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('skip', 'Skipped by calculation', 0, 1, 0, 0, 0, 0, 0, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); + ('skip', 'Skipped by calculation', 0, 1, 0, 0, 0, 0, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-18 16:35:41
|
Revision: 113 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=113&view=rev Author: matijsdejong Date: 2011-10-18 16:35:34 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Modified Paths: -------------- branches/newUser/classes/Gems/Cookies.php branches/newUser/classes/Gems/Default/IndexAction.php branches/newUser/classes/Gems/Loader/LoaderAbstract.php branches/newUser/classes/Gems/Loader.php branches/newUser/classes/GemsEscort.php branches/newUser/configs/db/patches.sql Added Paths: ----------- branches/newUser/ Modified: branches/newUser/classes/Gems/Cookies.php =================================================================== --- trunk/library/classes/Gems/Cookies.php 2011-10-17 13:51:03 UTC (rev 112) +++ branches/newUser/classes/Gems/Cookies.php 2011-10-18 16:35:34 UTC (rev 113) @@ -1,63 +1,86 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @author Matijs de Jong - * @since 1.0 - * @version $Id$ + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * @package Gems * @subpackage Cookies + * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License + * @version $Id$ */ /** * Static Gems cookie utilities - * - * @author Matijs de Jong + * * @package Gems * @subpackage Cookies * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License + * @since Class available since version 1.0 */ class Gems_Cookies { const LOCALE_COOKIE = 'gems_locale'; - public static function get(Zend_Controller_Request_Abstract $request, $name) + /** + * Get a specific cookie from the request. + * + * @param Zend_Controller_Request_Abstract $request + * @param string $name + * @param mixed $default + * @return mixed Cookie value + */ + public static function get(Zend_Controller_Request_Abstract $request, $name, $default = null) { - return $request->getCookie($name); + return $request->getCookie($name, $default); } + /** + * Get the current locale from the cookie. + * + * @param Zend_Controller_Request_Abstract $request + * @return string The current locale + */ public static function getLocale(Zend_Controller_Request_Abstract $request) { return self::get($request, self::LOCALE_COOKIE); } + /** + * Store this cookie in a generic save method that works for both sub-directory + * installations and own url installations. + * + * @param string $name Name of the cookie + * @param mixed $value Value to set + * @param int $days Number of days to keep this cookie + * @param string $basepath The folder of the domain, if any. + * @return boolean True if the cookie was stored. + */ public static function set($name, $value, $days = 30, $basepath = '/') { // Gems uses the empty string when the base path is '/' @@ -69,6 +92,13 @@ return setcookie($name, $value, time() + ($days * 86400), $basepath); } + /** + * Store the locale in a cookie. + * + * @param string $locale Locale to store + * @param string $basepath The folder of the domain, if any. + * @return boolean True if the cookie was stored. + */ public static function setLocale($locale, $basepath = '/') { // Set the cookie for 30 days Modified: branches/newUser/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-10-17 13:51:03 UTC (rev 112) +++ branches/newUser/classes/Gems/Default/IndexAction.php 2011-10-18 16:35:34 UTC (rev 113) @@ -92,6 +92,21 @@ $form->setMethod('post'); $form->setDescription(sprintf($this->_('Login to %s application'), $this->project->name)); + if ($this->escort instanceof Gems_Project_Organization_SingleOrganizationInterface) { + $element = new Zend_Form_Element_Hidden('organization'); + $element->setValue($this->escort->getRespondentOrganization()); + } else { + $element = new Zend_Form_Element_Select('organization'); + $element->setLabel($this->_('Organization')); + $element->setMultiOptions($this->util->getDbLookup()->getOrganizations()); + $element->setRequired(true); + + if (! $this->_request->isPost()) { + $element->setValue($this->escort->getCurrentOrganization()); + } + } + $form->addElement($element); + // Veld inlognaam $element = new Zend_Form_Element_Text('userlogin'); $element->setLabel($this->_('Username')); @@ -130,7 +145,7 @@ return $form; } - // Dummy: always rerouted by Gems + // Dummy: always rerouted by GemsEscort public function indexAction() { } public function loginAction() @@ -138,11 +153,17 @@ if (isset($this->session->user_id)) { $this->_reroute(array('controller' => 'respondent')); } + // MUtil_Echo::track(get_class($this->loader->getUser('super', null))); $form = $this->_getLoginForm(); if ($this->_request->isPost()) { if ($form->isValid($_POST, false)) { + /* + if ($user = $this->loader->getUser($_POST['userlogin'], $_POST['organization'])) { + + } // */ + if (isset($this->project->admin) && $this->project->admin['user'] == $_POST['userlogin'] && $this->project->admin['pwd'] == $_POST['password']) { $this->session->user_id = 2000; $this->session->user_name = $_POST['userlogin']; Modified: branches/newUser/classes/Gems/Loader/LoaderAbstract.php =================================================================== --- trunk/library/classes/Gems/Loader/LoaderAbstract.php 2011-10-17 13:51:03 UTC (rev 112) +++ branches/newUser/classes/Gems/Loader/LoaderAbstract.php 2011-10-18 16:35:34 UTC (rev 113) @@ -154,7 +154,7 @@ { // echo '_loadClassPath: ' . $this->cascade . '-' . $classname . '-' . ($create ? 1 : 0) . "<br/>\n"; // debug_print_backtrace(); - // MUtil_Echo::r($filepath, $classname, $this->cascade); + // MUtil_Echo::track($filepath, $classname, $this->cascade); if (file_exists($filepath)) { if (! class_exists($classname)) { Modified: branches/newUser/classes/Gems/Loader.php =================================================================== --- trunk/library/classes/Gems/Loader.php 2011-10-17 13:51:03 UTC (rev 112) +++ branches/newUser/classes/Gems/Loader.php 2011-10-18 16:35:34 UTC (rev 113) @@ -90,6 +90,12 @@ /** * + * @var Gems_User_UserLoader + */ + protected $userLoader; + + /** + * * @var Gems_Util */ protected $util; @@ -177,6 +183,28 @@ /** * + * @param string $login_name + * @param int $organization Only used when more than one organization uses this $login_name + * @return Gems_User_UserInterface + */ + public function getUser($login_name, $organization) + { + $loader = $this->getUserLoader(); + + return $loader->getUser($login_name, $organization); + } + + /** + * + * @return Gems_User_UserLoader + */ + protected function getUserLoader() + { + return $this->_getClass('userLoader', 'User_UserLoader'); + } + + /** + * * @return Gems_Util */ public function getUtil() Modified: branches/newUser/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-10-17 13:51:03 UTC (rev 112) +++ branches/newUser/classes/GemsEscort.php 2011-10-18 16:35:34 UTC (rev 113) @@ -207,7 +207,7 @@ * * Use $this->acl to access afterwards * - * @return Zend_View + * @return MUtil_Acl */ protected function _initAcl() { Modified: branches/newUser/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-17 13:51:03 UTC (rev 112) +++ branches/newUser/configs/db/patches.sql 2011-10-18 16:35:34 UTC (rev 113) @@ -203,4 +203,14 @@ -- PATCH: Assign maintenance mode toggle to super role UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; --- GEMS VERSION: 42 \ No newline at end of file +-- GEMS VERSION: 42 +-- PATCH: New user login structure +INSERT INTO gems__users (gsu_id_user, gsu_login, gsu_id_organization, gsu_user_class, gsu_active, + gsu_password, gsu_failed_logins, gsu_last_failed, gsu_reset_key, gsu_reset_requested, gsu_reset_required, + gsu_changed, gsu_changed_by, gsu_created, gsu_created_by) + SELECT grs_id_user, gr2o_patient_nr, gr2o_id_organization, 'RespondentUser', CASE WHEN gr2o_reception_code = 'OK' THEN 1 ELSE 0 END, + NULL, 0, NULL, NULL, NULL, 0, + gr2o_changed, gr2o_changed_by, gr2o_created, gr2o_created_by + FROM gems__respondents INNER JOIN gems__respondent2org ON grs_id_user = gr2o_id_user + INNER JOIN gems__organizations ON gr2o_id_organization = gor_id_organization + WHERE gor_name = 'HCU / Xpert Clinic'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 13:51:12
|
Revision: 112 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=112&view=rev Author: mennodekker Date: 2011-10-17 13:51:03 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Version -> 1.5, patchlevel -> 42 Modified Paths: -------------- trunk/library/classes/Gems/Versions.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__patch_levels.10.sql Modified: trunk/library/classes/Gems/Versions.php =================================================================== --- trunk/library/classes/Gems/Versions.php 2011-10-17 13:41:18 UTC (rev 111) +++ trunk/library/classes/Gems/Versions.php 2011-10-17 13:51:03 UTC (rev 112) @@ -43,12 +43,12 @@ { public final function getBuild() { - return 41; + return 42; } public final function getGemsVersion() { - return '1.4.3'; + return '1.5'; } public function getProjectVersion() Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-17 13:41:18 UTC (rev 111) +++ trunk/library/configs/db/patches.sql 2011-10-17 13:51:03 UTC (rev 112) @@ -201,4 +201,6 @@ ALTER TABLE gems__tracks CHANGE gtr_organisations gtr_organizations varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; -- PATCH: Assign maintenance mode toggle to super role -UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; \ No newline at end of file +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; + +-- GEMS VERSION: 42 \ No newline at end of file Modified: trunk/library/configs/db/tables/gems__patch_levels.10.sql =================================================================== --- trunk/library/configs/db/tables/gems__patch_levels.10.sql 2011-10-17 13:41:18 UTC (rev 111) +++ trunk/library/configs/db/tables/gems__patch_levels.10.sql 2011-10-17 13:51:03 UTC (rev 112) @@ -11,5 +11,5 @@ INSERT INTO gems__patch_levels (gpl_level, gpl_created) VALUES - (41, CURRENT_TIMESTAMP); + (42, CURRENT_TIMESTAMP); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 13:41:27
|
Revision: 111 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=111&view=rev Author: mennodekker Date: 2011-10-17 13:41:18 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Released 1.4.3 Added Paths: ----------- tags/1.4.3/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 13:21:35
|
Revision: 110 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=110&view=rev Author: mennodekker Date: 2011-10-17 13:21:23 +0000 (Mon, 17 Oct 2011) Log Message: ----------- update languages Modified Paths: -------------- trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-10-17 12:49:26 UTC (rev 109) +++ trunk/library/languages/default-en.po 2011-10-17 13:21:23 UTC (rev 110) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-14 17:00+0100\n" +"POT-Creation-Date: 2011-10-17 15:19+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" +"Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -36,30 +36,40 @@ msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1532 +#: classes/GemsEscort.php:1531 +msgid "Please check back later." +msgstr "Please check back later." + +#: classes/GemsEscort.php:1533 +#: classes/GemsEscort.php:1536 +#: classes/GemsEscort.php:1537 +msgid "System is in maintenance mode" +msgstr "System is in maintenance mode" + +#: classes/GemsEscort.php:1551 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1534 -#: classes/GemsEscort.php:1570 +#: classes/GemsEscort.php:1553 +#: classes/GemsEscort.php:1589 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1550 +#: classes/GemsEscort.php:1569 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1552 +#: classes/GemsEscort.php:1571 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "Access to this page is not allowed for current role: %s." -#: classes/GemsEscort.php:1557 -#: classes/GemsEscort.php:1568 +#: classes/GemsEscort.php:1576 +#: classes/GemsEscort.php:1587 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1558 +#: classes/GemsEscort.php:1577 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -1480,19 +1490,19 @@ msgid "Version information" msgstr "Version information" -#: classes/Gems/Default/ProjectInformationAction.php:140 +#: classes/Gems/Default/ProjectInformationAction.php:151 msgid "Server PHP Info" msgstr "Server PHP Info" -#: classes/Gems/Default/ProjectInformationAction.php:153 +#: classes/Gems/Default/ProjectInformationAction.php:164 msgid "Project settings" msgstr "Project settings" -#: classes/Gems/Default/ProjectInformationAction.php:160 +#: classes/Gems/Default/ProjectInformationAction.php:171 msgid "Session content" msgstr "Session content" -#: classes/Gems/Default/ProjectInformationAction.php:161 +#: classes/Gems/Default/ProjectInformationAction.php:172 msgid "Session" msgstr "Session" @@ -2517,49 +2527,53 @@ msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:394 +#: classes/Gems/Menu/MenuAbstract.php:303 +msgid "Maintenance mode" +msgstr "Maintenance mode" + +#: classes/Gems/Menu/MenuAbstract.php:395 msgid "Check status" msgstr "Check status" -#: classes/Gems/Menu/MenuAbstract.php:395 +#: classes/Gems/Menu/MenuAbstract.php:396 msgid "Synchronize surveys" msgstr "Synchronize surveys" -#: classes/Gems/Menu/MenuAbstract.php:396 -#: classes/Gems/Menu/MenuAbstract.php:407 +#: classes/Gems/Menu/MenuAbstract.php:397 +#: classes/Gems/Menu/MenuAbstract.php:408 msgid "Check answers" msgstr "Check answers" -#: classes/Gems/Menu/MenuAbstract.php:397 +#: classes/Gems/Menu/MenuAbstract.php:398 msgid "Synchronize all surveys" msgstr "Synchronize all surveys" -#: classes/Gems/Menu/MenuAbstract.php:398 -#: classes/Gems/Menu/MenuAbstract.php:408 +#: classes/Gems/Menu/MenuAbstract.php:399 +#: classes/Gems/Menu/MenuAbstract.php:409 msgid "Check all answers" msgstr "Check all answers" -#: classes/Gems/Menu/MenuAbstract.php:404 +#: classes/Gems/Menu/MenuAbstract.php:405 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:438 +#: classes/Gems/Menu/MenuAbstract.php:439 msgid "Check assignments" msgstr "Check assignments" -#: classes/Gems/Menu/MenuAbstract.php:441 +#: classes/Gems/Menu/MenuAbstract.php:442 msgid "Check all assignments" msgstr "Check all assignments" -#: classes/Gems/Menu/SubMenuItem.php:386 +#: classes/Gems/Menu/SubMenuItem.php:396 msgid "New" msgstr "New" -#: classes/Gems/Menu/SubMenuItem.php:440 +#: classes/Gems/Menu/SubMenuItem.php:450 msgid "Export the current data set to Excel" msgstr "Export the current data set to Excel" -#: classes/Gems/Menu/SubMenuItem.php:444 +#: classes/Gems/Menu/SubMenuItem.php:454 msgid "Excel export" msgstr "Excel export" @@ -3527,6 +3541,10 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." +#: views/scripts/index/login.phtml:12 +msgid "The Pulse software was made possible thanks to support from " +msgstr "The Pulse software was made possible thanks to support from " + #~ msgid "ACL" #~ msgstr "ACL" @@ -3557,9 +3575,6 @@ #~ msgid "No logged errors found." #~ msgstr "No logged errors found." -#~ msgid "The Pulse software was made possible thanks to support from " -#~ msgstr "The Pulse software was made possible thanks to support from " - #~ msgid "Email" #~ msgstr "Email" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-10-17 12:49:26 UTC (rev 109) +++ trunk/library/languages/default-nl.po 2011-10-17 13:21:23 UTC (rev 110) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-14 17:00+0100\n" +"POT-Creation-Date: 2011-10-17 15:19+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" +"Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -36,30 +36,40 @@ msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer de gegevens en probeer a.u.b. opnieuw." -#: classes/GemsEscort.php:1532 +#: classes/GemsEscort.php:1531 +msgid "Please check back later." +msgstr "Probeer het later opnieuw." + +#: classes/GemsEscort.php:1533 +#: classes/GemsEscort.php:1536 +#: classes/GemsEscort.php:1537 +msgid "System is in maintenance mode" +msgstr "Systeem is in onderhoudsmodus" + +#: classes/GemsEscort.php:1551 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1534 -#: classes/GemsEscort.php:1570 +#: classes/GemsEscort.php:1553 +#: classes/GemsEscort.php:1589 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1550 +#: classes/GemsEscort.php:1569 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1552 +#: classes/GemsEscort.php:1571 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "U heeft geen toegang tot deze pagina. Uw huidige rol is: %s." -#: classes/GemsEscort.php:1557 -#: classes/GemsEscort.php:1568 +#: classes/GemsEscort.php:1576 +#: classes/GemsEscort.php:1587 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1558 +#: classes/GemsEscort.php:1577 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -1480,19 +1490,19 @@ msgid "Version information" msgstr "Versie informatie" -#: classes/Gems/Default/ProjectInformationAction.php:140 +#: classes/Gems/Default/ProjectInformationAction.php:151 msgid "Server PHP Info" msgstr "Server PHP Info" -#: classes/Gems/Default/ProjectInformationAction.php:153 +#: classes/Gems/Default/ProjectInformationAction.php:164 msgid "Project settings" msgstr "Project instellingen" -#: classes/Gems/Default/ProjectInformationAction.php:160 +#: classes/Gems/Default/ProjectInformationAction.php:171 msgid "Session content" msgstr "Sessie inhoud" -#: classes/Gems/Default/ProjectInformationAction.php:161 +#: classes/Gems/Default/ProjectInformationAction.php:172 msgid "Session" msgstr "Sessie" @@ -2517,49 +2527,53 @@ msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:394 +#: classes/Gems/Menu/MenuAbstract.php:303 +msgid "Maintenance mode" +msgstr "Onderhoudsmodus" + +#: classes/Gems/Menu/MenuAbstract.php:395 msgid "Check status" msgstr "Status controle" -#: classes/Gems/Menu/MenuAbstract.php:395 +#: classes/Gems/Menu/MenuAbstract.php:396 msgid "Synchronize surveys" msgstr "Synchroniseer vragenlijsten" -#: classes/Gems/Menu/MenuAbstract.php:396 -#: classes/Gems/Menu/MenuAbstract.php:407 +#: classes/Gems/Menu/MenuAbstract.php:397 +#: classes/Gems/Menu/MenuAbstract.php:408 msgid "Check answers" msgstr "Antwoord controle" -#: classes/Gems/Menu/MenuAbstract.php:397 +#: classes/Gems/Menu/MenuAbstract.php:398 msgid "Synchronize all surveys" msgstr "Synchroniseer alle vragenlijsten" -#: classes/Gems/Menu/MenuAbstract.php:398 -#: classes/Gems/Menu/MenuAbstract.php:408 +#: classes/Gems/Menu/MenuAbstract.php:399 +#: classes/Gems/Menu/MenuAbstract.php:409 msgid "Check all answers" msgstr "Controleer alle antwoorden" -#: classes/Gems/Menu/MenuAbstract.php:404 +#: classes/Gems/Menu/MenuAbstract.php:405 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:438 +#: classes/Gems/Menu/MenuAbstract.php:439 msgid "Check assignments" msgstr "Controleer toewijzingen" -#: classes/Gems/Menu/MenuAbstract.php:441 +#: classes/Gems/Menu/MenuAbstract.php:442 msgid "Check all assignments" msgstr "Controleer alle toewijzingen" -#: classes/Gems/Menu/SubMenuItem.php:386 +#: classes/Gems/Menu/SubMenuItem.php:396 msgid "New" msgstr "Nieuw" -#: classes/Gems/Menu/SubMenuItem.php:440 +#: classes/Gems/Menu/SubMenuItem.php:450 msgid "Export the current data set to Excel" msgstr "Exporteer de huidige gegevens naar Excel" -#: classes/Gems/Menu/SubMenuItem.php:444 +#: classes/Gems/Menu/SubMenuItem.php:454 msgid "Excel export" msgstr "Excel export" @@ -3527,6 +3541,10 @@ msgid "This track can be assigned since %s." msgstr "Dit traject kan sinds %s aan een patiënt toegewezen worden." +#: views/scripts/index/login.phtml:12 +msgid "The Pulse software was made possible thanks to support from " +msgstr "De PULSE software is mede mogelijk gemaakt met steun van " + #~ msgid "ACL" #~ msgstr "ACL" @@ -3557,9 +3575,6 @@ #~ msgid "No logged errors found." #~ msgstr "Geen foutmeldingen gevonden." -#~ msgid "The Pulse software was made possible thanks to support from " -#~ msgstr "De PULSE software is mede mogelijk gemaakt met steun van " - #~ msgid "Email" #~ msgstr "Email" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 12:49:33
|
Revision: 109 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=109&view=rev Author: mennodekker Date: 2011-10-17 12:49:26 +0000 (Mon, 17 Oct 2011) Log Message: ----------- DocBlock fix Modified Paths: -------------- trunk/library/classes/Gems/Tracker/TrackerInterface.php Modified: trunk/library/classes/Gems/Tracker/TrackerInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/TrackerInterface.php 2011-10-17 12:18:08 UTC (rev 108) +++ trunk/library/classes/Gems/Tracker/TrackerInterface.php 2011-10-17 12:49:26 UTC (rev 109) @@ -60,8 +60,7 @@ * @subpackage Tracker * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @since Class available since version 1.0 - * @deprecated Class deprecated since version 2.0 + * @since Class available since version 1.4 */ interface Gems_Tracker_TrackerInterface { /** @@ -75,7 +74,7 @@ * @return array of translated messages */ public function checkTrackRounds($userId = null, $cond = null); - + /** * Create a new track for a patient * @@ -91,7 +90,7 @@ /** * Creates a new token with a new random token Id - * + * * @param array $tokenData The other new data for the token * @param int $userId Id of the user who takes the action (for logging) * @return string @@ -131,7 +130,7 @@ /** * Retrieve a SourceInterface with a given id - * + * * Should only be called by Gems_Tracker, Gems_Tracker_Survey or Gems_Tracker_Token (or should * this one use Gems_Tracker_Survey instead?) * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 12:18:19
|
Revision: 108 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=108&view=rev Author: mennodekker Date: 2011-10-17 12:18:08 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Updated #17: Improved database patch a little Modified Paths: -------------- trunk/library/configs/db/patches.sql Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-17 12:10:47 UTC (rev 107) +++ trunk/library/configs/db/patches.sql 2011-10-17 12:18:08 UTC (rev 108) @@ -201,4 +201,4 @@ ALTER TABLE gems__tracks CHANGE gtr_organisations gtr_organizations varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; -- PATCH: Assign maintenance mode toggle to super role -UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super'; \ No newline at end of file +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.maintenance%'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 12:10:53
|
Revision: 107 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=107&view=rev Author: mennodekker Date: 2011-10-17 12:10:47 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Updated #17: Database upgrade to assign needed privilege to super role Modified Paths: -------------- trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__roles.20.sql Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-10-17 12:03:09 UTC (rev 106) +++ trunk/library/configs/db/patches.sql 2011-10-17 12:10:47 UTC (rev 107) @@ -199,3 +199,6 @@ -- GEMS VERSION: 41 -- PATCH: Corrected misspelling of gtr_organisations ALTER TABLE gems__tracks CHANGE gtr_organisations gtr_organizations varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; + +-- PATCH: Assign maintenance mode toggle to super role +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.maintenance') WHERE grl_name = 'super'; \ No newline at end of file Modified: trunk/library/configs/db/tables/gems__roles.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__roles.20.sql 2011-10-17 12:03:09 UTC (rev 106) +++ trunk/library/configs/db/tables/gems__roles.20.sql 2011-10-17 12:10:47 UTC (rev 107) @@ -33,4 +33,4 @@ ('physician','physician','','staff', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('researcher','researcher','pr.invitation,pr.result,pr.islogin','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.role.create,pr.role.edit,pr.language,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); + ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.role.create,pr.role.edit,pr.language,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-10-17 12:03:16
|
Revision: 106 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=106&view=rev Author: mennodekker Date: 2011-10-17 12:03:09 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Fixed #17: Implement maintenance mode where only superadmin are allowed to login Modified Paths: -------------- trunk/library/classes/Gems/Default/ProjectInformationAction.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Menu/SubMenuItem.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Default/ProjectInformationAction.php =================================================================== --- trunk/library/classes/Gems/Default/ProjectInformationAction.php 2011-10-17 11:22:46 UTC (rev 105) +++ trunk/library/classes/Gems/Default/ProjectInformationAction.php 2011-10-17 12:03:09 UTC (rev 106) @@ -135,6 +135,17 @@ $this->_showTable($this->_('Version information'), $data); } + public function maintenanceAction() + { + $lockFile = GEMS_ROOT_DIR . '/var/settings/lock.txt'; + if(file_exists($lockFile)) { + unlink($lockFile); + } else { + touch($lockFile); + } + $this->_forward('index'); + } + public function phpAction() { $this->html->h2($this->_('Server PHP Info')); Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-17 11:22:46 UTC (rev 105) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-17 12:03:09 UTC (rev 106) @@ -300,6 +300,7 @@ $page->addAction($this->_('PHP'), null, 'php'); $page->addAction($this->_('Project'), null, 'project'); $page->addAction($this->_('Session'), null, 'session'); + $page->addAction($this->_('Maintenance mode'), 'pr.maintenance', 'maintenance'); return $page; } Modified: trunk/library/classes/Gems/Menu/SubMenuItem.php =================================================================== --- trunk/library/classes/Gems/Menu/SubMenuItem.php 2011-10-17 11:22:46 UTC (rev 105) +++ trunk/library/classes/Gems/Menu/SubMenuItem.php 2011-10-17 12:03:09 UTC (rev 106) @@ -348,6 +348,16 @@ return null; } + /** + * Add an action to the current subMenuItem + * + * @param string $label The label to display for the menu item + * @param string $privilege The privilege for the item + * @param string $controller What controller to use + * @param string $action The name of the action + * @param array $other Array of extra options for this item, e.g. 'visible', 'allowed', 'class', 'icon', 'target', 'type', 'button_only' + * @return Gems_Menu_SubMenuItem + */ public function addAction($label, $privilege = null, $action = 'index', array $other = array()) { $other['label'] = $label; Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-10-17 11:22:46 UTC (rev 105) +++ trunk/library/classes/GemsEscort.php 2011-10-17 12:03:09 UTC (rev 106) @@ -1519,6 +1519,25 @@ $this->menu = $this->getLoader()->createMenu($this); $this->_updateVariable('menu'); + /** + * Check if we are in maintenance mode or not. This is triggeren by a file in the var/settings + * directory with the name lock.txt + */ + if(file_exists(GEMS_ROOT_DIR . '/var/settings/lock.txt')) { + if ($this->session->user_id && $this->session->user_role !== 'super') { + //Still allow logoff so we can relogin as super + if (!('index' == $request->getControllerName() && 'logoff' == $request->getActionName())) { + $this->setError( + $this->_('Please check back later.'), + 401, + $this->_('System is in maintenance mode')); + } + } else { + $this->getMessenger()->addMessage($this->_('System is in maintenance mode')); + MUtil_Echo::r($this->_('System is in maintenance mode')); + } + } + // Gems does not use index/index if (('index' == $request->getControllerName()) && ('index' == $request->getActionName())) { // Instead Gems routes to the first available menu item when this is the request target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |