27require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
40$langs->loadLangs(array(
"companies",
"products",
"admin",
"sms",
"other",
"errors"));
47$action =
GETPOST(
'action',
'aZ09');
48$optioncss =
GETPOST(
'optionscss',
'aZ09');
49$contextpage =
GETPOST(
'contextpage',
'aZ09');
51$mode =
GETPOST(
'mode',
'aZ09') ?
GETPOST(
'mode',
'aZ09') :
'searchkey';
53$langcode =
GETPOST(
'langcode',
'alphanohtml');
54$transkey =
GETPOST(
'transkey',
'alphanohtml');
55if ($mode ==
'searchkey') {
56 $transvalue =
GETPOST(
'transvalue',
'alphanohtml');
58 $transvalue =
GETPOST(
'transvalue',
'restricthtml');
61$entity =
$conf->entity;
63 $entity =
GETPOST(
'entity',
'int');
68$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
75$offset = $limit * $page;
79 $sortfield =
'lang,transkey';
82 $sortorder =
'ASC,ASC';
86$hookmanager->initHooks(array(
'admintranslation',
'globaladmin'));
94if (
GETPOST(
'cancel',
'alpha')) {
98if (!
GETPOST(
'confirmmassaction',
'alpha') && !empty($massaction) && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
102$parameters = array();
103$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
108include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
111if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
115 $search_array_options = array();
118if ($action ==
'setMAIN_ENABLE_OVERWRITE_TRANSLATION') {
126if ($action ==
'update') {
127 if ($transkey ==
'') {
128 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TranslationKey")),
null,
'errors');
131 if ($transvalue ==
'') {
132 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")),
null,
'errors');
136 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Entity")),
null,
'errors');
142 $sql =
"UPDATE " . MAIN_DB_PREFIX .
"overwrite_trans set transkey = '" .
$db->escape(
144 ) .
"', transvalue = '" .
$db->escape($transvalue) .
"', entity = '" .
$db->escape(
146 ) .
"' WHERE rowid = " . ((int)
GETPOST(
'rowid',
'int'));
148 $result =
$db->query($sql);
157 if (
$db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
158 setEventMessages($langs->trans(
"WarningAnEntryAlreadyExistForTransKey"),
null,
'warnings');
167if ($action ==
'add') {
170 if (empty($langcode)) {
171 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Language")),
null,
'errors');
174 if ($transkey ==
'') {
175 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TranslationKey")),
null,
'errors');
178 if ($transvalue ==
'') {
179 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")),
null,
'errors');
185 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".
$db->escape($langcode).
"','".
$db->escape($transkey).
"','".
$db->escape($transvalue).
"', ".((int)
$conf->entity).
")";
186 $result =
$db->query($sql);
195 if (
$db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
196 setEventMessages($langs->trans(
"WarningAnEntryAlreadyExistForTransKey"),
null,
'warnings');
206if ($action ==
'delete') {
207 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"overwrite_trans WHERE rowid = ".((int) $id);
208 $result =
$db->query($sql);
227$wikihelp =
'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
228$title = $langs->trans(
"Translation");
229llxHeader(
'', $title, $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-translation');
231$param =
'&mode='.urlencode($mode);
233$enabledisablehtml =
'<span class="divfilteralone">';
236 $enabledisablehtml .=
'<a class="reposition valignmiddle nounderlineimp" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&token='.newToken().
'&value=1'.$param.
'">';
238 $enabledisablehtml .=
'<a class="reposition valignmiddle nounderlineimp" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&token='.newToken().
'&value=0'.$param.
'">';
240$enabledisablehtml .= $langs->trans(
"EnableOverwriteTranslation");
243 $enabledisablehtml .=
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="paddingleft valignmiddle"');
246 $enabledisablehtml .=
img_picto($langs->trans(
"Activated"),
'switch_on',
'class="paddingleft valignmiddle"');
248$enabledisablehtml .=
'</a>';
249$enabledisablehtml .=
'</span>';
251$current_language_code = $langs->defaultlang;
253$infoOnCurrentLang = $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"CurrentUserLanguage").
':</span> <strong>'.$s.
' '.$current_language_code.
'</strong>', $langs->trans(
"TranslationDesc")).
'</span><br>';
254if (!empty(
$conf->dol_optimize_smallscreen)) {
255 $infoOnCurrentLang = 1;
258print
load_fiche_titre($title, $enabledisablehtml,
'language', 0,
'',
'', $infoOnCurrentLang);
261if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
262 $param .=
'&contextpage='.urlencode($contextpage);
264if ($limit > 0 && $limit !=
$conf->liste_limit) {
265 $param .=
'&limit='.((int) $limit);
267if (isset($optioncss) && $optioncss !=
'') {
268 $param .=
'&optioncss='.urlencode($optioncss);
271 $param .=
'&langcode='.urlencode($langcode);
274 $param .=
'&transkey='.urlencode($transkey);
277 $param .=
'&transvalue='.urlencode($transvalue);
281print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
282if ($optioncss !=
'') {
283 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
285print
'<input type="hidden" name="token" value="'.newToken().
'">';
286print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
287print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
288print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
295$langcode = GETPOSTISSET(
'langcode') ?
GETPOST(
'langcode') : $langs->defaultlang;
298$newlang->setDefaultLang($langcode);
301$langsenfileonly->setDefaultLang(
'en_US');
304$newlangfileonly->setDefaultLang($langcode);
306$recordtoshow = array();
311$listoffiles = array();
312$listoffilesexternalmodules = array();
316foreach ($modulesdir as $keydir => $tmpsearchdir) {
317 $searchdir = $tmpsearchdir;
320 $dir_lang = dirname(dirname($searchdir)).
"/langs/".$langcode;
323 $filearray =
dol_dir_list($dir_lang_osencoded,
'files', 0,
'',
'',
"name", SORT_ASC, 1);
325 foreach ($filearray as $file) {
326 $tmpfile = preg_replace(
'/.lang/i',
'', basename($file[
'name']));
327 $moduledirname = (basename(dirname(dirname($dir_lang))));
331 $langkey .=
'@'.$moduledirname;
336 $result = $newlang->load($langkey, 0, 0,
'', 0);
338 $result = $newlangfileonly->load($langkey, 0, 0,
'', 1);
340 print
'Failed to load language file '.$tmpfile.
'<br>'.
"\n";
342 $listoffiles[$langkey] = $tmpfile;
343 if (strpos($langkey,
'@') !==
false) {
344 $listoffilesexternalmodules[$langkey] = $tmpfile;
350 $result = $langsenfileonly->load($langkey, 0, 0,
'', 1);
355$nbtotaloffiles = count($listoffiles);
356$nbtotaloffilesexternal = count($listoffilesexternalmodules);
358if ($mode ==
'overwrite') {
359 print
'<input type="hidden" name="page" value="'.$page.
'">';
363 $disabled =
' disabled="disabled"';
367 $disablededit =
' disabled';
370 $text = $langs->trans(
"SomeTranslationAreUncomplete");
371 $urlwikitranslatordoc =
'https://wiki.dolibarr.org/index.php/Translator_documentation';
372 $text .=
' - <a href="'.$urlwikitranslatordoc.
'" target="_blank" rel="noopener noreferrer external">'.$langs->trans(
"SeeAlso", $langs->transnoentitiesnoconv(
"Here")).
' '.
img_picto(
'',
'url').
'</a>.<br>';
375 $infoOnTransProcess .=
'<div class="justify info">';
376 $infoOnTransProcess .=
'<span class="">';
377 $infoOnTransProcess .= $langs->trans(
"TranslationOverwriteDesc", $langs->transnoentitiesnoconv(
"Language"), $langs->transnoentitiesnoconv(
"TranslationKey"), $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")).
"\n";
378 $infoOnTransProcess .=
' ('.$langs->trans(
"TranslationOverwriteDesc2").
').'.
"<br>\n";
379 $infoOnTransProcess .=
'</span></div>';
383 $infoOnTransProcess .=
info_admin($langs->trans(
"CacheForTranslationIsUsed"), 0, 0,
'1',
'warning');
386 print $infoOnTransProcess;
391 print
'<input type="hidden" name="action" value="'.($action ==
'edit' ?
'update' :
'add').
'">';
392 print
'<input type="hidden" id="mode" name="mode" value="'.$mode.
'">';
394 print
'<div class="div-table-responsive-no-min">';
395 print
'<table class="noborder centpercent">';
396 print
'<tr class="liste_titre">';
397 print_liste_field_titre(
"Language_en_US_es_MX_etc", $_SERVER[
"PHP_SELF"],
'lang,transkey',
'', $param,
'', $sortfield, $sortorder);
398 print_liste_field_titre(
"TranslationKey", $_SERVER[
"PHP_SELF"],
'transkey',
'', $param,
'', $sortfield, $sortorder);
399 print_liste_field_titre(
"NewTranslationStringToShow", $_SERVER[
"PHP_SELF"],
'transvalue',
'', $param,
'', $sortfield, $sortorder);
401 print_liste_field_titre(
"Entity", $_SERVER[
"PHP_SELF"],
'Entity',
'', $param,
'', $sortfield, $sortorder,
'center ');
410 print
'<tr class="oddeven">';
414 print $formadmin->select_language(
GETPOST(
'langcode'),
'langcode', 0, array(), 1, 0, $disablededit ? 1 : 0,
'minwidth100 maxwidth250', 1);
419 print
'<input type="text" class="flat maxwidthonsmartphone"'.$disablededit.
' name="transkey" id="transkey" value="'.(!empty($transkey) ? $transkey :
"").
'">';
424 print
'<input type="text" class="quatrevingtpercent"'.$disablededit.
' name="transvalue" id="transvalue" value="'.(!empty($transvalue) ? $transvalue :
"").
'">';
429 print
'<td class="center">';
430 print
'<input type="text" class="width50 center"' . $disablededit .
' name="entity" id="entity" value="' . (!empty($entity) ? $entity :
"") .
'">';
434 print
'<td class="center">';
435 print
'<input type="hidden" name="entity" value="'.$conf->entity.
'">';
436 print
'<input type="submit" class="button"'.$disabled.
' value="'.$langs->trans(
"Add").
'" name="add" title="'.
dol_escape_htmltag($langs->trans(
"YouMustEnableTranslationOverwriteBefore")).
'">';
441 $sql =
"SELECT rowid, entity, lang, transkey, transvalue";
442 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
443 $sql .=
" WHERE 1 = 1";
444 $sql .=
" AND entity IN (".getEntity(
'overwrite_trans').
")";
445 $sql .=
$db->order($sortfield, $sortorder);
447 dol_syslog(
"translation::select from table", LOG_DEBUG);
448 $result =
$db->query($sql);
450 $num =
$db->num_rows($result);
454 $obj =
$db->fetch_object($result);
458 print
'<tr class="oddeven">';
461 print
'<td>'.dol_escape_htmltag($obj->lang).
'</td>'.
"\n";
465 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
466 print
'<input type="text" class="quatrevingtpercent" name="transkey" value="'.dol_escape_htmltag($obj->transkey).
'">';
473 print
'<td class="small">';
479 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
480 print
'<input type="text" class="quatrevingtpercent" name="transvalue" value="'.dol_escape_htmltag($obj->transvalue).
'">';
483 $titleforvalue = $langs->trans(
"Translation").
' en_US for key '.$obj->transkey.
':<br>'.(!empty($langsenfileonly->tab_translate[$obj->transkey]) ? $langsenfileonly->trans($obj->transkey) :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>');
487 print
'<span title="'.dol_escape_htmltag($titleforvalue).
'" class="classfortooltip">';
494 if (
isModEnabled(
'multicompany') && empty($user->entity)) {
495 print
'<td class="center">';
496 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
497 print
'<input type="text" class="flat" size="1" name="entity" value="' . ((int) $obj->entity) .
'">';
503 print
'<input type="hidden" name="const[' . $i .
'][entity]" value="' . ((int) $obj->entity) .
'">';
506 print
'<td class="center">';
507 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
508 print
'<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.
'">';
509 print
'<input type="submit" class="button buttongen button-save" name="save" value="'.dol_escape_htmltag($langs->trans(
"Save")).
'">';
511 print
'<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans(
"Cancel")).
'">';
513 print
'<a class="reposition editfielda paddingrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.$obj->entity.
'&mode='.urlencode($mode).
'&action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
515 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.$obj->entity.
'&mode='.urlencode($mode).
'&action=delete&token='.newToken().
'">'.
img_delete().
'</a>';
529if ($mode ==
'searchkey') {
534 if (empty($langcode) || $langcode ==
'-1') {
537 if (empty($transkey)) {
540 if (empty($transvalue)) {
544 if ($action ==
'search' && ($nbempty > 999)) {
545 setEventMessages($langs->trans(
"WarningAtLeastKeyOrTranslationRequired"),
null,
'warnings');
548 foreach ($newlang->tab_translate as $key => $val) {
549 $newtranskey = preg_replace(
'/\$$/',
'', preg_replace(
'/^\^/',
'', $transkey));
550 $newtranskeystart = preg_match(
'/^\^/', $transkey);
551 $newtranskeyend = preg_match(
'/\$$/', $transkey);
552 $regexstring = ($newtranskeystart ?
'^' :
'').preg_quote($newtranskey,
'/').($newtranskeyend ?
'$' :
'');
553 if ($transkey && !preg_match(
'/'.$regexstring.
'/i', $key)) {
556 if ($transvalue && !preg_match(
'/'.preg_quote($transvalue,
'/').
'/i', $val)) {
559 $recordtoshow[$key] = $val;
564 $nbtotalofrecordswithoutfilters = count($newlang->tab_translate);
565 $nbtotalofrecords = count($recordtoshow);
567 if (($offset + $num) > $nbtotalofrecords) {
572 $title = $langs->trans(
"Translation");
573 if ($nbtotalofrecords > 0) {
574 $title .=
' <span class="opacitymedium colorblack paddingleft small">('.$nbtotalofrecords.
' / '.$nbtotalofrecordswithoutfilters.
' - <span title="'.
dol_escape_htmltag(($nbtotaloffiles - $nbtotaloffilesexternal).
' core - '.($nbtotaloffilesexternal).
' external').
'">'.$nbtotaloffiles.
' '.$langs->trans(
"Files").
'</span>)</span>';
576 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, -1 * $nbtotalofrecords,
'', 0,
'',
'', $limit, 0, 0, 1);
578 $massactionbutton =
'';
580 print
'<input type="hidden" id="action" name="action" value="search">';
581 print
'<input type="hidden" id="mode" name="mode" value="'.$mode.
'">';
583 print
'<div class="div-table-responsive-no-min">';
584 print
'<table class="noborder centpercent">';
586 print
'<tr class="liste_titre liste_titre_filter">';
588 if (
$conf->main_checkbox_left_column) {
589 print
'<td class="center nowraponall">';
590 $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0,
'checkforselect', 1);
595 print $formadmin->select_language($langcode,
'langcode', 0, array(), 0, 0, 0,
'minwidth100 maxwidth250', 1);
598 print
'<input type="text" class="flat maxwidthonsmartphone" name="transkey" value="'.dol_escape_htmltag($transkey).
'">';
600 print
'<input type="text" class="quatrevingtpercent" name="transvalue" value="'.dol_escape_htmltag($transvalue).
'">';
601 print
'<input type="hidden" name="entitysearch" value="'.$conf->entity.
'">';
605 if (!
$conf->main_checkbox_left_column) {
606 print
'<td class="right nowraponall">';
607 $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0,
'checkforselect', 1);
613 print
'<tr class="liste_titre">';
615 if (
$conf->main_checkbox_left_column) {
618 print_liste_field_titre(
"Language_en_US_es_MX_etc", $_SERVER[
"PHP_SELF"],
'lang,transkey',
'', $param,
'', $sortfield, $sortorder);
619 print_liste_field_titre(
"TranslationKey", $_SERVER[
"PHP_SELF"],
'transkey',
'', $param,
'', $sortfield, $sortorder);
620 print_liste_field_titre(
"CurrentTranslationString", $_SERVER[
"PHP_SELF"],
'transvalue',
'', $param,
'', $sortfield, $sortorder);
623 if (!
$conf->main_checkbox_left_column) {
629 if ($sortfield ==
'transkey' && strtolower($sortorder) ==
'asc') {
630 ksort($recordtoshow);
632 if ($sortfield ==
'transkey' && strtolower($sortorder) ==
'desc') {
633 krsort($recordtoshow);
635 if ($sortfield ==
'transvalue' && strtolower($sortorder) ==
'asc') {
636 asort($recordtoshow);
638 if ($sortfield ==
'transvalue' && strtolower($sortorder) ==
'desc') {
639 arsort($recordtoshow);
644 foreach ($recordtoshow as $key => $val) {
649 if ($limit && $i > ($offset + $limit)) {
653 print
'<tr class="oddeven">';
655 if (
$conf->main_checkbox_left_column) {
656 print
'<td class="center nowraponall">';
660 print
'<td>'.dolPrintHTML($langcode).
'</td>';
662 print
'<td class="" title="'.dolPrintHTMLForAttribute($key).
'">'.
dolPrintHTML($key).
'</td>';
663 print
'<td class="tdoverflowmax300 small">';
664 $titleforvalue = $langs->trans(
"Translation").
' en_US for key '.$key.
':<br>';
665 if (!empty($langsenfileonly->tab_translate[$key])) {
666 if (substr_count($langsenfileonly->tab_translate[$key],
'%s') <= 4) {
667 $titleforvalue .= $langsenfileonly->trans($key);
670 $titleforvalue .=
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
672 print
'<span title="'.dolPrintHTMLForAttribute($titleforvalue).
'" class="classfortooltip">';
674 if (substr_count($langsenfileonly->tab_translate[$key] ??
'',
'%s') > 5) {
675 print
'<br><div class="warning">Error, more than 5 %s in the source</div>';
680 print
'<td class="right nowraponall">';
681 if (!empty($newlangfileonly->tab_translate[$key])) {
682 if ($val != $newlangfileonly->tab_translate[$key]) {
684 $sql =
"SELECT rowid";
685 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
686 $sql .=
" WHERE entity IN (".getEntity(
'overwrite_trans').
")";
687 $sql .=
" AND transkey = '".$db->escape($key).
"'";
688 dol_syslog(
"translation::select from table", LOG_DEBUG);
689 $result =
$db->query($sql);
692 $obj =
$db->fetch_object($result);
694 if (is_object($obj)) {
695 print
'<a class="editfielda reposition marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.
$conf->entity.
'&mode=overwrite&action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
697 print
'<a class="marginleftonly marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.
$conf->entity.
'&mode='.urlencode($mode).
'&action=delete&token='.newToken().
'&mode='.urlencode($mode).
'">'.
img_delete().
'</a>';
698 print
' ';
699 $htmltext = $langs->trans(
"OriginalValueWas",
'<i>'.$newlangfileonly->tab_translate[$key].
'</i>');
700 print $form->textwithpicto(
'', $htmltext, 1,
'info');
704 print
'<a class="reposition paddingrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?mode=overwrite&langcode='.urlencode($langcode).
'&transkey='.urlencode($key).
'">'.
img_edit_add($langs->trans(
"TranslationOverwriteKey")).
'</a>';
708 $transifexlangfile =
'$';
710 $transifexurl =
'https://app.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.
'/'.$transifexlangfile.
'?q=key%3A'.$key;
712 print
' <a href="'.$transifexurl.
'" target="transifex">'.
img_picto($langs->trans(
'FixOnTransifex'),
'globe').
'</a>';
716 $sql =
"SELECT rowid";
717 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
718 $sql .=
" WHERE entity IN (".getEntity(
'overwrite_trans').
")";
719 $sql .=
" AND transkey = '".$db->escape($key).
"'";
720 dol_syslog(
"translation::select from table", LOG_DEBUG);
721 $result =
$db->query($sql);
724 $obj =
$db->fetch_object($result);
726 if (is_object($obj)) {
727 print
'<a class="editfielda reposition marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.
$conf->entity.
'&mode=overwrite&action=edit&token='.newToken().
'">'.
img_edit().
'</a>';
729 print
'<a class="marginleftonly marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.
$conf->entity.
'&mode='.urlencode($mode).
'&action=delete&token='.newToken().
'&mode='.urlencode($mode).
'">'.
img_delete().
'</a>';
730 print
' ';
733 $htmltext = $langs->trans(
"TransKeyWithoutOriginalValue", $key);
734 print $form->textwithpicto(
'', $htmltext, 1,
'warning');
740 if (!
$conf->main_checkbox_left_column) {
746 if (empty($recordtoshow)) {
747 print
'<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
758if (!empty($langcode)) {
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
translation_prepare_head()
Prepare array with list of tabs.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage translations.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dolGetModulesDirs($subdir='')
Return list of directories that contain modules.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_set_focus($selector)
Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
img_edit_add($titlealt='default', $other='')
Show logo "+".
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.