當前位置: 首頁>>代碼示例>>PHP>>正文


PHP setEventMessage函數代碼示例

本文整理匯總了PHP中setEventMessage函數的典型用法代碼示例。如果您正苦於以下問題:PHP setEventMessage函數的具體用法?PHP setEventMessage怎麽用?PHP setEventMessage使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了setEventMessage函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: _createOFCommande

function _createOFCommande(&$PDOdb, $TProduct, $TQuantites, $fk_commande, $fk_soc, $oneOF = false)
{
    global $db, $langs;
    if (!empty($TProduct)) {
        if ($oneOF) {
            $assetOf = new TAssetOF();
            $assetOf->fk_commande = $fk_commande;
        }
        foreach ($TProduct as $fk_commandedet => $v) {
            foreach ($v as $fk_product => $dummy) {
                if (!$oneOF) {
                    $assetOf = new TAssetOF();
                    $assetOf->fk_commande = $fk_commande;
                }
                if ($assetOf->fk_commande > 0) {
                    $com = new Commande($db);
                    //TODO on est pas censé toujours être sur la même commande ? AA
                    $com->fetch($assetOf->fk_commande);
                    $assetOf->fk_project = $com->fk_project;
                    if (!empty($com->date_livraison)) {
                        $assetOf->date_besoin = $com->date_livraison;
                    }
                }
                /*				pre($TQuantites,true);
                				pre($TProduct,true);exit;*/
                $qty = $TQuantites[$fk_commandedet];
                //print "$fk_product x $qty<br />";
                $assetOf->fk_soc = $fk_soc;
                $assetOf->addLine($PDOdb, $fk_product, 'TO_MAKE', $qty, 0, '', 0, $fk_commandedet);
                $assetOf->save($PDOdb);
            }
        }
        setEventMessage($langs->trans('OFAsset') . " créé(s) avec succès", 'mesgs');
    }
}
開發者ID:ATM-Consulting,項目名稱:dolibarr_module_of,代碼行數:35,代碼來源:liste_of.php

示例3: updateAllSoc

 function updateAllSoc(&$PDOdb)
 {
     global $langs, $conf, $user, $db;
     $TUser = TCommercialCategory::getUser($PDOdb, $this->fk_category);
     // useless, just for popup
     $nb_user = count($TUser);
     $TSociete = TCommercialCategory::getSociete($PDOdb, $this->fk_category);
     $nb_soc = count($TSociete);
     foreach ($TSociete as &$soc) {
         self::updateSociete($PDOdb, $soc);
     }
     setEventMessage($langs->trans('CategUserAffectation', $nb_user, $nb_soc));
 }
開發者ID:ATM-Consulting,項目名稱:dolibarr_module_commercialbycategory,代碼行數:13,代碼來源:commercialcategory.class.php

示例4: del

 static function del(&$PDOdb, $id_charge)
 {
     $recurrence = self::get_recurrence($PDOdb, $id_charge);
     if (isset($recurrence)) {
         $message = 'Récurrence de la charge sociale ' . $id_charge . ' supprimée.';
         setEventMessage($message);
         return $recurrence->delete($PDOdb);
     } else {
         $message = 'Suppression impossible : Récurrence de la charge sociale ' . $id_charge . ' introuvable.';
         setEventMessage($message, 'errors');
         return false;
     }
 }
開發者ID:vinclar,項目名稱:dolibarr_module_recurence,代碼行數:13,代碼來源:recurrence.class.php

