Work on feature to find a translation key
This commit is contained in:
parent
13746a3c03
commit
cb27b01812
BIN
doc/images/dolibarr_screenshot1_1280x800.jpg
Normal file
BIN
doc/images/dolibarr_screenshot1_1280x800.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
@ -40,6 +40,8 @@ $langcode=GETPOST('langcode','alpha');
|
||||
$transkey=GETPOST('transkey','alpha');
|
||||
$transvalue=GETPOST('transvalue','alpha');
|
||||
|
||||
$mode = GETPOST('mode')?GETPOST('mode'):'overwrite';
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
@ -124,7 +126,7 @@ $formadmin = new FormAdmin($db);
|
||||
$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
|
||||
llxHeader('',$langs->trans("Setup"),$wikihelp);
|
||||
|
||||
print load_fiche_titre($langs->trans("TranslationSetup"),'','title_setup');
|
||||
print load_fiche_titre($langs->trans("Translation"),'','title_setup');
|
||||
|
||||
print $langs->trans("TranslationDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
@ -140,16 +142,24 @@ print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("La
|
||||
|
||||
print '<br>';
|
||||
|
||||
$param='';
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||
{
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("TranslationKeySearch"), '', '')."\n";
|
||||
$param='mode='.$mode;
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
|
||||
$head=translation_prepare_head();
|
||||
|
||||
dol_fiche_head($head, $mode, '', 0, '');
|
||||
|
||||
if ($mode == 'searchkey')
|
||||
{
|
||||
//print '<br>';
|
||||
//print load_fiche_titre($langs->trans("TranslationKeySearch"), '', '')."\n";
|
||||
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="action" name="action" value="search">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -165,7 +175,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||
print "\n";
|
||||
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $formadmin->select_language(GETPOST('langcodesearch'),'langcodesearch',0,null,1,0,0,'',1);
|
||||
print $formadmin->select_language(GETPOST('langcodesearch'),'langcodesearch',0,null,$langs->trans("All"),0,0,'',1);
|
||||
//print '<input type="text" class="flat" size="24" name="langcode" value="'.GETPOST('langcode').'">';
|
||||
print '</td>'."\n";
|
||||
print '<td>';
|
||||
@ -194,13 +204,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
if ($mode == 'overwrite')
|
||||
{
|
||||
//print load_fiche_titre($langs->trans("TranslationOverwriteKey"), '', '')."\n";
|
||||
|
||||
print load_fiche_titre($langs->trans("TranslationOverwriteKey"), '', '')."\n";
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -301,6 +311,10 @@ if ($result)
|
||||
|
||||
print '</table>';
|
||||
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
|
||||
@ -51,14 +51,14 @@ class FormAdmin
|
||||
* @param string $htmlname Name of HTML select
|
||||
* @param int $showauto Show 'auto' choice
|
||||
* @param array $filter Array of keys to exclude in list
|
||||
* @param int $showempty Add empty value
|
||||
* @param string $showempty 1=Add empty value or string to show
|
||||
* @param int $showwarning Show a warning if language is not complete
|
||||
* @param int $disabled Disable edit of select
|
||||
* @param string $morecss Add more css styles
|
||||
* @param int $showcode Add language code into label
|
||||
* @return string Return HTML select string with list of languages
|
||||
*/
|
||||
function select_language($selected='',$htmlname='lang_id',$showauto=0,$filter=null,$showempty=0,$showwarning=0,$disabled=0,$morecss='',$showcode=0)
|
||||
function select_language($selected='',$htmlname='lang_id',$showauto=0,$filter=null,$showempty='',$showwarning=0,$disabled=0,$morecss='',$showcode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -71,7 +71,10 @@ class FormAdmin
|
||||
{
|
||||
$out.= '<option value=""';
|
||||
if ($selected == '') $out.= ' selected';
|
||||
$out.= '> </option>';
|
||||
$out.= '>';
|
||||
if ($showempty != '1') $out.=$showempty;
|
||||
else $out.=' ';
|
||||
$out.='</option>';
|
||||
}
|
||||
if ($showauto)
|
||||
{
|
||||
|
||||
@ -568,6 +568,37 @@ function security_prepare_head()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function translation_prepare_head()
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
|
||||
$head[$h][1] = $langs->trans("TranslationOverwriteKey");
|
||||
$head[$h][2] = 'overwrite';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey";
|
||||
$head[$h][1] = $langs->trans("TranslationKeySearch");
|
||||
$head[$h][2] = 'searchkey';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf,$langs,null,$head,$h,'translation_admin');
|
||||
|
||||
complete_head_from_modules($conf,$langs,null,$head,$h,'translation_admin','remove');
|
||||
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return list of session
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user