Exemplo n.º 1
0
 /**
  * @brief get a list
  * @parameter $p_cn database connection
  * @return array of data from document_type
  */
 static function get_list($p_cn)
 {
     $sql = "select * from document_type order by dt_value";
     $r = $p_cn->get_array($sql);
     $array = array();
     for ($i = 0; $i < count($r); $i++) {
         $tmp['dt_value'] = $r[$i]['dt_value'];
         $tmp['dt_prefix'] = $r[$i]['dt_prefix'];
         $bt = new IButton('M' . $r[$i]['dt_id']);
         $bt->label = _('Modifier');
         $bt->javascript = "cat_doc_change('" . $r[$i]['dt_id'] . "','" . Dossier::id() . "');";
         $tmp['js_mod'] = $bt->input();
         $tmp['dt_id'] = $r[$i]['dt_id'];
         $bt = new IButton('X' . $r[$i]['dt_id']);
         $bt->label = _('Effacer');
         $bt->javascript = "confirm_box('X{$r[$i]['dt_id']}','" . _('Vous confirmez') . "',";
         $bt->javascript .= "function () { cat_doc_remove('{$r[$i]['dt_id']}','" . Dossier::id() . "');})";
         $tmp['js_remove'] = $bt->input();
         $array[$i] = $tmp;
     }
     return $array;
 }
Exemplo n.º 2
0
         pcmn_update(<?php 
echo Dossier::id();
?>
,'');
     }
     $('pcmn_update_add_bt2').onclick = function () 
     {
         pcmn_update(<?php 
echo Dossier::id();
?>
,'');
     }
     $('pcmn_update_add_bt3').onclick = function () 
     {
         pcmn_update(<?php 
echo Dossier::id();
?>
,'');
     }
     window.onscroll=function () {
         if ( document.viewport.getScrollOffsets().top> 0) {
             if ($('go_up').visible() == false) {
                $('go_up').setOpacity(0.8); 
                $('go_up').show();
            }
        } else {
            $('go_up').hide();
        }
     }
</script>
<?php 
Exemplo n.º 3
0
 static function connect()
 {
     $id = Dossier::id();
     $cn = new Database($id);
     return $cn;
 }
Exemplo n.º 4
0
 function display_form_plan($p_array, $p_null, $p_mode, $p_seq, $p_amount, $p_id = '', $p_add_button = true)
 {
     if ($p_array != null) {
         extract($p_array);
     }
     $result = "";
     $plan = new Anc_Plan($this->db);
     $a_plan = $plan->get_list(" order by pa_id ");
     if (empty($a_plan)) {
         return "";
     }
     $table_id = "t" . $p_seq;
     $hidden = new IHidden();
     $readonly = $p_mode == 1 ? false : true;
     $result .= $hidden->input('amount_' . $table_id, $p_amount);
     if ($p_mode == 1) {
         $result .= '<table id="' . $p_id . $table_id . '">';
     } else {
         $result .= '<table>';
     }
     $result .= "<tr>" . $plan->header() . "<th>montant</th></tr>";
     /* compute the number of rows */
     $nb_row = isset($val[$p_seq]) ? count($val[$p_seq]) : 1;
     $count = 0;
     $remain = abs($p_amount);
     $ctrl_remain = "remain" . $this->in_div . $table_id;
     for ($i = 0; $i < $nb_row; $i++) {
         $result .= '<tr>';
         foreach ($a_plan as $r_plan) {
             $array = $this->db->make_array("select po_id as value," . " html_quote(po_name) as label from poste_analytique " . " where pa_id = " . $r_plan['id'] . " order by po_name", $p_null);
             $select = new ISelect("hplan[" . $p_seq . "][]", $array);
             $select->table = 0;
             // view only or editables
             if ($p_mode == 1) {
                 // editable
                 $select->readonly = false;
                 if (isset($hplan) && isset($hplan[$p_seq][$count])) {
                     $select->selected = $hplan[$p_seq][$count];
                 }
             } else {
                 if (isset($hplan) && isset($hplan[$p_seq][$count])) {
                     $select->selected = $hplan[$p_seq][$count];
                 }
                 // view only
                 $select->readOnly = true;
             }
             if ($p_mode == 1) {
                 $result .= '<td>' . $select->input() . '</td>';
             } else {
                 $result .= '<td>' . $select->display() . '</td>';
             }
             $count++;
         }
         $value = new INum();
         $value->javascript = 'onchange="format_number(this);anc_refresh_remain(\'' . $this->in_div . $table_id . '\',\'' . $p_seq . '\')"';
         $value->name = "val[" . $p_seq . "][]";
         $value->size = 6;
         $value->value = isset($val[$p_seq][$i]) ? $val[$p_seq][$i] : abs($p_amount);
         $value->readOnly = $p_mode == 1 ? false : true;
         $remain = bcsub($remain, $value->value);
         $result .= '<td>' . $value->input() . '</td>';
         $result .= "</tr>";
     }
     $result .= "</table>";
     if ($p_add_button && $p_mode == 1) {
         $style_remain = $remain == 0 ? 'style="color:green"' : ' style="color:red"';
         $result .= " Reste à imputer =  " . '<span class="remain" ' . $style_remain . ' id="' . $ctrl_remain . '">' . $remain . '</span>';
         // add a button to add a row
         $button = new IButton();
         $button->javascript = "add_row('" . $p_id . "{$table_id}',{$p_seq});";
         $button->name = "js" . $p_id . $p_seq;
         $button->label = _("Nouvelle ligne");
         $result .= "<br>" . $button->input();
         /**
          * Add a button for distribution key
          * 
          */
         $ledger = HtmlInput::default_value_post("p_jrn", 0);
         if ($ledger == 0) {
             $ledger = $this->db->get_value('select j_jrn_def from jrnx where j_id=$1', array($this->j_id));
         }
         $gDossier = Dossier::id();
         $button_key = new IButton();
         $button_key->javascript = "anc_key_choice(" . $gDossier . ",'" . $p_id . "{$table_id}',{$p_amount},'" . $ledger . "');";
         $button_key->name = "js" . $p_id . $p_seq;
         $button_key->label = _("Clef");
         $result .= $button_key->input();
     }
     return $result;
 }