示例5: formObjectOptions

    public function formObjectOptions($parameters, &$object, &$action, HookManager $hookManager)
    {
        global $db, $user, $langs, $mysoc, $dolibarr_main_cookie_cryptkey;
        $langs->load('otp@otp');
        $regenerate_button = '<form method="post">
			<input type="submit" value="' . $langs->trans('OTPRegenerate') . '" class="button" name="regenerate_otp">
		</form>';
        if ($action == '') {
            print '<tr><td>' . $langs->trans('OTPLogin') . '</td><td colspan="2">';
            if (GETPOST('regenerate_otp')) {
                if ($user->admin || $user->id == GETPOST('id', 'int')) {
                    /**
                     * Examples from http://es.php.net/mcrypt_encrypt
                     */
                    // Generates a 20-byte (160-bit) secret key
                    $otpSeed = Seed::generate();
                    $base32Seed = $otpSeed->getValue(Seed::FORMAT_BASE32);
                    $key = pack('H*', $dolibarr_main_cookie_cryptkey);
                    # crear una aleatoria IV para utilizarla co condificación CBC
                    $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
                    $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
                    $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $base32Seed, MCRYPT_MODE_CBC, $iv);
                    # anteponer la IV para que esté disponible para el descifrado
                    $ciphertext = $iv . $ciphertext;
                    # codificar el texto cifrado resultante para que pueda ser representado por un string
                    $ciphertext_base64 = base64_encode($ciphertext);
                    $sql = "UPDATE " . MAIN_DB_PREFIX . "user SET otp_seed = '" . $db->escape($ciphertext_base64) . "', otp_counter = 0 WHERE rowid = " . $user->id;
                    $db->query($sql);
                    $qrCode = new QrCode();
                    $qrCode->setText("otpauth://hotp/" . $mysoc->name . ":" . $user->login . "?secret=" . $base32Seed . "&issuer=" . $mysoc->name);
                    $qrCode->setSize(96);
                    $qrCode->setPadding(5);
                    $img_path = __DIR__ . '/../tmp/' . $user->id . '.png';
                    $qrCode->save($img_path);
                    //Qrcode library doesn't warn on image creation error
                    if (file_exists($img_path)) {
                        print '<img src="' . dol_buildpath('/otp/showdoc.php', 1) . '?img=' . $user->id . '"><br>' . $langs->trans('OTPTroubleHash') . '<br />
				<span style="font-family:monospace;font-size:20px">' . $base32Seed . '</span><br>' . $langs->trans('OTPKeyType');
                    } else {
                        print $regenerate_button;
                        setEventMessage('ErrorCreatingImage', 'errors');
                    }
                }
            } else {
                if ($user->admin || $user->id == GETPOST('id', 'int')) {
                    print $regenerate_button;
                }
            }
            print '</td></tr>';
        }
    }
開發者ID:Getron,項目名稱:dolibarr-otp,代碼行數:51,代碼來源:actions_otp.class.php

示例6: doActions

 function doActions($parameters, &$object, &$action)
 {
     global $langs, $user;
     $langs->load('resource@resource');
     if (in_array('element_resource', explode(':', $parameters['context']))) {
         // Efface une ressource
         if ($action == 'confirm_delete_resource' && $user->rights->resource->delete && GETPOST('confirm') == 'yes') {
             $res = $object->fetch(GETPOST('lineid'));
             if ($res) {
                 $result = $object->delete_resource(GETPOST('lineid'), GETPOST('element'));
                 if ($result >= 0) {
                     setEventMessage($langs->trans('RessourceLineSuccessfullyDeleted'));
                     Header("Location: " . $_SERVER['PHP_SELF'] . "?element=" . GETPOST('element') . "&element_id=" . GETPOST('element_id'));
                     exit;
                 } else {
                     setEventMessage($object->error, 'errors');
                 }
             }
         }
         // Update ressource
         if ($action == 'update_resource' && $user->rights->resource->write && !GETPOST('cancel')) {
             $res = $object->fetch(GETPOST('lineid'));
             if ($res) {
                 $object->id = GETPOST('lineid');
                 $object->busy = GETPOST('busy');
                 $object->mandatory = GETPOST('mandatory');
                 $result = $object->update();
                 if ($result >= 0) {
                     setEventMessage($langs->trans('RessourceLineSuccessfullyUpdated'));
                     Header("Location: " . $_SERVER['PHP_SELF'] . "?element=" . GETPOST('element') . "&element_id=" . GETPOST('element_id'));
                     exit;
                 } else {
                     setEventMessage($object->error, 'errors');
                 }
             }
         }
     }
 }
開發者ID:jmmu,項目名稱:dolibarr-resource,代碼行數:38,代碼來源:actions_resource.class.php

示例7: del

 static function del(&$PDOdb, $id_charge)
 {
     global $conf, $db, $user;
     $recurrence = self::get_recurrence($PDOdb, $id_charge);
     if (isset($recurrence)) {
         $message = 'Récurrence de la charge sociale ' . $id_charge . ' supprimée.';
         setEventMessage($message);
         //Suppression de toutes les charges sociales créé dans le futur lié à cette récurrence
         if ($conf->global->RECURRENCE_DELETE_FUTUR_SOCIAL_TAXES) {
             $TCharges = self::get_prochaines_charges($PDOdb, $id_charge, date('Y-m-d'));
             foreach ($TCharges as $charge) {
                 $chargesocial = new ChargeSociales($db);
                 $chargesocial->fetch($charge->rowid);
                 $chargesocial->delete($user);
             }
         }
         return $recurrence->delete($PDOdb);
     } else {
         $message = 'Suppression impossible : Récurrence de la charge sociale ' . $id_charge . ' introuvable.';
         setEventMessage($message, 'errors');
         return false;
     }
 }
