Debug v20

This commit is contained in:
Laurent Destailleur 2024-05-12 19:21:39 +02:00
parent 6cadff6406
commit d502e2e3eb
2 changed files with 34 additions and 28 deletions

View File

@ -1100,7 +1100,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '')
* WARNING: This function can be used by websites.
*
* @param string $type Type of container to search into (Example: '', 'page', 'blogpost', 'page,blogpost', ...)
* @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination 'meta,content,...')
* @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination 'meta,content,sitefiles')
* @param string $searchstring Search string
* @param int $max Max number of answers
* @param string $sortfield Sort Fields
@ -1117,10 +1117,15 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
$error = 0;
$arrayresult = array('code' => '', 'list' => array());
// Clean parameters
if (!is_object($weblangs)) {
$weblangs = $langs;
}
if (empty($algo)) {
$algo = 'content';
}
/*
if (empty($searchstring) && empty($type) && empty($langcode) && empty($otherfilters)) {
$error++;
$arrayresult['code'] = 'KO';
@ -1131,6 +1136,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
$arrayresult['code'] = 'KO';
$arrayresult['message'] = $weblangs->trans("ErrorSearchCriteriaTooSmall");
} else {
*/
$tmparrayoftype = explode(',', $type);
/*foreach ($tmparrayoftype as $tmptype) {
if (!in_array($tmptype, array('', 'page', 'blogpost'))) {
@ -1140,7 +1146,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
break;
}
}*/
}
//}
$searchdone = 0;
$found = 0;

View File

@ -4345,7 +4345,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
print $langs->trans('WEBSITE_TYPE_CONTAINER');
print '</td><td>';
print img_picto('', 'object_technic', 'class="paddingrightonly"').' ';
print $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1);
print $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1, 'minwidth300');
print '</td></tr>';
print '<script type="text/javascript">
@ -4578,9 +4578,8 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
print '</td></tr>';
}
$url = 'https://wiki.dolibarr.org/index.php/Module_Website';
// Content - Example/templates of page
$url = 'https://wiki.dolibarr.org/index.php/Module_Website';
$htmltext = '<small>';
$htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url);
$htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSource1", $url);
@ -4617,23 +4616,25 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
print '</td></tr>';
}
print '<tr id="pageContent"><td class="tdtop">';
if (! ($action == 'createcontainer' && $showlinktolayout && $showlinktoai)) {
if ($conf->browser->layout == 'phone') {
print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
} else {
//img_help(($tooltiptrigger != '' ? 2 : 1), $alt)
print $form->textwithpicto($langs->trans("PreviewPageContent").' '.img_help(2, $langs->trans("PreviewPageContent")), $htmltext, 1, 'none', 'inline-block', 1, 2, 'tooltipsubstitution');
if ($action == 'createcontainer') {
print '<tr id="pageContent"><td class="tdtop">';
if (!$showlinktolayout || !$showlinktoai) {
if ($conf->browser->layout == 'phone') {
print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
} else {
//img_help(($tooltiptrigger != '' ? 2 : 1), $alt)
print $form->textwithpicto($langs->trans("PreviewPageContent").' '.img_help(2, $langs->trans("PreviewPageContent")), $htmltext, 1, 'none', 'inline-block', 1, 2, 'tooltipsubstitution');
}
}
print '</td><td>';
//$doleditor = new DolEditor('content', GETPOST('content', 'restricthtmlallowunvalid'), '', 200, 'dolibarr_mailings', 'In', true, true, true, 40, '90%');
$doleditor = new DolEditor('contentpreview', GETPOST('content', 'none'), '', 200, 'dolibarr_mailings', 'In', true, true, true, 40, '90%');
$doleditor->Create();
//print '<div class="websitesample" id="contentpreview" name="contentpreview" style="height: 200px; border: 1px solid #bbb; overflow: scroll">';
print '</div>';
print '<textarea id="content" name="content" class="hideobject">'.GETPOST('content', 'none').'</textarea>';
print '</td></tr>';
}
print '</td><td>';
//$doleditor = new DolEditor('content', GETPOST('content', 'restricthtmlallowunvalid'), '', 200, 'dolibarr_mailings', 'In', true, true, true, 40, '90%');
$doleditor = new DolEditor('contentpreview', GETPOST('content', 'none'), '', 200, 'dolibarr_mailings', 'In', true, true, true, 40, '90%');
$doleditor->Create();
//print '<div class="websitesample" id="contentpreview" name="contentpreview" style="height: 200px; border: 1px solid #bbb; overflow: scroll">';
print '</div>';
print '<textarea id="content" name="content" class="hideobject">'.GETPOST('content', 'none').'</textarea>';
print '</td></tr>';
// Date creation
print '<tr><td>';
@ -4861,7 +4862,6 @@ if ($action == 'editcontent') {
$doleditor->Create(0, '', false);
}
print "</div>\n";
print "</form>\n";
@ -5036,8 +5036,8 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
}
print getTitleFieldOfList("Type", 0, $_SERVER['PHP_SELF'], 'type_container', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation
@ -5101,7 +5101,12 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
//print '</td>';
//print '<td class="tdoverflow100">';
print '<br>';
print '<span class="opacitymedium">'.dol_escape_htmltag($answerrecord->description ? $answerrecord->description : '&nbsp;').'</span>';
print '<span class="opacitymedium">'.dol_escape_htmltag($answerrecord->description ? $answerrecord->description : $langs->trans("NoDescription")).'</span>';
print '</td>';
// Language
print '<td class="center">';
print picto_from_langcode($answerrecord->lang, $answerrecord->lang);
print '</td>';
// Categories - Tags
@ -5119,11 +5124,6 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
//var_dump($existing);
print '</td>';
// Language
print '<td class="center">';
print picto_from_langcode($answerrecord->lang, $answerrecord->lang);
print '</td>';
// Number of words
print '<td class="center nowraponall">';
$textwithouthtml = dol_string_nohtmltag(dolStripPhpCode($answerrecord->content));