当前位置: 首页>>代码示例>>PHP>>正文


PHP Adherent::fetch方法代码示例

本文整理汇总了PHP中Adherent::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::fetch方法的具体用法?PHP Adherent::fetch怎么用?PHP Adherent::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Adherent的用法示例。


在下文中一共展示了Adherent::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getObject

 /**
  *  Get object
  *
  *  @param	int		$id		Object id
  *  @return	object			Object loaded
  */
 function getObject($id)
 {
     $ret = $this->getInstanceDao();
     if (is_object($this->object) && method_exists($this->object, 'fetch')) {
         if (!empty($id)) {
             $this->object->fetch($id);
         }
     } else {
         $object = new Adherent($this->db);
         if (!empty($id)) {
             $object->fetch($id);
         }
         $this->object = $object;
     }
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:21,代码来源:actions_adherentcard_common.class.php

示例2: testAdherentDelete

    /**
     * @depends	testAdherentOther
     * The depends says test is run only if previous is ok
     */
    public function testAdherentDelete($id)
    {
    	global $conf,$user,$langs,$db;
		$conf=$this->savconf;
		$user=$this->savuser;
		$langs=$this->savlangs;
		$db=$this->savdb;

		$localobject=new Adherent($this->savdb);
    	$result=$localobject->fetch($id);
		$result=$localobject->delete($id);
		print __METHOD__." id=".$id." result=".$result."\n";
		$this->assertLessThan($result, 0);

		return $result;
    }
开发者ID:remyyounes,项目名称:dolibarr,代码行数:20,代码来源:AdherentTest.php

示例3: Societe

     $elementtype = 'product';
 } else {
     if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) {
         $tmpobject = new Societe($db);
         $result = $tmpobject->fetch($removeelem);
         $elementtype = 'fournisseur';
     } else {
         if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) {
             $tmpobject = new Societe($db);
             $result = $tmpobject->fetch($removeelem);
             $elementtype = 'societe';
         } else {
             if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer) {
                 require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
                 $tmpobject = new Adherent($db);
                 $result = $tmpobject->fetch($removeelem);
                 $elementtype = 'member';
             } else {
                 if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
                     require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
                     $tmpobject = new Contact($db);
                     $result = $tmpobject->fetch($removeelem);
                     $elementtype = 'contact';
                 }
             }
         }
     }
 }
 $result = $object->del_type($tmpobject, $elementtype);
 if ($result < 0) {
     dol_print_error('', $object->error);
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:viewcat.php

示例4: Adherent

         $objal = $db->fetch_object($resql);
         print $objal->nb ? $objal->nb : $langs->trans("NoOtherDeliveryAddress");
     } else {
         dol_print_error($db);
     }
     print '</td>';
     print '</tr>';
 }
 // Module Adherent
 if ($conf->adherent->enabled) {
     $langs->load("members");
     $langs->load("users");
     print '<tr><td width="25%" valign="top">' . $langs->trans("LinkedToDolibarrMember") . '</td>';
     print '<td colspan="3">';
     $adh = new Adherent($db);
     $result = $adh->fetch('', '', $objsoc->id);
     if ($result > 0) {
         $adh->ref = $adh->getFullName($langs);
         print $adh->getNomUrl(1);
     } else {
         print $langs->trans("UserNotLinkedToMember");
     }
     print '</td>';
     print "</tr>\n";
 }
 print "</table>";
 print "</td>\n";
 print '<td valign="top" width="50%" class="notopnoleftnoright">';
 // Nbre max d'elements des petites listes
 $MAXLIST = 4;
 $tableaushown = 1;
开发者ID:netors,项目名称:dolibarr,代码行数:31,代码来源:fiche.php

示例5: foreach