Exemplo n.º 5
0
            $js = sprintf(' onclick="%s"', $amenu[$i]['me_javascript']);
        } else {
            $a_request = explode('/', $_REQUEST['ac']);
            if ($level == 0) {
                $url = $a_request[0];
                if (count($a_request) > 1 && $url . '/' . $amenu[$i]['me_code'] == $a_request[0] . '/' . $a_request[1]) {
                    $class = "selectedcell";
                }
            } elseif ($level == 1) {
                $url = $a_request[0] . '/' . $a_request[1];
            }
            $url .= '/' . $amenu[$i]['me_code'];
            if ($url == $_REQUEST['ac']) {
                $class = "selectedcell";
            }
            $url = "do.php?gDossier=" . Dossier::id() . "&ac=" . $url;
        }
        ?>
	<td class="<?php 
        echo $class;
        ?>
">
	    <a class="mtitle" href="<?php 
        echo $url;
        ?>
" <?php 
        echo $js;
        ?>
 title="<?php 
        echo h(gettext($amenu[$i]['me_description']));
        ?>
Exemplo n.º 6
0
/**
 * show the module
 * @global $g_user
 * @param $module the $_REQUEST['ac'] exploded into an array
 * @param  $idx the index of the array : the AD code is splitted into an array thanks the slash
 */
function show_menu($module)
{
    if ($module == 0) {
        return;
    }
    static $level = 0;
    global $g_user;
    $cn = Dossier::connect();
    /**
     * Show the submenus
     */
    $amenu = $cn->get_array("\n        select \n            pm_id,\n            me_code,\n            pm_id_dep,\n            me_file,\n            me_javascript,\n            me_url,\n            me_menu,\n            me_description,\n            me_description_etendue\n            from profile_menu \n            join menu_ref using (me_code) \n            where pm_id_dep=\$1 and p_id=\$2\n\t order by p_order", array($module, $g_user->get_profile()));
    // There are submenuS, so show them
    if (!empty($amenu) && count($amenu) > 1) {
        $a_style_menu = array('topmenu', 'menu2', 'menu3');
        if ($level > count($a_style_menu)) {
            $style_menu = 'menu3';
        } else {
            $style_menu = $a_style_menu[$level];
        }
        require 'template/menu.php';
    } elseif (count($amenu) == 1) {
        if (trim($amenu[0]['me_url']) != "" || trim($amenu[0]['me_file']) != "" || trim($amenu[0]['me_javascript']) != "") {
            echo '<div class="topmenu">';
            echo h2info(_($amenu[0]['me_menu']));
            echo '</div>';
            $module = $amenu[0]['pm_id'];
        } else {
            $url = $_REQUEST['ac'] . '/' . $amenu[0]['me_code'];
            echo '<a href="do.php?gDossier=' . Dossier::id() . '&ac=' . $url . '">';
            echo _($amenu[0]['me_menu']);
            echo '</a>';
            $level++;
            return;
        }
    }
    // There is no submenu or only one
    if (empty($amenu) || count($amenu) == 1) {
        $file = $cn->get_array("select me_file,me_parameter,me_javascript,me_type\n\t\tfrom menu_ref\n\t\tjoin profile_menu using (me_code)\n\t\tjoin profile_user using (p_id)\n\t\twhere\n\t\tpm_id=\$1 and\n\t\tuser_name=\$2 and\n\t\t(me_file is not null or trim(me_file) <>'' or\n\t\tme_javascript is not null or trim (me_javascript) <> '')", array($module, $g_user->login));
        if (count($file) == 0) {
            return;
        }
        if ($file[0]['me_file'] != "") {
            if ($file[0]['me_parameter'] !== "") {
                // if there are paramter put them in superglobal
                $array = compute_variable($file[0]['me_parameter']);
                put_global($array);
            }
            if (DEBUG) {
                echo $file[0]['me_file'], " param : ", $file[0]['me_parameter'];
            }
            /*
             * Log the file we input to put in the folder test-noalyss for replaying it
             */
            if (LOGINPUT) {
                $file_loginput = fopen($_ENV['TMP'] . '/scenario-' . $_SERVER['REQUEST_TIME'] . '.php', 'a+');
                fwrite($file_loginput, "include '" . $file[0]['me_file'] . "';");
                fwrite($file_loginput, "\n");
                fclose($file_loginput);
            }
            // if file is not a plugin, include the file, otherwise
            // include the plugin launcher
            if ($file[0]['me_type'] != 'PL') {
                require_once $file[0]['me_file'];
            } else {
                require 'extension_get.inc.php';
            }
            exit;
        }
        if ($file[0]['me_javascript'] != '') {
            $js = str_replace('<DOSSIER>', dossier::id(), $file[0]['me_javascript']);
            echo create_script($js);
        }
    }
    $level++;
}
Exemplo n.º 7
0
 /**
  * display all the accessible export of a profile $p_id
  * @param type $p_id profile.p_id
  */
 function printing()
 {
     $ret = $this->cn->exec_sql("\n                            SELECT pm_id,\n                                pm.me_code,\n                                me_code_dep,\n                                p_id,\n                                p_order,\n                                p_type_display,\n                                pm_default,\n                                pm_desc,\n                                me_menu,\n                                me_description\n                                FROM profile_menu as pm\n                                        join profile_menu_type on (p_type_display=pm_type)\n                                        join menu_ref as mr on (mr.me_code=pm.me_code)\n                                where\n                                p_id=\$1 and me_type='PR'\n                                order by p_order asc\n\t\t\t\t\t\t\t", array($this->p_id));
     // Menu by module
     $gDossier = Dossier::id();
     $this->sub_menu($ret, $this->p_id);
 }
Exemplo n.º 8
0
 * for delete
 * - gDossier
 * - i id
 */
