本文整理汇总了PHP中dolGetFirstLastname函数的典型用法代码示例。如果您正苦于以下问题:PHP dolGetFirstLastname函数的具体用法?PHP dolGetFirstLastname怎么用?PHP dolGetFirstLastname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dolGetFirstLastname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dol_syslog
if ($num) {
dol_syslog("comm/mailing/fiche.php: nb of targets = " . $num, LOG_DEBUG);
$now = dol_now();
// Positionne date debut envoi
$sql = "UPDATE " . MAIN_DB_PREFIX . "mailing SET date_envoi=" . $db->idate($now) . " WHERE rowid=" . $object->id;
$resql2 = $db->query($sql);
if (!$resql2) {
dol_print_error($db);
}
// Loop on each email and send it
$i = 0;
while ($i < $num && $i < $conf->global->MAILING_LIMIT_SENDBYWEB) {
$res = 1;
$obj = $db->fetch_object($resql);
// sendto en RFC2822
$sendto = str_replace(',', ' ', dolGetFirstLastname($obj->firstname, $obj->lastname)) . " <" . $obj->email . ">";
// Make substitutions on topic and body. From (AA=YY;BB=CC;...) we keep YY, CC, ...
$other = explode(';', $obj->other);
$tmpfield = explode('=', $other[0], 2);
$other1 = isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0];
$tmpfield = explode('=', $other[1], 2);
$other2 = isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0];
$tmpfield = explode('=', $other[2], 2);
$other3 = isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0];
$tmpfield = explode('=', $other[3], 2);
$other4 = isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0];
$tmpfield = explode('=', $other[4], 2);
$other5 = isset($tmpfield[1]) ? $tmpfield[1] : $tmpfield[0];
// Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions)
$substitutionarray = array('__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, '__LASTNAME__' => $obj->lastname, '__FIRSTNAME__' => $obj->firstname, '__MAILTOEMAIL__' => '<a href="mailto:' . $obj->email . '">' . $obj->email . '</a>', '__OTHER1__' => $other1, '__OTHER2__' => $other2, '__OTHER3__' => $other3, '__OTHER4__' => $other4, '__OTHER5__' => $other5, '__CHECK_READ__' => '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $obj->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>', '__UNSUBSCRIBE__' => '<a href="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-unsubscribe.php?tag=' . $obj->tag . '&unsuscrib=1&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" target="_blank">' . $langs->trans("MailUnsubcribe") . '</a>');
if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) {
示例2: ExpenseReport
$var = true;
$total_total_ht = 0;
$total_total_ttc = 0;
$total_total_tva = 0;
$expensereportstatic = new ExpenseReport($db);
if ($num > 0) {
while ($i < min($num, $limit)) {
$objp = $db->fetch_object($resql);
$expensereportstatic->id = $objp->rowid;
$expensereportstatic->ref = $objp->ref;
$var = !$var;
print "<tr " . $bc[$var] . ">";
print '<td>' . $expensereportstatic->getNomUrl(1) . '</td>';
print '<td align="center">' . ($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '') . '</td>';
print '<td align="center">' . ($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '') . '</td>';
print '<td align="left"><a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $objp->id_user . '">' . img_object($langs->trans("ShowUser"), "user") . ' ' . dolGetFirstLastname($objp->firstname, $objp->lastname) . '</a></td>';
print '<td align="right">' . price($objp->total_ht) . '</td>';
print '<td align="right">' . price($objp->total_tva) . '</td>';
print '<td align="right">' . price($objp->total_ttc) . '</td>';
$expensereporttmp->status = $objp->status;
print '<td align="right">';
//print $objp->status;
print $expensereporttmp->getLibStatut(5);
print '</td>';
print '<td></td>';
print "</tr>\n";
$total_total_ht = $total_total_ht + $objp->total_ht;
$total_total_tva = $total_total_tva + $objp->total_tva;
$total_total_ttc = $total_total_ttc + $objp->total_ttc;
$i++;
}
示例3: Translate
}
}
// Define line content
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($obj->lang) ? $langs->defaultlang : $obj->lang);
// By default language of sale representative
$outputlangs->load("bills");
$outputlangs->load("main");
$outputlangs->load("contracts");
$outputlangs->load("products");
if (dol_strlen($obj->email)) {
$message .= $outputlangs->trans("Contract") . " " . $obj->ref . ": " . $langs->trans("Service") . " " . dol_concatdesc($obj->plabel, $obj->description) . " (" . price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency) . ") " . $obj->name . ", " . $outputlangs->trans("DateEndPlannedShort") . " " . dol_print_date($db->jdate($obj->date_fin_validite), 'day') . "\n\n";
dol_syslog("email_expire_services_to_representatives.php: " . $obj->email);
$foundtoprocess++;
}
print "Service to expire " . $obj->ref . ", label " . dol_concatdesc($obj->plabel, $obj->description) . ", due date " . dol_print_date($db->jdate($obj->date_fin_validite), 'day') . " (linked to company " . $obj->name . ", sale representative " . dolGetFirstLastname($obj->firstname, $obj->lastname) . ", email " . $obj->email . "): ";
if (dol_strlen($obj->email)) {
print "qualified.";
} else {
print "disqualified (no email).";
}
print "\n";
unset($outputlangs);
$total += $obj->total_ttc;
$i++;
}
// Si il reste des envois en buffer
if ($foundtoprocess) {
if (dol_strlen($oldemail) && $oldemail != 'none') {
envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative, $duration_value);
} else {
示例4: set_infotrans
/**
* Set withdrawal to transmited status
*
* @param User $user id of user
* @param timestamp $date date of action
* @param string $method method of transmision to bank
* @return int >0 if OK, <0 if KO
*/
function set_infotrans($user, $date, $method)
{
global $conf, $langs;
$error = 0;
dol_syslog(get_class($this) . "::set_infotrans Start", LOG_INFO);
if ($this->db->begin()) {
$sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons ";
$sql .= " SET fk_user_trans = " . $user->id;
$sql .= " , date_trans = '" . $this->db->idate($date) . "'";
$sql .= " , method_trans = " . $method;
$sql .= " , statut = 1";
$sql .= " WHERE rowid = " . $this->id;
$sql .= " AND entity = " . $conf->entity;
$sql .= " AND statut = 0";
if ($this->db->query($sql)) {
$this->method_trans = $method;
$langs->load('withdrawals');
$subject = $langs->trans("InfoTransSubject", $this->ref);
$message = $langs->trans("InfoTransMessage", $this->ref, dolGetFirstLastname($user->firstname, $user->lastname));
$message .= $langs->trans("InfoTransData", price($this->amount), $this->methodes_trans[$this->method_trans], dol_print_date($date, 'day'));
// TODO Call trigger to create a notification using notification module
} else {
dol_syslog(get_class($this) . "::set_infotrans Erreur 1", LOG_ERR);
dol_syslog($this->db->error());
$error++;
}
if ($error == 0) {
$this->db->commit();
return 0;
} else {
$this->db->rollback();
dol_syslog(get_class($this) . "::set_infotrans ROLLBACK", LOG_ERR);
return -1;
}
} else {
dol_syslog(get_class($this) . "::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT);
return -2;
}
}
示例5: while
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
$event = new ActionComm($db);
$event->id = $obj->rowid;
// We put contact id in action id for birthdays events
$datebirth = dol_stringtotime($obj->birthday, 1);
//print 'ee'.$obj->birthday.'-'.$datebirth;
$datearray = dol_getdate($datebirth, true);
$event->datep = dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true);
// For full day events, date are also GMT but they wont but converted during output
$event->datef = $event->datep;
$event->type_code = 'BIRTHDAY';
$event->libelle = $langs->trans("Birthday") . ' ' . dolGetFirstLastname($obj->firstname, $obj->lastname);
$event->percentage = 100;
$event->fulldayevent = true;
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
$event->ponctuel = 0;
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = date('Y', $daycursor);
$mois = date('m', $daycursor);
$jour = date('d', $daycursor);
$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
示例6: load_fiche_titre
print load_fiche_titre($title);
// Lignes des titres
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Login") . '</td>';
print '<td> </td>';
print "</tr>\n";
$var = True;
while ($i < $num) {
$obj = $db->fetch_object($resql);
$var = !$var;
print "<tr " . $bc[$var] . "><td>";
print '<a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $obj->rowid . '">';
print img_object($langs->trans("ShowUser"), "user") . ' ';
print dolGetFirstLastname($obj->firstname, $obj->lastname) . "\n";
print '</a>';
print '</td><td>' . $obj->login . '</td>';
print '<td><a href="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '&commid=' . $obj->rowid . '">' . $langs->trans("Add") . '</a></td>';
print '</tr>' . "\n";
$i++;
}
print "</table>";
$db->free($resql);
} else {
dol_print_error($db);
}
}
}
llxFooter();
$db->close();
示例7: select_salesrepresentatives
/**
* Return select list for categories (to use in form search selectors)
*
* @param string $selected Preselected value
* @param string $htmlname Name of combo list (example: 'search_sale')
* @param User $user Object user
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param int $showempty 1=show also an empty value
* @param string $morecss More CSS
* @return string Html combo list code
*/
function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '')
{
global $conf, $langs;
$langs->load('users');
$out = '';
$nodatarole = '';
// Enhance with select2
if ($conf->use_javascript_ajax) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement = ajax_combobox($htmlname);
if ($comboenhancement) {
$out .= $comboenhancement;
$nodatarole = $comboenhancement ? ' data-role="none"' : '';
}
}
// Select each sales and print them in a select input
$out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $nodatarole . '>';
if ($showempty) {
$out .= '<option value="0"> </option>';
}
// Get list of users allowed to be viewed
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
$sql_usr .= " FROM " . MAIN_DB_PREFIX . "user as u";
$sql_usr .= " WHERE u.entity IN (0," . $conf->entity . ")";
if (empty($user->rights->user->user->lire)) {
$sql_usr .= " AND u.rowid = " . $user->id;
}
if (!empty($user->societe_id)) {
$sql_usr .= " AND u.fk_soc = " . $user->societe_id;
}
// Add existing sales representatives of thirdparty of external user
if (empty($user->rights->user->user->lire) && $user->societe_id) {
$sql_usr .= " UNION ";
$sql_usr .= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut, u2.login";
$sql_usr .= " FROM " . MAIN_DB_PREFIX . "user as u2, " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
$sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")";
$sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc=" . $user->societe_id;
}
$sql_usr .= " ORDER BY lastname ASC";
//print $sql_usr;exit;
$resql_usr = $this->db->query($sql_usr);
if ($resql_usr) {
while ($obj_usr = $this->db->fetch_object($resql_usr)) {
$out .= '<option value="' . $obj_usr->rowid . '"';
if ($obj_usr->rowid == $selected) {
$out .= ' selected';
}
$out .= '>';
$out .= dolGetFirstLastname($obj_usr->firstname, $obj_usr->lastname);
// Complete name with more info
$moreinfo = 0;
if (!empty($conf->global->MAIN_SHOW_LOGIN)) {
$out .= ($moreinfo ? ' - ' : ' (') . $obj_usr->login;
$moreinfo++;
}
if ($showstatus >= 0) {
if ($obj_usr->statut == 1 && $showstatus == 1) {
$out .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled');
$moreinfo++;
}
if ($obj_usr->statut == 0) {
$out .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled');
$moreinfo++;
}
}
$out .= $moreinfo ? ')' : '';
$out .= '</option>';
}
$this->db->free($resql_usr);
} else {
dol_print_error($this->db);
}
$out .= '</select>';
return $out;
}
示例8: add_to_spip
/**
* Fonction qui donne les droits redacteurs dans spip
*
* @param Adherent $object Object with data (->firstname, ->lastname, ->email and ->login)
* @return int =0 if KO, >0 if OK
*/
function add_to_spip($object)
{
dol_syslog(get_class($this) . "::add_to_spip");
if ($this->isSpipEnabled()) {
if ($this->checkSpipConfig()) {
$mydb = $this->connectSpip();
if ($mydb) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
$mdpass = dol_hash($object->pass);
$htpass = crypt($object->pass, makesalt());
$query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"" . dolGetFirstLastname($object->firstname, $object->lastname) . "\",\"" . $object->email . "\",\"" . $object->login . "\",\"{$mdpass}\",\"{$htpass}\",FLOOR(32000*RAND()),\"1comite\")";
$result = $mydb->query($query);
$mydb->close();
if ($result) {
return 1;
} else {
$this->error = $mydb->lasterror();
}
} else {
$this->error = 'Failed to connect to SPIP';
}
} else {
$this->error = 'BadSPIPConfiguration';
}
} else {
$this->error = 'SPIPNotEnabled';
}
return 0;
}
示例9: contact_get_property
/**
* Return property of contact from its id
*
* @param int $rowid id of contact
* @param string $mode 'email' or 'mobile'
* @return string email of contact
*/
function contact_get_property($rowid,$mode)
{
$contact_property='';
if (empty($rowid)) return '';
$sql = "SELECT rowid, email, phone_mobile, lastname, firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople";
$sql.= " WHERE rowid = '".$rowid."'";
$resql=$this->db->query($sql);
if ($resql)
{
$nump = $this->db->num_rows($resql);
if ($nump)
{
$obj = $this->db->fetch_object($resql);
if ($mode == 'email') $contact_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">";
else if ($mode == 'mobile') $contact_property = $obj->phone_mobile;
}
return $contact_property;
}
else
{
dol_print_error($this->db);
}
}
示例10: Societe
$object = new Societe($db);
$object->fetch($socid);
$res = $object->setValueFrom('localtax2_value', $value);
}
// Add new or update third party
if (!GETPOST('getcustomercode') && !GETPOST('getsuppliercode') && ($action == 'add' || $action == 'update') && $user->rights->societe->creer) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
if ($action == 'update') {
$ret = $object->fetch($socid);
$object->oldcopy = dol_clone($object);
} else {
$object->canvas = $canvas;
}
if (GETPOST("private") == 1) {
$object->particulier = GETPOST("private");
$object->name = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('nom', 'alpha') ? GETPOST('nom', 'alpha') : GETPOST('name', 'alpha'));
$object->civility_id = GETPOST('civility_id', 'int');
// Add non official properties
$object->name_bis = GETPOST('name', 'alpha') ? GETPOST('name', 'alpha') : GETPOST('nom', 'alpha');
$object->firstname = GETPOST('firstname', 'alpha');
} else {
$object->name = GETPOST('name', 'alpha') ? GETPOST('name', 'alpha') : GETPOST('nom', 'alpha');
}
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
$object->country_id = GETPOST('country_id', 'int');
$object->state_id = GETPOST('state_id', 'int');
$object->skype = GETPOST('skype', 'alpha');
$object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'alpha');
示例11: getFullName
/**
* Return full name (civility+' '+name+' '+lastname)
*
* @param Translate $langs Language object for translation of civility
* @param int $option 0=No option, 1=Add civility
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname
* @param int $maxlen Maximum length
* @return string String with full name
*/
function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
{
//print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."<br>\n";
$lastname = $this->lastname;
$firstname = $this->firstname;
if (empty($lastname)) {
$lastname = isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (isset($this->nom) ? $this->nom : ''));
}
$ret = '';
if ($option && $this->civility_id) {
if ($langs->transnoentitiesnoconv("Civility" . $this->civility_id) != "Civility" . $this->civility_id) {
$ret .= $langs->transnoentitiesnoconv("Civility" . $this->civility_id) . ' ';
} else {
$ret .= $this->civility_id . ' ';
}
}
$ret .= dolGetFirstLastname($firstname, $lastname, $nameorder);
return dol_trunc($ret, $maxlen);
}
示例12: build_exportfile
//.........这里部分代码省略.........
}
if ($key == 'logint' || $key == 'login') {
$logint = $value;
$userforfilter = new User($this->db);
$result = $userforfilter->fetch('', $value);
$sql .= " AND ar.fk_element = " . $userforfilter->id;
}
}
$sql .= " AND a.datep IS NOT NULL";
// To exclude corrupted events and avoid errors in lightning/sunbird import
$sql .= " ORDER by datep";
//print $sql;exit;
dol_syslog(get_class($this) . "::build_exportfile select events", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
// Note: Output of sql request is encoded in $conf->file->character_set_client
// This assignment in condition is not a bug. It allows walking the results.
while ($obj = $this->db->fetch_object($resql)) {
$qualified = true;
// 'eid','startdate','duration','enddate','title','summary','category','email','url','desc','author'
$event = array();
$event['uid'] = 'dolibarragenda-' . $this->db->database_name . '-' . $obj->id . "@" . $_SERVER["SERVER_NAME"];
$event['type'] = $type;
$datestart = $this->db->jdate($obj->datep) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : $conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
$dateend = $this->db->jdate($obj->datep2) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : $conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
$duration = $datestart && $dateend ? $dateend - $datestart : 0;
$event['summary'] = $obj->label . ($obj->socname ? " (" . $obj->socname . ")" : "");
$event['desc'] = $obj->note;
$event['startdate'] = $datestart;
$event['enddate'] = $dateend;
// Not required with type 'journal'
$event['duration'] = $duration;
// Not required with type 'journal'
$event['author'] = dolGetFirstLastname($obj->firstname, $obj->lastname);
$event['priority'] = $obj->priority;
$event['fulldayevent'] = $obj->fulldayevent;
$event['location'] = $obj->location;
$event['transparency'] = $obj->transparency > 0 ? 'OPAQUE' : 'TRANSPARENT';
// OPAQUE (busy) or TRANSPARENT (not busy)
$event['punctual'] = $obj->punctual;
$event['category'] = $obj->libelle;
// libelle type action
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
// This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$url = $urlwithroot . '/comm/action/card.php?id=' . $obj->id;
$event['url'] = $url;
$event['created'] = $this->db->jdate($obj->datec) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : $conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
$event['modified'] = $this->db->jdate($obj->datem) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : $conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
if ($qualified && $datestart) {
$eventarray[$datestart] = $event;
}
}
} else {
$this->error = $this->db->lasterror();
return -1;
}
$langs->load("agenda");
// Define title and desc
$more = '';
if ($login) {
$more = $langs->transnoentities("User") . ' ' . $login;
}
if ($logina) {
示例13: while
if ($num) {
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR>';
print "<td>" . $langs->trans("Name") . " / " . $langs->trans("Company") . "</td>";
print "<td>Date</td>";
print "<td align=\"right\">" . $langs->trans("Amount") . "</TD>";
print "</TR>\n";
$var = True;
$bc[1] = 'bgcolor="#f5f5f5"';
$bc[0] = 'bgcolor="#f0f0f0"';
while ($i < $num) {
$objp = $db->fetch_object($resql);
$var = !$var;
print "<tr " . $bc[$var] . ">";
if ($objp->public) {
print "<td>" . dolGetFirstLastname($objp->firstname, $objp->lastname) . " " . $objp->societe . "</td>\n";
} else {
print "<td>Anonyme Anonyme</td>\n";
}
print "<td>" . dol_print_date($db->jdate($objp->datedon)) . "</td>\n";
print '<td align="right">' . number_format($objp->amount, 2, '.', ' ') . ' ' . $langs->trans("Currency" . $conf->currency) . '</td>';
print "</tr>";
$i++;
}
print "</table>";
} else {
print "Aucun don publique";
}
} else {
dol_print_error($db);
}
示例14: User
}
// From
$expediteur = new User($db);
$expediteur->fetch($cp->fk_validator);
$emailFrom = $expediteur->email;
// Subject
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
$societeName = $conf->global->MAIN_APPLICATION_TITLE;
}
$subject = $societeName . " - " . $langs->transnoentitiesnoconv("HolidaysCanceled");
// Content
$message = $langs->transnoentitiesnoconv("Hello") . " " . $destinataire->firstname . ",\n";
$message .= "\n";
$message .= $langs->transnoentities("HolidaysCanceledBody", dol_print_date($cp->date_debut, 'day'), dol_print_date($cp->date_fin, 'day')) . "\n";
$message .= "- " . $langs->transnoentitiesnoconv("ModifiedBy") . " : " . dolGetFirstLastname($expediteur->firstname, $expediteur->lastname) . "\n";
$message .= "- " . $langs->transnoentitiesnoconv("Link") . " : " . $dolibarr_main_url_root . "/holiday/fiche.php?id=" . $cp->rowid . "\n\n";
$message .= "\n";
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message);
// Envoi du mail
$result = $mail->sendfile();
if (!$result) {
header('Location: fiche.php?id=' . $_GET['id'] . '&error=mail&error_content=' . $mail->error);
exit;
}
header('Location: fiche.php?id=' . $_GET['id']);
exit;
} else {
// Sinon on affiche le formulaire de demande avec le message d'erreur SQL
header('Location: fiche.php?id=' . $_GET['id'] . '&error=SQL_Create&msg=' . $cp->error);
exit;
示例15: send
/**
* Check if notification are active for couple action/company.
* If yes, send mail and save trace into llx_notify.
*
* @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param Object $object Object the notification deals on
* @return int <0 if KO, or number of changes if OK
*/
function send($notifcode, $object)
{
global $user, $conf, $langs, $mysoc, $dolibarr_main_url_root;
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
dol_syslog(get_class($this) . "::send notifcode=" . $notifcode . ", object=" . $object->id);
$langs->load("other");
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
// This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Define some vars
$application = $mysoc->name;
//if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $application = $conf->global->MAIN_APPLICATION_TITLE;
$replyto = $conf->notification->email_from;
$filename = basename($file);
$mimefile = dol_mimetype($file);
$object_type = '';
$link = '';
$num = 0;
if (!in_array($notifcode, array('BILL_VALIDATE', 'ORDER_VALIDATE', 'PROPAL_VALIDATE', 'FICHINTER_VALIDATE', 'ORDER_SUPPLIER_VALIDATE', 'ORDER_SUPPLIER_APPROVE', 'ORDER_SUPPLIER_REFUSE', 'SHIPPING_VALIDATE'))) {
return 0;
}
$oldref = empty($object->oldref) ? $object->ref : $object->oldref;
$newref = empty($object->newref) ? $object->ref : $object->newref;
// Check notification per third party
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
$sql .= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
$sql .= " FROM " . MAIN_DB_PREFIX . "socpeople as c,";
$sql .= " " . MAIN_DB_PREFIX . "c_action_trigger as a,";
$sql .= " " . MAIN_DB_PREFIX . "notify_def as n,";
$sql .= " " . MAIN_DB_PREFIX . "societe as s";
$sql .= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql .= " AND n.fk_soc = s.rowid";
if (is_numeric($notifcode)) {
$sql .= " AND n.fk_action = " . $notifcode;
} else {
$sql .= " AND a.code = '" . $notifcode . "'";
}
// New usage
$sql .= " AND s.rowid = " . $object->socid;
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
if ($num > 0) {
$i = 0;
while ($i < $num && !$error) {
$obj = $this->db->fetch_object($result);
$sendto = dolGetFirstLastname($obj->firstname, $obj->lastname) . " <" . $obj->email . ">";
$notifcodedefid = $obj->adid;
if (dol_strlen($obj->email)) {
// Set output language
$outputlangs = $langs;
if ($obj->default_lang && $obj->default_lang != $langs->defaultlang) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($obj->default_lang);
}
switch ($notifcode) {
case 'BILL_VALIDATE':
$link = '/compta/facture.php?facid=' . $object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated", $newref);
break;
case 'ORDER_VALIDATE':
$link = '/commande/card.php?id=' . $object->id;
$dir_output = $conf->commande->dir_output;
$object_type = 'order';
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated", $newref);
break;
case 'PROPAL_VALIDATE':
$link = '/comm/propal.php?id=' . $object->id;
$dir_output = $conf->propal->dir_output;
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated", $newref);
break;
case 'FICHINTER_VALIDATE':
$link = '/fichinter/card.php?id=' . $object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated", $object->ref);
break;
case 'ORDER_SUPPLIER_VALIDATE':
$link = '/fourn/commande/card.php?id=' . $object->id;
$dir_output = $conf->fournisseur->dir_output . '/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello") . ",\n\n";
$mesg .= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $object->ref, $user->getFullName($langs));
$mesg .= "\n\n" . $langs->transnoentitiesnoconv("Sincerely") . ".\n\n";
break;
case 'ORDER_SUPPLIER_APPROVE':
$link = '/fourn/commande/card.php?id=' . $object->id;
//.........这里部分代码省略.........