Exemplo n.º 1
0
// Update the detail
// Add a new action related to this one or update
//----------------------------------------------------------------------
if ($sub_action == "update") {
    // Update the modification
    if (isset($_POST['save'])) {
        $act2 = new Follow_Up($cn);
        $act2->fromArray($_POST);
        if ($g_user->can_write_action($act2->ag_id) == false) {
            echo '<div class="redcontent">';
            echo '<h2 class="error">' . _('Cette action ne vous est pas autorisée Contactez votre responsable') . '</h2>';
            echo '</div>';
            return;
        }
        $sub_action = "detail";
        put_global(array(array('key' => "sa", "value" => "detail")));
        try {
            $act2->verify();
            $act2->Update();
        } catch (Exception $e) {
            echo '<span class="notice">';
            echo _("Erreur") . " " . $e->getMessage();
            echo '</span>';
            $sub_action = "detail";
            $correction = 1;
            $act = clone $act2;
            $act->get();
            $act->fromArray($_POST);
            $error_id = $e->getCode();
        }
    }
Exemplo n.º 2
0
} else {
    $div = 'search_op';
    $action = "";
    $callback = "";
    echo HtmlInput::title_box(_('Recherche'), $div);
    echo '<form name="search_form_ajx" id="search_form_ajx" onsubmit="search_operation(this);return false">';
    echo HtmlInput::get_to_hidden(array('ctlc', 'ledger', 'target'));
    $inside = true;
}
echo $search_box;
echo HtmlInput::submit("viewsearch", _("Recherche"));
echo HtmlInput::button_close('search_op');
echo '</form>';
if (isset($_GET['amount_min']) && isset($_GET['amount_max']) && ($_GET['amount_max'] != 0 || $_GET['amount_min'] != 0)) {
    $_GET['viewsearch'] = 1;
    put_global(array(array('key' => 'ledger_type', 'value' => 'ALL')));
}
//-----------------------------------------------------
// Display search result
//-----------------------------------------------------
if (isset($_GET['viewsearch'])) {
    // Navigation bar
    $step = MAX_RECONCILE;
    $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';
Exemplo n.º 3
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++;
}
 *
 *   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
/*!\file
 * \brief show all the operation for a customer
 * the variable inherited are
 * - $cn database connexion
 * - $_REQUEST['f_id'] the f_id of the card
 * - $p_action
 * - $sub_action
 * - $ss_action
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_acc_ledger.php';
$f = new Fiche($cn, $_REQUEST['f_id']);
$qcode = $f->get_quick_code();
$_GET['qcode'] = $qcode;
$_REQUEST['qcode'] = $qcode;
$var_array = compute_variable('ledger_type=ALL');
put_global($var_array);
require_once NOALYSS_INCLUDE . '/history_operation.inc.php';