define('ALLOWED', 1);
require_once '../include/constant.php';
require_once NOALYSS_INCLUDE . '/class_dossier.php';
require_once NOALYSS_INCLUDE . '/class_todo_list.php';
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_user.php';
mb_internal_encoding("UTF-8");
$cn = Dossier::connect();
global $g_user;
$g_user = new User($cn);
$g_user->check(true);
$g_user->check_dossier(Dossier::id(), true);
set_language();
ajax_disconnected('add_todo_list');
////////////////////////////////////////////////////////////////////////////////
// Display the note
////////////////////////////////////////////////////////////////////////////////
if (isset($_REQUEST['show'])) {
    $cn = new Database(dossier::id());
    $todo = new Todo_list($cn);
    $todo->set_parameter('id', $_REQUEST['id']);
    $todo->load();
    $content = $todo->display();
    header('Content-type: text/xml; charset=UTF-8');
    $dom = new DOMDocument('1.0', 'UTF-8');
    $tl_id = $dom->createElement('tl_id', $todo->get_parameter('id'));
    $tl_content = $dom->createElement('tl_content', $content);
Exemplo n.º 9
0
 function display_form_periode()
 {
     $str_dossier = dossier::get();
     if ($this->jrn_def_id == 0) {
         $Res = $this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice,\n                                     (select count(jr_id) as count_op from jrn where jr_tech_per = p_id) as count_op\n                                     from parm_periode\n                                     order by p_start,p_end");
         $Max = Database::num_row($Res);
         echo '<form id="periode_frm" method="POST" onsubmit="return confirm_box(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >';
         echo HtmlInput::array_to_hidden(array('ac', 'gDossier', 'jrn_def_id', 'choose'), $_REQUEST);
         echo '<TABLE ALIGN="CENTER">';
         echo "</TR>";
         echo '<th>' . ICheckBox::toggle_checkbox("per_toggle", "periode_frm") . "</th>";
         echo '<TH> Date d&eacute;but </TH>';
         echo '<TH> Date fin </TH>';
         echo '<TH> Exercice </TH>';
         echo "</TR>";
         for ($i = 0; $i < $Max; $i++) {
             $l_line = Database::fetch_array($Res, $i);
             $class = "even";
             if ($i % 2 == 0) {
                 $class = "odd";
             }
             $style = '';
             if ($l_line['p_closed'] == 't') {
                 $style = "color:red";
             }
             echo '<TR class="' . $class . '" style="' . $style . '">';
             echo '<td>';
             if ($l_line['p_closed'] == 'f') {
                 $per_to_close = new ICheckBox('sel_per_close[]');
                 $per_to_close->value = $l_line['p_id'];
                 echo $per_to_close->input();
             }
             echo '</td>';
             echo '<TD ALIGN="CENTER"> ' . $l_line['date_start'] . '</TD>';
             echo '<TD  ALIGN="CENTER"> ' . $l_line['date_end'] . '</TD>';
             echo '<TD  ALIGN="CENTER"> ' . $l_line['p_exercice'] . '</TD>';
             if ($l_line['p_closed'] == 't') {
                 $closed = $l_line['p_central'] == 't' ? '<TD>Centralis&eacute;e</TD>' : '<TD>Ferm&eacute;e</TD>';
                 $change = '<TD></TD>';
                 $remove = sprintf(_('Nombre opérations %d'), $l_line['count_op']);
                 $remove = td($remove, ' class="mtitle" ');
                 $change = td('<A class="mtitle" HREF="javascript:void(0)"' . ' onclick="return confirm_box(null,\'' . _('Confirmez Réouverture') . ' ?\',function() {window.location=\'do.php?ac=' . $_REQUEST['ac'] . '&action=reopen&p_per=' . $l_line['p_id'] . '&' . $str_dossier . '\';} )"> Réouverture</A>', ' class="mtitle"');
             } else {
                 if ($l_line['count_op'] == 0) {
                     $change = HtmlInput::display_periode($l_line['p_id']);
                 } else {
                     $change = "Non modifiable";
                 }
                 $change = td($change, ' class="mtitle" ');
                 $reopen = td("");
                 $remove = '<TD class="mtitle">';
                 if ($l_line['count_op'] == 0) {
                     $go = 'do.php?' . http_build_query(array('ac' => $_REQUEST['ac'], 'action' => 'delete_per', 'p_per' => $l_line['p_id'], 'gDossier' => Dossier::id()));
                     $remove .= '<A class="mtitle" HREF="javascript:void(0)" ' . 'onclick="return confirm_box (null,\'' . _('Confirmez effacement ?') . '\',function() { window.location=\'' . $go . '\'});" >' . ' Efface</A>';
                 } else {
                     $remove .= sprintf(_('Nombre opérations %d'), $l_line['count_op']);
                 }
                 $remove .= '</td>';
             }
             echo $change;
             echo $remove;
             echo '</TR>';
         }
         echo '</table>';
         echo '<p style="text-align:center">';
         echo HtmlInput::hidden("close_per", 1);
         echo HtmlInput::submit('close_per_bt', 'Fermeture des périodes sélectionnées');
         echo '</p>';
         echo '</form>';
         $but = new IButton('show_per_add', 'Ajout d\'une période');
         $but->javascript = "\$('periode_add_div').show();";
         echo $but->input();
         echo '<div class="inner_box" style="width:40%;" id="periode_add_div">';
         echo HtmlInput::title_box("Ajout d'une période", "periode_add_div", "hide");
         echo '<FORM  METHOD="POST">';
         echo dossier::hidden();
         $istart = new IDate('p_date_start');
         $iend = new IDate('p_date_end');
         $iexercice = new INum('p_exercice');
         $iexercice->size = 5;
         echo '<table>';
         echo '<TR> ';
         echo td('Date de début');
         echo td($istart->input());
         echo '</tr><tr>';
         echo td('Date de fin');
         echo td($iend->input());
         echo '</tr><tr>';
         echo td('Exercice');
         echo td($iexercice->input());
         echo '</TABLE>';
         echo HtmlInput::submit('add_per', 'Valider');
         echo '</FORM>';
         echo '</div>';
         echo create_script("\$('periode_add_div').hide();new Draggable('periode_add_div',{starteffect:function()\n                                  {\n                                     new Effect.Highlight(obj.id,{scroll:window,queue:'end'});\n                                  }}\n                         );");
     } else {
         $Res = $this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,status,p_exercice\n                                     from parm_periode join jrn_periode using (p_id) where jrn_def_id=" . $this->jrn_def_id . "\n                                     order by p_start,p_end");
         $Max = Database::num_row($Res);
         $r = $this->cn->exec_sql('select jrn_Def_name from jrn_Def where jrn_Def_id=' . $this->jrn_def_id);
         $jrn_name = Database::fetch_result($r, 0, 0);
         echo '<h2> Journal ' . $jrn_name . '</h2>';
         echo '<form id="periode_frm" method="POST" onsubmit="return confirm_box(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >';
         echo HtmlInput::array_to_hidden(array('ac', 'gDossier', 'jrn_def_id', 'choose'), $_REQUEST);
         echo '<TABLE ALIGN="CENTER">';
         echo "</TR>";
         echo '<th>' . ICheckBox::toggle_checkbox("per_toggle", "periode_frm") . "</th>";
         echo '<TH> Date d&eacute;but </TH>';
         echo '<TH> Date fin </TH>';
         echo '<TH> Exercice </TH>';
         echo "</TR>";
         for ($i = 0; $i < $Max; $i++) {
             $l_line = Database::fetch_array($Res, $i);
             if ($l_line['status'] != 'OP') {
                 echo '<TR style="COLOR:RED">';
             } else {
                 echo '<TR>';
             }
             echo '<td>';
             if ($l_line['status'] == 'OP') {
                 $per_to_close = new ICheckBox('sel_per_close[]');
                 $per_to_close->value = $l_line['p_id'];
                 echo $per_to_close->input();
             }
             echo '</td>';
             echo '<TD ALIGN="CENTER"> ' . $l_line['date_start'] . '</TD>';
             echo '<TD  ALIGN="CENTER"> ' . $l_line['date_end'] . '</TD>';
             echo '<TD  ALIGN="CENTER"> ' . $l_line['p_exercice'] . '</TD>';
             $closed = "";
             if ($l_line['status'] != 'OP') {
                 $go = 'do.php?' . http_build_query(array('ac' => $_REQUEST['ac'], 'action' => 'reopen', 'p_per' => $l_line['p_id'], 'gDossier' => Dossier::id(), 'jrn_def_id' => $this->jrn_def_id));
                 $closed = td('<A class="mtitle" HREF="javascript:void(0)" ' . 'onclick="return confirm_box(null,\'' . _('Confirmez Réouverture') . ' ?\',function() {window.location=\'' . $go . '\';} );"> Réouverture</A>', ' class="mtitle"');
             }
             echo "{$closed}";
             echo '</TR>';
         }
         echo '</TABLE>';
         echo '<p style="text-align:center">';
         echo HtmlInput::submit('close_per', 'Fermeture des périodes sélectionnées');
         echo '</p>';
         echo '</form>';
     }
 }
Exemplo n.º 10
0
echo $dest->input();
?>
<p>
    <span>
        <?php 
echo _('Sujet');
?>
        <?php 
echo $title->input();
?>
    </span>
</p>
    <?php 
echo "Description";
?>
<p>
    <?php 
echo $summary->input();
?>
</p>
<?php 
echo HtmlInput::hidden('gDossier', Dossier::id());
echo HtmlInput::hidden('op', 'action_save');
?>
<p style="text-align: center">
    <?php 
echo HtmlInput::submit("action_add_submit", _('Valider'));
?>
</p>
</form>
Exemplo n.º 11
0
 public function display()
 {
     $cn = new Database(Dossier::id());
     $tva = new Acc_Tva($cn, $this->value);
     $comment = $tva->load() != "-1" ? $tva->tva_label : "";
     $res = sprintf('<input type="text" name="%s" size="6" class="input_text_ro" value="%s" id="%s" readonly="">%s', $this->name, $this->value, $this->name, $comment);
     return $res;
 }
Exemplo n.º 12
0
 static function test_me()
 {
     $cn = new Database(Dossier::id());
     $order = " order by f_id desc ";
     $url = HtmlInput::get_to_string(array("gDossier", "test_select"));
     if (isset($_GET['sb'])) {
         $order = " order by f_id";
         $img = "image/select1.gif";
     } else {
         $url = $url . "&sb=as";
         $img = "image/select2.gif";
     }
     $sql = "select f_id,name,quick_code from vw_client  {$order} limit 10";
     echo $sql;
     echo Html_Table::sql2table($cn, array(array('name' => 'N° de fiche', 'style' => 'text-align:right', 'link' => $url, 'image' => $img), array('name' => 'Nom', 'style' => 'text-align:right'), array('name' => 'QuickCode')), $sql);
 }
Exemplo n.º 13
0
        console.log(visible);
        var new_state="";
        if ( visible == 'block') { new_state='none';}
        else
        if ( visible == 'none') { new_state='block';}
        else 
            console.log('erreur');
        document.getElementById('debug_div').style.display=new_state;
    }