//.........这里部分代码省略.........
                    $this->tpl['localtax'] .= '</td><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td>';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td></tr>';
                } elseif ($mysoc->localtax1_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><tr>';
                } elseif ($mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">';
                    $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1);
                    $this->tpl['localtax'] .= '</td><tr>';
                }
            }
        } else {
            $head = societe_prepare_head($this->object);
            $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company');
            $this->tpl['showend'] = dol_get_fiche_end();
            $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom');
            $this->tpl['checkcustomercode'] = $this->object->check_codeclient();
            $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur();
            $this->tpl['address'] = dol_nl2br($this->object->address);
            $img = picto_from_langcode($this->object->country_code);
            if ($this->object->isInEEC()) {
                $this->tpl['country'] = $form->textwithpicto(($img ? $img . ' ' : '') . $this->object->country, $langs->trans("CountryIsInEEC"), 1, 0);
            }
            $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country;
            $this->tpl['phone'] = dol_print_phone($this->object->phone, $this->object->country_code, 0, $this->object->id, 'AC_TEL');
            $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX');
            $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL');
            $this->tpl['url'] = dol_print_url($this->object->url);
            $this->tpl['tva_assuj'] = yn($this->object->tva_assuj);
            // Third party type
            $arr = $formcompany->typent_array(1);
            $this->tpl['typent'] = $arr[$this->object->typent_code];
            if (!empty($conf->global->MAIN_MULTILANGS)) {
                require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
                //$s=picto_from_langcode($this->default_lang);
                //print ($s?$s.' ':'');
                $langs->load("languages");
                $this->tpl['default_lang'] = $this->default_lang ? $langs->trans('Language_' . $this->object->default_lang) : '';
            }
            $this->tpl['image_edit'] = img_edit();
            $this->tpl['display_rib'] = $this->object->display_rib();
            // Sales representatives
            $this->tpl['sales_representatives'] = '';
            $listsalesrepresentatives = $this->object->getSalesRepresentatives($user);
            $nbofsalesrepresentative = count($listsalesrepresentatives);
            if ($nbofsalesrepresentative > 3) {
                $this->tpl['sales_representatives'] .= '<a href="' . DOL_URL_ROOT . '/societe/commerciaux.php?socid=' . $this->object->id . '">';
                $this->tpl['sales_representatives'] .= $nbofsalesrepresentative;
                $this->tpl['sales_representatives'] .= '</a>';
            } else {
                if ($nbofsalesrepresentative > 0) {
                    $userstatic = new User($this->db);
                    $i = 0;
                    foreach ($listsalesrepresentatives as $val) {
                        $userstatic->id = $val['id'];
                        $userstatic->lastname = $val['name'];
                        $userstatic->firstname = $val['firstname'];
                        $this->tpl['sales_representatives'] .= $userstatic->getNomUrl(1);
                        $i++;
                        if ($i < $nbofsalesrepresentative) {
                            $this->tpl['sales_representatives'] .= ', ';
                        }
                    }
                } else {
                    $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected");
                }
            }
            // Linked member
            if (!empty($conf->adherent->enabled)) {
                $langs->load("members");
                $adh = new Adherent($this->db);
                $result = $adh->fetch('', '', $this->object->id);
                if ($result > 0) {
                    $adh->ref = $adh->getFullName($langs);
                    $this->tpl['linked_member'] = $adh->getNomUrl(1);
                } else {
                    $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember");
                }
            }
            // Local Tax
            // TODO mettre dans une classe propre au pays
            if ($mysoc->country_code == 'ES') {
                $this->tpl['localtax'] = '';
                if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax1_assuj) . '</td>';
                    $this->tpl['localtax'] .= '<td>' . $langs->trans("LocalTax2IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax2_assuj) . '</td></tr>';
                } elseif ($mysoc->localtax1_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax1_assuj) . '</td></tr>';
                } elseif ($mysoc->localtax2_assuj == "1") {
                    $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td>';
                    $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax2_assuj) . '</td></tr>';
                }
            }
        }
    }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:101,代码来源:actions_card_common.class.php

示例6: GETPOST

 *  \file       htdocs/adherents/agenda.php
 *  \ingroup    member
 *  \brief      Page of members events
 */
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);
/*
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:agenda.php

示例7: Adherent

                }
                print ' ('.$langs->trans("UseTypeFieldToChange").')';
                print '</td>';
                print "</tr>\n";
            }

            // Module Adherent
            if (! empty($conf->adherent->enabled))
            {
                $langs->load("members");
                print '<tr><td width="25%">'.$langs->trans("LinkedToDolibarrMember").'</td>';
                print '<td>';
                if ($object->fk_member)
                {
                    $adh=new Adherent($db);
                    $adh->fetch($object->fk_member);
                    $adh->ref=$adh->login;	// Force to show login instead of id
                    print $adh->getNomUrl(1);
                }
                else
                {
                    print $langs->trans("UserNotLinkedToMember");
                }
                print '</td>';
                print "</tr>\n";
            }

            // Multicompany
            // TODO check if user not linked with the current entity before change entity (thirdparty, invoice, etc.) !!
            if (! empty($conf->multicompany->enabled) && is_object($mc))
            {
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:card.php

示例8: Form

    }
}
/*
 * View
 */
