Look and feel v21

This commit is contained in:
Laurent Destailleur 2024-07-04 11:09:33 +02:00
parent d5ba3e6575
commit c7cd4999ff
4 changed files with 35 additions and 22 deletions

View File

@ -1837,8 +1837,8 @@ if ($id > 0) {
}
// Active
print '<td class="liste_titre center">';
print $form->selectyesno('search_active', $search_active, 0, false, 1);
print '<td class="liste_titre center parentonrightofpage">';
print $form->selectyesno('search_active', $search_active, 0, false, 1, 1, 'maxwidth100 onrightofpage', 'Activated', 'Disabled');
print '</td>';
$colspan++;
@ -1855,6 +1855,7 @@ if ($id > 0) {
print '</tr>';
// Title of lines
print '<!-- line title of record -->'."\n";
print '<tr class="liste_titre">';
@ -2115,12 +2116,12 @@ if ($id > 0) {
}
// Favorite & EEC - Only activated on country dictionary
if ($id == DICT_COUNTRY) {
print getTitleFieldOfList($langs->trans("InEEC"), 0, $_SERVER["PHP_SELF"], "eec", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder, '', 0, $langs->trans("CountryIsInEEC"));
print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
print getTitleFieldOfList($langs->trans("InEEC"), 0, $_SERVER["PHP_SELF"], "eec", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center ', 0, $langs->trans("CountryIsInEEC"));
print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center ');
}
// Status
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center ');
// Action button
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@ -2128,8 +2129,10 @@ if ($id > 0) {
}
print '</tr>';
// Lines with values
if ($num) {
// Lines with values
print '<!-- lines of dict -->'."\n";
while ($i < $num) {
$obj = $db->fetch_object($resql);
@ -2147,7 +2150,7 @@ if ($id > 0) {
$iserasable = 1;
$canbedisabled = 1;
$canbemodified = 1;
if (isset($obj->code) && $id != 10 && $id != 42) {
if (isset($obj->code) && $id != DICT_TVA && $id != DICT_PRODUCT_NATURE) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0;
$canbedisabled = 0;
@ -2193,14 +2196,15 @@ if ($id > 0) {
if (empty($rowidcol) || in_array($id, array(DICT_ACTIONCOMM, DICT_CHARGESOCIALES, DICT_TYPENT, DICT_PAIEMENT, DICT_TYPE_FEES, DICT_EFFECTIF, DICT_STCOMM, DICT_HRM_PUBLIC_HOLIDAY))) {
$rowidcol = 'rowid';
}
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder;
$url .= '&rowid='.(isset($obj->$rowidcol) ? $obj->$rowidcol : (!empty($obj->code) ? urlencode($obj->code) : ''));
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder);
$url .= '&rowid='.(isset($obj->$rowidcol) ? ((int) $obj->$rowidcol) : (!empty($obj->code) ? urlencode($obj->code) : ''));
$url .= '&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
if (!empty($param)) {
$url .= '&'.$param;
}
// If dictionary is different for each entity
if (!is_null($withentity)) {
$url .= '&entity='.$withentity;
$url .= '&entity='.((int) $withentity);
}
$url .= '&';
@ -2254,6 +2258,8 @@ if ($id > 0) {
$error = $hookmanager->error;
$errors = $hookmanager->errors;
$langs->loadLangs(array("bills", "agenda", "propal"));
if (empty($reshook)) {
$withentity = null;
@ -2300,7 +2306,6 @@ if ($id > 0) {
if ($value == 'private') {
$valuetoshow = yn($valuetoshow);
} elseif ($value == 'libelle_facture') {
$langs->load("bills");
$key = $langs->trans("PaymentCondition".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->$value);
$valuetoshow = nl2br($valuetoshow);
@ -2308,7 +2313,6 @@ if ($id > 0) {
$key = $langs->trans("Country".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->$value);
} elseif ($value == 'label' && $tabname[$id] == 'c_availability') {
$langs->load("propal");
$key = $langs->trans("AvailabilityType".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->$value);
} elseif ($value == 'libelle' && $tabname[$id] == 'c_actioncomm') {
@ -2327,17 +2331,22 @@ if ($id > 0) {
$key = $langs->trans("Civility".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "Civility".strtoupper($obj->code) ? $key : $obj->$value);
} elseif ($value == 'libelle' && $tabname[$id] == 'c_type_contact') {
$langs->load('agenda');
$key = $langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code) ? $key : $obj->$value);
} elseif ($value == 'libelle' && $tabname[$id] == 'c_payment_term') {
$langs->load("bills");
$key = $langs->trans("PaymentConditionShort".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->$value);
} elseif ($value == 'libelle' && $tabname[$id] == 'c_paiement') {
$langs->load("bills");
$transavailableforcode = $langs->tab_translate["PaymentType".strtoupper($obj->code)];
$key = $langs->trans("PaymentType".strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->$value);
$valuetoshow = $obj->$value;
if ($obj->code && $transavailableforcode) {
$htmltext = $form->textwithpicto($langs->trans("TranslationFound").': '.$key, $langs->trans("TheTranslationIsSearchedFromKey", "PaymentType".strtoupper($obj->code)));
} else {
$htmltext = $form->textwithpicto($langs->trans("TranslationFound").': '.$langs->trans("No"), $langs->trans("TheTranslationIsSearchedFromKey", "PaymentType".strtoupper($obj->code)));
}
//$valuetoshow = $form->textwithpicto($valuetoshow, $htmltext);
$valuetoshow .= '<br><span class="opacitymedium">'.$htmltext.'</span>';
} elseif ($value == 'type' && $tabname[$id] == 'c_paiement') {
$payment_type_list = array(0 => $langs->trans('PaymentTypeCustomer'), 1 => $langs->trans('PaymentTypeSupplier'), 2 => $langs->trans('PaymentTypeBoth'));
$valuetoshow = $payment_type_list[$valuetoshow];
@ -2442,6 +2451,9 @@ if ($id > 0) {
}
}
$class .= ($class ? ' ' : '').'tddict';
if ($value == 'name') {
$class .= ' tdoverflowmax200';
}
if ($value == 'note' && $id == DICT_TVA) {
$class .= ' tdoverflowmax200';
}
@ -2462,7 +2474,7 @@ if ($id > 0) {
}
// Show value for field
if ($showfield) {
print '<!-- '. $value .' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dol_escape_htmltag($titletoshow).'"' : '').'>'.$valuetoshow.'</td>';
print '<!-- '. $value .' --><td class="'.$class.'"'.($titletoshow ? ' title="'.dolPrintHTMLForAttribute($titletoshow).'"' : '').'>'.$valuetoshow.'</td>';
}
}
@ -2623,7 +2635,7 @@ $db->close();
*/
function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
{
global $conf, $langs, $db, $mysoc;
global $langs, $db, $mysoc;
global $form;
global $region_id;
global $elementList, $sourceList, $localtax_typeList, $type_vatList;
@ -2641,6 +2653,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
}
if (in_array($value, array('code', 'libelle', 'type')) && $tabname == "c_actioncomm" && isset($obj->$value) && in_array($obj->type, array('system', 'systemauto'))) {
// Special case for c_actioncomm (field that should not be modified)
$hidden = (!empty($obj->{$value}) ? $obj->{$value} : '');
print '<td>';
print '<input type="hidden" name="'. $value .'" value="'.$hidden.'">';

View File

@ -9713,7 +9713,7 @@ class Form
* @param string $labelno Label for No
* @return string See option
*/
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '', $labelyes = 'Yes', $labelno = 'No')
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = 'width75', $labelyes = 'Yes', $labelno = 'No')
{
global $langs;
@ -9726,7 +9726,7 @@ class Form
$disabled = ($disabled ? ' disabled' : '');
$resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
$resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n";
if ($useempty) {
$resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '>&nbsp;</option>' . "\n";
}

View File

@ -676,8 +676,6 @@ class Translate
*/
public function trans($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $maxsize = 0)
{
global $conf;
if (!empty($this->tab_translate[$key])) { // Translation is available
$str = $this->tab_translate[$key];

View File

@ -1169,6 +1169,8 @@ NoLocalTaxXForThisCountry=According to the setup of taxes (See %s - %s - %s), yo
LabelUsedByDefault=Label used by default if no translation can be found for code
LabelOnDocuments=Label on documents
LabelOrTranslationKey=Label or translation key
TranslationFound=Translation found
TheTranslationIsSearchedFromKey=The translation is searched from the translation key: <b>%s</b>
TranslationKey=Translation key
ValueOfConstantKey=Value of a configuration constant
ConstantIsOn=Option %s is on