Merge pull request #20429 from Hystepik/develop#4
Fix : filemanagement in ecm and medias
This commit is contained in:
commit
7f7b5fa92e
@ -1291,6 +1291,7 @@ class FormFile
|
|||||||
$nboflines++;
|
$nboflines++;
|
||||||
print '<!-- Line list_of_documents '.$key.' relativepath = '.$relativepath.' -->'."\n";
|
print '<!-- Line list_of_documents '.$key.' relativepath = '.$relativepath.' -->'."\n";
|
||||||
// Do we have entry into database ?
|
// Do we have entry into database ?
|
||||||
|
|
||||||
print '<!-- In database: position='.(array_key_exists('position', $filearray[$key]) ? $filearray[$key]['position'] : 0).' -->'."\n";
|
print '<!-- In database: position='.(array_key_exists('position', $filearray[$key]) ? $filearray[$key]['position'] : 0).' -->'."\n";
|
||||||
print '<tr class="oddeven" id="row-'.((array_key_exists('rowid', $filearray[$key]) && $filearray[$key]['rowid'] > 0) ? $filearray[$key]['rowid'] : 'AFTER'.$lastrowid.'POS'.($i + 1)).'">';
|
print '<tr class="oddeven" id="row-'.((array_key_exists('rowid', $filearray[$key]) && $filearray[$key]['rowid'] > 0) ? $filearray[$key]['rowid'] : 'AFTER'.$lastrowid.'POS'.($i + 1)).'">';
|
||||||
|
|
||||||
@ -1436,7 +1437,7 @@ class FormFile
|
|||||||
if ($permtoeditline) {
|
if ($permtoeditline) {
|
||||||
// Link to resize
|
// Link to resize
|
||||||
$moreparaminurl = '';
|
$moreparaminurl = '';
|
||||||
if ($object->id > 0) {
|
if (!empty($object->id) && $object->id > 0) {
|
||||||
$moreparaminurl = '&id='.$object->id;
|
$moreparaminurl = '&id='.$object->id;
|
||||||
} elseif (GETPOST('website', 'alpha')) {
|
} elseif (GETPOST('website', 'alpha')) {
|
||||||
$moreparaminurl = '&website='.GETPOST('website', 'alpha');
|
$moreparaminurl = '&website='.GETPOST('website', 'alpha');
|
||||||
|
|||||||
@ -54,7 +54,9 @@ if ($module == 'medias') {
|
|||||||
$showroot = 1;
|
$showroot = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($section)) {
|
||||||
|
$section = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Confirm remove file (for non javascript users)
|
// Confirm remove file (for non javascript users)
|
||||||
if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) {
|
if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->use_javascript_ajax)) {
|
||||||
@ -106,12 +108,26 @@ $('#acreatedir').on('click', function() {
|
|||||||
try{
|
try{
|
||||||
section_dir = $('.directory.expanded')[$('.directory.expanded').length-1].children[0].rel;
|
section_dir = $('.directory.expanded')[$('.directory.expanded').length-1].children[0].rel;
|
||||||
section = $('.directory.expanded')[$('.directory.expanded').length-1].children[0].id.split('_')[2];
|
section = $('.directory.expanded')[$('.directory.expanded').length-1].children[0].id.split('_')[2];
|
||||||
|
catParent = ";
|
||||||
|
if ($module == 'ecm') {
|
||||||
|
print "section;";
|
||||||
|
} else {
|
||||||
|
print "section_dir.substring(0, section_dir.length - 1);";
|
||||||
|
}
|
||||||
|
print "
|
||||||
} catch{
|
} catch{
|
||||||
section_dir = '/';
|
section_dir = '/';
|
||||||
section = 0;
|
section = 0;
|
||||||
|
catParent = ";
|
||||||
|
if ($module == 'ecm') {
|
||||||
|
print "section;";
|
||||||
|
} else {
|
||||||
|
print "section_dir;";
|
||||||
|
}
|
||||||
|
print "
|
||||||
}
|
}
|
||||||
console.log('We click to create a new directory, we set current section_dir='+section_dir+' into href url of button acreatedir');
|
console.log('We click to create a new directory, we set current section_dir='+section_dir+' into href url of button acreatedir');
|
||||||
$('#acreatedir').attr('href', $('#acreatedir').attr('href')+'§ion_dir='+encodeURI(section_dir)+'§ion='+encodeURI(section));
|
$('#acreatedir').attr('href', $('#acreatedir').attr('href')+'%26section_dir%3D'+encodeURI(section_dir)+'%26section%3D'+encodeURI(section)+'§ion_dir='+encodeURI(section_dir)+'§ion='+encodeURI(section)+'&catParent='+encodeURI(catParent));
|
||||||
console.log($('#acreatedir').attr('href'));
|
console.log($('#acreatedir').attr('href'));
|
||||||
});
|
});
|
||||||
$('#agenerateimgwebp').on('click', function() {
|
$('#agenerateimgwebp').on('click', function() {
|
||||||
|
|||||||
@ -230,7 +230,7 @@ if ($action == 'create') {
|
|||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" class="minwidth100" maxlength="32" value="'.$ecmdir->label.'" autofocus></td></tr>'."\n";
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" class="minwidth100" maxlength="32" value="'.(GETPOST("label", 'alpha') ? GETPOST("label", 'alpha') : $ecmdir->label).'" autofocus></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
||||||
print $formecm->selectAllSections((GETPOST("catParent", 'alpha') ? GETPOST("catParent", 'alpha') : $ecmdir->fk_parent), 'catParent', $module);
|
print $formecm->selectAllSections((GETPOST("catParent", 'alpha') ? GETPOST("catParent", 'alpha') : $ecmdir->fk_parent), 'catParent', $module);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user