// following the given distribution key given in parameter.
// Parameters are :
//   - gDossier
//   - t the element HTML to use as target
//   - amount the amount to distribute
//   - key the Distribution key to use
//
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_anc_key.php';
ob_start();
/////
$key = HtmlInput::default_value_get('key', 0);
$amount = HtmlInput::default_value_get('amount', 0);
$target = HtmlInput::default_value_get('t', '');
if (isNumber($key) == 0 || isNumber($amount) == 0 || $target == '') {
    die('Invalid parameter');
}
$compute_key = new Anc_Key($key);
$compute_key->fill_table($target, $amount);
////
$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>
Exemple #2
0
 * \brief manage all the export to CSV or PDF
 *   act can be
 *
 */
define('ALLOWED', 1);
require_once '../include/constant.php';
global $g_user, $cn, $g_parameter;
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_user.php';
$gDossier = dossier::id();
$cn = new Database($gDossier);
mb_internal_encoding("UTF-8");
$g_user = new User($cn);
$g_user->Check();
$action = $g_user->check_dossier($gDossier);
set_language();
if ($action == 'X' || !isset($_GET['act']) || $g_user->check_print($_GET['act']) == 0) {
    echo alert(_('Accès interdit'));
    redirect("do.php?" . dossier::get());
    exit;
}
// get file and execute it
$action = HtmlInput::default_value_get('act', null);
if ($action == null) {
    die(_('Appel invalide'));
}
$prfile = $cn->get_value("select me_file from menu_ref where me_code=\$1", array($action));
if ($prfile == "") {
    die(_('Export impossible'));
}
require_once $prfile;
Exemple #3
0
 *   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
/**\file
 * \brief display, add, delete and modify forecast
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_anticipation.php';
$action = HtmlInput::default_value_get('action', '');
echo '<div class="content">';
$sa = isset($_REQUEST['sa']) ? $_REQUEST['sa'] : 'list';
/* * ********************************************************************
 * Remove a anticipation
 *
 *
 * ******************************************************************** */
if ($action == 'del') {
    $forecast = new Forecast($cn, $_GET['f_id']);
    $forecast->delete();
}
/*
 * Cloning
 */