llxHeader('', $langs->trans("SubscriptionCard"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
$form = new Form($db);
dol_htmloutput_errors($errmsg);
if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
    /********************************************
     *
     * Fiche en mode edition
     *
     ********************************************/
    $subscription->fetch($rowid);
    $result = $adh->fetch($subscription->fk_adherent);
    /*
     * Affichage onglets
     */
    $h = 0;
    $head = array();
    $head[$h][0] = DOL_URL_ROOT . '/adherents/fiche_subscription.php?rowid=' . $subscription->id;
    $head[$h][1] = $langs->trans("SubscriptionCard");
    $head[$h][2] = 'general';
    $h++;
    $head[$h][0] = DOL_URL_ROOT . '/adherents/info_subscription.php?rowid=' . $subscription->id;
    $head[$h][1] = $langs->trans("Info");
    $head[$h][2] = 'info';
    $h++;
    print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:fiche_subscription.php

示例9: formCategory

     print '</td></tr>';
     print '</table>';
     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%">';
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:categorie.php

示例10: GETPOST

require_once DOL_DOCUMENT_ROOT . '/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
$langs->load("ldap");
$langs->load("admin");
$rowid = GETPOST('id', 'int');
$action = GETPOST('action');
// Protection
$socid = 0;
if ($user->societe_id > 0) {
    $socid = $user->societe_id;
}
$object = new Adherent($db);
$result = $object->fetch($rowid);
if (!$result) {
    dol_print_error($db, "Failed to get adherent: " . $object->error);
    exit;
}
/*
 * Actions
 */
if ($action == 'dolibarr2ldap') {
    $db->begin();
    $ldap = new Ldap();
    $result = $ldap->connect_bind();
    $info = $object->_load_ldap_info();
    $dn = $object->_load_ldap_dn($info);
    $olddn = $dn;
    // We can say that old dn = dn as we force synchro
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:ldap.php

示例11: Loyer

 /**
  * \brief Fonction generant le document sur le disque
  * \param agf		Objet document a generer (ou id si ancienne methode)
  * outputlangs	Lang object for output language
  * file		Name of file to generate
  * \return int 1=ok, 0=ko
  */
 function write_file($loyer, $outputlangs, $file, $socid, $courrier)
 {
     global $user, $langs, $conf, $mysoc;
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     if (!is_object($outputlangs)) {
         $outputlangs = $langs;
     }
     if (!is_object($loyer)) {
         $id = $loyer;
         $loyer = new Loyer($this->db);
         $ret = $loyer->fetch($id);
     }
     // dol_syslog ( "pdf_quittance::debug loyer=" . var_export ( $loyer, true ) );
     // Definition of $dir and $file
     $dir = $conf->immobilier->dir_output;
     $file = $dir . '/' . $file;
     if (!file_exists($dir)) {
         if (create_exdir($dir) < 0) {
             $this->error = $langs->trans("ErrorCanNotCreateDir", $dir);
             return 0;
         }
     }
     if (file_exists($dir)) {
         $pdf = pdf_getInstance($this->format, $this->unit, $this->orientation);
         if (class_exists('TCPDF')) {
             $pdf->setPrintHeader(false);
             $pdf->setPrintFooter(false);
         }
         $pdf->Open();
         $pagenb = 0;
         $pdf->SetTitle($outputlangs->convToOutputCharset($loyer->nom));
         $pdf->SetSubject($outputlangs->transnoentities("Quitance"));
         $pdf->SetCreator("Dolibarr " . DOL_VERSION . ' (Immobilier module)');
         $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
         $pdf->SetKeyWords($outputlangs->convToOutputCharset($loyer->nom) . " " . $outputlangs->transnoentities("Document"));
         if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) {
             $pdf->SetCompression(false);
         }
         $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
         // Left, Top, Right
         $pdf->SetAutoPageBreak(1, 0);
         // On recupere les infos societe
         $locataire = new Locataire($this->db);
         $result = $locataire->fetch($loyer->locataire_id);
         $proprio = new Adherent($this->db);
         $result = $proprio->fetch($loyer->proprietaire_id);
         $local = new Local($this->db);
         $result = $local->fetch($loyer->local_id);
         $paiement = new Paie($this->db);
         $result = $paiement->fetch_by_loyer($loyer->id);
         if (!empty($loyer->id)) {
             // New page
             $pdf->AddPage();
             $pagenb++;
             $this->_pagehead($pdf, $agf, 1, $outputlangs);
             $pdf->SetFont(pdf_getPDFFont($outputlangs), '', 9);
             $pdf->MultiCell(0, 3, '', 0, 'J');
             $pdf->SetTextColor(0, 0, 0);
             $posY = $this->marge_haute;
             $posX = $this->marge_gauche;
             // Bloc Owner
             $pdf->SetFont(pdf_getPDFFont($outputlangs), '', 15);
             $pdf->SetXY($posX, $posY + 3);
             $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset('Bailleur'), 1, 'C');
             $posY = $pdf->getY();
             $pdf->SetXY($posX, $posY);
             $pdf->SetFont(pdf_getPDFFont($outputlangs), '', 13);
             $this->str = $proprio->getFullName($outputlangs) . "\n";
             $this->str .= $proprio->address . "\n";
             $this->str .= $proprio->zip . ' ' . $proprio->town;
             $this->str .= ' - ' . $proprio->country . "\n\n";
             if ($proprio->phone) {
                 $this->str .= $outputlangs->transnoentities('Téléphone') . ' ' . $proprio->phone . "\n";
             }
             if ($proprio->fax) {
                 $this->str .= $outputlangs->transnoentities('Fax') . ' ' . $proprio->fax . "\n";
             }
             if ($proprio->email) {
                 $this->str .= $outputlangs->transnoentities('EMail') . ' ' . $proprio->email . "\n";
             }
             if ($proprio->url) {
                 $this->str .= $outputlangs->transnoentities('Url') . ' ' . $proprio->url . "\n";
             }
             $pdf->MultiCell(100, 20, $outputlangs->convToOutputCharset($this->str), 1, 'L');
             // Bloc Locataire
             $posX = $this->page_largeur - $this->marge_droite - 100;
             $posY = $pdf->getY() + 10;
             $pdf->SetFont(pdf_getPDFFont($outputlangs), '', 15);
             $pdf->SetXY($posX, $posY);
             $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset('Locataire Destinataire'), 1, 'C');
             $posY = $pdf->getY();
             $pdf->SetXY($posX, $posY);
             $pdf->SetFont(pdf_getPDFFont($outputlangs), '', 13);
//.........这里部分代码省略.........
开发者ID:abbenbouchta,项目名称:immobilier,代码行数:101,代码来源:pdf_quittance.modules.php

示例12: Form

}


/*
 * 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
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:document.php

示例13: accessforbidden

require_once(DOL_DOCUMENT_ROOT.'/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");

$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();
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:note.php

示例14: _create_and_send

function _create_and_send($PDOdb, $db, $user, $conf, $langs)
{
    unset($_SESSION['SENDTOINVOICETOADHERENT_TERROR']);
    unset($_SESSION['SENDTOINVOICETOADHERENT_TERRORFAC']);
    unset($_SESSION['SENDTOINVOICETOADHERENT_TERRORMAIL']);
    $error = 0;
    $nb_mail_sent = 0;
    if (!$user->rights->sendinvoicetoadherent->create) {
        $error++;
        setEventMessages($langs->trans('sendinvoicetoadherentErrorCreateNotPermitted'), false, 'errors');
        header('Location: ' . dol_buildpath('/sendinvoicetoadherent/sendinvoicetoadherent.php?action=list', 2));
        exit;
    }
    dol_include_once('/compta/facture/class/facture-rec.class.php');
    dol_include_once('/compta/facture/class/adherent.class.php');
    dol_include_once('/adherents/class/adherent.class.php');
    dol_include_once('/societe/class/societe.class.php');
    dol_include_once('/core/class/CMailFile.class.php');
    dol_include_once('/core/lib/files.lib.php');
    $date_fac = GETPOST('date_fac', 'alpha');
    $create_cotisation = GETPOST('create_cotisation', 'int');
    $date_start = GETPOST('date_start', 'alpha');
    $date_end = GETPOST('date_end', 'alpha');
    $amount = price2num(GETPOST('amount_cotisation', 'alpha'), 2);
    $label = GETPOST('label', 'alpha');
    $TDate_fac = explode('/', $date_fac);
    if (!checkdate($TDate_fac[1], $TDate_fac[0], $TDate_fac[2])) {
        $error++;
        setEventMessages($langs->trans('sendinvoicetoadherentErrorDateFac'), false, 'errors');
    }
    if ($create_cotisation) {
        $TDate_start = explode('/', $date_start);
        $TDate_end = explode('/', $date_end);
        if (!checkdate($TDate_start[1], $TDate_start[0], $TDate_start[2]) || !checkdate($TDate_end[1], $TDate_end[0], $TDate_end[2])) {
            $error++;
            setEventMessages($langs->trans('sendinvoicetoadherentErrorDate'), false, 'errors');
        }
    }
    $fk_facture_rec = (int) $conf->global->SENDINVOICETOADHERENT_FK_FACTURE;
    if (!$fk_facture_rec) {
        $error++;
        setEventMessages($langs->trans('sendinvoicetoadherent_fk_facture'), false, 'errors');
    }
    if (!$error) {
        $sql = _getSql();
        if ($PDOdb->Execute($sql)) {
            $TError = $TErrorFac = $TErrorMail = array();
            while ($row = $PDOdb->Get_line()) {
                $ad = new Adherent($db);
                $ad->fetch($row->rowid);
                if (!$ad->fk_soc && $ad->societe) {
                    $societe = _createTiers($db, $user, $ad);
                } else {
                    $ad->fetch_thirdparty();
                    $societe = $ad->thirdparty;
                }
                if ($societe && $societe->id > 0) {
                    if ($create_cotisation) {
                        if ($ad->cotisation(dol_mktime(0, 0, 0, $TDate_start[1], $TDate_start[0], $TDate_start[2]), $amount, 0, '', $label, '', '', '', dol_mktime(0, 0, 0, $TDate_end[1], $TDate_end[0], $TDate_end[2])) <= 0) {
                            $error++;
                            setEventMessages($object->error, $object->errors, 'errors');
                        }
                    }
                    $factureRec = new FactureRec($db);
                    $factureRec->fetch($fk_facture_rec);
                    $facture = new Facture($db);
                    $facture->brouillon = 1;
                    $facture->socid = $societe->id;
                    $facture->type = Facture::TYPE_STANDARD;
                    $facture->fk_project = $factureRec->fk_project;
                    $facture->cond_reglement_id = $factureRec->cond_reglement_id;
                    $facture->mode_reglement_id = $factureRec->mode_reglement_id;
                    $facture->remise_absolue = $factureRec->remise_absolue;
                    $facture->remise_percent = $factureRec->remise_percent;
                    $facture->date = dol_mktime(12, 0, 0, $TDate_fac[1], $TDate_fac[0], $TDate_fac[2]);
                    $facture->note_private = $factureRec->note_private;
                    $facture->note_public = $factureRec->note_public;
                    $facture->lines = $factureRec->lines;
                    if ($facture->create($user) > 0) {
                        $facture->validate($user);
                        if (!_sendByMail($db, $conf, $user, $langs, $facture, $societe, $label)) {
                            $TErrorMail[] = $societe->id;
                        }
                    } else {
                        $TErrorFac[] = $societe->id;
                    }
                } else {
                    $TError[] = $ad->id;
                }
            }
            if (count($TError) > 0) {
                setEventMessages($langs->trans('sendinvoicetoadherentErrorCreateTiers', count($TError)), null, 'errors');
            }
            if (count($TErrorFac) > 0) {
                setEventMessages($langs->trans('sendinvoicetoadherentErrorCreateFacture', count($TErrorFac)), null, 'errors');
            }
            if (count($TErrorMail) > 0) {
                setEventMessages($langs->trans('sendinvoicetoadherentErrorMailSend', count($TErrorMail)), null, 'errors');
            } else {
                setEventMessages($langs->trans('sendinvoicetoadherentConfirmCreate', $PDOdb->Get_Recordcount()), null);
//.........这里部分代码省略.........
开发者ID:ATM-Consulting,项目名称:dolibarr_module_sendinvoicetoadherent,代码行数:101,代码来源:sendinvoicetoadherent.php

示例15: GETPOST

require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
$langs->load("ldap");
$langs->load("admin");
$rowid = GETPOST('id', 'int');
$action = GETPOST('action');
// Protection
$socid = 0;
if ($user->societe_id > 0) {
    $socid = $user->societe_id;
}
$adh = new Adherent($db);
$adh->id = $rowid;
$result = $adh->fetch($rowid);
if (!$result) {
    dol_print_error($db, "Failed to get adherent: " . $adh->error);
    exit;
}
/*
 * Actions
 */
if ($action == 'dolibarr2ldap') {
    $db->begin();
    $ldap = new Ldap();
    $result = $ldap->connect_bind();
    $info = $adh->_load_ldap_info();
    $dn = $adh->_load_ldap_dn($info);
    $olddn = $dn;
    // We can say that old dn = dn as we force synchro
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:ldap.php


注:本文中的Adherent::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。