Skip to content

Commit

Permalink
Report are now right translated
Browse files Browse the repository at this point in the history
  • Loading branch information
phili67 committed Jan 31, 2018
1 parent db323ec commit 824a8a6
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 56 deletions.
64 changes: 32 additions & 32 deletions src/DirectoryReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
while ($rowCustomField = mysqli_fetch_array($rsCustomFields, MYSQLI_ASSOC)) {
if (($aSecurityType[$rowCustomField['custom_FieldSec']] == 'bAll') || ($_SESSION[$aSecurityType[$rowCustomField['custom_FieldSec']]])) {
?>
<input type="checkbox" Name="bCustom<?= $rowCustomField['custom_Order'] ?>" value="1" checked><?= $rowCustomField['custom_Name'] ?><br>
<input type="checkbox" Name="bCustom<?= $rowCustomField['custom_Order'] ?>" value="1" checked><?= $rowCustomField['custom_Name'] ?><br>
<?php
}
}
Expand All @@ -197,38 +197,38 @@

</td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Number of Columns') ?>:</td>
<td class="TextColumn">
<input type="radio" Name="NumCols" value=1>1 col<br>
<input type="radio" Name="NumCols" value=2 checked>2 cols<br>
<input type="radio" Name="NumCols" value=3>3 cols<br>
</td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Paper Size') ?>:</td>
<td class="TextColumn">
<input type="radio" name="PageSize" value="letter" checked>Letter (8.5x11)<br>
<input type="radio" name="PageSize" value="legal">Legal (8.5x14)<br>
<input type="radio" name="PageSize" value="a4">A4
</td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Font Size') ?>:</td>
<td class="TextColumn">
<table>
<tr>
<td><input type="radio" Name="FSize" value=6>6<br>
<input type="radio" Name="FSize" value=8>8<br>
<input type="radio" Name="FSize" value=10 checked>10<br></td>
<tr>
<td class="LabelColumn"><?= gettext('Number of Columns') ?>:</td>
<td class="TextColumn">
<input type="radio" Name="NumCols" value=1>1 col<br>
<input type="radio" Name="NumCols" value=2 checked>2 cols<br>
<input type="radio" Name="NumCols" value=3>3 cols<br>
</td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Paper Size') ?>:</td>
<td class="TextColumn">
<input type="radio" name="PageSize" value="letter" checked>Letter (8.5x11)<br>
<input type="radio" name="PageSize" value="legal">Legal (8.5x14)<br>
<input type="radio" name="PageSize" value="a4">A4
</td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Font Size') ?>:</td>
<td class="TextColumn">
<table>
<tr>
<td><input type="radio" Name="FSize" value=6>6<br>
<input type="radio" Name="FSize" value=8>8<br>
<input type="radio" Name="FSize" value=10 checked>10<br></td>

<td><input type="radio" Name="FSize" value=12>12<br>
<input type="radio" Name="FSize" value=14>14<br>
<input type="radio" Name="FSize" value=16>16<br></td>
</tr>
</table>
</td>
</tr>
<td><input type="radio" Name="FSize" value=12>12<br>
<input type="radio" Name="FSize" value=14>14<br>
<input type="radio" Name="FSize" value=16>16<br></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="LabelColumn"><?= gettext('Title page') ?>:</td>
<td class="TextColumn">
Expand Down
12 changes: 8 additions & 4 deletions src/EcclesiaCRM/Reports/PDF_Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace EcclesiaCRM\Reports;

use EcclesiaCRM\dto\SystemConfig;
use EcclesiaCRM\Utils\InputUtils;

class PDF_Directory extends ChurchInfoReport
{
Expand Down Expand Up @@ -34,7 +35,7 @@ public function Header()
//Move to the right
$this->SetX($this->_Margin_Left);
//Framed title
$this->Cell($this->w - ($this->_Margin_Left * 2), 10, SystemConfig::getValue('sChurchName').' - '.gettext('Directory'), 1, 0, 'C');
$this->Cell($this->w - ($this->_Margin_Left * 2), 10, SystemConfig::getValue('sChurchName').' - '.InputUtils::translate_special_charset(gettext('Directory')), 1, 0, 'C');
$this->SetY(25);
}
}
Expand Down Expand Up @@ -70,12 +71,15 @@ public function TitlePage()
//Line break
$this->Ln(5);
//Move to the right
$this->MultiCell(197, 10, "\n\n\n".SystemConfig::getValue('sChurchName')."\n\n".gettext('Directory')."\n\n", 0, 'C');
$this->MultiCell(197, 10, "\n\n\n".SystemConfig::getValue('sChurchName')."\n\n".InputUtils::translate_special_charset(gettext('Directory'))."\n\n", 0, 'C');
$this->Ln(5);
$today = date(SystemConfig::getValue("sDateFormatLong"));
$this->MultiCell(197, 10, $today."\n\n", 0, 'C');

