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


PHP Contact::getFullName方法代码示例

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


在下文中一共展示了Contact::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;
     $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedContacts", $max));
     if ($user->rights->societe->lire) {
         $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc,";
         $sql .= " s.nom as socname";
         $sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as sp";
         $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON sp.fk_soc = s.rowid";
         if (!$user->rights->societe->client->voir && !$user->societe_id) {
             $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
         }
         $sql .= " WHERE sp.entity IN (" . getEntity('societe', 1) . ")";
         if (!$user->rights->societe->client->voir && !$user->societe_id) {
             $sql .= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
         }
         if ($user->societe_id) {
             $sql .= " AND sp.fk_soc = {$user->societe_id}";
         }
         $sql .= " ORDER BY sp.tms DESC";
         $sql .= $db->plimit($max, 0);
         $result = $db->query($sql);
         if ($result) {
             $num = $db->num_rows($result);
             $contactstatic = new Contact($db);
             $societestatic = new Societe($db);
             $i = 0;
             while ($i < $num) {
                 $objp = $db->fetch_object($result);
                 $datec = $db->jdate($objp->datec);
                 $datem = $db->jdate($objp->tms);
                 $contactstatic->lastname = $objp->lastname;
                 $contactstatic->firstname = $objp->firstname;
                 $contactstatic->civility_id = $objp->civility_id;
                 $societestatic->id = $objp->fk_soc;
                 $societestatic->name = $objp->socname;
                 $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT . "/contact/card.php?id=" . $objp->rowid);
                 $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $contactstatic->getFullName($langs, 0), 'url' => DOL_URL_ROOT . "/contact/card.php?id=" . $objp->rowid);
                 $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => $objp->fk_soc > 0 ? 'company' : '', 'url' => $objp->fk_soc > 0 ? DOL_URL_ROOT . "/societe/soc.php?socid=" . $objp->fk_soc : '');
                 $this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => $societestatic->name, 'url' => DOL_URL_ROOT . "/societe/soc.php?socid=" . $objp->fk_soc);
                 $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_print_date($datem, "day"));
                 $i++;
             }
             if ($num == 0) {
                 $this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedContacts"));
             }
             $db->free($result);
         } 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:ADDAdev,项目名称:Dolibarr,代码行数:62,代码来源:box_contacts.php

示例2: pdf_build_address