</script>
<input type="button" class="tinybutton" style="position:absolute;display:fixed;top:40px;left:50px;margin-left:50px;z-index:1000" value="show request" onclick="show_debug_request()">

<?php 
}
global $g_user, $cn, $g_parameter;
$cn = new Database(Dossier::id());
/*
 * check that the database is not empty
 */
if (!$cn->exist_table('version')) {
    echo '<h2 class="notice">' . _('Désolé') . '</h2>';
    echo _('Ce dossier est vide');
    echo '<p>';
    echo '<a class="button" href="do.php">' . _("Retour à l'accueil") . '</a>';
    echo '</p>';
    return;
}
$g_user = new User($cn);
$g_parameter = new Own($cn);
load_all_script();
/*  Check Browser version if < IE6 then unsupported */
Exemplo n.º 14
0
/*----------------------------------------------------------------------
 * All the contact
 *
 *----------------------------------------------------------------------*/
if ($ss_action == 'cn') {
    echo '<div class="content">';
    echo dossier::hidden();
    $f = new Fiche($cn, $_REQUEST['f_id']);
    $contact = new Contact($cn);
    $contact->company = $f->get_quick_code();
    echo $contact->summary("");
    $sql = ' select fd_id from fiche_def where frd_id=' . FICHE_TYPE_CONTACT;
    $filter = $cn->make_list($sql);
    if (empty($filter)) {
        echo '<span class="notice">';
        $url = "do.php?" . http_build_query(array('gDossier' => Dossier::id(), 'ac' => 'CFGCARD'));
        echo '<a class="line" href="' . $url . '" targer="_blank">';
        echo _("Vous devez aller dans fiche et créer une catégorie pour les contacts");
        echo '</a>';
        echo '</span>';
        return;
    }
    /* Add button */
    $f_add_button = new IButton('add_card');
    $f_add_button->label = _('Créer une nouvelle fiche');
    $f_add_button->set_attribute('filter', $filter);
    $f_add_button->javascript = " select_card_type(this);";
    echo $f_add_button->input();
    echo '</div>';
}
/*----------------------------------------------------------------------------
Exemplo n.º 15
0
 /**
  * clear the search cell
  */
 static function add_clear_button($p_prefix)
 {
     $clear = HtmlInput::button('clear', 'X', 'onclick="search_clear_tag(' . Dossier::id() . ',\'' . $p_prefix . '\');"', 'smallbutton');
     return $clear;
 }
