本文整理汇总了PHP中dol_include_once函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_include_once函数的具体用法?PHP dol_include_once怎么用?PHP dol_include_once使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dol_include_once函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMoreActionsButtons
function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
{
global $db, $langs;
if (in_array('ordercard', explode(':', $parameters['context'])) && $object->statut < 3) {
dol_include_once('/shippableorder/class/shippableorder.class.php');
$shippableOrder =& $object->shippableorder;
?>
<script type="text/javascript">
$('table#tablelines tr.liste_titre td.linecoldescription').first().after('<td class="linecolstock" align="right" style="color:#fff;"><?php
echo $langs->trans('Available');
?>
</td>');
<?php
foreach ($object->lines as &$line) {
$stock = $shippableOrder->orderLineStockStatus($line, true);
?>
$('table#tablelines tr[id=row-<?php
echo $line->id;
?>
] td.linecoldescription').after("<td class=\"linecolstock nowrap\" align=\"right\"><?php
echo addslashes($stock);
?>
</td>");
<?php
}
?>
</script>
<?php
}
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_shippableorder,代码行数:30,代码来源:actions_shippableorder.class.php
示例2: doActions
/**
* Overloading the doActions function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function doActions($parameters, &$object, &$action, $hookmanager)
{
if (in_array('invoicecard', explode(':', $parameters['context']))) {
if ($action == 'update_courrier') {
global $user, $db, $langs;
$object->array_options['options_courrier_envoi'] = time();
$object->insertExtraFields();
dol_include_once('/comm/action/class/actioncomm.class.php');
$a = new ActionComm($db);
$a->type_code = 'AC_OTH_AUTO';
$a->label = $langs->trans('ClassifyCourrierEvent', $object->ref);
$a->fk_element = $object->id;
$a->elementtype = 'facture';
$a->usertodo = $user;
$a->userdone = $user;
$a->percentage = 100;
$a->datep = date('Y-m-d H:i:s');
$a->add($user);
setEventMessage('ClassifyCourrierMsg');
} else {
if ($action == 'no_courrier') {
global $user;
$object->array_options['options_courrier_envoi'] = '';
$object->insertExtraFields();
setEventMessage('UnClassifyCourrierMsg');
}
}
}
return 0;
}
开发者ID:ATM-Consulting,项目名称:dolibarr_module_facturecourrier,代码行数:39,代码来源:actions_facturecourrier.class.php
示例3: beforePDFCreation
function beforePDFCreation($parameters, &$object, &$action, $hookmanager)
{
if ($object->element == 'facture') {
if (isset($object->thirdparty)) {
$societe =& $object->thirdparty;
} else {
dol_include_once('/societe/class/societe.class.php');
$societe = new Societe($db);
$societe->fetch($object->socid);
}
if (!empty($societe->id)) {
global $db, $conf;
if (!empty($societe->array_options['options_fk_soc_factor']) && $societe->array_options['options_factor_suivi'] == 1) {
define('INC_FROM_DOLIBARR', true);
dol_include_once('/factor/config.php');
dol_include_once('/factor/class/factor.class.php');
$PDOdb = new TPDOdb();
$factor = new TFactor();
$factor->loadBy($PDOdb, $societe->array_options['options_fk_soc_factor'], 'fk_soc');
if (!empty($factor->mention)) {
if (strpos($object->note_public, $factor->mention) === false) {
$object->note_public = $factor->mention . (!empty($object->note_public) ? "\n\n" . $object->note_public : '');
$r = $object->update_note($object->note_public, '_public');
}
}
}
}
}
}
示例4: addMoreActionsButtons
/**
* Overloading the doActions function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
{
$error = 0;
if (in_array('pricesuppliercard', explode(':', $parameters['context']))) {
global $conf, $user, $langs;
if (!empty($conf->global->MANDARIN_TRACE_COST_PRICE) && !empty($user->rights->mandarin->graph->product_cost_price)) {
define('INC_FROM_DOLIBARR', true);
dol_include_once('/mandarin/config.php');
dol_include_once('/mandarin/class/costpricelog.class.php');
$PDOdb = new TPDOdb();
$TData = TProductCostPriceLog::getDataForProduct($PDOdb, $object->id);
if (!empty($TData)) {
$l = new TListviewTBS('graphrate');
echo $l->renderArray($PDOdb, $TData, array('type' => 'chart', 'curveType' => 'none', 'liste' => array('titre' => $langs->trans('GraphTraceCostPrice')), 'title' => array('PA' => $langs->transnoentities('PricePA'), 'PMP' => $langs->transnoentities('PricePMP'), 'OF' => $langs->transnoentities('PriceOF'))));
?>
<script type="text/javascript">
$(document).ready(function() {
$('#div_query_chartgraphrate').insertAfter('div.fiche:first');
});
</script>
<?php
}
}
}
if (!$error) {
return 0;
// or return 1 to replace standard code
} else {
$this->errors[] = 'Error message';
return -1;
}
}
示例5: getRefByObject
static function getRefByObject(&$object)
{
global $db;
$ref = '';
if ($object->element == 'societe' && !empty($object->code_client)) {
$ref = $object->code_client;
} else {
if ($object->element == 'societe') {
$ref = $object->name;
} else {
if ($object->element == 'contact') {
dol_include_once('/societe/class/societe.class.php');
$soc = new Societe($db);
$soc->fetch($object->socid);
$ref = trim((!empty($soc->code_client) ? $soc->code_client : $soc->name) . '_' . $object->lastname);
} else {
if ($object->element == 'user' && !empty($object->login)) {
$ref = $object->login;
} elseif (!empty($object->ref)) {
$ref = $object->ref;
}
}
}
}
return $ref;
}
示例6: loadBox
/**
* Load data into info_box_contents array to show array later.
*
* @param int $max of records to load
*
* @return void
*/
public function loadBox($max = 5)
{
global $conf, $user, $langs, $db;
$this->max = $max;
dol_include_once('/lead/class/lead.class.php');
$lead = new Lead($db);
$lead->fetch_all('DESC', 't.date_closure', $max, 0, array('t.date_closure<' => dol_now()));
$text = $langs->trans("LeadLate", $max);
$this->info_box_head = array('text' => $text, 'limit' => dol_strlen($text));
$i = 0;
foreach ($lead->lines as $line) {
// FIXME: line is an array, not an object
$line->fetch_thirdparty();
// Ref
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $line->ref, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => 'company', 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => dol_trunc($line->thirdparty->name, 40), 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
// Amount Guess
$this->info_box_contents[$i][4] = array('td' => 'align="left"', 'text' => price($line->amount_prosp, 'HTML') . $langs->getCurrencySymbol($conf->currency));
// Amount real
$this->info_box_contents[$i][5] = array('td' => 'align="left"', 'text' => $line->getRealAmount() . $langs->getCurrencySymbol($conf->currency));
$i++;
}
}
示例7: formObjectOptions
function formObjectOptions($parameters, &$object, &$action, $hookmanager)
{
global $conf, $langs, $db;
if ((in_array('ordercard', explode(':', $parameters['context'])) || in_array('propalcard', explode(':', $parameters['context']))) && $conf->global->REMISE_USE_WEIGHT) {
print '<script type="text/javascript">
$(document).ready(function() { ';
foreach ($object->lines as &$line) {
if ($line->fk_product_type == 0 && $line->fk_product > 0) {
dol_include_once('/product/class/product.class.php', 'Product');
$p = new Product($db);
$p->fetch($line->fk_product);
if ($p->id > 0) {
$weight_kg = $p->weight * $line->qty * pow(10, $p->weight_units);
$id_line = !empty($line->id) ? $line->id : $line->rowid;
if (!empty($weight_kg)) {
print '$("tr#row-' . $id_line . ' td:first").append(" - ' . $langs->trans('Weight') . ' : ' . $weight_kg . 'Kg");';
}
}
}
}
print '});
</script>';
}
return 0;
}
示例8: formObjectOptions
/** Overloading the doActions function : replacing the parent's function with the one below
* @param parameters meta datas of the hook (context, etc...)
* @param object the object you want to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param action current action (if set). Generally create or edit or null
* @return void
*/
function formObjectOptions($parameters, &$object, &$action, $hookmanager)
{
global $user;
if (($parameters['currentcontext'] == 'projectcard' || $parameters['currentcontext'] == 'productcard' || $parameters['currentcontext'] == 'thirdpartycard' || $parameters['currentcontext'] == 'usercard') && $action == '' && !empty($user->rights->query->dashboard->viewin)) {
define('INC_FROM_DOLIBARR', true);
dol_include_once('/query/config.php');
dol_include_once('/query/class/dashboard.class.php');
dol_include_once('/query/class/query.class.php');
$PDOdb = new TPDOdb();
$TDash = TQDashBoard::getDashboard($PDOdb, $parameters['currentcontext'], $user->id);
foreach ($TDash as $uid) {
$url = dol_buildpath('/query/dashboard.php?action=run&allow_gen=1&uid=' . $uid . '&table_element=' . $object->table_element . '&fk_object=' . $object->id, 1);
?>
<tr>
<td colspan="2">
<iframe src="<?php
echo $url;
?>
" width="100%" frameborder="0" onload="this.height = this.contentWindow.document.body.scrollHeight + 'px'"></iframe>
</td>
</tr>
<?php
}
}
}
示例9: _get_company_object
function _get_company_object(&$TRender)
{
global $db, $conf, $langs, $user;
dol_include_once('/societe/class/societe.class.php');
foreach ($TRender as $fk_soc => &$line) {
$s = new Societe($db);
$s->fetch($fk_soc);
$line['client'] = $s->name;
}
}
示例10: grapefruitGetTasksForProject
function grapefruitGetTasksForProject($name = 'fk_task', $socid = -1, $showempty = 1, $projectid = 0)
{
global $db;
dol_include_once('/core/class/html.form.class.php');
$form = new Form($db);
$TTask = getTaskByProjectId($projectid);
$return = array();
$return['value'] = $form->selectarray('fk_task', $TTask, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100 maxwidth300', 1);
echo json_encode($return);
}
示例11: check_user_password_otp
/**
* Check validity of user/password/entity
* If test is ko, reason must be filled into $_SESSION["dol_loginmesg"]
*
* @param string $usertotest Login
* @param string $passwordtotest Password
* @param int $entitytotest Number of instance (always 1 if module multicompany not enabled)
* @return string Login if OK, '' if KO
*/
function check_user_password_otp($usertotest, $passwordtotest, $entitytotest)
{
global $db, $conf, $dolibarr_main_cookie_cryptkey;
dol_include_once('/core/login/functions_dolibarr.php');
//We first check if user & password are OK
if (check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotest) == '') {
return '';
}
// Force master entity in transversal mode
$entity = $entitytotest;
if (!empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode)) {
$entity = 1;
}
$sql = 'SELECT rowid, otp_seed, otp_counter';
$sql .= ' FROM ' . MAIN_DB_PREFIX . "user";
$sql .= ' WHERE login = "' . $db->escape($usertotest) . '"';
$sql .= ' AND entity IN (0,' . ($entity ? $entity : 1) . ")";
dol_syslog("functions_dolibarr::check_user_password_dolibarr sql=" . $sql);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj) {
//The user has not configured an OTP key
if (!$obj->otp_seed) {
return $usertotest;
}
//Now we validate OTP
$providedOTP = GETPOST('otp');
if (empty($providedOTP)) {
return '';
}
/**
* Examples from http://es.php.net/mcrypt_encrypt
*/
$ciphertext_dec = base64_decode($obj->otp_seed);
$key = pack('H*', $dolibarr_main_cookie_cryptkey);
# recupera la IV, iv_size debería crearse usando mcrypt_get_iv_size()
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
$iv_dec = substr($ciphertext_dec, 0, $iv_size);
# recupera el texto cifrado (todo excepto el $iv_size en el frente)
$ciphertext_dec = substr($ciphertext_dec, $iv_size);
# podrían eliminarse los caracteres con valor 00h del final del texto puro
$otpSeed = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $ciphertext_dec, MCRYPT_MODE_CBC, $iv_dec);
$otplib = new \Rych\OTP\HOTP($otpSeed);
if ($otplib->validate($providedOTP, $obj->otp_counter)) {
$obj->otp_counter++;
$sql = "UPDATE " . MAIN_DB_PREFIX . "user SET otp_counter = '" . $obj->otp_counter . "' WHERE rowid = " . $obj->rowid;
$db->query($sql);
// Now the user is authenticated
return $usertotest;
}
}
}
return '';
}
示例12: setVersion
static function setVersion(&$DoliDb, $moduleName)
{
if (class_exists($moduleName)) {
dol_include_once('/core/lib/admin.lib.php');
$mod = new $moduleName($DoliDb);
if (!empty($mod->version)) {
$version = $mod->version;
dolibarr_set_const($DoliDb, 'ATM_MODULE_VERSION_' . strtoupper($moduleName), $version);
}
}
}
示例13: doActions
/**
* Overloading the doActions function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function doActions($parameters, &$object, &$action, $hookmanager)
{
//var_dump($parameters, $action);
if (!empty($parameters['currentcontext'])) {
$currentcontext = $parameters['currentcontext'];
} else {
$currentcontext = $parameters['context'];
}
// Retrocompatibility <= 3.6
$routeAction = $currentcontext . ':' . $action;
define('INC_FROM_DOLIBARR', true);
dol_include_once('/routing/config.php');
TRouting::route($routeAction, $object);
}
示例14: addMoreActionsButtons
/**
* Overloading the doActions function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
{
if (in_array('propalcard', explode(':', $parameters['context'])) || in_array('ordercard', explode(':', $parameters['context']))) {
global $langs, $conf;
$langs->load('free2product@free2product');
global $addButtonToConvertAll;
$base_new_ref = !empty($conf->global->FREE2PRODUCT_BASE_NEWREF) ? $conf->global->FREE2PRODUCT_BASE_NEWREF : 'FREELINE-';
if ($addButtonToConvertAll) {
// On ajoute l'inclusion d'abricot
define('INC_FROM_DOLIBARR', true);
dol_include_once('/free2product/config.php');
?>
<div class="inline-block divButAction">
<a class="butAction" href="javascript:convertAllFreeLine();">
<?php
echo $langs->trans('convertAllFreeLine');
?>
</a>
</div>
<div id="convertAllFreeLine_popup" style="display:none">
<?php
$formCore = new TFormCore();
?>
<table class="border" width="100%">
<?php
foreach ($object->lines as &$line) {
if ($line->product_type <= 1 && $line->fk_product == 0) {
$lineid = !empty($line->id) ? $line->id : $line->rowid;
// compatibilité 3.6
$desc = !empty($line->desc) ? $line->desc : $line->description;
// compatibilité 3.6
echo '<tr>
<td>' . $formCore->texte('', 'TFreeProduct[' . $line->id . '][ref]', $base_new_ref . $lineid, 15, 255, ' lineid="' . $lineid . '" label="' . htmlentities(addslashes($desc)) . '" qty="' . $line->qty . '" price="' . $line->subprice . '" product_type="' . $line->product_type . '" tva="' . $line->tva_tx . '" ') . '</td>
<td>' . $line->desc . '</td>
<td align="right">' . price($line->subprice) . '</td>
<td align="right">' . price($line->qty) . '</td>
</tr>';
}
}
?>
</table>
</div>
<?php
}
}
}
示例15: addEvent
static function addEvent($fk_facture, $ref = '')
{
global $db, $langs, $user;
dol_include_once('/comm/action/class/actioncomm.class.php');
$a = new ActionComm($db);
$a->type_code = 'AC_OTH_AUTO';
$a->label = $langs->trans('BillClassifyDeposed', $ref);
$a->fk_element = $fk_facture;
$a->elementtype = 'facture';
$a->usertodo = $user;
$a->userdone = $user;
$a->percentage = 100;
$a->datep = date('Y-m-d H:i:s');
$a->add($user);
}