/**
 *   	Return a string with full address formated
 *
 * 		@param	Translate	$outputlangs		Output langs object
 *   	@param  Societe		$sourcecompany		Source company object
 *   	@param  Societe		$targetcompany		Target company object
 *      @param  Contact		$targetcontact		Target contact object
 * 		@param	int			$usecontact			Use contact instead of company
 * 		@param	int			$mode				Address type ('source', 'target', 'targetwithdetails')
 * 		@return	string							String with full address
 */
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source')
{
    global $conf;
    $stringaddress = '';
    if ($mode == 'source' && !is_object($sourcecompany)) {
        return -1;
    }
    if ($mode == 'target' && !is_object($targetcompany)) {
        return -1;
    }
    if (!empty($sourcecompany->state_id) && empty($sourcecompany->departement)) {
        $sourcecompany->departement = getState($sourcecompany->state_id);
    }
    //TODO: Deprecated
    if (!empty($sourcecompany->state_id) && empty($sourcecompany->state)) {
        $sourcecompany->state = getState($sourcecompany->state_id);
    }
    if (!empty($targetcompany->state_id) && empty($targetcompany->departement)) {
        $targetcompany->departement = getState($targetcompany->state_id);
    }
    if ($mode == 'source') {
        $withCountry = 0;
        if (!empty($sourcecompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
            $withCountry = 1;
        }
        $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($sourcecompany, $withCountry, "\n", $outputlangs)) . "\n";
        if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS)) {
            // Phone
            if ($sourcecompany->phone) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("PhoneShort") . ": " . $outputlangs->convToOutputCharset($sourcecompany->phone);
            }
            // Fax
            if ($sourcecompany->fax) {
                $stringaddress .= ($stringaddress ? $sourcecompany->phone ? " - " : "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($sourcecompany->fax);
            }
            // EMail
            if ($sourcecompany->email) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Email") . ": " . $outputlangs->convToOutputCharset($sourcecompany->email);
            }
            // Web
            if ($sourcecompany->url) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Web") . ": " . $outputlangs->convToOutputCharset($sourcecompany->url);
            }
        }
    }
    if ($mode == 'target' || $mode == 'targetwithdetails') {
        if ($usecontact) {
            $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
            if (!empty($targetcontact->address)) {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($targetcontact)) . "\n";
            } else {
                $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->convToOutputCharset(dol_format_address($targetcompany)) . "\n";
            }
            // Country
            if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
                $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcontact->country_code)) . "\n";
            } else {
                if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
                    $stringaddress .= $outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country" . $targetcompany->country_code)) . "\n";
                }
            }
            if (!empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails') {
                // Phone
                if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Phone") . ": ";
                }
                if (!empty($targetcontact->phone_pro)) {
                    $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
                }
                if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
                    $stringaddress .= " / ";
                }
                if (!empty($targetcontact->phone_mobile)) {
                    $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
                }
                // Fax
                if ($targetcontact->fax) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Fax") . ": " . $outputlangs->convToOutputCharset($targetcontact->fax);
                }
                // EMail
                if ($targetcontact->email) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Email") . ": " . $outputlangs->convToOutputCharset($targetcontact->email);
                }
                // Web
                if ($targetcontact->url) {
                    $stringaddress .= ($stringaddress ? "\n" : '') . $outputlangs->transnoentities("Web") . ": " . $outputlangs->convToOutputCharset($targetcontact->url);
                }
            }
        } else {
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:pdf.lib.php

示例3: Societe

         print preg_replace('/./i', '*', $fuser->phenix_pass_crypted);
     }
     print '</td></tr>';
 }
 // Company / Contact
 if ($conf->societe->enabled) {
     print '<tr><td width="25%" valign="top">' . $langs->trans("LinkToCompanyContact") . '</td>';
     print '<td>';
     if ($fuser->societe_id > 0) {
         $societe = new Societe($db);
         $societe->fetch($fuser->societe_id);
         print $societe->getNomUrl(1, '');
         if ($fuser->contact_id) {
             $contact = new Contact($db);
             $contact->fetch($fuser->contact_id);
             print ' / <a href="' . DOL_URL_ROOT . '/contact/fiche.php?id=' . $fuser->contact_id . '">' . img_object($langs->trans("ShowContact"), 'contact') . ' ' . dol_trunc($contact->getFullName($langs), 32) . '</a>';
         }
     } else {
         print $langs->trans("ThisUserIsNot");
     }
     print '</td>';
     print "</tr>\n";
 }
 // Module Adherent
 if ($conf->adherent->enabled) {
     $langs->load("members");
     print '<tr><td width="25%" valign="top">' . $langs->trans("LinkedToDolibarrMember") . '</td>';
     print '<td>';
     if ($fuser->fk_member) {
         $adh = new Adherent($db);
         $adh->fetch($fuser->fk_member);
开发者ID:netors,项目名称:dolibarr,代码行数:31,代码来源:fiche.php

示例4: HookManager


//.........这里部分代码省略.........
                     //complete_substitutions_array($tmparray, $outputlangs, $object, $task, "completesubstitutionarray_lines");
                     foreach ($tmparray as $key => $val) {
                         try {
                             $listlines->setVars($key, $val, true, 'UTF-8');
                         } catch (OdfException $e) {
                         } catch (SegmentException $e) {
                         }
                     }
                     $taskobj = new Task($this->db);
                     $taskobj->fetch($task->id);
                     // Replace tags of lines for contacts task
                     $sourcearray = array('internal', 'external');
                     $contact_arrray = array();
                     foreach ($sourcearray as $source) {
                         $contact_temp = $taskobj->liste_contact(-1, $source);
                         if (is_array($contact_temp) && count($contact_temp) > 0) {
                             $contact_arrray = array_merge($contact_arrray, $contact_temp);
                         }
                     }
                     if (is_array($contact_arrray) && count($contact_arrray) > 0) {
                         $listlinestaskres = $listlines->__get('tasksressources');
                         foreach ($contact_arrray as $contact) {
                             if ($contact['source'] == 'internal') {
                                 $objectdetail = new User($this->db);
                                 $objectdetail->fetch($contact['id']);
                                 $contact['socname'] = $mysoc->name;
                             } elseif ($contact['source'] == 'external') {
                                 $objectdetail = new Contact($this->db);
                                 $objectdetail->fetch($contact['id']);
                                 $soc = new Societe($this->db);
                                 $soc->fetch($contact['socid']);
                                 $contact['socname'] = $soc->name;
                             }
                             $contact['fullname'] = $objectdetail->getFullName($outputlangs, 1);
                             $tmparray = $this->get_substitutionarray_tasksressource($contact, $outputlangs);
                             foreach ($tmparray as $key => $val) {
                                 try {
                                     $listlinestaskres->setVars($key, $val, true, 'UTF-8');
                                 } catch (OdfException $e) {
                                 } catch (SegmentException $e) {
                                 }
                             }
                             $listlinestaskres->merge();
                         }
                     }
                     //Time ressources
                     $sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
                     $sql .= ", u.lastname, u.firstname";
                     $sql .= " FROM " . MAIN_DB_PREFIX . "projet_task_time as t";
                     $sql .= " , " . MAIN_DB_PREFIX . "user as u";
                     $sql .= " WHERE t.fk_task =" . $task->id;
                     $sql .= " AND t.fk_user = u.rowid";
                     $sql .= " ORDER BY t.task_date DESC";
                     $resql = $this->db->query($sql);
                     if ($resql) {
                         $num = $this->db->num_rows($resql);
                         $i = 0;
                         $tasks = array();
                         $listlinestasktime = $listlines->__get('taskstimes');
                         while ($i < $num) {
                             $row = $this->db->fetch_array($resql);
                             if (!empty($row['fk_user'])) {
                                 $objectdetail = new User($this->db);
                                 $objectdetail->fetch($row['fk_user']);
                                 $row['fullcivname'] = $objectdetail->getFullName($outputlangs, 1);
                             } else {
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:67,代码来源:doc_generic_project_odt.modules.php

示例5: Ldap

*/
$sql = "SELECT rowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople";
$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);
        $contact = new Contact($db);
        $contact->id = $obj->rowid;
        $contact->fetch($contact->id);
        print $langs->trans("UpdateContact") . " rowid=" . $contact->id . " " . $contact->getFullName($langs);
        $oldobject = $contact;
        $oldinfo = $oldobject->_load_ldap_info();
        $olddn = $oldobject->_load_ldap_dn($oldinfo);
        $info = $contact->_load_ldap_info();
        $dn = $contact->_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->trans("OK");
        } else {
            $error++;
            print " - " . $langs->trans("KO") . ' - ' . $ldap->error;
        }
        print "\n";
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:sync_contacts_dolibarr2ldap.php

示例6: array

}
// instantiate Silex app, add twig capability to app
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
// ======
// routes
$app->get("/", function () use($app) {
    return $app['twig']->render('index.html.twig', array('contacts' => Contact::getAll()));
});
$app->get("/add_contact", function () use($app) {
    return $app['twig']->render('index.html.twig', array('form' => true));
});
$app->post("/add_contact_success", function () use($app) {
    $new_contact = new Contact($_POST['first_name'], $_POST['last_name'], $_POST['email'], $_POST['phone'], $_POST['street_address'], $_POST['city'], $_POST['state'], $_POST['zip_code'], $_POST['notes']);
    $new_contact->saveContact();
    return $app['twig']->render('index.html.twig', array('contacts' => Contact::getAll(), 'message' => array('type' => 'success', 'text' => $new_contact->getFullName() . ' has been added to your address book.')));
});
$app->get("/delete_contact", function () use($app) {
    return $app['twig']->render('index.html.twig', array('contacts' => Contact::getAll(), 'delete' => true));
});
$app->post("/delete_contact_success", function () use($app) {
    foreach ($_SESSION['list_of_contacts'] as $key => $contact) {
        if ($contact->getContactID() == $_POST['delete_contact']) {
            break;
        }
    }
    $name_of_deleted = $_SESSION['list_of_contacts'][$key]->getFullName();
    $_SESSION['list_of_contacts'][$key]->deleteContact();
    return $app['twig']->render('index.html.twig', array('contacts' => Contact::getAll(), 'message' => array('type' => 'danger', 'text' => $name_of_deleted . ' has been successfully removed from your address book.')));
});
$app->get("/delete_all_contacts", function () use($app) {
开发者ID:joekarasek,项目名称:epicodus-php-address_book,代码行数:31,代码来源:app.php

示例7: restrictedArea

// Security check
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db);
$result = $contact->fetch($id);
$physicalperson = 1;
$company = new Societe($db);
if ($contact->socid) {
    $result = $company->fetch($contact->socid);
    //print "ee";
}
// We create VCard
$v = new vCard();
$v->setProdId('Dolibarr ' . DOL_VERSION);
$v->setUid('DOLIBARR-CONTACTID-' . $contact->id);
$v->setName($contact->lastname, $contact->firstname, "", "", "");
$v->setFormattedName($contact->getFullName($langs));
// By default, all informations are for work (except phone_perso and phone_mobile)
$v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
$v->setPhoneNumber($contact->fax, "WORK;FAX");
$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, $contact->country_code ? $contact->country_id : '', "WORK;POSTAL");
$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, $contact->country_code ? $contact->country_id : '', "WORK");
$v->setEmail($contact->email, 'internet,pref');
$v->setNote($contact->note);
$v->setTitle($contact->poste);
// Data from linked company
if ($company->id) {
    $v->setURL($company->url, "WORK");
    if (!$contact->phone_pro) {
        $v->setPhoneNumber($company->phone, "WORK;VOICE");
    }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:vcard.php

示例8: loadBox

	/**
	 *      Load data of box into memory for a future usage
	 *      @param      $max        Maximum number of records to show
	 */
	function loadBox($max=5)
	{
		global $user, $langs, $db, $conf;
		$langs->load("boxes");

		$this->max=$max;

		$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedContacts",$max));

		if ($user->rights->societe->lire)
		{
			$sql = "SELECT s.rowid, s.name, s.firstname, s.civilite, s.datec, s.tms";
			$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as s";
			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
			$sql.= " WHERE s.entity = ".$conf->entity;
			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
			if ($user->societe_id) $sql.= " AND s.rowid = $user->societe_id";
			$sql.= " ORDER BY s.tms DESC";
			$sql.= $db->plimit($max, 0);

			$result = $db->query($sql);

			if ($result)
			{
				$num = $db->num_rows($result);

				$contactstatic=new Contact($db);

				$i = 0;
				while ($i < $num)
				{
					$objp = $db->fetch_object($result);
					$datec=$db->jdate($objp->datec);
					$datem=$db->jdate($objp->tms);

					$contactstatic->name=$objp->name;
                    $contactstatic->firstname=$objp->firstname;
                    $contactstatic->civilite_id=$objp->civilite;

					$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
                    'logo' => $this->boximg,
                    'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid);

					$this->info_box_contents[$i][1] = array('td' => 'align="left"',
                    'text' => $contactstatic->getFullName($langs,1),
                    'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid);

					$this->info_box_contents[$i][2] = array('td' => 'align="right"',
					'text' => dol_print_date($datem, "day"));

					$i++;
				}

				if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContacts"));
			}
			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:remyyounes,项目名称:dolibarr,代码行数:71,代码来源:box_contacts.php

示例9: Contact

 /**
  *    \brief      Affiche formulaire de selection des contacts
  *    \param      page        Page
  *    \param      selected    Id contact pre-selectionne
  *    \param      htmlname    Nom du formulaire select
  */
 function form_contacts($page, $societe, $selected = '', $htmlname = 'contactidp')
 {
     global $langs;
     if ($htmlname != "none") {
         print '<form method="post" action="' . $page . '">';
         print '<input type="hidden" name="action" value="set_contact">';
         print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
         print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
         print '<tr><td>';
         $num = $this->select_contacts($societe->id, $selected, $htmlname);
         if ($num == 0) {
             print '<font class="error">Cette societe n\'a pas de contact, veuillez en cr�er un avant de faire votre proposition commerciale</font><br>';
             print '<a href="' . DOL_URL_ROOT . '/contact/fiche.php?socid=' . $societe->id . '&amp;action=create&amp;backtoreferer=1">' . $langs->trans('AddContact') . '</a>';
         }
         print '</td>';
         print '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>';
         print '</tr></table></form>';
     } else {
         if ($selected) {
             require_once DOL_DOCUMENT_ROOT . "/contact/class/contact.class.php";
             //$this->load_cache_contacts();
             //print $this->cache_contacts[$selected];
             $contact = new Contact($this->db);
             $contact->fetch($selected);
             print $contact->getFullName($langs);
         } else {
             print "&nbsp;";
         }
     }
 }
开发者ID:netors,项目名称:dolibarr,代码行数:36,代码来源:html.form.class.php

示例10: getState

 /**
  * Define array with couple subtitution key => subtitution value
  *
  * @param	Contact 		$object        	contact
  * @param	Translate 	$outputlangs   	object for output
  * @param   array_key	$array_key	    Name of the key for return array
  * @return	array of substitution key->code
  */
 function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
 {
     global $conf;
     if (empty($object->country) && !empty($object->country_code)) {
         $object->country = $outputlangs->transnoentitiesnoconv("Country" . $object->country_code);
     }
     if (empty($object->state) && !empty($object->state_code)) {
         $object->state = getState($object->state_code, 0);
     }
     $array_contact = array($array_key . '_fullname' => $object->getFullName($outputlangs, 1), $array_key . '_lastname' => $object->lastname, $array_key . '_firstname' => $object->firstname, $array_key . '_address' => $object->address, $array_key . '_zip' => $object->zip, $array_key . '_town' => $object->town, $array_key . '_state_id' => $object->state_id, $array_key . '_state_code' => $object->state_code, $array_key . '_state' => $object->state, $array_key . '_country_id' => $object->country_id, $array_key . '_country_code' => $object->country_code, $array_key . '_country' => $object->country, $array_key . '_poste' => $object->poste, $array_key . '_socid' => $object->socid, $array_key . '_statut' => $object->statut, $array_key . '_code' => $object->code, $array_key . '_email' => $object->email, $array_key . '_jabberid' => $object->jabberid, $array_key . '_phone_pro' => $object->phone_pro, $array_key . '_phone_perso' => $object->phone_perso, $array_key . '_phone_mobile' => $object->phone_mobile, $array_key . '_fax' => $object->fax, $array_key . '_birthday' => $object->birthday, $array_key . '_default_lang' => $object->default_lang, $array_key . '_note_public' => $object->note_public, $array_key . '_note_private' => $object->note_private);
     // Retrieve extrafields
     require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
     $extrafields = new ExtraFields($this->db);
     $extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
     $object->fetch_optionals($object->id, $extralabels);
     foreach ($extrafields->attribute_label as $key => $label) {
         if ($extrafields->attribute_type[$key] == 'price') {
             $object->array_options['options_' . $key] = price($object->array_options['options_' . $key], 0, $outputlangs, 0, 0, -1, $conf->currency);
         } elseif ($extrafields->attribute_type[$key] == 'select') {
             $object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
         }
         $array_contact = array_merge($array_contact, array($array_key . '_options_' . $key => $object->array_options['options_' . $key]));
     }
     return $array_contact;
 }
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:33,代码来源:commondocgenerator.class.php

示例11: show_contacts


//.........这里部分代码省略.........
            $contactstatic->firstname = $obj->firstname;
            $contactstatic->civility_id = $obj->civility_id;
            print $contactstatic->getNomUrl(1);
            print '</td>';
            print '<td>' . $obj->poste . '</td>';
            $country_code = getCountry($obj->country_id, 'all');
            // Lien click to dial
            print '<td>';
            print dol_print_phone($obj->phone, $country_code['code'], $obj->rowid, $object->id, 'AC_TEL');
            print '</td>';
            print '<td>';
            print dol_print_phone($obj->phone_mobile, $country_code['code'], $obj->rowid, $object->id, 'AC_TEL');
            print '</td>';
            print '<td>';
            print dol_print_phone($obj->fax, $country_code['code'], $obj->rowid, $object->id, 'AC_FAX');
            print '</td>';
            print '<td>';
            print dol_print_email($obj->email, $obj->rowid, $object->id, 'AC_EMAIL');
            print '</td>';
            if (!empty($conf->skype->enabled)) {
                print '<td>';
                print dol_print_skype($obj->skype, $obj->rowid, $object->id, 'AC_SKYPE');
                print '</td>';
            }
            // Status
            print '<td>' . $contactstatic->getLibStatut(5) . '</td>';
            print '<td align="center">';
            if (!empty($conf->use_javascript_ajax)) {
                // Copy to clipboard
                $coords = '';
                if (!empty($object->name)) {
                    $coords .= $object->name . "<br>";
                }
                $coords .= $contactstatic->getFullName($langs, 1) . ' ';
                $coords .= "<br>";
                if (!empty($obj->address)) {
                    $coords .= dol_nl2br($obj->address, 1, true) . "<br>";
                    if (!empty($obj->zip)) {
                        $coords .= $obj->zip . ' ';
                    }
                    if (!empty($obj->town)) {
                        $coords .= $obj->town;
                    }
                    if (!empty($obj->country_id)) {
                        $coords .= "<br>" . $country_code['label'];
                    }
                } else {
                    if (!empty($object->address)) {
                        $coords .= dol_nl2br($object->address, 1, true) . "<br>";
                        if (!empty($object->zip)) {
                            $coords .= $object->zip . ' ';
                        }
                        if (!empty($object->town)) {
                            $coords .= $object->town;
                        }
                        if (!empty($object->country_id)) {
                            $coords .= "<br>" . $country_code['label'];
                        }
                    }
                }
                // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile
                print '<a href="#" class="hideonsmartphone" onclick="return copyToClipboard(\'' . dol_escape_js($coords) . '\',\'' . dol_escape_js($langs->trans("HelpCopyToClipboard")) . '\');">';
                print img_picto($langs->trans("Address"), 'object_address.png');
                print '</a>';
            }
            print '</td>';
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:67,代码来源:company.lib.php

示例12: sendOrderByMail

 /**
  *
  * @param unknown $object
  */
 static function sendOrderByMail(&$object)
 {
     global $conf, $langs, $user, $db;
     if (empty($object->thirdparty)) {
         $object->fetch_thirdparty();
     }
     $sendto = $object->thirdparty->email;
     $sendtocc = '';
     $from = empty($user->email) ? $conf->global->MAIN_MAIL_EMAIL_FROM : $user->email;
     $id = $object->id;
     $_POST['receiver'] = '-1';
     $_POST['frommail'] = $_POST['replytomail'] = $from;
     $_POST['fromname'] = $_POST['replytoname'] = $user->getFullName($langs);
     dol_include_once('/core/class/html.formmail.class.php');
     $formmail = new Formmail($db);
     $outputlangs = clone $langs;
     $id_template = (int) $conf->global->GRAPEFRUIT_SEND_BILL_BY_MAIL_ON_VALIDATE_MODEL;
     $formmail->fetchAllEMailTemplate('facture_send', $user, $outputlangs);
     foreach ($formmail->lines_model as &$model) {
         if ($model->id == $id_template) {
             break;
         }
     }
     if (empty($model)) {
         setEventMessage($langs->trans('ModelRequire'), 'errors');
     }
     // Make substitution
     $substit['__REF__'] = $object->ref;
     $substit['__SIGNATURE__'] = $user->signature;
     $substit['__REFCLIENT__'] = $object->ref_client;
     $substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
     $substit['__PROJECT_REF__'] = is_object($object->projet) ? $object->projet->ref : '';
     $substit['__PROJECT_NAME__'] = is_object($object->projet) ? $object->projet->title : '';
     $substit['__PERSONALIZED__'] = '';
     $substit['__CONTACTCIVNAME__'] = '';
     // Find the good contact adress
     $custcontact = '';
     $contactarr = array();
     $contactarr = $object->liste_contact(-1, 'external');
     if (is_array($contactarr) && count($contactarr) > 0) {
         foreach ($contactarr as $contact) {
             dol_syslog(get_class($this) . '::' . __METHOD__ . ' lib=' . $contact['libelle']);
             dol_syslog(get_class($this) . '::' . __METHOD__ . ' trans=' . $langs->trans('TypeContact_commande_external_BILLING'));
             if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_BILLING')) {
                 require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
                 $contactstatic = new Contact($db);
                 $contactstatic->fetch($contact['id']);
                 $custcontact = $contactstatic->getFullName($langs, 1);
                 dol_syslog(get_class($this) . '::' . __METHOD__ . ' email=' . $contactstatic->email);
             }
         }
         if (!empty($custcontact)) {
             $substit['__CONTACTCIVNAME__'] = $custcontact;
         }
         if (!empty($contactstatic->email)) {
             $sendto = $contactstatic->email;
         }
     }
     $topic = make_substitutions($model->topic, $substit);
     $message = make_substitutions($model->content, $substit);
     $_POST['message'] = $message;
     $_POST['subject'] = $topic;
     require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
     // Add attached files
     $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $object->ref, preg_quote($object->ref, '/') . '[^\\-]+');
     if (is_array($fileparams) && array_key_exists('fullname', $fileparams) && !empty($fileparams['fullname'])) {
         $_SESSION["listofpaths"] = $fileparams['fullname'];
         $_SESSION["listofnames"] = basename($fileparams['fullname']);
         $_SESSION["listofmimes"] = dol_mimetype($fileparams['fullname']);
     } else {
         // generate invoice
         $result = $object->generateDocument($object->modelpdf, $outputlangs, 0, 0, 0);
         if ($result <= 0) {
             $this->error = $object->error;
         }
         $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $object->ref, preg_quote($object->ref, '/') . '[^\\-]+');
         if (is_array($fileparams) && array_key_exists('fullname', $fileparams) && !empty($fileparams['fullname'])) {
             $_SESSION["listofpaths"] = $fileparams['fullname'];
             $_SESSION["listofnames"] = basename($fileparams['fullname']);
             $_SESSION["listofmimes"] = dol_mimetype($fileparams['fullname']);
         }
     }
     $action = 'send';
     $actiontypecode = 'AC_FAC';
     $trigger_name = 'BILL_SENTBYMAIL';
     $paramname = 'id';
     $mode = 'emailfrominvoice';
     if (!empty($sendto)) {
         require_once __DIR__ . '/../tpl/actions_sendmails.inc.php';
     }
 }
开发者ID:ATM-Consulting,项目名称:dolibarr_module_grapefruit,代码行数:95,代码来源:grapefruit.class.php

示例13: isset

	}
	else
	{
		$result=$cactioncomm->fetch($_POST["actioncode"]);
	}

	// Initialisation objet actioncomm
	$actioncomm->type_id = $cactioncomm->id;
	$actioncomm->type_code = $cactioncomm->code;
	$actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0;
	$actioncomm->fulldayevent = $_POST["fullday"]?1:0;
	$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
	$actioncomm->label = trim($_POST["label"]);
	if (! $_POST["label"])
	{
		if ($_POST["actioncode"] == 'AC_RDV' && $contact->getFullName($langs))
		{
			$actioncomm->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs));
		}
		else
		{
			if ($langs->trans("Action".$actioncomm->type_code) != "Action".$actioncomm->type_code)
			{
				$actioncomm->label = $langs->transnoentitiesnoconv("Action".$actioncomm->type_code)."\n";
			}
			else $actioncomm->label = $cactioncomm->libelle;
		}
	}
	$actioncomm->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
	$actioncomm->datep = $datep;
	$actioncomm->datef = $datef;
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:fiche.php