Exemplo n.º 16
0
    echo $retour;
    return;
}
/*******************************************************************************************/
// Save a new category of card
/*******************************************************************************************/
if (isset($_POST['add_modele'])) {
    $single = new Tool_Uos("dup");
    if ($single->get_count() == 0) {
        $single->save();
        $fiche_def = new Fiche_Def($cn);
        /**
         * Check if we have all needed information
         */
        if ($fiche_def->Add($_POST) == 0) {
            echo $fiche_def->input_detail();
            echo $retour;
            return;
        } else {
            $fiche_def->input_new();
            echo $retour;
            return;
        }
    } else {
        alert(_('Doublon'));
    }
}
$fiche_def = new Fiche_def($cn);
$fiche_def->Display();
$dossier = Dossier::id();
Exemplo n.º 17
0
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
ob_start();
require_once NOALYSS_INCLUDE . '/class_follow_up.php';
require_once NOALYSS_INCLUDE . '/class_default_menu.php';
echo HtmlInput::title_box(_("Détail action"), $div);
$act = new Follow_Up($cn);
$act->ag_id = $ag_id;
$act->get();
$code = 'nok';
if ($g_user->can_write_action($ag_id) == true || $g_user->can_read_action($ag_id) == true || $act->ag_dest == -1) {
    $menu = new Default_Menu();
    echo $act->Display('READ', false, "ajax", "");
    //$action=HtmlInput::array_to_string(array("gDossier","ag_id"), $_GET)."&ac=FOLLOW&sa=detail";
    $action = "do.php?" . http_build_query(array("gDossier" => Dossier::id(), "ag_id" => $ag_id, "ac" => $menu->get('code_follow'), "sa" => "detail"));
    $code = 'ok';
    if ($_GET['mod'] == 1) {
        $forbidden = _("Accès interdit : vous n'avez pas accès à cette information, contactez votre responsable");
        ?>
<a href="<?php 
        echo $action;
        ?>
" target="_blank" class="smallbutton"><?php 
        echo _("Modifier");
        ?>
 </a>
    <?php 
        $code = 'nok';
    }
} else {
Exemplo n.º 18
0
 function display($p_array)
 {
     global $g_parameter, $g_user;
     require_once NOALYSS_INCLUDE . '/class_acc_ledger.php';
     $legder = new Acc_Ledger($this->db, $this->jrn_def_id);
     $legder->nb = $legder->get_min_row();
     if ($p_array != null) {
         extract($p_array);
     }
     $add_js = "";
     $ret = "";
     if ($g_user->check_action(FICADD) == 1) {
         /* Add button */
         $f_add_button = new IButton('add_card');
         $f_add_button->label = _('Créer une nouvelle fiche');
         $f_add_button->set_attribute('ipopup', 'ipop_newcard');
         $f_add_button->set_attribute('jrn', $legder->id);
         $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);";
         $f_add_button->input();
     }
     $nb_row = isset($nb_item) ? $nb_item : $legder->nb;
     $ret .= HtmlInput::hidden('nb_item', $nb_row);
     $ret .= HtmlInput::hidden('p_jrn', $this->jrn_def_id);
     $ret .= dossier::hidden();
     $ret .= dossier::hidden();
     $ret .= HtmlInput::hidden('jrn_type', $legder->get_type());
     $info = HtmlInput::infobulle(0);
     $info_poste = HtmlInput::infobulle(9);
     if ($g_user->check_action(FICADD) == 1) {
         $ret .= $f_add_button->input();
     }
     $ret .= '<table id="quick_item" style="width:100%">';
     $ret .= '<tr>' . '<th style="text-align:left">Quickcode' . $info . '</th>' . '<th style="text-align:left">' . _('Poste') . $info_poste . '</th>' . '<th style="text-align:left">' . _('Libellé') . '</th>' . '<th style="text-align:left">' . _('Montant') . '</th>' . '<th style="text-align:left">' . _('Débit') . '</th>' . '</tr>';
     for ($i = 0; $i < $nb_row; $i++) {
         // Quick Code
         $quick_code = new ICard('qc_' . $i);
         $quick_code->set_dblclick("fill_ipopcard(this);");
         $quick_code->set_attribute('ipopup', 'ipopcard');
         // name of the field to update with the name of the card
         $quick_code->set_attribute('label', "ld" . $i);
         $quick_code->set_attribute('jrn', $legder->id);
         // name of the field to update with the name of the card
         $quick_code->set_attribute('typecard', 'filter');
         // Add the callback function to filter the card on the jrn
         $quick_code->set_callback('filter_card');
         $quick_code->set_function('fill_data');
         $quick_code->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $quick_code->name);
         $quick_code->jrn = $legder->id;
         $quick_code->value = isset(${'qc_' . $i}) ? ${'qc_' . $i} : "";
         $label = '';
         if ($quick_code->value != '') {
             $Fiche = new Fiche($legder->db);
             $Fiche->get_by_qcode($quick_code->value);
             $label = $Fiche->strAttribut(ATTR_DEF_NAME);
         }
         // Account
         $poste = new IPoste();
         $poste->name = 'poste' . $i;
         $poste->set_attribute('jrn', $legder->id);
         $poste->set_attribute('ipopup', 'ipop_account');
         $poste->set_attribute('label', 'ld' . $i);
         $poste->set_attribute('account', 'poste' . $i);
         $poste->set_attribute('dossier', Dossier::id());
         $poste->value = isset(${'poste' . $i}) ? ${"poste" . $i} : '';
         $poste->dbl_click_history();
         if ($poste->value != '') {
             $Poste = new Acc_Account($legder->db);
             $Poste->set_parameter('value', $poste->value);
             $label = $Poste->get_lib();
         }
         // Description of the line
         $line_desc = new IText();
         $line_desc->name = 'ld' . $i;
         $line_desc->size = 30;
         $line_desc->value = isset(${"ld" . $i}) ? ${"ld" . $i} : $label;
         // Amount
         $amount = new INum();
         $amount->size = 10;
         $amount->name = 'amount' . $i;
         $amount->value = isset(${'amount' . $i}) ? ${"amount" . $i} : '';
         $amount->javascript = ' onChange="format_number(this);checkTotalDirect()"';
         // D/C
         $deb = new ICheckBox();
         $deb->name = 'ck' . $i;
         $deb->selected = isset(${'ck' . $i}) ? true : false;
         $deb->javascript = ' onChange="checkTotalDirect()"';
         $ret .= '<tr>';
         $ret .= '<td>' . $quick_code->input() . $quick_code->search() . '</td>';
         $ret .= '<td>' . $poste->input() . '<script> document.getElementById(\'poste' . $i . '\').onblur=function(){ if (trim(this.value) !=\'\') {document.getElementById(\'qc_' . $i . '\').value="";}}</script>' . '</td>';
         $ret .= '<td>' . $line_desc->input() . '</td>';
         $ret .= '<td>' . $amount->input() . '</td>';
         $ret .= '<td>' . $deb->input() . '</td>';
         $ret .= '</tr>';
         // If readonly == 1 then show CA
     }
     $ret .= '</table>';
     return $ret;
 }
