Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions install/es_MX_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# OpenCATS Career Portal — Spanish (es_MX) Translation

This adds a Spanish (Mexico) translation of the OpenCATS Career Portal.

## What's included

- `es_MX_career_portal_template.sql` — Database template "CATS 2.0 ES" with full Spanish translation
- Modified `modules/careers/CareersUI.php` — i18n detection based on active template name

## How to install

1. Import the Spanish template into your database:
```bash
mysql opencats < install/es_MX_career_portal_template.sql
```

2. Activate the Spanish template from the admin panel:
- Go to Settings → Career Portal Settings
- Select "CATS 2.0 ES" as the active template
- Save

Or via SQL:
```sql
UPDATE settings SET value = 'CATS 2.0 ES' WHERE setting = 'activeBoard';
```

## Translated sections

| Section | Status |
|---------|--------|
| Main page | ✅ |
| Search Results | ✅ |
| Job Details | ✅ |
| Candidate Registration | ✅ |
| Apply for Position | ✅ |
| Candidate Profile | ✅ |
| Thanks for Submission | ✅ |
| Header (navigation buttons) | ✅ |
| Table headers (Company, Department, Position, Location) | ✅ |
| Action buttons (Apply, Continue, Submit, Login) | ✅ |
| Welcome back message | ✅ |

## How it works

The translation is detected automatically based on the active template name.
Any template containing "ES" in its name activates Spanish strings in CareersUI.php.

To switch back to English:
```sql
UPDATE settings SET value = 'CATS 2.0' WHERE setting = 'activeBoard';
```

