Ejemplo n.º 1
0
		if ($statut == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
		if ($statut == '-1')   { $titre=$langs->trans("MembersListToValid"); }
		if ($statut == '1' && ! $filter)    		{ $titre=$langs->trans("MembersListValid"); }
		if ($statut == '1' && $filter=='uptodate')  { $titre=$langs->trans("MembersListUpToDate"); }
		if ($statut == '1' && $filter=='outofdate')	{ $titre=$langs->trans("MembersListNotUpToDate"); }
		if ($statut == '0')    { $titre=$langs->trans("MembersListResiliated"); }
	}
	elseif ($_POST["action"] == 'search')
	{
		$titre=$langs->trans("MembersListQualified");
	}

	if ($_REQUEST["type"] > 0)
	{
		$membertype=new AdherentType($db);
		$result=$membertype->fetch($_REQUEST["type"]);
		$titre.=" (".$membertype->libelle.")";
	}

	$param="";
	if (isset($_GET["statut"]))       $param.="&statut=".$_GET["statut"];
	if (isset($_GET["search_nom"]))   $param.="&search_nom=".$_GET["search_nom"];
	if (isset($_GET["search_login"])) $param.="&search_login="******"search_login"];
	if (isset($_GET["search_email"])) $param.="&search_email=".$_GET["search_email"];
	if (isset($_GET["filter"]))       $param.="&filter=".$_GET["filter"];
	print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);

	if ($sall)
	{
		print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
	}
Ejemplo n.º 2
0
print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n";
// Type
if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
    $listoftype = $adht->liste_array();
    $tmp = array_keys($listoftype);
    $defaulttype = '';
    $isempty = 1;
    if (count($listoftype) == 1) {
        $defaulttype = $tmp[0];
        $isempty = 0;
    }
    print '<tr><td width="15%">' . $langs->trans("Type") . ' <FONT COLOR="red">*</FONT></td><td width="35%">';
    print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ? GETPOST('type') : $defaulttype, $isempty);
    print '</td></tr>' . "\n";
} else {
    $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
    //print $adht->libelle;
    print '<input type="hidden" id="type" name="type" value="' . $conf->global->MEMBER_NEWFORM_FORCETYPE . '">';
}
// Moral/Physic attribute
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) {
    print '<tr class="morphy"><td>' . $langs->trans('Nature') . ' <FONT COLOR="red">*</FONT></td><td>' . "\n";
    print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
    print '</td></tr>' . "\n";
} else {
    print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
    print '<input type="hidden" id="morphy" name="morphy" value="' . $conf->global->MEMBER_NEWFORM_FORCEMORPHY . '">';
}
// Civility
Ejemplo n.º 3
0
                         $titre = $langs->trans("MembersListNotUpToDate");
                     } else {
                         if ($status == '0') {
                             $titre = $langs->trans("MembersListResiliated");
                         }
                     }
                 }
             }
         }
     }
 } elseif ($action == 'search') {
     $titre = $langs->trans("MembersListQualified");
 }
 if ($type > 0) {
     $membertype = new AdherentType($db);
     $result = $membertype->fetch($type);
     $titre .= " (" . $membertype->libelle . ")";
 }
 $param = "&rowid=" . $rowid;
 if (!empty($status)) {
     $param .= "&status=" . $status;
 }
 if (!empty($search_lastname)) {
     $param .= "&search_lastname=" . $search_lastname;
 }
 if (!empty($search_firstname)) {
     $param .= "&search_firstname=" . $search_firstname;
 }
 if (!empty($search_login)) {
     $param .= "&search_login=" . $search_login;
 }
Ejemplo n.º 4
0
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
$id = GETPOST('id', 'int');
// Security check
$result = restrictedArea($user, 'adherent', $id);
$object = new Adherent($db);
$result = $object->fetch($id);
if ($result > 0) {
    $object->fetch_thirdparty();
    $adht = new AdherentType($db);
    $result = $adht->fetch($object->typeid);
}
/*
 *	Actions
 */
// None
/*
 *	View
 */
$contactstatic = new Contact($db);
$form = new Form($db);
/*
 * Fiche categorie de client et/ou fournisseur
 */
if ($object->id > 0) {
    require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
Ejemplo n.º 5
0
     }
     if ($statut == '1' && $filter == 'uptodate') {
         $titre = $langs->trans("MembersListUpToDate");
     }
     if ($statut == '1' && $filter == 'outofdate') {
         $titre = $langs->trans("MembersListNotUpToDate");
     }
     if ($statut == '0') {
         $titre = $langs->trans("MembersListResiliated");
     }
 } elseif ($action == 'search') {
     $titre = $langs->trans("MembersListQualified");
 }
 if ($type > 0) {
     $membertype = new AdherentType($db);
     $result = $membertype->fetch(GETPOST("type"));
     $titre .= " (" . $membertype->libelle . ")";
 }
 $param = "";
 if ($statut != "") {
     $param .= "&statut=" . $statut;
 }
 if ($search_nom) {
     $param .= "&search_nom=" . $search_nom;
 }
 if ($search_login) {
     $param .= "&search_login="******"&search_email=" . $search_email;
 }