開發者ID:ATM-Consulting,項目名稱:dolibarr_module_recurence,代碼行數:23,代碼來源:recurrence.class.php

示例8: mouvement

 function mouvement(&$PDOdb, &$object, $fk_product, $qty, $fk_warehouse_from, $fk_warehouse_to)
 {
     global $db, $user, $langs;
     dol_include_once('/product/stock/class/mouvementstock.class.php');
     dol_include_once('/product/class/product.class.php');
     /*var_dump($fk_product, $qty,$fk_warehouse_from, $fk_warehouse_to);
     		exit;
     			*/
     $stock = new MouvementStock($db);
     $label = '';
     if (method_exists($object, 'getNomUrl')) {
         $label .= $object->getNomUrl(1);
     }
     if (!empty($conf->global->ROUTING_INFO_ALERT)) {
         $product = new Product($db);
         $product->fetch($fk_product);
         $msg = $product->getNomUrl(0) . ' ' . $product->label . ' ' . $langs->trans('MoveFrom') . ' ' . $wh_from_label . ' ' . $langs->trans('MoveTo') . ' ' . $wh_to_label;
         setEventMessage($msg);
     }
     $stock->origin = $object;
     $stock->reception($user, $fk_product, $fk_warehouse_to, $qty, 0, $label);
     $stock->livraison($user, $fk_product, $fk_warehouse_from, $qty, 0, $label);
 }
開發者ID:ATM-Consulting,項目名稱:dolibarr_module_routing,代碼行數:23,代碼來源:routing.class.php

示例9: Societe

    exit;
}
if (GETPOST("action") == 'setremise') {
    $soc = new Societe($db);
    $soc->fetch($_GET["id"]);
    $result = $soc->set_remise_client($_POST["remise"], $_POST["note"], $user);
    if ($result > 0) {
        if (!empty($backtopage)) {
            header("Location: " . $backtopage);
            exit;
        } else {
            header("Location: remise.php?id=" . $_GET["id"]);
            exit;
        }
    } else {
        setEventMessage($soc->error, 'errors');
    }
}
/*
 * View
 */
$form = new Form($db);
llxHeader();
/*********************************************************************************
 *
 * Mode fiche
 *
 *********************************************************************************/
if ($socid > 0) {
    // On recupere les donnees societes par l'objet
    $objsoc = new Societe($db);
開發者ID:TAASA,項目名稱:Dolibarr-ERP-3.8.1,代碼行數:31,代碼來源:remise.php

示例10: setEventMessage

        $object->fk_parent = $parent;
    }
    $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
    if (!$object->label) {
        $error++;
        $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref"));
        $action = 'create';
    }
    // Create category in database
    if (!$error) {
        $result = $object->create($user);
        if ($result > 0) {
            $action = 'confirmed';
            $_POST["addcat"] = '';
        } else {
            setEventMessage($object->error, 'errors');
        }
    }
}
// Confirm action
if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->creer) {
    // Action confirmation de creation categorie
    if ($action == 'confirmed') {
        if ($urlfrom) {
            header("Location: " . $urlfrom);
            exit;
        } else {
            if ($idProdOrigin) {
                header("Location: " . DOL_URL_ROOT . '/categories/categorie.php?id=' . $idProdOrigin . '&mesg=' . urlencode($langs->trans("CatCreated")));
                exit;
            } else {
開發者ID:LionSystemsSolutions,項目名稱:El-Canelo-ERP,代碼行數:31,代碼來源:fiche.php

示例11: accessforbidden

}
$limit = $conf->liste_limit;
$offset = $limit * $page;
if (!$user->admin) {
    accessforbidden();
}
/*
 * Actions
 */
if ($action == 'delete') {
    $file = $conf->admin->dir_output . '/' . GETPOST('urlfile');
    $ret = dol_delete_file($file, 1);
    if ($ret) {
        setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
    } else {
        setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
    }
    $action = '';
}
/*
 * View
 */
$form = new Form($db);
$formfile = new FormFile($db);
$label = getStaticMember($db, 'label');
$help_url = 'EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad';
llxHeader('', '', $help_url);
?>
<script type="text/javascript">
jQuery(document).ready(function() {
開發者ID:LionSystemsSolutions,項目名稱:El-Canelo-ERP,代碼行數:30,代碼來源:dolibarr_export.php

示例12: header

            }
            if ($result >= 0) {
                $db->commit();
                header("Location: " . DOL_URL_ROOT . '/compta/salaries/index.php');
                exit;
            } else {
                $object->error = $accountline->error;
                $db->rollback();
                setEventMessage($object->error, 'errors');
            }
        } else {
            $db->rollback();
            setEventMessage($object->error, 'errors');
        }
    } else {
        setEventMessage('Error try do delete a line linked to a conciliated bank transaction', 'errors');
    }
}
/*
 *	View
 */
llxHeader();
$form = new Form($db);
if ($id) {
    $object = new PaymentSalary($db);
    $result = $object->fetch($id);
    if ($result <= 0) {
        dol_print_error($db);
        exit;
    }
}
開發者ID:TAASA,項目名稱:Dolibarr-ERP-3.8.1,代碼行數:31,代碼來源:card.php

示例13: setEventMessage

        //Verify if process() works
        $res = $price_updaters->process();
        if ($res > 0) {
            $res = $price_updaters->update($user);
        }
        if ($res > 0) {
            $action = '';
        } else {
            setEventMessage($price_updaters->error, 'errors');
        }
    } elseif ($action == 'delete_updater') {
        $res = $price_updaters->delete($selection, $user);
        if ($res > 0) {
            $action = '';
        } else {
            setEventMessage($price_updaters->error, 'errors');
        }
    }
} elseif (!empty($cancel)) {
    $action = '';
}
/*
 * View
 */
