2
0
forked from Wavyzz/dolibarr

Look and feel v14

This commit is contained in:
Laurent Destailleur
2021-02-04 19:21:07 +01:00
parent eee49b9132
commit 726ef265f2
6 changed files with 29 additions and 31 deletions

View File

@@ -75,7 +75,7 @@ $tablib[1] = "Websites";
// Requests to extract data // Requests to extract data
$tabsql = array(); $tabsql = array();
$tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.position, f.status FROM ".MAIN_DB_PREFIX.'website as f WHERE f.entity IN ('.getEntity('website').')'; $tabsql[1] = "SELECT f.rowid as rowid, f.entity, f.ref, f.description, f.virtualhost, f.position, f.status, f.date_creation FROM ".MAIN_DB_PREFIX.'website as f WHERE f.entity IN ('.getEntity('website').')';
// Criteria to sort dictionaries // Criteria to sort dictionaries
$tabsqlsort = array(); $tabsqlsort = array();
@@ -83,7 +83,7 @@ $tabsqlsort[1] = "ref ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire // Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield = array(); $tabfield = array();
$tabfield[1] = "ref,description,virtualhost,position"; $tabfield[1] = "ref,description,virtualhost,position,date_creation";
// Nom des champs d'edition pour modification d'un enregistrement // Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue = array(); $tabfieldvalue = array();
@@ -139,8 +139,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
$fieldnamekey = $listfield[$f]; $fieldnamekey = $listfield[$f];
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
break; break;
} elseif ($value == 'ref' && !preg_match('/^[a-z0-9_\-\.]+$/i', $_POST[$value])) } elseif ($value == 'ref' && !preg_match('/^[a-z0-9_\-\.]+$/i', GETPOST($value))) {
{
$ok = 0; $ok = 0;
$fieldnamekey = $listfield[$f]; $fieldnamekey = $listfield[$f];
setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities($fieldnamekey)), null, 'errors'); setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities($fieldnamekey)), null, 'errors');
@@ -149,9 +148,8 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
} }
// Clean parameters // Clean parameters
if (!empty($_POST['ref'])) if (GETPOST('ref')) {
{ $websitekey = strtolower(GETPOST('ref'));
$websitekey = strtolower($_POST['ref']);
} }
// Si verif ok et action add, on ajoute la ligne // Si verif ok et action add, on ajoute la ligne
@@ -441,6 +439,8 @@ if ($id)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {
if ($fieldlist[$field] == 'date_creation') continue;
// Determine le nom du champ par rapport aux noms possibles // Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees // dans les dictionnaires de donnees
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut $valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
@@ -534,6 +534,7 @@ if ($id)
if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); } if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); }
if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); } if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); }
if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); } if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); }
if ($fieldlist[$field] == 'date_creation') { $valuetoshow = $langs->trans("DateCreation"); }
// Affiche nom du champ // Affiche nom du champ
if ($showfield) if ($showfield)
@@ -597,7 +598,7 @@ if ($id)
print "</td>"; print "</td>";
// Modify link // Modify link
print '<td align="center"><a class="reposition" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>'; print '<td align="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
// Delete link // Delete link
if ($iserasable) print '<td align="center"><a class="reposition" href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>'; if ($iserasable) print '<td align="center"><a class="reposition" href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>';
@@ -646,6 +647,7 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {
$fieldname = $fieldlist[$field]; $fieldname = $fieldlist[$field];
if ($fieldlist[$field] == 'lang') if ($fieldlist[$field] == 'lang')
{ {
print '<td>'; print '<td>';
@@ -654,6 +656,8 @@ function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
} elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldname)) { } elseif ($fieldlist[$field] == 'code' && isset($obj->$fieldname)) {
print '<td><input type="text" class="flat" value="'.(!empty($obj->$fieldname) ? $obj->$fieldname : '').'" size="10" name="'.$fieldlist[$field].'"></td>'; print '<td><input type="text" class="flat" value="'.(!empty($obj->$fieldname) ? $obj->$fieldname : '').'" size="10" name="'.$fieldlist[$field].'"></td>';
} else { } else {
if ($fieldlist[$field] == 'date_creation') continue;
print '<td>'; print '<td>';
$size = ''; $size = '';
if ($fieldlist[$field] == 'code') $size = 'size="8" '; if ($fieldlist[$field] == 'code') $size = 'size="8" ';

View File

@@ -1800,10 +1800,10 @@ class Form
} }
$out .= ' data-html="'; $out .= ' data-html="';
$outhtml = ''; $outhtml = '';
if (!empty($obj->photo)) // if (!empty($obj->photo))
{ // {
$outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; $outhtml .= $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' ';
} // }
if ($showstatus >= 0 && $obj->status == 0) $outhtml .= '<strike class="opacitymediumxxx">'; if ($showstatus >= 0 && $obj->status == 0) $outhtml .= '<strike class="opacitymediumxxx">';
$outhtml .= $labeltoshow; $outhtml .= $labeltoshow;
if ($showstatus >= 0 && $obj->status == 0) $outhtml .= '</strike>'; if ($showstatus >= 0 && $obj->status == 0) $outhtml .= '</strike>';

View File