示例14: setEventMessages

     $donotclearsession = 1;
     $action = 'create';
     setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
 } else {
     $object->type_code = GETPOST('actioncode');
 }
 if (!$error) {
     // Initialisation objet actioncomm
     $object->priority = GETPOST("priority") ? GETPOST("priority") : 0;
     $object->fulldayevent = !empty($fulldayevent) ? 1 : 0;
     $object->location = GETPOST("location");
     $object->label = trim(GETPOST('label'));
     $object->fk_element = GETPOST("fk_element");
     $object->elementtype = GETPOST("elementtype");
     if (!GETPOST('label')) {
         if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) {
             $object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs));
         } else {
             if ($langs->trans("Action" . $object->type_code) != "Action" . $object->type_code) {
                 $object->label = $langs->transnoentitiesnoconv("Action" . $object->type_code) . "\n";
             } else {
                 $object->label = $cactioncomm->libelle;
             }
         }
     }
     $object->fk_project = isset($_POST["projectid"]) ? $_POST["projectid"] : 0;
     $object->datep = $datep;
     $object->datef = $datef;
     $object->percentage = $percentage;
     $object->duree = ((double) (GETPOST('dureehour') * 60) + (double) GETPOST('dureemin')) * 60;
     $transparency = GETPOST("transparency") == 'on' ? 1 : 0;
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:card.php

