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


PHP Translate::transnoentities方法代码示例

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


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

示例1: foreach

 /**
  *  Output record line into file
  *
  *  @param      array		$array_selected_sorted      Array with list of field to export
  *  @param      resource	$objp                       A record from a fetch with all fields from select
  *  @param      Translate	$outputlangs                Object lang to translate values
  *  @param		array		$array_types				Array with types of fields
  * 	@return		int										<0 if KO, >0 if OK
  */
 function write_record($array_selected_sorted, $objp, $outputlangs, $array_types)
 {
     global $conf;
     // Create a format for the column headings
     if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
         $outputlangs->charset_output = 'ISO-8859-1';
         // Because Excel 5 format is ISO
     }
     // Define first row
     $this->col = 0;
     foreach ($array_selected_sorted as $code => $value) {
         if (strpos($code, ' as ') == 0) {
             $alias = str_replace(array('.', '-'), '_', $code);
         } else {
             $alias = substr($code, strpos($code, ' as ') + 4);
         }
         if (empty($alias)) {
             dol_print_error('', 'Bad value for field with code=' . $code . '. Try to redefine export.');
         }
         $newvalue = $objp->{$alias};
         $newvalue = $this->excel_clean($newvalue);
         $typefield = isset($array_types[$code]) ? $array_types[$code] : '';
         // Traduction newvalue
         if (preg_match('/^\\((.*)\\)$/i', $newvalue, $reg)) {
             $newvalue = $outputlangs->transnoentities($reg[1]);
         } else {
             $newvalue = $outputlangs->convToOutputCharset($newvalue);
         }
         if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i', $newvalue)) {
             if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
                 $formatdate = $this->workbook->addformat();
                 $formatdate->set_num_format('yyyy-mm-dd');
                 //$formatdate->set_num_format(0x0f);
                 $arrayvalue = preg_split('/[.,]/', xl_parse_date($newvalue));
                 //print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
                 $newvalue = strval($arrayvalue[0]) . '.' . strval($arrayvalue[1]);
                 // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
                 $this->worksheet->write($this->row, $this->col, $newvalue, PHPExcel_Shared_Date::PHPToExcel($formatdate));
             } else {
                 $newvalue = dol_stringtotime($newvalue);
                 $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, PHPExcel_Shared_Date::PHPToExcel($newvalue));
                 $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
                 $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd');
             }
         } elseif (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/i', $newvalue)) {
             if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
                 $formatdatehour = $this->workbook->addformat();
                 $formatdatehour->set_num_format('yyyy-mm-dd hh:mm:ss');
                 //$formatdatehour->set_num_format(0x0f);
                 $arrayvalue = preg_split('/[.,]/', xl_parse_date($newvalue));
                 //print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
                 $newvalue = strval($arrayvalue[0]) . '.' . strval($arrayvalue[1]);
                 // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
                 $this->worksheet->write($this->row, $this->col, $newvalue, $formatdatehour);
             } else {
                 $newvalue = dol_stringtotime($newvalue);
                 $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, PHPExcel_Shared_Date::PHPToExcel($newvalue));
                 $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
                 $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('yyyy-mm-dd h:mm:ss');
             }
         } else {
             if (!empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) {
                 $this->worksheet->write($this->row, $this->col, $newvalue);
             } else {
                 if ($typefield == 'Text' || $typefield == 'TextAuto') {
                     //$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
                     $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, (string) $newvalue);
                     $coord = $this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row + 1)->getCoordinate();
                     $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
                     $this->workbook->getActiveSheet()->getStyle($coord)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
                 } else {
                     $this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row + 1, $newvalue);
                 }
             }
         }
         $this->col++;
     }
     $this->row++;
     return 0;
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:89,代码来源:export_excel.modules.php

示例2: info

 /**		Return description of module
  *
  * 		@param	Translate	$langs		Object langs
  * 		@return string      			Description of module
  */
 function info($langs)
 {
     global $conf, $mc;
     global $form;
     $langs->load("companies");
     $disabled = !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity ? ' disabled="disabled"' : '';
     $texte = $langs->trans('GenericNumRefModelDesc') . "<br>\n";
     $texte .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
     $texte .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     $texte .= '<input type="hidden" name="action" value="setModuleOptions">';
     $texte .= '<input type="hidden" name="param1" value="COMPANY_ELEPHANT_MASK_CUSTOMER">';
     $texte .= '<input type="hidden" name="param2" value="COMPANY_ELEPHANT_MASK_SUPPLIER">';
     $texte .= '<table class="nobordernopadding" width="100%">';
     $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("ThirdParty"), $langs->transnoentities("ThirdParty"));
     //$tooltip.=$langs->trans("GenericMaskCodes2");	Not required for third party numbering
     $tooltip .= $langs->trans("GenericMaskCodes3");
     $tooltip .= $langs->trans("GenericMaskCodes4b");
     $tooltip .= $langs->trans("GenericMaskCodes5");
     // Parametrage du prefix customers
     $texte .= '<tr><td>' . $langs->trans("Mask") . ' (' . $langs->trans("CustomerCodeModel") . '):</td>';
     $texte .= '<td align="right">' . $form->textwithpicto('<input type="text" class="flat" size="24" name="value1" value="' . $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER . '"' . $disabled . '>', $tooltip, 1, 1) . '</td>';
     $texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="' . $langs->trans("Modify") . '" name="Button"' . $disabled . '></td>';
     $texte .= '</tr>';
     // Parametrage du prefix suppliers
     $texte .= '<tr><td>' . $langs->trans("Mask") . ' (' . $langs->trans("SupplierCodeModel") . '):</td>';
     $texte .= '<td align="right">' . $form->textwithpicto('<input type="text" class="flat" size="24" name="value2" value="' . $conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER . '"' . $disabled . '>', $tooltip, 1, 1) . '</td>';
     $texte .= '</tr>';
     $texte .= '</table>';
     $texte .= '</form>';
     return $texte;
 }
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:36,代码来源:mod_codeclient_elephant.php

