コード例 #1
0
}
dol_include_once("/core/class/html.formother.class.php");
dol_include_once("/core/lib/company.lib.php");
$langs->load('of@of');
$PDOdb = new TPDOdb();
$action = __get('action');
switch ($action) {
    case 'createOFCommande':
        set_time_limit(0);
        _createOFCommande($PDOdb, $_REQUEST['TProducts'], $_REQUEST['TQuantites'], $_REQUEST['fk_commande'], $_REQUEST['fk_soc'], isset($_REQUEST['subFormAlone']));
        _liste($PDOdb);
        break;
    case 'printTicket':
        _printTicket($PDOdb);
    default:
        _liste($PDOdb);
        break;
}
/*
 * Créé des Of depuis un tableau de product
 */
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) {
            break;
        case 'save':
            $dolidacticiel->load($PDOdb, GETPOST('id'));
            $dolidacticiel->set_values($_REQUEST);
            $dolidacticiel->save($PDOdb);
            _fiche($PDOdb, $dolidacticiel, 'view');
            break;
        case 'liste':
            _liste($PDOdb, $dolidacticiel, $action);
            break;
        default:
            _liste($PDOdb, $dolidacticiel, $action);
            break;
    }
} else {
    _liste($PDOdb, $dolidacticiel, 'view');
}
llxFooter();
$db->close();
function _liste(&$PDOdb, &$dolidacticiel, $action)
{
    global $langs, $db, $user, $conf;
    /*
     * View
     */
    $page_name = "dolidacticielSetup";
    llxHeader('', $langs->trans($page_name));
    // Subheader
    $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
    print_fiche_titre($langs->trans($page_name), $linkback);
    // Configuration header
コード例 #3
0
<?php

require 'config.php';
dol_include_once('/of/class/ordre_fabrication_asset.class.php');
if (!$user->rights->of->of->lire) {
    accessforbidden();
}
dol_include_once("/core/class/html.formother.class.php");
$langs->load('asset@asset');
_liste();
function _liste()
{
    global $langs, $db, $user, $conf;
    $langs->load('asset@asset');
    llxHeader('', $langs->trans('ListControl'), '', '');
    getStandartJS();
    if (isset($_SESSION['AssetMsg'])) {
        print_r('<div class="info">' . $langs->trans($_SESSION['AssetMsg']) . '</div>');
        unset($_SESSION['AssetMsg']);
    }
    $form = new TFormCore();
    $assetControl = new TAssetControl();
    $r = new TSSRenderControler($assetControl);
    $sql = 'SELECT rowid as id, libelle, type, question, "" as action FROM ' . MAIN_DB_PREFIX . 'asset_control';
    $THide = array('id');
    $form = new TFormCore($_SERVER['PHP_SELF'], 'form', 'GET');
    $ATMdb = new TPDOdb();
    $r->liste($ATMdb, $sql, array('limit' => array('nbLine' => '30'), 'subQuery' => array(), 'link' => array('libelle' => '<a href="' . DOL_URL_ROOT . '/custom/asset/control.php?id=@id@">' . img_picto('', 'object_generic.png', '', 0) . '@val@</a>', 'question' => '<a href="' . DOL_URL_ROOT . '/custom/asset/control.php?id=@id@">@val@</a>', 'action' => '<a title="Modifier" href="control.php?id=@id@&action=edit">' . img_picto('', 'edit.png', '', 0) . '</a>&nbsp;&nbsp;&nbsp;<a title="Supprimer" onclick="if (!window.confirm(\'Confirmez-vous la suppression ?\')) return false;" href="control.php?id=@id@&action=delete">' . img_picto('', 'delete.png', '', 0) . "</a>"), 'search' => array('libelle' => array('recherche' => true, 'table' => '')), 'translate' => array(), 'hide' => $THide, 'liste' => array('titre' => $langs->trans('ListControl'), 'image' => img_picto('', 'title.png', '', 0), 'picto_precedent' => img_picto('', 'back.png', '', 0), 'picto_suivant' => img_picto('', 'next.png', '', 0), 'noheader' => 0, 'messageNothing' => $langs->trans('AssetEmptyControl'), 'picto_search' => img_picto('', 'search.png', '', 0)), 'title' => array('libelle' => 'Libelle', 'type' => 'Type', 'nb_value' => 'Nombre de valeurs associés', 'question' => 'Question', 'action' => 'Action'), 'eval' => array('type' => 'TAssetControl::$TType["@val@"]')));
    $form->end();
    echo '<div class="tabsAction">';
    echo '<a class="butAction" href="control.php?action=new">' . $langs->trans('AssetCreateControl') . '</a>';
コード例 #4
0
        $ideaItem = new TIdeaboxItem();
        $ideaItem->load($PDOdb, $id);
        if ($user->rights->ideabox->create < 1 && $ideaItem->fk_user != $user->id) {
            accessforbidden();
        }
        $idea = new TIdeabox();
        $idea->load($PDOdb, $ideaItem->fk_ideabox);
        $ideaItem->delete($PDOdb);
        setEventMessage($langs->trans('IdeaboxItemDeleteControlEvent'));
        header('Location: ' . dol_buildpath('/ideabox/ideabox.php', 2) . '?id=' . $idea->getId() . '&action=view');
        break;
    case 'liste':
    default:
        $idea = new TIdeabox();
        $idea->load($PDOdb, $id);
        _liste($PDOdb, $idea, 'view');
        break;
}
function _fiche(&$PDOdb, &$idea, $mode = 'view', $editValue = false)
{
    global $db, $langs, $user;
    llxHeader('', $langs->trans('IdeaboxAddItem'), '', '');
    /******/
    $TBS = new TTemplateTBS();
    $TBS->TBS->protect = false;
    $TBS->TBS->noerr = true;
    $form = new TFormCore($_SERVER['PHP_SELF'], 'form', 'POST');
    $form->Set_typeaff($mode);
    echo $form->hidden('id', $idea->getId());
    echo $form->hidden('action', 'save');
    $TIdeaboxItem = _fiche_ligne_ideabox_item($PDOdb, $idea->getId(), $mode);