Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
This commit is contained in:
commit
0a48d1ad56
10 changed files with 97 additions and 44 deletions
|
|
@ -11,8 +11,8 @@
|
|||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2023-2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1167,6 +1167,7 @@ class Categorie extends CommonObject
|
|||
}
|
||||
|
||||
$this->cats = array();
|
||||
$nbcateg = 0;
|
||||
|
||||
// Init this->motherof that is array(id_son=>id_parent, ...)
|
||||
$this->load_motherof();
|
||||
|
|
@ -1188,6 +1189,8 @@ class Categorie extends CommonObject
|
|||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$nbcateg = $this->db->num_rows($resql);
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$this->cats[$obj->rowid]['rowid'] = $obj->rowid;
|
||||
$this->cats[$obj->rowid]['id'] = $obj->rowid;
|
||||
|
|
@ -1210,7 +1213,7 @@ class Categorie extends CommonObject
|
|||
dol_syslog(get_class($this)."::get_full_arbo call to buildPathFromId", LOG_DEBUG);
|
||||
foreach ($this->cats as $key => $val) {
|
||||
//print 'key='.$key.'<br>'."\n";
|
||||
$this->buildPathFromId($key, 0); // Process a branch from the root category key (this category has no parent)
|
||||
$this->buildPathFromId($key, $nbcateg); // Process a branch from the root category key (this category has no parent)
|
||||
}
|
||||
|
||||
// Include or exclude leaf including $markafterid from tree
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
|||
}
|
||||
|
||||
$object->$key = $value;
|
||||
if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) {
|
||||
if ($val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -593,6 +593,7 @@ class ExtraFields
|
|||
$lengthdb = '255';
|
||||
} elseif ($type == 'html') {
|
||||
$typedb = 'text';
|
||||
$lengthdb = $length;
|
||||
} elseif ($type == 'link') {
|
||||
$typedb = 'int';
|
||||
$lengthdb = '11';
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ class FormWebsite
|
|||
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
if ($selected == $obj->rowid || $selected == $obj->code) {
|
||||
print '<option value="'.$obj->code.'" selected>';
|
||||
} else {
|
||||
|
|
@ -138,6 +139,9 @@ class FormWebsite
|
|||
}
|
||||
print $langs->trans($obj->label);
|
||||
print '</option>';
|
||||
|
||||
$conf->cache['type_of_container'][$obj->code] = $obj->label;
|
||||
|
||||
$i++;
|
||||
}
|
||||
print "</select>";
|
||||
|
|
@ -170,7 +174,7 @@ class FormWebsite
|
|||
*/
|
||||
public function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200')
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $langs, $user;
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ DemoCompanyManufacturing=Company manufacturing products
|
|||
DemoCompanyAll=公司有多项活动(所有主要模块)
|
||||
CreatedBy=创建者 %s
|
||||
ModifiedBy=修改者 %s
|
||||
ValidatedBy=由%验证s
|
||||
ValidatedBy=由%s验证
|
||||
SignedBy=Signed by %s
|
||||
ClosedBy=由%闭s
|
||||
CreatedById=创建的用户ID号
|
||||
|
|
|
|||
|
|
@ -2576,8 +2576,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$btnUser = '<!-- div for user link -->
|
||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
|
||||
'.$userImage.(empty($user->photo) ? '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>' : '').'
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a valignmiddle" data-toggle="dropdown">
|
||||
'.$userImage.(empty($user->photo) ? '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft valignmiddle small">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>' : '').'
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
|
|
@ -2623,10 +2623,9 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||
} else {
|
||||
$btnUser = '<!-- div for user link -->
|
||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" alt="'.$langs->trans("MyUserCard").'">
|
||||
'.$userImage.'
|
||||
<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>
|
||||
</a>
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="valignmiddle" alt="'.$langs->trans("MyUserCard").'">
|
||||
'.$userImage.(empty($user->photo) ? '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft small">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>' : '').'
|
||||
</a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
|
@ -2649,7 +2648,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||
';
|
||||
|
||||
|
||||
if ($conf->theme != 'md') {
|
||||
//if ($conf->theme != 'md') {
|
||||
$btnUser .= '
|
||||
jQuery("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
|
||||
console.log("Click on #topmenu-login-dropdown .dropdown-toggle");
|
||||
|
|
@ -2666,7 +2665,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||
console.log("Click on #topmenuloginmoreinfo-btn");
|
||||
jQuery("#topmenuloginmoreinfo").slideToggle();
|
||||
});';
|
||||
}
|
||||
//}
|
||||
|
||||
$btnUser .= '
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3169,6 +3169,12 @@ div.login_block a {
|
|||
color: var(--colortextbackhmenu);
|
||||
display: inline-block;
|
||||
}
|
||||
div.login_block a .atoploginusername {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
max-width: 60px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
div.login_block span.aversion {
|
||||
color: var(--colortextbackhmenu);
|
||||
filter: contrast(0.7);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
<?php
|
||||
if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
die('Must be call by steelsheet');
|
||||
} ?>
|
||||
}
|
||||
|
||||
// When no photo, we show the login name, so we need an offset to output picto at a fixed position.
|
||||
$atoploginusername = empty($user->photo) ? 52 : 0;
|
||||
|
||||
?>
|
||||
/* <style type="text/css" > don't remove this line it's an ide hack */
|
||||
/*
|
||||
* Dropdown of user popup
|
||||
|
|
@ -27,17 +32,17 @@ button.dropdown-item.global-search-item {
|
|||
|
||||
div#topmenu-global-search-dropdown {
|
||||
position: fixed;
|
||||
<?php echo $right; ?>: 125px;
|
||||
<?php echo $right; ?>: <?php echo (125 + $atoploginusername); ?>px;
|
||||
top: 0px;
|
||||
}
|
||||
div#topmenu-quickadd-dropdown {
|
||||
position: fixed;
|
||||
<?php echo $right; ?>: 90px;
|
||||
<?php echo $right; ?>: <?php echo (90 + $atoploginusername); ?>px;
|
||||
top: 0px;
|
||||
}
|
||||
div#topmenu-bookmark-dropdown {
|
||||
position: fixed;
|
||||
<?php echo $right; ?>: <?php print empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER) ? 55 : 85; ?>px;
|
||||
<?php echo $right; ?>: <?php print !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? (55 + $atoploginusername) : 85; ?>px;
|
||||
top: 0px;
|
||||
}
|
||||
div#topmenu-login-dropdown {
|
||||
|
|
|
|||
|
|
@ -3259,6 +3259,13 @@ div.login_block a {
|
|||
color: var(--colortexthmenu);
|
||||
display: inline-block;
|
||||
}
|
||||
div.login_block a .atoploginusername {
|
||||
color: var(--colortextbackhmenu);
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
max-width: 50px;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
div.login_block span.aversion {
|
||||
color: var(--colortexthmenu);
|
||||
filter: contrast(0.7);
|
||||
|
|
|
|||
|
|
@ -4957,6 +4957,8 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
|
|||
print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']);
|
||||
print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $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
|
||||
print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif
|
||||
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
|
|
@ -4969,21 +4971,37 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
|
|||
|
||||
foreach ($listofpages['list'] as $answerrecord) {
|
||||
if (is_object($answerrecord) && get_class($answerrecord) == 'WebsitePage') {
|
||||
$param = '?mode=replacesite';
|
||||
$param .= '&websiteid='.$website->id;
|
||||
$param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09');
|
||||
$param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09');
|
||||
$param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09');
|
||||
$param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09');
|
||||
$param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09');
|
||||
$param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09');
|
||||
$param .= '&searchstring='.urlencode($searchkey);
|
||||
|
||||
print '<tr>';
|
||||
|
||||
// Type of container
|
||||
print '<td class="nowraponall">'.$langs->trans("Container").' - ';
|
||||
print $langs->trans($answerrecord->type_container); // TODO Use label of container
|
||||
print '<td class="nowraponall">';
|
||||
//print $langs->trans("Container").'<br>';
|
||||
if (!empty($conf->cache['type_of_container'][$answerrecord->type_container])) {
|
||||
print $langs->trans($conf->cache['type_of_container'][$answerrecord->type_container]);
|
||||
} else {
|
||||
print $langs->trans($answerrecord->type_container);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Container url and label
|
||||
print '<td>';
|
||||
$titleofpage = ($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle"));
|
||||
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($titleofpage).'">';
|
||||
print $answerrecord->getNomUrl(1);
|
||||
print ' <span class="opacitymedium">('.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).')</span>';
|
||||
print ' <span class="opacitymedium">('.dol_escape_htmltag($titleofpage).')</span>';
|
||||
//print '</td>';
|
||||
//print '<td class="tdoverflow100">';
|
||||
print '<br>';
|
||||
print '<span class="opacitymedium">'.$answerrecord->description.'</span>';
|
||||
print '<span class="opacitymedium">'.dol_escape_htmltag($answerrecord->description ? $answerrecord->description : ' ').'</span>';
|
||||
print '</td>';
|
||||
|
||||
// Categories - Tags
|
||||
|
|
@ -5001,17 +5019,6 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
|
|||
//var_dump($existing);
|
||||
print '</td>';
|
||||
|
||||
|
||||
$param = '?mode=replacesite';
|
||||
$param .= '&websiteid='.$website->id;
|
||||
$param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09');
|
||||
$param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09');
|
||||
$param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09');
|
||||
$param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09');
|
||||
$param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09');
|
||||
$param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09');
|
||||
$param .= '&searchstring='.urlencode($searchkey);
|
||||
|
||||
// Language
|
||||
print '<td class="center">';
|
||||
print picto_from_langcode($answerrecord->lang, $answerrecord->lang);
|
||||
|
|
@ -5028,6 +5035,25 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
|
|||
}
|
||||
print '</td>';
|
||||
|
||||
// Author
|
||||
print '<td class="tdoverflowmax125">';
|
||||
if (!empty($answerrecord->fk_user_creat)) {
|
||||
if (empty($conf->cache['user'][$answerrecord->fk_user_creat])) {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($answerrecord->fk_user_creat);
|
||||
$conf->cache['user'][$answerrecord->fk_user_creat] = $tmpuser;
|
||||
} else {
|
||||
$tmpuser = $conf->cache['user'][$answerrecord->fk_user_creat];
|
||||
}
|
||||
print $tmpuser->getNomUrl(-1, '', 0, 0, 0, 0, 'login');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Date creation
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($answerrecord->date_creation, 'dayhour');
|
||||
print '</td>';
|
||||
|
||||
// Date last modification
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($answerrecord->date_modification, 'dayhour');
|
||||
|
|
@ -5071,6 +5097,16 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
|
|||
|
||||
print '</tr>';
|
||||
} else {
|
||||
$param = '?mode=replacesite';
|
||||
$param .= '&websiteid='.$website->id;
|
||||
$param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09');
|
||||
$param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09');
|
||||
$param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09');
|
||||
$param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09');
|
||||
$param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09');
|
||||
$param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09');
|
||||
$param .= '&searchstring='.urlencode($searchkey);
|
||||
|
||||
print '<tr>';
|
||||
|
||||
// Type of container
|
||||
|
|
@ -5084,23 +5120,15 @@ if ($mode == 'replacesite' || $massaction == 'replace') {
|
|||
'website_readme' => 'WEBSITE_README',
|
||||
'website_manifestjson' => 'WEBSITE_MANIFEST_JSON'
|
||||
);
|
||||
print '<span class="opacitymedium">';
|
||||
if (!empty($translateofrecordtype[$answerrecord['type']])) {
|
||||
print $langs->trans($translateofrecordtype[$answerrecord['type']]);
|
||||
} else {
|
||||
print $answerrecord['type'];
|
||||
}
|
||||
print '</span>';
|
||||
print '</td>';
|
||||
|
||||
$param = '?mode=replacesite';
|
||||
$param .= '&websiteid='.$website->id;
|
||||
$param .= '&optioncontent='.GETPOST('optioncontent', 'aZ09');
|
||||
$param .= '&optionmeta='.GETPOST('optionmeta', 'aZ09');
|
||||
$param .= '&optionsitefiles='.GETPOST('optionsitefiles', 'aZ09');
|
||||
$param .= '&optioncontainertype='.GETPOST('optioncontainertype', 'aZ09');
|
||||
$param .= '&optionlanguage='.GETPOST('optionlanguage', 'aZ09');
|
||||
$param .= '&optioncategory='.GETPOST('optioncategory', 'aZ09');
|
||||
$param .= '&searchstring='.urlencode($searchkey);
|
||||
|
||||
// Container url and label
|
||||
print '<td>';
|
||||
$backtopageurl = $_SERVER["PHP_SELF"].$param;
|
||||
|
|
|
|||
Loading…
Reference in a new issue