示例3: info

 /**		Return description of module
  *
  * 		@param	Translate 		$langs		Object langs
  * 		@return string      			Description of module
  */
 function info($langs)
 {
     global $conf, $mc;
     global $form;
     $langs->load("products");
     $disabled = !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity ? ' disabled="disabled"' : '';
     $texte = $langs->trans('GenericNumRefModelDesc') . "<br>\n";
     $texte .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
     $texte .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     $texte .= '<input type="hidden" name="action" value="setModuleOptions">';
     $texte .= '<input type="hidden" name="param1" value="BARCODE_STANDARD_PRODUCT_MASK">';
     $texte .= '<table class="nobordernopadding" width="100%">';
     $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("BarCode"), $langs->transnoentities("BarCode"));
     $tooltip .= $langs->trans("GenericMaskCodes3");
     $tooltip .= $langs->trans("GenericMaskCodes4c");
     $tooltip .= $langs->trans("GenericMaskCodes5");
     // Mask parameter
     //$texte.= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):</td>';
     $texte .= '<tr><td>' . $langs->trans("Mask") . ':</td>';
     $texte .= '<td align="right">' . $form->textwithpicto('<input type="text" class="flat" size="24" name="value1" value="' . (!empty($conf->global->BARCODE_STANDARD_PRODUCT_MASK) ? $conf->global->BARCODE_STANDARD_PRODUCT_MASK : '') . '"' . $disabled . '>', $tooltip, 1, 1) . '</td>';
     $texte .= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="' . $langs->trans("Modify") . '" name="Button"' . $disabled . '></td>';
     $texte .= '</tr>';
     $texte .= '</table>';
     $texte .= '</form>';
     return $texte;
 }
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:mod_barcode_product_standard.php

示例4: html_print_paybox_footer

/**
 * Show footer of company in HTML pages
 *
 * @param   Societe		$fromcompany	Third party
 * @param   Translate	$langs			Output language
 * @return	void
 */
function html_print_paybox_footer($fromcompany,$langs)
{
	global $conf;

	// Juridical status
	$line1="";
	if ($fromcompany->forme_juridique_code)
	{
		$line1.=($line1?" - ":"").getFormeJuridiqueLabel($fromcompany->forme_juridique_code);
	}
	// Capital
	if ($fromcompany->capital)
	{
		$line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency);
	}
	// Prof Id 1
	if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2))
	{
		$field=$langs->transcountrynoentities("ProfId1",$fromcompany->country_code);
		if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
		$line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof1;
	}
	// Prof Id 2
	if ($fromcompany->idprof2)
	{
		$field=$langs->transcountrynoentities("ProfId2",$fromcompany->country_code);
		if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
		$line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof2;
	}

	// Second line of company infos
	$line2="";
	// Prof Id 3
	if ($fromcompany->idprof3)
	{
		$field=$langs->transcountrynoentities("ProfId3",$fromcompany->country_code);
		if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
		$line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof3;
	}
	// Prof Id 4
	if ($fromcompany->idprof4)
	{
		$field=$langs->transcountrynoentities("ProfId4",$fromcompany->country_code);
		if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
		$line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof4;
	}
	// IntraCommunautary VAT
	if ($fromcompany->tva_intra != '')
	{
		$line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
	}

	print '<br><br><hr>'."\n";
	print '<center><font style="font-size: 10px;">'."\n";
	print $fromcompany->nom.'<br>';
	print $line1.'<br>';
	print $line2;
	print '</font></center>'."\n";
}
开发者ID:nrjacker4,项目名称:crm-php,代码行数:66,代码来源:paybox.lib.php

示例5: pdf_getLinkedObjects

/**
 * 	Return linked objects
 *
 * 	@param	object		$object			Object
 * 	@param	Translate	$outputlangs	Object lang for output
 * 	@return	array   Linked objects
 */
