diff --git a/README.md b/README.md index 8ac2abc62..51d6d5e6a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ _Preserving history, one page at a time._ This repository contains the code that powers https://www.pgdp.net and other sister DP sites world-wide. +**This branch should not be merged into master.** + +This branch is for pgdp.net-specific production hacks and should not be merged +into master. + ## About Distributed Proofreaders is a web application (written in PHP and backed by a diff --git a/api/v1_projects.inc b/api/v1_projects.inc index 70e842b71..931f3f907 100644 --- a/api/v1_projects.inc +++ b/api/v1_projects.inc @@ -213,7 +213,7 @@ function get_project_fields_with_attr(?string $attr, ?Project $project): array // case of forbidding PMs to search for clearances that they can in fact // see in their individual projects, but we don't want to open up the // ability for them to value-fishing on clearances. - $can_search = is_null($project) && (user_is_a_sitemanager() || user_is_proj_facilitator()); + $can_search = is_null($project) && (user_is_a_sitemanager() || user_is_proj_facilitator() || User::current_username() == 'pg-automation'); if ($can_search || $can_render) { $fields["clearance"] = ["sql_name" => "clearance", "updatable" => true, "queryable" => true]; } diff --git a/dp_branding/dp-logo-500px-white.png b/dp_branding/dp-logo-500px-white.png new file mode 100644 index 000000000..f59e05652 Binary files /dev/null and b/dp_branding/dp-logo-500px-white.png differ diff --git a/dp_branding/dp-logo-500px.png b/dp_branding/dp-logo-500px.png new file mode 100644 index 000000000..d02f629c2 Binary files /dev/null and b/dp_branding/dp-logo-500px.png differ diff --git a/dp_branding/dp-logo-600px-white.png b/dp_branding/dp-logo-600px-white.png new file mode 100644 index 000000000..f672275e8 Binary files /dev/null and b/dp_branding/dp-logo-600px-white.png differ diff --git a/dp_branding/dp-logo-600px.png b/dp_branding/dp-logo-600px.png new file mode 100644 index 000000000..f6186045a Binary files /dev/null and b/dp_branding/dp-logo-600px.png differ diff --git a/dp_branding/dp-logo-Amiri_font.svg b/dp_branding/dp-logo-Amiri_font.svg new file mode 100644 index 000000000..aeeab696b --- /dev/null +++ b/dp_branding/dp-logo-Amiri_font.svg @@ -0,0 +1,517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + Distribute + + d + p + + roofreaders + + Preserving History One Page at a Time. + + diff --git a/dp_branding/dp-logo-bw-500px.png b/dp_branding/dp-logo-bw-500px.png new file mode 100644 index 000000000..33a20d692 Binary files /dev/null and b/dp_branding/dp-logo-bw-500px.png differ diff --git a/dp_branding/dp-logo-bw.svg b/dp_branding/dp-logo-bw.svg new file mode 100644 index 000000000..a2bb56271 --- /dev/null +++ b/dp_branding/dp-logo-bw.svg @@ -0,0 +1,836 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dp_branding/dp-logo-dark.svg b/dp_branding/dp-logo-dark.svg new file mode 100644 index 000000000..8bca64a17 --- /dev/null +++ b/dp_branding/dp-logo-dark.svg @@ -0,0 +1,838 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dp_branding/dp-logo.png b/dp_branding/dp-logo.png new file mode 100644 index 000000000..2ec073f23 Binary files /dev/null and b/dp_branding/dp-logo.png differ diff --git a/dp_branding/dp-logo.svg b/dp_branding/dp-logo.svg new file mode 100644 index 000000000..4f7ecd627 --- /dev/null +++ b/dp_branding/dp-logo.svg @@ -0,0 +1,840 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dp_branding/dp-mark-120px-white.png b/dp_branding/dp-mark-120px-white.png new file mode 100644 index 000000000..eea9caa50 Binary files /dev/null and b/dp_branding/dp-mark-120px-white.png differ diff --git a/dp_branding/dp-mark-120px.png b/dp_branding/dp-mark-120px.png new file mode 100644 index 000000000..6c8d30798 Binary files /dev/null and b/dp_branding/dp-mark-120px.png differ diff --git a/dp_branding/dp-mark-32px-white.png b/dp_branding/dp-mark-32px-white.png new file mode 100644 index 000000000..610d57cb5 Binary files /dev/null and b/dp_branding/dp-mark-32px-white.png differ diff --git a/dp_branding/dp-mark-32px.png b/dp_branding/dp-mark-32px.png new file mode 100644 index 000000000..e30d8b604 Binary files /dev/null and b/dp_branding/dp-mark-32px.png differ diff --git a/dp_branding/dp-mark-400px-white.png b/dp_branding/dp-mark-400px-white.png new file mode 100644 index 000000000..03e94dd73 Binary files /dev/null and b/dp_branding/dp-mark-400px-white.png differ diff --git a/dp_branding/dp-mark-400px.png b/dp_branding/dp-mark-400px.png new file mode 100644 index 000000000..a4ef771c8 Binary files /dev/null and b/dp_branding/dp-mark-400px.png differ diff --git a/dp_branding/dp-mark-64px-white.png b/dp_branding/dp-mark-64px-white.png new file mode 100644 index 000000000..90dcb75b4 Binary files /dev/null and b/dp_branding/dp-mark-64px-white.png differ diff --git a/dp_branding/dp-mark-64px.png b/dp_branding/dp-mark-64px.png new file mode 100644 index 000000000..8505d8ee8 Binary files /dev/null and b/dp_branding/dp-mark-64px.png differ diff --git a/dp_branding/dp-mark.svg b/dp_branding/dp-mark.svg new file mode 100644 index 000000000..452497c2d --- /dev/null +++ b/dp_branding/dp-mark.svg @@ -0,0 +1,115 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/dp_branding/index.php b/dp_branding/index.php new file mode 100644 index 000000000..5348ae538 --- /dev/null +++ b/dp_branding/index.php @@ -0,0 +1,235 @@ +$title"; + +echo "

" . _("Consistent branding and logos are an important part of today's world. This page provides some guidance when referring to Distributed Proofreaders as well as visual assets for both web and print.") . "

"; + +echo "

" . _("Referring to Distributed Proofreaders") . "

"; +echo "

" . _("Distributed Proofreaders refers to the web site at www.pgdp.net. It is governed by the Distributed Proofreaders Foundation. Community members affectionately refer to it as simply 'DP', but use the full 'Distributed Proofreaders' name for clarity when outside the community.") . "

"; + +echo "

" . _("Other entities with similar names:") . "

"; + +echo ""; + +echo "

" . _("Logos and Marks") . "

"; + +echo "

" . _("The following are DP logos and marks that can be used to link back to https://www.pgdp.net. An SVG is included, as well as PNGs at different sizes. Some of the PNGs have a white background and others use a transparent background. Use whichever makes sense for your purposes. If you need different sizes, you are encouraged to generate them from the SVG file, using a program like Inkscape, rather than resizing the PNGs.") . "

"; + +echo "

" . _("For print media, you are encouraged to use the black and white version without the drop shadow. If your design software supports it, use the SVG version for the best output.") . "

"; + +echo "

" . _("The SVG files have had the text changed into paths for best consumability. See Fonts and Colors for what fonts were used.") . "

