Skip to content

Commit

Permalink
Merge pull request #25 from t-oster/master
Browse files Browse the repository at this point in the history
Check if language is available and take "en" otherwise
  • Loading branch information
jasperf committed Jul 12, 2012
2 parents 67dc536 + 691efc7 commit d8ad3af
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
9 changes: 8 additions & 1 deletion include/class.translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ function loadTranslate()
{
$language = $this->getLanguage();

require (TRANSLATE_DIR.$language.'/translate.php');
if (is_file(TRANSLATE_DIR.$language.'/translate.php'))
{
require (TRANSLATE_DIR.$language.'/translate.php');
}
else
{
require (TRANSLATE_DIR.'en/translate.php');
}

$this->LANG = $LANG;

Expand Down
34 changes: 17 additions & 17 deletions include/client/open.inc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
if(!defined('OSTCLIENTINC')) die('Kwaheri rafiki!'); //Say bye to our friend..

$info=($_POST && $errors)?Format::input($_POST):array(); //on error...use the post data
$info=($_POST && $errors)?Format::input($_POST):($_GET ? Format::input($_GET) : array()); //on error...use the post data or use get data if available to prefill fields
?>
<div>
<?if($errors['err']) {?>
Expand All @@ -12,11 +12,11 @@
<p id="warnmessage"><?php echo $warn?></p>
<?}?>
</div>
<div><?php echo $trl->translate('TEXT_PLEASE_FILL_FORM_NEW_TICKET')?></div><br>
<div><?php echo $trl->translate('TEXT_PLEASE_FILL_FORM_NEW_TICKET')?></div><br>
<form action="open.php" method="POST" enctype="multipart/form-data">
<table align="left" cellpadding=2 cellspacing=1 width="90%">
<tr>
<th width="20%"><?php echo $trl->translate('LABEL_FULL_NAME')?>:</th>
<th width="20%"><?php echo $trl->translate('LABEL_FULL_NAME')?>:</th>
<td>
<?if ($thisclient && ($name=$thisclient->getName())) {
?>
Expand Down Expand Up @@ -58,7 +58,7 @@
<?
$services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');
while (list($topicId,$topic) = db_fetch_row($services)){
$selected = ($info['topicId']==$topicId)?'selected':''; ?>
$selected = ($info['topicId']==$topicId || $info['topic']==$topic)?'selected':''; ?>
<option value="<?php echo $topicId?>"<?php echo $selected?>><?php echo $topic?></option>
<?
}?>
Expand Down Expand Up @@ -110,19 +110,19 @@
</td>
</tr>
<?}?>
<?if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) {
if($_POST && $errors && !$errors['captcha'])
$errors['captcha']='Please re-enter the text again';
?>
<tr>
<th valign="top">Captcha Text:</th>
<td><img src="captcha.php" border="0" align="left">
<span>&nbsp;&nbsp;<input type="text" name="captcha" size="7" value="">&nbsp;<i>Enter the text shown on the image.</i></span><br/>
<font class="error">&nbsp;<?php echo $errors['captcha']?></font>
</td>
</tr>
<?}?>
<tr height=2px><td align="left" colspan=2 >&nbsp;</td></tr>
<?if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) {
if($_POST && $errors && !$errors['captcha'])
$errors['captcha']='Please re-enter the text again';
?>
<tr>
<th valign="top">Captcha Text:</th>
<td><img src="captcha.php" border="0" align="left">
<span>&nbsp;&nbsp;<input type="text" name="captcha" size="7" value="">&nbsp;<i>Enter the text shown on the image.</i></span><br/>
<font class="error">&nbsp;<?php echo $errors['captcha']?></font>
</td>
</tr>
<?}?>
<tr height=2px><td align="left" colspan=2 >&nbsp;</td></tr>
<tr>
<td></td>
<td>
Expand Down

0 comments on commit d8ad3af

Please sign in to comment.