27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
41$langs->loadLangs(array(
"companies",
"products",
"admin",
"sms",
"other",
"errors"));
48$action =
GETPOST(
'action',
'aZ09');
49$optioncss =
GETPOST(
'optionscss',
'aZ09');
50$contextpage =
GETPOST(
'contextpage',
'aZ09');
52$mode =
GETPOST(
'mode',
'aZ09') ?
GETPOST(
'mode',
'aZ09') :
'searchkey';
54$langcode =
GETPOST(
'langcode',
'alphanohtml');
55$transkey =
GETPOST(
'transkey',
'alphanohtml');
56if ($mode ==
'searchkey') {
57 $transvalue =
GETPOST(
'transvalue',
'alphanohtml');
59 $transvalue =
GETPOST(
'transvalue',
'restricthtml');
62$entity = $conf->entity;
64 $entity =
GETPOST(
'entity',
'int');
69$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
70$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
72if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
76$offset = $limit * $page;
80 $sortfield =
'lang,transkey';
83 $sortorder =
'ASC,ASC';
87$hookmanager->initHooks(array(
'admintranslation',
'globaladmin'));
95if (
GETPOST(
'cancel',
'alpha')) {
99if (!
GETPOST(
'confirmmassaction',
'alpha') && !empty($massaction) && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
103$parameters = array();
104$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
109include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
112if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
116 $search_array_options = array();
119if ($action ==
'setMAIN_ENABLE_OVERWRITE_TRANSLATION') {
121 dolibarr_set_const($db,
'MAIN_ENABLE_OVERWRITE_TRANSLATION', 1,
'chaine', 0,
'', $conf->entity);
123 dolibarr_set_const($db,
'MAIN_ENABLE_OVERWRITE_TRANSLATION', 0,
'chaine', 0,
'', $conf->entity);
127if ($action ==
'update') {
128 if ($transkey ==
'') {
129 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TranslationKey")),
null,
'errors');
132 if ($transvalue ==
'') {
133 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")),
null,
'errors');
137 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Entity")),
null,
'errors');
143 $sql =
"UPDATE " . MAIN_DB_PREFIX .
"overwrite_trans set transkey = '" . $db->escape(
145 ) .
"', transvalue = '" . $db->escape($transvalue) .
"', entity = '" . $db->escape(
147 ) .
"' WHERE rowid = " . ((int)
GETPOST(
'rowid',
'int'));
149 $result = $db->query($sql);
158 if ($db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
159 setEventMessages($langs->trans(
"WarningAnEntryAlreadyExistForTransKey"),
null,
'warnings');
168if ($action ==
'add') {
171 if (empty($langcode)) {
172 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Language")),
null,
'errors');
175 if ($transkey ==
'') {
176 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"TranslationKey")),
null,
'errors');
179 if ($transvalue ==
'') {
180 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")),
null,
'errors');
186 $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).
")";
187 $result = $db->query($sql);
196 if ($db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
197 setEventMessages($langs->trans(
"WarningAnEntryAlreadyExistForTransKey"),
null,
'warnings');
207if ($action ==
'delete') {
208 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"overwrite_trans WHERE rowid = ".((int) $id);
209 $result = $db->query($sql);
225$form =
new Form($db);
228$wikihelp =
'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
229$title = $langs->trans(
"Translation");
230llxHeader(
'', $title, $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-translation');
232$param =
'&mode='.urlencode($mode);
234$enabledisablehtml =
'';
235$enabledisablehtml .= $langs->trans(
"EnableOverwriteTranslation").
' ';
238 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&token='.
newToken().
'&value=1'.$param.
'">';
239 $enabledisablehtml .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
240 $enabledisablehtml .=
'</a>';
243 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&token='.
newToken().
'&value=0'.$param.
'">';
244 $enabledisablehtml .=
img_picto($langs->trans(
"Activated"),
'switch_on');
245 $enabledisablehtml .=
'</a>';
248$current_language_code = $langs->defaultlang;
250$infoOnCurrentLang = $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"CurrentUserLanguage").
':</span> <strong>'.$s.
' '.$current_language_code.
'</strong>', $langs->trans(
"TranslationDesc")).
'</span><br>';
251if (!empty($conf->dol_optimize_smallscreen)) {
252 $infoOnCurrentLang = 1;
255print
load_fiche_titre($title, $enabledisablehtml,
'language', 0,
'',
'', $infoOnCurrentLang);
258if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
259 $param .=
'&contextpage='.urlencode($contextpage);
261if ($limit > 0 && $limit != $conf->liste_limit) {
262 $param .=
'&limit='.((int) $limit);
264if (isset($optioncss) && $optioncss !=
'') {
265 $param .=
'&optioncss='.urlencode($optioncss);
268 $param .=
'&langcode='.urlencode($langcode);
271 $param .=
'&transkey='.urlencode($transkey);
274 $param .=
'&transvalue='.urlencode($transvalue);
278print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
279if ($optioncss !=
'') {
280 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
282print
'<input type="hidden" name="token" value="'.newToken().
'">';
283print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
284print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
285print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
292$langcode = GETPOSTISSET(
'langcode') ?
GETPOST(
'langcode') : $langs->defaultlang;
295$newlang->setDefaultLang($langcode);
297$langsenfileonly =
new Translate(
'', $conf);
298$langsenfileonly->setDefaultLang(
'en_US');
300$newlangfileonly =
new Translate(
'', $conf);
301$newlangfileonly->setDefaultLang($langcode);
303$recordtoshow = array();
308$listoffiles = array();
309$listoffilesexternalmodules = array();
313foreach ($modulesdir as $keydir => $tmpsearchdir) {
314 $searchdir = $tmpsearchdir;
317 $dir_lang = dirname(dirname($searchdir)).
"/langs/".$langcode;
320 $filearray =
dol_dir_list($dir_lang_osencoded,
'files', 0,
'',
'',
"name", SORT_ASC, 1);
322 foreach ($filearray as $file) {
323 $tmpfile = preg_replace(
'/.lang/i',
'', basename($file[
'name']));
324 $moduledirname = (basename(dirname(dirname($dir_lang))));
328 $langkey .=
'@'.$moduledirname;
333 $result = $newlang->load($langkey, 0, 0,
'', 0);
335 $result = $newlangfileonly->load($langkey, 0, 0,
'', 1);
337 print
'Failed to load language file '.$tmpfile.
'<br>'.
"\n";
339 $listoffiles[$langkey] = $tmpfile;
340 if (strpos($langkey,
'@') !==
false) {
341 $listoffilesexternalmodules[$langkey] = $tmpfile;
347 $result = $langsenfileonly->load($langkey, 0, 0,
'', 1);
352$nbtotaloffiles = count($listoffiles);
353$nbtotaloffilesexternal = count($listoffilesexternalmodules);
355if ($mode ==
'overwrite') {
356 print
'<input type="hidden" name="page" value="'.$page.
'">';
360 $disabled =
' disabled="disabled"';
364 $disablededit =
' disabled';
367 $text = $langs->trans(
"SomeTranslationAreUncomplete");
368 $urlwikitranslatordoc =
'https://wiki.dolibarr.org/index.php/Translator_documentation';
369 $text .=
' - <a href="'.$urlwikitranslatordoc.
'" target="_blank" rel="noopener noreferrer external">'.$langs->trans(
"SeeAlso", $langs->transnoentitiesnoconv(
"Here")).
' '.
img_picto(
'',
'url').
'</a>.<br>';
372 $infoOnTransProcess .=
'<div class="justify">';
373 $infoOnTransProcess .=
'<span class="opacitymedium">';
374 $infoOnTransProcess .= $langs->trans(
"TranslationOverwriteDesc", $langs->transnoentitiesnoconv(
"Language"), $langs->transnoentitiesnoconv(
"TranslationKey"), $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")).
"\n";
375 $infoOnTransProcess .=
' ('.$langs->trans(
"TranslationOverwriteDesc2").
').'.
"<br>\n";
376 $infoOnTransProcess .=
'</span></div>';
380 $infoOnTransProcess .=
info_admin($langs->trans(
"CacheForTranslationIsUsed"), 0, 0,
'1',
'warning');
383 print $infoOnTransProcess;
388 print
'<input type="hidden" name="action" value="'.($action ==
'edit' ?
'update' :
'add').
'">';
389 print
'<input type="hidden" id="mode" name="mode" value="'.$mode.
'">';
391 print
'<div class="div-table-responsive-no-min">';
392 print
'<table class="noborder centpercent">';
393 print
'<tr class="liste_titre">';
394 print_liste_field_titre(
"Language_en_US_es_MX_etc", $_SERVER[
"PHP_SELF"],
'lang,transkey',
'', $param,
'', $sortfield, $sortorder);
395 print_liste_field_titre(
"TranslationKey", $_SERVER[
"PHP_SELF"],
'transkey',
'', $param,
'', $sortfield, $sortorder);
396 print_liste_field_titre(
"NewTranslationStringToShow", $_SERVER[
"PHP_SELF"],
'transvalue',
'', $param,
'', $sortfield, $sortorder);
398 print_liste_field_titre(
"Entity", $_SERVER[
"PHP_SELF"],
'Entity',
'', $param,
'', $sortfield, $sortorder,
'center ');
400 print
'<td align="center"></td>';
407 print
'<tr class="oddeven">';
411 print $formadmin->select_language(
GETPOST(
'langcode'),
'langcode', 0, array(), 1, 0, $disablededit ? 1 : 0,
'minwidth100 maxwidth250', 1);
416 print
'<input type="text" class="flat maxwidthonsmartphone"'.$disablededit.
' name="transkey" id="transkey" value="'.(!empty($transkey) ? $transkey :
"").
'">';
421 print
'<input type="text" class="quatrevingtpercent"'.$disablededit.
' name="transvalue" id="transvalue" value="'.(!empty($transvalue) ? $transvalue :
"").
'">';
426 print
'<td class="center">';
427 print
'<input type="text" class="width50 center"' . $disablededit .
' name="entity" id="entity" value="' . (!empty($entity) ? $entity :
"") .
'">';
431 print
'<td class="center">';
432 print
'<input type="hidden" name="entity" value="'.$conf->entity.
'">';
433 print
'<input type="submit" class="button"'.$disabled.
' value="'.$langs->trans(
"Add").
'" name="add" title="'.
dol_escape_htmltag($langs->trans(
"YouMustEnableTranslationOverwriteBefore")).
'">';
438 $sql =
"SELECT rowid, entity, lang, transkey, transvalue";
439 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
440 $sql .=
" WHERE 1 = 1";
441 $sql .=
" AND entity IN (".getEntity(
'overwrite_trans').
")";
442 $sql .= $db->order($sortfield, $sortorder);
444 dol_syslog(
"translation::select from table", LOG_DEBUG);
445 $result = $db->query($sql);
447 $num = $db->num_rows($result);
451 $obj = $db->fetch_object($result);
455 print
'<tr class="oddeven">';
458 print
'<td>'.dol_escape_htmltag($obj->lang).
'</td>'.
"\n";
462 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
463 print
'<input type="text" class="quatrevingtpercent" name="transkey" value="'.dol_escape_htmltag($obj->transkey).
'">';
470 print
'<td class="small">';
476 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
477 print
'<input type="text" class="quatrevingtpercent" name="transvalue" value="'.dol_escape_htmltag($obj->transvalue).
'">';
480 $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>');
484 print
'<span title="'.dol_escape_htmltag($titleforvalue).
'" class="classfortooltip">';
491 if (
isModEnabled(
'multicompany') && empty($user->entity)) {
492 print
'<td class="center">';
493 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
494 print
'<input type="text" class="flat" size="1" name="entity" value="' . ((int) $obj->entity) .
'">';
500 print
'<input type="hidden" name="const[' . $i .
'][entity]" value="' . ((int) $obj->entity) .
'">';
503 print
'<td class="center">';
504 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
505 print
'<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.
'">';
506 print
'<input type="submit" class="button buttongen button-save" name="save" value="'.dol_escape_htmltag($langs->trans(
"Save")).
'">';
508 print
'<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans(
"Cancel")).
'">';
510 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>';
512 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.$obj->entity.
'&mode='.urlencode($mode).
'&action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
526if ($mode ==
'searchkey') {
531 if (empty($langcode) || $langcode ==
'-1') {
534 if (empty($transkey)) {
537 if (empty($transvalue)) {
541 if ($action ==
'search' && ($nbempty > 999)) {
542 setEventMessages($langs->trans(
"WarningAtLeastKeyOrTranslationRequired"),
null,
'warnings');
545 foreach ($newlang->tab_translate as $key => $val) {
546 $newtranskey = preg_replace(
'/\$$/',
'', preg_replace(
'/^\^/',
'', $transkey));
547 $newtranskeystart = preg_match(
'/^\^/', $transkey);
548 $newtranskeyend = preg_match(
'/\$$/', $transkey);
549 $regexstring = ($newtranskeystart ?
'^' :
'').preg_quote($newtranskey,
'/').($newtranskeyend ?
'$' :
'');
550 if ($transkey && !preg_match(
'/'.$regexstring.
'/i', $key)) {
553 if ($transvalue && !preg_match(
'/'.preg_quote($transvalue,
'/').
'/i', $val)) {
556 $recordtoshow[$key] = $val;
561 $nbtotalofrecordswithoutfilters = count($newlang->tab_translate);
562 $nbtotalofrecords = count($recordtoshow);
564 if (($offset + $num) > $nbtotalofrecords) {
569 $title = $langs->trans(
"Translation");
570 if ($nbtotalofrecords > 0) {
571 $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>';
573 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, -1 * $nbtotalofrecords,
'', 0,
'',
'', $limit, 0, 0, 1);
575 $massactionbutton =
'';
577 print
'<input type="hidden" id="action" name="action" value="search">';
578 print
'<input type="hidden" id="mode" name="mode" value="'.$mode.
'">';
580 print
'<div class="div-table-responsive-no-min">';
581 print
'<table class="noborder centpercent">';
583 print
'<tr class="liste_titre liste_titre_filter"><td>';
584 print $formadmin->select_language($langcode,
'langcode', 0, array(), 0, 0, 0,
'minwidth100 maxwidth250', 1);
587 print
'<input type="text" class="flat maxwidthonsmartphone" name="transkey" value="'.dol_escape_htmltag($transkey).
'">';
589 print
'<input type="text" class="quatrevingtpercent" name="transvalue" value="'.dol_escape_htmltag($transvalue).
'">';
598 print
'<input type="hidden" name="entitysearch" value="'.$conf->entity.
'">';
602 print
'<td class="right nowraponall">';
603 $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0,
'checkforselect', 1);
608 print
'<tr class="liste_titre">';
609 print_liste_field_titre(
"Language_en_US_es_MX_etc", $_SERVER[
"PHP_SELF"],
'lang,transkey',
'', $param,
'', $sortfield, $sortorder);
610 print_liste_field_titre(
"TranslationKey", $_SERVER[
"PHP_SELF"],
'transkey',
'', $param,
'', $sortfield, $sortorder);
611 print_liste_field_titre(
"CurrentTranslationString", $_SERVER[
"PHP_SELF"],
'transvalue',
'', $param,
'', $sortfield, $sortorder);
613 print
'<td align="center"></td>';
617 if ($sortfield ==
'transkey' && strtolower($sortorder) ==
'asc') {
618 ksort($recordtoshow);
620 if ($sortfield ==
'transkey' && strtolower($sortorder) ==
'desc') {
621 krsort($recordtoshow);
623 if ($sortfield ==
'transvalue' && strtolower($sortorder) ==
'asc') {
624 asort($recordtoshow);
626 if ($sortfield ==
'transvalue' && strtolower($sortorder) ==
'desc') {
627 arsort($recordtoshow);
632 foreach ($recordtoshow as $key => $val) {
637 if ($limit && $i > ($offset + $limit)) {
640 print
'<tr class="oddeven"><td>'.dolPrintHTML($langcode).
'</td>';
642 print
'<td class="" title="'.dolPrintHTMLForAttribute($key).
'">'.
dolPrintHTML($key).
'</td>';
643 print
'<td class="tdoverflowmax300 small">';
644 $titleforvalue = $langs->trans(
"Translation").
' en_US for key '.$key.
':<br>';
645 if (!empty($langsenfileonly->tab_translate[$key])) {
646 if (substr_count($langsenfileonly->tab_translate[$key],
'%s') <= 4) {
647 $titleforvalue .= $langsenfileonly->trans($key);
650 $titleforvalue .=
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
652 print
'<span title="'.dolPrintHTMLForAttribute($titleforvalue).
'" class="classfortooltip">';
654 if (substr_count($langsenfileonly->tab_translate[$key] ??
'',
'%s') > 5) {
655 print
'<br><div class="warning">Error, more than 5 %s in the source</div>';
659 print
'<td class="right nowraponall">';
660 if (!empty($newlangfileonly->tab_translate[$key])) {
661 if ($val != $newlangfileonly->tab_translate[$key]) {
663 $sql =
"SELECT rowid";
664 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
665 $sql .=
" WHERE entity IN (".getEntity(
'overwrite_trans').
")";
666 $sql .=
" AND transkey = '".$db->escape($key).
"'";
667 dol_syslog(
"translation::select from table", LOG_DEBUG);
668 $result = $db->query($sql);
671 $obj = $db->fetch_object($result);
673 if (is_object($obj)) {
674 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>';
676 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>';
677 print
' ';
678 $htmltext = $langs->trans(
"OriginalValueWas",
'<i>'.$newlangfileonly->tab_translate[$key].
'</i>');
679 print $form->textwithpicto(
'', $htmltext, 1,
'info');
683 print
'<a class="reposition paddingrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?mode=overwrite&langcode='.urlencode($langcode).
'&transkey='.urlencode($key).
'">'.
img_edit_add($langs->trans(
"TranslationOverwriteKey")).
'</a>';
687 $transifexlangfile =
'$';
689 $transifexurl =
'https://app.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.
'/'.$transifexlangfile.
'?q=key%3A'.$key;
691 print
' <a href="'.$transifexurl.
'" target="transifex">'.
img_picto($langs->trans(
'FixOnTransifex'),
'globe').
'</a>';
695 $sql =
"SELECT rowid";
696 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
697 $sql .=
" WHERE entity IN (".getEntity(
'overwrite_trans').
")";
698 $sql .=
" AND transkey = '".$db->escape($key).
"'";
699 dol_syslog(
"translation::select from table", LOG_DEBUG);
700 $result = $db->query($sql);
703 $obj = $db->fetch_object($result);
705 if (is_object($obj)) {
706 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>';
708 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>';
709 print
' ';
712 $htmltext = $langs->trans(
"TransKeyWithoutOriginalValue", $key);
713 print $form->textwithpicto(
'', $htmltext, 1,
'warning');
720 print
'</td></tr>'.
"\n";
723 if (empty($recordtoshow)) {
724 print
'<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
735if (!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)
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.
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.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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.