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;
63if (isModEnabled(
'multicompany') && !$user->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') {
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';
229llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-translation');
231$param =
'&mode='.urlencode($mode);
233$enabledisablehtml =
'';
234$enabledisablehtml .= $langs->trans(
"EnableOverwriteTranslation").
' ';
237 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&token='.
newToken().
'&value=1'.$param.
'">';
238 $enabledisablehtml .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
239 $enabledisablehtml .=
'</a>';
242 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMAIN_ENABLE_OVERWRITE_TRANSLATION&token='.
newToken().
'&value=0'.$param.
'">';
243 $enabledisablehtml .=
img_picto($langs->trans(
"Activated"),
'switch_on');
244 $enabledisablehtml .=
'</a>';
247$current_language_code = $langs->defaultlang;
249$infoOnCurrentLang = $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"CurrentUserLanguage").
':</span> <strong>'.$s.
' '.$current_language_code.
'</strong>', $langs->trans(
"TranslationDesc")).
'</span><br>';
250if (!empty(
$conf->dol_optimize_smallscreen)) {
251 $infoOnCurrentLang = 1;
254print
load_fiche_titre($langs->trans(
"Translation"), $enabledisablehtml,
'language', 0,
'',
'', $infoOnCurrentLang);
257if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
258 $param .=
'&contextpage='.urlencode($contextpage);
260if ($limit > 0 && $limit !=
$conf->liste_limit) {
261 $param .=
'&limit='.((int) $limit);
263if (isset($optioncss) && $optioncss !=
'') {
264 $param .=
'&optioncss='.urlencode($optioncss);
267 $param .=
'&langcode='.urlencode($langcode);
270 $param .=
'&transkey='.urlencode($transkey);
273 $param .=
'&transvalue='.urlencode($transvalue);
277print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
278if ($optioncss !=
'') {
279 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
281print
'<input type="hidden" name="token" value="'.newToken().
'">';
282print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
283print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
284print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
291$langcode = GETPOSTISSET(
'langcode') ?
GETPOST(
'langcode') : $langs->defaultlang;
294$newlang->setDefaultLang($langcode);
297$langsenfileonly->setDefaultLang(
'en_US');
300$newlangfileonly->setDefaultLang($langcode);
302$recordtoshow = array();
307$listoffiles = array();
308$listoffilesexternalmodules = array();
312foreach ($modulesdir as $keydir => $tmpsearchdir) {
313 $searchdir = $tmpsearchdir;
316 $dir_lang = dirname(dirname($searchdir)).
"/langs/".$langcode;
319 $filearray =
dol_dir_list($dir_lang_osencoded,
'files', 0,
'',
'',
"name", SORT_ASC, 1);
321 foreach ($filearray as $file) {
322 $tmpfile = preg_replace(
'/.lang/i',
'', basename($file[
'name']));
323 $moduledirname = (basename(dirname(dirname($dir_lang))));
327 $langkey .=
'@'.$moduledirname;
332 $result = $newlang->load($langkey, 0, 0,
'', 0);
334 $result = $newlangfileonly->load($langkey, 0, 0,
'', 1);
336 print
'Failed to load language file '.$tmpfile.
'<br>'.
"\n";
338 $listoffiles[$langkey] = $tmpfile;
339 if (strpos($langkey,
'@') !==
false) {
340 $listoffilesexternalmodules[$langkey] = $tmpfile;
346 $result = $langsenfileonly->load($langkey, 0, 0,
'', 1);
351$nbtotaloffiles = count($listoffiles);
352$nbtotaloffilesexternal = count($listoffilesexternalmodules);
354if ($mode ==
'overwrite') {
355 print
'<input type="hidden" name="page" value="'.$page.
'">';
359 $disabled =
' disabled="disabled"';
363 $disablededit =
' disabled';
366 $text = $langs->trans(
"SomeTranslationAreUncomplete");
367 $urlwikitranslatordoc =
'https://wiki.dolibarr.org/index.php/Translator_documentation';
368 $text .=
' - <a href="'.$urlwikitranslatordoc.
'" target="_blank" rel="noopener noreferrer external">'.$langs->trans(
"SeeAlso", $langs->transnoentitiesnoconv(
"Here")).
' '.
img_picto(
'',
'url').
'</a>.<br>';
371 $infoOnTransProcess .=
'<div class="justify">';
372 $infoOnTransProcess .=
'<span class="opacitymedium">';
373 $infoOnTransProcess .= $langs->trans(
"TranslationOverwriteDesc", $langs->transnoentitiesnoconv(
"Language"), $langs->transnoentitiesnoconv(
"TranslationKey"), $langs->transnoentitiesnoconv(
"NewTranslationStringToShow")).
"\n";
374 $infoOnTransProcess .=
' ('.$langs->trans(
"TranslationOverwriteDesc2").
').'.
"<br>\n";
375 $infoOnTransProcess .=
'</span></div>';
378 if (isModEnabled(
'memcached') ||
getDolGlobalInt(
'MAIN_USE_CACHE_FOR_TRANSLATION')) {
379 $infoOnTransProcess .=
info_admin($langs->trans(
"CacheForTranslationIsUsed"), 0, 0,
'1',
'warning');
382 print $infoOnTransProcess;
387 print
'<input type="hidden" name="action" value="'.($action ==
'edit' ?
'update' :
'add').
'">';
388 print
'<input type="hidden" id="mode" name="mode" value="'.$mode.
'">';
390 print
'<div class="div-table-responsive-no-min">';
391 print
'<table class="noborder centpercent">';
392 print
'<tr class="liste_titre">';
393 print_liste_field_titre(
"Language_en_US_es_MX_etc", $_SERVER[
"PHP_SELF"],
'lang,transkey',
'', $param,
'', $sortfield, $sortorder);
394 print_liste_field_titre(
"TranslationKey", $_SERVER[
"PHP_SELF"],
'transkey',
'', $param,
'', $sortfield, $sortorder);
395 print_liste_field_titre(
"NewTranslationStringToShow", $_SERVER[
"PHP_SELF"],
'transvalue',
'', $param,
'', $sortfield, $sortorder);
396 if (isModEnabled(
'multicompany') && !$user->entity) {
397 print_liste_field_titre(
"Entity", $_SERVER[
"PHP_SELF"],
'Entity',
'', $param,
'', $sortfield, $sortorder,
'center ');
399 print
'<td align="center"></td>';
406 print
'<tr class="oddeven">';
410 print $formadmin->select_language(
GETPOST(
'langcode'),
'langcode', 0, array(), 1, 0, $disablededit ? 1 : 0,
'minwidth100 maxwidth250', 1);
415 print
'<input type="text" class="flat maxwidthonsmartphone"'.$disablededit.
' name="transkey" id="transkey" value="'.(!empty($transkey) ? $transkey :
"").
'">';
420 print
'<input type="text" class="quatrevingtpercent"'.$disablededit.
' name="transvalue" id="transvalue" value="'.(!empty($transvalue) ? $transvalue :
"").
'">';
424 if (isModEnabled(
'multicompany') && !$user->entity) {
425 print
'<td class="center">';
426 print
'<input type="text" class="width50 center"' . $disablededit .
' name="entity" id="entity" value="' . (!empty($entity) ? $entity :
"") .
'">';
430 print
'<td class="center">';
431 print
'<input type="hidden" name="entity" value="'.$conf->entity.
'">';
432 print
'<input type="submit" class="button"'.$disabled.
' value="'.$langs->trans(
"Add").
'" name="add" title="'.
dol_escape_htmltag($langs->trans(
"YouMustEnableTranslationOverwriteBefore")).
'">';
437 $sql =
"SELECT rowid, entity, lang, transkey, transvalue";
438 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
439 $sql .=
" WHERE 1 = 1";
440 $sql .=
" AND entity IN (".getEntity(
'overwrite_trans').
")";
441 $sql .= $db->order($sortfield, $sortorder);
443 dol_syslog(
"translation::select from table", LOG_DEBUG);
444 $result = $db->query($sql);
446 $num = $db->num_rows($result);
450 $obj = $db->fetch_object($result);
454 print
'<tr class="oddeven">';
457 print
'<td>'.dol_escape_htmltag($obj->lang).
'</td>'.
"\n";
461 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
462 print
'<input type="text" class="quatrevingtpercent" name="transkey" value="'.dol_escape_htmltag($obj->transkey).
'">';
469 print
'<td class="small">';
475 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
476 print
'<input type="text" class="quatrevingtpercent" name="transvalue" value="'.dol_escape_htmltag($obj->transvalue).
'">';
479 $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>');
483 print
'<span title="'.dol_escape_htmltag($titleforvalue).
'" class="classfortooltip">';
490 if (isModEnabled(
'multicompany') && empty($user->entity)) {
491 print
'<td class="center">';
492 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
493 print
'<input type="text" class="flat" size="1" name="entity" value="' . ((int) $obj->entity) .
'">';
499 print
'<input type="hidden" name="const[' . $i .
'][entity]" value="' . ((int) $obj->entity) .
'">';
502 print
'<td class="center">';
503 if ($action ==
'edit' && $obj->rowid ==
GETPOSTINT(
'rowid')) {
504 print
'<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.
'">';
505 print
'<input type="submit" class="button buttongen button-save" name="save" value="'.dol_escape_htmltag($langs->trans(
"Save")).
'">';
507 print
'<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans(
"Cancel")).
'">';
509 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>';
511 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?rowid='.$obj->rowid.
'&entity='.$obj->entity.
'&mode='.urlencode($mode).
'&action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
525if ($mode ==
'searchkey') {
530 if (empty($langcode) || $langcode ==
'-1') {
533 if (empty($transkey)) {
536 if (empty($transvalue)) {
540 if ($action ==
'search' && ($nbempty > 999)) {
541 setEventMessages($langs->trans(
"WarningAtLeastKeyOrTranslationRequired"),
null,
'warnings');
544 foreach ($newlang->tab_translate as $key => $val) {
545 $newtranskey = preg_replace(
'/\$$/',
'', preg_replace(
'/^\^/',
'', $transkey));
546 $newtranskeystart = preg_match(
'/^\^/', $transkey);
547 $newtranskeyend = preg_match(
'/\$$/', $transkey);
548 $regexstring = ($newtranskeystart ?
'^' :
'').preg_quote($newtranskey,
'/').($newtranskeyend ?
'$' :
'');
549 if ($transkey && !preg_match(
'/'.$regexstring.
'/i', $key)) {
552 if ($transvalue && !preg_match(
'/'.preg_quote($transvalue,
'/').
'/i', $val)) {
555 $recordtoshow[$key] = $val;
560 $nbtotalofrecordswithoutfilters = count($newlang->tab_translate);
561 $nbtotalofrecords = count($recordtoshow);
563 if (($offset + $num) > $nbtotalofrecords) {
568 $title = $langs->trans(
"Translation");
569 if ($nbtotalofrecords > 0) {
570 $title .=
' <span class="opacitymedium colorblack paddingleft">('.$nbtotalofrecords.
' / '.$nbtotalofrecordswithoutfilters.
' - <span title="'.
dol_escape_htmltag(($nbtotaloffiles - $nbtotaloffilesexternal).
' core - '.($nbtotaloffilesexternal).
' external').
'">'.$nbtotaloffiles.
' '.$langs->trans(
"Files").
'</span>)</span>';
572 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, -1 * $nbtotalofrecords,
'', 0,
'',
'', $limit, 0, 0, 1);
574 $massactionbutton =
'';
576 print
'<input type="hidden" id="action" name="action" value="search">';
577 print
'<input type="hidden" id="mode" name="mode" value="'.$mode.
'">';
579 print
'<div class="div-table-responsive-no-min">';
580 print
'<table class="noborder centpercent">';
582 print
'<tr class="liste_titre liste_titre_filter"><td>';
583 print $formadmin->select_language($langcode,
'langcode', 0, array(), 0, 0, 0,
'minwidth100 maxwidth250', 1);
586 print
'<input type="text" class="flat maxwidthonsmartphone" name="transkey" value="'.dol_escape_htmltag($transkey).
'">';
588 print
'<input type="text" class="quatrevingtpercent" name="transvalue" value="'.dol_escape_htmltag($transvalue).
'">';
597 print
'<input type="hidden" name="entitysearch" value="'.$conf->entity.
'">';
601 print
'<td class="right nowraponall">';
602 $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0,
'checkforselect', 1);
607 print
'<tr class="liste_titre">';
608 print_liste_field_titre(
"Language_en_US_es_MX_etc", $_SERVER[
"PHP_SELF"],
'lang,transkey',
'', $param,
'', $sortfield, $sortorder);
609 print_liste_field_titre(
"TranslationKey", $_SERVER[
"PHP_SELF"],
'transkey',
'', $param,
'', $sortfield, $sortorder);
610 print_liste_field_titre(
"CurrentTranslationString", $_SERVER[
"PHP_SELF"],
'transvalue',
'', $param,
'', $sortfield, $sortorder);
612 print
'<td align="center"></td>';
616 if ($sortfield ==
'transkey' && strtolower($sortorder) ==
'asc') {
617 ksort($recordtoshow);
619 if ($sortfield ==
'transkey' && strtolower($sortorder) ==
'desc') {
620 krsort($recordtoshow);
622 if ($sortfield ==
'transvalue' && strtolower($sortorder) ==
'asc') {
623 asort($recordtoshow);
625 if ($sortfield ==
'transvalue' && strtolower($sortorder) ==
'desc') {
626 arsort($recordtoshow);
631 foreach ($recordtoshow as $key => $val) {
636 if ($limit && $i > ($offset + $limit)) {
639 print
'<tr class="oddeven"><td>'.dolPrintHTML($langcode).
'</td>';
641 print
'<td class="" title="'.dolPrintHTMLForAttribute($key).
'">'.
dolPrintHTML($key).
'</td>';
642 print
'<td class="tdoverflowmax300 small">';
643 $titleforvalue = $langs->trans(
"Translation").
' en_US for key '.$key.
':<br>';
644 if (!empty($langsenfileonly->tab_translate[$key])) {
645 if (substr_count($langsenfileonly->tab_translate[$key],
'%s') <= 4) {
646 $titleforvalue .= $langsenfileonly->trans($key);
649 $titleforvalue .=
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
651 print
'<span title="'.dolPrintHTMLForAttribute($titleforvalue).
'" class="classfortooltip">';
653 if (substr_count($langsenfileonly->tab_translate[$key] ??
'',
'%s') > 5) {
654 print
'<br><div class="warning">Error, more than 5 %s in the source</div>';
658 print
'<td class="right nowraponall">';
659 if (!empty($newlangfileonly->tab_translate[$key])) {
660 if ($val != $newlangfileonly->tab_translate[$key]) {
662 $sql =
"SELECT rowid";
663 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
664 $sql .=
" WHERE entity IN (".getEntity(
'overwrite_trans').
")";
665 $sql .=
" AND transkey = '".$db->escape($key).
"'";
666 dol_syslog(
"translation::select from table", LOG_DEBUG);
667 $result = $db->query($sql);
670 $obj = $db->fetch_object($result);
672 if (is_object($obj)) {
673 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>';
675 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>';
676 print
' ';
677 $htmltext = $langs->trans(
"OriginalValueWas",
'<i>'.$newlangfileonly->tab_translate[$key].
'</i>');
678 print $form->textwithpicto(
'', $htmltext, 1,
'info');
682 print
'<a class="reposition paddingrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?mode=overwrite&langcode='.urlencode($langcode).
'&transkey='.urlencode($key).
'">'.
img_edit_add($langs->trans(
"TranslationOverwriteKey")).
'</a>';
686 $transifexlangfile =
'$';
688 $transifexurl =
'https://app.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.
'/'.$transifexlangfile.
'?q=key%3A'.$key;
690 print
' <a href="'.$transifexurl.
'" target="transifex">'.
img_picto($langs->trans(
'FixOnTransifex'),
'globe').
'</a>';
694 $sql =
"SELECT rowid";
695 $sql .=
" FROM ".MAIN_DB_PREFIX.
"overwrite_trans";
696 $sql .=
" WHERE entity IN (".getEntity(
'overwrite_trans').
")";
697 $sql .=
" AND transkey = '".$db->escape($key).
"'";
698 dol_syslog(
"translation::select from table", LOG_DEBUG);
699 $result = $db->query($sql);
702 $obj = $db->fetch_object($result);
704 if (is_object($obj)) {
705 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>';
707 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>';
708 print
' ';
711 $htmltext = $langs->trans(
"TransKeyWithoutOriginalValue", $key);
712 print $form->textwithpicto(
'', $htmltext, 1,
'warning');
719 print
'</td></tr>'.
"\n";
722 if (empty($recordtoshow)) {
723 print
'<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
734if (!empty($langcode)) {
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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...
img_edit_add($titlealt='default', $other='')
Show logo +.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.