本文整理汇总了PHP中Adherent::getFullName方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::getFullName方法的具体用法?PHP Adherent::getFullName怎么用?PHP Adherent::getFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::getFullName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadBox
/**
* Load data into info_box_contents array to show array later.
*
* @param int $max Maximum number of records to load
* @return void
*/
function loadBox($max = 5)
{
global $user, $langs, $db, $conf;
$langs->load("boxes");
$this->max = $max;
include_once DOL_DOCUMENT_ROOT . "/adherents/class/adherent.class.php";
$memberstatic = new Adherent($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers", $max));
if ($user->rights->societe->lire) {
$sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql .= " t.cotisation";
$sql .= " FROM " . MAIN_DB_PREFIX . "adherent as a, " . MAIN_DB_PREFIX . "adherent_type as t";
$sql .= " WHERE a.entity = " . $conf->entity;
$sql .= " AND a.fk_adherent_type = t.rowid";
$sql .= " ORDER BY a.tms DESC";
$sql .= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
$datec = $db->jdate($objp->datec);
$datem = $db->jdate($objp->tms);
$memberstatic->lastname = $objp->lastname;
$memberstatic->firstname = $objp->firstname;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT . "/adherents/fiche.php?rowid=" . $objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $memberstatic->getFullName($langs), 'url' => DOL_URL_ROOT . "/adherents/fiche.php?rowid=" . $objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => dol_print_date($datem, "day"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', 'text' => $memberstatic->LibStatut($objp->status, $objp->cotisation, $db->jdate($objp->date_end_subscription), 3));
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedCustomers"));
}
} else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql);
}
} else {
$this->info_box_contents[0][0] = array('align' => 'left', 'text' => $langs->trans("ReadPermissionNotAllowed"));
}
}
示例2: Cotisation
$result=$member->fetch('',GETPOST("ref"));
if ($result < 0)
{
$mesg=$member->error;
$error++;
}
else
{
$subscription=new Cotisation($db);
}
$amount=$subscription->total_ttc;
if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int');
$amount=price2num($amount);
$fulltag='MID='.$member->id.'.M='.strtr($member->getFullName($langs),"-"," ");
if (! empty($_REQUEST["tag"])) { $tag=$_REQUEST["tag"]; $fulltag.='.TAG='.$_REQUEST["tag"]; }
$fulltag=dol_string_unaccent($fulltag);
// Creditor
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '</td></tr>'."\n";
// Debitor
$var=!$var;
print '<tr><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Member");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$member->getFullName($langs).'</b>';
示例3: GETPOST
}
$fulltag = dol_string_unaccent($fulltag);
// Creditor
$var = !$var;
print '<tr class="CTableRow' . ($var ? '1' : '2') . '"><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Creditor");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '"><b>' . $creditor . '</b>';
print '<input type="hidden" name="creditor" value="' . $creditor . '">';
print '</td></tr>' . "\n";
// Debitor
$var = !$var;
print '<tr class="CTableRow' . ($var ? '1' : '2') . '"><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Member");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '"><b>';
if ($member->morphy == 'mor' && !empty($member->societe)) {
print $member->societe;
} else {
print $member->getFullName($langs);
}
print '</b>';
// Object
$var = !$var;
$text = '<b>' . $langs->trans("PaymentSubscription") . '</b>';
print '<tr class="CTableRow' . ($var ? '1' : '2') . '"><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Designation");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '">' . $text;
print '<input type="hidden" name="source" value="' . GETPOST("source", 'alpha') . '">';
print '<input type="hidden" name="ref" value="' . $member->ref . '">';
print '</td></tr>' . "\n";
if ($member->last_subscription_date || $member->last_subscription_amount) {
// Last subscription date
$var = !$var;
print '<tr class="CTableRow' . ($var ? '1' : '2') . '"><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("LastSubscriptionDate");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '">' . dol_print_date($member->last_subscription_date, 'day');
示例4: while
print '<input type="image" class="liste_titre" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/searchclear.png" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
print '</td>';
print "</tr>\n";
print '</form>';
$var = True;
while ($i < $num && $i < $conf->liste_limit) {
$objp = $db->fetch_object($resql);
$datefin = $db->jdate($objp->datefin);
$adh = new Adherent($db);
$adh->lastname = $objp->lastname;
$adh->firstname = $objp->firstname;
// Lastname
$var = !$var;
print '<tr ' . $bc[$var] . '>';
if ($objp->societe != '') {
print '<td><a href="card.php?rowid=' . $objp->rowid . '">' . img_object($langs->trans("ShowMember"), "user") . ' ' . $adh->getFullName($langs, 0, -1, 20) . ' / ' . dol_trunc($objp->societe, 12) . '</a></td>' . "\n";
} else {
print '<td><a href="card.php?rowid=' . $objp->rowid . '">' . img_object($langs->trans("ShowMember"), "user") . ' ' . $adh->getFullName($langs, 0, -1, 32) . '</a></td>' . "\n";
}
// Login
print "<td>" . $objp->login . "</td>\n";
// Type
/*print '<td class="nowrap">';
$membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type;
print $membertypestatic->getNomUrl(1,12);
print '</td>';
*/
// Moral/Physique
print "<td>" . $adh->getmorphylib($objp->morphy) . "</td>\n";
// EMail
示例5: GETPOST
if ($action == 'setsocid') {
$error = 0;
if (!$error) {
if (GETPOST('socid', 'int') != $object->fk_soc) {
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "adherent";
$sql .= " WHERE fk_soc = '" . GETPOST('socid', 'int') . "'";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj && $obj->rowid > 0) {
$othermember = new Adherent($db);
$othermember->fetch($obj->rowid);
$thirdparty = new Societe($db);
$thirdparty->fetch(GETPOST('socid', 'int'));
$error++;
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors');
}
}
if (!$error) {
$result = $object->setThirdPartyId(GETPOST('socid', 'int'));
if ($result < 0) {
dol_print_error('', $object->error);
}
$_POST['action'] = '';
$action = '';
}
}
}
}
if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && !$_POST["cancel"]) {
$error = 0;
示例6: print
$objp = $db->fetch_object($resql);
$datefin = $db->jdate($objp->datefin);
$memberstatic->id = $objp->rowid;
$memberstatic->ref = $objp->rowid;
$memberstatic->lastname = $objp->lastname;
$memberstatic->firstname = $objp->firstname;
$companyname = $objp->company;
$var = !$var;
print "<tr " . $bc[$var] . ">";
// Ref
print "<td>";
print $memberstatic->getNomUrl(1);
print "</td>\n";
// Lastname
print "<td><a href=\"card.php?rowid={$objp->rowid}\">";
print !empty($objp->lastname) || !empty($objp->firstname) ? dol_trunc($memberstatic->getFullName($langs)) : '';
print (!empty($objp->lastname) || !empty($objp->firstname)) && !empty($companyname) ? ' / ' : '';
print !empty($companyname) ? dol_trunc($companyname, 32) : '';
print "</a></td>\n";
// Login
print "<td>" . $objp->login . "</td>\n";
// Type
$membertypestatic->id = $objp->type_id;
$membertypestatic->libelle = $objp->type;
print '<td class="nowrap">';
print $membertypestatic->getNomUrl(1, 32);
print '</td>';
// Moral/Physique
print "<td>" . $memberstatic->getmorphylib($objp->morphy) . "</td>\n";
// EMail
print "<td>" . dol_print_email($objp->email, 0, 0, 1) . "</td>\n";
示例7: foreach
print '</tr>';
print '</thead>';
print '<tfoot>';
print '</tfoot>';
print '<tbody>';
$var = true;
$total = 0;
if (count($result->rows) > 0) {
foreach ($result->rows as $aRow) {
$objp = $aRow->value;
$total += $objp->amount;
$cotisation->ref = $objp->crowid;
$cotisation->id = $objp->crowid;
$adherent->Lastname = $objp->Lastname;
$adherent->Firstname = $objp->Firstname;
$adherent->ref = $adherent->getFullName($langs);
$adherent->id = $objp->_id;
$adherent->login = $objp->login;
print "<tr>";
print '<td>' . $objp->_id . '</td>';
// Login
print '<td>' . $objp->login . '</td>';
print '<td>' . $objp->Firstname . '</td>';
print '<td>' . $objp->Lastname . '</td>';
// Libelle
print '<td>';
print dol_trunc($objp->note, 32);
print '</td>';
// Banque
if ($conf->banque->enabled) {
if ($objp->fk_account) {
示例8: GETPOST
$fulltag = 'MEM=' . $member->id . '.DAT=' . dol_print_date(dol_now(), '%Y%m%d%H%M');
if (!empty($TAG)) {
$tag = $TAG;
$fulltag .= '.TAG=' . $TAG;
}
$fulltag = dol_string_unaccent($fulltag);
// Creditor
$var = !$var;
print '<tr><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Creditor");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '"><b>' . $creditor . '</b>';
print '<input type="hidden" name="creditor" value="' . $creditor . '">';
print '</td></tr>' . "\n";
// Debitor
$var = !$var;
print '<tr><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Member");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '"><b>' . $member->getFullName($langs) . '</b>';
// Object
$var = !$var;
$text = '<b>' . $langs->trans("PaymentSubscription") . '</b>';
print '<tr><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("Designation");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '">' . $text;
print '<input type="hidden" name="source" value="' . GETPOST("source", 'alpha') . '">';
print '<input type="hidden" name="ref" value="' . $member->ref . '">';
print '</td></tr>' . "\n";
if ($member->last_subscription_date || $member->last_subscription_amount) {
// Last subscription date
$var = !$var;
print '<tr><td class="CTableRow' . ($var ? '1' : '2') . '">' . $langs->trans("LastSubscriptionDate");
print '</td><td class="CTableRow' . ($var ? '1' : '2') . '">' . dol_print_date($member->last_subscription_date, 'day');
print '</td></tr>' . "\n";
// Last subscription amount
示例9: while
$ldap->connect_bind();
while ($i < $num) {
$ldap->error = "";
$obj = $db->fetch_object($resql);
$member = new Adherent($db);
$result = $member->fetch($obj->rowid);
if ($result < 0) {
dol_print_error($db, $member->error);
exit(-1);
}
$result = $member->fetch_subscriptions();
if ($result < 0) {
dol_print_error($db, $member->error);
exit(-1);
}
print $langs->transnoentities("UpdateMember") . " rowid=" . $member->id . " " . $member->getFullName($langs);
$oldobject = $member;
$oldinfo = $oldobject->_load_ldap_info();
$olddn = $oldobject->_load_ldap_dn($oldinfo);
$info = $member->_load_ldap_info();
$dn = $member->_load_ldap_dn($info);
$result = $ldap->add($dn, $info, $user);
// Wil fail if already exists
$result = $ldap->update($dn, $info, $user, $olddn);
if ($result > 0) {
print " - " . $langs->transnoentities("OK");
} else {
$error++;
print " - " . $langs->transnoentities("KO") . ' - ' . $ldap->error;
}
print "\n";
示例10: while
$var = True;
while ($i < $num) {
$var = !$var;
$obj = $db->fetch_object($resql);
print "<tr " . $bc[$var] . ">";
$staticmember->id = $obj->rowid;
$staticmember->lastname = $obj->lastname;
$staticmember->firstname = $obj->firstname;
if (!empty($obj->fk_soc)) {
$staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name = $staticmember->thirdparty->name;
} else {
$staticmember->name = $obj->company;
}
$staticmember->ref = $staticmember->getFullName($langs);
$statictype->id = $obj->typeid;
$statictype->libelle = $obj->libelle;
print '<td>' . $staticmember->getNomUrl(1, 32) . '</td>';
print '<td>' . $statictype->getNomUrl(1, 32) . '</td>';
print '<td>' . dol_print_date($db->jdate($obj->datem), 'dayhour') . '</td>';
print '<td align="right">' . $staticmember->LibStatut($obj->statut, $obj->cotisation == 'yes' ? 1 : 0, $db->jdate($obj->date_end_subscription), 5) . '</td>';
print '</tr>';
$i++;
}
}
print "</table><br>";
} else {
dol_print_error($db);
}
/*
示例11:
/**
* Create a third party into database from a member object
*
* @param Adherent $member Object member
* @param string $socname Name of third party to force
* @return int <0 if KO, id of created account if OK
*/
function create_from_member(Adherent $member,$socname='')
{
global $user,$langs;
$name = $socname?$socname:$member->societe;
if (empty($name)) $name=$member->getFullName($langs);
// Positionne parametres
$this->nom=$name; // TODO deprecated
$this->name=$name;
$this->address=$member->address;
$this->zip=$member->zip;
$this->town=$member->town;
$this->country_code=$member->country_code;
$this->country_id=$member->country_id;
$this->phone=$member->phone; // Prof phone
$this->email=$member->email;
$this->skype=$member->skype;
$this->client = 1; // A member is a customer by default
$this->code_client = -1;
$this->code_fournisseur = -1;
$this->db->begin();
// Cree et positionne $this->id
$result=$this->create($user);
if ($result >= 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql.= " SET fk_soc=".$this->id;
$sql.= " WHERE rowid=".$member->id;
dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$this->db->commit();
return $this->id;
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -1;
}
}
else
{
// $this->error deja positionne
dol_syslog(get_class($this)."::create_from_member - 2 - ".$this->error." - ".join(',',$this->errors), LOG_ERR);
$this->db->rollback();
return $result;
}
}
示例12: 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);
//.........这里部分代码省略.........
示例13: 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>';
}
}
}
}
示例14:
$member->morphy = 'phy';
$member->photo = '';
$member->public = 1;
$member->birth = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE]);
$member->statut = -1;
if (isset($ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS])) {
$member->datec = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
$member->datevalid = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
$member->statut = $ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS];
}
//if ($member->statut > 1) $member->statut=1;
//print_r($ldapuser);
// Propriete type membre
$member->typeid = $typeid;
// Creation membre
print $langs->transnoentities("MemberCreate") . ' # ' . $key . ': login=' . $member->login . ', fullname=' . $member->getFullName($langs);
print ', datec=' . $member->datec;
$member_id = $member->create($user);
if ($member_id > 0) {
print ' --> Created member id=' . $member_id . ' login=' . $member->login;
} else {
$error++;
print ' --> ' . $member->error;
}
print "\n";
//print_r($member);
$datefirst = '';
if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) {
$datefirst = dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]);
$pricefirst = price2num($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT]);
}
示例15: while
}
$sql .= " ORDER BY d.rowid ASC";
dol_syslog("Search members", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
if ($objp->country == '-') {
$objp->country = '';
}
$adherentstatic->lastname = $objp->lastname;
$adherentstatic->firstname = $objp->firstname;
// List of values to scan for a replacement
$substitutionarray = array('%ID%' => $objp->rowid, '%LOGIN%' => $objp->login, '%FIRSTNAME%' => $objp->firstname, '%LASTNAME%' => $objp->lastname, '%FULLNAME%' => $adherentstatic->getFullName($langs), '%COMPANY%' => $objp->company, '%ADDRESS%' => $objp->address, '%ZIP%' => $objp->zip, '%TOWN%' => $objp->town, '%COUNTRY%' => $objp->country, '%COUNTRY_CODE%' => $objp->country_code, '%EMAIL%' => $objp->email, '%BIRTH%' => dol_print_date($objp->birth, 'day'), '%TYPE%' => $objp->type, '%YEAR%' => $year, '%MONTH%' => $month, '%DAY%' => $day, '%DOL_MAIN_URL_ROOT%' => DOL_MAIN_URL_ROOT, '%SERVER%' => "http://" . $_SERVER["SERVER_NAME"] . "/");
complete_substitutions_array($substitutionarray, $langs);
// For business cards
if (empty($mode) || $mode == 'card' || $mode == 'cardlogin') {
$textleft = make_substitutions($conf->global->ADHERENT_CARD_TEXT, $substitutionarray);
$textheader = make_substitutions($conf->global->ADHERENT_CARD_HEADER_TEXT, $substitutionarray);
$textfooter = make_substitutions($conf->global->ADHERENT_CARD_FOOTER_TEXT, $substitutionarray);
$textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
if (is_numeric($foruserid) || $foruserlogin) {
for ($j = 0; $j < 100; $j++) {
$arrayofmembers[] = array('textleft' => $textleft, 'textheader' => $textheader, 'textfooter' => $textfooter, 'textright' => $textright, 'id' => $objp->rowid, 'photo' => $objp->photo);
}
} else {
$arrayofmembers[] = array('textleft' => $textleft, 'textheader' => $textheader, 'textfooter' => $textfooter, 'textright' => $textright, 'id' => $objp->rowid, 'photo' => $objp->photo);
}
}