Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_tasklist_columnAndExtrafields
This commit is contained in:
commit
81d86f717d
@ -2785,7 +2785,7 @@ class ContratLigne extends CommonObjectLine
|
|||||||
elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); }
|
elseif ($status == self::STATUS_CLOSED) { $labelStatus = $langs->trans("ServiceStatusClosed"); $labelStatusShort = $langs->trans("ServiceStatusClosed"); }
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status3';
|
if ($status == self::STATUS_OPEN && $expired == 1) $statusType = 'status1';
|
||||||
if ($status == self::STATUS_CLOSED) $statusType = 'status6';
|
if ($status == self::STATUS_CLOSED) $statusType = 'status6';
|
||||||
|
|
||||||
$params = array(); $reg = array();
|
$params = array(); $reg = array();
|
||||||
|
|||||||
@ -109,7 +109,7 @@ $dataseries = array();
|
|||||||
$vals = array();
|
$vals = array();
|
||||||
|
|
||||||
// Search by status (except expired)
|
// Search by status (except expired)
|
||||||
$sql = "SELECT count(cd.rowid), cd.statut";
|
$sql = "SELECT count(cd.rowid) as nb, cd.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -126,16 +126,16 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($row)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$nb[$row[1]] = $row[0];
|
$nb[$obj->status] = $obj->nb;
|
||||||
if ($row[1] != 5)
|
if ($obj->status != 5)
|
||||||
{
|
{
|
||||||
$vals[$row[1]] = $row[0];
|
$vals[$obj->status] = $obj->nb;
|
||||||
$totalinprocess += $row[0];
|
$totalinprocess += $obj->nb;
|
||||||
}
|
}
|
||||||
$total += $row[0];
|
$total += $obj->nb;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
// Search by status (only expired)
|
// Search by status (only expired)
|
||||||
$sql = "SELECT count(cd.rowid), cd.statut";
|
$sql = "SELECT count(cd.rowid) as nb, cd.statut as status";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
$sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -165,16 +165,16 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($row)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$nb[$row[1].true] = $row[0];
|
$nb[$obj->status.true] = $obj->nb;
|
||||||
if ($row[1] != 5)
|
if ($obj->status != 5)
|
||||||
{
|
{
|
||||||
$vals[$row[1]] = $row[0];
|
$vals[$obj->status.true] = $obj->nb;
|
||||||
$totalinprocess += $row[0];
|
$totalinprocess += $obj->nb;
|
||||||
}
|
}
|
||||||
$total += $row[0];
|
$total += $obj->nb;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -185,6 +185,10 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$colorseries = array();
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Services").'</th></tr>'."\n";
|
||||||
@ -192,6 +196,11 @@ $listofstatus = array(0, 4, 4, 5); $bool = false;
|
|||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (int) $nb[$status.$bool] : 0));
|
$dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (int) $nb[$status.$bool] : 0));
|
||||||
|
if ($status == ContratLigne::STATUS_INITIAL) $colorseries[$status.$bool] = '-'.$badgeStatus0;
|
||||||
|
if ($status == ContratLigne::STATUS_OPEN && !$bool) $colorseries[$status.$bool] = $badgeStatus4;
|
||||||
|
if ($status == ContratLigne::STATUS_OPEN && $bool) $colorseries[$status.$bool] = $badgeStatus1;
|
||||||
|
if ($status == ContratLigne::STATUS_CLOSED) $colorseries[$status.$bool] = $badgeStatus6;
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax))
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -209,6 +218,7 @@ if (!empty($conf->use_javascript_ajax))
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
|
|||||||
@ -3764,10 +3764,13 @@ function img_allow($allow, $titlealt = 'default')
|
|||||||
* Return image of a credit card according to its brand name
|
* Return image of a credit card according to its brand name
|
||||||
*
|
*
|
||||||
* @param string $brand Brand name of credit card
|
* @param string $brand Brand name of credit card
|
||||||
|
* @param string $morecss More CSS
|
||||||
* @return string Return img tag
|
* @return string Return img tag
|
||||||
*/
|
*/
|
||||||
function img_credit_card($brand)
|
function img_credit_card($brand, $morecss = null)
|
||||||
{
|
{
|
||||||
|
if (is_null($morecss)) $morecss = 'fa-2x';
|
||||||
|
|
||||||
if ($brand == 'visa' || $brand == 'Visa') {$brand = 'cc-visa'; }
|
if ($brand == 'visa' || $brand == 'Visa') {$brand = 'cc-visa'; }
|
||||||
elseif ($brand == 'mastercard' || $brand == 'MasterCard') {$brand = 'cc-mastercard'; }
|
elseif ($brand == 'mastercard' || $brand == 'MasterCard') {$brand = 'cc-mastercard'; }
|
||||||
elseif ($brand == 'amex' || $brand == 'American Express') {$brand = 'cc-amex'; }
|
elseif ($brand == 'amex' || $brand == 'American Express') {$brand = 'cc-amex'; }
|
||||||
@ -3776,7 +3779,7 @@ function img_credit_card($brand)
|
|||||||
elseif ($brand == 'diners' || $brand == 'Diners club') {$brand = 'cc-diners-club'; }
|
elseif ($brand == 'diners' || $brand == 'Diners club') {$brand = 'cc-diners-club'; }
|
||||||
elseif (!in_array($brand, array('cc-visa', 'cc-mastercard', 'cc-amex', 'cc-discover', 'cc-jcb', 'cc-diners-club'))) {$brand = 'credit-card'; }
|
elseif (!in_array($brand, array('cc-visa', 'cc-mastercard', 'cc-amex', 'cc-discover', 'cc-jcb', 'cc-diners-club'))) {$brand = 'credit-card'; }
|
||||||
|
|
||||||
return '<span class="fa fa-'.$brand.' fa-2x fa-fw"></span>';
|
return '<span class="fa fa-'.$brand.' fa-fw'.($morecss ? ' '.$morecss : '').'"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -255,7 +255,6 @@ if ( $resql )
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table></div><br>";
|
print "</table></div><br>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user