function pdf_getLinkedObjects($object, $outputlangs)
{
    global $hookmanager;
    $linkedobjects = array();
    $object->fetchObjectLinked();
    foreach ($object->linkedObjects as $objecttype => $objects) {
        if ($objecttype == 'propal') {
            $outputlangs->load('propal');
            foreach ($objects as $elementobject) {
                $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
                $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
                $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
                $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
            }
        } else {
            if ($objecttype == 'commande') {
                $outputlangs->load('orders');
                foreach ($objects as $elementobject) {
                    $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
                    $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref) . ($elementobject->ref_client ? ' (' . $elementobject->ref_client . ')' : '');
                    $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
                    $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
                }
            } else {
                if ($objecttype == 'contrat') {
                    $outputlangs->load('contracts');
                    foreach ($objects as $elementobject) {
                        $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
                        $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
                        $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
                        $linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat, 'day', '', $outputlangs);
                    }
                } else {
                    if ($objecttype == 'shipping') {
                        $outputlangs->load('orders');
                        $outputlangs->load('sendings');
                        foreach ($objects as $elementobject) {
                            $elementobject->fetchObjectLinked();
                            $order = $elementobject->linkedObjects['commande'][0];
                            if (!empty($object->linkedObjects['commande'])) {
                                $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
                                $linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref);
                                $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateSending");
                                $linkedobjects[$objecttype]['date_value'] .= dol_print_date($elementobject->date_delivery, 'day', '', $outputlangs);
                            } else {
                                $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder") . ' / ' . $outputlangs->transnoentities("RefSending");
                                $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref) . ($order->ref_client ? ' (' . $order->ref_client . ')' : '');
                                $linkedobjects[$objecttype]['ref_value'] .= ' / ' . $outputlangs->transnoentities($elementobject->ref);
                                $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ' / ' . $outputlangs->transnoentities("DateSending");
                                $linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date, 'day', '', $outputlangs);
                                $linkedobjects[$objecttype]['date_value'] .= ' / ' . dol_print_date($elementobject->date_delivery, 'day', '', $outputlangs);
                            }
                        }
                    }
                }
            }
        }
    }
    // For add external linked objects
    if (is_object($hookmanager)) {
        $parameters = array('linkedobjects' => $linkedobjects, 'outputlangs' => $outputlangs);
        $action = '';
        $hookmanager->executeHooks('pdf_getLinkedObjects', $parameters, $object, $action);
        // Note that $action and $object may have been modified by some hooks
        if (!empty($hookmanager->resArray)) {
            $linkedobjects = $hookmanager->resArray;
        }
    }
    return $linkedobjects;
}
开发者ID:Samara94,项目名称:dolibarr,代码行数:77,代码来源:pdf.lib.php

示例6: envoi_mail

/**
 * 	Send email
 *
 * 	@param	string	$mode					Mode (test | confirm)
 *  @param	string	$oldemail				Old email
 * 	@param	string	$message				Message to send
 * 	@param	string	$total					Total amount of unpayed invoices
 *  @param	string	$userlang				Code lang to use for email output.
 *  @param	string	$oldsalerepresentative	Old sale representative
 * 	@return	int								<0 if KO, >0 if OK
 */
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative)
{
    global $conf, $langs;
    if (getenv('DOL_FORCE_EMAIL_TO')) {
        $oldemail = getenv('DOL_FORCE_EMAIL_TO');
    }
    $newlangs = new Translate('', $conf);
    $newlangs->setDefaultLang(empty($userlang) ? empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT : $userlang);
    $newlangs->load("main");
    $newlangs->load("bills");
    $subject = empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_SUBJECT) ? $newlangs->trans("ListOfYourUnpaidInvoices") : $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_SUBJECT;
    $sendto = $oldemail;
    $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
    $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
    $msgishtml = -1;
    print "- Send email for " . $oldsalerepresentative . " (" . $oldemail . "), total: " . $total . "\n";
    dol_syslog("email_unpaid_invoices_to_representatives.php: send mail to " . $oldemail);
    $usehtml = 0;
    if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) {
        $usehtml += 1;
    }
    if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER)) {
        $usehtml += 1;
    }
    $allmessage = '';
    if (!empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER)) {
        $allmessage .= $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER;
    } else {
        $allmessage .= $newlangs->transnoentities("ListOfYourUnpaidInvoices") . ($usehtml ? "<br>\n" : "\n") . ($usehtml ? "<br>\n" : "\n");
        $allmessage .= $newlangs->transnoentities("NoteListOfYourUnpaidInvoices") . ($usehtml ? "<br>\n" : "\n");
    }
    $allmessage .= $message . ($usehtml ? "<br>\n" : "\n");
    $allmessage .= $langs->trans("Total") . " = " . price($total, 0, $newlangs, 0, 0, -1, $conf->currency) . ($usehtml ? "<br>\n" : "\n");
    if (!empty($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) {
        $allmessage .= $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER;
        if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) {
            $usehtml += 1;
        }
    }
    $mail = new CMailFile($subject, $sendto, $from, $allmessage, array(), array(), array(), '', '', 0, $msgishtml);
    $mail->errors_to = $errorsto;
    // Send or not email
    if ($mode == 'confirm') {
        $result = $mail->sendfile();
        if (!$result) {
            print "Error sending email " . $mail->error . "\n";
            dol_syslog("Error sending email " . $mail->error . "\n");
        }
    } else {
        print "No email sent (test mode)\n";
        dol_syslog("No email sent (test mode)");
        $mail->dump_mail();
        $result = 1;
    }
    if ($result) {
        return 1;
    } else {
        return -1;
    }
}
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:71,代码来源:email_unpaid_invoices_to_representatives.php

