Fix look and feel v11

This commit is contained in:
Laurent Destailleur 2019-12-25 23:15:56 +01:00
parent fc45d7d249
commit 8202a67e4e
7 changed files with 81 additions and 96 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
@ -238,6 +238,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("Amount").'</td>';
@ -261,6 +262,7 @@ print '<td><input name="amount" class="flat" type="text" size="6" value="'.dol_e
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
print "</table>";
print '</div>';
print '<br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></div>';

View File

@ -456,7 +456,7 @@ if ($id)
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<table class="border centpercent tableforfield">';
// Label
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';

View File

@ -134,7 +134,7 @@ if ($object->id)
print '<table class="border tableforfield centpercent">';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';

View File

@ -108,6 +108,10 @@ class ChargeSociales extends CommonObject
public $fk_project;
const STATUS_UNPAID = 0;
const STATUS_PAID = 1;
/**
* Constructor
*
@ -495,43 +499,23 @@ class ChargeSociales extends CommonObject
// Load translation files required by the page
$langs->loadLangs(array("customers","bills"));
if ($mode == 0 || $mode == 1)
if (empty($this->labelStatus) || empty($this->labelStatusShort))
{
if ($status == 0) return $langs->trans("Unpaid");
elseif ($status == 1) return $langs->trans("Paid");
}
elseif ($mode == 2)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 3)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 4)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 5)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 6)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
global $langs;
//$langs->load("mymodule");
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft');
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled');
if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
}
else return "Error, mode/status not found";
$statusType = 'status1';
if ($status == 0 && $alreadypaid > 0) $statusType = 'status3';
if ($status == 1) $statusType = 'status6';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@ -105,6 +105,10 @@ class Loan extends CommonObject
public $fk_project;
const STATUS_UNPAID = 0;
const STATUS_PAID = 1;
/**
* Constructor
*
@ -425,47 +429,29 @@ class Loan extends CommonObject
*/
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
{
// phpcs:enable
// phpcs:enable
global $langs;
$langs->loadLangs(array("customers", "bills"));
if ($mode == 0 || $mode == 1)
// Load translation files required by the page
$langs->loadLangs(array("customers","bills"));
if (empty($this->labelStatus) || empty($this->labelStatusShort))
{
if ($status == 0) return $langs->trans("Unpaid");
elseif ($status == 1) return $langs->trans("Paid");
}
elseif ($mode == 2)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 3)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 4)
{
if ($status == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
elseif ($status == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
elseif ($status == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
}
elseif ($mode == 5)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
}
elseif ($mode == 6)
{
if ($status == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
elseif ($status == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
elseif ($status == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
global $langs;
//$langs->load("mymodule");
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft');
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled');
if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
}
else return "Error, mode/status not found";
$statusType = 'status1';
if ($status == 0 && $alreadypaid > 0) $statusType = 'status3';
if ($status == 1) $statusType = 'status6';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@ -49,7 +49,8 @@ if (!$sortorder) $sortorder = "DESC";
$search_ref = GETPOST('search_ref', 'int');
$search_label = GETPOST('search_label', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$filtre = GETPOST("filtre");
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
// Purge search criteria
@ -77,10 +78,6 @@ $sql .= " WHERE l.entity = ".$conf->entity;
if ($search_amount) $sql .= natural_search("l.capital", $search_amount, 1);
if ($search_ref) $sql .= " AND l.rowid = ".$db->escape($search_ref);
if ($search_label) $sql .= natural_search("l.label", $search_label);
if ($filtre) {
$filtre = str_replace(":", "=", $filtre);
$sql .= " AND ".$filtre;
}
$sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend";
$sql .= $db->order($sortfield, $sortorder);
@ -108,10 +105,10 @@ if ($resql)
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_ref) $param.="&amp;search_ref=".urlencode($search_ref);
if ($search_label) $param.="&amp;search_label=".urlencode($search_user);
if ($search_amount) $param.="&amp;search_amount=".urlencode($search_amount_ht);
if ($optioncss != '') $param.='&amp;optioncss='.urlencode($optioncss);
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_label) $param.="&search_label=".urlencode($search_label);
if ($search_amount) $param.="&search_amount=".urlencode($search_amount);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
$newcardbutton='';
if ($user->rights->loan->write)
@ -130,6 +127,8 @@ if ($resql)
print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
$moreforfilter = '';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
@ -157,7 +156,7 @@ if ($resql)
print_liste_field_titre('');
print "</tr>\n";
while ($i < min($num, $limit))
while ($i < ($limit ? min($num, $limit) : $num))
{
$obj = $db->fetch_object($resql);
$loan_static->id = $obj->rowid;
@ -190,6 +189,14 @@ if ($resql)
$i++;
}
// If no record found
if ($num == 0)
{
$colspan = 7;
//foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
print "</table>";
print '</div>';
print "</form>\n";

View File

@ -48,17 +48,17 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/loan/list.php?restore_lastsearch_values=1
$morehtmlref = '<div class="refidno">';
// Ref loan
$morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1);
$morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->projet->enabled))
{
$langs->loadLangs(array("projects"));
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if ($user->rights->loan->write)
{
if ($action != 'classify')
$morehtmlref .= '<a href="'.$_SERVER['PHP_SELF'].'?action=classify&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
//$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
@ -83,6 +83,9 @@ if (!empty($conf->projet->enabled))
}
}
$morehtmlref .= '</div>';
$morehtmlright = '';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
if ($action == 'createecheancier') {
@ -140,8 +143,6 @@ if ($action == 'updateecheancier') {
$echeance = new LoanSchedule($db);
$echeance->fetchAll($object->id);
$var = !$var;
?>
<script type="text/javascript" language="javascript">
@ -187,6 +188,8 @@ if (count($echeance->lines) > 0)
} else {
print '<input type="hidden" name="action" value="createecheancier">';
}
print '<div class="div-table-responsive-no-min">';
print '<table class="border centpercent">';
print '<tr class="liste_titre">';
$colspan = 6;
@ -197,12 +200,12 @@ print '</th>';
print '</tr>';
print '<tr class="liste_titre">';
print '<th width="5%" class="center">'.$langs->trans("Term").'</th>';
print '<th width="5%" class="center">'.$langs->trans("Date").'</th>';
print '<th width="15%" class="center">'.$langs->trans("Insurance");
print '<th width="15%" class="center">'.$langs->trans("InterestAmount").'</th>';
print '<th width="10%" class="center">'.$langs->trans("Amount").'</th>';
print '<th width="40%" class="center">'.$langs->trans("CapitalRemain");
print '<th class="center">'.$langs->trans("Term").'</th>';
print '<th class="center">'.$langs->trans("Date").'</th>';
print '<th class="center">'.$langs->trans("Insurance");
print '<th class="center">'.$langs->trans("InterestAmount").'</th>';
print '<th class="center">'.$langs->trans("Amount").'</th>';
print '<th class="center">'.$langs->trans("CapitalRemain");
print '<br>('.price($object->capital, 0, '', 1, -1, -1, $conf->currency).')';
print '<input type="hidden" name="hi_capital0" id ="hi_capital0" value="'.$object->capital.'">';
print '</th>';
@ -276,8 +279,11 @@ elseif (count($echeance->lines) > 0)
}
print '</table>';
print '</div>';
print '</br>';
print '</br>';
if (count($echeance->lines) == 0) $label = $langs->trans("Create");
else $label = $langs->trans("Save");
print '<div class="center"><input class="button" type="submit" value="'.$label.'"></div>';