From 72025f6d5d8dd0e52d1fe036da0475827a5ab15b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2019 15:54:24 +0200 Subject: [PATCH] Fix CSS --- htdocs/expensereport/card.php | 32 ++++++++----- .../tpl/expensereport_linktofile.tpl.php | 48 +++++++++++++------ htdocs/theme/eldy/global.inc.php | 8 ++++ htdocs/theme/md/style.css.php | 9 ++++ 4 files changed, 72 insertions(+), 25 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 8f6f7c98c56..48535ba8f48 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -145,7 +145,11 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; - if (GETPOST('sendit', 'alpha')) $action=''; + if (GETPOSTISSET('sendit')) // If we just submit a file + { + if ($action == 'updateline') $action='editline'; // To avoid to make the updateline now + else $action=''; // To avoid to make the addline now + } include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once @@ -2004,7 +2008,7 @@ else print ''.$langs->trans("AmountExpected").':'.price($object->total_ttc).''; print ''.$langs->trans("RemainderToPay").':'; - print ''.price($resteapayeraffiche).''; + print ''.price($resteapayeraffiche).''; $db->free($resql); } @@ -2209,7 +2213,7 @@ else { print ''; - print 'rowid.'#'.$line->rowid.'">'; + print 'rowid.'">'; print img_edit(); print '   '; print 'rowid.'">'; @@ -2224,14 +2228,18 @@ else if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { - - // Add line with link to add new file or attach to an existing file - $colspan = 12; + // Add line with link to add new file or attach line to an existing file + $colspan = 10; if (! empty($conf->projet->enabled)) $colspan++; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) $colspan++; print ''; - print ''; + + print ''; + print $numline; + print ''; + + print ''; print ''.$langs->trans("UploadANewFileNow"); print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); print ''; @@ -2355,7 +2363,9 @@ else } // Add a line - if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $action != 'editline' && $user->rights->expensereport->creer) + if (($object->fk_statut == ExpenseReport::STATUS_DRAFT || $object->fk_statut == ExpenseReport::STATUS_REFUSED) + && $action != 'editline' + && $user->rights->expensereport->creer) { $colspan = 11; if (! empty($conf->global->MAIN_USE_EXPENSE_IK)) $colspan++; @@ -2399,10 +2409,10 @@ else jQuery(".trattachnewfilenow").toggle(); jQuery(".truploadnewfilenow").hide(); return false; - });'; - if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array'))) + });'."\n"; + if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')) && $action != 'updateline') { - print 'jQuery(".trattachnewfilenow").toggle();'."\n"; + print 'jQuery(".trattachnewfilenow").show();'."\n"; } print ' }); diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php index 4ea23418db8..48f21bc3dc2 100644 --- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php @@ -17,35 +17,41 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print 'global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>'; print ''; //print ''.$langs->trans("AttachTheNewLineToTheDocument").'
'; - $modulepart='expensereport';$maxheightmini=48; + $modulepart='expensereport'; $maxheightmini=48; $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; + $filei=0; foreach($arrayoffiles as $file) { - print '
'; - $fileinfo = pathinfo($file['name']); + $urlforhref=array(); + $filei++; + + print '
'; + $fileinfo = pathinfo($file['fullname']); if (image_format_supported($file['name']) > 0) { $minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case however) than original //print $file['path'].'/'.$minifile.'
'; - $urlforhref=getAdvancedPreviewUrl($modulepart, $fileinfo['relativename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity)); + $urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity)); if (empty($urlforhref)) { $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($fileinfo['relativename'].'.'.strtolower($fileinfo['extension'])); print ''; } else { print ''; } - print '
'; + print '
'; print ''; print '
'; print '
'; } else { - $modulepart='expensereport'; - print ''; } + + print ''; + print ''; } else diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 73972698c43..3cec07bce27 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -446,7 +446,15 @@ textarea.centpercent { .cursornotallowed { cursor: not-allowed; } +.backgroundblank { + background-color: #fff; +} +.checkboxattachfilelabel { + font-size: 0.85em; + opacity: 0.7; +} +/* Themes for badges */ .borderrightlight diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e4e30310e14..8b3b06b2d0d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -659,6 +659,15 @@ textarea.centpercent { .cursornotallowed { cursor: not-allowed; } +.backgroundblank { + background-color: #fff; +} +.checkboxattachfilelabel { + font-size: 0.85em; + opacity: 0.7; +} + +/* Themes for badges */ .badge { display: inline-block; min-width: 10px;