Exemplo n.º 19
0
 static function button_action_add()
 {
     $dossier = Dossier::id();
     $js = HtmlInput::button_action(_('Nouvel événement'), 'action_add(' . $dossier . ')', 'xx', 'smallbutton');
     return $js;
 }
Exemplo n.º 20
0
 *   NOALYSS is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with NOALYSS; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
// Copyright Author Dany De Bontridder danydb@aevalys.eu
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_tag.php';
ob_start();
$tag = new Tag($cn);
$tag->select();
//------------------- Propose to add a tag
$js = sprintf("onclick=\"show_tag('%s','%s','%s','j')\"", Dossier::id(), '', '-1');
echo HtmlInput::button("tag_add", _("Ajout d'un tag"), $js);
$response = ob_get_clean();
$html = escape_xml($response);
header('Content-type: text/xml; charset=UTF-8');
echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ctl></ctl>
<code>{$html}</code>
</data>
EOF;
exit;
Exemplo n.º 21
0
?>
tag_tb_id">
    <tr>
        <th>
            <?php 
echo _("Tag");
?>
        </th>
        <th>
            <?php 
echo _("Description");
?>
        </th>
    </tr>
<?php 
$gDossier = Dossier::id();
for ($i = 0; $i < $max; $i++) {
    $row = Database::fetch_array($ret, $i);
    ?>
    <tr class="<?php 
    echo $i % 2 == 0 ? 'even' : 'odd';
    ?>
">
        <td>
            <?php 
    $js = sprintf("search_add_tag('%s','%s','%s')", $gDossier, $row['t_id'], $p_prefix);
    echo HtmlInput::anchor($row['t_tag'], "", "onclick=\"{$js}\"");
    ?>
        </td>
        <td>
            <?php 
Exemplo n.º 22
0
 /**
  * @brief Show the form to encode your operation
  * @param$p_array if you correct or use a predef operation (default = null)
  * @param$p_readonly 1 for readonly 0 for writable (default 0)
  *@exception if ledger not found
  * \return a string containing the form
  */
 function input($p_array = null, $p_readonly = 0)
 {
     global $g_parameter, $g_user;
     $this->nb = $this->get_min_row();
     if ($p_readonly == 1) {
         return $this->confirm($p_array);
     }
     if ($p_array != null) {
         extract($p_array);
     }
     $add_js = "";
     if ($g_parameter->MY_PJ_SUGGEST == 'Y') {
         $add_js = "update_pj();";
     }
     if ($g_parameter->MY_DATE_SUGGEST == 'Y') {
         $add_js .= 'get_last_date();';
     }
     $add_js .= 'update_row("quick_item");';
     $ret = "";
     if ($g_user->check_action(FICADD) == 1) {
         /* Add button */
         $f_add_button = new IButton('add_card');
         $f_add_button->label = _('Créer une nouvelle fiche');
         $f_add_button->set_attribute('ipopup', 'ipop_newcard');
         $f_add_button->set_attribute('jrn', $this->id);
         $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);";
         $f_add_button->input();
     }
     $wLedger = $this->select_ledger('ODS', 2);
     if ($wLedger == null) {
         throw new Exception(_('Pas de journal disponible'));
     }
     $wLedger->javascript = "onChange='update_name();update_predef(\"ods\",\"t\",\"" . $_REQUEST['ac'] . "\");{$add_js}'";
     $label = " Journal " . HtmlInput::infobulle(2);
     $ret .= $label . $wLedger->input();
     // Load the javascript
     //
     $ret .= "<table>";
     $ret .= '<tr ><td colspan="2" style="width:auto">';
     $wDate = new IDate('e_date');
     $wDate->readonly = $p_readonly;
     $e_date = isset($e_date) && trim($e_date) != '' ? $e_date : '';
     $wDate->value = $e_date;
     $ret .= _("Date") . ' : ' . $wDate->input();
     $ret .= '</td>';
     /* insert periode if needed */
     // Periode
     //--
     if ($this->check_periode() == true) {
         $l_user_per = $g_user->get_periode();
         $def = isset($periode) ? $periode : $l_user_per;
         $period = new IPeriod("period");
         $period->user = $g_user;
         $period->cn = $this->db;
         $period->value = $def;
         $period->type = OPEN;
         try {
             $l_form_per = $period->input();
         } catch (Exception $e) {
             if ($e->getCode() == 1) {
                 echo _("Aucune période ouverte");
                 exit;
             }
         }
         $label = HtmlInput::infobulle(3);
         $f_periode = _("Période comptable") . " {$label} " . $l_form_per;
         $ret .= td($f_periode);
     }
     $wPJ = new IText('e_pj');
     $wPJ->readonly = false;
     $wPJ->size = 10;
     /* suggest PJ ? */
     $default_pj = '';
     if ($g_parameter->MY_PJ_SUGGEST == 'Y') {
         $default_pj = $this->guess_pj();
     }
     $wPJ->value = isset($e_pj) ? $e_pj : $default_pj;
     $ret .= '</tr>';
     $ret .= '<tr >';
     $ret .= '<td colspan="2" style="width:auto"> ' . _('Pièce') . ' : ' . $wPJ->input();
     $ret .= HtmlInput::hidden('e_pj_suggest', $default_pj);
     $ret .= '</tr>';
     $ret .= '</td>';
     $ret .= '<tr>';
     $ret .= '<td colspan="2" style="width:auto">';
     $ret .= _('Libellé');
     $wDescription = new IText('desc');
     $wDescription->readonly = $p_readonly;
     $wDescription->size = "50";
     $wDescription->value = isset($desc) ? $desc : '';
     $ret .= $wDescription->input();
     $ret .= '</td>';
     $ret .= '</tr>';
     $ret .= '</table>';
     $nb_row = isset($nb_item) ? $nb_item : $this->nb;
     $ret .= HtmlInput::hidden('nb_item', $nb_row);
     $ret .= dossier::hidden();
     $ret .= dossier::hidden();
     $ret .= HtmlInput::hidden('jrn_type', $this->get_type());
     $info = HtmlInput::infobulle(0);
     $info_poste = HtmlInput::infobulle(9);
     if ($g_user->check_action(FICADD) == 1) {
         $ret .= $f_add_button->input();
     }
     $ret .= '<table id="quick_item" style="position:float;width:100%">';
     $ret .= '<tr>' . '<th style="text-align:left">Quickcode' . $info . '</th>' . '<th style="text-align:left">' . _('Poste') . $info_poste . '</th>' . '<th style="text-align:left">' . _('Libellé') . '</th>' . '<th style="text-align:left">' . _('Montant') . '</th>' . '<th style="text-align:left">' . _('Débit') . '</th>' . '</tr>';
     for ($i = 0; $i < $nb_row; $i++) {
         // Quick Code
         $quick_code = new ICard('qc_' . $i);
         $quick_code->set_dblclick("fill_ipopcard(this);");
         $quick_code->set_attribute('ipopup', 'ipopcard');
         // name of the field to update with the name of the card
         $quick_code->set_attribute('label', "ld" . $i);
         // name of the field to update with the name of the card
         $quick_code->set_attribute('typecard', 'filter');
         // Add the callback function to filter the card on the jrn
         $quick_code->set_callback('filter_card');
         $quick_code->set_function('fill_data');
         $quick_code->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $quick_code->name);
         $quick_code->value = isset(${'qc_' . $i}) ? ${'qc_' . $i} : "";
         $quick_code->readonly = $p_readonly;
         $label = '';
         if ($quick_code->value != '') {
             $Fiche = new Fiche($this->db);
             $Fiche->get_by_qcode($quick_code->value);
             $label = $Fiche->strAttribut(ATTR_DEF_NAME);
         }
         // Account
         $poste = new IPoste();
         $poste->name = 'poste' . $i;
         $poste->set_attribute('jrn', $this->id);
         $poste->set_attribute('ipopup', 'ipop_account');
         $poste->set_attribute('label', 'ld' . $i);
         $poste->set_attribute('account', 'poste' . $i);
         $poste->set_attribute('dossier', Dossier::id());
         $poste->value = isset(${'poste' . $i}) ? ${"poste" . $i} : '';
         $poste->dbl_click_history();
         $poste->readonly = $p_readonly;
         if ($poste->value != '') {
             $Poste = new Acc_Account($this->db);
             $Poste->set_parameter('value', $poste->value);
             $label = $Poste->get_lib();
         }
         // Description of the line
         $line_desc = new IText();
         $line_desc->name = 'ld' . $i;
         $line_desc->size = 30;
         $line_desc->value = isset(${"ld" . $i}) ? ${"ld" . $i} : $label;
         // Amount
         $amount = new INum();
         $amount->size = 10;
         $amount->name = 'amount' . $i;
         $amount->value = isset(${'amount' . $i}) ? ${"amount" . $i} : '';
         $amount->readonly = $p_readonly;
         $amount->javascript = ' onChange="format_number(this);checkTotalDirect()"';
         // D/C
         $deb = new ICheckBox();
         $deb->name = 'ck' . $i;
         $deb->selected = isset(${'ck' . $i}) ? true : false;
         $deb->readonly = $p_readonly;
         $deb->javascript = ' onChange="checkTotalDirect()"';
         $ret .= '<tr>';
         $ret .= '<td>' . $quick_code->input() . $quick_code->search() . '</td>';
         $ret .= '<td>' . $poste->input() . '<script> document.getElementById(\'poste' . $i . '\').onblur=function(){ if (trim(this.value) !=\'\') {document.getElementById(\'qc_' . $i . '\').value="";}}</script>' . '</td>';
         $ret .= '<td>' . $line_desc->input() . '</td>';
         $ret .= '<td>' . $amount->input() . '</td>';
         $ret .= '<td>' . $deb->input() . '</td>';
         $ret .= '</tr>';
         // If readonly == 1 then show CA
     }
     $ret .= '</table>';
     if (isset($this->with_concerned) && $this->with_concerned == true) {
         $oRapt = new Acc_Reconciliation($this->db);
         $w = $oRapt->widget();
         $w->name = 'jrn_concerned';
         $w->value = isset($jrn_concerned) ? $jrn_concerned : "";
         $ret .= "R&eacute;conciliation/rapprochements : " . $w->input();
     }
     $ret .= create_script("\$('" . $wDate->id . "').focus()");
     return $ret;
 }
    echo $url;
    ?>
                        </p>
                        <p>
                        <?php 
    echo _('ordre apparition'), " ", $row['p_order'];
    ?>
                        <p>
                        <?php 
    echo _('Default'), " : ", $row['pm_default'] == 1 ? _('Oui') : _('Non');
    ?>
                        </p>
                        
                 </td>
		<?php 
}
?>
                 <td>
                     <?php 