示例15: Task


//.........这里部分代码省略.........
                 }
                 $tmparray = $this->get_substitutionarray_tasks($object, $outputlangs);
                 complete_substitutions_array($tmparray, $outputlangs, $object);
                 foreach ($tmparray as $key => $val) {
                     try {
                         $odfHandler->setVars($key, $val, true, 'UTF-8');
                     } catch (OdfException $e) {
                     } catch (SegmentException $e) {
                     }
                 }
                 // Replace tags of lines for contacts task
                 $sourcearray = array('internal', 'external');
                 $contact_arrray = array();
                 foreach ($sourcearray as $source) {
                     $contact_temp = $object->liste_contact(-1, $source);
                     if (is_array($contact_temp) && count($contact_temp) > 0) {
                         $contact_arrray = array_merge($contact_arrray, $contact_temp);
                     }
                 }
                 if (is_array($contact_arrray) && count($contact_arrray) > 0) {
                     $listlinestaskres = $odfHandler->setSegment('tasksressources');
                     foreach ($contact_arrray as $contact) {
                         if ($contact['source'] == 'internal') {
                             $objectdetail = new User($this->db);
                             $objectdetail->fetch($contact['id']);
                             $contact['socname'] = $mysoc->name;
                         } elseif ($contact['source'] == 'external') {
                             $objectdetail = new Contact($this->db);
                             $objectdetail->fetch($contact['id']);
                             $soc = new Societe($this->db);
                             $soc->fetch($contact['socid']);
                             $contact['socname'] = $soc->name;
                         }
                         $contact['fullname'] = $objectdetail->getFullName($outputlangs, 1);
                         $tmparray = $this->get_substitutionarray_tasksressource($contact, $outputlangs);
                         foreach ($tmparray as $key => $val) {
                             try {
                                 $listlinestaskres->setVars($key, $val, true, 'UTF-8');
                             } catch (OdfException $e) {
                             } catch (SegmentException $e) {
                             }
                         }
                         $listlinestaskres->merge();
                     }
                     $odfHandler->mergeSegment($listlinestaskres);
                 }
                 //Time ressources
                 $sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
                 $sql .= ", u.name, u.firstname";
                 $sql .= " FROM " . MAIN_DB_PREFIX . "projet_task_time as t";
                 $sql .= " , " . MAIN_DB_PREFIX . "user as u";
                 $sql .= " WHERE t.fk_task =" . $object->id;
                 $sql .= " AND t.fk_user = u.rowid";
                 $sql .= " ORDER BY t.task_date DESC";
                 $resql = $this->db->query($sql);
                 if ($resql) {
                     $num = $this->db->num_rows($resql);
                     $i = 0;
                     $tasks = array();
                     $listlinestasktime = $odfHandler->setSegment('taskstimes');
                     while ($i < $num) {
                         $row = $this->db->fetch_array($resql);
                         if (!empty($row['fk_user'])) {
                             $objectdetail = new User($this->db);
                             $objectdetail->fetch($row['fk_user']);
                             $row['fullcivname'] = $objectdetail->getFullName($outputlangs, 1);
开发者ID:Samara94,项目名称:dolibarr,代码行数:67,代码来源:doc_generic_task_odt.modules.php


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