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


PHP dol_concatdesc函数代码示例

本文整理汇总了PHP中dol_concatdesc函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_concatdesc函数的具体用法?PHP dol_concatdesc怎么用?PHP dol_concatdesc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dol_concatdesc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: write_file


//.........这里部分代码省略.........
             }
             $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
             // Left, Top, Right
             // Positionne $this->atleastonediscount si on a au moins une remise
             for ($i = 0; $i < $nblignes; $i++) {
                 if ($object->lines[$i]->remise_percent) {
                     $this->atleastonediscount++;
                 }
             }
             // New page
             $pdf->AddPage();
             if (!empty($tplidx)) {
                 $pdf->useTemplate($tplidx);
             }
             $pagenb++;
             $this->_pagehead($pdf, $object, 1, $outputlangs);
             $pdf->SetFont('', '', $default_font_size - 1);
             $pdf->MultiCell(0, 3, '');
             // Set interline to 3
             $pdf->SetTextColor(0, 0, 0);
             $tab_top = 95;
             $tab_top_newpage = empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 95 : 10;
             $tab_height = 110;
             $tab_height_newpage = 110;
             // Show notes
             $notetoshow = empty($object->note_public) ? '' : $object->note_public;
             if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) {
                 // Get first sale rep
                 if (is_object($object->thirdparty)) {
                     $salereparray = $object->thirdparty->getSalesRepresentatives($user);
                     $salerepobj = new User($this->db);
                     $salerepobj->fetch($salereparray[0]['id']);
                     if (!empty($salerepobj->signature)) {
                         $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature);
                     }
                 }
             }
             if ($notetoshow) {
                 $tab_top = 95;
                 $pdf->SetFont('', '', $default_font_size - 1);
                 $pdf->writeHTMLCell(190, 3, $this->posxpiece - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
                 $nexY = $pdf->GetY();
                 $height_note = $nexY - $tab_top;
                 // Rect prend une longueur en 3eme param
                 $pdf->SetDrawColor(192, 192, 192);
                 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
                 $tab_height = $tab_height - $height_note;
                 $tab_top = $nexY + 6;
             } else {
                 $height_note = 0;
             }
             $iniY = $tab_top + 7;
             $curY = $tab_top + 7;
             $nexY = $tab_top + 7;
             // Loop on each lines
             for ($i = 0; $i < $nblignes; $i++) {
                 $piece_comptable = $i + 1;
                 $curY = $nexY;
                 $pdf->SetFont('', '', $default_font_size - 1);
                 // Into loop to work with multipage
                 $pdf->SetTextColor(0, 0, 0);
                 $pdf->setTopMargin($tab_top_newpage);
                 $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
                 // The only function to edit the bottom margin of current page to set it.
                 $pageposbefore = $pdf->getPage();
                 // Description of product line
开发者ID:Samara94,项目名称:dolibarr,代码行数:67,代码来源:pdf_standard.modules.php

示例2: write_file


//.........这里部分代码省略.........
             $pdf->MultiCell(0, 3, '');
             // Set interline to 3
             $pdf->SetTextColor(0, 0, 0);
             $tab_top = 90;
             $tab_top_newpage = empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10;
             $tab_height = 130;
             $tab_height_newpage = 150;
             // Incoterm
             $height_incoterms = 0;
             if ($conf->incoterm->enabled) {
                 $desc_incoterms = $object->getIncotermsForPDF();
                 if ($desc_incoterms) {
                     $tab_top = 88;
                     $pdf->SetFont('', '', $default_font_size - 1);
                     $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
                     $nexY = $pdf->GetY();
                     $height_incoterms = $nexY - $tab_top;
                     // Rect prend une longueur en 3eme param
                     $pdf->SetDrawColor(192, 192, 192);
                     $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
                     $tab_top = $nexY + 6;
                     $height_incoterms += 4;
                 }
             }
             // Affiche notes
             $notetoshow = empty($object->note_public) ? '' : $object->note_public;
             if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) {
                 // Get first sale rep
                 if (is_object($object->thirdparty)) {
                     $salereparray = $object->thirdparty->getSalesRepresentatives($user);
                     $salerepobj = new User($this->db);
                     $salerepobj->fetch($salereparray[0]['id']);
                     if (!empty($salerepobj->signature)) {
                         $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature);
                     }
                 }
             }
             if ($notetoshow) {
                 $tab_top = 88 + $height_incoterms;
                 $pdf->SetFont('', '', $default_font_size - 1);
                 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
                 $nexY = $pdf->GetY();
                 $height_note = $nexY - $tab_top;
                 // Rect prend une longueur en 3eme param
                 $pdf->SetDrawColor(192, 192, 192);
                 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
                 $tab_height = $tab_height - $height_note;
                 $tab_top = $nexY + 6;
             } else {
                 $height_note = 0;
             }
             $iniY = $tab_top + 7;
             $curY = $tab_top + 7;
             $nexY = $tab_top + 7;
             // Loop on each lines
             for ($i = 0; $i < $nblignes; $i++) {
                 $curY = $nexY;
                 $pdf->SetFont('', '', $default_font_size - 1);
                 // Into loop to work with multipage
                 $pdf->SetTextColor(0, 0, 0);
                 // Define size of image if we need it
                 $imglinesize = array();
                 if (!empty($realpatharray[$i])) {
                     $imglinesize = pdf_getSizeForImage($realpatharray[$i]);
                 }
                 $pdf->setTopMargin($tab_top_newpage);
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:67,代码来源:pdf_crabe.modules.php

示例3: write_file


//.........这里部分代码省略.........
             if ($object->duree > 0) {
                 $totaltime = convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
                 $text .= ($text ? ' - ' : '') . $langs->trans("Total") . ": " . $totaltime;
             }
             $desc = dol_htmlentitiesbr($text, 1);
             //print $outputlangs->convToOutputCharset($desc); exit;
             $pdf->writeHTMLCell(180, 3, 10, $tab_top + 5, $outputlangs->convToOutputCharset($desc), 0, 1);
             $nexY = $pdf->GetY();
             $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
             $nblines = count($object->lines);
             // Loop on each lines
             for ($i = 0; $i < $nblines; $i++) {
                 $objectligne = $object->lines[$i];
                 $valide = empty($objectligne->id) ? 0 : $objectligne->fetch($objectligne->id);
                 if ($valide > 0 || $object->specimen) {
                     $curY = $nexY;
                     $pdf->SetFont('', '', $default_font_size - 1);
                     // Into loop to work with multipage
                     $pdf->SetTextColor(0, 0, 0);
                     $pdf->setTopMargin($tab_top_newpage);
                     $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
                     // The only function to edit the bottom margin of current page to set it.
                     $pageposbefore = $pdf->getPage();
                     // Description of product line
                     $curX = $this->posxdesc - 1;
                     // Description of product line
                     $txt = $outputlangs->transnoentities("Date") . " : " . dol_print_date($objectligne->datei, 'dayhour', false, $outputlangs, true);
                     if ($objectligne->duration > 0) {
                         $txt .= " - " . $outputlangs->transnoentities("Duration") . " : " . convertSecondToTime($objectligne->duration);
                     }
                     $txt = '<strong>' . dol_htmlentitiesbr($txt, 1, $outputlangs->charset_output) . '</strong>';
                     $desc = dol_htmlentitiesbr($objectligne->desc, 1);
                     $pdf->startTransaction();
                     $pdf->writeHTMLCell(0, 0, $curX, $curY + 1, dol_concatdesc($txt, $desc), 0, 1, 0);
                     $pageposafter = $pdf->getPage();
                     if ($pageposafter > $pageposbefore) {
                         $pdf->rollbackTransaction(true);
                         $pageposafter = $pageposbefore;
                         //print $pageposafter.'-'.$pageposbefore;exit;
                         $pdf->setPageOrientation('', 1, $heightforfooter);
                         // The only function to edit the bottom margin of current page to set it.
                         $pdf->writeHTMLCell(0, 0, $curX, $curY, $txt . '<br>' . $desc, LR, 1, 0);
                         $pageposafter = $pdf->getPage();
                         $posyafter = $pdf->GetY();
                         //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
                         if ($posyafter > $this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)) {
                             if ($i == $nblines - 1) {
                                 $pdf->AddPage('', '', true);
                                 if (!empty($tplidx)) {
                                     $pdf->useTemplate($tplidx);
                                 }
                                 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
                                     $this->_pagehead($pdf, $object, 0, $outputlangs);
                                 }
                                 $pdf->setPage($pageposafter + 1);
                             }
                         }
                     } else {
                         $pdf->commitTransaction();
                     }
                     $nexY = $pdf->GetY();
                     $pageposafter = $pdf->getPage();
                     $pdf->setPage($pageposbefore);
                     $pdf->setTopMargin($this->marge_haute);
                     $pdf->setPageOrientation('', 1, 0);
                     // The only function to edit the bottom margin of current page to set it.
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:67,代码来源:pdf_soleil.modules.php

示例4: dol_concatdesc

     }
     $desc = dol_concatdesc($desc, $product_desc);
     // Add custom code and origin country into description
     if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
         $tmptxt = '(';
         if (!empty($prod->customcode)) {
             $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
         }
         if (!empty($prod->customcode) && !empty($prod->country_code)) {
             $tmptxt .= ' - ';
         }
         if (!empty($prod->country_code)) {
             $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
         }
         $tmptxt .= ')';
         $desc = dol_concatdesc($desc, $tmptxt);
     }
     $type = $prod->type;
     $fk_unit = $prod->fk_unit;
 } else {
     $pu_ht = price2num($price_ht, 'MU');
     $pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
     $tva_npr = preg_match('/\\*/', $tva_tx) ? 1 : 0;
     $tva_tx = str_replace('*', '', $tva_tx);
     $label = GETPOST('product_label') ? GETPOST('product_label') : '';
     $desc = $product_desc;
     $type = GETPOST('type');
     $fk_unit = GETPOST('units', 'alpha');
 }
 // Margin
 $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:facture.php

