本文整理汇总了PHP中dol_nl2br函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_nl2br函数的具体用法?PHP dol_nl2br怎么用?PHP dol_nl2br使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dol_nl2br函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GenericObject
}
if (!$error) {
if (isset($object) && !is_object($object) || empty($savemethod)) {
$object = new GenericObject($db);
}
// Specific for add_object_linked()
// TODO add a function for variable treatment
$object->ext_fk_element = $newvalue;
$object->ext_element = $ext_element;
$object->fk_element = $fk_element;
$object->element = $element;
$ret = $object->{$savemethodname}($field, $newvalue, $table_element, $fk_element, $format);
if ($ret > 0) {
if ($type == 'numeric') {
$value = price($newvalue);
} else {
if ($type == 'textarea') {
$value = dol_nl2br($newvalue);
}
}
$return['value'] = $value;
$return['view'] = !empty($view) ? $view : $value;
} else {
$return['error'] = $object->error;
}
}
echo json_encode($return);
} else {
echo $langs->trans('NotEnoughPermissions');
}
}
示例2: dol_trunc
print '<td>';
$contractstatic->id = $obj->cid;
$contractstatic->ref = $obj->ref ? $obj->ref : $obj->cid;
print $contractstatic->getNomUrl(1, 16);
print '</td>';
// Service
print '<td>';
if ($obj->pid) {
$productstatic->id = $obj->pid;
$productstatic->type = $obj->ptype;
$productstatic->ref = $obj->pref;
$productstatic->entity = $obj->pentity;
print $productstatic->getNomUrl(1, '', 20);
print $obj->label ? ' - ' . dol_trunc($obj->label, 16) : '';
if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) {
print '<br>' . dol_nl2br($obj->description);
}
} else {
if ($obj->type == 0) {
print img_object($obj->description, 'product') . dol_trunc($obj->description, 20);
}
if ($obj->type == 1) {
print img_object($obj->description, 'service') . dol_trunc($obj->description, 20);
}
}
print '</td>';
// Third party
print '<td>';
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = 1;
示例3: dol_htmlentitiesbr
/**
* This function is called to encode a string into a HTML string but differs from htmlentities because
* all entities but &,<,> are converted. This permits to encode special chars to entities with no double
* encoding for already encoded HTML strings.
* This function also remove last CR/BR.
* For PDF usage, you can show text by 2 ways:
* - writeHTMLCell -> param must be encoded into HTML.
* - MultiCell -> param must not be encoded into HTML.
* Because writeHTMLCell convert also \n into <br>, if function
* is used to build PDF, nl2brmode must be 1
*
* @param string $stringtoencode String to encode
* @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br (for use with FPDF writeHTMLCell function for example)
* @param string $pagecodefrom Pagecode stringtoencode is encoded
* @return string String encoded
*/
function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UTF-8')
{
if (dol_textishtml($stringtoencode)) {
$newstring = $stringtoencode;
$newstring = preg_replace('/<br(\\s[\\sa-zA-Z_="]*)?\\/?>/i', '<br>', $newstring);
// Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF.
$newstring = preg_replace('/<br>$/i', '', $newstring);
// Remove last <br>
$newstring = strtr($newstring, array('&' => '__and__', '<' => '__lt__', '>' => '__gt__', '"' => '__dquot__'));
$newstring = dol_htmlentities($newstring, ENT_COMPAT, $pagecodefrom);
// Make entity encoding
$newstring = strtr($newstring, array('__and__' => '&', '__lt__' => '<', '__gt__' => '>', '__dquot__' => '"'));
//$newstring=strtr($newstring,array('__li__'=>"<li>\n")); // Restore <li>\n
} else {
$newstring = dol_nl2br(dol_htmlentities($stringtoencode, ENT_COMPAT, $pagecodefrom), $nl2brmode);
}
// Other substitutions that htmlentities does not do
//$newstring=str_replace(chr(128),'€',$newstring); // 128 = 0x80. Not in html entity table. // Seems useles with TCPDF. Make bug with UTF8 languages
return $newstring;
}
示例4: dol_nl2br
print '<td>';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) {
print $form->select_dolusers($task_time->fk_user, 'userid_line');
} else {
$userstatic->id = $task_time->fk_user;
$userstatic->lastname = $task_time->lastname;
$userstatic->firstname = $task_time->firstname;
print $userstatic->getNomUrl(1);
}
print '</td>';
// Note
print '<td align="left">';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) {
print '<textarea name="timespent_note_line" cols="80" rows="' . ROWS_3 . '">' . $task_time->note . '</textarea>';
} else {
print dol_nl2br($task_time->note);
}
print '</td>';
// Time spent
print '<td align="right">';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) {
print '<input type="hidden" name="old_duration" value="' . $task_time->task_duration . '">';
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
} else {
print convertSecondToTime($task_time->task_duration, 'allhourmin');
}
print '</td>';
// Edit and delete icon
print '<td align="center" valign="middle" width="80">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
print '<input type="hidden" name="lineid" value="' . $_GET['lineid'] . '">';
示例5: assign_values
//.........这里部分代码省略.........
}
// VAT
$this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value', $this->tpl['tva_assuj'], 1);
// Assujeti par defaut en creation
// Select users
$this->tpl['select_users'] = $form->select_dolusers($this->object->commercial_id, 'commercial_id', 1);
// 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><td>';
$this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1);
$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) {
示例6: img_picto
$tmpecmdir=0;
}
$i++;
}
print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
print $s;
print '</td></tr>';
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
if ($_GET["action"] == 'edit')
{
print '<textarea class="flat" name="description" cols="80">';
print $ecmdir->description;
print '</textarea>';
}
else print dol_nl2br($ecmdir->description);
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMCreationUser").'</td><td>';
$userecm=new User($db);
$userecm->fetch($ecmdir->fk_user_c);
print $userecm->getNomUrl(1);
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMCreationDate").'</td><td>';
print dol_print_date($ecmdir->date_c,'dayhour');
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
print '/ecm/'.$relativepath;
print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>';
print sizeof($filearray);
print '</td></tr>';
示例7: dol_buildpath
print '<img src="' . dol_buildpath('/opensurvey/img/medaille.png', 1) . '"> ' . $langs->trans('TheBestChoices') . ": <b>" . $meilleursujet . "</b> " . $langs->trans('with') . " <b>{$meilleurecolonne} </b>" . $vote_str . ".\n";
}
print '</p><br>' . "\n";
}
}
print '<br>';
// Comment list
$comments = $object->getComments();
if ($comments) {
print "<br><b>" . $langs->trans("CommentsOfVoters") . ":</b><br>\n";
foreach ($comments as $obj) {
print '<div class="comment"><span class="usercomment">';
if (in_array($obj->usercomment, $listofvoters)) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?deletecomment=' . $obj->id_comment . '&sondage=' . $numsondage . '"> ' . img_picto('', 'delete.png') . '</a> ';
}
print dol_htmlentities($obj->usercomment) . ':</span> <span class="comment">' . dol_nl2br(dol_htmlentities($obj->comment)) . "</span></div>";
}
}
// Form to add comment
if ($object->allow_comments) {
print '<div class="addcomment">' . $langs->trans("AddACommentForPoll") . "<br>\n";
print '<textarea name="comment" rows="2" cols="60"></textarea><br>' . "\n";
print $langs->trans("Name") . ': ';
print '<input type="text" name="commentuser" maxlength="64" /> ' . "\n";
print '<input type="submit" class="button" name="ajoutcomment" value="' . dol_escape_htmltag($langs->trans("AddComment")) . '"><br>' . "\n";
print '</form>' . "\n";
print '</div>' . "\n";
// div add comment
}
print '<br><br>';
print '<a name="bas"></a>' . "\n";
示例8: get_form
//.........这里部分代码省略.........
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="' . $langs->trans("Upload") . '" />';
$out .= ' ';
$out .= '<input type="submit" class="button" id="' . $addfileaction . '" name="' . $addfileaction . '" value="' . $langs->trans("MailingAddFile") . '" />';
}
} else {
$out .= $this->withfile;
}
$out .= "</td></tr>\n";
}
// Message
if (!empty($this->withbody)) {
$defaultmessage = "";
if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['content']) {
$defaultmessage = $arraydefaultmessage['content'];
} elseif (!is_numeric($this->withbody)) {
$defaultmessage = $this->withbody;
}
// Complete substitution array
if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) {
require_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
$langs->load('paypal');
if ($this->param["models"] == 'order_send') {
$url = getPaypalPaymentUrl(0, 'order', $this->substit['__ORDERREF__']);
$this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
}
if ($this->param["models"] == 'facture_send') {
$url = getPaypalPaymentUrl(0, 'invoice', $this->substit['__FACREF__']);
$this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url));
}
}
$defaultmessage = str_replace('\\n', "\n", $defaultmessage);
// Deal with format differences between message and signature (text / HTML)
if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
$this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
} else {
if (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
}
if (isset($_POST["message"]) && !$_POST['modelselected']) {
$defaultmessage = $_POST["message"];
} else {
$defaultmessage = make_substitutions($defaultmessage, $this->substit);
// Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty)
$defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage);
$defaultmessage = preg_replace("/^\n+/", "", $defaultmessage);
}
$out .= '<tr>';
$out .= '<td width="180" valign="top">' . $langs->trans("MailText") . '</td>';
$out .= '<td>';
if ($this->withbodyreadonly) {
$out .= nl2br($defaultmessage);
$out .= '<input type="hidden" id="message" name="message" value="' . $defaultmessage . '" />';
} else {
if (!isset($this->ckeditortoolbar)) {
$this->ckeditortoolbar = 'dolibarr_notes';
}
// Editor wysiwyg
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
if ($this->withfckeditor == -1) {
if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
$this->withfckeditor = 1;
} else {
$this->withfckeditor = 0;
}
}
示例9: show_contacts
//.........这里部分代码省略.........
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>';
// Add to agenda
if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
print '<td align="center">';
示例10: editInPlace
/**
* Output edit in place form
*
* @param object $object Object
* @param string $value Value to show/edit
* @param string $htmlname DIV ID (field name)
* @param int $condition Condition to edit
* @param string $inputType Type of input ('numeric', 'datepicker', 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx')
* @param string $editvalue When in edit mode, use this value as $value instead of value
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @return string HTML edit in place
*/
private function editInPlace($object, $value, $htmlname, $condition, $inputType = 'textarea', $editvalue = null, $extObject = null, $custommsg = null)
{
global $conf;
$out = '';
// Check parameters
if ($inputType == 'textarea') {
$value = dol_nl2br($value);
} else {
if (preg_match('/^numeric/', $inputType)) {
$value = price($value);
} else {
if ($inputType == 'datepicker') {
$value = dol_print_date($value, 'day');
}
}
}
if ($condition) {
$element = false;
$table_element = false;
$fk_element = false;
$loadmethod = false;
$savemethod = false;
$ext_element = false;
$button_only = false;
if (is_object($object)) {
$element = $object->element;
$table_element = $object->table_element;
$fk_element = $object->id;
}
if (is_object($extObject)) {
$ext_element = $extObject->element;
}
if (preg_match('/^(string|email|numeric)/', $inputType)) {
$tmp = explode(':', $inputType);
$inputType = $tmp[0];
if (!empty($tmp[1])) {
$inputOption = $tmp[1];
}
if (!empty($tmp[2])) {
$savemethod = $tmp[2];
}
} else {
if (preg_match('/^datepicker/', $inputType) || preg_match('/^datehourpicker/', $inputType)) {
$tmp = explode(':', $inputType);
$inputType = $tmp[0];
if (!empty($tmp[1])) {
$inputOption = $tmp[1];
}
if (!empty($tmp[2])) {
$savemethod = $tmp[2];
}
$out .= '<input id="timestamp" type="hidden"/>' . "\n";
// Use for timestamp format
} else {
if (preg_match('/^(select|autocomplete)/', $inputType)) {
$tmp = explode(':', $inputType);
$inputType = $tmp[0];
$loadmethod = $tmp[1];
if (!empty($tmp[2])) {
$savemethod = $tmp[2];
}
if (!empty($tmp[3])) {
$button_only = true;
}
} else {
if (preg_match('/^textarea/', $inputType)) {
$tmp = explode(':', $inputType);
$inputType = $tmp[0];
$rows = empty($tmp[1]) ? '8' : $tmp[1];
$cols = empty($tmp[2]) ? '80' : $tmp[2];
} else {
if (preg_match('/^ckeditor/', $inputType)) {
$tmp = explode(':', $inputType);
$inputType = $tmp[0];
$toolbar = $tmp[1];
if (!empty($tmp[2])) {
$width = $tmp[2];
}
if (!empty($tmp[3])) {
$heigth = $tmp[3];
}
if (!empty($tmp[4])) {
$savemethod = $tmp[4];
}
if (!empty($conf->fckeditor->enabled)) {
$out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n";
} else {
//.........这里部分代码省略.........
示例11: dol_print_date
print '</td>';
print '</tr>';
// Date
print '<tr><td width="25%">' . $langs->trans("Date") . '</td><td colspan="2">';
print dol_print_date($object->date, "day");
print "</td>";
print '<tr><td>' . $langs->trans("Amount") . '</td><td colspan="2">';
print price($object->amount, 0, $langs, 0, 0, -1, $conf->currency);
print '</td></tr>';
print '<tr><td>' . $langs->trans("PublicDonation") . '</td><td colspan="2">';
print yn($object->public);
print '</td></tr>';
print '<tr><td>' . $langs->trans("Company") . '</td><td colspan="2">' . $object->societe . '</td></tr>';
print '<tr><td>' . $langs->trans("Lastname") . '</td><td colspan="2">' . $object->lastname . '</td></tr>';
print '<tr><td>' . $langs->trans("Firstname") . '</td><td colspan="2">' . $object->firstname . '</td></tr>';
print '<tr><td>' . $langs->trans("Address") . '</td><td>' . dol_nl2br($object->address) . '</td>';
$rowspan = 6;
if (!empty($conf->projet->enabled)) {
$rowspan++;
}
print '<td rowspan="' . $rowspan . '" valign="top">';
/*
* Payments
*/
$sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,";
$sql .= "c.code as type_code,c.libelle as paiement_type";
$sql .= " FROM " . MAIN_DB_PREFIX . "payment_donation as p";
$sql .= ", " . MAIN_DB_PREFIX . "c_paiement as c ";
$sql .= ", " . MAIN_DB_PREFIX . "don as d";
$sql .= " WHERE d.rowid = '" . $id . "'";
$sql .= " AND p.fk_donation = d.rowid";
示例12: require_once
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td>';
print '<td valign="top">';
if ($action == 'edit' && $user->rights->societe->creer)
{
print '<input type="hidden" name="action" value="add" />';
print '<input type="hidden" name="socid" value="'.$object->id.'" />';
// Editeur wysiwyg
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('note',$object->note,'',360,'dolibarr_notes','In',true,false,$conf->global->FCKEDITOR_ENABLE_SOCIETE,20,70);
$doleditor->Create();
}
else
{
print dol_textishtml($object->note)?$object->note:dol_nl2br($object->note,1,true);
}
print "</td></tr>";
$var=!$var;
print "</table>";
if ($action == 'edit')
{
print '<center><br>';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print ' ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</center>';
}
示例13: dol_concatdesc
/**
* Concat 2 descriptions (second one after first one with a new line separator if required)
* text1 html + text2 html => text1 + '<br>' + text2
* text1 html + text2 txt => text1 + '<br>' + dol_nl2br(text2)
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
* text1 txt + text2 txt => text1 + '\n' + text2
*
* @param string $text1 Text 1
* @param string $text2 Text 2
* @param bool $forxml false=Use <br>, true=Use <br />
* @return string Text 1 + new line + Text2
* @see dol_textishtml
*/
function dol_concatdesc($text1, $text2, $forxml = false)
{
$ret = '';
$ret .= !dol_textishtml($text1) && dol_textishtml($text2) ? dol_nl2br($text1, 0, $forxml) : $text1;
$ret .= !empty($text1) && !empty($text2) ? dol_textishtml($text1) || dol_textishtml($text2) ? $forxml ? "<br \\>\n" : "<br>\n" : "\n" : "";
$ret .= dol_textishtml($text1) && !dol_textishtml($text2) ? dol_nl2br($text2, 0, $forxml) : $text2;
return $ret;
}
示例14: beforePDFCreation
function beforePDFCreation(&$parameters, &$object, &$action, $hookmanager)
{
global $conf, $user, $langs, $db, $mysoc;
// Sur version 5.0 le $parameters['currentcontext'] == ordersuppliercard et le "pdfgeneration" est dans $parameters['context']
$TContext = explode(':', $parameters['context']);
if ($parameters['currentcontext'] === 'pdfgeneration' || in_array('pdfgeneration', $TContext)) {
$base_object = $parameters['object'];
if (isset($base_object) && in_array($base_object->element, array('order_supplier', 'commande'))) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
$parameters['outputlangs']->load('deliveries');
$parameters['outputlangs']->load('orders');
$usecommande = $usecontact = false;
// Load des contacts livraison
$arrayidcontact = $base_object->getIdContact('external', 'SHIPPING');
if (count($arrayidcontact) > 0) {
$usecontact = true;
$base_object->fetch_contact($arrayidcontact[0]);
}
$base_object->fetchObjectLinked();
$Qwrite = false;
if (isset($base_object->linkedObjects['commande']) && !empty($conf->global->GRAPEFRUIT_SUPPLIER_CONTACT_SHIP_ADDRESS)) {
// On récupère la donnée de la commande initiale
// C'est un tableau basé sur des ID donc on boucle pour sortir le premier item
$commande = reset($base_object->linkedObjects['commande']);
$date_affiche = date("Y-m-d", $commande->date);
$ref = $commande->ref;
$ref_client = $commande->ref_client;
$usecommande = $Qwrite = true;
} elseif ($base_object->element === 'commande' && !empty($conf->global->GRAPEFRUIT_ORDER_CONTACT_SHIP_ADDRESS)) {
$date_affiche = date("Y-m-d", $base_object->date);
$ref = $base_object->ref;
$ref_client = $base_object->ref_client;
$usecommande = $Qwrite = true;
}
if ($usecontact && $Qwrite) {
//Recipient name
// On peut utiliser le nom de la societe du contact
$thirdparty = $base_object->thirdparty;
if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $base_object->contact;
}
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $parameters['outputlangs']);
$thecontact = $base_object->contact;
// SI un élément manquant ou qu'on veuille envoyé à la société du contact alors on change
if (empty($thecontact->address) || empty($thecontact->zip) || empty($thecontact->town)) {
$contactSociete = new Societe($db);
$contactSociete->fetch($thecontact->socid);
$thecontact->address = $contactSociete->address;
$thecontact->zip = $contactSociete->zip;
$thecontact->town = $contactSociete->town;
}
$carac_client = pdf_build_address($parameters['outputlangs'], $object->emetteur, $base_object->client, $base_object->contact, $usecontact, 'target');
$newcontent = $parameters['outputlangs']->trans('DeliveryAddress') . ' :' . "\n" . '<strong>' . $carac_client_name . '</strong>' . "\n" . $carac_client;
if ($usecommande) {
if (isset($ref_client)) {
$newcontent .= "\n" . "<strong>" . $parameters['outputlangs']->trans('RefOrder') . ' client : </strong>' . $ref_client;
}
$newcontent .= "\n" . "<strong>" . $parameters['outputlangs']->trans('RefOrder') . ' ' . $mysoc->name . ' : </strong>' . $ref;
$newcontent .= "\n" . "<strong>" . $parameters['outputlangs']->trans('OrderDate') . ' : </strong>' . $date_affiche;
}
if (!empty($parameters['object']->note_public)) {
$parameters['object']->note_public = dol_nl2br($newcontent . "\n\n" . $parameters['object']->note_public);
} else {
$parameters['object']->note_public = dol_nl2br($newcontent);
}
}
}
// Fin order / order_supplier
}
}
示例15: if
else
{
print ' ';
}
print "</td></tr>\n";
}
// Custom code
print '<tr><td>'.$langs->trans("CustomCode").'</td><td colspan="2">'.$product->customcode.'</td>';
// Origin country code
print '<tr><td>'.$langs->trans("CountryOrigin").'</td><td colspan="2">'.getCountry($product->country_id,0,$db).'</td>';
// Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="2">'.(dol_textishtml($product->note)?$product->note:dol_nl2br($product->note,1,true)).'</td></tr>';
print "</table>\n";
}
else
{
$canvas->assign_values('view');
$canvas->display_canvas();
}
dol_fiche_end();
}
}
else if ($action != 'create')
{