//Header
llxHeader("", "", $langs->trans("CardProduct" . $product->type));
print load_fiche_titre($langs->trans("DynamicPriceConfiguration"));
$form = new Form($db);
//Global variables table
if ($action != 'create_updater' && $action != 'edit_updater') {
    print $langs->trans("GlobalVariables");
開發者ID:Samara94,項目名稱:dolibarr,代碼行數:31,代碼來源:dynamic_prices.php

示例14: array

// j is module number. Automatically affected if module number not defined.
$modNameLoaded = array();
foreach ($modulesdir as $dir) {
    // Load modules attributes in arrays (name, numero, orders) from dir directory
    //print $dir."\n<br>";
    dol_syslog("Scan directory " . $dir . " for module descriptor files (modXXX.class.php)");
    $handle = @opendir($dir);
    if (is_resource($handle)) {
        while (($file = readdir($handle)) !== false) {
            //print "$i ".$file."\n<br>";
            if (is_readable($dir . $file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
                $modName = substr($file, 0, dol_strlen($file) - 10);
                if ($modName) {
                    if (!empty($modNameLoaded[$modName])) {
                        $mesg = "Error: Module " . $modName . " was found twice: Into " . $modNameLoaded[$modName] . " and " . $dir . ". You probably have an old file on your disk.<br>";
                        setEventMessage($mesg, 'warnings');
                        dol_syslog($mesg, LOG_ERR);
                        continue;
                    }
                    try {
                        $res = (include_once $dir . $file);
                        if (class_exists($modName)) {
                            try {
                                $objMod = new $modName($db);
                                $modNameLoaded[$modName] = $dir;
                                if ($objMod->numero > 0) {
                                    $j = $objMod->numero;
                                } else {
                                    $j = 1000 + $i;
                                }
                                $modulequalified = 1;
開發者ID:LionSystemsSolutions,項目名稱:El-Canelo-ERP,代碼行數:31,代碼來源:modules.php

示例15: setEventMessage

            exit;
        } else {
            $action = 'create';
            setEventMessage($menu->error, 'errors');
        }
    }
}
// delete
if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') {
    $this->db->begin();
    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "menu WHERE rowid = " . $_GET['menuId'];
    $db->query($sql);
    if ($result == 0) {
        $this->db->commit();
        llxHeader();
        setEventMessage($langs->trans("MenuDeleted"));
        llxFooter();
        exit;
    } else {
        $this->db->rollback();
        $reload = 0;
        $_GET["action"] = '';
    }
}
/*
 * View
 */
$form = new Form($db);
$formadmin = new FormAdmin($db);
llxHeader('', $langs->trans("Menu"));
if ($action == 'create') {
開發者ID:TAASA,項目名稱:Dolibarr-ERP-3.8.1,代碼行數:31,代碼來源:edit.php


注:本文中的setEventMessage函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。