|
noalyss
Version-6.7.2
|
manage the current dossier, everywhere we need to know to which folder we are connected, because we can't use $_SESSION, we need to pass the dossier_id via a _GET or a POST variable private static $variable=array("id"=>"dos_id", "name"=>"dos_name", "desc"=>"dos_description"); More...
Public Member Functions | |
| __construct ($p_id) | |
| get_info () | |
| get_parameter ($p_string) | |
| get_user_folder ($sql="") | |
| Return all the users as an array. | |
| load () | |
| save () | |
| set_parameter ($p_string, $p_value) | |
| show_dossier ($p_type, $p_first=0, $p_max=0, $p_Num=0) | |
| update () | |
Static Public Member Functions | |
| static | check () |
| check if gDossier is set | |
| static | connect () |
| static | get () |
| return a string to put to gDossier into a GET | |
| static | get_version ($p_cn) |
| static | hidden () |
| return a string to set gDossier into a FORM | |
| static | id () |
| return the $_REQUEST['gDossier'] after a check | |
| static | name ($id=0) |
| retrieve the name of the current dossier | |
| static | synchro_admin ($p_id) |
| connect to folder and give to admin. | |
Static Private Attributes | |
| static | $variable |
manage the current dossier, everywhere we need to know to which folder we are connected, because we can't use $_SESSION, we need to pass the dossier_id via a _GET or a POST variable private static $variable=array("id"=>"dos_id", "name"=>"dos_name", "desc"=>"dos_description");
Definition at line 39 of file class_dossier.php.
| Dossier::__construct | ( | $ | p_id | ) |
Definition at line 44 of file class_dossier.php.
References cn.
| static Dossier::check | ( | ) | [static] |
check if gDossier is set
Definition at line 137 of file class_dossier.php.
References $_REQUEST, $id, echo_error(), and exit.
| static Dossier::connect | ( | ) | [static] |
| static Dossier::get | ( | ) | [static] |
return a string to put to gDossier into a GET
Definition at line 152 of file class_dossier.php.
References check().
{
self::check();
return "gDossier=".$_REQUEST['gDossier'];
}
Definition at line 198 of file class_dossier.php.
{
return var_export(self::$variable,true);
}
| Dossier::get_parameter | ( | $ | p_string | ) |
| Dossier::get_user_folder | ( | $ | sql = "" | ) |
Return all the users as an array.
Definition at line 106 of file class_dossier.php.
References $res, $sql, and cn.
{
$sql="
select
use_id,
use_first_name,
use_name,
use_login,
use_active,
use_admin,
ag_dossier
from
ac_users as ac
left join (select array_to_string(array_agg(dos_name),',') as ag_dossier,jt.use_id as jt_use_id
from ac_dossier as ds
join jnt_use_dos as jt on (jt.dos_id=ds.dos_id)
join priv_user as pu on (pu.priv_jnt=jt.jnt_id)
where
pu.priv_priv != 'X'
group by jt.use_id) as dossier_name on (jt_use_id=ac.use_id)
where
use_login!='phpcompta'
$sql
";
$res=$this->cn->get_array($sql);
return $res;
}
| static Dossier::get_version | ( | $ | p_cn | ) | [static] |
Definition at line 245 of file class_dossier.php.
{
return $p_cn->get_value('select val from version');
}
| static Dossier::hidden | ( | ) | [static] |
return a string to set gDossier into a FORM
Definition at line 160 of file class_dossier.php.
References check().
Referenced by Acc_Parm_Code\form().
{
self::check();
return '<input type="hidden" id="gDossier" name="gDossier" value="'.$_REQUEST['gDossier'].'">';
}
| static Dossier::id | ( | ) | [static] |
return the $_REQUEST['gDossier'] after a check
Definition at line 50 of file class_dossier.php.
References $_REQUEST, and check().
Referenced by Tag\add_clear_button(), Tag\button_search(), connect(), Pre_Op_Advanced\display(), ITva_Popup\display(), Acc_Ledger\input(), Html_Table\test_me(), and Acc_Ledger_Info\test_me().
{
self::check();
return $_REQUEST['gDossier'];
}
| Dossier::load | ( | ) |
Definition at line 226 of file class_dossier.php.
References $idx, $res, $row, $sql, $value, cn, Database\fetch_array(), and Database\num_row().
| static Dossier::name | ( | $ | id = 0 | ) | [static] |
retrieve the name of the current dossier
Definition at line 166 of file class_dossier.php.
| Dossier::save | ( | ) |
| Dossier::set_parameter | ( | $ | p_string, |
| $ | p_value | ||
| ) |
| Dossier::show_dossier | ( | $ | p_type, |
| $ | p_first = 0, |
||
| $ | p_max = 0, |
||
| $ | p_Num = 0 |
||
| ) |
| p_type | string : all for all dossiers lim for only the dossier where we've got rights |
Show the folder where user have access. Return : nothing ++
Definition at line 62 of file class_dossier.php.
References $Max, $row, and cn.
{
$l_user=$_SESSION['g_user'];
if ( $p_max == 0 )
{
$l_step="";
}
else
{
$l_step="LIMIT $p_max OFFSET $p_first";
}
if ( $p_type == "all")
{
$l_sql="select *, 'W' as priv_priv from ac_dossier ORDER BY dos_name ";
$p_Num=$this->cn->count_sql($l_sql);
}
else
{
$l_sql="select * from jnt_use_dos
natural join ac_dossier
natural join ac_users
inner join priv_user on priv_jnt=jnt_id where
use_login='".$l_user."' and priv_priv !='NO'
order by dos_name ";
$p_Num=$this->cn->count_sql($l_sql);
}
$l_sql=$l_sql.$l_step;
$p_res=$this->cn->exec_sql($l_sql);
$Max=$this->cn->size();
if ( $Max == 0 ) return null;
for ( $i=0;$i<$Max; $i++)
{
$row[]=$this->cn->fetch($i);
}
return $row;
}
| static Dossier::synchro_admin | ( | $ | p_id | ) | [static] |
connect to folder and give to admin.
the profile Admin(builtin)
| int | $p_id | dossier::id() |
synchro global
Definition at line 260 of file class_dossier.php.
References $cn, $e, $repo, and echo_warning().
{
// connect to target
$cn=new Database($p_id);
if (! $cn->exist_table("profile_menu"))
{
echo_warning("Dossier invalide");
return;
}
// connect to repo
$repo=new Database();
$a_admin=$repo->get_array("select use_login from ac_users where
use_admin=1 and use_active=1");
try
{
/**
* synchro global
*/
$cn->start();
for ($i=0;$i<count($a_admin);$i++)
{
$exist=$cn->get_value("select p_id from profile_user
where user_name=$1",array($a_admin[$i]['use_login']));
if ( $exist == "")
{
$cn->exec_sql("insert into profile_user(user_name,p_id) values($1,1)",
array($a_admin[$i]['use_login']));
}
}
$cn->commit();
} catch(Exception $e)
{
echo_warning($e->getMessage());
$cn->rollback();
}
}
| Dossier::update | ( | ) |
Definition at line 208 of file class_dossier.php.
References $res, $sql, cn, and trim().
Referenced by save().
{
if ( strlen(trim($this->dos_name))== 0 ) return;
if ( $this->cn->get_value("select count(*) from ac_dossier where dos_name=$1 and dos_id<>$2",
array($this->dos_name,$this->dos_id)) !=0 )
return ;
$sql="update ac_dossier set dos_name=$1,dos_description=$2 ".
" where dos_id = $3";
$res=$this->cn->exec_sql(
$sql,
array(trim($this->dos_name),
trim($this->dos_description),
$this->dos_id)
);
}
Dossier::$variable [static, private] |
array("id"=>"dos_id", "name"=>"dos_name", "desc"=>"dos_description")
Definition at line 41 of file class_dossier.php.