$sContact = sprintf("%s\n%s, %s %s\n\n%s\n\n", SystemConfig::getValue('sChurchAddress'), SystemConfig::getValue('sChurchCity'), SystemConfig::getValue('sChurchState'), SystemConfig::getValue('sChurchZip'), SystemConfig::getValue('sChurchPhone'));
$sContact = sprintf("%s\n%s, %s %s\n\n%s\n\n", InputUtils::translate_special_charset(SystemConfig::getValue('sChurchAddress')),
InputUtils::translate_special_charset(SystemConfig::getValue('sChurchCity')),
InputUtils::translate_special_charset(SystemConfig::getValue('sChurchState')), InputUtils::translate_special_charset(SystemConfig::getValue('sChurchZip')),
SystemConfig::getValue('sChurchPhone'));
$this->MultiCell(197, 10, $sContact, 0, 'C');
$this->Cell(10);
$sDirectoryDisclaimer = iconv('UTF-8', 'ISO-8859-1', $sDirectoryDisclaimer);
Expand Down Expand Up @@ -219,7 +223,7 @@ public function Add_Header($sLetter)
$this->SetTextColor(0);
$this->SetFont($this->_Font, '', $this->_Char_Size);
// $this->SetY($this->GetY() + 5);
$this->SetY($this->GetY() + $this->_LS);
$this->SetY($this->GetY() + $this->_LS);
}

// This prints the family name in BOLD
Expand Down
10 changes: 6 additions & 4 deletions src/EcclesiaCRM/Reports/PDF_GroupDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace EcclesiaCRM\Reports;

use EcclesiaCRM\Utils\InputUtils;

