Debug v16
This commit is contained in:
parent
41683b9025
commit
54019b7d76
@ -1470,7 +1470,7 @@ class FormFile
|
|||||||
print '<td class="valignmiddle right actionbuttons nowraponall"><!-- action on files -->';
|
print '<td class="valignmiddle right actionbuttons nowraponall"><!-- action on files -->';
|
||||||
if ($useinecm == 1 || $useinecm == 5) { // ECM manual tree only
|
if ($useinecm == 1 || $useinecm == 5) { // ECM manual tree only
|
||||||
// $section is inside $param
|
// $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?§ion_dir='.urlencode($relativepath).$newparam;
|
$backtopage = DOL_URL_ROOT.'/ecm/index.php?§ion_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>';
|
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>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10045,7 +10045,7 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
$dictvalues[$obj->{$rowidfield}] = $obj;
|
$dictvalues[$obj->{$rowidfield}] = $obj; // $obj is stdClass
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -10056,7 +10056,8 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
|
|||||||
|
|
||||||
if (!empty($dictvalues[$id])) {
|
if (!empty($dictvalues[$id])) {
|
||||||
// Found
|
// Found
|
||||||
return $dictvalues[$id]->{$field};
|
$tmp = $dictvalues[$id];
|
||||||
|
return (property_exists($tmp, $field) ? $tmp->$field : '');
|
||||||
} else {
|
} else {
|
||||||
// Not found
|
// Not found
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@ -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 img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
} elseif ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm
|
} elseif ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm
|
||||||
|
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 '<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 img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<script>
|
print "<script>
|
||||||
|
|||||||
@ -346,7 +346,7 @@ if ($action != 'edit') {
|
|||||||
print $fulllink;
|
print $fulllink;
|
||||||
}
|
}
|
||||||
if ($action != 'edit') {
|
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>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,8 @@ if ($user->socid > 0) {
|
|||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
|
|||||||
@ -58,7 +58,7 @@ if (!$sortorder) {
|
|||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
}
|
}
|
||||||
if (!$sortfield) {
|
if (!$sortfield) {
|
||||||
$sortfield = "fullname";
|
$sortfield = "name";
|
||||||
}
|
}
|
||||||
|
|
||||||
$ecmdir = new EcmDirectory($db);
|
$ecmdir = new EcmDirectory($db);
|
||||||
|
|||||||
@ -36,6 +36,9 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
if (empty($module)) {
|
if (empty($module)) {
|
||||||
$module = 'ecm';
|
$module = 'ecm';
|
||||||
}
|
}
|
||||||
|
if (empty($nameforformuserfile)) {
|
||||||
|
$nameforformuserfile = '';
|
||||||
|
}
|
||||||
$paramwithoutsection = preg_replace('/&?section=(\d+)/', '', $param);
|
$paramwithoutsection = preg_replace('/&?section=(\d+)/', '', $param);
|
||||||
|
|
||||||
$openeddir = '/'; // The root directory shown
|
$openeddir = '/'; // The root directory shown
|
||||||
|
|||||||
@ -906,6 +906,8 @@ $help_url = 'EN:Module_Holiday';
|
|||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
$edit = false;
|
||||||
|
|
||||||
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||||
// If user has no permission to create a leave
|
// 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)))) {
|
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">';
|
print '</div><div class="fichehalfright">';
|
||||||
|
|
||||||
$MAXEVENT = 10;
|
$MAXEVENT = 10;
|
||||||
|
$morehtmlright = '';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
|
|||||||
@ -99,6 +99,10 @@ class Holiday extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_user_valid;
|
public $fk_user_valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Date approbation
|
||||||
|
*/
|
||||||
|
public $date_approbation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Date for refuse
|
* @var int Date for refuse
|
||||||
@ -2202,7 +2206,7 @@ class Holiday extends CommonObject
|
|||||||
$sql .= " f.date_create as datec,";
|
$sql .= " f.date_create as datec,";
|
||||||
$sql .= " f.tms as date_modification,";
|
$sql .= " f.tms as date_modification,";
|
||||||
$sql .= " f.date_valid as datev,";
|
$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.date_refuse as dater,";
|
||||||
$sql .= " f.fk_user_create as fk_user_creation,";
|
$sql .= " f.fk_user_create as fk_user_creation,";
|
||||||
$sql .= " f.fk_user_modif as fk_user_modification,";
|
$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_validation = $this->db->jdate($obj->datev);
|
||||||
$this->date_approbation = $this->db->jdate($obj->datea);
|
$this->date_approbation = $this->db->jdate($obj->datea);
|
||||||
|
|
||||||
$cuser = new User($this->db);
|
if (!empty($obj->fk_user_creation)) {
|
||||||
$cuser->fetch($obj->fk_user_author);
|
|
||||||
$this->user_creation = $cuser;
|
|
||||||
|
|
||||||
if ($obj->fk_user_creation) {
|
|
||||||
$cuser = new User($this->db);
|
$cuser = new User($this->db);
|
||||||
$cuser->fetch($obj->fk_user_creation);
|
$cuser->fetch($obj->fk_user_creation);
|
||||||
$this->user_creation = $cuser;
|
$this->user_creation = $cuser;
|
||||||
}
|
}
|
||||||
if ($obj->fk_user_valid) {
|
if (!empty($obj->fk_user_approve_done)) {
|
||||||
$vuser = new User($this->db);
|
$vuser = new User($this->db);
|
||||||
$vuser->fetch($obj->fk_user_valid);
|
$vuser->fetch($obj->fk_user_approve_done);
|
||||||
$this->user_validation = $vuser;
|
$this->user_validation = $vuser;
|
||||||
}
|
}
|
||||||
if ($obj->fk_user_modification) {
|
if (!empty($obj->fk_user_modification)) {
|
||||||
$muser = new User($this->db);
|
$muser = new User($this->db);
|
||||||
$muser->fetch($obj->fk_user_modification);
|
$muser->fetch($obj->fk_user_modification);
|
||||||
$this->user_modification = $muser;
|
$this->user_modification = $muser;
|
||||||
@ -2252,7 +2252,7 @@ class Holiday extends CommonObject
|
|||||||
$this->user_approve = $auser;
|
$this->user_approve = $auser;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($obj->fk_user_approve_expected) {
|
if (!empty($obj->fk_user_approve_expected)) {
|
||||||
$auser = new User($this->db);
|
$auser = new User($this->db);
|
||||||
$auser->fetch($obj->fk_user_approve_expected);
|
$auser->fetch($obj->fk_user_approve_expected);
|
||||||
$this->user_approve = $auser;
|
$this->user_approve = $auser;
|
||||||
|
|||||||
@ -124,6 +124,7 @@ $title = $langs->trans("Leave").' - '.$langs->trans("Files");
|
|||||||
|
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
$edit = false;
|
||||||
|
|
||||||
if ($object->id) {
|
if ($object->id) {
|
||||||
$valideur = new User($db);
|
$valideur = new User($db);
|
||||||
|
|||||||
@ -924,29 +924,33 @@ class MyObject extends CommonObject
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
if ($this->db->num_rows($result)) {
|
if ($this->db->num_rows($result)) {
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
if (!empty($obj->fk_user_author)) {
|
|
||||||
|
if (!empty($obj->fk_user_creat)) {
|
||||||
$cuser = new User($this->db);
|
$cuser = new User($this->db);
|
||||||
$cuser->fetch($obj->fk_user_author);
|
$cuser->fetch($obj->fk_user_creat);
|
||||||
$this->user_creation = $cuser;
|
$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)) {
|
if (!empty($obj->fk_user_valid)) {
|
||||||
$vuser = new User($this->db);
|
$vuser = new User($this->db);
|
||||||
$vuser->fetch($obj->fk_user_valid);
|
$vuser->fetch($obj->fk_user_valid);
|
||||||
$this->user_validation = $vuser;
|
$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_creation = $this->db->jdate($obj->datec);
|
||||||
$this->date_modification = $this->db->jdate($obj->datem);
|
$this->date_modification = $this->db->jdate($obj->datem);
|
||||||
|
if (!empty($obj->datev)) {
|
||||||
$this->date_validation = $this->db->jdate($obj->datev);
|
$this->date_validation = $this->db->jdate($obj->datev);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user