Better responsive

This commit is contained in:
Laurent Destailleur 2020-10-13 10:05:47 +02:00
parent e00cf0d37c
commit 7c67dbf6d5
8 changed files with 54 additions and 64 deletions

View File

@ -1068,12 +1068,14 @@ if ($action == 'create')
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth300" value="'.(GETPOST('location') ? GETPOST('location') : $object->location).'"></td></tr>';
print '<tr><td>'.$langs->trans("Location").'</td><td><input type="text" name="location" class="minwidth300 maxwidth150onsmartphone" value="'.(GETPOST('location') ? GETPOST('location') : $object->location).'"></td></tr>';
}
// Assigned to
print '<tr><td class="tdtop nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
$listofuserid = array();
$listofcontactid = array();
$listofotherid = array();
if (empty($donotclearsession))
{
$assignedtouser = GETPOST("assignedtouser") ?GETPOST("assignedtouser") : (!empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : $user->id);
@ -1090,12 +1092,6 @@ if ($action == 'create')
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0', 1, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
/*if (in_array($user->id,array_keys($listofuserid)))
{
print '<div class="myavailability">';
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked':'').'> '.$langs->trans("Busy");
print '</div>';
}*/
print '</td></tr>';
// Done by
@ -1108,9 +1104,9 @@ if ($action == 'create')
if ($conf->categorie->enabled) {
// Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
print $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, '', 0, '100%');
print $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent', 0, 0);
print "</td></tr>";
}
@ -1148,7 +1144,8 @@ if ($action == 'create')
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
$preselectedids = GETPOST('socpeopleassigned', 'array');
if (GETPOST('contactid', 'int')) $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int');
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
print img_picto('', 'contact', 'class="paddingrightonly"');
print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
print '</td></tr>';
}
@ -1161,7 +1158,7 @@ if ($action == 'create')
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td id="project-input-container" >';
print img_picto('', 'project', 'class="paddingrightonly"');
$numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
$numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500 widthcentpercentminusxx');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
$urloption = '?action=create&donotclearsession=1';

View File

@ -360,7 +360,9 @@ if (empty($action) || $action == 'show_month')
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y");
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth.$param."\">".$langs->trans("Today")."</a> ";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendar';
}
if ($action == 'show_week')
@ -369,7 +371,9 @@ if ($action == 'show_week')
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week;
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendarweek';
}
if ($action == 'show_day')
@ -378,7 +382,9 @@ if ($action == 'show_day')
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort");
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendarday';
}

View File

@ -274,34 +274,17 @@ $lastdaytoshow = dol_time_plus_duree($firstdaytoshow, 7, 'd');
$max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year));
$tmpday = $first_day;
$picto = 'calendartype';
$picto = 'calendarweek';
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\">".img_previous($langs->trans("Previous"))."</a>\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y")."</span> \n";
$nav .= "<a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
$nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
$picto = 'calendarweek';
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
}
/*$nav .= ' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav .= '<input type="hidden" name="token" value="'.newToken().'">';
$nav .= '<input type="hidden" name="action" value="'.$action.'">';
$nav .= '<input type="hidden" name="filtert" value="'.$filtert.'">';
$nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';
$nav .= '<input type="hidden" name="actioncode" value="'.$actioncode.'">';
$nav .= '<input type="hidden" name="resourceid" value="'.$resourceid.'">';
$nav .= '<input type="hidden" name="status" value="'.$status.'">';
$nav .= '<input type="hidden" name="socid" value="'.$socid.'">';
$nav .= '<input type="hidden" name="projectid" value="'.$projectid.'">';
$nav .= '<input type="hidden" name="begin_h" value="'.$begin_h.'">';
$nav .= '<input type="hidden" name="end_h" value="'.$end_h.'">';
$nav .= '<input type="hidden" name="begin_d" value="'.$begin_d.'">';
$nav .= '<input type="hidden" name="end_d" value="'.$end_d.'">';
$nav .= '<input type="hidden" name="showbirthday" value="'.$showbirthday.'">';
*/
$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
//$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav .= ' <button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
//$nav .= '</form>';
// Must be after the nav definition
$param .= '&year='.urlencode($year).'&month='.urlencode($month).($day ? '&day='.urlencode($day) : '');

View File