if ($action == 'clone') {
 *     # 1 it is a menu with possible submenu p_type = E, refresh the table with menu
 *     # 2 it is a menu with no submenu , p_type = E 
 * $dep  : is the profile_menu.pm_id of the parent menu
 *     
 * 
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
// Security
if ($g_user->check_module('CFGPRO') == 0) {
    die;
}
$type = HtmlInput::default_value_get('type', 'XX');
$p_level = HtmlInput::default_value_get('p_level', 0);
$dep = HtmlInput::default_value_get('dep', 0);
if ($type == 'XX') {
    throw new Exception('invalid call');
    return;
}
// if type == menu the
if ($type == 'me') {
    if (isNumber($p_level) == 0) {
        throw new Exception('invalid call');
    }
    if ($p_level == 0) {
        // There is no dependency
        // Menu which can be added
        $ame_code = $cn->make_array("\nselect me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'')\n\t||'('|| case when me_type='SP' then 'Special'\n\t\twhen me_type='PL' then 'Plugin'\n\t\twhen me_type='ME' and me_file is null and me_javascript is null and me_url is null then 'Module - Menu principal'\n\t\twhen me_type='ME' then 'Menu'\n\t\telse\n\t\tme_type\n\t\tend||')'\n\tfrom\n\tmenu_ref\n        where\n        me_type<>'PR'\n\torder by 1\n\t");
    } elseif ($p_level == 1) {
        // dependency is in dep
 * Security : only user with the menu CFGPRO
 * display the submenu of a menu or a module
 * It expects 2 parameters  = p_profile (profile.p_id) and the dep (menu_ref.me_code)
 */
// require_once '.php';
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
// Security
if ($g_user->check_module('CFGPRO') == 0) {
    die;
}
// Check parameter
$module = HtmlInput::default_value_get("dep", "");
$p_level = HtmlInput::default_value_get("p_level", 0);
$p_id = HtmlInput::default_value_get('p_profile', -1);
if ($module == "" || $p_id == -1 || isNumber($p_id) == 0 || isNumber($p_level) == 0) {
    echo _('Paramètre invalide');
    return;
}
require_once NOALYSS_INCLUDE . '/class_profile_menu.php';
$p_level++;
$profile = new Profile_Menu($cn);
$profile->p_id = $p_id;
$profile->display_module_menu($module, $p_level);
////////////////////////////////////////////////////////////////////////////////
// EXAMPLE
////////////////////////////////////////////////////////////////////////////////
/*
if ($ac == 'save') // operation
{
Exemple #6
0
 $page = isset($_GET['offset']) ? $_GET['page'] : 1;
 $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
 if (count($_GET) == 0) {
     $array = null;
 } else {
     $array = $_GET;
 }
 $array['p_action'] = 'ALL';
 if (!isset($array['date_start']) || !isset($array['date_end'])) {
     // get first date of current exercice
     list($array['date_start'], $array['date_end']) = $g_user->get_limit_current_exercice();
 }
 list($sql, $where) = $ledger->build_search_sql($array);
 // Count nb of line
 $max_line = $cn->count_sql($sql);
 $target = HtmlInput::default_value_get("target", "");
 list($count, $content) = $ledger->list_operation_to_reconcile($sql, $target);
 $bar = navigation_bar($offset, $max_line, $step, $page);
 if (!$inside) {
     echo $bar;
 } else {
     if ($step < $max_line) {
         echo '<h2 class="notice">' . _('Liste limitée à ') . $step . _(' enregistrements. Le nombre d\'enregistrements trouvés est de ') . $max_line . '</h2>';
     }
 }
 echo '<form method="get" onsubmit="set_reconcile(this);return false">';
 echo HtmlInput::submit("upd_rec", _("Mettre à jour"));
 echo HtmlInput::get_to_hidden(array('ctlc', 'amount_id', 'ledger'));
 echo HtmlInput::get_to_hidden(array('l', 'date_start', 'date_end', 'desc', 'amount_min', 'amount_max', 'qcodesearch_op', 'accounting', 'unpaid', 'gDossier', 'ledger_type'));
 echo $content;
 echo HtmlInput::submit("upd_rec", _("Mettre à jour"));
 * \file
 *
 *
 * \brief
 *
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_acc_ledger_purchase.php';
require_once NOALYSS_INCLUDE . '/class_acc_ledger_fin.php';
require_once NOALYSS_INCLUDE . '/class_acc_ledger_sold.php';
require_once NOALYSS_INCLUDE . '/class_acc_ledger.php';
global $g_user, $cn;
$p_array = $_GET;
$ledger_type = HtmlInput::default_value_get("ledger_type", 'ALL');
switch ($ledger_type) {
    case 'ACH':
        $Ledger = new Acc_Ledger_Purchase($cn, 0);
        $ask_pay = 1;
        break;
    case 'ODS':
        $Ledger = new Acc_Ledger($cn, 0);
        $ask_pay = 0;
        $p_array['ledger_type'] = 'ODS';
        $Ledger->type = 'ODS';
        break;
    case 'ALL':
        $Ledger = new Acc_Ledger($cn, 0);
        $ask_pay = 0;
        $p_array['ledger_type'] = 'ALL';
$all = HtmlInput::default_value_get('all', "0");
switch ($p_type) {
    case 'C':
        $bal->get_array_card('C');
        $bal->export_csv($p_date, $p_let);
        break;
    case 'F':
        $bal->get_array_card('F');
        $bal->export_csv($p_date, $p_let);
        break;
    case 'U':
        $bal->get_array_card('U', $fiche);
        $bal->export_csv($p_date, $p_let);
        break;
    case 'X':
        $all = HtmlInput::default_value_get('all', 0);
        if ($all == 0) {
            $bal->get_array_card('X', $_GET['cat']);
            $bal->export_csv($p_date, $p_let);
        } else {
            $a_cat = $cn->get_array("select fd_id from vw_fiche_def where ad_id=" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
            $nb_cat = count($a_cat);
            for ($i = 0; $i < $nb_cat; $i++) {
                $bal->get_array_card('X', $a_cat[$i]['fd_id']);
                $bal->export_csv($p_date, $p_let);
            }
        }
        break;
    default:
        break;
}
 *   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_calendar.php';
ob_start();
if ($notitle == 0) {
    echo HtmlInput::title_box(_("Calendrier"), "calendar_zoom_div");
}
$cal = new Calendar();
$in = HtmlInput::default_value_get('in', "");
$notitle = HtmlInput::default_value_get('notitle', "0");
if ($in == "") {
    $in = $cal->get_preference();
}
$cal->set_periode($in);
echo $cal->zoom($distype, $notitle);
$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>
<html>{$html}</html>
</data>
EOF;
require_once NOALYSS_INCLUDE . '/class_iselect.php';
require_once NOALYSS_INCLUDE . '/class_idate.php';
require_once NOALYSS_INCLUDE . '/class_acc_report.php';
require_once NOALYSS_INCLUDE . '/class_exercice.php';
global $g_user;
//-----------------------------------------------------
// If print is asked
// First time in html
// after in pdf or cvs
//-----------------------------------------------------
if (isset($_GET['bt_html'])) {
    $Form = new Acc_Report($cn, $_GET['form_id']);
    $Form->get_name();
    // step asked ?
    //--
    $type_periode = HtmlInput::default_value_get("type_periode", -1);
    if ($type_periode == 1) {
        $array = $Form->get_row($_GET['from_date'], $_GET['to_date'], $type_periode);
    }
    if ($type_periode == 0 && $_GET['p_step'] == 0) {
        $array = $Form->get_row($_GET['from_periode'], $_GET['to_periode'], $type_periode);
    }
    if ($type_periode == 0 && $_GET['p_step'] == 1) {
        // step are asked
        //--
        for ($e = $_GET['from_periode']; $e <= $_GET['to_periode']; $e += $_GET['p_step']) {
            $periode = getPeriodeName($cn, $e);
            if ($periode == null) {
                continue;
            }
            $array[] = $Form->get_row($e, $e, $_GET['type_periode']);
Exemple #11
0
    header('Content-type: text/xml; charset=UTF-8');
    $dom = new DOMDocument('1.0', 'UTF-8');
    $xml = escape_xml($content);
    $xml_content = $dom->createElement('content', $xml);
    $xml_status = $dom->createElement('status', $status);
    $root = $dom->createElement("root");
    $root->appendChild($xml_content);
    $root->appendChild($xml_status);
    $dom->appendChild($root);
    echo $dom->saveXML();
    exit;
}
// For the operation 'modele_drop','modele_modify','folder_modify','folder_drop'
// the p_dossier parameter is mandatory
if (in_array($op, array('modele_drop', 'modele_modify', 'folder_modify', 'folder_drop'))) {
    $dossier = HtmlInput::default_value_get('p_dossier', 0);
    $content = _('Erreur paramètre');
    $status = "NOK";
    // check if we receive a valid parameter
    if ($dossier == 0 || isNumber($dossier) == 0) {
        //----------------------------------------------------------------
        // Answer in XML
        header('Content-type: text/xml; charset=UTF-8');
        $dom = new DOMDocument('1.0', 'UTF-8');
        $xml = escape_xml($content);
        $xml_content = $dom->createElement('content', $xml);
        $xml_status = $dom->createElement('status', $status);
        $root = $dom->createElement("root");
        $root->appendChild($xml_content);
        $root->appendChild($xml_status);
        $dom->appendChild($root);
header('Content-Disposition: attachment;filename="jrn-' . $fDate . '.csv"', FALSE);
include_once "ac_common.php";
require_once NOALYSS_INCLUDE . '/class_own.php';
require_once NOALYSS_INCLUDE . '/class_acc_ledger_sold.php';
require_once NOALYSS_INCLUDE . '/class_acc_ledger_purchase.php';
require_once NOALYSS_INCLUDE . '/class_dossier.php';
$gDossier = dossier::id();
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/class_acc_ledger.php';
/*
 * Variable from $_GET
 */
$get_jrn = HtmlInput::default_value_get('jrn_id', -1);
$get_option = HtmlInput::default_value_get('p_simple', -1);
$get_from_periode = HtmlInput::default_value_get('from_periode', null);
$get_to_periode = HtmlInput::default_value_get('to_periode', NULL);
//--- Check validity
if ($get_jrn == -1 || $get_option == -1 || $get_from_periode == null || $get_to_periode == null) {
    die(_('Options invalides'));
}
require_once NOALYSS_INCLUDE . '/class_user.php';
$g_user->Check();
$g_user->check_dossier($gDossier);
//----------------------------------------------------------------------------
// $get_jrn == 0 when request for all ledger, in that case, we must filter
// the legder with the security in Acc_Ledger::get_row
//----------------------------------------------------------------------------
if ($get_jrn != 0 && $g_user->check_jrn($get_jrn) == 'X') {
    NoAccess();
    exit;
}
Exemple #13
0
    $gestion = new Follow_Up($cn);
    $gestion->display_short();
    return;
}
if ($op == 'action_save') {
    require_once NOALYSS_INCLUDE . '/class_follow_up.php';
    /**
     * save info from the get
     */
    $date_event = HtmlInput::default_value_get("date_event", -1);
    $dest = HtmlInput::default_value_get("dest", "");
    $event_group = HtmlInput::default_value_get("event_group", 0);
    $event_priority = HtmlInput::default_value_get("event_priority", 0);
    $title = HtmlInput::default_value_get("title_event", NULL);
    $summary = HtmlInput::default_value_get("summary", "");
    $type_event = HtmlInput::default_value_get('type_event', -1);
    /*
     * Check if data are valid
     */
    try {
        if ($date_event == -1 || isDate($date_event) == 0) {
            throw new Exception(_('Date invalide'));
        }
        if (trim($dest) == "") {
            $dest_id = NULL;
        } else {
            $fiche = new Fiche($cn);
            $fiche->get_by_qcode($dest);
            $dest_id = $fiche->id;
            if ($dest_id == 0) {
                throw new Exception(_('Destinataire invalide'));
 *
 *   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 2014 Author Dany De Bontridder danydb@aevalys.eu
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
$ag_id = HtmlInput::default_value_get("ag_id", "0");
$f_id = HtmlInput::default_value_get("f_id", "0");
if ($ag_id == 0 || $f_id == 0) {
    throw new Exception("Invalid values", 0);
}
require_once 'class_follow_up.php';
$follow = new Follow_Up($cn, $ag_id);
ob_start();
$follow->remove_linked_card($f_id);
echo $follow->display_linked();
HtmlInput::button_action_add_concerned_card($follow->ag_id);
$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>
Exemple #15
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 the calendar as a list. Included from the Calendar::zoom_list()
 */
?>
<div class="content" id="user_cal" style="width:100%">
<?php 
$short = HtmlInput::default_value_get('from', 0);
$js = sprintf("calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s','notitle':%d})", dossier::id(), 'per_div', 'calendar_zoom_div', 'cal', $notitle);
echo HtmlInput::anchor(_('Calendrier'), '', " onclick=\"{$js}\"");
echo HtmlInput::button_action_add();
?>
    <table class="result">
<?php 
$nb_event = count($a_event);
$a_status = array('R' => _('Retard'), 'N' => 'Auj.', 'F' => '');
for ($i = 0; $i < $nb_event; $i++) {
    $class = $i % 2 == 0 ? 'even' : 'odd';
    $idx = $a_event[$i]['status'];
    $class = $idx == 'R' ? 'notice' : $class;
    ?>
        <tr class="<?php 
    echo $class;
 *
 *   NOALYSS is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   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
// Copyright Author Dany De Bontridder danydb@aevalys.eu
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
/**
 * export all the selected documents for Ana Accountancy in PDF
 */
require_once NOALYSS_INCLUDE . '/class_document_export.php';
$ck = HtmlInput::default_value_get('ck', 0);
if ($ck == 0) {
    echo "Aucune sélection";
    exit;
}
$anc = new Document_Export();
$anc->export_all($ck);
*/
/**
 * @file
 * @brief show the available distribution keys for analytic activities. Expected
 * parameter are 
 *  - t for the table id
 *  - amount is the amount to distributed
 *
 */
// Copyright (2014) Author Dany De Bontridder danydb@aevalys.eu
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
$amount = HtmlInput::default_value_get("amount", 0);
$table_id = HtmlInput::default_value_get("t", "");
$ledger = HtmlInput::default_value_get('led', 0);
if ($table_id == "" || isNumber($amount) == 0 || isNumber($ledger) == 0) {
    die('Invalid Parameter');
}
require_once 'class_anc_key.php';
ob_start();
echo HtmlInput::title_box(_("Choix d'une clef"), 'div_anc_key_choice');
Anc_Key::display_choice($amount, $table_id, $ledger);
echo HtmlInput::button_close('div_anc_key_choice');
$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>
Exemple #18
0
        echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<code>bkname</code>
<value>{$html}</value>
</data>
EOF;
        break;
        // display new calendar
    // display new calendar
    case 'cal':
        require_once NOALYSS_INCLUDE . '/class_calendar.php';
        /* others report */
        $cal = new Calendar();
        $cal->set_periode($per);
        $notitle = HtmlInput::default_value_get("notitle", 0);
        $html = "";
        $html = $cal->display($_GET['t'], $notitle);
        $html = escape_xml($html);
        header('Content-type: text/xml; charset=UTF-8');
        echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<code>{$html}</code>
</data>
EOF;
        break;
        /* rem a cat of document */
    /* rem a cat of document */
    case 'rem_cat_doc':
        require_once NOALYSS_INCLUDE . '/class_document_type.php';
Exemple #19
0
echo '<FORM  method="get">';
echo HtmlInput::get_to_hidden(array('ac'));
echo HtmlInput::hidden('type', 'bal');
echo HtmlInput::get_to_hidden(array('exercice'));
echo dossier::hidden();
// filter on the current year
$from = HtmlInput::default_value_get("from_periode", "");
$input_from = new IPeriod("from_periode", $from, $exercice);
$input_from->show_end_date = false;
$input_from->type = ALL;
$input_from->cn = $cn;
$input_from->filter_year = true;
$input_from->user = $g_user;
echo _('Depuis') . ' :' . $input_from->input();
// filter on the current year
$to = HtmlInput::default_value_get("to_periode", "");
$input_to = new IPeriod("to_periode", $to, $exercice);
$input_to->show_start_date = false;
$input_to->filter_year = true;
$input_to->type = ALL;
$input_to->cn = $cn;
$input_to->user = $g_user;
echo "  " . _('jusque') . ' :' . $input_to->input();
echo '<br>';
echo HtmlInput::button_action(_('Avancé'), " if (\$('balance_advanced_div').style.display=='none') { \$('balance_advanced_div').show();} else { \$('balance_advanced_div').hide();}");
//-------------------------------------------------
echo '<div id="balance_advanced_div" style="display:none">';
/*  add a all ledger choice */
echo _('Filtre') . " ";
$rad = new IRadio();
$array_ledger = $g_user->get_ledger('ALL', 3);
Exemple #20
0
     echo "<p>Diff = " . round(($end_mem - $start_mem) / 1024 / 1024, 2) . " Mbytes ";
     echo '</p>';
     echo "<p>Execution script " . $script . " time = " . round($end_time - $start_time, 4) . " secondes</p>";
     $nb++;
     if ($nb == $maxscan) {
         echo "Dernier test";
     } else {
         $get = 'test.php?' . http_build_query(array('script' => "all", 'gDossier' => $gDossierLogInput, 'nb_script' => $nb));
         echo '<a href="' . $get . '" target="_blank">';
         echo $scenario[$nb]['file'];
     }
 } else {
     $start_mem = memory_get_usage();
     $start_time = microtime(true);
     $script = str_replace('../', '', $script);
     $description = HtmlInput::default_value_get("description", "aucune description");
     echo '<h1>' . $script . "</h1>";
     echo '<p> description = ' . $description . '<p>';
     include '../scenario/' . $script;
     $end_mem = memory_get_usage();
     $end_time = microtime(true);
     echo "<p>start mem : " . $start_mem;
     echo '</p>';
     echo "<p>end mem : " . $end_mem;
     echo '</p>';
     echo "<p>Diff = " . ($end_mem - $start_mem) . " bytes ";
     echo "<p>Diff = " . round(($end_mem - $start_mem) / 1024, 2) . " kbytes ";
     echo "<p>Diff = " . round(($end_mem - $start_mem) / 1024 / 1024, 2) . " Mbytes ";
     echo '</p>';
     echo "<p>Execution script " . $script . " time = " . round($end_time - $start_time, 4) . " secondes</p>";
 }
    throw new Exception('ag_id is null');
}
require_once 'class_acc_ledger.php';
$r = HtmlInput::title_box(_("Détail fiche"), 'search_card');
$r .= '<form id="search_card1_frm" method="GET" onsubmit="action_add_concerned_card(this);return false;">';
$q = new IText('query');
$q->value = isset($query) ? $query : '';
$r .= '<span style="margin-left:50px">';
$r .= _('Fiche contenant') . HtmlInput::infobulle(19);
$r .= $q->input();
$r .= HtmlInput::submit('fs', _('Recherche'), "", "smallbutton");
$r .= '</span>';
$r .= dossier::hidden() . HtmlInput::hidden('op', 'add_concerned_card');
$r .= HtmlInput::request_to_hidden(array('ag_id'));
$r .= '</form>';
$query = HtmlInput::default_value_get("query", "");
$sql_array['query'] = $query;
$sql_array['typecard'] = 'all';
$fiche = new Fiche($cn);
/* Build the SQL and show result */
$sql = $fiche->build_sql($sql_array);
/* We limit the search to MAX_SEARCH_CARD records */
$sql = $sql . ' order by vw_name limit ' . MAX_SEARCH_CARD;
$a = $cn->get_array($sql);
for ($i = 0; $i < count($a); $i++) {
    $array[$i]['quick_code'] = $a[$i]['quick_code'];
    $array[$i]['name'] = h($a[$i]['vw_name']);
    $array[$i]['accounting'] = $a[$i]['accounting'];
    $array[$i]['first_name'] = h($a[$i]['vw_first_name']);
    $array[$i]['description'] = h($a[$i]['vw_description']);
    $array[$i]['javascript'] = sprintf("action_save_concerned(%d,'%s','%s')", $gDossier, $a[$i]['f_id'], $ag_id);
/*
 *   This file is part of NOALYSS.
 *
 *   NOALYSS is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   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 2015 Author Dany De Bontridder danydb@aevalys.eu
// require_once '.php';
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
// Security
if ($g_user->check_module('CFGPRO') == 0) {
    die;
}
$p_profile_menu_id = HtmlInput::default_value_get('p_profile_menu_id', 0);
$cn->exec_sql('delete from profile_menu where pm_id = $1 or pm_id_dep=$1', array($p_profile_menu_id));
?>
        
echo _("Type de tiers") . " " . $w_select->input();
?>
   <?php 
echo HtmlInput::submit("view", _('Valider'));
?>
</form>

<?php 
if (!isset($_GET['view'])) {
    html_page_stop();
    return;
}
?>
<form method="get" action="export.php">
    <?php 
echo HtmlInput::request_to_hidden(array('gDossier', 'ac', 'p_type', 'p_let', 'p_date_start'));
echo HtmlInput::hidden('act', 'CSV:balance_age');
echo HtmlInput::submit('csv', _('export CSV'));
?>
</form>
<?php 
require_once 'class_balance_age.php';
$balance = new Balance_Age($cn);
$type = HtmlInput::default_value_get('p_type', 'C');
$let = HtmlInput::default_value_get('p_let', 'unlet');
$date = HtmlInput::default_value_get('p_date_start', date('d.m.Y'));
if ($type == "C") {
    $balance->display_sale($date, $let);
} else {
    $balance->display_purchase($date, $let);
}
Exemple #24
0
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_iselect.php';
require_once NOALYSS_INCLUDE . '/class_icheckbox.php';
require_once NOALYSS_INCLUDE . '/class_ihidden.php';
require_once NOALYSS_INCLUDE . '/class_database.php';
require_once NOALYSS_INCLUDE . '/ac_common.php';
require_once NOALYSS_INCLUDE . '/class_pre_operation.php';
/*
 * Value from $_GET or $_REQUEST
 */
$request_jrn = HtmlInput::default_value_request("jrn", -1);
$request_ac = HtmlInput::default_value_request("ac", "");
$request_sa = HtmlInput::default_value_request("sa", "");
$get_jrn = HtmlInput::default_value_get('jrn', -1);
echo '<div class="content">';
echo '<form method="GET">';
$sel = new ISelect();
$sel->name = "jrn";
$sel->value = $cn->make_array("select jrn_def_id,jrn_def_name from " . " jrn_def where jrn_def_type in ('VEN','ACH','ODS') order by jrn_def_name");
// Show a list of ledger
$sel->selected = $request_jrn;
echo 'Choisissez un journal ' . $sel->input();
echo dossier::hidden();
$hid = new IHidden();
echo $hid->input("sa", "jrn");
echo $hid->input("ac", $request_ac);
echo '<hr>';
echo HtmlInput::submit('Accepter', 'Accepter');
echo '</form>';
    }
    if ($todo->is_shared_with($p_login) == 0) {
        // Add a share to the user
        $todo->add_share($p_login);
    } else {
        // remove a share from the user
        $todo->remove_share($p_login);
    }
}
////////////////////////////////////////////////////////////////////////////////
// Remove the share of a note which the connected user doesn't own
//
////////////////////////////////////////////////////////////////////////////////
if ($ac == "remove_share") {
    $id = HtmlInput::default_value_get("todo_id", 0);
    $p_login = HtmlInput::default_value_get("login", "");
    // If note_id is not correct then give an error
    if ($id == 0 || isNumber($id) == 0 || trim($p_login) == "") {
        header('Content-type: text/xml; charset=UTF-8');
        $dom = new DOMDocument('1.0', 'UTF-8');
        $status = $dom->createElement('status', "nok");
        $tl_id = $dom->createElement('content', _("Erreur : paramètre invalide"));
        $dom->appendChild($status);
        $dom->appendChild($tl_id);
        echo $dom->saveXML();
        return;
    }
    $todo = new Todo_List($cn);
    $todo->set_parameter("id", $id);
    $todo->load();
    $todo->remove_share($p_login);
 /**
  * @brief zoom the calendar
  */
 function zoom_calendar($notitle)
 {
     global $g_user;
     $exercice_user = $g_user->get_exercice();
     /* day */
     $cell = array();
     for ($i = 0; $i < 42; $i++) {
         $cell[$i] = "";
     }
     $this->set_month_year();
     /* weekday */
     $week = array(_('Dimanche'), _('Lundi'), _('Mardi'), _('Mercredi'), _('Jeudi'), _('Vendredi'), _('Samedi'));
     $this->fill_from_action($cell, "long");
     $this->fill_from_todo($cell, "long");
     $wMonth = new ISelect('per_div');
     $cn = new Database(dossier::id());
     $wMonth->value = $cn->make_array("select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = '{$exercice_user}' order by p_start");
     $wMonth->selected = $this->default_periode;
     $wMonth->javascript = sprintf("onchange=calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s',notitle:%d})", dossier::id(), 'per_div', 'calendar_zoom_div', 'cal', $notitle);
     $wMonth->set_attribute('gDossier', dossier::id());
     $month_year = $wMonth->input() . $wMonth->get_js_attr();
     ob_start();
     $zoom = 1;
     $notitle = HtmlInput::default_value_get('notitle', 0);
     require_once NOALYSS_INCLUDE . '/template/calendar.php';
     if (count($this->action_div) > 0) {
         foreach ($this->action_div as $day) {
             echo $day;
         }
     }
     $ret = ob_get_contents();
     ob_end_clean();
     return $ret;
 }
require_once NOALYSS_INCLUDE . '/class_exercice.php';
if (isset($_POST['del'])) {
    if (isset($_POST['ok'])) {
        if ($g_user->can_write_repo($_POST['r_id'])) {
            $cn->exec_sql('delete from stock_change where c_id=$1', array($_POST['c_id']));
        } else {
            alert(_("Vous ne pouvez pas modifier ce dépôt"));
        }
    } else {
        alert(_("Opération non effacée: vous n'avez pas confirmé"));
    }
}
$profile = $g_user->get_profile();
$gDossier = dossier::id();
$default_exercice = $g_user->get_exercice();
$p_exercice = HtmlInput::default_value_get("p_exercice", $default_exercice);
$a_change = $cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_date from stock_change as sc\n\t\t\tjoin stock_repository as sr on (sc.r_id=sr.r_id)\n\t\t\twhere sc.r_id in (select r_id from profile_sec_repository where p_id=\$1)\n                         and c_date >= (select min(p_start) from parm_periode where p_exercice = \$2)\n                        and c_date <= (select max(p_end) from parm_periode where p_exercice = \$2)\n\t\torder by c_date", array($profile, $p_exercice));
$exercice = new Exercice($cn);
?>
<div class="content">
    <form method="get" class="print">
      <?php 
echo HtmlInput::get_to_hidden(array('gDossier', 'ac'));
?>
      <?php 
echo $exercice->select('p_exercice', $p_exercice)->input();
?>
      <?php 
echo HtmlInput::submit("filter", _('Valider'));
?>
    </form>
if ($g_user->check_module('CFGPCMN') == 0) {
    $html = h2(_('Action interdite'), ' class="notice"');
    $html = escape_xml($response);
    header('Content-type: text/xml; charset=UTF-8');
    echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ctl>pcmn_update</ctl>
<code>{$html}</code>
<status>NOTALLOWED</status>
</data>
EOF;
    return;
}
ob_start();
$pcmn_val = HtmlInput::default_value_get('value', "-1");
// if empty
if ($pcmn_val != "-1") {
    // not set
}
$action = 'new';
$val = new IText('p_valu');
$parent = new IText('p_parentu');
$lib = new IText('p_libu');
$lib->css_size = "100%";
$type = new ISelect('p_typeu');
$type->value = Acc_Account::$type;
if ($pcmn_val != "") {
    $action = 'update';
    /*
     * Not empty, show the default value
require_once NOALYSS_INCLUDE . '/class_pdf.php';
$gDossier = dossier::id();
$cn = new Database($gDossier);
extract($_GET);
$ret = "";
$Form = new Acc_Report($cn, $form_id);
$Libelle = sprintf("%s ", $Form->get_name());
$pdf = new PDF($cn);
$pdf->setDossierInfo($Libelle);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetAuthor('NOALYSS');
$pdf->setTitle("Rapport " . $Libelle, true);
// Step ??
//--
$step = HtmlInput::default_value_get("p_step", 0);
if ($step == 0) {
    // No step asked
    //--
    if ($_GET['type_periode'] == 0) {
        $array = $Form->get_row($_GET['from_periode'], $_GET['to_periode'], $_GET['type_periode']);
    } else {
        $array = $Form->get_row($_GET['from_date'], $_GET['to_date'], $_GET['type_periode']);
    }
} else {
    // yes with step
    //--
    for ($e = $_GET['from_periode']; $e <= $_GET['to_periode']; $e += $_GET['p_step']) {
        $periode = getPeriodeName($cn, $e);
        if ($periode == null) {
            continue;
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_acc_account.php';
require_once NOALYSS_INCLUDE . '/ac_common.php';
require_once NOALYSS_INCLUDE . '/constant.php';
require_once NOALYSS_INCLUDE . '/class_dossier.php';
require_once NOALYSS_INCLUDE . '/function_javascript.php';
$gDossier = dossier::id();
require_once NOALYSS_INCLUDE . '/class_database.php';
/* Admin. Dossier */
$cn = new Database($gDossier);
require_once NOALYSS_INCLUDE . '/class_user.php';
require_once NOALYSS_INCLUDE . '/user_menu.php';
echo '<div id="acc_update" class="inner_box" style="display:none;position:absolute;text-align:left;z-index:1"></div>';
/* Store the p_start parameter */
$g_start = HtmlInput::default_value_get('p_start', 1);
?>
<a  id="top"></a>

<div class="content">
<?php 
menu_acc_plan($g_start);
?>
</div>

<DIV CLASS="myfieldset" style="width:auto">
<?php 
$Ret = $cn->exec_sql("select pcm_val,pcm_lib,pcm_val_parent,pcm_type,array_to_string(array_agg(j_qcode) , ',') as acode\n\tfrom tmp_pcmn left join vw_poste_qcode on (j_poste=pcm_val) where substr(pcm_val::text,1,1)='" . $g_start . "'" . "  group by pcm_val,pcm_lib,pcm_val_parent, pcm_type  order by pcm_val::text");
$MaxRow = Database::num_row($Ret);
?>
<span style="display:inline;margin: 15px 15px 15px 15px">