Debug v16

This commit is contained in:
Laurent Destailleur 2022-06-08 20:07:16 +02:00
parent 41683b9025
commit 54019b7d76
11 changed files with 43 additions and 27 deletions

View File

@ -1470,7 +1470,7 @@ class FormFile
print '<td class="valignmiddle right actionbuttons nowraponall"><!-- action on files -->';
if ($useinecm == 1 || $useinecm == 5) { // ECM manual tree only
// $section is inside $param
$newparam .= preg_replace('/&file=.*$/', '', $param); // We don't need param file=
$newparam = preg_replace('/&file=.*$/', '', $param); // We don't need param file=
$backtopage = DOL_URL_ROOT.'/ecm/index.php?&section_dir='.urlencode($relativepath).$newparam;
print '<a class="editfielda editfilelink" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
}

View File

@ -10045,7 +10045,7 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
$dictvalues[$obj->{$rowidfield}] = $obj;
$dictvalues[$obj->{$rowidfield}] = $obj; // $obj is stdClass
}
} else {
dol_print_error($db);
@ -10056,7 +10056,8 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
if (!empty($dictvalues[$id])) {
// Found
return $dictvalues[$id]->{$field};
$tmp = $dictvalues[$id];
return (property_exists($tmp, $field) ? $tmp->$field : '');
} else {
// Not found
return '';

View File

@ -94,9 +94,11 @@ if ($permtoadd && GETPOSTISSET('website')) { // If on file manager to manage med
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '</a>';
} elseif ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm
print '<a id="agenerateimgwebp" href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp&token='.newToken().'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '</a>';
if (getDolGlobalInt('ECM_SHOW_GENERATE_WEBP_BUTTON')) {
print '<a id="agenerateimgwebp" href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp&token='.newToken().'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '</a>';
}
}
print "<script>

View File

@ -346,7 +346,7 @@ if ($action != 'edit') {
print $fulllink;
}
if ($action != 'edit') {
print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; // No target here.
print ' <a href="'.$fulllink.'">'.img_picto($langs->trans("Download"), 'download', 'class="opacitymedium paddingrightonly"').'</a>'; // No target here.
}
print '</td></tr>';

View File

@ -47,6 +47,8 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$backtopage = GETPOST('backtopage', 'alpha');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');

View File

@ -58,7 +58,7 @@ if (!$sortorder) {
$sortorder = "ASC";
}
if (!$sortfield) {
$sortfield = "fullname";
$sortfield = "name";
}
$ecmdir = new EcmDirectory($db);

View File

@ -36,6 +36,9 @@ if (empty($conf) || !is_object($conf)) {
if (empty($module)) {
$module = 'ecm';
}
if (empty($nameforformuserfile)) {
$nameforformuserfile = '';
}
$paramwithoutsection = preg_replace('/&?section=(\d+)/', '', $param);
$openeddir = '/'; // The root directory shown

View File

@ -906,6 +906,8 @@ $help_url = 'EN:Module_Holiday';
llxHeader('', $title, $help_url);
$edit = false;
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
// If user has no permission to create a leave
if ((in_array($fuserid, $childids) && empty($user->rights->holiday->write)) || (!in_array($fuserid, $childids) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance)))) {
@ -1563,6 +1565,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print '</div><div class="fichehalfright">';
$MAXEVENT = 10;
$morehtmlright = '';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -99,6 +99,10 @@ class Holiday extends CommonObject
*/
public $fk_user_valid;
/**
* @var int Date approbation
*/
public $date_approbation;
/**
* @var int Date for refuse
@ -2202,7 +2206,7 @@ class Holiday extends CommonObject
$sql .= " f.date_create as datec,";
$sql .= " f.tms as date_modification,";
$sql .= " f.date_valid as datev,";
//$sql .= " f.date_approve as datea,";
$sql .= " f.date_approve as datea,";
$sql .= " f.date_refuse as dater,";
$sql .= " f.fk_user_create as fk_user_creation,";
$sql .= " f.fk_user_modif as fk_user_modification,";
@ -2225,21 +2229,17 @@ class Holiday extends CommonObject
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_approbation = $this->db->jdate($obj->datea);
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
if ($obj->fk_user_creation) {
if (!empty($obj->fk_user_creation)) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_creation);
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid) {
if (!empty($obj->fk_user_approve_done)) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$vuser->fetch($obj->fk_user_approve_done);
$this->user_validation = $vuser;
}
if ($obj->fk_user_modification) {
if (!empty($obj->fk_user_modification)) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modification);
$this->user_modification = $muser;
@ -2252,7 +2252,7 @@ class Holiday extends CommonObject
$this->user_approve = $auser;
}
} else {
if ($obj->fk_user_approve_expected) {
if (!empty($obj->fk_user_approve_expected)) {
$auser = new User($this->db);
$auser->fetch($obj->fk_user_approve_expected);
$this->user_approve = $auser;

View File

@ -124,6 +124,7 @@ $title = $langs->trans("Leave").' - '.$langs->trans("Files");
llxHeader('', $title);
$edit = false;
if ($object->id) {
$valideur = new User($db);

View File

@ -924,28 +924,32 @@ class MyObject extends CommonObject
if ($result) {
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if (!empty($obj->fk_user_author)) {
if (!empty($obj->fk_user_creat)) {
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$cuser->fetch($obj->fk_user_creat);
$this->user_creation = $cuser;
}
if (!empty($obj->fk_user_modif)) {
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
if (!empty($obj->fk_user_valid)) {
$vuser = new User($this->db);
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if (!empty($obj->fk_user_cloture)) {
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
if (!empty($obj->datev)) {
$this->date_validation = $this->db->jdate($obj->datev);
}
}
$this->db->free($result);