Fix minor bug on subscription pages
This commit is contained in:
parent
c750ba8b99
commit
9fd48df839
@ -32,7 +32,8 @@ class Subscription extends CommonObject
|
|||||||
{
|
{
|
||||||
public $element='subscription';
|
public $element='subscription';
|
||||||
public $table_element='subscription';
|
public $table_element='subscription';
|
||||||
|
public $picto='payment';
|
||||||
|
|
||||||
var $datec; // Date creation
|
var $datec; // Date creation
|
||||||
var $datem; // Date modification
|
var $datem; // Date modification
|
||||||
var $dateh; // Subscription start date (date subscription)
|
var $dateh; // Subscription start date (date subscription)
|
||||||
@ -277,6 +278,31 @@ class Subscription extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retourne le libelle du statut d'une adhesion
|
||||||
|
*
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Label
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode=0)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoi le libelle d'un statut donne
|
||||||
|
*
|
||||||
|
* @param int $statut Id statut
|
||||||
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
|
* @return string Label
|
||||||
|
*/
|
||||||
|
function LibStatut($statut)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$langs->load("members");
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load information of the subscription object
|
* Load information of the subscription object
|
||||||
*
|
*
|
||||||
|
|||||||
@ -792,7 +792,7 @@ if ($rowid > 0)
|
|||||||
$sql.= " c.datef,";
|
$sql.= " c.datef,";
|
||||||
$sql.= " c.fk_bank,";
|
$sql.= " c.fk_bank,";
|
||||||
$sql.= " b.rowid as bid,";
|
$sql.= " b.rowid as bid,";
|
||||||
$sql.= " ba.rowid as baid, ba.label, ba.bank";
|
$sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.accountancy_journal, ba.number";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
@ -807,7 +807,7 @@ if ($rowid > 0)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
print '<table class="noborder" width="100%">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Ref").'</td>';
|
print '<td>'.$langs->trans("Ref").'</td>';
|
||||||
@ -841,6 +841,10 @@ if ($rowid > 0)
|
|||||||
{
|
{
|
||||||
$accountstatic->label=$objp->label;
|
$accountstatic->label=$objp->label;
|
||||||
$accountstatic->id=$objp->baid;
|
$accountstatic->id=$objp->baid;
|
||||||
|
$accountstatic->number=$objp->number;
|
||||||
|
$accountstatic->account_number=$objp->account_number;
|
||||||
|
$accountstatic->accountancy_journal=$objp->accountancy_journal;
|
||||||
|
$accountstatic->ref=$objp->ref;
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -40,6 +40,7 @@ $action=GETPOST("action",'alpha');
|
|||||||
$rowid=GETPOST("rowid","int")?GETPOST("rowid","int"):GETPOST("id","int");
|
$rowid=GETPOST("rowid","int")?GETPOST("rowid","int"):GETPOST("id","int");
|
||||||
$typeid=GETPOST("typeid","int");
|
$typeid=GETPOST("typeid","int");
|
||||||
$cancel=GETPOST('cancel');
|
$cancel=GETPOST('cancel');
|
||||||
|
$confirm=GETPOST('confirm');
|
||||||
|
|
||||||
if (! $user->rights->adherent->cotisation->lire)
|
if (! $user->rights->adherent->cotisation->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -62,10 +63,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include,
|
|||||||
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
|
||||||
if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update' && ! $_POST["cancel"])
|
if ($user->rights->adherent->cotisation->creer && $action == 'update' && ! $cancel)
|
||||||
{
|
{
|
||||||
// Charge objet actuel
|
// Charge objet actuel
|
||||||
$result=$object->fetch($_POST["rowid"]);
|
$result=$object->fetch($rowid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
@ -138,7 +139,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->adherent->cotisation->creer)
|
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->adherent->cotisation->creer)
|
||||||
{
|
{
|
||||||
$result=$object->fetch($rowid);
|
$result=$object->fetch($rowid);
|
||||||
$result=$object->delete($user);
|
$result=$object->delete($user);
|
||||||
@ -189,11 +190,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
|||||||
|
|
||||||
dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');
|
dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment');
|
||||||
|
|
||||||
print "\n";
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
print "\n";
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td class="valeur" colspan="3">';
|
print '<td class="valeur" colspan="3">';
|
||||||
@ -287,49 +288,50 @@ if ($rowid && $action != 'edit')
|
|||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
// Ref
|
dol_banner_tab($object, 'rowid', $linkback, 1);
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
|
|
||||||
print '<td class="valeur" colspan="3">';
|
print '<div class="fichecenter">';
|
||||||
print $form->showrefnav($object, 'rowid', $linkback, 1);
|
|
||||||
print '</td></tr>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Member
|
// Member
|
||||||
$adh->ref=$adh->getFullName($langs);
|
$adh->ref=$adh->getFullName($langs);
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1,0,'subscription').'</td>';
|
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1,0,'subscription').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date record
|
// Date record
|
||||||
/*print '<tr>';
|
/*print '<tr>';
|
||||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->datec,'dayhour').'</td>';
|
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->datec,'dayhour').'</td>';
|
||||||
print '</tr>';*/
|
print '</tr>';*/
|
||||||
|
|
||||||
// Date subscription
|
// Date subscription
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->dateh,'day').'</td>';
|
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh,'day').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date end subscription
|
// Date end subscription
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="3">'.dol_print_date($object->datef,'day').'</td>';
|
print '<td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur">'.dol_print_date($object->datef,'day').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="3">'.price($object->amount).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$object->note.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||||
|
|
||||||
// Bank line
|
// Bank line
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="3">';
|
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||||
if ($object->fk_bank)
|
if ($object->fk_bank)
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
@ -346,6 +348,8 @@ if ($rowid && $action != 'edit')
|
|||||||
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@ -5256,7 +5256,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
|
|||||||
|
|
||||||
$sql = "SELECT ".$fieldid." as valuetoget";
|
$sql = "SELECT ".$fieldid." as valuetoget";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
|
||||||
$sql.= " WHERE ".$fieldkey." = '".$key."'";
|
$sql.= " WHERE ".$fieldkey." = '".$db->escape($key)."'";
|
||||||
dol_syslog('dol_getIdFromCode', LOG_DEBUG);
|
dol_syslog('dol_getIdFromCode', LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -45,7 +45,7 @@ MemberStatusDraft=Draft (needs to be validated)
|
|||||||
MemberStatusDraftShort=Draft
|
MemberStatusDraftShort=Draft
|
||||||
MemberStatusActive=Validated (waiting subscription)
|
MemberStatusActive=Validated (waiting subscription)
|
||||||
MemberStatusActiveShort=Validated
|
MemberStatusActiveShort=Validated
|
||||||
MemberStatusActiveLate=subscription expired
|
MemberStatusActiveLate=Subscription expired
|
||||||
MemberStatusActiveLateShort=Expired
|
MemberStatusActiveLateShort=Expired
|
||||||
MemberStatusPaid=Subscription up to date
|
MemberStatusPaid=Subscription up to date
|
||||||
MemberStatusPaidShort=Up to date
|
MemberStatusPaidShort=Up to date
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user