[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4321 - in phpcompta/trunk: html include include/templat
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4321 - in phpcompta/trunk: html include include/template sql |
Date: |
Wed, 9 Nov 2011 00:04:58 +0100 (CET) |
Author: danydb
Date: 2011-11-09 00:04:55 +0100 (Wed, 09 Nov 2011)
New Revision: 4321
Added:
phpcompta/trunk/sql/extension.sql
Modified:
phpcompta/trunk/html/ajax.php
phpcompta/trunk/html/do.php
phpcompta/trunk/html/extension.raw.php
phpcompta/trunk/include/ac_common.php
phpcompta/trunk/include/class_extension.php
phpcompta/trunk/include/extension_choice.inc.php
phpcompta/trunk/include/extension_get.inc.php
phpcompta/trunk/include/template/module.php
phpcompta/trunk/sql/object-6.0.sql
phpcompta/trunk/sql/upgrade.sql
Log:
Extension : change for security, now based on MENU_REF
Update the script to put the extension into menu_ref + profile_menu
Modified: phpcompta/trunk/html/ajax.php
===================================================================
--- phpcompta/trunk/html/ajax.php 2011-11-08 19:45:07 UTC (rev 4320)
+++ phpcompta/trunk/html/ajax.php 2011-11-08 23:04:55 UTC (rev 4321)
@@ -21,8 +21,8 @@
{
$ext=new Extension($cn);
- $ext->search('code',$_REQUEST['plugin_code']);
- if ( $ext->get_parameter('id') != 0 )
+
+ if ( $ext->search($_REQUEST['plugin_code']) != -1)
{
/* security */
if ( !isset ($_SESSION['g_user']) ||
$ext->can_request($_SESSION['g_user']) == 0 )
@@ -30,7 +30,7 @@
exit();
}
/* call the ajax script */
-
require_once('ext'.DIRECTORY_SEPARATOR.dirname(trim($ext->get_parameter('filepath'))).DIRECTORY_SEPARATOR.'ajax.php');
+
require_once('ext'.DIRECTORY_SEPARATOR.dirname(trim($ext->get_parameter('me_file'))).DIRECTORY_SEPARATOR.'ajax.php');
}
else
{
Modified: phpcompta/trunk/html/do.php
===================================================================
--- phpcompta/trunk/html/do.php 2011-11-08 19:45:07 UTC (rev 4320)
+++ phpcompta/trunk/html/do.php 2011-11-08 23:04:55 UTC (rev 4321)
@@ -127,6 +127,17 @@
show_menu($all, $i);
}
}
+elseif (isset($_REQUEST['plugin_code']))
+{
+ $default = find_default_module();
+ $_GET['ac']=$default;
+ $_POST['ac']=$default;
+ $_REQUEST['ac']=$default;
+ show_module('EXTENSION');
+ $all[0] = $default;
+ show_menu($all, 0);
+ require_once 'extension_choice.inc.php';
+}
else
{
$default = find_default_module();
Modified: phpcompta/trunk/html/extension.raw.php
===================================================================
--- phpcompta/trunk/html/extension.raw.php 2011-11-08 19:45:07 UTC (rev
4320)
+++ phpcompta/trunk/html/extension.raw.php 2011-11-08 23:04:55 UTC (rev
4321)
@@ -41,16 +41,16 @@
$only_plugin=$user->check_dossier(dossier::id());
$ext=new Extension($cn);
-$ext->search('code',$_REQUEST['plugin_code']);
-if ( $ext->get_parameter('id') != 0 )
+
+if ( $ext->search($_REQUEST['plugin_code']) != -1 )
{
/* security */
if ( !isset ($_SESSION['g_user']) ||
$ext->can_request($_SESSION['g_user']) == 0 )
{
- exit();
+ exit();
}
/* call the ajax script */
-
require_once('ext'.DIRECTORY_SEPARATOR.dirname(trim($ext->get_parameter('filepath'))).DIRECTORY_SEPARATOR.'raw.php');
+
require_once('ext'.DIRECTORY_SEPARATOR.dirname(trim($ext->get_parameter('me_file'))).DIRECTORY_SEPARATOR.'raw.php');
}
else
{
Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php 2011-11-08 19:45:07 UTC (rev
4320)
+++ phpcompta/trunk/include/ac_common.php 2011-11-08 23:04:55 UTC (rev
4321)
@@ -737,7 +737,7 @@
global $g_user;
$cn = Dossier::connect();
$amodule = $cn->get_array("select
- me_code,me_menu,me_url,me_javascript,p_order
+ me_code,me_menu,me_url,me_javascript,p_order,me_type
from v_all_menu
where
user_name=$1
@@ -747,7 +747,7 @@
if ($selected != -1)
{
require_once('template/module.php');
- $file = $cn->get_array("select me_file,me_parameter,me_javascript from
v_all_menu
+ $file = $cn->get_array("select
me_file,me_parameter,me_javascript,me_type from v_all_menu
where me_code=$1 and user_name=$2",
array($selected,$g_user->login));
if ( count($file ) == 0 )
{
@@ -766,6 +766,9 @@
$array=compute_variable($file[0]['me_parameter']);
put_global($array);
}
+
+ // 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
@@ -810,7 +813,7 @@
if (count($default_module) > 1)
{
- echo_error("Plusieurs modules sont le module par défaut", __LINE__,
__FILE__);
+ echo_error("Plusieurs modules sont le module par défaut",
__LINE__, __FILE__);
}
elseif (count($default_module) == 1)
{
@@ -829,21 +832,21 @@
global $g_user;
$cn = Dossier::connect();
$amenu = $cn->get_array("select
- me_menu,me_code,me_url,me_javascript
+ me_menu,me_code,me_url,me_javascript,me_type
from v_all_menu
where
me_code_dep=$1 and user_name=$2 order by p_order", array($module[$idx],
$g_user->login));
if (!empty($amenu) && count($amenu) > 1)
{
- require 'template/menu.php';
+ require 'template/menu.php';
}
elseif (count($amenu) == 1)
{
- echo '<div class="topmenu">';
- echo h2info($amenu[0]['me_menu']);
- echo '</div>';
- $module[$idx] = $amenu[0]['me_code'];
+ echo '<div class="topmenu">';
+ echo h2info($amenu[0]['me_menu']);
+ echo '</div>';
+ $module[$idx] = $amenu[0]['me_code'];
}
if (empty($amenu) || count($amenu) == 1)
@@ -852,7 +855,7 @@
* @todo add security
* check if user can access this module
*/
- $file = $cn->get_array("select
me_file,me_parameter,me_javascript
+ $file = $cn->get_array("select
me_file,me_parameter,me_javascript,me_type
from menu_ref
where
me_code=$1 and
@@ -869,24 +872,29 @@
{
if ($file[0]['me_parameter'] !== "")
{
- // if there are paramter put them in superglobal
- $array=compute_variable($file[0]['me_parameter']);
- put_global($array);
+ // if there are paramter put them in superglobal
+
$array=compute_variable($file[0]['me_parameter']);
+ put_global($array);
}
- echo '<div class="content">';
- require_once $file[0]['me_file'];
- echo '</div>';
+
+ // 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'] != '')
{
- echo create_script($file[0]['me_javascript']);
+ echo create_script($file[0]['me_javascript']);
}
}
}
/**
* Put in superglobal (get,post,request) the value contained in
- * the superglobal
+ * the parameter field (me_parameter)
* @param $array [key] [value]
*/
function put_global($array)
Modified: phpcompta/trunk/include/class_extension.php
===================================================================
--- phpcompta/trunk/include/class_extension.php 2011-11-08 19:45:07 UTC (rev
4320)
+++ phpcompta/trunk/include/class_extension.php 2011-11-08 23:04:55 UTC (rev
4321)
@@ -25,8 +25,8 @@
* the inclusion...
*/
/*!\brief manage the extension, it involves the table extension
- *
- * Data member
+ *
+ * Data member
* - $cn database connection
* - $variable :
* - id (extension.ex_id)
@@ -36,136 +36,22 @@
* - enable (extension.ex_enable)
* - filepath (extension.ex_file)
*/
-class Extension
-{
- private static $variable=array('id'=>'ex_id',
- 'name'=>'ex_name',
- 'code'=>'ex_code',
- 'desc'=>'ex_desc',
- 'enable'=>'ex_enable',
- 'filepath'=>'ex_file');
- /*!\brief constructor
- *\param a database connextion
- */
- function __construct ($p_init)
- {
- $this->cn=$p_init;
- $this->ex_id=0;
- }
- public function get_parameter($p_string)
- {
- if ( array_key_exists($p_string,self::$variable) )
- {
- $idx=self::$variable[$p_string];
- return $this->$idx;
- }
- else
- exit (__FILE__.":".__LINE__.'Erreur attribut
inexistant'.$p_string);
- }
- public function set_parameter($p_string,$p_value)
- {
- if ( array_key_exists($p_string,self::$variable) )
- {
- $idx=self::$variable[$p_string];
- $this->$idx=$p_value;
- }
- else
- exit (__FILE__.":".__LINE__.'Erreur attribut inexistant
'.$p_string);
+require_once 'class_menu_ref_sql.php';
-
- }
- public function get_info()
- {
- return var_export(self::$variable,true);
- }
+class Extension extends Menu_Ref_sql
+{
+ /**
+ * @todo to be rewritten
+ */
public function verify()
{
// Verify that the elt we want to add is correct
- if (trim($this->ex_code)=="") throw new Exception('Le code ne peut pas
être vide');
- if (trim($this->ex_name)=="") throw new Exception('Le nom ne peut pas
être vide');
- if (trim($this->ex_file)=="") throw new Exception('Chemin incorrect');
- if
(file_exists('..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'ext'.DIRECTORY_SEPARATOR.$this->ex_file)
== false)
+ if (trim($this->me_code)=="") throw new Exception('Le code ne peut pas
être vide');
+ if (trim($this->me_name)=="") throw new Exception('Le nom ne peut pas
être vide');
+ if (trim($this->me_file)=="") throw new Exception('Chemin incorrect');
+ if
(file_exists('..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'ext'.DIRECTORY_SEPARATOR.$this->me_file)
== false)
throw new Exception ('Extension non trouvée, le chemin est-il
correct?');
}
- /*!\brief call insert for a new plugin or update if the plugin exist */
- public function save()
- {
- if ( $this->get_parameter("id") == 0 )
- $this->insert();
- else
- $this->update();
- }
- /*!\brief insert a plugin
- * \return error = -1 otherwiser the id */
- public function insert()
- {
- if ( $this->verify() != 0 ) return -1;
- if ( $this->cn->count_sql('select * from extension where
upper(ex_code)=upper($1)',
- array($this->ex_code)) > 0)
- throw new Exception ('Ce code existe déjà');
- if ( $this->cn->count_sql('select * from extension where
upper(ex_name)=upper($1)',
- array($this->ex_name)) > 0)
- throw new Exception ('Ce nom existe déjà');
-
- $sql='INSERT INTO extension( ex_code, ex_desc, ex_file,
ex_enable,ex_name) '.
- ' VALUES ($1, $2, $3,$4,$5) returning ex_id';
- $res=$this->cn->exec_sql(
- $sql,
- array($this->ex_code,
- $this->ex_desc,
- $this->ex_file,
- $this->ex_enable,
- $this->ex_name)
- );
- $this->ex_id=Database::fetch_result($res,0,0);
- }
- /*!\brief update a plugin
- * \return error = -1 otherwiser 0 */
- public function update()
- {
- if ( $this->verify() != 0 ) return -1;
- $sql='UPDATE extension '.
- 'SET ex_code=$1, ex_desc=$2, ex_file=$3, ex_enable=$4,ex_name=$5
'.
- ' WHERE ex_id=$6 ';
- $this->cn->exec_sql($sql,
- array($this->ex_code,
- $this->ex_desc,
- $this->ex_file,
- $this->ex_enable,
- $this->ex_name,
- $this->ex_id)
- );
- return 0;
- }
- /*!\brief load a plugin */
- public function load()
- {
- $sql='SELECT ex_id, ex_name,ex_code, ex_desc, ex_file, ex_enable '.
- ' FROM extension where ex_id=$1';
- $res=$this->cn->exec_sql($sql,array($this->ex_id));
- if ( Database::num_row($res) == 0 ) return -1;
- $row=Database::fetch_array($res,0);
- foreach ($row as $idx=>$value)
- {
- $this->$idx=$value;
- }
- return 0;
- }
- /*!\brief delete a plugin */
- public function delete()
- {
- $sql="delete from extension where ex_id=$1";
- $res=$this->cn->exec_sql($sql,array($this->ex_id));
- }
- /*!\brief load all the plugin and returns an array
- *\param $p_cn database connx
- */
- static public function listing($p_cn)
- {
- $sql="SELECT ex_id, ex_name,ex_code, ex_desc, ex_file, ex_enable FROM
extension order by ex_code";
- $array=$p_cn->get_array($sql);
- return $array;
- }
/*!\brief transform an array into a valid object
*\param $array with the value
*\verbatim
@@ -180,98 +66,46 @@
*/
function fromArray($p_array)
{
- $this->ex_id=$p_array['ex_id'];
- $this->ex_name=$p_array['name'];
- $this->ex_code=$p_array['code'];
- $this->ex_desc=$p_array['desc'];
- $this->ex_enable=$p_array['enable'];
- $this->ex_file=$p_array['file'];
-
+ $this->me_menu=$p_array['name'];
+ $this->me_code=$p_array['code'];
+ $this->me_desc=$p_array['desc'];
+ $this->me_file=$p_array['file'];
+ $this->me_type='PL';
}
/address@hidden search a extension, the what is the column (extends_code */
- function search($p_what,$p_value)
+ function search($p_what)
{
- switch($p_what)
- {
- case 'code':
- $cond=" where ex_code = upper($1) ";
- break;
- default:
- return -1;
- }
-
- $sql="select ex_id from extension $cond";
- $res=$this->cn->get_value($sql, array($p_value));
- if ( $res=="") return -1;
-
- $this->ex_id=$res;
- $this->load();
-
+ $this->me_code=$p_what;
+ if ( $this->load() == -1) return null;
+ return 1;
}
/*!\brief return 1 if the user given in parameter can access this extension
* otherwise returns 0
*\param $p_login the user login
- *\return 1 has access, 0 has no access
+ *\return 1 has access, 0 has no access
*/
function can_request($p_login)
{
- $sql="select use_access from user_sec_extension where ".
- "upper(use_login ) = upper($1) and ex_id=$2";
- $ret=$this->cn->get_value($sql,array($p_login,$this->ex_id));
- if ( $this->cn->count() == 0 ) return 0;
- if ( $ret=='Y') return 1;
- return 0;
+ $cnt=$this->cn->get_value("select count(*) from menu_ref
+
join profile_menu using (me_code)
+
join profile_user using (p_id)
+
where
+
me_code=$1
+
and user_name=$2",
+
array($this->me_code,$p_login));
+ if ( $cnt > 0) return 1;
+ return 0;
}
- /address@hidden save the security in the table
- address@hidden $p_array is an array of value
- * indices are :
- * - "is_" + login
- * - value is Y or N
- * you must add the value of gDossier
- \code
- [is_phpcompta]=>N
- [gDossier]=>xx
- \endcode
- */
- function save_security($p_array)
- {
- $d=$p_array['gDossier'];
- $cn=new Database($d);
- $list_user=User::get_list($d);
- for ($i=0;$i<sizeof($list_user);$i++)
- {
- $ix="is_".$list_user[$i]['use_login'];
- /* if exist */
- if ( isset($p_array[$ix] ))
- {
- if ( $cn->count_sql("select ex_id from user_sec_extension
where use_login=$1 and ex_id=$2"
-
,array($list_user[$i]['use_login'],$this->ex_id)) == 0 )
- {
- /* insert */
- $sql="INSERT INTO user_sec_extension(
- ex_id, use_login, use_access) VALUES ($1,$2,$3)";
-
$cn->exec_sql($sql,array($this->ex_id,$list_user[$i]['use_login'],$p_array[$ix]));
-
- }
- else
- {
- /* update */
- $sql="update user_sec_extension set use_access=$1 where
ex_id=$2 and use_login=$3";
-
$cn->exec_sql($sql,array($p_array[$ix],$this->ex_id,$list_user[$i]['use_login']));
- }
- }
-
- }
- }
/address@hidden make an array of the available plugin for the current user
* @return an array
address@hidden ISelect
*/
static function make_array($cn)
{
- $sql="select ex_code as value, ex_name as label from
user_sec_extension ".
- " join extension using (ex_id) where ex_enable='Y' and
use_access='Y' ".
- " and use_login=$1";
+ $sql="select me_code as value, me_menu as label from ".
+ " menu_ref join profile_menu using (me_code)
+ join profile_user using (p_id) where ".
+ " user_name=$1 and me_type='PL' and me_code_dep='EXTENSION'";
$a=$cn->get_array($sql,array($_SESSION['g_user']));
return $a;
}
@@ -285,31 +119,5 @@
exit();
}
}
- /*!\brief test this class
- */
- static function test_me()
- {
- $cn=new Database(dossier::id());
- print '<h1>Save</h1>';
- $ext=new Extension($cn);
- /* create a plugin */
- $ext->set_parameter('code','test');
- $ext->set_parameter('enable','Y');
- $ext->set_parameter('desc','plugin de test');
- $ext->set_parameter('filepath','test.php');
- $ext->save();
- print '<h1>Show</h1>';
- /* show plugins */
- $res=$cn->get_array('select * from extension');
- print_r($res);
- /* delete plugin */
- print '<h1>Load</h1>';
- $ext->load();
- print_r($ext);
- print '<h1>Delete</h1>';
- $ext->delete();
- }
-
}
-/* test::test_me(); */
Modified: phpcompta/trunk/include/extension_choice.inc.php
===================================================================
--- phpcompta/trunk/include/extension_choice.inc.php 2011-11-08 19:45:07 UTC
(rev 4320)
+++ phpcompta/trunk/include/extension_choice.inc.php 2011-11-08 23:04:55 UTC
(rev 4321)
@@ -47,6 +47,8 @@
echo '</form>';
echo '<hr>';
}
-require_once 'extension_get.inc.php';
+if ( isset($_REQUEST['plugin_code']))
+ require_once 'extension_get.inc.php';
+
?>
Modified: phpcompta/trunk/include/extension_get.inc.php
===================================================================
--- phpcompta/trunk/include/extension_get.inc.php 2011-11-08 19:45:07 UTC
(rev 4320)
+++ phpcompta/trunk/include/extension_get.inc.php 2011-11-08 23:04:55 UTC
(rev 4321)
@@ -10,33 +10,32 @@
require_once ('constant.security.php');
require_once ('class_user.php');
-/* if a code has been asked */
-if (isset($_REQUEST['plugin_code']) )
-{
- $cn=new Database(dossier::id());
- $ext=new Extension($cn);
- $ext->search('code',$_REQUEST['plugin_code']);
- if ( $ext->get_parameter('id') != 0 )
- {
- /* security */
- if ( $ext->can_request($_SESSION['g_user']) == 0 )
- {
- alert(j(_("Vous ne pouvez pas utiliser cette extension. Contactez
votre responsable")));
- exit();
- }
+/**
+ * included from do.php + extension_choice.inc.php
+ */
- if ( !
file_exists('../include/ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath'))))
- {
- alert(j(_("Ce fichier n'existe pas ")));
- exit();
- }
-
require_once('ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath')));
- }
- else
- {
- alert(j(_("Cette extension n'existe pas ")));
- exit();
- }
+// find file and check security
+global $cn,$g_user;
+$ext=new Extension($cn);
+;
+if ($ext->search($_REQUEST['plugin_code']) == -1)
+ {
+ echo_warning("plugin non trouvé");
+ exit();
}
+if ($ext->can_request($g_user->login)==-1)
+{
+ alert("Plugin non authorisé");
+ exit();
+}
+if ( ! file_exists('../include/ext'.DIRECTORY_SEPARATOR.trim($ext->me_file)))
+ {
+ alert(j(_("Ce fichier n'existe pas ")));
+ exit();
+ }
+echo '<div class="content">';
+require_once('ext'.DIRECTORY_SEPARATOR.trim($ext->me_file));
+
+
?>
Modified: phpcompta/trunk/include/template/module.php
===================================================================
--- phpcompta/trunk/include/template/module.php 2011-11-08 19:45:07 UTC (rev
4320)
+++ phpcompta/trunk/include/template/module.php 2011-11-08 23:04:55 UTC (rev
4321)
@@ -2,20 +2,33 @@
<div class="name">
<H2 class="dossier"> Dossier : <?=h(dossier::name())?></h2>
- <?=IButton::show_calc()?>
+<?php
+
+if ( $cn->get_value("select count(*) from profile join profile_user using
(p_id)
+ where user_name=$1 and
with_calc=true",array($_SESSION['g_user'])) ==1):
+ echo IButton::show_calc();
+endif;
+
+if ( $cn->get_value("select count(*) from profile join profile_user using
(p_id)
+ where user_name=$1 and
with_direct_form=true",array($_SESSION['g_user'])) ==1):
+?>
<div id="direct">
<form method="get">
+ <?=HtmlInput::default_value('ac', '', $_REQUEST)?>
<?=Dossier::hidden()?>
<?
$direct=new IText('ac');
$direct->style='class="direct"';
- $direct->value=HtmlInput::default_value('ac', '',
$_REQUEST);
+ $direct->value='';
$direct->size=(strlen($direct->value)<10)?10:strlen($direct->value);
echo $direct->input();
echo HtmlInput::submit('go','aller');
?>
</form>
</div>
+<?
+endif;
+?>
</div>
<div class="acces_direct">
<table>
Added: phpcompta/trunk/sql/extension.sql
===================================================================
--- phpcompta/trunk/sql/extension.sql (rev 0)
+++ phpcompta/trunk/sql/extension.sql 2011-11-08 23:04:55 UTC (rev 4321)
@@ -0,0 +1,4 @@
+insert into
menu_ref(me_code,me_menu,me_file,me_description,me_type,me_parameter) select
ex_code,ex_name,ex_file,ex_desC,'PL','plugin_code='||ex_code from extension;
+
+insert into profile_menu (me_code,me_code_dep,p_id,p_type_display) select
me_code,'EXTENSION',1,'S' from menu_ref where me_type='PL';
+
Modified: phpcompta/trunk/sql/object-6.0.sql
===================================================================
--- phpcompta/trunk/sql/object-6.0.sql 2011-11-08 19:45:07 UTC (rev 4320)
+++ phpcompta/trunk/sql/object-6.0.sql 2011-11-08 23:04:55 UTC (rev 4321)
@@ -78,7 +78,9 @@
CREATE TABLE profile (
p_name text NOT NULL,
p_id integer NOT NULL,
- p_desc text
+ p_desc text,
+ with_calc boolean DEFAULT true,
+ with_direct_form boolean DEFAULT true
);
@@ -106,6 +108,20 @@
--
+-- Name: COLUMN profile.with_calc; Type: COMMENT; Schema: public; Owner: dany
+--
+
+COMMENT ON COLUMN profile.with_calc IS 'show the calculator';
+
+
+--
+-- Name: COLUMN profile.with_direct_form; Type: COMMENT; Schema: public;
Owner: dany
+--
+
+COMMENT ON COLUMN profile.with_direct_form IS 'show the direct form';
+
+
+--
-- Name: profile_menu; Type: TABLE; Schema: public; Owner: dany; Tablespace:
--
@@ -155,7 +171,8 @@
--
COMMENT ON COLUMN profile_menu.p_type_display IS 'M is a module
-E is a menu';
+E is a menu
+S is a select (for plugin)';
--
@@ -183,7 +200,7 @@
-- Name: profile_menu_pm_id_seq; Type: SEQUENCE SET; Schema: public; Owner:
dany
--
-SELECT pg_catalog.setval('profile_menu_pm_id_seq', 156, true);
+SELECT pg_catalog.setval('profile_menu_pm_id_seq', 172, true);
--
@@ -281,7 +298,7 @@
--
CREATE VIEW v_all_menu AS
- SELECT pm.me_code, pm.pm_id, pm.me_code_dep, pm.p_order,
pm.p_type_display, pu.user_name, pu.pu_id, p.p_name, p.p_desc, mr.me_menu,
mr.me_file, mr.me_url, mr.me_parameter, mr.me_javascript FROM (((profile_menu
pm JOIN profile_user pu ON ((pu.p_id = pm.p_id))) JOIN profile p ON ((p.p_id =
pm.p_id))) JOIN menu_ref mr USING (me_code)) ORDER BY pm.p_order;
+ SELECT pm.me_code, pm.pm_id, pm.me_code_dep, pm.p_order,
pm.p_type_display, pu.user_name, pu.pu_id, p.p_name, p.p_desc, mr.me_menu,
mr.me_file, mr.me_url, mr.me_parameter, mr.me_javascript, mr.me_type FROM
(((profile_menu pm JOIN profile_user pu ON ((pu.p_id = pm.p_id))) JOIN profile
p ON ((p.p_id = pm.p_id))) JOIN menu_ref mr USING (me_code)) ORDER BY
pm.p_order;
ALTER TABLE public.v_all_menu OWNER TO dany;
@@ -311,6 +328,13 @@
-- Data for Name: menu_ref; Type: TABLE DATA; Schema: public; Owner: dany
--
+INSERT INTO menu_ref VALUES ('MODOP', 'Correction Opération',
'modop/index.php', NULL, 'Correction d''écritures comptables',
'plugin_code=MODOP', NULL, 'PL');
+INSERT INTO menu_ref VALUES ('IMPCARD', 'Import Fiche',
'import_card/index.php', NULL, 'Importation de fiches', 'plugin_code=IMPCARD',
NULL, 'PL');
+INSERT INTO menu_ref VALUES ('AMORTIS', 'Amortissement', 'amortis/index.php',
NULL, 'Amortissement', 'plugin_code=AMORTIS', NULL, 'PL');
+INSERT INTO menu_ref VALUES ('TOOLPLAN', 'Import/export plan',
'tool_pcmn/index.php', NULL, 'Importation /export de plan comptable',
'plugin_code=TOOLPLAN', NULL, 'PL');
+INSERT INTO menu_ref VALUES ('IMPORTBANK', 'Importation banque',
'importbank/index.php', NULL, 'Import. fichier CVS de la banque',
'plugin_code=IMPORTBANK', NULL, 'PL');
+INSERT INTO menu_ref VALUES ('TOOL', 'Outil comptable', 'tools/index.php',
NULL, 'Outil comptable', 'plugin_code=TOOL', NULL, 'PL');
+INSERT INTO menu_ref VALUES ('TVA', 'Module de TVA', 'tva/index.php', NULL,
'Cette extension permet de faire les listings et declarations TVA',
'plugin_code=TVA', NULL, 'PL');
INSERT INTO menu_ref VALUES ('ACH', 'Achat', 'compta_ach.inc.php', NULL, NULL,
NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CSV:AncBalGroup', 'Export Balance groupe
analytique', NULL, NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('OTH:Bilan', 'Export Bilan', NULL, NULL, NULL,
NULL, NULL, 'PR');
@@ -318,6 +342,9 @@
INSERT INTO menu_ref VALUES ('CSV:postedetail', 'Export Poste détail', NULL,
NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('PDF:postedetail', 'Export Poste détail', NULL,
NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('CSV:fichedetail', 'Export Fiche détail', NULL,
NULL, NULL, NULL, NULL, 'PR');
+INSERT INTO menu_ref VALUES ('CFGMENU', 'Config. Menu', 'menu.inc.php', NULL,
NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('MODULARITY', 'Menu et profile', NULL, NULL,
NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('CFGPROFILE', 'Profile', 'profile.inc.php', NULL,
NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('SEARCH', 'Recherche', NULL, NULL, NULL, NULL,
'popup_recherche()', 'ME');
INSERT INTO menu_ref VALUES ('COMPANY', 'Sociétés', 'company.inc.php', NULL,
'Parametre societe', NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('PERIODE', 'Période', 'periode.inc.php', NULL,
'Gestion des périodes', NULL, NULL, 'ME');
@@ -340,7 +367,6 @@
INSERT INTO menu_ref VALUES ('SUPPL', 'Fournisseur', 'supplier.inc.php', NULL,
NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('FOLLOW', 'Courrier', 'action.inc.php', NULL,
NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('FORECAST', 'Prévision', 'forecast.inc.php',
NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPJRN', 'Historique', 'impress_jrn.inc.php',
NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('LETTER', 'Lettrage', NULL, NULL, NULL, NULL,
NULL, 'ME');
INSERT INTO menu_ref VALUES ('CFGSECURITY', 'Sécurité', 'param_sec.inc.php',
NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('LETTERCARD', 'Let. Fiche',
'lettering.card.inc.php', NULL, NULL, NULL, NULL, 'ME');
@@ -358,7 +384,6 @@
INSERT INTO menu_ref VALUES ('PREFERENCE', 'Préférence', 'pref.inc.php', NULL,
NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('HIST', 'Historique',
'history_operation.inc.php', NULL, NULL, 'ledger_type=ALL', NULL, 'ME');
INSERT INTO menu_ref VALUES ('MENUFIN', 'Financier', NULL, NULL, NULL, NULL,
NULL, 'ME');
-INSERT INTO menu_ref VALUES ('TVA', 'Tva', 'extension_get.inc.php', NULL,
NULL, 'plugin_code=AMORTIS', NULL, 'ME');
INSERT INTO menu_ref VALUES ('EXTENSION', 'Extension',
'extension_choice.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('MENUACH', 'Achat', NULL, NULL, NULL, NULL, NULL,
'ME');
INSERT INTO menu_ref VALUES ('MENUODS', 'Opérations diverses', NULL, NULL,
NULL, NULL, NULL, 'ME');
@@ -371,13 +396,6 @@
INSERT INTO menu_ref VALUES ('ACCESS', 'Dossier', NULL, 'user_login.php',
NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('JSSEARCH', 'Recherche', NULL, NULL, NULL, NULL,
'search_reconcile()', 'ME');
INSERT INTO menu_ref VALUES ('CFGLEDGER', 'journaux', 'cfgledger.inc.php',
NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPREC', 'Rapprochement', 'impress_rec.inc.php',
NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPPOSTE', 'Poste', 'impress_poste.inc.php',
NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPREPORT', 'Rapport',
'impress_rapport.inc.php', NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPBILAN', 'Bilan', 'impress_bilan.inc.php',
NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPGL', 'Grand Livre',
'impress_gl_comptes.inc.php', NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPBAL', 'Balance', 'balance.inc.php', NULL,
NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMPCARD', 'Catégorie de Fiches',
'impress_fiche.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CUSTDET', 'Fiche', 'detail_client.inc.php',
NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CUSTFOLLOW', 'Suivi', 'suivi_client.inc.php',
NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CUSTOP', 'Opération',
'operation_client.inc.php', NULL, NULL, NULL, NULL, 'ME');
@@ -395,7 +413,6 @@
INSERT INTO menu_ref VALUES ('COMPTA', 'Comptabilité', NULL, NULL, NULL, NULL,
NULL, 'ME');
INSERT INTO menu_ref VALUES ('LOGOUT', 'Sortie', NULL, 'logout.php', NULL,
NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('DASHBOARD', 'Tableau de bord',
'dashboard.inc.php', NULL, NULL, NULL, NULL, 'ME');
-INSERT INTO menu_ref VALUES ('IMP', 'Impression', NULL, NULL, NULL, NULL,
NULL, 'ME');
INSERT INTO menu_ref VALUES ('PDF:fiche_balance', 'Export Fiche balance',
NULL, NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('CSV:report', 'Export report', NULL, NULL, NULL,
NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('PDF:report', 'Export report', NULL, NULL, NULL,
NULL, NULL, 'PR');
@@ -416,15 +433,24 @@
INSERT INTO menu_ref VALUES ('CSV:AncTable', 'Export Tableau Analytique',
NULL, NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('CSV:AncAccList', 'Export Historique Compt.
Analytique', NULL, NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('new_line', NULL, NULL, NULL, 'Saut de ligne',
NULL, NULL, 'SP');
+INSERT INTO menu_ref VALUES ('PRINTJRN', 'Historique', 'impress_jrn.inc.php',
NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTREC', 'Rapprochement',
'impress_rec.inc.php', NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTPOSTE', 'Poste', 'impress_poste.inc.php',
NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTREPORT', 'Rapport',
'impress_rapport.inc.php', NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTBILAN', 'Bilan', 'impress_bilan.inc.php',
NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTGL', 'Grand Livre',
'impress_gl_comptes.inc.php', NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTBAL', 'Balance', 'balance.inc.php', NULL,
NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINTCARD', 'Catégorie de Fiches',
'impress_fiche.inc.php', NULL, NULL, NULL, NULL, 'ME');
+INSERT INTO menu_ref VALUES ('PRINT', 'Impression', NULL, NULL, NULL, NULL,
NULL, 'ME');
--
-- Data for Name: profile; Type: TABLE DATA; Schema: public; Owner: dany
--
-INSERT INTO profile VALUES ('default', 1, 'Profil par défaut');
-INSERT INTO profile VALUES ('Analytique', 2, 'Uniquement comptabilité
analytique');
-INSERT INTO profile VALUES ('Vente', 3, 'Uniquement vente');
+INSERT INTO profile VALUES ('Analytique', 2, 'Uniquement comptabilité
analytique', true, true);
+INSERT INTO profile VALUES ('Vente', 3, 'Uniquement vente', true, true);
+INSERT INTO profile VALUES ('default', 1, 'Profil par défaut', true, true);
--
@@ -440,11 +466,6 @@
INSERT INTO profile_menu VALUES (60, 'CFGTVA', 'DIVPARM', 1, 5, 'E', NULL);
INSERT INTO profile_menu VALUES (61, 'CFGACCOUNT', 'DIVPARM', 1, 6, 'E', NULL);
INSERT INTO profile_menu VALUES (67, 'CFGCATDOC', 'DIVPARM', 1, 8, 'E', NULL);
-INSERT INTO profile_menu VALUES (13, 'IMPBILAN', 'IMP', 1, 11, 'E', NULL);
-INSERT INTO profile_menu VALUES (14, 'IMPCARD', 'IMP', 1, 12, 'E', NULL);
-INSERT INTO profile_menu VALUES (15, 'IMPGL', 'IMP', 1, 13, 'E', NULL);
-INSERT INTO profile_menu VALUES (16, 'IMPJRN', 'IMP', 1, 14, 'E', NULL);
-INSERT INTO profile_menu VALUES (17, 'IMPBAL', 'IMP', 1, 15, 'E', NULL);
INSERT INTO profile_menu VALUES (68, 'CFGATTRIBCARD', 'DIVPARM', 1, 9, 'E',
NULL);
INSERT INTO profile_menu VALUES (69, 'CFGPCMN', 'PARAM', 1, 4, 'E', NULL);
INSERT INTO profile_menu VALUES (70, 'CFGEXTENSION', 'PARAM', 1, 5, 'E', NULL);
@@ -454,9 +475,6 @@
INSERT INTO profile_menu VALUES (74, 'CFGLEDGER', 'PARAM', 1, 9, 'E', NULL);
INSERT INTO profile_menu VALUES (75, 'PLANANC', 'ANC', 1, 1, 'E', NULL);
INSERT INTO profile_menu VALUES (65, 'CFGCARDCAT', 'DIVPARM', 1, 7, 'E', NULL);
-INSERT INTO profile_menu VALUES (9, 'IMPPOSTE', 'IMP', 1, 8, 'E', NULL);
-INSERT INTO profile_menu VALUES (10, 'IMPREC', 'IMP', 1, 9, 'E', NULL);
-INSERT INTO profile_menu VALUES (11, 'IMPREPORT', 'IMP', 1, 10, 'E', NULL);
INSERT INTO profile_menu VALUES (76, 'ANCODS', 'ANC', 1, 2, 'E', NULL);
INSERT INTO profile_menu VALUES (77, 'ANCGROUP', 'ANC', 1, 3, 'E', NULL);
INSERT INTO profile_menu VALUES (78, 'ANCIMP', 'ANC', 1, 4, 'E', NULL);
@@ -466,7 +484,6 @@
INSERT INTO profile_menu VALUES (37, 'CUST', 'GESTION', 1, 1, 'E', NULL);
INSERT INTO profile_menu VALUES (38, 'SUPPL', 'GESTION', 1, 2, 'E', NULL);
INSERT INTO profile_menu VALUES (39, 'ADM', 'GESTION', 1, 3, 'E', NULL);
-INSERT INTO profile_menu VALUES (35, 'IMP', 'GESTION', 1, 4, 'E', NULL);
INSERT INTO profile_menu VALUES (36, 'CARD', 'GESTION', 1, 6, 'E', NULL);
INSERT INTO profile_menu VALUES (40, 'STOCK', 'GESTION', 1, 5, 'E', NULL);
INSERT INTO profile_menu VALUES (41, 'FORECAST', 'GESTION', 1, 7, 'E', NULL);
@@ -481,20 +498,21 @@
INSERT INTO profile_menu VALUES (94, 'FINSALDO', 'MENUFIN', 1, 3, 'E', NULL);
INSERT INTO profile_menu VALUES (95, 'FINREC', 'MENUFIN', 1, 4, 'E', NULL);
INSERT INTO profile_menu VALUES (79, 'PREFERENCE', NULL, 1, 15, 'M', NULL);
-INSERT INTO profile_menu VALUES (6, 'IMP', 'COMPTA', 1, 6, 'E', NULL);
INSERT INTO profile_menu VALUES (28, 'ADV', 'COMPTA', 1, 20, 'E', NULL);
INSERT INTO profile_menu VALUES (45, 'PARAM', NULL, 1, 20, 'M', NULL);
INSERT INTO profile_menu VALUES (53, 'ACCESS', NULL, 1, 25, 'M', NULL);
INSERT INTO profile_menu VALUES (123, 'CSV:histo', NULL, 1, NULL, 'P', NULL);
INSERT INTO profile_menu VALUES (20, 'LOGOUT', NULL, 1, 30, 'M', NULL);
INSERT INTO profile_menu VALUES (44, 'DASHBOARD', NULL, 1, 10, 'M', 1);
+INSERT INTO profile_menu VALUES (35, 'PRINT', 'GESTION', 1, 4, 'E', NULL);
INSERT INTO profile_menu VALUES (156, 'new_line', NULL, 1, 35, 'M', NULL);
INSERT INTO profile_menu VALUES (124, 'CSV:ledger', NULL, 1, NULL, 'P', NULL);
INSERT INTO profile_menu VALUES (80, 'PLANANC', 'ANC', 2, 1, 'E', NULL);
INSERT INTO profile_menu VALUES (125, 'PDF:ledger', NULL, 1, NULL, 'P', NULL);
+INSERT INTO profile_menu VALUES (6, 'PRINT', 'COMPTA', 1, 6, 'E', NULL);
INSERT INTO profile_menu VALUES (126, 'CSV:postedetail', NULL, 1, NULL, 'P',
NULL);
-INSERT INTO profile_menu VALUES (84, 'TVA', 'PARAM', 1, 102, 'E', NULL);
INSERT INTO profile_menu VALUES (1, 'COMPTA', NULL, 1, 40, 'M', 0);
+INSERT INTO profile_menu VALUES (164, 'TVA', 'EXTENSION', 1, NULL, 'S', NULL);
INSERT INTO profile_menu VALUES (3, 'MENUACH', 'COMPTA', 1, 3, 'E', NULL);
INSERT INTO profile_menu VALUES (86, 'ACHIMP', 'MENUACH', 1, 2, 'E', NULL);
INSERT INTO profile_menu VALUES (34, 'GESTION', NULL, 1, 45, 'M', NULL);
@@ -502,6 +520,8 @@
INSERT INTO profile_menu VALUES (88, 'ODS', 'MENUODS', 1, 1, 'E', NULL);
INSERT INTO profile_menu VALUES (89, 'ODSIMP', 'MENUODS', 1, 2, 'E', NULL);
INSERT INTO profile_menu VALUES (2, 'ANC', NULL, 1, 50, 'M', 0);
+INSERT INTO profile_menu VALUES (157, 'AMORTIS', 'MENUACH', 1, 10, 'M', NULL);
+INSERT INTO profile_menu VALUES (158, 'MODOP', 'EXTENSION', 1, NULL, 'S',
NULL);
INSERT INTO profile_menu VALUES (4, 'VENMENU', 'COMPTA', 1, 2, 'E', NULL);
INSERT INTO profile_menu VALUES (90, 'VEN', 'VENMENU', 1, 1, 'E', NULL);
INSERT INTO profile_menu VALUES (91, 'VENIMP', 'VENMENU', 1, 2, 'E', NULL);
@@ -509,8 +529,24 @@
INSERT INTO profile_menu VALUES (19, 'FIN', 'MENUFIN', 1, 1, 'E', NULL);
INSERT INTO profile_menu VALUES (92, 'MENUFIN', 'COMPTA', 1, 4, 'E', NULL);
INSERT INTO profile_menu VALUES (93, 'FINIMP', 'MENUFIN', 1, 2, 'E', NULL);
+INSERT INTO profile_menu VALUES (159, 'IMPCARD', 'EXTENSION', 1, NULL, 'S',
NULL);
+INSERT INTO profile_menu VALUES (160, 'AMORTIS', 'EXTENSION', 1, NULL, 'S',
NULL);
+INSERT INTO profile_menu VALUES (161, 'TOOLPLAN', 'EXTENSION', 1, NULL, 'S',
NULL);
INSERT INTO profile_menu VALUES (151, 'SEARCH', NULL, 1, 60, 'M', NULL);
INSERT INTO profile_menu VALUES (85, 'ACH', 'MENUACH', 1, 1, 'E', NULL);
+INSERT INTO profile_menu VALUES (16, 'PRINTJRN', 'IMP', 1, 14, 'E', NULL);
+INSERT INTO profile_menu VALUES (10, 'PRINTREC', 'IMP', 1, 9, 'E', NULL);
+INSERT INTO profile_menu VALUES (9, 'PRINTPOSTE', 'IMP', 1, 8, 'E', NULL);
+INSERT INTO profile_menu VALUES (11, 'PRINTREPORT', 'IMP', 1, 10, 'E', NULL);
+INSERT INTO profile_menu VALUES (13, 'PRINTBILAN', 'IMP', 1, 11, 'E', NULL);
+INSERT INTO profile_menu VALUES (15, 'PRINTGL', 'IMP', 1, 13, 'E', NULL);
+INSERT INTO profile_menu VALUES (17, 'PRINTBAL', 'IMP', 1, 15, 'E', NULL);
+INSERT INTO profile_menu VALUES (14, 'PRINTCARD', 'IMP', 1, 12, 'E', NULL);
+INSERT INTO profile_menu VALUES (162, 'IMPORTBANK', 'EXTENSION', 1, NULL, 'S',
NULL);
+INSERT INTO profile_menu VALUES (163, 'TOOL', 'EXTENSION', 1, NULL, 'S', NULL);
+INSERT INTO profile_menu VALUES (171, 'CFGMENU', 'MODULARITY', 1, NULL, 'M',
NULL);
+INSERT INTO profile_menu VALUES (167, 'MODULARITY', 'PARAM', 1, 1, 'M', NULL);
+INSERT INTO profile_menu VALUES (172, 'CFGPROFILE', 'MODULARITY', 1, NULL,
'M', NULL);
INSERT INTO profile_menu VALUES (127, 'PDF:postedetail', NULL, 1, NULL, 'P',
NULL);
INSERT INTO profile_menu VALUES (50, 'ANC', NULL, 2, 1, 'M', 0);
INSERT INTO profile_menu VALUES (128, 'CSV:fichedetail', NULL, 1, NULL, 'P',
NULL);
Modified: phpcompta/trunk/sql/upgrade.sql
===================================================================
--- phpcompta/trunk/sql/upgrade.sql 2011-11-08 19:45:07 UTC (rev 4320)
+++ phpcompta/trunk/sql/upgrade.sql 2011-11-08 23:04:55 UTC (rev 4321)
@@ -15,6 +15,8 @@
trigger.tmp_pcmn.sql
account_add.sql
object-6.0.sql
-epad-style.css
+epad-style.sql
+extension.sql
+
*/
create unique index qcode_idx on fiche_detail (ad_value) where ad_id=23;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4321 - in phpcompta/trunk: html include include/template sql,
phpcompta-dev <=