Commit 3398153c authored by SNA's avatar SNA
Browse files

Création rep entreprise

parent 1bc09e9c
<?php
/*
* Copyright 2008,2009 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework 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 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework 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 Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Action : simple confirm
*
* Open a modal box to confirm a status modification. Used by the core (manage_action.php page).
*
* @file
* @author Claire Figueras <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup apps
*/
/**
* $confirm bool true
*/
$confirm = true;
/**
* $etapes array Contains only one etap, the status modification
*/
$etapes = array('status','close');
require_once($_SESSION['pathtocoreclass']."class_history.php");
/**
* Manages a status (All params must be declared, even if not used, to corresponds to the action management of the core)
*
* @param $arr_id array Contains the res_id to be modified
* @param $history string Not Used here
* @param $id_action string Action identifier
* @param $label_action string Action label
* @param $status string New status
* @return bool false in sql error case, true otherwise
*/
function manage_status($arr_id, $history, $id_action, $label_action, $status)
{
$db = new dbquery();
$db->connect();
$result = '';
for($i=0; $i<count($arr_id );$i++)
{
$result .= $arr_id[$i].'#';
$req = $db->query("update ".$_POST['table']. " set status = '".$status."' where res_id = ".$arr_id[$i], true);
if(!$req)
{
$_SESSION['error'] = _SQL_ERROR;
return false;
}
}
return array('result' => $result, 'history_msg' => '');
//return true;
}
function manage_close($arr_id, $history, $id_action, $label_action, $status)
{
$db = new dbquery();
$db->connect();
$result = '';
require_once($_SESSION['pathtocoreclass'].'class_security.php');
require_once($_SESSION['pathtocoreclass'].'class_request.php');
$sec = new security();
$req = new request();
$ind_coll = $sec->get_ind_collection($_POST['coll_id']);
$ext_table = $_SESSION['collections'][$ind_coll]['extensions'][0];
$current_date = $req->current_datetime();
for($i=0; $i<count($arr_id );$i++)
{
$result .= $arr_id[$i].'#';
$req = $db->query("update ".$ext_table. " set closing_date = ".$current_date." where res_id = ".$arr_id[$i], true);
if(!$req)
{
$_SESSION['error'] = _SQL_ERROR;
return false;
}
}
return array('result' => $result, 'history_msg' => '');
}
?>
<?php
/*
* Copyright 2008,2009 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework 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 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework 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 Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Action : simple confirm
*
* Open a modal box to confirm a status modification. Used by the core (manage_action.php page).
*
* @file
* @author Claire Figueras <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup apps
*/
/**
* $confirm bool true
*/
$confirm = true;
/**
* $etapes array Contains only one etap, the status modification
*/
$etapes = array('status');
require_once($_SESSION['pathtocoreclass']."class_history.php");
/**
* Manages a status (All params must be declared, even if not used, to corresponds to the action management of the core)
*
* @param $arr_id array Contains the res_id to be modified
* @param $history string Not Used here
* @param $id_action string Action identifier
* @param $label_action string Action label
* @param $status string New status
* @return bool false in sql error case, true otherwise
*/
function manage_status($arr_id, $history, $id_action, $label_action, $status)
{
$db = new dbquery();
$db->connect();
$result = '';
for($i=0; $i<count($arr_id );$i++)
{
$result .= $arr_id[$i].'#';
$req = $db->query("update ".$_POST['table']. " set status = '".$status."' where res_id = ".$arr_id[$i], true);
if(!$req)
{
$_SESSION['error'] = _SQL_ERROR;
return false;
}
}
return array('result' => $result, 'history_msg' => '');
//return true;
}
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/*
* Copyright 2008,2009 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework 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 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework 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 Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief View a document
*
* @file view.php
* @author Claire Figueras <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup indexing_searching_mlb
*/
/**
* $etapes array Contains 2 etaps : form and status (order matters)
*/
$etapes = array('form', 'status');
/**
* $frm_width Width of the modal (empty)
*/
$frm_width='';
/**
* $frm_height Height of the modal (empty)
*/
$frm_height = '';
/**
* $mode_form Mode of the modal : fullscreen
*/
$mode_form = 'fullscreen';
/**
* Returns the indexing form text
*
* @param $values Array Contains the res_id of the document to process
* @param $path_manage_action String Path to the PHP file called in Ajax
* @param $id_action String Action identifier
* @param $table String Table
* @param $module String Origin of the action
* @param $coll_id String Collection identifier
* @param $mode String Action mode 'mass' or 'page'
* @return String The form content text
**/
function get_form_txt($values, $path_manage_action, $id_action, $table, $module, $coll_id, $mode )
{
$res_id = $values[0];
$frm_str = '';
$_SESSION['doc_id'] = $res_id;
$frm_str .= '<div>';
$frm_str .= ' <center><input name="close" id="close" type="button" value="'._CLOSE.'" class="button" onClick="javascript:$(\'baskets\').style.visibility=\'visible\';destroyModal(\'modal_'.$id_action.'\');reinit();"/></center>';
$frm_str .= ' <iframe src="'.$_SESSION['config']['businesappurl'].'indexing_searching/view.php?id='.$res_id.'" name="viewframe" id="viewframe" scrolling="auto" frameborder="0" ></iframe>';
$frm_str .= '</div>';
$frm_str .= '<script type="text/javascript">resize_frame_process("modal_'.$id_action.'", "viewframe", true, true);resize_frame_process("modal_'.$id_action.'", "hist_doc", true, false);window.scrollTo(0,0);</script>';
return addslashes($frm_str);
}
?>
<?php
/**
* File : admin.php
*
* Administration summary Page
* {@internal this page calls an admin object (class admin)}}
*
* @package Maarch Framework v3
* @version 2.1
* @since 10/2005
* @license GPL
* @author Claire Figueras <dev@maarch.org>
*/
/**
* include the test admin page
*
* this page tests the user access level, and if the user is an admin or not
*/
require_once($_SESSION['pathtocoreclass']."class_functions.php");
require($_SESSION['config']['businessapppath']."class".$_SESSION['slash_env']."class_admin.php");
$admin = new admin();
$core_tools2 = new core_tools();
$core_tools2->test_admin('admin', 'apps');
/****************Management of the location bar ************/
$init = false;
if($_REQUEST['reinit'] == "true")
{
$init = true;
}
$level = "";
if($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1)
{
$level = $_REQUEST['level'];
}
$page_path = $_SESSION['config']['businessappurl'].'index.php?page=admin';
$page_label = _ADMIN;
$page_id = "admin";
$core_tools2->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
/***********************************************************/
unset($_SESSION['m_admin']);
?>
<h1><img src="<?php echo $_SESSION['config']['img'];?>/picto_admin_b.gif" alt="" /> <?php echo _ADMIN;?></h1>
<div id="inner_content" class="clearfix">
<?php
$admin->retrieve_app_admin_services($_SESSION['app_services']);
?>
<!--<hr />-->
<?php
$admin->retrieve_modules_admin_services($_SESSION['modules_services']);
?>
</div>
<?php
/*
* Copyright 2008,2009 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework 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 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework 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 Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Displays actions in a list
*
* @file
* @author Claire Figueras <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup admin
*/
$admin = new core_tools();
$admin->test_admin('admin_actions', 'apps');
$func = new functions();
/****************Management of the location bar ************/
$init = false;
if($_REQUEST['reinit'] == "true")
{
$init = true;
}
$level = "";
if($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1)
{
$level = $_REQUEST['level'];
}
$page_path = $_SESSION['config']['businessappurl'].'index.php?page=action&admin=action';
$page_label = _ACTION_LIST;
$page_id = "action";
$admin->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
/***********************************************************/
require_once($_SESSION['pathtocoreclass']."class_request.php");
require_once($_SESSION['config']['businessapppath']."class".DIRECTORY_SEPARATOR."class_list_show.php");
$select[$_SESSION['tablename']['actions']] = array();
array_push($select[$_SESSION['tablename']['actions']],"id", "label_action", 'is_system');
$what = "";
$where =" enabled = 'Y' ";
if(isset($_REQUEST['what']))
{
$what = $func->protect_string_db($_REQUEST['what']);
if($_SESSION['config']['databasetype'] == "POSTGRESQL")
{
$where .= " and (label_action ilike '".$func->protect_string_db($what,$_SESSION['config']['databasetype'])."%' or id ilike '".$func->protect_string_db($what,$_SESSION['config']['databasetype'])."%' ) ";
}
else
{
$where .= " and (label_action like '".$func->protect_string_db($what,$_SESSION['config']['databasetype'])."%' or id like '".$func->protect_string_db($what,$_SESSION['config']['databasetype'])."%' ) ";
}
}
$list = new list_show();
$order = 'asc';
if(isset($_REQUEST['order']) && !empty($_REQUEST['order']))
{
$order = trim($_REQUEST['order']);
}
$field = 'label_action';
if(isset($_REQUEST['order_field']) && !empty($_REQUEST['order_field']))
{
$field = trim($_REQUEST['order_field']);
}
$orderstr = $list->define_order($order, $field);
$request= new request;
$tab=$request->select($select,$where,$orderstr,$_SESSION['config']['databasetype']);
//$request->show();
$del = array();
for ($i=0;$i<count($tab);$i++)
{
for ($j=0;$j<count($tab[$i]);$j++)
{
foreach(array_keys($tab[$i][$j]) as $value)
{
if($tab[$i][$j][$value]=="id")
{
$load = $admin->is_action_defined($tab[$i][$j]['value']);
$tab[$i][$j]["id"]=$tab[$i][$j]['value'];
$tab[$i][$j]["label"]= _ID;
$tab[$i][$j]["size"]="18";
$tab[$i][$j]["label_align"]="left";
$tab[$i][$j]["align"]="left";
$tab[$i][$j]["valign"]="bottom";
$tab[$i][$j]["show"]=true;
$tab[$i][$j]["order"]='id';
if(!$load)
{
array_push($del, $i);
//unset($tab[$i]);
}
}
if($tab[$i][$j][$value]=="label_action")
{
$tab[$i][$j]['value']=$request->show_string($tab[$i][$j]['value']);
$tab[$i][$j]["label_action"]=$tab[$i][$j]['value'];
$tab[$i][$j]["label"]=_DESC;
$tab[$i][$j]["size"]="15";
$tab[$i][$j]["label_align"]="left";
$tab[$i][$j]["align"]="left";
$tab[$i][$j]["valign"]="bottom";
$tab[$i][$j]["show"]=true;
$tab[$i][$j]["order"]='label_action';
}
if($tab[$i][$j][$value]=="is_system")
{
if($tab[$i][$j]['value'] == 'Y')
{
$tab[$i][$j]['value'] = _YES;
array_push($tab[$i], array('column' => 'can_delete', 'value' => 'false', 'can_delete' => 'false',
'label' => _DESC,'show' => false));
}
else
{
$tab[$i][$j]['value'] = _NO;
array_push($tab[$i], array('column' => 'can_delete', 'value' => 'true', 'can_delete' => 'true',
'label' => _DESC,'show' => false));
}
$tab[$i][$j]["is_system"]=$tab[$i][$j]['value'];
$tab[$i][$j]["label"]=_IS_SYSTEM;
$tab[$i][$j]["size"]="5";
$tab[$i][$j]["label_align"]="left";
$tab[$i][$j]["align"]="left";
$tab[$i][$j]["valign"]="bottom";
$tab[$i][$j]["show"]=true;
$tab[$i][$j]["order"]='is_system';
}
}
}
}
for($i=0; $i<count($del);$i++)
{
array_splice($tab, $del[$i], 1);
}
//$request->show_array($tab);
$page_name = "action";
$page_name_up = "action_up";
$page_name_del = "action_del";
$page_name_val= "";
$page_name_ban = "";
$page_name_add = "action_add";
$label_add = _ADD_ACTION;
$_SESSION['m_admin']['init'] = true;
$title = _ACTION_LIST." : ".count($tab)." "._ACTIONS;
$autoCompletionArray = array();
$autoCompletionArray["list_script_url"] = $_SESSION['config']['businessappurl']."admin/action/action_list_by_name.php";
$autoCompletionArray["number_to_begin"] = 1;
$list->admin_list($tab, count($tab), $title, 'id','action','action','id', true, $page_name_up, $page_name_val, $page_name_ban, $page_name_del, $page_name_add, $label_add, FALSE, FALSE, _ALL_ACTIONS, _ACTION, $_SESSION['config']['img'].'/manage_actions_b.gif', false, true, false, true, $what, true, $autoCompletionArray);
$_SESSION['m_admin']['action'] = array();
?>
<?php
/*
* Copyright 2008,2009 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework 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 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework 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 Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Form to add an action
*
* @file
* @author Claire Figueras <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup admin
*/
session_name('PeopleBox');
session_start();
$core_tools2 = new core_tools();
//here we loading the lang vars
$core_tools2->load_lang();
$core_tools2->test_admin('admin_actions', 'apps');
/****************Management of the location bar ************/
$init = false;
if($_REQUEST['reinit'] == "true")
{
$init = true;
}
$level = "";
if($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1)
{
$level = $_REQUEST['level'];
}
$page_path = $_SESSION['config']['businessappurl'].'index.php?page=action_add&admin=action';
$page_label = _ADDITION;
$page_id = "action_add";
$core_tools2->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
/***********************************************************/
require($_SESSION['config']['businessapppath']."class".DIRECTORY_SEPARATOR."class_admin_actions.php");
$action = new AdminActions();
$action->formaction("add");
?>
\ No newline at end of file
<?php
/*
* Copyright 2008,2009 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework 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 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework 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 Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @brief Delete an action
*
* @file
* @author Claire Figueras <dev@maarch.org>
* @date $date$
* @version $Revision$
* @ingroup admin
*/
session_name('PeopleBox');
session_start();
require_once($_SESSION['pathtocoreclass']."class_functions.php");
require($_SESSION['pathtocoreclass']."class_core_tools.php");
$core_tools = new core_tools();
//here we loading the lang vars
$core_tools->load_lang();
$core_tools->test_admin('admin_actions', 'apps');
require_once($_SESSION['pathtocoreclass']."class_db.php");
require($_SESSION['config']['businessapppath']."class".DIRECTORY_SEPARATOR."class_admin_actions.php");
$func = new functions();
if(isset($_GET['id']))
{
$s_id = addslashes($func->wash($_GET['id'], "alphanum", _THE_ACTION));
}
else
{
$s_id = "";
}
$action= new AdminActions();
$action->delaction($s_id);