## Tested on
- PHP 8.4.21
- MariaDB 10.11
- Debian 12 (Bookworm)
12 changes: 12 additions & 0 deletions install/es_MX_career_portal_template.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Apply for Position', '<div id="careerContent">\n <h1>Aplicando a: <title></h1>\n <div class="applyBoxLeft">\n <div><h3>1. Importar CV y completar campos</h3></div>\n <table>\n <tr>\n <td><input-resumeUploadPreview></td>\n </tr>\n </table>\n <br />\n <div><h3>2. Cuéntanos sobre ti</h3></div>\n <p class="instructions">Todos los campos marcados con asterisco (*) son obligatorios.</p>\n <table>\n <tr>\n <td class="label"><label id="firstNameLabel" for="firstName">*Nombre(s):</label></td>\n <td><input-firstName></td>\n </tr>\n <tr>\n <td class="label"><label id="lastNameLabel" for="lastName">*Apellido(s):</label></td>\n <td><input-lastName></td>\n </tr>\n <tr>\n <td class="label"><label id="emailLabel" for="email">*Correo electrónico:</label></td>\n <td><input-email></td>\n </tr>\n <tr>\n <td class="label"><label id="emailConfirmLabel" for="emailconfirm">*Confirmar correo:</label></td>\n <td><input-emailconfirm></td>\n </tr>\n </table>\n </div>\n <div class="applyBoxRight">\n <div><h3>3. ¿Cómo podemos contactarte?</h3></div>\n <table>\n <tr>\n <td class="label"><label id="homePhoneLabel" for="homePhone">Teléfono casa:</label></td>\n <td><input-phone-home></td>\n </tr>\n <tr>\n <td class="label"><label id="mobilePhoneLabel" for="mobilePhone">Teléfono celular:</label></td>\n <td><input-phone-cell></td>\n </tr>\n <tr>\n <td class="label"><label id="workPhoneLabel" for="workPhone">Teléfono trabajo:</label></td>\n <td><input-phone></td>\n </tr>\n <tr>\n <td class="label"><label id="bestTimeLabel" for="bestTime">*Mejor horario para llamar:</label></td>\n <td><input-best-time-to-call></td>\n </tr>\n <tr>\n <td class="label"><label id="mailingAddressLabel" for="mailingAddress">Dirección:</label></td>\n <td><input-address></td>\n </tr>\n <tr>\n <td class="label"><label id="cityProvinceLabel" for="cityProvince">*Ciudad/Municipio:</label></td>\n <td><input-city></td>\n </tr>\n <tr>\n <td class="label"><label id="stateCountryLabel" for="stateCountry">*Estado/País:</label></td>\n <td><input-state></td>\n </tr>\n <tr>\n <td class="label"><label id="zipPostalLabel" for="zipPostal">*Código Postal:</label></td>\n <td><input-zip></td>\n </tr>\n </table>\n <br />\n <div><h3>4. Información adicional</h3></div>\n <table>\n <tr>\n <td class="label"><label id="keySkillsLabel" for="keySkills">*Habilidades clave:</label></td>\n <td><input-keySkills></td>\n </tr>\n <tr>\n <td>&nbsp;</td>\n <td><input type="button" value="Enviar solicitud" id="submitApplicationNow" style="background:#5c8a00;color:white;padding:8px 16px;border:none;border-radius:3px;cursor:pointer;font-size:14px;" onmouseover="this.style.background=\\'#4a7000\\'" onmouseout="this.style.background=\\'#5c8a00\\'" onclick="if (applyValidate()) { document.applyToJobForm.submit(); }" /></td>\n </tr>\n </table>\n </div>\n</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Candidate Profile', '<div id="careerContent"><h1 style="padding: 0; margin: 0; border: 0;">Mi Perfil</h1><h3 style="font-weight: normal;">Cualquier cambio que realices en tu perfil se actualizará en nuestro sitio web para todos los trabajos pasados y futuros a los que apliques.</h3><br /><div class="applyBoxLeft"><div><h3>1. Cuéntanos sobre ti</h3></div><p class="instructions">Todos los campos marcados con asterisco (*) son obligatorios.</p><table><tr><td class="label"><label id="firstNameLabel" for="firstName">*Nombre(s):</label></td><td><input-firstName></td></tr><tr><td class="label"><label id="lastNameLabel" for="lastName">*Apellido(s):</label></td><td><input-lastName></td></tr><tr><td class="label"><label id="emailLabel" for="email">*Correo electrónico:</label></td><td><input-email1></td></tr><tr><td colspan="2"><input-resume></td></tr></table></div><div class="applyBoxRight"><div><h3>2. ¿Cómo podemos contactarte?</h3></div><table><tr><td class="label"><label id="homePhoneLabel" for="homePhone">Teléfono casa:</label></td><td><input-phoneHome></td></tr><tr><td class="label"><label id="mobilePhoneLabel" for="mobilePhone">Teléfono celular:</label></td><td><input-phoneCell></td></tr><tr><td class="label"><label id="workPhoneLabel" for="workPhone">Teléfono trabajo:</label></td><td><input-phoneWork></td></tr><tr><td class="label"><label id="bestTimeLabel" for="bestTime">*Mejor horario para llamar:</label></td><td><input-bestTimeToCall></td></tr><tr><td class="label"><label id="mailingAddressLabel" for="mailingAddress">Dirección:</label></td><td><input-address></td></tr><tr><td class="label"><label id="cityProvinceLabel" for="cityProvince">*Ciudad/Municipio:</label></td><td><input-city></td></tr><tr><td class="label"><label id="stateCountryLabel" for="stateCountry">*Estado/País:</label></td><td><input-state></td></tr><tr><td class="label"><label id="zipPostalLabel" for="zipPostal">*Código Postal:</label></td><td><input-zip></td></tr></table><br /><div><h3>3. Información adicional</h3></div><table><tr><td class="label"><label id="keySkillsLabel" for="keySkills">*Habilidades clave:</label></td><td><input-keySkills></td></tr><tr><td>&nbsp;</td><td style="padding-top: 40px;"><input-submit></td></tr></table></div></div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Candidate Registration', '<div id="careerContent">\n <h1><applyContent>Aplicando a: <title></applyContent></h1>\n <center>\n <table cellpadding="0" cellspacing="0">\n <tr>\n <td><label id="emailLabel" for="email"><h2>Ingresa tu correo electrónico:</h2></label></td>\n <td><input-email></td>\n </tr>\n <tr>\n <td align="right" valign="top"><input-new></td>\n <td style="line-height: 18px;">\n <applyContent>\n <strong>No me he registrado en este sitio web.</strong><br />\n (No he aplicado a ningún trabajo en línea)\n </applyContent>\n </td>\n </tr>\n <tr>\n <td align="right" valign="top"><input-registered></td>\n <td style="line-height: 20px;">\n <strong>Ya me he registrado antes</strong><br />\n y mi apellido es:<br />\n <input-lastName><br />\n y mi código postal es:<br />\n <input-zip><br /><br />\n <input-rememberMe> Recordar mi información para visitas futuras<br /><br />\n <input-submit><br /><br />\n </td>\n </tr>\n </table>\n </center>\n</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Job Details', '<div id="careerContent">\n <registeredCandidate>\n <h1>Detalles de la posición: <title></h1>\n <table id="detailsTable">\n <tr>\n <td class="detailsHeader"><strong>Ubicación:</strong></td>\n <td><city>, <state></td>\n </tr>\n <tr>\n <td class="detailsHeader"><strong>Vacantes:</strong></td>\n <td><openings></td>\n </tr>\n <tr>\n <td class="detailsHeader"><strong>Rango salarial:</strong></td>\n <td><salary></td>\n </tr>\n </table>\n <div id="descriptive">\n <p><strong>Descripción:</strong></p>\n <description>\n </div>\n <div id="detailsTools">\n <h2>Acciones:</h2>\n <a-applyToJob><input type="button" value="Aplicar a esta posición" style="background:#5c8a00;color:white;padding:8px 16px;border:none;border-radius:3px;cursor:pointer;font-size:14px;" onmouseover="this.style.background=\\'#4a7000\\'" onmouseout="this.style.background=\\'#5c8a00\\'" /></a-applyToJob>\n </div>\n</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Main', '<div id="careerContent">\n <registeredCandidate>\n <h1>Vacantes disponibles en <siteName></h1>\n <div id="descriptive">\n <p>Transforma tu vida hoy convirtiéndote en parte de nuestro equipo.</p>\n <p>Si estás interesado, te invitamos a ver las <a href="index.php?m=careers&p=showAll">posiciones abiertas actualmente</a> en nuestra empresa.</p><br /><br /><registeredLoginTitle><h1 style="padding:0;margin:0;border:0">¿Has aplicado con nosotros antes?</h1></registeredLoginTitle><registeredLogin>\n </div>\n <div id="detailsTools">\n <h2>Acciones:</h2>\n <ul>\n <li><a href="">Visitar nuestro sitio web</a></li>\n </ul>\n </div>\n</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Questionnaire', '<div id="careerContent">\n<questionnaire>\n<br /><br />\n<div style="text-align: right;">\n<submit value="Continuar">\n</div>\n</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Search Results', '<div id="careerContent">\n <registeredCandidate>\n <h1>Vacantes disponibles, publicadas recientemente: <numberOfSearchResults></h1>\n<searchResultsTable>\n </div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Content - Thanks for your Submission', '<div id="careerContent">\n <h1>Solicitud enviada para: <title></h1>\n <div id="descriptive">\n <p>Por favor revisa tu bandeja de entrada &#8212; Deberías recibir un correo de confirmación de tu solicitud.</p>\n <p>Gracias por enviarnos tu solicitud. La revisaremos a la brevedad y nos pondremos en contacto contigo pronto.</p>\n </div>\n <div id="detailsTools">\n <h2>Acciones:</h2>\n <ul>\n <li><a href="">Visitar nuestro sitio web</a></li>\n </ul>\n </div>\n</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'CSS', 'table.sortable\n{\ntext-align:left;\nempty-cells: show;\nwidth: 940px;\n}\ntd\n{\npadding:5px;\n}\ntr.rowHeading\n{\n background: #e0e0e0; border: 1px solid #cccccc; border-left: none; border-right: none;\n}\nth\n{\npadding:5px; background: #e0e0e0; border: 1px solid #cccccc; border-left: none; border-right: none;\n}');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Footer', '</div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Header', '<div id="container">\n <div id="logo"><img src="images/careers_cats.gif" alt="Portal de Empleo OpenCATS" /></div>\n <div id="actions">\n <h2>Accesos rápidos:</h2>\n <a href="index.php" style="display:inline-block;padding:4px 10px;background:#5c8a00;color:white;text-decoration:none;border-radius:3px;margin:2px;">&#8592; Inicio</a>\n <a href="<rssURL>" style="display:inline-block;padding:4px 10px;background:#e07000;color:white;text-decoration:none;border-radius:3px;margin:2px;">RSS</a>\n <a href="index.php?m=careers&p=showAll" style="display:inline-block;padding:4px 10px;background:#5c8a00;color:white;text-decoration:none;border-radius:3px;margin:2px;">Ver todas las vacantes</a>\n </div>');
INSERT INTO career_portal_template (career_portal_name, setting, value) VALUES ('CATS 2.0 ES', 'Left', '');
2 changes: 1 addition & 1 deletion lib/AJAXInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function __construct()
/* Give the session a unique name to avoid conflicts and start the
* session. */
@session_name(CATS_SESSION_NAME);
session_start();
if (session_status() === PHP_SESSION_NONE) { session_start(); }
Comment on lines 206 to +207

/* Validate the session. */
if (!$this->isSessionLoggedIn())
Expand Down
21 changes: 14 additions & 7 deletions lib/CareerPortal.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,20 @@ public function sendEmail($userID, $destination, $subject, $body)

/* Send e-mail notification. */
//FIXME: Make subject configurable.
$mailer = new Mailer($this->_siteID, $userID);
$mailerStatus = $mailer->sendToOne(
array($destination, ''),
$subject,
$body,
true
);
try {
$mailer = new Mailer($this->_siteID, $userID);
$mailerStatus = $mailer->sendToOne(
array($destination, ''),
$subject,
$body,
true
);
} catch (Exception $e) {
// Mail not configured or failed - log error for debugging
$mailerStatus = false;

error_log('OpenCATS Mailer error (site=' . $this->_siteID . '): ' . $e->getMessage());
}
Comment on lines +469 to +474
}
}

Expand Down
Loading