echo HtmlInput::button_action("+", sprintf("add_menu({dossier:%d,p_id:%d,type:'%s',p_level:%d,dep:0})", Dossier::id(), $this->p_id, 'me', 0), "xx", 'smallbutton');
?>
                 </td>
	    </tr>
	</table>
    </div>

<div id='sub_menu_div'>
    <table id="menu_table" class="result">

    </table>
</div>
Exemplo n.º 24
0
/* * *
 * @file
 * @brief display a table with the list of available keys for all ledgers
 * @see Anc_Key::display_list
 */
global $g_succeed, $g_failed;
?>
<div class="content">
    <?php 
echo _('Filtre') . " " . HtmlInput::filter_table("anc_key_table_id", '0,1', 0);
?>

<table id="anc_key_table_id" class="result">
    <?php 
for ($i = 0; $i < count($a_key); $i++) {
    $onclick = http_build_query(array('gDossier' => Dossier::id(), 'ac' => $_REQUEST['ac'], 'op' => 'consult', 'key' => $a_key[$i]['kd_id']));
    $class = $i % 2 == 0 ? 'class="even"' : 'class="odd"';
    ?>
        <tr <?php 
    echo $class;
    ?>
>
            <td>
                <a class="line" href="do.php?<?php 
    echo $onclick;
    ?>
" >
                <?php 
    echo $a_key[$i]['kd_name'];
    ?>
                </a>
Exemplo n.º 25
0
 /**
  * @brief display all the user to select the user with who we want to share
  * the connected user is not shown
  * @global type $g_user
  */
 function display_user()
 {
     global $g_user;
     // Get array of user
     $p_array = User::get_list(Dossier::id());
     $dossier = Dossier::id();
     include 'template/todo_list_list_user.php';
 }
Exemplo n.º 26
0
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
/* * *
 * @file
 * @brief display a table with the list of available keys
 * @see Anc_Key::display_choice
 */
?>
<table class="result">
    <?php 
for ($i = 0; $i < count($a_key); $i++) {
    $onclick = sprintf(' onclick="anc_key_compute(%s,\'%s\',%s,%s)"', Dossier::id(), $p_target, $p_amount, $a_key[$i]['kd_id']);
    ?>
        <tr>
            <td>
                <a class="line" <?php 
    echo $onclick;
    ?>
 >
                <?php 
    echo h($a_key[$i]['kd_name']);
    ?>
                </a>
            </td>
            <td>
                <?php 
    echo h($a_key[$i]['kd_description']);
Exemplo n.º 27
0
            ?>
">
     </div>
     
<?php 
        }
        ?>
         
</div>
<?php 
        if ($this->ag_id != 0 && !$readonly) {
            ?>
     <div >
         <p>
         <?php 
            $query = http_build_query(array('gDossier' => Dossier::id(), 'ag_id' => $this->ag_id, 'create_invoice' => 1, 'ac' => $menu->get('code_invoice')));
            echo HtmlInput::button_anchor(_("Transformer en facture"), "do.php?" . $query, "create_invoice", '  target="_blank" ', "button");
            ?>
         </p>
      </div>
     <?php 
        }
    }
    ?>