示例7: foreach

 /**
  *	Output record line into file
  *
  *  @param     	array		$array_selected_sorted      Array with list of field to export
  *  @param     	resource	$objp                       A record from a fetch with all fields from select
  *  @param     	Translate	$outputlangs    			Object lang to translate values
  *  @param		array		$array_types				Array with types of fields
  * 	@return		int										<0 if KO, >0 if OK
  */
 function write_record($array_selected_sorted, $objp, $outputlangs, $array_types)
 {
     global $conf;
     if (!empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) {
         $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET;
     } else {
         $outputlangs->charset_output = 'ISO-8859-1';
     }
     $this->col = 0;
     foreach ($array_selected_sorted as $code => $value) {
         if (strpos($code, ' as ') == 0) {
             $alias = str_replace(array('.', '-'), '_', $code);
         } else {
             $alias = substr($code, strpos($code, ' as ') + 4);
         }
         if (empty($alias)) {
             dol_print_error('', 'Bad value for field with key=' . $code . '. Try to redefine export.');
         }
         $newvalue = $outputlangs->convToOutputCharset($objp->{$alias});
         // objp->$alias must be utf8 encoded as any var in memory	// newvalue is now $outputlangs->charset_output encoded
         $typefield = isset($array_types[$code]) ? $array_types[$code] : '';
         // Translation newvalue
         if (preg_match('/^\\((.*)\\)$/i', $newvalue, $reg)) {
             $newvalue = $outputlangs->transnoentities($reg[1]);
         }
         $newvalue = $this->csv_clean($newvalue, $outputlangs->charset_output);
         if (preg_match('/^Select:/i', $typefield, $reg) && ($typefield = substr($typefield, 7))) {
             $array = unserialize($typefield);
             $array = $array['options'];
             $newvalue = $array[$newvalue];
         }
         fwrite($this->handle, $newvalue . $this->separator);
         $this->col++;
     }
     fwrite($this->handle, "\n");
     return 0;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:46,代码来源:export_csv.modules.php

示例8: runTrigger

 /**
  * Function called when a Dolibarrr business event is done.
  * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
  *
  * @param string		$action		Event action code
  * @param Object		$object     Object
  * @param User			$user       Object user
  * @param Translate		$langs      Object langs
  * @param conf			$conf       Object conf
  * @return int         				<0 if KO, 0 if no triggered ran, >0 if OK
  */
 public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
 {
     if (!empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) {
         return 0;
     }
     // Log events is disabled (hidden features)
     $key = 'MAIN_LOGEVENTS_' . $action;
     //dol_syslog("xxxxxxxxxxx".$key);
     if (empty($conf->global->{$key})) {
         return 0;
     }
     // Log events not enabled for this action
     if (empty($conf->entity)) {
         $conf->entity = $entity;
     }
     // forcing of the entity if it's not defined (ex: in login form)
     $date = dol_now();
     // Actions
     if ($action == 'USER_LOGIN') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         // Initialisation donnees (date,duree,texte,desc)
         $text = "(UserLogged," . $object->login . ")";
         $text .= empty($object->trigger_mesg) ? '' : ' - ' . $object->trigger_mesg;
         $desc = "(UserLogged," . $object->login . ")";
         $desc .= empty($object->trigger_mesg) ? '' : ' - ' . $object->trigger_mesg;
     }
     if ($action == 'USER_LOGIN_FAILED') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         // Initialisation donnees (date,duree,texte,desc)
         $text = $object->trigger_mesg;
         // Message direct
         $desc = $object->trigger_mesg;
         // Message direct
     }
     if ($action == 'USER_LOGOUT') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         // Initialisation donnees (date,duree,texte,desc)
         $text = "(UserLogoff," . $object->login . ")";
         $desc = "(UserLogoff," . $object->login . ")";
     }
     if ($action == 'USER_CREATE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         $text = $langs->transnoentities("NewUserCreated", $object->login);
         $desc = $langs->transnoentities("NewUserCreated", $object->login);
     } elseif ($action == 'USER_MODIFY') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         $text = $langs->transnoentities("EventUserModified", $object->login);
         $desc = $langs->transnoentities("EventUserModified", $object->login);
     } elseif ($action == 'USER_NEW_PASSWORD') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         $text = $langs->transnoentities("NewUserPassword", $object->login);
         $desc = $langs->transnoentities("NewUserPassword", $object->login);
     } elseif ($action == 'USER_ENABLEDISABLE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         if ($object->statut == 0) {
             $text = $langs->transnoentities("UserEnabled", $object->login);
             $desc = $langs->transnoentities("UserEnabled", $object->login);
         }
         if ($object->statut == 1) {
             $text = $langs->transnoentities("UserDisabled", $object->login);
             $desc = $langs->transnoentities("UserDisabled", $object->login);
         }
     } elseif ($action == 'USER_DELETE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         $text = $langs->transnoentities("UserDeleted", $object->login);
         $desc = $langs->transnoentities("UserDeleted", $object->login);
     } elseif ($action == 'GROUP_CREATE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         $text = $langs->transnoentities("NewGroupCreated", $object->name);
         $desc = $langs->transnoentities("NewGroupCreated", $object->name);
     } elseif ($action == 'GROUP_MODIFY') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $langs->load("users");
         // Initialisation donnees (date,duree,texte,desc)
         $text = $langs->transnoentities("GroupModified", $object->name);
         $desc = $langs->transnoentities("GroupModified", $object->name);
     } elseif ($action == 'GROUP_DELETE') {
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:interface_20_all_Logevents.class.php

示例9: envoi_mail

/**
 * 	Send email
 *
 * 	@param	string	$mode			Mode (test | confirm)
 *  @param	string	$oldemail		Target email
 * 	@param	string	$message		Message to send
 * 	@param	string	$total			Total amount of unpayed invoices
 *  @param	string	$userlang		Code lang to use for email output.
 *  @param	string	$oldtarget		Target name
 *  @param  int		$duration_value	duration value
 * 	@return	int						<0 if KO, >0 if OK
 */
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value)
{
    global $conf, $langs;
    if (getenv('DOL_FORCE_EMAIL_TO')) {
        $oldemail = getenv('DOL_FORCE_EMAIL_TO');
    }
    $newlangs = new Translate('', $conf);
    $newlangs->setDefaultLang(empty($userlang) ? empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT : $userlang);
    $newlangs->load("main");
    $newlangs->load("contracts");
    if ($duration_value) {
        if ($duration_value > 0) {
            $title = $newlangs->transnoentities("ListOfServicesToExpireWithDuration", $duration_value);
        } else {
            $title = $newlangs->transnoentities("ListOfServicesToExpireWithDurationNeg", $duration_value);
        }
    } else {
        $title = $newlangs->transnoentities("ListOfServicesToExpire");
    }
    $subject = empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT) ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT;
    $sendto = $oldemail;
    $from = $conf->global->MAIN_MAIL_EMAIL_FROM;
    $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
    $msgishtml = -1;
    print "- Send email to '" . $oldtarget . "' (" . $oldemail . "), total: " . $total . "\n";
    dol_syslog("email_expire_services_to_customers.php: send mail to " . $oldemail);
    $usehtml = 0;
    if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER)) {
        $usehtml += 1;
    }
    if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER)) {
        $usehtml += 1;
    }
    $allmessage = '';
    if (!empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER)) {
        $allmessage .= $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER;
    } else {
        $allmessage .= "Dear customer" . ($usehtml ? "<br>\n" : "\n") . ($usehtml ? "<br>\n" : "\n");
        $allmessage .= "Please, find a summary of the services contracted by you that are about to expire." . ($usehtml ? "<br>\n" : "\n") . ($usehtml ? "<br>\n" : "\n");
    }
    $allmessage .= $message . ($usehtml ? "<br>\n" : "\n");
    //$allmessage.= $langs->trans("Total")." = ".price($total,0,$userlang,0,0,-1,$conf->currency).($usehtml?"<br>\n":"\n");
    if (!empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER)) {
        $allmessage .= $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER;
        if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER)) {
            $usehtml += 1;
        }
    }
    $mail = new CMailFile($subject, $sendto, $from, $allmessage, array(), array(), array(), '', '', 0, $msgishtml);
    $mail->errors_to = $errorsto;
    // Send or not email
    if ($mode == 'confirm') {
        $result = $mail->sendfile();
        if (!$result) {
            print "Error sending email " . $mail->error . "\n";
            dol_syslog("Error sending email " . $mail->error . "\n");
        }
    } else {
        print "No email sent (test mode)\n";
        dol_syslog("No email sent (test mode)");
        $mail->dump_mail();
        $result = 1;
    }
    unset($newlangs);
    if ($result) {
        return 1;
    } else {
        return -1;
    }
}
开发者ID:Samara94,项目名称:dolibarr,代码行数:82,代码来源:email_expire_services_to_customers.php