示例5: dol_concatdesc

 $deliveryreceipt = $_POST['deliveryreceipt'];
 if ($action == 'send') {
     if (dol_strlen($_POST['subject'])) {
         $subject = $_POST['subject'];
     } else {
         $subject = $langs->transnoentities('CustomerOrder') . ' ' . $object->ref;
     }
     $actiontypecode = 'AC_SUP_INV';
     $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
     if ($message) {
         if ($sendtocc) {
             $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
         }
         $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
         $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
         $actionmsg = dol_concatdesc($actionmsg, $message);
     }
     $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode);
 }
 // Create form object
 include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
 $formmail = new FormMail($db);
 $attachedfiles = $formmail->get_attached_files();
 $filepath = $attachedfiles['paths'];
 $filename = $attachedfiles['names'];
 $mimetype = $attachedfiles['mimes'];
 // Send mail
 require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
 $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
 if ($mailfile->error) {
     setEventMessages($mailfile->error, $mailfile->errors, 'errors');
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:card.php

示例6: price2num

                 $price_base_type = $prodcustprice->lines[0]->price_base_type;
                 $prod->tva_tx = $prodcustprice->lines[0]->tva_tx;
             }
         }
     }
     // On reevalue prix selon taux tva car taux tva transaction peut etre different
     // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
     if ($tva_tx != $prod->tva_tx) {
         if ($price_base_type != 'HT') {
             $pu_ht = price2num($pu_ttc / (1 + $tva_tx / 100), 'MU');
         } else {
             $pu_ttc = price2num($pu_ht * (1 + $tva_tx / 100), 'MU');
         }
     }
     $desc = $prod->description;
     $desc = dol_concatdesc($desc, $product_desc);
     $fk_unit = $prod->fk_unit;
 } else {
     $pu_ht = GETPOST('price_ht');
     $price_base_type = 'HT';
     $tva_tx = GETPOST('tva_tx') ? str_replace('*', '', GETPOST('tva_tx')) : 0;
     // tva_tx field may be disabled, so we use vat rate 0
     $tva_npr = preg_match('/\\*/', GETPOST('tva_tx')) ? 1 : 0;
     $desc = $product_desc;
     $fk_unit = GETPOST('units', 'alpha');
 }
 $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
 $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
 // ajout prix achat
 $fk_fournprice = $_POST['fournprice'];
 if (!empty($_POST['buying_price'])) {
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:card.php

示例7: addOrderLine

 /**
  * Adds a product to the order
  *
  * @param Commande $object Order object
  * @param Product $prod Product to add
  * @param int $qty Quantity of the product
  * @throws Exception
  */
 public static function addOrderLine(Commande $object, Product $prod, $qty)
 {
     global $db, $conf, $mysoc, $langs;
     require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
     $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
     $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
     if (!empty($conf->global->PRODUIT_MULTIPRICES) && !empty($object->thirdparty->price_level)) {
         $pu_ht = $prod->multiprices[$object->thirdparty->price_level];
         $pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
         $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
         if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) {
             $tva_tx = $prod->multiprices_tva_tx[$object->thirdparty->price_level];
         }
         if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) {
             $tva_npr = $prod->multiprices_recuperableonly[$object->thirdparty->price_level];
         }
     } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
         require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
         $prodcustprice = new Productcustomerprice($db);
         $filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id);
         $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
         if ($result >= 0) {
             if (count($prodcustprice->lines) > 0) {
                 $pu_ht = price($prodcustprice->lines[0]->price);
                 $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
                 $price_base_type = $prodcustprice->lines[0]->price_base_type;
                 $prod->tva_tx = $prodcustprice->lines[0]->tva_tx;
             } else {
                 $pu_ht = $prod->price;
                 $pu_ttc = $prod->price_ttc;
                 $price_base_type = $prod->price_base_type;
             }
         } else {
             throw new Exception($prodcustprice->error);
         }
     } else {
         $pu_ht = $prod->price;
         $pu_ttc = $prod->price_ttc;
         $price_base_type = $prod->price_base_type;
     }
     // if price ht is forced (ie: calculated by margin rate and cost price)
     if (!empty($price_ht)) {
         $pu_ht = price2num($price_ht, 'MU');
         $pu_ttc = price2num($pu_ht * (1 + $tva_tx / 100), 'MU');
     } elseif ($tva_tx != $prod->tva_tx) {
         if ($price_base_type != 'HT') {
             $pu_ht = price2num($pu_ttc / (1 + $tva_tx / 100), 'MU');
         } else {
             $pu_ttc = price2num($pu_ht * (1 + $tva_tx / 100), 'MU');
         }
     }
     // Define output language
     if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
         $outputlangs = $langs;
         $newlang = '';
         if (empty($newlang) && GETPOST('lang_id')) {
             $newlang = GETPOST('lang_id');
         }
         if (empty($newlang)) {
             $newlang = $object->thirdparty->default_lang;
         }
         if (!empty($newlang)) {
             $outputlangs = new Translate("", $conf);
             $outputlangs->setDefaultLang($newlang);
         }
         $desc = !empty($prod->multilangs[$outputlangs->defaultlang]["description"]) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
     } else {
         $desc = $prod->description;
     }
     // Add custom code and origin country into description
     if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) {
         $tmptxt = '(';
         if (!empty($prod->customcode)) {
             $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
         }
         if (!empty($prod->customcode) && !empty($prod->country_code)) {
             $tmptxt .= ' - ';
         }
         if (!empty($prod->country_code)) {
             $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
         }
         $tmptxt .= ')';
         $desc = dol_concatdesc($desc, $tmptxt);
     }
     //3.9.0 version added support for price units
     if (versioncompare(versiondolibarrarray(), array(3, 9, 0)) >= 0) {
         $fk_unit = $prod->fk_unit;
     } else {
         $fk_unit = null;
     }
     // Local Taxes
     $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
