New: Ajout fleches navigation suivant/prcdent dans fiches adhrents
This commit is contained in:
parent
f1fa416e9f
commit
8053321f7b
@ -1707,6 +1707,41 @@ class Adherent
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les propriétés id_previous et id_next
|
||||
* \param filter filtre
|
||||
* \return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function load_previous_next_id($filter='')
|
||||
{
|
||||
$sql = "SELECT MAX(rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent";
|
||||
$sql.= " WHERE rowid < '".addslashes($this->id)."'";
|
||||
if (isset($filter)) $sql.=" AND ".$filter;
|
||||
$result = $this->db->query($sql) ;
|
||||
if (! $result)
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
$row = $this->db->fetch_row($result);
|
||||
$this->id_previous = $row[0];
|
||||
|
||||
$sql = "SELECT MIN(rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent";
|
||||
$sql.= " WHERE rowid > '".addslashes($this->id)."'";
|
||||
if (isset($filter)) $sql.=" AND ".$filter;
|
||||
$result = $this->db->query($sql) ;
|
||||
if (! $result)
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -2;
|
||||
}
|
||||
$row = $this->db->fetch_row($result);
|
||||
$this->id_next = $row[0];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Initialise le membre avec valeurs fictives aléatoire
|
||||
*/
|
||||
|
||||
@ -183,11 +183,21 @@ $head = member_prepare_head($adh);
|
||||
dolibarr_fiche_head($head, 'subscription', $langs->trans("Member"));
|
||||
|
||||
|
||||
$result=$adh->load_previous_next_id($adh->next_prev_filter);
|
||||
if ($result < 0) dolibarr_print_error($db,$adh->error);
|
||||
$previous_id = $adh->id_previous?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_previous).'">'.img_previous().'</a>':'';
|
||||
$next_id = $adh->id_next?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_next).'">'.img_next().'</a>':'';
|
||||
|
||||
print '<form action="fiche.php" method="post">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur">'.$adh->id.' </td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur">';
|
||||
if ($previous_id || $next_id) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print $adh->id;
|
||||
if ($previous_id || $next_id) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_id.'</td><td class="nobordernopadding" align="center" width="20">'.$next_id.'</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
@ -219,8 +229,8 @@ print "</div>\n";
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// Lien nouvelle cotisation
|
||||
if ($action != 'addsubscription')
|
||||
// Lien nouvelle cotisation si non brouillon et non résilié
|
||||
if ($action != 'addsubscription' && $adh->statut > 0)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"card_subscriptions.php?rowid=$rowid&action=addsubscription\">".$langs->trans("NewSubscription")."</a>";
|
||||
}
|
||||
@ -331,7 +341,8 @@ if ($adh->datefin)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived")." ".img_warning($langs->trans("Late"));
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non résilié
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -734,7 +734,6 @@ if ($action == 'create')
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($rowid && $action != 'edit')
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
@ -762,6 +761,11 @@ if ($rowid && $action != 'edit')
|
||||
dolibarr_fiche_head($head, 'general', $langs->trans("Member"));
|
||||
|
||||
|
||||
$result=$adh->load_previous_next_id($adh->next_prev_filter);
|
||||
if ($result < 0) dolibarr_print_error($db,$adh->error);
|
||||
$previous_id = $adh->id_previous?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_previous).'">'.img_previous().'</a>':'';
|
||||
$next_id = $adh->id_next?'<a href="'.$_SERVER["PHP_SELF"].'?rowid='.urlencode($adh->id_next).'">'.img_next().'</a>':'';
|
||||
|
||||
// Confirmation de la suppression de l'adhérent
|
||||
if ($action == 'delete')
|
||||
{
|
||||
@ -832,7 +836,12 @@ if ($rowid && $action != 'edit')
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="3">'.$adh->id.' </td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur" colspan="3">';
|
||||
if ($previous_id || $next_id) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print $adh->id;
|
||||
if ($previous_id || $next_id) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_id.'</td><td class="nobordernopadding" align="center" width="20">'.$next_id.'</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
|
||||
@ -85,6 +85,10 @@ $head = member_prepare_head($adh);
|
||||
|
||||
dolibarr_fiche_head($head, 'ldap', $langs->trans("Member"));
|
||||
|
||||
$result=$adh->load_previous_next_id($adh->next_prev_filter);
|
||||
if ($result < 0) dolibarr_print_error($db,$adh->error);
|
||||
$previous_id = $adh->id_previous?'<a href="'.$_SERVER["PHP_SELF"].'?id='.urlencode($adh->id_previous).'">'.img_previous().'</a>':'';
|
||||
$next_id = $adh->id_next?'<a href="'.$_SERVER["PHP_SELF"].'?id='.urlencode($adh->id_next).'">'.img_next().'</a>':'';
|
||||
|
||||
|
||||
/*
|
||||
@ -93,7 +97,12 @@ dolibarr_fiche_head($head, 'ldap', $langs->trans("Member"));
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur">'.$adh->id.' </td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur">';
|
||||
if ($previous_id || $next_id) print '<table class="nobordernopadding" width="100%"><tr class="nobordernopadding"><td class="nobordernopadding">';
|
||||
print $adh->id;
|
||||
if ($previous_id || $next_id) print '</td><td class="nobordernopadding" align="center" width="20">'.$previous_id.'</td><td class="nobordernopadding" align="center" width="20">'.$next_id.'</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Nom
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.' </td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user