Ejemplo n.º 6
0
         print '</td>';
         print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="' . (!GETPOST('chqemetteur') ? '' : GETPOST('chqemetteur')) . '"></td></tr>';
         print '<tr class="bankswitchclass2"><td>' . $langs->trans('Bank');
         print ' <em>(' . $langs->trans("ChequeBank") . ')</em>';
         print '</td>';
         print '<td><input id="chqbank" name="chqbank" size="32" type="text" value="' . (!GETPOST('chqbank') ? '' : GETPOST('chqbank')) . '"></td></tr>';
     }
 }
 print '<tr><td colspan="2">&nbsp;</td>';
 print '<tr><td width="30%">' . $langs->trans("SendAcknowledgementByMail") . '</td>';
 print '<td>';
 if (!$object->email) {
     print $langs->trans("NoEMail");
 } else {
     $adht = new AdherentType($db);
     $adht->fetch($object->typeid);
     $subjecttosend = $object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
     $texttosend = $object->makeSubstitution($adht->getMailOnSubscription());
     $tmp = '<input name="sendmail" type="checkbox"' . (GETPOST('sendmail') ? GETPOST('sendmail') : (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? ' checked' : '')) . '>';
     $helpcontent = '';
     $helpcontent .= '<b>' . $langs->trans("MailFrom") . '</b>: ' . $conf->global->ADHERENT_MAIL_FROM . '<br>' . "\n";
     $helpcontent .= '<b>' . $langs->trans("MailRecipient") . '</b>: ' . $object->email . '<br>' . "\n";
     $helpcontent .= '<b>' . $langs->trans("MailTopic") . '</b>:<br>' . "\n";
     $helpcontent .= $subjecttosend . "\n";
     $helpcontent .= "<br>";
     $helpcontent .= '<b>' . $langs->trans("MailText") . '</b>:<br>';
     $helpcontent .= dol_htmlentitiesbr($texttosend) . "\n";
     print $form->textwithpicto($tmp, $helpcontent, 1, 'help');
 }
 print '</td></tr>';
 print '</tbody>';