//.........这里部分代码省略.........
开发者ID:marcosgdf,项目名称:dolibarr-importorderlines,代码行数:101,代码来源:Utils.php

示例8: send


//.........这里部分代码省略.........
                             $object_type = 'order_supplier';
                             $mesg = $langs->transnoentitiesnoconv("Hello") . ",\n\n";
                             $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $newref, $user->getFullName($langs));
                             $mesg .= "\n\n" . $langs->transnoentitiesnoconv("Sincerely") . ".\n\n";
                             break;
                         case 'ORDER_SUPPLIER_REFUSE':
                             $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("EMailTextOrderRefusedBy", $newref, $user->getFullName($langs));
                             $mesg .= "\n\n" . $langs->transnoentitiesnoconv("Sincerely") . ".\n\n";
                             break;
                         case 'SHIPPING_VALIDATE':
                             $dir_output = $conf->expedition->dir_output . '/sending/';
                             $object_type = 'order_supplier';
                             $mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
                             break;
                     }
                     $ref = dol_sanitizeFileName($newref);
                     $pdf_path = $dir_output . "/" . $ref . "/" . $ref . ".pdf";
                     if (!dol_is_file($pdf_path)) {
                         // We can't add PDF as it is not generated yet.
                         $filepdf = '';
                     } else {
                         $filepdf = $pdf_path;
                     }
                     $subject = '[' . $application . '] ' . $outputlangs->transnoentitiesnoconv("DolibarrNotification");
                     $message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name) . "\n";
                     $message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name) . "\n";
                     $message .= "\n";
                     $message .= $mesg;
                     if ($link) {
                         $message = dol_concatdesc($message, $urlwithroot . $link);
                     }
                     $mailfile = new CMailFile($subject, $sendto, $replyto, $message, array($file), array($mimefile), array($filename[count($filename) - 1]), '', '', 0, -1);
                     if ($mailfile->sendfile()) {
                         $sql = "INSERT INTO " . MAIN_DB_PREFIX . "notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
                         $sql .= " VALUES ('" . $this->db->idate(dol_now()) . "', " . $notifcodedefid . ", " . $object->socid . ", " . $obj->cid . ", '" . $obj->type . "', '" . $object_type . "', " . $object->id . ", '" . $this->db->escape($obj->email) . "')";
                         if (!$this->db->query($sql)) {
                             dol_print_error($this->db);
                         }
                     } else {
                         $error++;
                         $this->errors[] = $mailfile->error;
                     }
                 } else {
                     dol_syslog("No notification sent for " . $sendto . " because email is empty");
                 }
                 $i++;
             }
         } else {
             dol_syslog("No notification to thirdparty sent, nothing into notification setup for the thirdparty socid = " . $object->socid);
         }
     } else {
         $error++;
         $this->errors[] = $this->db->lasterror();
         return -1;
     }
     // Check notification using fixed email
     if (!$error) {
         foreach ($conf->global as $key => $val) {
             if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_' . $notifcode . '_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) {
                 continue;
             }
             $threshold = (double) $reg[1];
开发者ID:Samara94,项目名称:dolibarr,代码行数:67,代码来源:notify.class.php

示例9: 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 {
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:email_expire_services_to_representatives.php

示例10: doc_getlinedesc

/**
 *  Return line description translated in outputlangs and encoded into UTF8
 *
 *  @param  Line		$line                Current line number (0 = first line, 1 = second line, ...)
 *  @param  Translate	$outputlangs         Object langs for output
 *  @param  int			$hideref             Hide reference
 *  @param  int			$hidedesc            Hide description
 *  @param  int			$issupplierline      Is it a line for a supplier object ?
 *  @return string       				     String with line
 */
function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issupplierline = 0)
{
    global $db, $conf, $langs;
    $idprod = $line->fk_product;
    $label = !empty($line->label) ? $line->label : (!empty($line->libelle) ? $line->libelle : '');
    $desc = !empty($line->desc) ? $line->desc : (!empty($line->description) ? $line->description : '');
    $ref_supplier = !empty($line->ref_supplier) ? $line->ref_supplier : (!empty($line->ref_fourn) ? $line->ref_fourn : '');
    // TODO Not yet saved for supplier invoices, only supplier orders
    $note = !empty($line->note) ? $line->note : '';
    if ($issupplierline) {
        $prodser = new ProductFournisseur($db);
    } else {
        $prodser = new Product($db);
    }
    if ($idprod) {
        $prodser->fetch($idprod);
        // If a predefined product and multilang and on other lang, we renamed label with label translated
        if (!empty($conf->global->MAIN_MULTILANGS) && $outputlangs->defaultlang != $langs->defaultlang) {
            if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) {
                $label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
            }
            if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) {
                $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"];
            }
            if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) {
                $note = $prodser->multilangs[$outputlangs->defaultlang]["note"];
            }
        }
    }
    // Description short of product line
    $libelleproduitservice = $label;
    // Description long of product line
    if ($desc && $desc != $label) {
        if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except) {
            $discount = new DiscountAbsolute($db);
            $discount->fetch($line->fk_remise_except);
            $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $discount->ref_facture_source);
        } elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except) {
            $discount = new DiscountAbsolute($db);
            $discount->fetch($line->fk_remise_except);
            $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $discount->ref_facture_source);
            // Add date of deposit
            if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) {
                $libelleproduitservice .= ' (' . dol_print_date($discount->datec, 'day', '', $outputlangs) . ')';
            }
        } else {
            if ($idprod) {
                if (empty($hidedesc)) {
                    $libelleproduitservice = dol_concatdesc($libelleproduitservice, $desc);
                }
            } else {
                $libelleproduitservice = dol_concatdesc($libelleproduitservice, $desc);
            }
        }
    }
    // If line linked to a product
    if ($idprod) {
        // On ajoute la ref
        if ($prodser->ref) {
            $prefix_prodserv = "";
            $ref_prodserv = "";
            if (!empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) {
                if ($prodser->isService()) {
                    $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service") . " ";
                } else {
                    $prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product") . " ";
                }
            }
            if (empty($hideref)) {
                if ($issupplierline) {
                    $ref_prodserv = $prodser->ref . ' (' . $outputlangs->trans("SupplierRef") . ' ' . $ref_supplier . ')';
                } else {
                    $ref_prodserv = $prodser->ref;
                }
                // Show local ref only
                $ref_prodserv .= " - ";
            }
            $libelleproduitservice = $prefix_prodserv . $ref_prodserv . $libelleproduitservice;
        }
    }
    if (!empty($line->date_start) || !empty($line->date_end)) {
        $format = 'day';
        // Show duration if exists
        if ($line->date_start && $line->date_end) {
            $period = '(' . $outputlangs->transnoentitiesnoconv('DateFromTo', dol_print_date($line->date_start, $format, false, $outputlangs), dol_print_date($line->date_end, $format, false, $outputlangs)) . ')';
        }
        if ($line->date_start && !$line->date_end) {
            $period = '(' . $outputlangs->transnoentitiesnoconv('DateFrom', dol_print_date($line->date_start, $format, false, $outputlangs)) . ')';
        }
        if (!$line->date_start && $line->date_end) {
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:doc.lib.php

示例11: dol_print_date

$value_private = $object->note_private;
if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES)) {
    $stringtoadd = dol_print_date(dol_now(), 'dayhour') . ' ' . $user->getFullName($langs) . ' --';
    if (GETPOST('action') == 'edit' . $note_public) {
        $value_public = dol_concatdesc($value_public, ($value_public ? "\n" : "") . "-- " . $stringtoadd);
        if (dol_textishtml($value_public)) {
            $value_public .= "<br>\n";
        } else {
            $value_public .= "\n";
        }
    }
}
if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) {
    $stringtoadd = dol_print_date(dol_now(), 'dayhour') . ' ' . $user->getFullName($langs) . ' --';
    if (GETPOST('action') == 'edit' . $note_private) {
        $value_private = dol_concatdesc($value_private, ($value_private ? "\n" : "") . "-- " . $stringtoadd);
        if (dol_textishtml($value_private)) {
            $value_private .= "<br>\n";
        } else {
            $value_private .= "\n";
        }
    }
}
// Special cases
if ($module == 'propal') {
    $permission = $user->rights->propale->creer;
} elseif ($module == 'fichinter') {
    $permission = $user->rights->ficheinter->creer;
} elseif ($module == 'project') {
    $permission = $user->rights->projet->creer;
} elseif ($module == 'project_task') {
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:31,代码来源:notes.tpl.php

示例12: Translate

         //if (empty($newemail)) print "Warning: Customer ".$target." has no email. Notice disabled.\n";
     }
     // Define line content
     $outputlangs = new Translate('', $conf);
     $outputlangs->setDefaultLang(empty($obj->default_lang) ? $langs->defaultlang : $obj->default_lang);
     // By default language of customer
     $outputlangs->load("bills");
     $outputlangs->load("main");
     $outputlangs->load("contracts");
     $outputlangs->load("products");
     if (dol_strlen($newemail)) {
         $message .= $outputlangs->trans("Contract") . " " . $obj->ref . ": " . $outputlangs->trans("Service") . " " . dol_concatdesc($obj->plabel, $obj->description) . " (" . price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency) . "), " . $outputlangs->trans("DateEndPlannedShort") . " " . dol_print_date($db->jdate($obj->date_fin_validite), 'day') . "\n\n";
         dol_syslog("email_expire_services_to_customers.php: " . $newemail . " " . $message);
         $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') . ", customer id " . $obj->sid . " " . $obj->name . ", " . ($obj->cid ? "contact id " . $obj->cid . " " . $obj->clastname . " " . $obj->cfirstname . ", " : "") . "email " . $newemail . ", lang " . $outputlangs->defaultlang . ": ";
     if (dol_strlen($newemail)) {
         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' && empty($trackthirdpartiessent[$oldsid . '|' . $oldemail])) {
         envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget, $duration_value);
         $trackthirdpartiessent[$oldsid . '|' . $oldemail] = 'contact id ' . $oldcid;
