Merge pull request #10925 from ptibogxiv/patch-146
NEW morphy value in member type
This commit is contained in:
commit
6884999ee3
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2018-2019 Thibault Foucart <support@ptibogxiv.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -64,6 +65,11 @@ class AdherentType extends CommonObject
|
|||||||
* @var string Adherent type label
|
* @var string Adherent type label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Adherent type nature
|
||||||
|
*/
|
||||||
|
public $morphy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Subsription required (0 or 1)
|
* @var int Subsription required (0 or 1)
|
||||||
@ -184,6 +190,7 @@ class AdherentType extends CommonObject
|
|||||||
$sql.= "SET ";
|
$sql.= "SET ";
|
||||||
$sql.= "statut = ".$this->statut.",";
|
$sql.= "statut = ".$this->statut.",";
|
||||||
$sql.= "libelle = '".$this->db->escape($this->label) ."',";
|
$sql.= "libelle = '".$this->db->escape($this->label) ."',";
|
||||||
|
$sql.= "morphy = '".$this->db->escape($this->morphy) ."',";
|
||||||
$sql.= "subscription = '".$this->db->escape($this->subscription)."',";
|
$sql.= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||||
$sql.= "vote = ".(integer) $this->db->escape($this->vote).",";
|
$sql.= "vote = ".(integer) $this->db->escape($this->vote).",";
|
||||||
@ -274,7 +281,7 @@ class AdherentType extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetch($rowid)
|
public function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, d.libelle as label, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||||
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
||||||
|
|
||||||
@ -290,6 +297,7 @@ class AdherentType extends CommonObject
|
|||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->ref = $obj->rowid;
|
$this->ref = $obj->rowid;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
|
$this->morphy = $obj->morphy;
|
||||||
$this->statut = $obj->statut;
|
$this->statut = $obj->statut;
|
||||||
$this->subscription = $obj->subscription;
|
$this->subscription = $obj->subscription;
|
||||||
$this->mail_valid = $obj->mail_valid;
|
$this->mail_valid = $obj->mail_valid;
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
|
* Copyright (C) 2019 Thibault Foucart <support@ptibogxiv.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -57,6 +58,7 @@ if (! $sortorder) { $sortorder="DESC"; }
|
|||||||
if (! $sortfield) { $sortfield="d.lastname"; }
|
if (! $sortfield) { $sortfield="d.lastname"; }
|
||||||
|
|
||||||
$label=GETPOST("label", "alpha");
|
$label=GETPOST("label", "alpha");
|
||||||
|
$morphy=GETPOST("morphy", "alpha");
|
||||||
$statut=GETPOST("statut", "int");
|
$statut=GETPOST("statut", "int");
|
||||||
$subscription=GETPOST("subscription", "int");
|
$subscription=GETPOST("subscription", "int");
|
||||||
$vote=GETPOST("vote", "int");
|
$vote=GETPOST("vote", "int");
|
||||||
@ -103,6 +105,7 @@ if ($cancel) {
|
|||||||
|
|
||||||
if ($action == 'add' && $user->rights->adherent->configurer) {
|
if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||||
$object->label = trim($label);
|
$object->label = trim($label);
|
||||||
|
$object->morphy = trim($morphy);
|
||||||
$object->statut = (int) $statut;
|
$object->statut = (int) $statut;
|
||||||
$object->subscription = (int) $subscription;
|
$object->subscription = (int) $subscription;
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
@ -157,6 +160,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||||||
$object->oldcopy = clone $object;
|
$object->oldcopy = clone $object;
|
||||||
|
|
||||||
$object->label = trim($label);
|
$object->label = trim($label);
|
||||||
|
$object->morphy = trim($morphy);
|
||||||
$object->statut = (int) $statut;
|
$object->statut = (int) $statut;
|
||||||
$object->subscription = (int) $subscription;
|
$object->subscription = (int) $subscription;
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
@ -215,7 +219,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
{
|
{
|
||||||
//dol_fiche_head('');
|
//dol_fiche_head('');
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut";
|
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut, d.morphy";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||||
$sql.= " WHERE d.entity IN (".getEntity('member_type').")";
|
$sql.= " WHERE d.entity IN (".getEntity('member_type').")";
|
||||||
|
|
||||||
@ -256,6 +260,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Ref").'</th>';
|
print '<th>'.$langs->trans("Ref").'</th>';
|
||||||
print '<th>'.$langs->trans("Label").'</th>';
|
print '<th>'.$langs->trans("Label").'</th>';
|
||||||
|
print '<th class="center">'.$langs->trans("Nature").'</th>';
|
||||||
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
||||||
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
|
print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
|
||||||
print '<th class="center">'.$langs->trans("Status").'</th>';
|
print '<th class="center">'.$langs->trans("Status").'</th>';
|
||||||
@ -277,6 +282,11 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||||||
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($objp->morphy == 'phy') { print $langs->trans("Physical"); }
|
||||||
|
elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); }
|
||||||
|
else print $langs->trans("Physical & Morale");
|
||||||
|
print '</td>';
|
||||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -330,6 +340,14 @@ if ($action == 'create')
|
|||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1);
|
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Morphy
|
||||||
|
$morphys[""] = $langs->trans("Physical & Morale");
|
||||||
|
$morphys["phy"] = $langs->trans("Physical");
|
||||||
|
$morphys["mor"] = $langs->trans("Morale");
|
||||||
|
print '<tr><td><span>'.$langs->trans("Nature").'</span></td><td>';
|
||||||
|
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||||
print $form->selectyesno("subscription", 1, 1);
|
print $form->selectyesno("subscription", 1, 1);
|
||||||
@ -411,6 +429,10 @@ if ($rowid > 0)
|
|||||||
print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased");
|
print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased");
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Morphy
|
||||||
|
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||||
print yn($object->subscription);
|
print yn($object->subscription);
|
||||||
@ -751,6 +773,14 @@ if ($rowid > 0)
|
|||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut);
|
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Morphy
|
||||||
|
$morphys[""] = $langs->trans("Physical & Morale");
|
||||||
|
$morphys["phy"] = $langs->trans("Physical");
|
||||||
|
$morphys["mor"] = $langs->trans("Morale");
|
||||||
|
print '<tr><td><span>'.$langs->trans("Nature").'</span></td><td>';
|
||||||
|
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||||
print $form->selectyesno("subscription", $object->subscription, 1);
|
print $form->selectyesno("subscription", $object->subscription, 1);
|
||||||
|
|||||||
@ -86,6 +86,7 @@ create table llx_mailing_unsubscribe
|
|||||||
ALTER TABLE llx_mailing_unsubscribe ADD UNIQUE uk_mailing_unsubscribe(email, entity, unsubscribegroup);
|
ALTER TABLE llx_mailing_unsubscribe ADD UNIQUE uk_mailing_unsubscribe(email, entity, unsubscribegroup);
|
||||||
|
|
||||||
ALTER TABLE llx_adherent ADD gender VARCHAR(10);
|
ALTER TABLE llx_adherent ADD gender VARCHAR(10);
|
||||||
|
ALTER TABLE llx_adherent_type ADD morphy VARCHAR(3);
|
||||||
ALTER TABLE llx_subscription ADD fk_type integer;
|
ALTER TABLE llx_subscription ADD fk_type integer;
|
||||||
|
|
||||||
-- Add url_id into unique index of bank_url
|
-- Add url_id into unique index of bank_url
|
||||||
|
|||||||
@ -29,6 +29,7 @@ create table llx_adherent_type
|
|||||||
tms timestamp,
|
tms timestamp,
|
||||||
statut smallint NOT NULL DEFAULT 0,
|
statut smallint NOT NULL DEFAULT 0,
|
||||||
libelle varchar(50) NOT NULL,
|
libelle varchar(50) NOT NULL,
|
||||||
|
morphy varchar(3) NOT NULL,
|
||||||
subscription varchar(3) NOT NULL DEFAULT 'yes',
|
subscription varchar(3) NOT NULL DEFAULT 'yes',
|
||||||
vote varchar(3) NOT NULL DEFAULT 'yes',
|
vote varchar(3) NOT NULL DEFAULT 'yes',
|
||||||
note text,
|
note text,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user