mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 12:01:23 +01:00
Fix selection in combo
This commit is contained in:
@@ -326,7 +326,8 @@ print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
|
||||
//if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
//{
|
||||
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0), 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
|
||||
$selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0);
|
||||
print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
|
||||
//} else {
|
||||
// print '<span class="opacitymedium">'.$langs->trans("MultiLangNotEnabled").'</span>';
|
||||
//}
|
||||
|
||||
@@ -834,8 +834,8 @@ if ($showbirthday)
|
||||
}
|
||||
|
||||
// HOLIDAYS CALENDAR
|
||||
if ($conf->global->AGENDA_SHOW_HOLIDAYS)
|
||||
{
|
||||
//if ($conf->global->AGENDA_SHOW_HOLIDAYS)
|
||||
//{
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.rowid = x.fk_user";
|
||||
@@ -920,7 +920,7 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// EXTERNAL CALENDAR
|
||||
// Complete $eventarray with external import Ical
|
||||
@@ -1514,6 +1514,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
global $theme_datacolor;
|
||||
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
|
||||
|
||||
if ($conf->use_javascript_ajax) { // Enable the "Show more button..."
|
||||
$conf->global->MAIN_JS_SWITCH_AGENDA = 1;
|
||||
}
|
||||
|
||||
$dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
|
||||
|
||||
print "\n";
|
||||
@@ -1645,7 +1649,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
// Define color
|
||||
$color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
|
||||
}
|
||||
$cssclass = $cssclass.' '.$cssclass.'_day_'.$ymd;
|
||||
$cssclass = $cssclass.' eventday_'.$ymd;
|
||||
|
||||
// Defined style to disable drag and drop feature
|
||||
if ($event->type_code == 'AC_OTH_AUTO')
|
||||
@@ -1676,10 +1680,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
if ($action == 'show_day') { $h = 'height: 100%; '; $nowrapontd = 0; }
|
||||
if ($action == 'show_week') { $h = 'height: 100%; '; $nowrapontd = 0; }
|
||||
|
||||
// Show rect of event
|
||||
// Show event box
|
||||
print "\n";
|
||||
print '<!-- start event '.$i.' -->'."\n";
|
||||
print '<div id="event_'.$ymd.'_'.$i.'" class="event family_'.$event->type.' '.$cssclass.'"';
|
||||
$morecss = '';
|
||||
if ($i >= $maxprint) {
|
||||
$morecss = 'showifmore';
|
||||
}
|
||||
if ($event->type == 'holiday' && !GETPOST('check_birthday')) {
|
||||
$morecss = 'hidden';
|
||||
}
|
||||
print '<div id="event_'.$ymd.'_'.$i.'" class="event family_'.$event->type.' '.$cssclass.($morecss ? ' '.$morecss : '').'"';
|
||||
//print ' style="height: 100px;';
|
||||
//print ' position: absolute; top: 40px; width: 50%;';
|
||||
//print '"';
|
||||
@@ -1887,16 +1898,20 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $i > $maxprint && $maxprint)
|
||||
{
|
||||
print '<div id="more_'.$ymd.'">'.img_picto("all", "1downarrow_selected.png").' +'.$langs->trans("More").'...</div>';
|
||||
print '<div class="center" id="more_'.$ymd.'">'.img_picto("All", "angle-double-down", 'class="warning"').' +'.($i - $maxprint).'</div>';
|
||||
//print ' +'.(count($eventarray[$daykey])-$maxprint);
|
||||
print '<script type="text/javascript">'."\n";
|
||||
print 'jQuery(document).ready(function () {'."\n";
|
||||
print 'jQuery("#more_'.$ymd.'").click(function() { reinit_day_'.$ymd.'(); });'."\n";
|
||||
|
||||
print ' var open=0;'."\n";
|
||||
print ' jQuery("#more_'.$ymd.'").click(function() { console.log("Click on showmore for '.$ymd.'"); reinit_day_'.$ymd.'(); event.stopImmediatePropagation(); });'."\n";
|
||||
print ' function reinit_day_'.$ymd.'() {'."\n";
|
||||
print 'var nb=0;'."\n";
|
||||
// TODO Loop on each element of day $ymd and start to toggle once $maxprint has been reached
|
||||
print 'jQuery(".family_mytasks_day_'.$ymd.'").toggle();';
|
||||
print ' jQuery(".eventday_'.$ymd.'.showifmore").toggle();'."\n";
|
||||
print ' open = open + 1; if (open > 1) { open = 0; }'."\n";
|
||||
print ' if (open) { ';
|
||||
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-up", 'class="warning"').'\');'."\n";
|
||||
print ' } else { ';
|
||||
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-down", 'class="warning"').' +'.($i - $maxprint).'\');'."\n";
|
||||
print ' }'."\n";
|
||||
print ' }'."\n";
|
||||
|
||||
print '});'."\n";
|
||||
|
||||
@@ -77,7 +77,7 @@ class FormAdmin
|
||||
if ($showempty && !$multiselect)
|
||||
{
|
||||
$out .= '<option value="0"';
|
||||
if ($selected == '') $out .= ' selected';
|
||||
if ($selected === '') $out .= ' selected';
|
||||
$out .= '>';
|
||||
if ($showempty != '1') $out .= $showempty;
|
||||
else $out .= ' ';
|
||||
@@ -86,7 +86,7 @@ class FormAdmin
|
||||
if ($showauto)
|
||||
{
|
||||
$out .= '<option value="auto"';
|
||||
if ($selected == 'auto') $out .= ' selected';
|
||||
if ($selected === 'auto') $out .= ' selected';
|
||||
$out .= '>'.$langs->trans("AutoDetectLang").'</option>';
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class FormAdmin
|
||||
}
|
||||
|
||||
$valuetoshow .= ' '.picto_from_langcode($key, 'class="saturatemedium"');
|
||||
if ($selected == $keytouse) {
|
||||
if ((string) $selected == (string) $keytouse) {
|
||||
$out .= '<option value="'.$keytouse.'" selected data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';
|
||||
} else {
|
||||
$out .= '<option value="'.$keytouse.'" data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';
|
||||
|
||||
@@ -3265,7 +3265,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
||||
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
|
||||
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
|
||||
'cash-register', 'category', 'check', 'clock', 'close_title', 'cog', 'company', 'contact', 'contract', 'cron', 'cubes',
|
||||
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
|
||||
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
|
||||
|
||||
@@ -4531,7 +4531,7 @@ div.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.hidden, td.hidden, img.hidden, span.hidden {
|
||||
div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -4402,7 +4402,7 @@ div.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.hidden, td.hidden, img.hidden, span.hidden {
|
||||
div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user