"; + +echo ""; + +echo "

" . _("SVG files") . "

"; + +echo << + + Transparent
Background, light themes + + + + + + + + dp-logo.svg + + + + Transparent
Background, dark themes + + + + + + + + dp-logo-dark.svg + + + + SVGLOGO; + +echo "

" . _("PNG files") . "

"; + +echo << + + Transparent
Background, light themes + + + + + + + + dp-logo-500px.png + + + + White
Background + + + + + + + + dp-logo-500px-white.png + + + + LOGO; + +echo ""; + +echo "

" . _("SVG file") . "

"; + +echo << + + Transparent
Background + + + + + + + + dp-logo-bw.svg + + + + SVGLOGO; + +echo "

" . _("PNG file") . "

"; + +echo << + + Transparent
Background + + + + + + + + dp-logo-bw-500px.png + + + + LOGO; + +echo "

" . _("Mark") . "

"; + +echo "

" . _("SVG file") . "

"; + +echo << + + Transparent
Background + +
+ + + + + + dp-mark.svg + + + + SVGMARK; + +echo "

" . _("PNG files") . "

"; + +echo << + + Size + Transparent
Background + White
Background + + + 32 x 32 + +
+ dp-mark-32px.png + + +
+ dp-mark-32px-white.png + + + + 64 x 64 + +
+ dp-mark-64px.png + + +
+ dp-mark-64px-white.png + + + + 120 x 120 + +
+ dp-mark-120px.png + + +
+ dp-mark-120px-white.png + + + + 400 x 400 + + dp-mark-400px.png + + + dp-mark-400px-white.png + + + + MARK; + +echo "

" . _("Fonts and Colors") . "

"; + +echo "

" . _("If you are looking to create additional branding assets, here are some guidelines for how the current assets were created.") . "

