本文整理汇总了PHP中Adherent类的典型用法代码示例。如果您正苦于以下问题:PHP Adherent类的具体用法?PHP Adherent怎么用?PHP Adherent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Adherent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Adherent $data)
{
if ($data->isValid()) {
$this->add($data);
} else {
throw new RunTimeException('an adherent must be valid to be registerd, please check data and pull request again.');
}
}
开发者ID:sdmg15,项目名称:cmpj,代码行数:8,代码来源:AdherentManagerPDO.php
示例2: 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
示例3: 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"));
}
}
开发者ID:nrjacker4,项目名称:crm-php,代码行数:48,代码来源:box_members.php
示例4: include
else {
print $langs->trans("NoParentCompany");
}
print '</td></tr>';
}
// Sales representative
include(DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php');
// Module Adherent
if ($conf->adherent->enabled)
{
$langs->load("members");
print '<tr><td width="25%" valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td colspan="3">';
$adh=new Adherent($db);
$result=$adh->fetch('','',$object->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>';
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:soc.php
示例5: AccountLine
}
}
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) {
$accline = new AccountLine($db);
$result = $accline->fetch(GETPOST("rowid"));
$result = $accline->delete();
}
/*
* View
*/
llxHeader('', $langs->trans("FinancialAccount") . '-' . $langs->trans("Transactions"));
$societestatic = new Societe($db);
$userstatic = new User($db);
$chargestatic = new ChargeSociales($db);
$loanstatic = new Loan($db);
$memberstatic = new Adherent($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
$paymentvatstatic = new TVA($db);
$paymentsalstatic = new PaymentSalary($db);
$donstatic = new Don($db);
$expensereportstatic = new ExpenseReport($db);
$bankstatic = new Account($db);
$banklinestatic = new AccountLine($db);
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
if ($vline) {
$viewline = $vline;
} else {
$viewline = empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? 20 : $conf->global->MAIN_SIZE_LISTE_LIMIT;
}
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:31,代码来源:account.php
示例6: GETPOST
$mode = GETPOST('mode') ? GETPOST('mode') : '';
// Security check
if ($user->societe_id > 0) {
$action = '';
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
$year = strftime("%Y", time());
$startyear = $year - 2;
$endyear = $year;
$langs->load("members");
$langs->load("companies");
/*
* View
*/
$memberstatic = new Adherent($db);
llxHeader('', '', '', '', 0, 0, array('http://www.google.com/jsapi'));
$title = $langs->trans("MembersStatisticsByProperties");
print load_fiche_titre($title, $mesg);
dol_mkdir($dir);
$tab = 'byproperties';
$data = array();
$sql .= "SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, d.morphy as code";
$sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d";
$sql .= " WHERE d.entity IN (" . getEntity() . ")";
$sql .= " AND d.statut = 1";
$sql .= " GROUP BY d.morphy";
$foundphy = $foundmor = 0;
// Define $data array
dol_syslog("Count member", LOG_DEBUG);
$resql = $db->query($sql);
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:byproperties.php
示例7: dol_now
$langs->load("members");
$langs->load("errors");
// Choix de l'annee d'impression ou annee courante.
$now = dol_now();
$year = dol_print_date($now, '%Y');
$month = dol_print_date($now, '%m');
$day = dol_print_date($now, '%d');
$foruserid = GETPOST('foruserid');
$foruserlogin = GETPOST('foruserlogin');
$mode = GETPOST('mode');
$model = GETPOST("model");
// Doc template to use for business cards
$modellabel = GETPOST("modellabel");
// Doc template to use for address sheet
$mesg = '';
$adherentstatic = new Adherent($db);
/*
* Actions
*/
if ($mode == 'cardlogin' && empty($foruserlogin)) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login"));
}
if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
$arrayofmembers = array();
// requete en prenant que les adherents a jour de cotisation
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,";
$sql .= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
$sql .= " t.libelle as type,";
$sql .= " c.code as country_code, c.label as country";
$sql .= " FROM " . MAIN_DB_PREFIX . "adherent_type as t, " . MAIN_DB_PREFIX . "adherent as d";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON d.country = c.rowid";
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:carte.php
示例8: Adherent
print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print ' ';
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);
// Nom
$var=!$var;
print "<tr $bc[$var]>";
if ($objp->societe != '')
{
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom." ".dol_trunc($objp->nom,12)." / ".dol_trunc($objp->societe,12)."</a></td>\n";
}
else
{
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom." ".dol_trunc($objp->nom)."</a></td>\n";
}
// Login
print "<td>".$objp->login."</td>\n";
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:liste.php
示例9: 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
示例10: show_ldap_test_button
print '</form>';
/*
* Test de la connexion
*/
if (!empty($conf->global->LDAP_MEMBER_ACTIVE)) {
$butlabel = $langs->trans("LDAPTestSynchroMember");
$testlabel = 'testmember';
$key = $conf->global->LDAP_KEY_MEMBERS;
$dn = $conf->global->LDAP_MEMBER_DN;
$objectclass = $conf->global->LDAP_MEMBER_OBJECT_CLASS;
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
}
if (function_exists("ldap_connect")) {
if ($_GET["action"] == 'testmember') {
// Creation objet
$object = new Adherent($db);
$object->initAsSpecimen();
// Test synchro
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result > 0) {
$info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info);
$result1 = $ldap->delete($dn);
// To be sure to delete existing records
$result2 = $ldap->add($dn, $info, $user);
// Now the test
$result3 = $ldap->delete($dn);
// Clean what we did
if ($result2 > 0) {
print img_picto('', 'info') . ' ';
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:ldap_members.php
示例11: HTTPRequest
include_once "C:\\wamp\\www\\CMPJ\\Controleurs\\HTTPRequest.php";
include_once "C:\\wamp\\www\\CMPJ\\Controleurs\\HTTPResponse.php";
include_once "C:\\wamp\\www\\CMPJ\\Model\\AdherentManagerPDO.php";
include_once "C:\\wamp\\www\\CMPJ\\Model\\PDOFactory.php";
$request = new HTTPRequest();
$manager = new AdherentManagerPDO(PDOFactory::getPdoInstance());
if (isset($_GET['modifier'])) {
if (!$manager->Exists((int) $_GET['modifier'])) {
$message = 'NOT FOUND.';
} else {
$adherent = $manager->getUnique((int) $_GET['modifier']);
}
}
if ($request->postExists('nom')) {
//on hydrate les données
$adherent = new Adherent(['nom' => $request->postData('nom'), 'prenom' => $request->postData('prenom'), 'dateNaissance' => $request->postData('date'), 'lieu' => $request->postData('lieuNaissance'), 'sexe' => $request->postData('sexe'), 'region' => $request->postData('region'), 'departement' => $request->postData('departement'), 'ethnie' => $request->postData('ethnie'), 'nationalite' => $request->postData('nationalite'), 'profession_mere_parrain' => $request->postData('profession'), 'situationMatrimoniale' => $request->postData('situation'), 'lieuResidence' => $request->postData('lieuResidence'), 'adresse' => $request->postData('addr'), 'telPerso' => $request->postData('telPerso'), 'sosTel' => $request->postData('sosTel'), 'sosName' => $request->postData('sosName'), 'diplomeEleve' => $request->postData('diplome'), 'dateObtentionPlace' => $request->postData('dateObtention'), 'speakLanguage' => $request->postData('speakLanguage'), 'filiere' => $request->postData('option')]);
$adherent->setId((int) $_GET['modifier']);
if ($adherent->isvalid()) {
$manager->update($adherent);
$message = 'Informations bien modifiées ';
} else {
$erreurs = $adherent->getErreurs();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Formulaire d'inscription CMPJ MAYO-LOUTI</title>
<meta charset="utf-8" content="text/html">
<link rel="stylesheet" href="css/Envision.css" >
开发者ID:sdmg15,项目名称:cmpj,代码行数:31,代码来源:modifier.php
示例12: Adherent
print $langs->trans("ThisUserIsNot");
}
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
示例13: Ldap
print $langs->trans("LDAPSynchronizationNotSetupInDolibarr");
exit(-1);
}
*/
$sql = "SELECT rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "adherent";
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$ldap = new Ldap();
$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();
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:sync_members_dolibarr2ldap.php
示例14: GETPOST
require_once DOL_DOCUMENT_ROOT . '/core/lib/ldap.lib.php';
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;
}
$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);
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:ldap.php
示例15: GETPOST
$_POST['action'] = '';
$action = '';
}
}
}
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 = '';
}
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:card_subscriptions.php
示例16: dol_escape_htmltag
print '<td class="liste_titre"> </td>';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_email" value="' . dol_escape_htmltag($search_email) . '" size="12"></td>';
print '<td class="liste_titre"> </td>';
print '<td align="right" colspan="2" class="liste_titre">';
print '<input type="image" class="liste_titre" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
print ' ';
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;
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:type.php
示例17: GETPOST
/**
* \file htdocs/adherents/cotisations.php
* \ingroup member
* \brief Page de consultation et insertion d'une cotisation
*/
require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT . "/adherent/class/adherent.class.php";
require_once DOL_DOCUMENT_ROOT . "/compta/bank/class/account.class.php";
$langs->load("members");
$msg = '';
$date_select = GETPOST("date_select");
if (!$user->rights->adherent->cotisation->lire) {
accessforbidden();
}
// Static objects
$adherent = new Adherent($db);
$accountstatic = new Account($db);
/*
* Actions
*/
/*
* View
*/
llxHeader('', $langs->trans("ListOfSubscriptions"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
if ($msg) {
print $msg . '<br>';
}
if (!empty($date_select)) {
$result = $adherent->getView('cotisationYear', array("key" => (int) $date_select));
} else {
$result = $adherent->getView('cotisationYear');
开发者ID:nrjacker4,项目名称:crm-php,代码行数:31,代码来源:cotisations.php
示例18: Adherent
$email=$contract->client->email;
$email=(GETPOST("email")?GETPOST("email"):(isValidEmail($email)?$email:''));
print '</td><td class="CTableRow'.($var?'1':'2').'"><input class="flat" type="text" name="email" size="48" value="'.$email.'"></td></tr>'."\n";
}
// Payment on member subscription
if (GETPOST("source") == 'membersubscription')
{
$found=true;
$langs->load("members");
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/class/cotisation.class.php");
$member=new Adherent($db);
$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);
开发者ID:remyyounes,项目名称:dolibarr,代码行数:30,代码来源:newpayment.php
示例19: dol_print_error
} else {
dol_print_error($db);
exit(-1);
}
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result >= 0) {
$justthese = array();
// We disable synchro Dolibarr-LDAP
$conf->global->LDAP_MEMBER_ACTIVE = 0;
$ldaprecords = $ldap->getRecords('*', $conf->global->LDAP_MEMBER_DN, $conf->global->LDAP_KEY_MEMBERS, $required_fields, 0);
if (is_array($ldaprecords)) {
$db->begin();
// Warning $ldapuser has a key in lowercase
foreach ($ldaprecords as $key => $ldapuser) {
$member = new Adherent($db);
// Propriete membre
$member->firstname = $ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME];
$member->lastname = $ldapuser[$conf->global->LDAP_FIELD_NAME];
$member->login = $ldapuser[$conf->global->LDAP_FIELD_LOGIN];
$member->pass = $ldapuser[$conf->global->LDAP_FIELD_PASSWORD];
//$member->societe;
$member->address = $ldapuser[$conf->global->LDAP_FIELD_ADDRESS];
$member->zip = $ldapuser[$conf->global->LDAP_FIELD_ZIP];
$member->town = $ldapuser[$conf->global->LDAP_FIELD_TOWN];
$member->country = $ldapuser[$conf->global->LDAP_FIELD_COUNTRY];
$member->country_id = $countries[$hashlib2rowid[strtolower($member->country)]]['rowid'];
$member->country_code = $countries[$hashlib2rowid[strtolower($member->country)]]['code'];
$member->phone = $ldapuser[$conf->global->LDAP_FIELD_PHONE];
$member->phone_perso = $ldapuser[$conf->global->LDAP_FIELD_PHONE_PERSO];
$member->phone_mobile = $ldapuser[$conf->global->LDAP_FIELD_MOBILE];
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:sync_members_ldap2dolibarr.php
示例20: assign_values
//.........这里部分代码省略.........
$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
注:本文中的Adherent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论