@ -285,28 +285,11 @@ $nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week;
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
/*$nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav.='<input type="hidden" name="token" value="' . newToken() . '">';
$nav.='<input type="hidden" name="action" value="' . $action . '">';
$nav.='<input type="hidden" name="filtert" value="' . $filtert . '">';
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
$nav.='<input type="hidden" name="actioncode" value="' . $actioncode . '">';
$nav.='<input type="hidden" name="resourceid" value="' . $resourceid . '">';
$nav.='<input type="hidden" name="status" value="' . $status . '">';
$nav.='<input type="hidden" name="socid" value="' . $socid . '">';
$nav.='<input type="hidden" name="projectid" value="' . $projectid . '">';
$nav.='<input type="hidden" name="begin_h" value="' . $begin_h . '">';
$nav.='<input type="hidden" name="end_h" value="' . $end_h . '">';
$nav.='<input type="hidden" name="begin_d" value="' . $begin_d . '">';
$nav.='<input type="hidden" name="end_d" value="' . $end_d . '">';
$nav.='<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
*/
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
//$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav .= ' <button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
//$nav.='</form>';
// Must be after the nav definition
$param .= '&year='.urlencode($year).'&month='.urlencode($month).($day ? '&day='.urlencode($day) : '');

View File

@ -1848,7 +1848,7 @@ class Form
if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid)))
{
$out .= '<div class="myavailability inline-block">';
$out .= '&nbsp;-&nbsp;<span class="opacitymedium">'.$langs->trans("Availability").':</span> <input id="transparency" class="marginleftonly marginrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'>'.$langs->trans("Busy");
$out .= '<span class="hideonsmartphone">&nbsp;-&nbsp;<span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>';
$out .= '</div>';
}
}
@ -5578,7 +5578,6 @@ class Form
}
// Show date with combo selects
else {
//$retstring.='<div class="inline-block">';
// Day
$retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">';
@ -5622,11 +5621,13 @@ class Form
}
$retstring .= "</select>\n";
}
//$retstring.='</div>';
}
}
if ($d && $h) $retstring .= ($h == 2 ? '<br>' : ' ');
if ($d && $h) {
$retstring .= ($h == 2 ? '<br>' : ' ');
$retstring.='<span class="nowraponall">';
}
if ($h)
{
@ -5644,10 +5645,13 @@ class Form
for ($hour = $hourstart; $hour < $hourend; $hour++)
{
if (strlen($hour) < 2) $hour = "0".$hour;
$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour.(empty($conf->dol_optimize_smallscreen) ? '' : 'H').'</option>';
$retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour;
//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H');
$retstring .= '</option>';
}
$retstring .= '</select>';
if ($m && empty($conf->dol_optimize_smallscreen)) $retstring .= ":";
//if ($m && empty($conf->dol_optimize_smallscreen)) $retstring .= ":";
if ($m) $retstring .= ":";
}
if ($m)
@ -5665,6 +5669,10 @@ class Form
$retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">';
}
if ($d && $h) {
$retstring .= '</span>';
}
// Add a "Now" link
if ($conf->use_javascript_ajax && $addnowlink)
{

View File

@ -353,7 +353,7 @@ class FormProjets
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
$out .= $comboenhancement;
$morecss = 'minwidth200imp maxwidth500';
$morecss = 'minwidth200 maxwidth500';
}
if (empty($option_only)) {

View File

@ -1275,6 +1275,10 @@ table[summary="list_of_modules"] .fa-cog {
width: calc(100% - 50px) !important;
display: inline-block;
}
.widthcentpercentminusxx {
width: calc(100% - 70px) !important;
display: inline-block;
}
/* Force values for small screen 767 */
@media only screen and (max-width: 767px)
@ -1298,8 +1302,8 @@ table[summary="list_of_modules"] .fa-cog {
margin-bottom: 15px !important;
}
select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth300 {
width: calc(100% - 50px) !important;
select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 {
width: calc(100% - 40px) !important;
display: inline-block;
}

View File

@ -1269,6 +1269,15 @@ table[summary="list_of_modules"] .fa-cog {
.minwidth500imp { min-width: 250px !important; }
}
.widthcentpercentminusx {
width: calc(100% - 50px) !important;
display: inline-block;
}
.widthcentpercentminusxx {
width: calc(100% - 70px) !important;
display: inline-block;
}
/* Force values for small screen 767 */
@media only screen and (max-width: 767px)
{