"; + +echo << +
  • DP blue: #007dc1
  • +
  • Base logo font: Amiri, available for free from Google Fonts
  • +
  • 'Preserving History' font: Times New Roman
  • +
  • DP mark: Garamond
  • +
  • DP logo and mark drop shadow (created with the Drop Shadow filter in Inkscape):
      +
    • Blur radius: 2.0
    • +
    • Horiz offset (px): -3.7
    • +
    • Vertical offset (px): 3.7
    • +
    • Color (RGBA): 00000048
    • +
  • + + ASSETS; diff --git a/index.php b/index.php index 1eeccb4cb..793d05fff 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,42 @@ include_once($relPath.'site_news.inc'); include_once($relPath.'walkthrough.inc'); -output_header(_("Welcome"), SHOW_STATSBAR); +// SITE-SPECIFIC +// Add social media tags to main page for PROD +$extra_args = []; +if (!SiteConfig::get()->testing) { + $extra_args = ['head_data' => << + + + + + + + + + EOF + ]; +} + +output_header(_("Welcome"), SHOW_STATSBAR, $extra_args); $image = get_page_header_image("FRONT"); if ($image) { @@ -111,6 +146,14 @@ . "

    " . "\n"; +echo "

    " + . sprintf( + _("We are unable to provide certification for any purpose that would require Distributed Proofreaders to track the number of hours spent volunteering, or to provide verification of a user's identity beyond that provided by their email address, or to certify that the volunteer personally performed the work. For these reasons, we cannot provide certification for court-ordered community service, programs operated by federal, state, or municipal governments, etc. For more information, please see this page."), + "$wiki_url/DP_Official_Documentation:General/Certification_of_Volunteer_Work" + ) + . "

    " + . "\n"; + // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX echo "\n" diff --git a/phpstan.neon b/phpstan.neon index 35dba7059..4c15cad51 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -38,8 +38,6 @@ parameters: path: pinc/DifferenceEngineWrapper.inc - message: '#Call to function is_array\(\) with array will always evaluate to true.#' path: pinc/3rdparty/mediawiki/WordLevelDiff.php - - message: '#Function get_dpl_enforcement_for_user\(\) never returns null.*#' - path: pinc/daily_page_limit.inc - message: '#Variable .* might not be defined#' - message: '#Constant .* not found#' diff --git a/pinc/Project.inc b/pinc/Project.inc index 8415af491..1ee3eb6c3 100644 --- a/pinc/Project.inc +++ b/pinc/Project.inc @@ -1162,6 +1162,7 @@ class Project $this->can_be_managed_by_current_user || $this->PPVer_is_current_user || ($this->PPer_is_current_user && user_has_DU_access()) + || User::current_username() == 'pg-automation' ); } diff --git a/pinc/ProjectSearchResults.inc b/pinc/ProjectSearchResults.inc index 8c7517f50..45df74494 100644 --- a/pinc/ProjectSearchResults.inc +++ b/pinc/ProjectSearchResults.inc @@ -341,6 +341,9 @@ class OptionsColumn extends Column $actions[] = "" . _("Edit Word Lists") . ""; } + $actions[] = "" . _("Email db-req") . ""; + $actions[] = "" . _("Email dp-format") . ""; + // Should we show an "attention" icon? // Currently, we only do this if suggestions have been added since // the Good Words file was last modified. diff --git a/pinc/ProjectTransition.inc b/pinc/ProjectTransition.inc index c9b6c9571..0c73d6978 100644 --- a/pinc/ProjectTransition.inc +++ b/pinc/ProjectTransition.inc @@ -474,7 +474,7 @@ function create_project_transitions(): array project_restriction: null, action_name: '[default]', confirmation_question: null, - detour: null, + detour: 'gate_on_pqc', settings_template: '', collateral_actions: null, ); diff --git a/pinc/Round.inc b/pinc/Round.inc index 872ee96e4..c9a168889 100644 --- a/pinc/Round.inc +++ b/pinc/Round.inc @@ -515,8 +515,8 @@ function get_reserve_length(Project $project, Round $round): int return 0; } - // Otherwise, reserve for 7 days. - return 7; + // Otherwise, reserve for 14 days. + return 14; } // Anything not covered above diff --git a/pinc/SiteConfig.inc b/pinc/SiteConfig.inc index e01548908..808284c0a 100644 --- a/pinc/SiteConfig.inc +++ b/pinc/SiteConfig.inc @@ -78,7 +78,7 @@ class SiteConfig // AlertExceedsMax -- should be set to true if you wish files that cannot // be scanned at that limit to be rejected. // See `man clamd.conf` for more detailed info - public int $uploads_max_size_mb = 1024; + public int $uploads_max_size_mb = 200; // WordCheck & locales public string $aspell_executable = '/usr/bin/aspell'; @@ -107,9 +107,9 @@ class SiteConfig public ?string $translation_coordinator_email_addr; // New feature deployment timestamps - public int $wordcheck_deployed = 0; - public int $unicode_deployed = 0; - public int $format_preview_tracking_deployed = 0; + public int $wordcheck_deployed = 1173762000; // March 13 2007 + public int $unicode_deployed = 1589785200; // midnight May 18 2020 + public int $format_preview_tracking_deployed = 1765472400; // December 11 2025 // Misc configuration public bool $use_secure_cookies = false; diff --git a/pinc/UserSuggestions.inc b/pinc/UserSuggestions.inc index 92f9f9359..b496cc917 100644 --- a/pinc/UserSuggestions.inc +++ b/pinc/UserSuggestions.inc @@ -407,6 +407,11 @@ class UserSuggestions // fields used here, and in dependent functions, be populated in the row. $project = new ProjectSuggestion($project_row); + // pgdp-production: skip self-evaluation projects + if (stripos($project->nameofwork, "self-evaluation") !== false) { + continue; + } + try { $round = Rounds::get_by_project_state($project->state); validate_user_against_project_reserve($user, $project, $round); diff --git a/pinc/access_change_emails.inc b/pinc/access_change_emails.inc new file mode 100644 index 000000000..9d3d05cd0 --- /dev/null +++ b/pinc/access_change_emails.inc @@ -0,0 +1,249 @@ +site_abbreviation); + + $message[] = sprintf(_("Hello %s,"), $user->username); + + // TRANSLATORS: %s is the site abbreviation (eg: 'DP') + $message[] = sprintf(_("Congratulations! You are now eligible to learn to transform %s projects into their final formats, ready for upload to Project Gutenberg. If you're already familiar with HTML and CSS, it may make learning Post-Processing (PP) somewhat easier, but many prolific Post-Processors (PPers) knew no HTML or CSS when they first started, so if you aren't already familiar with them, don't be discouraged!"), SiteConfig::get()->site_abbreviation); + + $message[] = sprintf(_("We encourage you to start with an easy book and work with an experienced PPer as a mentor. For help in finding a PP mentor, please contact the PPV Coordinator (%s). In addition, all new Post-Processors' work must go through the Post-Processing Verification (PPV) stage, which is another opportunity to pick up valuable tips and tricks. Please avail yourself of the wealth of information in our official documentation and in the Post-Processing forum."), "ppv-coord@pgdp.net"); + + $message[] = _("Here is a list of a few of our resources to get you started:"); + + $message[] = "- " . sprintf( + _("Official documentation page with links to the FAQs and other Post-Processing resources: %s"), + "https://www.pgdp.net/wiki/DP_Official_Documentation:PP_and_PPV" + ); + + $message[] = "- " . sprintf( + _("\"Getting your PP Project Ready for PPV\" document: %s"), + "https://www.pgdp.net/wiki/DP_Official_Documentation:PP_and_PPV/Getting_your_PP_Project_Ready_for_PPV" + ); + + $message[] = "- " . sprintf( + _("Post-Processing Workbench: %s"), + "https://www.pgdp.net/wiki/DP_Official_Documentation:PP_and_PPV/Post-Processing_Workbench" + ); + + $message[] = sprintf( + _("An excellent place to ask Post-Processing-related questions is the forum topic 'The Official \"No Dumb Questions\" thread for PPers': %s"), + "https://www.pgdp.net/phpBB3/viewtopic.php?t=15019" + ); + + $message[] = _("It is important that books don't get stuck in the Post-Processing process, but keep moving towards being posted at Project Gutenberg. As a community, we have a lot invested in each project -- each represents many hours of volunteer work. We are all eager to see each book posted and there is also a risk that that work would be lost should other organizations produce and post a book before we finish."); + + $message[] = sprintf( + _("The site software sends out reminder emails on the first of every month to all Post-Processors who have projects that have been checked out for 90 days or more since they last visited their books' Project Pages. If you receive such a notice, and are still working on the book, or plan to work on it soon, please visit the project page so that it will renew for another 90 days. This is a regular reminder, and not meant to be discouraging. We realize that it may take new Post-Processors longer than it does more experienced PPers to complete their PP work. See %s for more detailed information."), + "https://www.pgdp.net/wiki/DP_Official_Documentation:PP_and_PPV/Post-Processing_FAQ#How_long_can_I_keep_a_book_checked_out.3F" + ); + + // TRANSLATORS: %s is the site name (eg: 'Distributed Proofreaders') + $message[] = sprintf(_("Thank you for deciding to work as a Post-Processor! Although the work can be daunting at first, it can be the most rewarding and motivating activity here at %s."), SiteConfig::get()->site_name); + + $email = $user->email; + $message_string = implode("\n\n", $message); + + $mail_accepted = send_mail($email, $subject, $message_string, null, SiteConfig::get()->db_requests_email_addr); + + // restore gettext to current user's locale + configure_gettext_for_user(); +} + +function p2_access_change_email(User $user, string $access_change): void +{ + $daily_limit = get_Round_for_round_id('P2')->daily_page_limit; + + // only send emails on grant + if ($access_change != "grant") { + return; + } + + // configure gettext to translate user email + configure_gettext_for_user($user); + + // TRANSLATORS: %s is the site abbreviation (eg: 'DP') + $subject = sprintf(_("%s: Welcome to P2 Proofreading"), SiteConfig::get()->site_abbreviation); + + $message[] = sprintf(_("Hello %s,"), $user->username); + + $message[] = _("Congratulations! You may now work in P2, the second proofreading round."); + + $message[] = "== " . _("Compared to P1, what remains the same?") . " =="; + + $message[] = _("The Proofreading Guidelines are exactly the same, and you still need to comply with the Project Comments and Project Discussion guidance for every project."); + + $message[] = _("Please keep aiming to leave every page as perfect as you can."); + + $message[] = "== " . _("What is expected in P2?") . " =="; + + $message[] = "- " . sprintf( + _("Using WordCheck is compulsory in P2 and P3, and pages that have not been WordChecked may be removed from your record. See %s for information about WordCheck"), + "https://www.pgdp.net/wiki/DP_Official_Documentation:Proofreading/WordCheck_FAQ" + ); + + $message[] = _("It is important to be aware that, when you work in P2, you set an example to P1 proofreaders: they will be checking their diffs to see how you changed their work. Make sure that you don't mislead them."); + + $message[] = _("If you remember how your mentor guided you when you started, you may consider giving gentle feedback in a private message to new proofreaders when you see them making repeated errors."); + + $message[] = _("The text you worked on in P1 was generated from the page images by means of software tools. When you work in P2, however, you are working on text that someone else has already proofread. Nevertheless, please check every character and word carefully, since new P1s, unfamiliar with our guidelines, may have left errors."); + + if ($daily_limit) { + $message[] = sprintf(_("Please keep in mind that we currently have a limit in P2 of no more than %d pages per day. This is a daily limit, not an average; the limit is there to make sure that we have a variety of projects available in the round at all times."), $daily_limit); + // The above paragraph will be added to the email only if the daily limit + // is a positive integer. Currently, if the daily limit value is zero or + // NULL, the paragraph is not added. This code will need to be adjusted + // if there is ever a need for them to be treated differently. + } + + $message[] = "== " . _("What resources are available?") . " =="; + + $message[] = "- " . sprintf(_("You may ask for help at dp-feedback ( %s ), giving the name of the project, the round you worked in, and the png numbers of the pages you would like to have reviewed."), "https://www.pgdp.net/phpBB3/ucp.php?i=pm&mode=compose&u=37603"); + + $message[] = "- " . sprintf(_("If you haven't yet, try using DP's Proofreading Font: %s"), "https://www.pgdp.net/c/faq/font_sample.php"); + + $message[] = "- " . sprintf(_("When the diffs for your pages become available, check your diffs: %1\$s . You can easily check diffs with the Review Work tool: %2\$s"), "https://www.pgdp.net/wiki/DP_Official_Documentation:Proofreading/Checking_your_diffs", "https://www.pgdp.net/c/tools/proofers/review_work.php?work_round_id=P2&review_round_id=P3&days=100&sample_limit=0"); + + $message[] = "- " . sprintf(_("For a quick refresher, consider redoing the proofreading quizzes: %s"), "https://www.pgdp.net/c/quiz/start.php?show_only=PQ"); + + $message[] = _("If you have questions, there are several options:"); + + $message[] = "- " . _("For questions specific to a project you're working on, please post your question in the project's Project Discussion. There's a link to this on each project's main Project Page on the line reading \"Forum\"."); + + $message[] = "- " . sprintf( + _("If you have a general question, you can post in the \"Common Proofreading Q&A\" Forum: %s"), + "https://www.pgdp.net/phpBB3/viewforum.php?f=19" + ); + + $message[] = "- " . _("If you don't know whether the question is a general question or specific to the project, you should start by asking in the Project Discussion."); + + $message[] = "- " . _("If you'd rather ask a question privately or would like more information on proofreading in general, you can send a Private Message to one of the following volunteers:") . + "\n Bess (Bess): https://www.pgdp.net/phpBB3/ucp.php?i=pm&mode=compose&u=101542" . + "\n jjz (Jacqueline): https://www.pgdp.net/phpBB3/ucp.php?i=pm&mode=compose&u=15578"; + + $message[] = "== " . _("What could possibly go wrong?") . " =="; + + $message[] = "- " . _("Getting the Proofreading and Formatting Guidelines mixed up."); + + $message[] = "- " . _("Proofreading too fast! Proofread each page slowly enough to carefully compare the original scan with the proofing text."); + + $message[] = "- " . _("Forgetting to read the specific project comments, and not checking for new posts in the project discussion."); + + $message[] = "- " . _("Forgetting to use WordCheck."); + + // TRANSLATORS: %s is the site name (eg: 'Distributed Proofreaders') + $message[] = sprintf(_("Again, please don't hesitate to ask if you have questions, and thanks for volunteering at %s."), SiteConfig::get()->site_name); + + $email = $user->email; + $message_string = implode("\n\n", $message); + + $mail_accepted = send_mail($email, $subject, $message_string); + + // restore gettext to current user's locale + configure_gettext_for_user(); +} + +function f1_access_change_email(User $user, string $access_change): void +{ + $daily_limit = get_Round_for_round_id('F1')->daily_page_limit; + + // only send emails on grant + if ($access_change != "grant") { + return; + } + + // configure gettext to translate user email + configure_gettext_for_user($user); + + // TRANSLATORS: %s is the site abbreviation (eg: 'DP') + $subject = sprintf(_("%s: Welcome to F1 Formatting"), SiteConfig::get()->site_abbreviation); + + $message[] = sprintf(_("Hello %s,"), $user->username); + + $message[] = _("Congratulations! You may now work in F1, the first round of formatting."); + + $message[] = _("Formatting is the process of adding tags to a project for items such as italics, boldface, small capitals, footnotes, illustrations, poetry and block quotes, as well as appropriate spacing for chapter and section headers, etc. The tags and spacing will assist the Post-Processor in producing an ebook."); + + $message[] = _("After all of the pages of a project are completed in F1, the project moves into F2 for review and any needed corrections. F2 is the final round of formatting before Post-Processing."); + + if ($daily_limit) { + $message[] = "***" . sprintf(_("Please keep in mind that we currently have a limit in F1 of no more than %d pages per day."), $daily_limit) . "*** " . + _("(This is a daily limit, not an average.) The limit is there to make sure that we have a variety of projects available in the round at all times."); + // The above paragraph will be added to the email only if the daily limit + // is a positive integer. Currently, if the daily limit value is zero or + // NULL, the paragraph is not added. This code will need to be adjusted + // if there is ever a need for them to be treated differently. + } + + $message[] = sprintf( + _("Before you begin formatting, please read through the Formatting Guidelines: %1\$s . You may also view and print our two-page Formatting Summary: %2\$s to keep on hand while you're formatting. The Guidelines contain a lot of information, so please take your time and ask questions if there's something you don't understand."), + "https://www.pgdp.net/wiki/DP_Official_Documentation:Formatting/Formatting_Guidelines", + "https://www.pgdp.net/c/faq/formatting_summary.pdf" + ); + + $message[] = _("If you have questions, there are several options:"); + + $message[] = "- " . _("For questions specific to a project you're working on, please post your question in the project's Project Discussion. There's a link to this on each project's main Project Page on the line reading \"Forum.\""); + + $message[] = "- " . sprintf( + _("If you have a general question, you can post in the \"Common Formatting Q&A\" Forum: %s"), + "https://www.pgdp.net/phpBB3/viewforum.php?f=34" + ); + + $message[] = "- " . _("If you don't know whether the question is a general question or specific to the project, start by asking in the Project Discussion."); + + $message[] = "- " . _("If you'd rather ask a question privately or would like more information on formatting in general, you can send a Private Message to one of our F2 Evaluators:") . + "\n cmspence (Carol): https://www.pgdp.net/phpBB3/ucp.php?i=pm&mode=compose&u=69533" . + "\n K7UQT (Lisa): https://www.pgdp.net/phpBB3/ucp.php?i=pm&mode=compose&u=24945"; + + + $message[] = "== " . _("Here is a list of important tips and resources to get you started:") . " =="; + + $message[] = "- ***" . _("Please use the Format Preview tool on each page.") . "*** " . + sprintf( + _("Each time you format a page (but before you save it as Done), click on the Format Preview button. This will highlight many common formatting problems so that you may fix them before saving the page. The Format Preview button is labelled \"Preview\" and is found in the rows of buttons below the formatting window. (If your buttons display as icons, the Format Preview icon is a red \"F\" with checkmark.) For more information about this tool, see: %s"), + "https://www.pgdp.net/wiki/Format_Preview" + ); + + $message[] = "- " . _("Always use the formatting shortcut buttons when adding formatting tags. Manually typing in the tags is more time-consuming and prone to error. To use the shortcut buttons, highlight the text you need to add tags around (using your mouse or keyboard arrows) and click on the appropriate button. The buttons are found along the bottom of the formatting interface."); + + $message[] = "- " . _("If you accidentally add incorrect inline tags, highlight the text again, and click on the button labelled with a horizontal line through the middle. This removes inline formatting only (such as italics, bold, small caps, etc.), but does not affect illustration, footnote, blockquote, nowrap, or other non-inline tagging."); + + $message[] = "- " . sprintf( + _("Check out our F1 Self Evaluation Project: %s . It's an easy way to gain formatting experience without working on a 'live' project. You may want to start with this before working on a regular F1 project. Please read the instructions on the Project Page carefully before you begin."), + "https://www.pgdp.net/c/project.php?id=projectID50cd68d39b208" + ); + + $message[] = "- " . sprintf( + _("Once you've become familiar with the Formatting Guidelines, you may want to look through our Library of Formatting Examples (LoFE), which is found in the Formatting forums here: %s . While the LoFE should not be used in place of the Guidelines, it's a useful resource for common formatting issues that may not be covered completely by the Guidelines."), + "https://www.pgdp.net/phpBB3/viewtopic.php?f=34&t=47569" + ); + + $message[] = "- " . sprintf( + _("It's good practice to check your 'diffs' each day to see what changes have been made on your pages after they've been reviewed in F2 so that you can improve your skills. You can easily check diffs with the Review Work tool: %s"), + "https://www.pgdp.net/c/tools/proofers/review_work.php?work_round_id=F1&review_round_id=F2&days=100&sample_limit=0" + ); + + // TRANSLATORS: %s is the site name (eg: 'Distributed Proofreaders') + $message[] = sprintf(_("Again, please don't hesitate to ask if you have questions, and thanks for volunteering at %s."), SiteConfig::get()->site_name); + + $email = $user->email; + $message_string = implode("\n\n", $message); + + $mail_accepted = send_mail($email, $subject, $message_string); + + // restore gettext to current user's locale + configure_gettext_for_user(); +} diff --git a/pinc/autorelease.inc b/pinc/autorelease.inc index 5860a3c8b..a4acb2900 100644 --- a/pinc/autorelease.inc +++ b/pinc/autorelease.inc @@ -451,7 +451,8 @@ class ReleaseRestrictor public function approves_project(array $project): bool { $is_special = !empty($project['special_code']); - if ($is_special) { + // temp hack - enable "no duplicate author" restriction for Childrens Book Week and type-in projects + if ($is_special && ($project['special_code'] != 'ChBookWk') && ($project['special_code'] != 'TypeInProject')) { echo " It's special, so it's exempt from release restrictions.\n"; return true; } diff --git a/pinc/daily_page_limit.inc b/pinc/daily_page_limit.inc index 04b011e62..b4b17a70b 100644 --- a/pinc/daily_page_limit.inc +++ b/pinc/daily_page_limit.inc @@ -49,9 +49,16 @@ function get_dpl_count_for_user_in_round(string $username, Round $round): int */ function get_dpl_enforcement_for_user(string $username, Round $round, Project $project): ?int { - // This function is a placeholder for sites to add any per-project - // customizations that might bypass the DPL enforcement. So while it - // doesn't currently return null, it might after site-specific updates. + // pgdp-production - projects with some primary languages bypass DPL + $dpl_exempt_languages = [ + "French", + "French, Middle (ca.1400-1600)", + "French, Old (842-ca.1400)", + "Portuguese", + ]; + if (in_array($project->languages[0], $dpl_exempt_languages)) { + return null; + } return get_dpl_count_for_user_in_round($username, $round); } diff --git a/pinc/gradual.inc b/pinc/gradual.inc index 6ebb4dfb1..5858c2685 100644 --- a/pinc/gradual.inc +++ b/pinc/gradual.inc @@ -337,6 +337,12 @@ function encourage_highest_round(?string $username, ?string $round_id = null): v return; } + // pgdp-production: don't encourage proofreaders to apply to P3 or F2 + // just yet, as we want to add checks against access_log first + if (in_array($round->id, ["P3", "F2"])) { + continue; + } + // They're already eligible but have not requested access, tell them. $uao = $round->user_access($username); if ($uao->all_minima_satisfied) { diff --git a/pinc/graph_data.inc b/pinc/graph_data.inc index 493a001fe..2ca706444 100644 --- a/pinc/graph_data.inc +++ b/pinc/graph_data.inc @@ -579,7 +579,9 @@ function total_pages_by_month_graph(string $tally_name): array /////////////////////////////////////////////////// //Total pages by month since beginning of stats - $data = get_site_tally_grouped($tally_name, 'year_month'); + $min_timestamp = $tally_name == 'R*' ? 1110960000 : null; + + $data = get_site_tally_grouped($tally_name, 'year_month', $min_timestamp); $datax = array_column($data, 0); $datay1 = array_column($data, 1); $datay2 = array_column($data, 2); @@ -671,6 +673,16 @@ function pages_daily(string $tally_name, string $c_or_i, string $timeframe): arr throw new UnexpectedValueException("bad 'cori' value: '$c_or_i'"); } + if ($tally_name == 'R*' and $timeframe == 'all_time') { + if ($c_or_i == 'increments') { + $start_timestamp = 1110960000; + } else { + $start_timestamp = 1110960000 - 10; + } + $end_timestamp = mktime(0, 0, 0, 6, 8, 2005); + $title_timeframe = _('since we started keeping track'); + } + $days_to_average = 21; [$datax, $pages, $goal, $moving_average] = get_site_tally_cumulative_or_incremental( diff --git a/pinc/new_user_mails.inc b/pinc/new_user_mails.inc index 6260216bb..0ca4565e5 100644 --- a/pinc/new_user_mails.inc +++ b/pinc/new_user_mails.inc @@ -125,6 +125,11 @@ function send_welcome_mail(string $email, string $real_name, string $username): Later you should also read the full Proofreading Guidelines: $dp_wiki_url/DP_Official_Documentation:Proofreading/Proofreading_Guidelines + Before starting proofreading, you will need to successfully complete all + five pages of the interactive proofreading quiz, and are encouraged to read + through their associated tutorials: + $code_url/quiz/start.php?show_level=P_BASIC + $feedback_paragraph #### Start Smooth Reading diff --git a/pinc/page_tally.inc b/pinc/page_tally.inc index 346ef4730..81ea684f0 100644 --- a/pinc/page_tally.inc +++ b/pinc/page_tally.inc @@ -21,6 +21,7 @@ include_once($relPath.'User.inc'); function get_page_tally_names(): array { $page_tally_names = []; + $page_tally_names['R*'] = _('Pages saved-as-done in old rounds R1+R2'); foreach (Rounds::get_all() as $round) { $page_tally_names[$round->id] = sprintf(_('Pages saved-as-done in round %s'), $round->id); diff --git a/pinc/quals.inc b/pinc/quals.inc new file mode 100644 index 000000000..3f09c710e --- /dev/null +++ b/pinc/quals.inc @@ -0,0 +1,73 @@ +" . sprintf(_("%s Qualifying Projects"), $qual_type) . ""; + + switch ($round) { + case 'P2': + case 'F1': + echo "

    " . _("The following projects are currently available:") . "

    "; + break; + case 'P3': + case 'F2': + echo "

    " . sprintf(_("Your help in proofreading these %s Qualifier projects would be greatly appreciated:"), $round) . "

    "; + break; + } + + echo "
      "; + foreach ($projectids as $projectid) { + $project = new Project($projectid); + $proj_url = ""; + echo "
    • "; + echo ""; + echo html_safe($project->nameofwork); + echo " — ({$project->language}) {$project->n_available_pages} pp. available."; + echo "
    • "; + } + echo "
    "; + + // Post list caveats, etc. can be inserted here + switch ($round) { + case 'P2': + case 'F1': + echo "

    " . sprintf(_("%1\$s Qualifying projects are for volunteers who are preparing to apply for %1\$s access."), $qual_type) . "

    "; + echo "

    " . sprintf(_("Please make sure you have satisfied the %2\$s entrance requirements before applying.

    "), "$code_url/tools/proofers/round.php?round_id=$qual_type#Entrance_Requirements", $qual_type) . "

    "; + break; + case 'P3': + case 'F2': + echo "

    " . sprintf(_("Thank you very much for your help with the %s Quals!"), $qual_type) . "

    "; + break; + } +} diff --git a/pinc/quizzes.inc b/pinc/quizzes.inc index 15195526f..29b7be4bc 100644 --- a/pinc/quizzes.inc +++ b/pinc/quizzes.inc @@ -126,7 +126,7 @@ new QuizLevel( "proof", "

    " . sprintf(_("This section covers topics that are not addressed in the proofreading guidelines. The pages include items that you are likely to see when proofreading HARD (and some Average) projects."), get_faq_url("proofreading_guidelines.php")) . "

    \n

    " . - _("If you are not yet familiar with a topic, you can learn about it by using the tutorial mode or following the \"Information\" link for that topic.") . + _("The following quizzes are not required, but can be useful. If you are not yet familiar with a topic, you can learn about it by using the tutorial mode or following the \"Information\" link for that topic.") . "

    ", [ diff --git a/pinc/stages.inc b/pinc/stages.inc index b89b2bb61..633579a3b 100644 --- a/pinc/stages.inc +++ b/pinc/stages.inc @@ -9,6 +9,7 @@ include_once($relPath.'Pool.inc'); include_once($relPath.'ProjectState.inc'); include_once($relPath.'forum_interface.inc'); // get_url_to_view_forum() include_once($relPath.'faq.inc'); +include_once($relPath.'access_change_emails.inc'); // pp_access_change_email(), f1_access_change_email() // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -32,14 +33,14 @@ $pi_tools_for_F = [ new Round( 'P1', _('Proofreading Round 1'), - [], - 'IMMEDIATE', + ['quiz/p_basic' => 1], + 'REQ-AUTO', '', null, // access_change_callback _("The page-texts are the output from OCR software and need to have the text carefully compared to the image."), 'proofreading_guidelines.php', $pi_tools_for_P, - null, // daily_page_limit + 60, // daily_page_limit [], [ 0 => _('Novice'), @@ -76,11 +77,11 @@ new Round( ['P1' => 300, 'days since reg' => 21, 'quiz/p_basic' => 1, 'quiz/p_mod1' => 1], 'REQ-AUTO', '', - null, // access_change_callback + "p2_access_change_email", // access_change_callback _("The page-texts have already been proofread, and now need to have the text WordChecked and carefully compared to the image."), 'proofreading_guidelines.php', $pi_tools_for_P, - null, // daily_page_limit + 60, // daily_page_limit ['P1'], [ 0 => _('Precise Proofreader'), @@ -116,7 +117,7 @@ new Round( _('Proofreading Round 3'), ['P2' => 150, 'F1' => 50, 'days since reg' => 42, 'quiz/p_basic' => 1, 'quiz/p_mod1' => 1, 'quiz/p_mod2' => 1], 'REQ-HUMAN', - _("Once you have met the requirements and requested access to P3, an evaluator will check over at least 50 of your recent P2 pages that have been completed in P3. If you proofread them to P3 standards, you'll be granted access."), + sprintf(_("If you are interested in earning access to P3, please visit Am I ready for P3?, and do a self-evaluation. Once you have requested access to P3, an evaluator will check over at least 50 of your recent P2 pages that have been completed in P3. If you proofread them to P3 standards, you'll be granted access."), "https://www.pgdp.net/wiki/DP_Official_Documentation:Proofreading/Am_I_Ready_For_P3%3F"), null, // access_change_callback _("The page-texts have already been proofread, but now need to be examined closely for small errors that may have been missed."), 'proofreading_guidelines.php', @@ -158,11 +159,11 @@ new Round( ['P1' => 300, 'days since reg' => 21, 'quiz/f_only' => 1], 'REQ-AUTO', '', - null, // access_change_callback + "f1_access_change_email", // access_change_callback _("The page-texts have already been proofread, but now need to be formatted with markup which may be specific to the project."), 'formatting_guidelines.php', $pi_tools_for_F, - null, // daily_page_limit + 25, // daily_page_limit [], [ 0 => _('Formatting Neophyte'), @@ -265,7 +266,7 @@ new Pool( ['F1' => 400], 'REQ-AUTO', '', - null, // access_change_callback + "pp_access_change_email", // access_change_callback _('After going through various rounds of proofreading and formatting, the books need to be massaged into a final e-text.'), 'post_proof.php', _("Manager"), diff --git a/pinc/theme.inc b/pinc/theme.inc index c647dfbee..1de0a0c0b 100644 --- a/pinc/theme.inc +++ b/pinc/theme.inc @@ -536,6 +536,21 @@ function html_statsbar(): void global $code_url, $PG_home_url; maybe_show_language_selector(); + // SITE-SPECIFIC + // Display the donation icon and link to donate. + // + // It was decided that, at pgdp.net, we would show the donation block + // only on the front page and the Activity Hub. + // It's somewhat kludgey to effect that here -- a better design + // would express that in the respective calls to output_header() -- + // but this approach has a much lower impact (code diff), + // and its drawbacks probably won't bite us. + if (str_ends_with($_SERVER['SCRIPT_NAME'], "/index.php") || + str_ends_with($_SERVER['SCRIPT_NAME'], "/activity_hub.php")) { + show_donation_stuff(); + show_social_media_links(); + } + // For logged-in users, show links to key help documents: $user = User::load_current(); if ($user) { @@ -607,9 +622,24 @@ function html_statsbar(): void } // SITE-SPECIFIC - //Display the "About DP" section if user is not logged in + echo "
    "; + echo "

    " . _("About DP") . "

    "; + + echo "

    "; + echo "" . _("Code of Conduct") . ""; + echo " · "; + echo "" . _("Privacy Policy") . ""; + echo "

    "; + + echo "

    " . _("Mission") . "

    "; + echo "

    "; + echo sprintf(_("Distributed Proofreaders is dedicated to the preservation of written works that are in the Public Domain in the United States by converting them into high-quality, freely available digital transcriptions. This is accomplished through the efforts of a supportive community of volunteers. Distributed Proofreaders follows the principles of the American Library Association Freedom to Read statement."), "http://www.ala.org/advocacy/intfreedom/freedomreadstatement"); + echo "

    "; + + //Display the history section if user is not logged in if (!$user) { - echo "

    "; + echo "

    " . _("History") . "

    "; + echo "

    "; echo sprintf(_("Distributed Proofreaders was founded in 2000 by Charles Franks to support the digitization of Public Domain books. Originally conceived to assist Project Gutenberg (PG), Distributed Proofreaders (DP) is now the main source of PG e-books. In 2002, Distributed Proofreaders became an official PG site. In May 2006, Distributed Proofreaders became a separate legal entity and continues to maintain a strong relationship with PG."), $PG_home_url); echo "

    "; } @@ -1049,6 +1079,72 @@ function show_key_help_links(): void // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +function show_donation_stuff(): void +{ + $pgdp_wiki_url = "https://www.pgdp.net/wiki"; + $DPF_home_url = "$pgdp_wiki_url/Distributed_Proofreaders_Foundation"; + $DPF_donor_url = "$pgdp_wiki_url/DPFoundation:Information_for_Donors"; + + echo "
    "; + echo "

    "; + echo sprintf( + _("Thank you for supporting DP! You can also support the site by making a donation to the non-profit Distributed Proofreaders Foundation."), + $DPF_home_url + ); + echo "

    \n"; + + echo "
    "; + echo ""; + echo "
    "; + + echo "
    \n"; + echo "
    \n"; +} + +function show_social_media_links(): void +{ + // insert social media links + $social_links = [ + "WordPress" => [ + "class" => "fab fa-wordpress fa-2x", + "url" => "https://blog.pgdp.net", + ], + "Mastodon" => [ + "class" => "fab fa-mastodon fa-2x", + "url" => "https://universeodon.com/@DProofreaders", + "rel" => "me", + ], + "Facebook" => [ + "class" => "fab fa-facebook-f fa-2x", + "url" => "https://www.facebook.com/distributed.proofreaders/", + ], + "GitHub" => [ + "class" => "fab fa-github fa-2x", + "url" => "https://github.com/DistributedProofreaders/dproofreaders/blob/master/README.md", + ], + ]; + echo "
    "; + + $links = []; + foreach ($social_links as $name => $data) { + $class = $data["class"]; + $url = $data["url"]; + $rel = $data["rel"] ?? ""; + $links[] = "" . + "" . + ""; + } + + echo join("   ", $links); + + echo "
    "; + echo "
    \n"; +} + +// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + /** * Calculate progress bar size and color properties * diff --git a/project.php b/project.php index 7863c0834..cc067c09c 100644 --- a/project.php +++ b/project.php @@ -672,6 +672,19 @@ function do_project_info_table(): void // insert e.g. templates and biographies $comments = parse_project_comments($project); + // Automatically prepend mentor round comments template for Beginners Only + if ($project->difficulty == "beginner") { + if ($round && $round->is_a_mentor_round()) { + $comments = " +

    This book has changed from a BEGINNERS ONLY project to a MENTORS project.

    + +

    NOTE: You may find a list of which beginner has done which page, and the number of pages proofread by each, at the For Mentors page.

    + +

    Also, should you be issued a page that shows any of the Project Facilitators as the P1 proofreader, you may safely skip the feedback--unless, of course, we NEED it! That page will have been reclaimed, then proofread by one of us in order to move the project on to P2.

    + " . $comments; + } + } + if ($comments == '') { // Put in *something*, otherwise it'll probably look odd. $comments = ' '; diff --git a/stats/includes/member.inc b/stats/includes/member.inc index 5bc55c37e..cdc3ef17b 100644 --- a/stats/includes/member.inc +++ b/stats/includes/member.inc @@ -407,17 +407,24 @@ function showMbrTallySelector(int $u_id, ?string $tally_name): void function showMbrPageStats(User $user, string $tally_name): void { - global $ELR_round; - $users_tallyboard = new TallyBoard($tally_name, 'U'); $vitals = $users_tallyboard->get_vitals($user->u_id); $now = time(); - // If this is the entry-level round, use the user creation date - if ($tally_name == $ELR_round->id) { + // There are two special cases needed here: + // Firstly, the R* tally should span the time period from date_created to the site R* apocalypse + // Secondly, the P1 tally should start from the site P genesis, or date_created, whichever is later. + + $site_R_apocalypse = 1117576800; + $site_P_genesis = 1117720800; + + if ($tally_name == "R*") { $firstWorkInRound = $user->date_created; + $daysInRoundInteger = floor(($site_R_apocalypse - $firstWorkInRound) / 86400); + } elseif ($tally_name == "P1") { + $firstWorkInRound = ($user->date_created > $site_P_genesis) ? $user->date_created : $site_P_genesis; $daysInRoundInteger = floor(($now - $firstWorkInRound) / 86400); } else { $firstWorkInRound = get_first_granted_date($user->username, $tally_name); diff --git a/stats/pp_stats.php b/stats/pp_stats.php index 1180081b2..0866e1484 100644 --- a/stats/pp_stats.php +++ b/stats/pp_stats.php @@ -16,6 +16,8 @@ echo "

    " . _("Total Projects Post-Processed Since Statistics were Kept") . "

    \n"; +echo "" . _("Sorry, this table has been temporarily disabled.") . "\n"; +/* $psd = get_project_status_descriptor('PPd'); dpsql_dump_themed_query(" SELECT @@ -23,6 +25,7 @@ FROM project_state_stats WHERE $psd->state_selector GROUP BY date ORDER BY date DESC LIMIT 1 "); +*/ echo "
    \n"; diff --git a/stats/requested_books.php b/stats/requested_books.php index 77985118f..838c0ad3f 100644 --- a/stats/requested_books.php +++ b/stats/requested_books.php @@ -12,7 +12,10 @@ echo "

    $title

    \n"; echo "

    " . _("You can sign up for notifications in the Event Subscriptions section of the Project Comments page when proofreading.") . "

    "; -echo "

    " . _("Most Requested Books Being Proofread") . "

    \n"; +echo "

    This page has been temporarily disabled due to its high load on the system. We're working to fix this.

    "; +exit; + +echo "

    " . _("Most Requested Books Being Proofread") . "

    \n"; /** @phpstan-ignore-line The exit statement above makes this dead code */ create_temporary_project_event_subscription_summary_table(); diff --git a/styles/layout.less b/styles/layout.less index 7f34ee1c0..965b79f4a 100644 --- a/styles/layout.less +++ b/styles/layout.less @@ -1858,3 +1858,22 @@ p.mentor-oldest { @import (inline) "../pinc/3rdparty/mediawiki/mediawiki.diff.styles.css"; /* ------------------------------------------------------------------------ */ +/* Branding table */ + +table.branding { + width: 500px; + border-collapse: collapse; + text-align: center; +} +table.branding th.gray, table.branding td.gray { + background-color: @table-cell-base-highc; +} +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: @table-cell-base-highc; +} +table.branding tr th, table.branding tr td { + padding: 0.5em; +} + +/* ------------------------------------------------------------------------ */ diff --git a/styles/themes/charcoal.css b/styles/themes/charcoal.css index 20c4970be..1a927d909 100644 --- a/styles/themes/charcoal.css +++ b/styles/themes/charcoal.css @@ -3006,6 +3006,25 @@ td.diff-marker { content: '↩'; } +/* ------------------------------------------------------------------------ */ +/* Branding table */ +table.branding { + width: 500px; + border-collapse: collapse; + text-align: center; +} +table.branding th.gray, +table.branding td.gray { + background-color: #121212; +} +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: #121212; +} +table.branding tr th, +table.branding tr td { + padding: 0.5em; +} /* ------------------------------------------------------------------------ */ /* Do not underline links */ a { @@ -3153,3 +3172,11 @@ table.striped tr:nth-child(even) td { * a dark theme background for WC management for PMs. */ /* WordCheck */ +/*--------------------------------------------------------*/ +/* On the branding page, the background behind the black */ +/* logo needs a hack so that both the logo image and the */ +/* link to the file are easily readable. */ +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: #636363; +} diff --git a/styles/themes/charcoal.less b/styles/themes/charcoal.less index d42c99316..f5fb93048 100644 --- a/styles/themes/charcoal.less +++ b/styles/themes/charcoal.less @@ -270,3 +270,13 @@ table.striped { @preWC: #666666; @noWC: #996300; @WC: #036309; + +/*--------------------------------------------------------*/ +/* On the branding page, the background behind the black */ +/* logo needs a hack so that both the logo image and the */ +/* link to the file are easily readable. */ + +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: #636363; +} diff --git a/styles/themes/classic_grey.css b/styles/themes/classic_grey.css index 2dd28854f..e74daf146 100644 --- a/styles/themes/classic_grey.css +++ b/styles/themes/classic_grey.css @@ -3007,3 +3007,22 @@ td.diff-marker { } /* ------------------------------------------------------------------------ */ +/* Branding table */ +table.branding { + width: 500px; + border-collapse: collapse; + text-align: center; +} +table.branding th.gray, +table.branding td.gray { + background-color: #cccccc; +} +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: #cccccc; +} +table.branding tr th, +table.branding tr td { + padding: 0.5em; +} +/* ------------------------------------------------------------------------ */ diff --git a/styles/themes/project_gutenberg.css b/styles/themes/project_gutenberg.css index 2020c2afb..721339d31 100644 --- a/styles/themes/project_gutenberg.css +++ b/styles/themes/project_gutenberg.css @@ -3007,3 +3007,22 @@ td.diff-marker { } /* ------------------------------------------------------------------------ */ +/* Branding table */ +table.branding { + width: 500px; + border-collapse: collapse; + text-align: center; +} +table.branding th.gray, +table.branding td.gray { + background-color: #cccccc; +} +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: #cccccc; +} +table.branding tr th, +table.branding tr td { + padding: 0.5em; +} +/* ------------------------------------------------------------------------ */ diff --git a/styles/themes/royal_blues.css b/styles/themes/royal_blues.css index 8060b24e4..e21c5be4b 100644 --- a/styles/themes/royal_blues.css +++ b/styles/themes/royal_blues.css @@ -3007,3 +3007,22 @@ td.diff-marker { } /* ------------------------------------------------------------------------ */ +/* Branding table */ +table.branding { + width: 500px; + border-collapse: collapse; + text-align: center; +} +table.branding th.gray, +table.branding td.gray { + background-color: #cccccc; +} +table.branding th.black-transparent, +table.branding td.black-transparent { + background-color: #cccccc; +} +table.branding tr th, +table.branding tr td { + padding: 0.5em; +} +/* ------------------------------------------------------------------------ */ diff --git a/tools/display_image.php b/tools/display_image.php new file mode 100644 index 000000000..0ed55a8d8 --- /dev/null +++ b/tools/display_image.php @@ -0,0 +1,22 @@ +$title"; + +echo "

    This page has moved. Please update your bookmarks.

    "; + +echo "

    The following link will get you to the new location with whatever parameters you passed in.

    "; +$url = "$code_url/tools/page_browser.php?simpleHeader=true&mode=image&project=$projectid&imagefile=$imagefile"; +echo "

    $url

    "; diff --git a/tools/mentors/view_page_text_image.php b/tools/mentors/view_page_text_image.php new file mode 100644 index 000000000..91abea91a --- /dev/null +++ b/tools/mentors/view_page_text_image.php @@ -0,0 +1,22 @@ +$title"; + +echo "

    This page has moved. Please update your bookmarks.

    "; + +echo "

    The following link will get you to the new location with whatever parameters you passed in.

    "; +$url = "$code_url/tools/page_browser.php?mode=imageText&project=$projectid&imagefile=$imagefile"; +echo "

    $url

    "; diff --git a/tools/project_manager/displayimage.php b/tools/project_manager/displayimage.php new file mode 100644 index 000000000..dcbd3292a --- /dev/null +++ b/tools/project_manager/displayimage.php @@ -0,0 +1,22 @@ +$title"; + +echo "

    This page has moved. Please update your bookmarks.

    "; + +echo "

    The following link will get you to the new location with whatever parameters you passed in.

    "; +$url = "$code_url/tools/page_browser.php?mode=image&project=$projectid&imagefile=$imagefile"; +echo "

    $url

    "; diff --git a/tools/project_manager/remote_file_manager.php b/tools/project_manager/remote_file_manager.php index a74886d58..1e5ebd8e8 100644 --- a/tools/project_manager/remote_file_manager.php +++ b/tools/project_manager/remote_file_manager.php @@ -227,6 +227,7 @@ function do_showdir(string $action_message): void } echo "

    " . _("This page allows you to manage content in this uploads folder.") . "

    \n"; + echo "

    " . _("The ~/dpscans directory is not backed up so please keep a local copy on your computer until they are no longer needed. And please remove files when they're no longer required.") . "

    "; if (get_access_mode($pguser) == 'common') { show_message('info', _("Your files are located in a common, shared, area.
    Please take care to avoid affecting other users' files.")); diff --git a/tools/proofers/round.php b/tools/proofers/round.php index 3873649c4..abd5ebf5c 100644 --- a/tools/proofers/round.php +++ b/tools/proofers/round.php @@ -9,6 +9,7 @@ include_once($relPath.'gradual.inc'); include_once($relPath.'site_news.inc'); include_once($relPath.'mentoring.inc'); +include_once($relPath.'quals.inc'); include_once($relPath.'page_tally.inc'); include_once($relPath.'faq.inc'); @@ -39,6 +40,7 @@ show_news_for_page($round_id); +output_qual_projects($round_id); if ($pagesproofed < 100 && $ELR_round->id == $round_id) { echo "
    "; diff --git a/tools/site_admin/project_jump.php b/tools/site_admin/project_jump.php index ce83caecf..fce898807 100644 --- a/tools/site_admin/project_jump.php +++ b/tools/site_admin/project_jump.php @@ -16,6 +16,10 @@ foreach (Rounds::get_all() as $round) { $valid_new_states[] = $round->project_unavailable_state; } +$valid_new_states = array_merge($valid_new_states, [ + 'proj_post_first_unavailable', 'proj_post_first_available', 'proj_post_first_checked_out', + 'proj_post_second_available', 'proj_post_second_checked_out', +]); $new_state = get_enumerated_param($_POST, 'new_state', null, $valid_new_states, true); @@ -58,6 +62,13 @@ function display_project_jump_form(string $action, ?string $projectid, ?string $ foreach (Rounds::get_all() as $round) { echo ""; } + echo " + + + + + + "; echo "\n"; echo ""; @@ -101,6 +112,25 @@ function jump_project(string $projectid, string $new_state, bool $just_checking) throw new RuntimeException("Project does not have a pages table and cannot be jumped to a new state"); } + if ('proj_post_first_checked_out' == $new_state && '' == $project->checkedoutby) { + throw new RuntimeException("project must have a PPer assigned to jump to $new_state"); + } elseif ('proj_post_first_checked_out' == $new_state) { + echo " PPer : $project->checkedoutby\n"; + } + if ('proj_post_first_available' == $new_state && '' != $project->checkedoutby) { + throw new RuntimeException("project has a PPer assigned ($project->checkedoutby) so can't jump to $new_state"); + } + + if ('proj_post_second_checked_out' == $new_state && '' == $project->checkedoutby) { + throw new RuntimeException("project must have a PPVer assigned to jump to $new_state"); + } elseif ('proj_post_second_checked_out' == $new_state) { + echo " PPVer : $project->checkedoutby\n"; + } + if ('proj_post_second_available' == $new_state && '' != $project->checkedoutby) { + throw new RuntimeException("project has a PPVer assigned ($project->checkedoutby) so can't jump to $new_state"); + } + + if ($just_checking) { echo "\n"; echo "

    \n";