class PDF_GroupDirectory extends ChurchInfoReport
{
// Private properties
Expand All @@ -26,9 +28,9 @@ public function Header()
//Move to the right
$this->Cell(10);
//Framed title
$sTitle = $sGroupName.' - '.gettext('Group Directory');
$sTitle = $sGroupName.' - '. InputUtils::translate_special_charset(gettext('Group Directory'));
if (strlen($sRoleName)) {
$sTitle .= ' ('.$sRoleName.')';
$sTitle .= ' ('.InputUtils::translate_special_charset(gettext($sRoleName)).')';
}
$this->Cell(197, 10, $sTitle, 1, 0, 'C');
}
Expand Down Expand Up @@ -116,7 +118,7 @@ public function Print_Name($sName)
$_PosX = $this->_Margin_Left + ($this->_Column * 108);
$_PosY = $this->_Margin_Top + ($this->_CurLine * 5);
$this->SetXY($_PosX, $_PosY);
$this->Write(5, $sName);
$this->Write(5, InputUtils::translate_special_charset($sName));
$this->SetFont($this->_Font, '', $this->_Char_Size);
$this->_CurLine++;
}
Expand All @@ -131,7 +133,7 @@ public function Add_Record($sName, $text, $numlines)
$_PosX = $this->_Margin_Left + ($this->_Column * 108);
$_PosY = $this->_Margin_Top + ($this->_CurLine * 5);
$this->SetXY($_PosX, $_PosY);
$this->MultiCell(108, 5, $text);
$this->MultiCell(108, 5, InputUtils::translate_special_charset($text));
$this->_CurLine += $numlines;
}
}
4 changes: 4 additions & 0 deletions src/EcclesiaCRM/Reports/PDF_Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public function _Set_Format($format)
// Constructor
public function __construct($format, $posX = 1, $posY = 1, $unit = 'mm')
{
if ($format == gettext('Tractor')) {
$format = 'Tractor';
}

if (is_array($format)) {
// Custom format
$Tformat = $format;
Expand Down
2 changes: 1 addition & 1 deletion src/EcclesiaCRM/dto/SystemConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private static function buildConfigs()
"sTimeEnglish" => new ConfigItem(1051, "sTimeEnglish", "boolean", "1",gettext("Set the time in English format or 24 hours.")),
"sDateFormatNoYear" => new ConfigItem(103, "sDateFormatNoYear", "text", "m/d"),
"sDateFormatShort" => new ConfigItem(104, "sDateFormatShort", "text", "j/m/y"),
"sDateTimeFormat" => new ConfigItem(105, "sDateTimeFormat", "text", "j/m/y g:i a"),
"sDateTimeFormat" => new ConfigItem(105, "sDateTimeFormat", "text", gettext("php format for the date, in English : j/m/y g:i a")),
"sDateFilenameFormat" => new ConfigItem(106, "sDateFilenameFormat", "text", "Ymd-Gis"),
"sCSVExportDelemiter" => new ConfigItem(107, "sCSVExportDelemiter", "text", ",", gettext("To export to another For european CharSet use ;")),
"sCSVExportCharset" => new ConfigItem(108, "sCSVExportCharset", "text", "UTF-8", gettext("Default is UTF-8, For european CharSet use Windows-1252 for example for French language.")),
Expand Down
12 changes: 6 additions & 6 deletions src/GroupReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="row">
<div class="col-xs-6">
<label for="GroupID"><?= gettext('Select Group') ?>:</label>
<select id="GroupID" name="GroupID" onChange="UpdateRoles();">
<select id="GroupID" class="form-control input-sm" name="GroupID" onChange="UpdateRoles();">
<?php
// Create the group select drop-down
echo '<option value="0">'.gettext('None').'</option>';
Expand All @@ -55,7 +55,7 @@
<div class="row">
<div class="col-xs-6">
<label for=""><?= gettext('Select Role') ?>:</label>
<select name="GroupRole" id="GroupRole">
<select name="GroupRole" class="form-control input-sm" id="GroupRole">
<option><?= gettext('No Role Selected') ?></option>
</select>
</div>
Expand All @@ -78,8 +78,8 @@
</div>
<div class="row">
<div class="col-xs-6">
<input type="submit" class="btn" name="Submit" value="<?= gettext('Next') ?>">
<input type="button" class="btn" name="Cancel" value="<?= gettext('Cancel') ?>" onclick="javascript:document.location = 'ReportList.php';">
<input type="submit" class="btn btn-primary" name="Submit" value="<?= gettext('Next') ?>">
<input type="button" class="btn btn-default" name="Cancel" value="<?= gettext('Cancel') ?>" onclick="javascript:document.location = 'ReportList.php';">

</div>
</div>
Expand Down Expand Up @@ -147,8 +147,8 @@

<p align="center">
<BR>
<input type="submit" class="btn" name="Submit" value="<?= gettext('Create Report') ?>">
<input type="button" class="btn" name="Cancel" value="<?= gettext('Cancel') ?>" onclick="javascript:document.location = 'Menu.php';">
<input type="submit" class="btn btn-primary" name="Submit" value="<?= gettext('Create Report') ?>">
<input type="button" class="btn btn-default" name="Cancel" value="<?= gettext('Cancel') ?>" onclick="javascript:document.location = 'Menu.php';">
</p>
</form>

Expand Down
15 changes: 6 additions & 9 deletions src/LettersAndLabels.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<tr>
<td class="LabelColumn"><?= gettext("Recipient Naming Method")?>:</td>
<td class="TextColumn">
<select name="recipientnamingmethod">
<select class="form-control input-sm" name="recipientnamingmethod">
<option value="salutationutility"><?= gettext("Salutation Utility") ?></option>
<option value="familyname"><?= gettext("Family Name") ?></option>
</select>
Expand All @@ -75,15 +75,12 @@
</table>
</div>
<div>
<input type="submit" class="btn" name="SubmitNewsLetter" value="<?= gettext('Newsletter labels') ?>">
<input type="submit" class="btn" name="SubmitConfirmReport" value="<?= gettext('Confirm data letter') ?>">
<input type="submit" class="btn" name="SubmitConfirmReportEmail" value="<?= gettext('Confirm data Email') ?>">
<input type="submit" class="btn" name="SubmitConfirmLabels" value="<?= gettext('Confirm data labels') ?>">
<input type="button" class="btn" name="Cancel" value="<?= gettext('Cancel') ?>" onclick="javascript:document.location = 'Menu.php';">
<input type="submit" class="btn btn-default" name="SubmitNewsLetter" value="<?= gettext('Newsletter labels') ?>">
<input type="submit" class="btn btn-default" name="SubmitConfirmReport" value="<?= gettext('Confirm data letter') ?>">
<input type="submit" class="btn btn-default" name="SubmitConfirmReportEmail" value="<?= gettext('Confirm data Email') ?>">
<input type="submit" class="btn btn-default" name="SubmitConfirmLabels" value="<?= gettext('Confirm data labels') ?>">
<input type="button" class="btn btn-default" name="Cancel" value="<?= gettext('Cancel') ?>" onclick="javascript:document.location = 'Menu.php';">
</div>



</form>
</div>
</div>
Expand Down
Binary file modified src/locale/textdomain/fr_FR/LC_MESSAGES/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions src/locale/textdomain/fr_FR/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -9608,3 +9608,6 @@ msgstr "SMS d'EcclesiaCRM"

msgid "Copy Paste the Texts"
msgstr "Copier coller les Textos"

msgid "php format for the date, in English : j/m/y g:i a"
msgstr "format php pour les dates en français : j/m/y G:i"

0 comments on commit 824a8a6

Please sign in to comment.