Ejemplo n.º 7
0
             print "</td>";
             print "</tr>\n";
             $i++;
         }
         print "</table>\n";
         if ($num > $conf->liste_limit) {
             print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
         }
     } else {
         dol_print_error($db);
     }
 }
 if ($action == 'edit') {
     $adht = new AdherentType($db);
     $adht->id = $rowid;
     $adht->fetch($rowid);
     $adht->fetch_optionals($rowid, $extralabels);
     $h = 0;
     $head[$h][0] = $_SERVER["PHP_SELF"] . '?rowid=' . $adht->id;
     $head[$h][1] = $langs->trans("Card");
     $head[$h][2] = 'card';
     $h++;
     dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
     print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?rowid=' . $rowid . '">';
     print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     print '<input type="hidden" name="rowid" value="' . $rowid . '">';
     print '<input type="hidden" name="action" value="update">';
     print '<table class="border" width="100%">';
     print '<tr><td width="15%">' . $langs->trans("Ref") . '</td><td>' . $adht->id . '</td></tr>';
     print '<tr><td>' . $langs->trans("Label") . '</td><td><input type="text" name="libelle" size="40" value="' . $adht->libelle . '"></td></tr>';
     print '<tr><td>' . $langs->trans("SubscriptionRequired") . '</td><td>';
$membert = new AdherentType($db);
$result = $object->fetch($id);
if ($result < 0) {
    dol_print_error($db);
    exit;
}
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
 * View
 */
llxHeader();
if ($id > 0) {
    $result = $membert->fetch($object->typeid);
    if ($result > 0) {
        /*
         * Affichage onglets
         */
        if (!empty($conf->notification->enabled)) {
            $langs->load("mails");
        }
        $head = member_prepare_head($object);
        $form = new Form($db);
        dol_fiche_head($head, 'document', $langs->trans("Member"), 0, 'user');
        // Construit liste des fichiers
        $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\\.meta|_preview\\.png)$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1);
        $totalsize = 0;
        foreach ($filearray as $key => $file) {
            $totalsize += $file['size'];
Ejemplo n.º 9
0
     dol_fiche_end();
     formCategory($db, $product, 0, $socid, $user->rights->produit->creer || $user->rights->service->creer);
 }
 if ($type == Categorie::TYPE_MEMBER) {
     $langs->load("members");
     /*
      *  Category card for member
      */
     require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php';
     require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
     require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
     // Produit
     $member = new Adherent($db);
     $result = $member->fetch($id, $ref);
     $membert = new AdherentType($db);
     $membert->fetch($member->typeid);
     llxHeader("", "", $langs->trans("Member"));
     $head = member_prepare_head($member);
     $titre = $langs->trans("Member");
     $picto = 'user';
     dol_fiche_head($head, 'category', $titre, 0, $picto);
     $rowspan = 5;
     if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
         $rowspan += 1;
     }
     if (!empty($conf->societe->enabled)) {
         $rowspan++;
     }
     print '<table class="border" width="100%">';
     // Ref
     print '<tr><td width="20%">' . $langs->trans("Ref") . '</td>';
Ejemplo n.º 10
0
         print '</td>';
         print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="' . (empty($_POST['chqemetteur']) ? $facture->client->nom : $_POST['chqemetteur']) . '"></td></tr>';
         print '<tr class="bankswitchclass2"><td>' . $langs->trans('Bank');
         print ' <em>(' . $langs->trans("ChequeBank") . ')</em>';
         print '</td>';
         print '<td><input id="chqbank" name="chqbank" size="32" type="text" value="' . (empty($_POST['chqbank']) ? '' : $_POST['chqbank']) . '"></td></tr>';
     }
 }
 print '<tr><td colspan="2">&nbsp;</td>';
 print '<tr><td width="30%">' . $langs->trans("SendAcknowledgementByMail") . '</td>';
 print '<td>';
 if (!$adh->email) {
     print $langs->trans("NoEMail");
 } else {
     $adht = new AdherentType($db);
     $adht->fetch($adh->typeid);
     $subjecttosend = $adh->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
     $texttosend = $adh->makeSubstitution($adht->getMailOnSubscription());
     $tmp = '<input name="sendmail" type="checkbox"' . ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL ? ' checked="true"' : '') . '>';
     $helpcontent = '';
     $helpcontent .= '<b>' . $langs->trans("MailFrom") . '</b>: ' . $conf->global->ADHERENT_MAIL_FROM . '<br>' . "\n";
     $helpcontent .= '<b>' . $langs->trans("MailRecipient") . '</b>: ' . $adh->email . '<br>' . "\n";
     $helpcontent .= '<b>' . $langs->trans("Subject") . '</b>:<br>' . "\n";
     $helpcontent .= $subjecttosend . "\n";
     $helpcontent .= "<br>";
     $helpcontent .= '<b>' . $langs->trans("Content") . '</b>:<br>';
     $helpcontent .= dol_htmlentitiesbr($texttosend) . "\n";
     print $html->textwithpicto($tmp, $helpcontent, 1, 'help');
 }
 print '</td></tr>';
 print '</table>';
Ejemplo n.º 11
0

/*
 * View
 */

$form = new Form($db);
$member=new Adherent($db);
$membert=new AdherentType($db);

llxHeader();

if ($id > 0)
{
    $result=$member->fetch($id);
    $result=$membert->fetch($member->typeid);
	if ($result > 0)
	{
		/*
		 * Affichage onglets
		 */
		if ($conf->notification->enabled) $langs->load("mails");
		$head = member_prepare_head($member);

		$html=new Form($db);

		dol_fiche_head($head, 'document', $langs->trans("Member"),0,'user');


		// Construit liste des fichiers
		$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
Ejemplo n.º 12
0
$action=isset($_GET["action"])?$_GET["action"]:(isset($_POST["action"])?$_POST["action"]:"");
$id=isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:"");

$langs->load("companies");
$langs->load("members");
$langs->load("bills");

if (!$user->rights->adherent->lire)
  accessforbidden();

$adh = new Adherent($db);
$result=$adh->fetch($id);
if ($result > 0)
{
    $adht = new AdherentType($db);
    $result=$adht->fetch($adh->typeid);
}


/******************************************************************************/
/*                     Actions                                                */
/******************************************************************************/

if ($_POST["action"] == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
{
	$db->begin();

	$res=$adh->update_note($_POST["note"],$user);
	if ($res < 0)
	{
		$mesg='<div class="error">'.$adh->error.'</div>';
Ejemplo n.º 13
0
 /**
  * testAdherentTypeDelete
  *
  * @param   Adherent    $localobject    Member instance
  * @return void
  *
  * @depends	testAdherentDelete
  * The depends says test is run only if previous is ok
  */
 public function testAdherentTypeDelete($localobject)
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     $localobjectat = new AdherentType($this->savdb);
     $result = $localobjectat->fetch($localobject->typeid);
     $result = $localobjectat->delete();
     print __METHOD__ . " result=" . $result . "\n";
     $this->assertLessThan($result, 0);
     return $localobject->id;
 }