开发者ID:Samara94,项目名称:dolibarr,代码行数:31,代码来源:email_expire_services_to_customers.php

示例13: _createEvent

function _createEvent(&$db, &$user, &$langs, &$conf, &$propal, $fk_socpeople, $subject, $message, $type = 'thirdparty')
{
    $actionmsg = $actionmsg2 = '';
    if ($type == 'thirdparty') {
        $sendto = $propal->thirdparty->email;
    } else {
        $sendto = $propal->thirdparty->contact_get_property((int) $fk_socpeople, 'email');
    }
    $actionmsg2 = $langs->transnoentities('MailSentBy') . ' <' . $user->email . '> ' . $langs->transnoentities('To') . ' ' . $sendto;
    if ($message) {
        $actionmsg = $langs->transnoentities('MailSentBy') . ' <' . $user->email . '> ' . $langs->transnoentities('To') . ' ' . $sendto;
        $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
        $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
        $actionmsg = dol_concatdesc($actionmsg, $message);
    }
    // Initialisation donnees
    $propal->socid = $propal->thirdparty->id;
    // To link to a company
    $propal->sendtoid = $fk_socpeople;
    // To link to a contact/address
    $propal->actiontypecode = 'AC_PROP';
    $propal->actionmsg = $actionmsg;
    // Long text
    $propal->actionmsg2 = $actionmsg2;
    // Short text
    $propal->fk_element = $propal->id;
    $propal->elementtype = $propal->element;
    // Appel des triggers
    $interface = new Interfaces($db);
    $result = $interface->run_triggers('PROPAL_SENTBYMAIL', $propal, $user, $langs, $conf);
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_propalautosend,代码行数:31,代码来源:propalAutoSend.php

示例14: testDolConcat

 /**
  * testDolConcat
  *
  * @return boolean
  */
 public function testDolConcat()
 {
     $text1 = "A string 1";
     $text2 = "A string 2";
     // text 1 and 2 are text, concat need only \n
     $after = dol_concatdesc($text1, $text2);
     $this->assertEquals("A string 1\nA string 2", $after);
     $text1 = "A<br>string 1";
     $text2 = "A string 2";
     // text 1 is html, concat need <br>\n
     $after = dol_concatdesc($text1, $text2);
     $this->assertEquals("A<br>string 1<br>\nA string 2", $after);
     $text1 = "A string 1";
     $text2 = "A <b>string</b> 2";
     // text 2 is html, concat need <br>\n
     $after = dol_concatdesc($text1, $text2);
     $this->assertEquals("A string 1<br>\nA <b>string</b> 2", $after);
     return true;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:24,代码来源:FunctionsLibTest.php

示例15: write_file


//.........这里部分代码省略.........
             }
             if (empty($this->atleastonediscount)) {
                 $this->posxpicture += $this->postotalht - $this->posxdiscount;
                 $this->posxtva += $this->postotalht - $this->posxdiscount;
                 $this->posxup += $this->postotalht - $this->posxdiscount;
                 $this->posxqty += $this->postotalht - $this->posxdiscount;
                 $this->posxdiscount += $this->postotalht - $this->posxdiscount;
                 //$this->postotalht;
             }
             // New page
             $pdf->AddPage();
             if (!empty($tplidx)) {
                 $pdf->useTemplate($tplidx);
             }
             $pagenb++;
             $this->_pagehead($pdf, $object, 1, $outputlangs);
             $pdf->SetFont('', '', $default_font_size - 1);
             $pdf->MultiCell(0, 3, '');
             // Set interline to 3
             $pdf->SetTextColor(0, 0, 0);
             $tab_top = 90;
             $tab_top_newpage = empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10;
             $tab_height = 130;
             $tab_height_newpage = 150;
             // Affiche notes
             $notetoshow = empty($object->note_public) ? '' : $object->note_public;
             if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) {
                 // Get first sale rep
                 if (is_object($object->thirdparty)) {
                     $salereparray = $object->thirdparty->getSalesRepresentatives($user);
                     $salerepobj = new User($this->db);
                     $salerepobj->fetch($salereparray[0]['id']);
                     if (!empty($salerepobj->signature)) {
                         $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature);
                     }
                 }
             }
             if ($notetoshow) {
                 $tab_top = 88;
                 $pdf->SetFont('', '', $default_font_size - 1);
                 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
                 $nexY = $pdf->GetY();
                 $height_note = $nexY - $tab_top;
                 // Rect prend une longueur en 3eme param
                 $pdf->SetDrawColor(192, 192, 192);
                 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
                 $tab_height = $tab_height - $height_note;
                 $tab_top = $nexY + 6;
             } else {
                 $height_note = 0;
             }
             $iniY = $tab_top + 7;
             $curY = $tab_top + 7;
             $nexY = $tab_top + 7;
             $inPackage = false;
             $TPackageInfos = array();
             $TChilds = array();
             $package_qty = 0;
             $TStack = array();
             // Loop on each lines
             for ($i = 0; $i < $nblignes; $i++) {
                 $package_qty = $TStack[count($TStack) - 1]['package_qty'];
                 $inPackage = count($TStack) > 0;
                 // Ligne de titre
                 if ($object->lines[$i]->product_type == 9 && $object->lines[$i]->qty < 97 && $object->lines[$i]->fk_product > 0) {
                     $inPackage = true;
开发者ID:altatof,项目名称:dolibarr_module_subtotal,代码行数:67,代码来源:pdf_einstein_subtotal.modules.php


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