@@ -130,7 +130,7 @@ class FormActions
//var_dump($selected); //var_dump($selected);
if ($selected == 'done') $selected = '100'; if ($selected == 'done') $selected = '100';
print '<select '.($canedit ? '' : 'disabled ').'name="'.$htmlname.'" id="select'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'">'; print '<select '.($canedit ? '' : 'disabled ').'name="'.$htmlname.'" id="select'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'">';
if ($showempty) print '<option value=""'.($selected == '' ? ' selected' : '').'></option>'; if ($showempty) print '<option value=""'.($selected == '' ? ' selected' : '').'>&nbsp;</option>';
foreach ($listofstatus as $key => $val) foreach ($listofstatus as $key => $val)
{ {
print '<option value="'.$key.'"'.(($selected == $key && strlen($selected) == strlen($key)) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected' : '').'>'.$val.'</option>'; print '<option value="'.$key.'"'.(($selected == $key && strlen($selected) == strlen($key)) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected' : '').'>'.$val.'</option>';
@@ -142,6 +142,8 @@ class FormActions
print '</select>'; print '</select>';
if ($selected == 0 || $selected == 100) $canedit = 0; if ($selected == 0 || $selected == 100) $canedit = 0;
print ajax_combobox('select'.$htmlname);
if (empty($onlyselect)) if (empty($onlyselect))
{ {
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat hideifna" value="'.($selected >= 0 ? $selected : '').'" size="2"'.($canedit && ($selected >= 0) ? '' : ' disabled').'>'; print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat hideifna" value="'.($selected >= 0 ? $selected : '').'" size="2"'.($canedit && ($selected >= 0) ? '' : ' disabled').'>';

View File

@@ -73,8 +73,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
{ {
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
// Type // Type
print '<span class="fas fa-square inline-block fawidth30" style=" color: #ddd;"></span>'; print '<span class="fas fa-square inline-block fawidth30" style=" color: #ddd;" title="'.$langs->trans("Type").'"></span>';
print '<span class="hideonsmartphone">'.$langs->trans("Type").'</span>';
$multiselect = 0; $multiselect = 0;
if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
{ {
@@ -85,13 +84,11 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Assigned to // Assigned to
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
print img_picto('', 'user', 'class="fawidth30 inline-block"'); print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="fawidth30 inline-block"');
print '<span class="hideonsmartphone">'.$langs->trans("ActionsToDoBy").'</span>';
print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusxx'); print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusxx');
print '</div>'; print '</div>';
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
print img_picto('', 'object_group', 'class="fawidth30 inline-block"'); print img_picto($langs->trans("ToUserOfGroup"), 'object_group', 'class="fawidth30 inline-block"');
print '<span class="hideonsmartphone">'.$langs->trans("ToUserOfGroup").'</span>';
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500');
print '</div>'; print '</div>';
@@ -102,8 +99,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Resource // Resource
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
print img_picto('', 'object_resource', 'class="fawidth30 inline-block"'); print img_picto($langs->trans("Resource"), 'object_resource', 'class="fawidth30 inline-block"');
print '<span class="hideonsmartphone">'.$langs->trans("Resource").'</span>';
print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500'); print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500');
print '</div>'; print '</div>';
} }
@@ -112,8 +108,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (!empty($conf->societe->enabled) && $user->rights->societe->lire) if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
{ {
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
print img_picto('', 'company', 'class="fawidth30 inline-block"'); print img_picto($langs->trans("ThirdParty"), 'company', 'class="fawidth30 inline-block"');
print '<span class="hideonsmartphone">'.$langs->trans("ThirdParty").'</span>';
print $form->select_company($socid, 'search_socid', '', '&nbsp;', 0, 0, null, 0, 'minwidth100 maxwidth500'); print $form->select_company($socid, 'search_socid', '', '&nbsp;', 0, 0, null, 0, 'minwidth100 maxwidth500');
print '</div>'; print '</div>';
} }
@@ -124,8 +119,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
print img_picto('', 'project', 'class="fawidth30 inline-block"'); print img_picto($langs->trans("Project"), 'project', 'class="fawidth30 inline-block"');
print '<span class="hideonsmartphone">'.$langs->trans("Project").'</span>';
print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500'); print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500');
print '</div>'; print '</div>';
} }
@@ -134,8 +128,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
{ {
// Status // Status
print '<div class="divsearchfield">'; print '<div class="divsearchfield">';
print img_picto('', 'setup', 'class="fawidth30 inline-block"'); print img_picto($langs->trans("Status"), 'setup', 'class="fawidth30 inline-block"');
print '<span class="hideonsmartphone">'.$langs->trans("Status").'</span>';
$formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100'); $formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100');
print '</div>'; print '</div>';
} }

View File

@@ -3414,13 +3414,13 @@ div.pagination li:first-child span {
border-bottom-left-radius: 4px;*/ border-bottom-left-radius: 4px;*/
} }
div.pagination li a:hover, /*div.pagination li a:hover,
div.pagination li:not(.paginationafterarrows,.title-button) span:hover, div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:hover,
div.pagination li a:focus, div.pagination li a:focus,
div.pagination li:not(.paginationafterarrows,.title-button) span:focus { div.pagination li:not(.paginationbeforearrows,.paginationafterarrows,.title-button) span:focus {
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); -webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
} }*/
div.pagination li .active a, div.pagination li .active a,
div.pagination li .active span, div.pagination li .active span,
div.pagination li .active a:hover, div.pagination li .active a:hover,

View File

@@ -277,7 +277,6 @@ if ($canreadperms)
} }
} }
//print '</td></tr></table>';
print '</div></div></div>'; print '</div></div></div>';
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array