示例10: dol_print_error

/**
 *	Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remontee des bugs.
 *	On doit appeler cette fonction quand une erreur technique bloquante est rencontree.
 *	Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant
 *	renvoyer leur erreur par l'intermediaire de leur propriete "error".
 *	@param      db      	Database handler
 *	@param      error		String or array of errors strings to show
 *  @see        dol_htmloutput_errors
 */
function dol_print_error($db = '', $error = '')
{
    global $conf, $langs, $argv;
    global $dolibarr_main_prod;
    $out = '';
    $syslog = '';
    // Si erreur intervenue avant chargement langue
    if (!$langs) {
        require_once DOL_DOCUMENT_ROOT . "/core/class/translate.class.php";
        $langs = new Translate("", $conf);
        $langs->load("main");
    }
    $langs->load("main");
    $langs->load("errors");
    if ($_SERVER['DOCUMENT_ROOT']) {
        $out .= $langs->trans("DolibarrHasDetectedError") . ".<br>\n";
        if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
            $out .= "You use an experimental level of features, so please do NOT report any bugs, anywhere, until going back to MAIN_FEATURES_LEVEL = 0.<br>\n";
        }
        $out .= $langs->trans("InformationToHelpDiagnose") . ":<br>\n";
        $out .= "<b>" . $langs->trans("Date") . ":</b> " . dol_print_date(time(), 'dayhourlog') . "<br>\n";
        $out .= "<b>" . $langs->trans("Dolibarr") . ":</b> " . DOL_VERSION . "<br>\n";
        if (isset($conf->global->MAIN_FEATURES_LEVEL)) {
            $out .= "<b>" . $langs->trans("LevelOfFeature") . ":</b> " . $conf->global->MAIN_FEATURES_LEVEL . "<br>\n";
        }
        if (function_exists("phpversion")) {
            $out .= "<b>" . $langs->trans("PHP") . ":</b> " . phpversion() . "<br>\n";
            //phpinfo();       // This is to show location of php.ini file
        }
        $out .= "<b>" . $langs->trans("Server") . ":</b> " . $_SERVER["SERVER_SOFTWARE"] . "<br>\n";
        $out .= "<br>\n";
        $out .= "<b>" . $langs->trans("RequestedUrl") . ":</b> " . $_SERVER["REQUEST_URI"] . "<br>\n";
        $out .= "<b>" . $langs->trans("Referer") . ":</b> " . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '') . "<br>\n";
        $out .= "<b>" . $langs->trans("MenuManager") . ":</b> " . $conf->top_menu . "<br>\n";
        $out .= "<br>\n";
        $syslog .= "url=" . $_SERVER["REQUEST_URI"];
        $syslog .= ", query_string=" . $_SERVER["QUERY_STRING"];
    } else {
        $out .= '> ' . $langs->transnoentities("ErrorInternalErrorDetected") . ":\n" . $argv[0] . "\n";
        $syslog .= "pid=" . getmypid();
    }
    if (is_object($db)) {
        if ($_SERVER['DOCUMENT_ROOT']) {
            $out .= "<b>" . $langs->trans("DatabaseTypeManager") . ":</b> " . $db->type . "<br>\n";
            $out .= "<b>" . $langs->trans("RequestLastAccessInError") . ":</b> " . ($db->lastqueryerror() ? $db->lastqueryerror() : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
            $out .= "<b>" . $langs->trans("ReturnCodeLastAccessInError") . ":</b> " . ($db->lasterrno() ? $db->lasterrno() : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
            $out .= "<b>" . $langs->trans("InformationLastAccessInError") . ":</b> " . ($db->lasterror() ? $db->lasterror() : $langs->trans("ErrorNoRequestInError")) . "<br>\n";
            $out .= "<br>\n";
        } else {
            $out .= '> ' . $langs->transnoentities("DatabaseTypeManager") . ":\n" . $db->type . "\n";
            $out .= '> ' . $langs->transnoentities("RequestLastAccessInError") . ":\n" . ($db->lastqueryerror() ? $db->lastqueryerror() : $langs->trans("ErrorNoRequestInError")) . "\n";
            $out .= '> ' . $langs->transnoentities("ReturnCodeLastAccessInError") . ":\n" . ($db->lasterrno() ? $db->lasterrno() : $langs->trans("ErrorNoRequestInError")) . "\n";
            $out .= '> ' . $langs->transnoentities("InformationLastAccessInError") . ":\n" . ($db->lasterror() ? $db->lasterror() : $langs->trans("ErrorNoRequestInError")) . "\n";
        }
        $syslog .= ", sql=" . $db->lastquery();
        $syslog .= ", db_error=" . $db->lasterror();
    }
    if ($error) {
        $langs->load("errors");
        if (is_array($error)) {
            $errors = $error;
        } else {
            $errors = array($error);
        }
        foreach ($errors as $msg) {
            $msg = $langs->trans($msg);
            if ($_SERVER['DOCUMENT_ROOT']) {
                $out .= "<b>" . $langs->trans("Message") . ":</b> " . $msg . "<br>\n";
            } else {
                $out .= '> ' . $langs->transnoentities("Message") . ":\n" . $msg . "\n";
            }
            $syslog .= ", msg=" . $msg;
        }
    }
    if (empty($dolibarr_main_prod) && $_SERVER['DOCUMENT_ROOT'] && function_exists('xdebug_call_file')) {
        xdebug_print_function_stack();
        $out .= '<b>XDebug informations:</b>' . "<br>\n";
        $out .= 'File: ' . xdebug_call_file() . "<br>\n";
        $out .= 'Line: ' . xdebug_call_line() . "<br>\n";
        $out .= 'Function: ' . xdebug_call_function() . "<br>\n";
        $out .= "<br>\n";
    }
    if (empty($dolibarr_main_prod)) {
        print $out;
    } else {
        define("MAIN_CORE_ERROR", 1);
    }
    //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.';
    dol_syslog("Error " . $syslog, LOG_ERR);
}
开发者ID:netors,项目名称:dolibarr,代码行数:99,代码来源:functions.lib.php

示例11: foreach

 /**
  *	Output record line into file
  *
  *  @param     	array		$array_selected_sorted      Array with list of field to export
  *  @param     	resource	$objp                       A record from a fetch with all fields from select
  *  @param     	Translate	$outputlangs    			Object lang to translate values
  * 	@return		int										<0 if KO, >0 if OK
  */
 function write_record($array_selected_sorted, $objp, $outputlangs)
 {
     global $conf;
     if (!empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) {
         $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET;
     } else {
         $outputlangs->charset_output = 'ISO-8859-1';
     }
     $this->col = 0;
     foreach ($array_selected_sorted as $code => $value) {
         $alias = str_replace(array('.', '-'), '_', $code);
         if (empty($alias)) {
             dol_print_error('', 'Bad value for field with key=' . $code . '. Try to redefine export.');
         }
         $newvalue = $outputlangs->convToOutputCharset($objp->{$alias});
         // Translation newvalue
         if (preg_match('/^\\((.*)\\)$/i', $newvalue, $reg)) {
             $newvalue = $outputlangs->transnoentities($reg[1]);
         }
         $newvalue = $this->csv_clean($newvalue, $outputlangs->charset_output);
         fwrite($this->handle, $newvalue . $this->separator);
         $this->col++;
     }
     fwrite($this->handle, "\n");
     return 0;
 }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:34,代码来源:export_csv.modules.php

示例12: dol_print_reduction

/**
 *	Returns formated reduction
 *
 *	@param	int			$reduction		Reduction percentage
 *	@param	Translate	$langs			Output language
 *	@return	string						Formated reduction
 */
function dol_print_reduction($reduction, $langs)
{
    $string = '';
    if ($reduction == 100) {
        $string = $langs->transnoentities("Offered");
    } else {
        $string = $reduction . '%';
    }
    return $string;
}
开发者ID:Albertopf,项目名称:prueba,代码行数:17,代码来源:functions2.lib.php

示例13: pdf_getLinkedObjects

/**
 * 	Return linked objects
 *
 * 	@param	object		$object			Object
 * 	@param	Translate	$outputlangs	Object lang for output
 *	@param	HookManager	$hookmanager	Hook manager instance
 * 	@return	void
 */
function pdf_getLinkedObjects($object, $outputlangs, $hookmanager = false)
{
    $linkedobjects = array();
    $object->fetchObjectLinked();
    foreach ($object->linkedObjects as $objecttype => $objects) {
        if ($objecttype == 'propal') {
            $outputlangs->load('propal');
            $num = count($objects);
            for ($i = 0; $i < $num; $i++) {
                $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefProposal");
                $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
                $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DatePropal");
                $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date, 'day', '', $outputlangs);
            }
        } else {
            if ($objecttype == 'commande') {
                $outputlangs->load('orders');
                $num = count($objects);
                for ($i = 0; $i < $num; $i++) {
                    $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
                    $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref) . ($objects[$i]->ref_client ? ' (' . $objects[$i]->ref_client . ')' : '');
                    $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
                    $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date, 'day', '', $outputlangs);
                }
            } else {
                if ($objecttype == 'contrat') {
                    $outputlangs->load('contracts');
                    $num = count($objects);
                    for ($i = 0; $i < $num; $i++) {
                        $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
                        $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
                        $linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
                        $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat, 'day', '', $outputlangs);
                    }
                }
            }
        }
    }
    // For add external linked objects
    if (is_object($hookmanager)) {
        $parameters = array('linkedobjects' => $linkedobjects, 'outputlangs' => $outputlangs);
        $action = '';
        $hookmanager->executeHooks('pdf_getLinkedObjects', $parameters, $object, $action);
        // Note that $action and $object may have been modified by some hooks
        if (!empty($hookmanager->resArray)) {
            $linkedobjects = $hookmanager->resArray;
        }
    }
    return $linkedobjects;
}
开发者ID:nrjacker4,项目名称:crm-php,代码行数:58,代码来源:pdf.lib.php

