Look and feel v13

This commit is contained in:
Laurent Destailleur 2020-09-21 13:54:26 +02:00
parent 3e977bc5d6
commit e52559783f
9 changed files with 183 additions and 174 deletions

View File

@ -282,7 +282,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Latest modified members
*/
$max = 5;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.tms as datem, datefin as date_end_subscription,";
@ -337,7 +337,7 @@ if ($resql) {
/*
* Last modified subscriptions
*/
$max = 5;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " datefin as date_end_subscription,";

View File

@ -58,7 +58,7 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
$max = 3;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$now = dol_now();
/*
@ -523,7 +523,7 @@ if ($user->rights->agenda->myactions->read) {
* Actions to do
*/
if ($user->rights->agenda->myactions->read) {
show_array_actions_to_do(10);
show_array_actions_to_do($max);
}
@ -545,12 +545,12 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND s.rowid = ".$socid;
$sql .= " ORDER BY c.tms DESC";
$sql .= $db->plimit(5, 0);
$sql .= $db->plimit($max + 1, 0);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
startSimpleTable($langs->trans("LastContracts", 5), "", "", 2);
startSimpleTable($langs->trans("LastContracts", $max), "", "", 2);
if ($num > 0) {
$i = 0;
@ -604,17 +604,26 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$resql = $db->query($sql);
if ($resql) {
$total = 0;
$total = $total_ttc = 0;
$num = $db->num_rows($resql);
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
startSimpleTable("ProposalsOpened", "comm/propal/list.php", "search_status=1", 4, $num);
if ($num > 0) {
$i = 0;
$othernb = 0;
while ($i < $nbofloop) {
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$propalstatic->id = $obj->propalid;
$propalstatic->ref = $obj->ref;
$propalstatic->ref_client = $obj->ref_client;
@ -655,11 +664,20 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
print '</tr>';
$i++;
$total += (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
}
addSummaryTableLine(5, $num, $nbofloop, $total, "NoProposal", true);
addSummaryTableLine(5, $num, $nbofloop, empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $total_ttc : $total, "NoProposal", true);
finishSimpleTable(true);
$db->free($resql);
@ -687,17 +705,26 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$resql = $db->query($sql);
if ($resql) {
$total = 0;
$total = $total_ttc = 0;
$num = $db->num_rows($resql);
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
startSimpleTable("OrdersOpened", "commande/list.php", "search_status=".Commande::STATUS_VALIDATED, 4, $num);
if ($num > 0) {
$i = 0;
$othernb = 0;
while ($i < $nbofloop) {
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$orderstatic->id = $obj->commandeid;
$orderstatic->ref = $obj->ref;
$orderstatic->ref_client = $obj->ref_client;
@ -738,11 +765,20 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '</tr>';
$i++;
$total +=(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc);
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
}
addSummaryTableLine(5, $num, $nbofloop, $total, "None", true);
addSummaryTableLine(5, $num, $nbofloop, empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $total_ttc : $total, "None", true);
finishSimpleTable(true);
$db->free($resql);

View File

@ -60,7 +60,7 @@ if ($user->socid > 0)
$socid = $user->socid;
}
$max = 3;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('invoiceindex'));
@ -370,6 +370,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$num = $db->num_rows($resql);
$i = 0;
$othernb = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
@ -386,6 +387,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$facturestatic->ref = $obj->ref;
$facturestatic->id = $obj->rowid;
$facturestatic->total_ht = $obj->total_ht;
@ -442,6 +451,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
} else {
$colspan = 5;
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
@ -501,10 +518,20 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
{
$i = 0;
$total = $total_ttc = $totalam = 0;
$othernb = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$facstatic->ref = $obj->ref;
$facstatic->id = $obj->rowid;
$facstatic->total_ht = $obj->total_ht;
@ -539,6 +566,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$totalam += $obj->am;
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
} else {
$colspan = 5;
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
@ -574,10 +609,10 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire)
$result = $db->query($sql);
if ($result)
{
$var = false;
$num = $db->num_rows($result);
$i = 0;
$othernb = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
@ -596,6 +631,14 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire)
{
$objp = $db->fetch_object($result);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$donationstatic->id = $objp->rowid;
$donationstatic->ref = $objp->rowid;
$donationstatic->lastname = $objp->lastname;
@ -614,6 +657,14 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire)
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
} else {
print '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
@ -663,10 +714,20 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
$i = 0;
$tot_ttc = 0;
$othernb = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$chargestatic->id = $obj->rowid;
$chargestatic->ref = $obj->rowid;
$chargestatic->label = $obj->label;
@ -684,6 +745,14 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total"><td class="left" colspan="2">'.$langs->trans("Total").'</td>';
print '<td class="nowrap right">'.price($tot_ttc).'</td>';
print '<td class="right"></td>';
@ -740,6 +809,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
if ($num)
{
$i = 0;
$othernb = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
@ -764,6 +834,14 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$societestatic->id = $obj->socid;
$societestatic->name = $obj->name;
$societestatic->email = $obj->email;
@ -812,6 +890,14 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($tot_ht).'</td>';
print '<td class="nowrap right">'.price($tot_ttc).'</td>';
@ -861,6 +947,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$num = $db->num_rows($resql);
$i = 0;
$othernb = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
@ -887,6 +974,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$facturestatic->ref = $obj->ref;
$facturestatic->id = $obj->rowid;
$facturestatic->total_ht = $obj->total_ht;
@ -934,7 +1029,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="nowrap right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am, $obj->type).'</td>';
print '</tr>';
$total_ttc += $obj->total_ttc;
@ -944,6 +1039,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc - $totalam).')</font> </td>';
print '<td>&nbsp;</td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>';
@ -970,7 +1073,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
{
$facstatic = new FactureFournisseur($db);
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
$sql .= ", ff.date_lim_reglement";
$sql .= ", s.nom as name";
$sql .= ", s.rowid as socid, s.email";
@ -991,7 +1094,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$reshook = $hookmanager->executeHooks('printFieldListWhereSupplierUnpaid', $parameters);
$sql .= $hookmanager->resPrint;
$sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye, ff.date_lim_reglement,";
$sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye, ff.date_lim_reglement,";
$sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
$sql .= " ORDER BY ff.date_lim_reglement ASC";
@ -999,6 +1102,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
if ($resql)
{
$num = $db->num_rows($resql);
$othernb = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
@ -1028,8 +1132,17 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
{
$obj = $db->fetch_object($resql);
if ($i >= $max) {
$othernb += 1;
$i++;
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
continue;
}
$facstatic->ref = $obj->ref;
$facstatic->id = $obj->rowid;
$facstatic->type = $obj->type;
$facstatic->total_ht = $obj->total_ht;
$facstatic->total_tva = $obj->total_tva;
$facstatic->total_ttc = $obj->total_ttc;
@ -1052,7 +1165,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($obj->total_ht).'</td>';
print '<td class="nowrap right">'.price($obj->total_ttc).'</td>';
print '<td class="nowrap right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am, $obj->type).'</td>';
print '</tr>';
$total += $obj->total_ht;
$total_ttc += $obj->total_ttc;
@ -1060,6 +1173,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$i++;
}
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc - $totalam).')</font> </td>';
print '<td>&nbsp;</td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td class="right">'.price($total).'</td>';

View File

@ -544,7 +544,7 @@ abstract class CommonInvoice extends CommonObject
$labelStatus = $langs->trans('BillStatusClosedPaidPartially');
$labelStatusShort = $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially');
$statusType = 'status9';
} elseif ($alreadypaid <= 0) {
} elseif ($alreadypaid == 0) {
$labelStatus = $langs->trans('BillStatusNotPaid');
$labelStatusShort = $langs->trans('Bill'.$prefix.'StatusNotPaid');
$statusType = 'status1';

View File

@ -53,8 +53,7 @@ if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INF
$holiday = new Holiday($db);
$holidaystatic = new Holiday($db);
$max = 3;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
/*

View File

@ -159,8 +159,8 @@ END MODULEBUILDER DRAFT MYOBJECT */
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$NBMAX = 3;
$max = 3;
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject

View File

@ -53,7 +53,7 @@ if (!$user->rights->projet->lire) accessforbidden();
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$max = 3;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
/*
@ -362,7 +362,7 @@ if ($resql)
if ($othernb) {
print '<tr class="oddeven">';
print '<td class="nowrap">';
print '...';
print '<span class="opacitymedium">...</span>';
print '</td>';
print '<td class="nowrap right">';
print $othernb;

View File

@ -317,8 +317,8 @@ END MODULEBUILDER DRAFT MYOBJECT */
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$NBMAX = 3;
$max = 3;
$NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Last modified job position
if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)

View File

@ -67,156 +67,9 @@ print load_fiche_titre($langs->trans("ZapierForDolibarrArea"), '', 'zapier.png@z
print '<div class="fichecenter"><div class="fichethirdleft">';
/* BEGIN MODULEBUILDER DRAFT MYOBJECT
// Draft MyObject
if (! empty($conf->zapier->enabled) && $user->rights->zapier->read)
{
$langs->load("orders");
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.fk_soc = s.rowid";
$sql.= " AND c.fk_statut = 0";
$sql.= " AND c.entity IN (".getEntity('commande').")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
$resql = $db->query($sql);
if ($resql)
{
$total = 0;
$num = $db->num_rows($resql);
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("DraftOrders").($num?'<span class="badge marginleftonlyshort">'.$num.'</span>':'').'</th></tr>';
$var = true;
if ($num > 0)
{
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven"><td class="nowrap">';
$orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref;
$orderstatic->ref_client=$obj->ref_client;
$orderstatic->total_ht = $obj->total_ht;
$orderstatic->total_tva = $obj->total_tva;
$orderstatic->total_ttc = $obj->total_ttc;
print $orderstatic->getNomUrl(1);
print '</td>';
print '<td class="nowrap">';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1,'customer',16);
print '</td>';
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
$i++;
$total += $obj->total_ttc;
}
if ($total>0)
{
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" class="right">'.price($total)."</td></tr>";
}
}
else
{
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoOrder").'</td></tr>';
}
print "</table><br>";
$db->free($resql);
}
else
{
dol_print_error($db);
}
}
END MODULEBUILDER DRAFT MYOBJECT */
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$NBMAX = 3;
$max = 3;
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject
if (! empty($conf->zapier->enabled) && $user->rights->zapier->read)
{
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 2, 3)";
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = $socid";
$sql .= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th colspan="2">';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
print '</th>';
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
print '</tr>';
if ($num)
{
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$companystatic->id=$objp->rowid;
$companystatic->name=$objp->name;
$companystatic->client=$objp->client;
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas=$objp->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
print '<td class="right nowrap">';
print $companystatic->getLibCustProspStatut();
print "</td>";
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms),'day')."</td>";
print '</tr>';
$i++;
}
$db->free($resql);
}
else
{
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table><br>";
}
}
*/
print '</div></div></div>';
// End of page