</div>
<?php 
}
?>

<div style="clear:both"></div>    
<?php 
Exemplo n.º 28
0
    if ($row['me_code'] == 'new_line') {
        echo "</tr><tr>";
        continue;
    }
    $style = "tool";
    if ($row['me_code'] == $selected_module) {
        $style = 'toolselected';
    }
    if ($row['me_url'] != '') {
        $url = $row['me_url'];
    } elseif ($row['me_javascript'] != '') {
        $url = "javascript:void(0)";
        $js_dossier = str_replace('<DOSSIER>', Dossier::id(), $row['me_javascript']);
        $js = sprintf(' onclick="%s"', $js_dossier);
    } else {
        $url = "do.php?gDossier=" . Dossier::id() . "&ac=" . $row['me_code'];
    }
    ?>
		<td class="<?php 
    echo $style;
    ?>
">
                    <a class="mtitle" href="<?php 
    echo $url;
    ?>
" title="<?php 
    echo _($row['me_description']);
    ?>
" <?php 
    echo $js;
    ?>
Exemplo n.º 29
0
 * @brief Manage the tags
 *
 */
require_once NOALYSS_INCLUDE . '/class_tag.php';
require_once NOALYSS_INCLUDE . '/class_tool_uos.php';
$tag = new Tag($cn);
$uos = new Tool_Uos('tag');
if (isset($_POST['save_tag_sb'])) {
    if (!isset($_POST['remove'])) {
        try {
            $uos->check();
            $tag->save($_POST);
            $uos->save();
        } catch (Exception $e) {
            alert("déjà sauvé");
        }
    } else {
        $tag->remove($_POST);
    }
}
?>
<div style="margin-left:10%;width:80%">
     <p class="notice">
        <?php 
echo _("Vous pouvez utiliser ceci comme des étiquettes pour marquer des documents ou \n         comme des dossiers pour rassembler des documents. Un document peut appartenir\n         à plusieurs dossiers ou avoir plusieurs étiquettes.");
?>
     </p>
    <?php 
$tag->show_list();
$js = sprintf("onclick=\"show_tag('%s','%s','%s','p')\"", Dossier::id(), $_REQUEST['ac'], '-1');
echo HtmlInput::button("tag_add", "Ajout d'un tag", $js);
Exemplo n.º 30
0
 static function test_me()
 {
     echo "Dossier = " . Dossier::id();
     $cn = new Database(Dossier::id());
     $a = new Acc_Ledger_Info($cn);
     $a->jr_id = 3;
     $a->id_type = 'BON_COMMANDE';
     $a->ji_value = 'BON';
     var_dump($a);
     $a->insert();
     $a->set_jrn_id(7);
     $a->set_type('OTHER');
     $a->set_value('Autre test');
     $a->insert();
 }