示例14: runTrigger

 /**
  * Function called when a Dolibarrr business event is done.
  * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
  *
  * Following properties must be filled:
  *      $object->actiontypecode (translation action code: AC_OTH, ...)
  *      $object->actionmsg (note, long text)
  *      $object->actionmsg2 (label, short text)
  *      $object->sendtoid (id of contact)
  *      $object->socid
  *      Optionnal:
  *      $object->fk_element
  *      $object->elementtype
  *
  * @param string		$action		Event action code
  * @param Object		$object     Object
  * @param User		    $user       Object user
  * @param Translate 	$langs      Object langs
  * @param conf		    $conf       Object conf
  * @return int         				<0 if KO, 0 if no triggered ran, >0 if OK
  */
 public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
 {
     // Module not active, we do nothing
     if (empty($conf->agenda->enabled)) {
         return 0;
     }
     $key = 'MAIN_AGENDA_ACTIONAUTO_' . $action;
     // Do not log events not enabled for this action
     if (empty($conf->global->{$key})) {
         return 0;
     }
     $langs->load("agenda");
     // Actions
     if ($action == 'COMPANY_CREATE') {
         $langs->load("other");
         $langs->load("companies");
         $object->actiontypecode = 'AC_OTH_AUTO';
         if (empty($object->actionmsg2)) {
             $object->actionmsg2 = $langs->transnoentities("NewCompanyToDolibarr", $object->name);
         }
         $object->actionmsg = $langs->transnoentities("NewCompanyToDolibarr", $object->name);
         if (!empty($object->prefix)) {
             $object->actionmsg .= " (" . $object->prefix . ")";
         }
         $object->actionmsg .= "\n" . $langs->transnoentities("Author") . ': ' . $user->login;
         $object->sendtoid = 0;
         $object->socid = $object->id;
     } elseif ($action == 'COMPANY_SENTBYMAIL') {
         $langs->load("other");
         $langs->load("orders");
         if (empty($object->actiontypecode)) {
             $object->actiontypecode = 'AC_OTH_AUTO';
         }
         if (empty($object->actionmsg2)) {
             dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
         }
         $object->actionmsg .= "\n" . $langs->transnoentities("Author") . ': ' . $user->login;
         // Parameters $object->sendtoid defined by caller
         //$object->sendtoid=0;
     } elseif ($action == 'CONTRACT_VALIDATE') {
         $langs->load("other");
         $langs->load("contracts");
         $object->actiontypecode = 'AC_OTH_AUTO';
         if (empty($object->actionmsg2)) {
             $object->actionmsg2 = $langs->transnoentities("ContractValidatedInDolibarr", $object->newref ? $object->newref : $object->ref);
         }
         $object->actionmsg = $langs->transnoentities("ContractValidatedInDolibarr", $object->newref ? $object->newref : $object->ref);
         $object->actionmsg .= "\n" . $langs->transnoentities("Author") . ': ' . $user->login;
         $object->sendtoid = 0;
     } elseif ($action == 'PROPAL_VALIDATE') {
         $langs->load("other");
         $langs->load("propal");
         $object->actiontypecode = 'AC_OTH_AUTO';
         if (empty($object->actionmsg2)) {
             $object->actionmsg2 = $langs->transnoentities("PropalValidatedInDolibarr", $object->newref ? $object->newref : $object->ref);
         }
         $object->actionmsg = $langs->transnoentities("PropalValidatedInDolibarr", $object->newref ? $object->newref : $object->ref);
         $object->actionmsg .= "\n" . $langs->transnoentities("Author") . ': ' . $user->login;
         $object->sendtoid = 0;
     } elseif ($action == 'PROPAL_SENTBYMAIL') {
         $langs->load("other");
         $langs->load("propal");
         $object->actiontypecode = 'AC_OTH_AUTO';
         if (empty($object->actionmsg2)) {
             $object->actionmsg2 = $langs->transnoentities("ProposalSentByEMail", $object->ref);
         }
         if (empty($object->actionmsg)) {
             $object->actionmsg = $langs->transnoentities("ProposalSentByEMail", $object->ref);
             $object->actionmsg .= "\n" . $langs->transnoentities("Author") . ': ' . $user->login;
         }
         // Parameters $object->sendtoid defined by caller
         //$object->sendtoid=0;
     } elseif ($action == 'PROPAL_CLOSE_SIGNED') {
         $langs->load("other");
         $langs->load("propal");
         $object->actiontypecode = 'AC_OTH_AUTO';
         if (empty($object->actionmsg2)) {
             $object->actionmsg2 = $langs->transnoentities("PropalClosedSignedInDolibarr", $object->ref);
         }
//.........这里部分代码省略.........
开发者ID:Samara94,项目名称:dolibarr,代码行数:101,代码来源:interface_50_modAgenda_ActionsAuto.class.php

示例15: foreach

 /**
  * 	Output record line into file
  *
  *  @param      array		$array_selected_sorted      Array with list of field to export
  *  @param      resource	$objp                       A record from a fetch with all fields from select
  *  @param      Translate	$outputlangs                Object lang to translate values
  * 	@return		int										<0 if KO, >0 if OK
  */
 function write_record($array_selected_sorted, $objp, $outputlangs)
 {
     $this->col = 0;
     foreach ($array_selected_sorted as $code => $value) {
         $alias = str_replace(array('.', '-'), '_', $code);
         if (empty($alias)) {
             dol_print_error('', 'Bad value for field with code=' . $code . '. Try to redefine export.');
         }
         $newvalue = $objp->{$alias};
         // Translation newvalue
         if (preg_match('/^\\((.*)\\)$/i', $newvalue, $reg)) {
             $newvalue = $outputlangs->transnoentities($reg[1]);
         }
         $newvalue = $this->tsv_clean($newvalue);
         fwrite($this->handle, $newvalue . $this->separator);
         $this->col++;
     }
     fwrite($this->handle, "\n");
     return 0;
 }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:28,代码来源:export_tsv.modules.php


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