Merge branch 'dev7202'
This commit is contained in:
commit
cc4abbc6f3
21 changed files with 278 additions and 78 deletions
|
|
@ -161,6 +161,8 @@ content[205]="<?php echo _("Port pour postgresql")?>";
|
|||
content[206]="<?php echo _("En version mono dossier, le nom de la base de données doit être mentionné")?>";
|
||||
content[207]="<?php echo _("Vous devez choisir si NOALYSS est installé sur l'un de vos servers ou sur un server mutualisé qui ne donne qu'une seule base de données")?>";
|
||||
content[208]="<?php echo _("Serveur postgresql")?>";
|
||||
content[209]="<?php echo _("Mot de passe administrateur, il peut être changé ensuite dans les préférences")?>";
|
||||
content[210]="<?php echo _("login administrateur")?>";
|
||||
|
||||
</script>
|
||||
|
||||
|
|
@ -181,7 +183,7 @@ if ( strpos($inc_path,";") != 0 ) {
|
|||
$new_path=$inc_path.':../../include:addon';
|
||||
$os=1; /* $os is 1 for unix */
|
||||
}
|
||||
// Retrieve informations from the very screen
|
||||
// Retrieve informations from the screen
|
||||
//
|
||||
$http=new HttpInput();
|
||||
$db_user=$http->request("cuser","string", "");
|
||||
|
|
@ -194,6 +196,7 @@ $ctmp=$http->request("ctmp","string", "/tmp");
|
|||
$cpath=$http->request("cpath","string", "/usr/bin");
|
||||
$db_name=$http->request("cdbname", "string","");
|
||||
$cadmin=$http->request("cadmin","string", "admin");
|
||||
$cpassword_admin=$http->request("cpassword_admin","string", "phpcompta");
|
||||
$cadmin=strtolower($cadmin);
|
||||
//-------------------------------------------------------------------------
|
||||
// warn only if we can not write in include
|
||||
|
|
@ -213,6 +216,36 @@ if ( is_writable ('install.php') == false ) {
|
|||
|
||||
if (isset($_POST['save_config'])) {
|
||||
require_once NOALYSS_INCLUDE.'/lib/config_file.php';
|
||||
$err=0;
|
||||
// check password and admin not empty
|
||||
//
|
||||
if ( strlen(trim($cpassword_admin))== 0 ||
|
||||
strlen(trim($cadmin))== 0
|
||||
) {
|
||||
echo '<h2 class="warning">';
|
||||
echo _('Le mot de passe du super admin et le login ne peuvent être vides');
|
||||
echo '</h2>';
|
||||
$err++;
|
||||
|
||||
}
|
||||
|
||||
// check password and admin not containing quote or double quote
|
||||
//
|
||||
if ( strpos($cpassword_admin,'"') !== false
|
||||
|| strpos($cadmin,'"') !== false
|
||||
|| strpos($cpassword_admin,"'") !== false
|
||||
|| strpos($cadmin,"'") !== false
|
||||
|| strpos($cpassword_admin," ") !== false
|
||||
|| strpos($cadmin," ") !== false
|
||||
|| strpos($cadmin,"@mobile") !== false
|
||||
) {
|
||||
echo '<h2 class="warning">';
|
||||
echo _('Le mot de passe du super admin et le superadmin ne peut pas contenir des guillemets ou espaces, ni @mobile');
|
||||
echo '</h2>';
|
||||
$err++;
|
||||
|
||||
}
|
||||
|
||||
// Try to connect , if it doesn't work that do not create the config file
|
||||
if ($multi=="N") {
|
||||
$cnx = new DatabaseCore($db_user, $db_password,'template1', $db_host, $db_port);
|
||||
|
|
@ -222,13 +255,14 @@ if (isset($_POST['save_config'])) {
|
|||
// -----
|
||||
// If conx successfull save the file or display it
|
||||
// -----
|
||||
if ( $cnx !== false ) {
|
||||
if ( $err == 0 && $cnx !== false ) {
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<h2 class="warning">',_("Voici l'utilisateur et mot de passe de l'utilisateur administrateur de Noalyss , il a tous les droits et a accès à tout."
|
||||
echo '<h2 class="warning">',_("Voici l'utilisateur et mot de passe de l'utilisateur administrateur de Noalyss , "
|
||||
. " il a tous les droits et a accès à tout."
|
||||
. " Connectez-vous avec ses identifiants et changer le mot de passe dans préférence (en haut à droit)"),
|
||||
"</h2>";
|
||||
echo '<p style="font-size:120%">'._('Utilisateur administrateur'),' ','<span style="color:red"> ',$cadmin,'</span>','</p>';
|
||||
echo '<p style="font-size:120%">',_('Mot de passe'),'<span style="color:red"> phpcompta </span>','</p>';
|
||||
echo '<p style="font-size:120%">',_('Mot de passe'),'<span style="color:red"> '.$cpassword_admin.' </span>','</p>';
|
||||
// Create the db
|
||||
if (is_writable(NOALYSS_INCLUDE)) {
|
||||
$url=config_file_create($_POST,1,$os);
|
||||
|
|
@ -256,7 +290,7 @@ if (isset($_POST['save_config'])) {
|
|||
echo '</textarea>';
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
} elseif ($err == 0 && $cnx == false) {
|
||||
echo '<h2 class="warning">';
|
||||
echo _('Impossible de se connecter à Postgresql, vérifiez les informations de connection');
|
||||
echo '</h2>';
|
||||
|
|
@ -270,6 +304,7 @@ if (isset($_POST['save_config'])) {
|
|||
//
|
||||
//------------------------------------------------------------------------
|
||||
if ( ! file_exists(NOALYSS_INCLUDE.'/config.inc.php')) {
|
||||
|
||||
echo '<h1 class="info">'._('Entrez les informations nécessaires à noalyss').'</h1>';
|
||||
echo '<form method="post">';
|
||||
require_once NOALYSS_INCLUDE.'/lib/config_file.php';
|
||||
|
|
@ -294,6 +329,7 @@ if ( ! file_exists(NOALYSS_INCLUDE.'/config.inc.php')) {
|
|||
// magic_quotes_runtime = Off
|
||||
// magic_quotes_sybase = Off
|
||||
// include_path
|
||||
require_once NOALYSS_INCLUDE.'/config.inc.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/config_file.php';
|
||||
require_once NOALYSS_INCLUDE.'/class/database.class.php';
|
||||
|
||||
|
|
@ -365,7 +401,7 @@ for ($m=0;$m<$nb_need_module;$m++)
|
|||
if ( ini_get("max_execution_time") < 60 ) {
|
||||
echo "<li>";
|
||||
echo _('Avertissement').' : '.$failed;
|
||||
echo '<span class="info"> ',
|
||||
echo '<span class="info"> ',
|
||||
_("max_execution_time devrait être de 60 minimum"),
|
||||
'</span>';
|
||||
echo "</li>";
|
||||
|
|
@ -522,8 +558,9 @@ if ($account == 0 ) {
|
|||
$cn->execute_script(NOALYSS_INCLUDE."/sql/account_repository/constraint.sql");
|
||||
/* update name administrator */
|
||||
$cadmin=NOALYSS_ADMINISTRATOR;
|
||||
$cn->exec_sql("update ac_users set use_login=$1,use_active=1 where use_id=1",
|
||||
array(strtolower($cadmin)));
|
||||
$cpassword_admin=NOALYSS_ADMIN_PASSWORD;
|
||||
$cn->exec_sql("update ac_users set use_login=$1,use_pass=md5($2),use_active=1 where use_id=1",
|
||||
array(strtolower($cadmin),$cpassword_admin));
|
||||
|
||||
$cn->commit($cn);
|
||||
|
||||
|
|
@ -617,11 +654,11 @@ if (defined("MULTI") && MULTI == 0)
|
|||
}
|
||||
}
|
||||
|
||||
$db->exec_sql("update ac_users set use_login=$1 where use_id=1",
|
||||
array(strtolower(NOALYSS_ADMINISTRATOR)));
|
||||
$db->exec_sql("update ac_users set use_login=$1,use_pass=2 where use_id=1",
|
||||
array(strtolower(NOALYSS_ADMINISTRATOR),NOALYSS_ADMIN_PASSWORD));
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
echo '<p>'._('Utilisateur administrateur'),' ',NOALYSS_ADMINISTRATOR,'</p>';
|
||||
echo '<p>',_('Mot de passe par défaut à l\'installation'),' phpcompta','</p>';
|
||||
|
||||
echo "<h2 class=\"warning\">";
|
||||
printf (" VOUS DEVEZ EFFACER CE FICHIER %s",__FILE__);
|
||||
echo "</h2>";
|
||||
|
|
@ -640,9 +677,12 @@ define ('ALLOWED',1);
|
|||
define ('ALLOWED_ADMIN',1);
|
||||
|
||||
$rep=new Database();
|
||||
if (defined(NOALYSS_ADMINISTRATOR))
|
||||
if (defined("NOALYSS_ADMINISTRATOR") && defined ("NOALYSS_ADMIN_PASSWORD"))
|
||||
{
|
||||
$rep->exec_sql("update ac_users set use_login=$1 where use_id=1", array(strtolower(NOALYSS_ADMINISTRATOR)));
|
||||
$rep->exec_sql("update ac_users set use_login=$1 ,use_pass=md5($2)
|
||||
where use_id=1",
|
||||
array(strtolower(NOALYSS_ADMINISTRATOR),
|
||||
NOALYSS_ADMIN_PASSWORD));
|
||||
}
|
||||
Dossier::upgrade();
|
||||
echo '<h1>'._('Important').'</h1>';
|
||||
|
|
|
|||
|
|
@ -2193,6 +2193,9 @@ function filter_list(phrase, _id) {
|
|||
|
||||
for (var r = 0; r < l_list.childNodes.length; r++) {
|
||||
var found = 0;
|
||||
if (l_list.childNodes[r].nodeType != 1 ){
|
||||
continue;
|
||||
}
|
||||
if (l_list.childNodes[r].childElementCount == 0)
|
||||
{
|
||||
ele = l_list.childNodes[r].innerHTML;
|
||||
|
|
|
|||
|
|
@ -258,9 +258,10 @@ class Acc_Bilan
|
|||
*/
|
||||
function get_request_get()
|
||||
{
|
||||
$this->b_id=(isset($_GET['b_id']))?$_GET['b_id']:"";
|
||||
$this->from=( isset ($_GET['from_periode']))?$_GET['from_periode']:-1;
|
||||
$this->to=( isset ($_GET['to_periode']))?$_GET['to_periode']:-1;
|
||||
$http=new \HttpInput();
|
||||
$this->b_id=$http->get("b_id","number","");
|
||||
$this->from=$http->get("from_periode","number",-1);
|
||||
$this->to=$http->get("to_periode","number",-1);
|
||||
}
|
||||
/*!\brief load from the database the document data */
|
||||
function load()
|
||||
|
|
@ -501,7 +502,10 @@ class Acc_Bilan
|
|||
}
|
||||
|
||||
$header_txt=header_txt($this->db);
|
||||
|
||||
|
||||
if ($this->b_type == "rtf") {
|
||||
$header_txt=convert_to_rtf($header_txt);
|
||||
}
|
||||
while ( !feof($p_file) )
|
||||
{
|
||||
$line_rtf=fgets($p_file);
|
||||
|
|
@ -537,7 +541,8 @@ class Acc_Bilan
|
|||
if($ret[0]['acct_name'])
|
||||
{
|
||||
/* for rtf we have the string to put it in latin1 */
|
||||
$a = utf8_decode($ret[0]['acct_name']);
|
||||
if ( $this->b_type != "rtf") { $a = utf8_decode($ret[0]['acct_name']);}
|
||||
if ( $this->b_type == "rtf") { $a =convert_to_rtf($ret[0]['acct_name']);}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,8 +113,11 @@ class Database extends DatabaseCore
|
|||
}
|
||||
|
||||
/**
|
||||
* \brief loop to apply all the path to a folder or
|
||||
* a template
|
||||
* \brief loop to apply all the path to a folder or a template
|
||||
* Upgrade check if the folder $p_name needs to be upgrade thanks the variable DBVERSION
|
||||
* and run all the SQL script named upgradeX.sql from the folder noalyss/include/sql/patch
|
||||
* until X equal DBVERSION-1
|
||||
*
|
||||
* \param $p_name database name
|
||||
*
|
||||
*/
|
||||
|
|
@ -142,8 +145,7 @@ class Database extends DatabaseCore
|
|||
echo "<li>Patching " . $p_name .
|
||||
" from the version " . $this->get_version() . " to $to ";
|
||||
|
||||
$this->execute_script(NOALYSS_INCLUDE . '/sql/patch/upgrade' . $i . '.sql');
|
||||
echo $succeed;
|
||||
|
||||
|
||||
if (!DEBUG)
|
||||
ob_start();
|
||||
|
|
@ -214,9 +216,17 @@ class Database extends DatabaseCore
|
|||
$country = $this->get_value("select pr_value from parameter where pr_id='MY_COUNTRY'");
|
||||
$this->execute_script(NOALYSS_INCLUDE . "/sql/patch/upgrade61." . $country . ".sql");
|
||||
}
|
||||
/**
|
||||
* Bug in parm_code for FRANCE
|
||||
*/
|
||||
if ($i == 141 ) {
|
||||
$country = $this->get_value("select pr_value from parameter where pr_id='MY_COUNTRY'");
|
||||
$this->execute_script(NOALYSS_INCLUDE . "/sql/patch/upgrade141." . $country . ".sql");
|
||||
}
|
||||
|
||||
if (!DEBUG)
|
||||
ob_end_clean();
|
||||
|
||||
}
|
||||
}
|
||||
echo '</ul>';
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class Document_type
|
|||
{
|
||||
$sql = "select * from document_type where dt_id=$1";
|
||||
$R = $this->db->exec_sql($sql, array($this->dt_id));
|
||||
if (count($R) == 0) return 1;
|
||||
if ($this->db->count($R) == 0) return 1;
|
||||
$r = Database::fetch_array($R, 0);
|
||||
$this->dt_id = $r['dt_id'];
|
||||
$this->dt_value = $r['dt_value'];
|
||||
|
|
|
|||
|
|
@ -330,7 +330,13 @@ class Dossier
|
|||
$cn->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade check if the folder ACCOUNT_REPOSITORY needs to be upgrade thanks the variable DBVERSIONREPO
|
||||
* and run all the SQL script named ac-upgradeX.sql from the folder noalyss/include/sql/patch
|
||||
* until X equal DBVERSIONREPO-1
|
||||
* After it will call the function apply_patch, remove_inexistant_user and clean_orphan_log for each folder
|
||||
*
|
||||
*/
|
||||
static function upgrade()
|
||||
{
|
||||
$rep=new Database();
|
||||
|
|
@ -405,5 +411,16 @@ class Dossier
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current dossier to $p_dossier
|
||||
* @param numeric $p_dossier
|
||||
*/
|
||||
static function set_current($p_dossier) {
|
||||
|
||||
put_global(["gDossier"=>$p_dossier]);
|
||||
self::check();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ class Periode
|
|||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
record_log($e->getMessage()." - ".$e->getCode());
|
||||
record_log($e->getTraceAsString());
|
||||
$this->cn->rollback();
|
||||
throw $e;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ $g_succeed="<span style=\"font-size:18px;color:green\">✓</span>";
|
|||
define ('SMALLX','ⵝ');
|
||||
define ('BUTTONADD',"✚");
|
||||
|
||||
|
||||
define ('SVNINFO',NOALYSS_VERSION);
|
||||
if ( ! defined ('DEBUG')) {
|
||||
define ("DEBUG",false);
|
||||
|
|
@ -108,7 +107,7 @@ if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
|
|||
if ( ! defined ("SYSINFO_DISPLAY")) {
|
||||
define ("SYSINFO_DISPLAY",TRUE);
|
||||
}
|
||||
define ("DBVERSION",141);
|
||||
define ("DBVERSION",143);
|
||||
define ("MONO_DATABASE",25);
|
||||
define ("DBVERSIONREPO",18);
|
||||
define ('NOTFOUND','--not found--');
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ if ($low_action == "list")
|
|||
<form method="get" action="<?php echo $href;?>">
|
||||
<?php
|
||||
echo dossier::hidden();
|
||||
$a = (isset($_GET['query'])) ? $_GET['query'] : "";
|
||||
echo _("Cherche ").HtmlInput::filter_table_form("contact_tb", '0,1,2,3,4,5,6', 1,"query",$a);
|
||||
$a = $http->get("query","string","");
|
||||
echo _("Cherche ").HtmlInput::filter_table_form("contact_tb", '0,1,2,3,4,5,6', 1,"query",$a);
|
||||
|
||||
$sel_card = new ISelect('cat');
|
||||
$sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' .
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ if ($low_action == "list")
|
|||
$a=$http->get("query","string","");
|
||||
echo _("Cherche ").HtmlInput::filter_table_form("tiers_tb", '0,1,2', 1,"query",$a);
|
||||
|
||||
$choice_cat=$http->request("choice_cat", "",1);
|
||||
$choice_cat=$http->request("choice_cat", "string",1);
|
||||
|
||||
if ( $choice_cat == 1 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,51 +36,55 @@ global $g_user;
|
|||
//-----------------------------------------------------
|
||||
// Form
|
||||
//-----------------------------------------------------
|
||||
|
||||
$http=new \HttpInput();
|
||||
$bilan=new Acc_Bilan($cn);
|
||||
$bilan->get_request_get();
|
||||
echo '<div class="content">';
|
||||
$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice();
|
||||
$exercice=$http->get("exercice","number",$g_user->get_exercice());
|
||||
//----------------------------------------------------------------
|
||||
// Verification
|
||||
//----------------------------------------------------------------
|
||||
if ( ! isset ($_GET['verif']))
|
||||
{
|
||||
/*
|
||||
* Let you change the exercice
|
||||
*/
|
||||
echo '<fieldset><legend>'._('Exercice').'</legend>';;
|
||||
echo '<form method="GET">';
|
||||
echo _('Choisissez un autre exercice');
|
||||
$ex=new Exercice($cn);
|
||||
$wex=$ex->select('exercice',$exercice,' onchange="submit(this)"');
|
||||
echo $wex->input();
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::get_to_hidden(array('ac','type'));
|
||||
echo '</form>';
|
||||
echo '</fieldset>';
|
||||
/*
|
||||
* Let you change the exercice
|
||||
*/
|
||||
echo '<fieldset><legend>'._('Exercice').'</legend>';;
|
||||
echo '<form method="GET">';
|
||||
echo _('Choisissez un autre exercice');
|
||||
$ex=new Exercice($cn);
|
||||
$wex=$ex->select('exercice',$exercice,' onchange="submit(this)"');
|
||||
echo $wex->input();
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::get_to_hidden(array('ac','type'));
|
||||
echo '</form>';
|
||||
echo '</fieldset>';
|
||||
|
||||
$filter_year=" where p_exercice='".sql_string($exercice)."'";
|
||||
echo '<FORM METHOD="GET">';
|
||||
echo HtmlInput::hidden('type','bilan');
|
||||
echo dossier::hidden();
|
||||
$filter_year=" where p_exercice='".sql_string($exercice)."'";
|
||||
echo '<FORM METHOD="GET">';
|
||||
echo HtmlInput::hidden('type','bilan');
|
||||
echo dossier::hidden();
|
||||
|
||||
// By default , show last day of exercice
|
||||
if ($bilan->to == -1 ){
|
||||
$t_periode=new Periode($cn);
|
||||
list($per_max,$per_min)=$t_periode->get_limit($exercice);
|
||||
$bilan->to=$per_min->p_id;
|
||||
// By default , show last day of exercice
|
||||
if ($bilan->to == -1 ){
|
||||
$t_periode=new Periode($cn);
|
||||
list($per_max,$per_min)=$t_periode->get_limit($exercice);
|
||||
$bilan->to=$per_min->p_id;
|
||||
}
|
||||
echo $bilan->display_form ($filter_year);
|
||||
echo '<span class="notice"> '._('Attention : si le bilan n\'est pas équilibré.<br> Vérifiez <ul>
|
||||
<li>L\'affectation du résultat est fait</li>
|
||||
<li>Vos comptes actifs ont un solde débiteur (sauf les comptes dit inversés)</li>
|
||||
<li> les comptes passifs ont un solde créditeur (sauf les comptes dit inversés) </li>
|
||||
</ul>
|
||||
Utilisez la balance des comptes pour vérifier.').' </span>';
|
||||
echo HtmlInput::submit('verif',_('Verification comptabilite'));
|
||||
echo HtmlInput::get_to_hidden(array('ac','exercice'));
|
||||
echo '</FORM>';
|
||||
}
|
||||
echo $bilan->display_form ($filter_year);
|
||||
echo '<span class="notice"> '._('Attention : si le bilan n\'est pas équilibré.<br> Vérifiez <ul>
|
||||
<li>L\'affectation du résultat est fait</li>
|
||||
<li>Vos comptes actifs ont un solde débiteur (sauf les comptes dit inversés)</li>
|
||||
<li> les comptes passifs ont un solde créditeur (sauf les comptes dit inversés) </li>
|
||||
</ul>
|
||||
Utilisez la balance des comptes pour vérifier.').' </span>';
|
||||
echo HtmlInput::submit('verif',_('Verification comptabilite'));
|
||||
echo HtmlInput::get_to_hidden(array('ac','exercice'));
|
||||
echo '</FORM>';
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// Print
|
||||
//----------------------------------------------------------------
|
||||
if ( isset($_GET['verif']))
|
||||
{
|
||||
$periode=new Periode($cn);
|
||||
|
|
@ -95,7 +99,7 @@ if ( isset($_GET['verif']))
|
|||
echo '<FORM METHOD="GET" ACTION="export.php">';
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::get_to_hidden(array('exercice'));
|
||||
echo HtmlInput::hidden('b_id',$_GET['b_id']);
|
||||
echo HtmlInput::hidden('b_id',$bilan->b_id);
|
||||
echo HtmlInput::hidden('act','OTH:Bilan');
|
||||
|
||||
echo HtmlInput::hidden('from_periode',$bilan->from);
|
||||
|
|
@ -107,4 +111,4 @@ if ( isset($_GET['verif']))
|
|||
|
||||
echo '<hr>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -1347,4 +1347,22 @@ if(!function_exists('tracedebug')) {
|
|||
file_put_contents($tmp_file, $output, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* encode the string for RTF, return a stringu
|
||||
* @param $p_string string to convert
|
||||
* @return string
|
||||
*/
|
||||
function convert_to_rtf($p_string)
|
||||
{
|
||||
$result="";
|
||||
$p_string2=utf8_decode($p_string);
|
||||
$nb_result=strlen($p_string2);
|
||||
for ($i = 0 ; $i < $nb_result ; $i++ ){
|
||||
if (ord($p_string[$i]) < 127 ) {
|
||||
$result.=$p_string[$i];
|
||||
} else {
|
||||
$result.='\u'.ord($p_string[$i]).chr(92).chr(39).'3f';
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -105,6 +105,10 @@ function config_file_form($p_array=null)
|
|||
}
|
||||
$icdbname=new IText('cdbname');
|
||||
$icdbname->value=$cdbname;
|
||||
|
||||
$icpassword_admin=new IText('cpassword_admin');
|
||||
$icpassword_admin->value=$cpassword_admin;
|
||||
|
||||
require NOALYSS_TEMPLATE.'/template_config_form.php';
|
||||
}
|
||||
/**
|
||||
|
|
@ -156,6 +160,12 @@ function display_file_config($p_array,$from_setup=1,$p_os=1)
|
|||
print ("\r\n");
|
||||
print ( 'define ("NOALYSS_ADMINISTRATOR","'.$cadmin.'");');
|
||||
print ("\r\n");
|
||||
print ("// For changing the password of admin, go to preference or update in db");
|
||||
print ("\r\n");
|
||||
print ("// this password is only used when executing install.php ");
|
||||
print ("\r\n");
|
||||
print ( 'define ("NOALYSS_ADMIN_PASSWORD","'.$cpassword_admin.'");');
|
||||
print ("\r\n");
|
||||
|
||||
print ( 'define ("LOCALE",'.$clocale.');');
|
||||
print ("\r\n");
|
||||
|
|
|
|||
|
|
@ -950,25 +950,43 @@ class HtmlInput
|
|||
return $sel;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* * filter the rows in a table and keep the colored row in alternance
|
||||
* @param dom_id $p_table_id table
|
||||
* @param string $p_col , column to search example 0,1,2
|
||||
* @param int $start_row row to always keep (header)
|
||||
* @param string $p_name name of the input field
|
||||
* @param string $p_old_value search value sent by $_GET (or $_REQUEST)
|
||||
* @return string HTML
|
||||
*/
|
||||
static function filter_table_form($p_table_id, $p_col, $start_row, $p_name,
|
||||
$p_old_value)
|
||||
{
|
||||
$r="
|
||||
<span>
|
||||
<input id=\"lk_".$p_table_id."\" name=\"$p_name\" value=\"$p_old_value\"autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\">
|
||||
<span class=\"icon\" ></span>
|
||||
<input id=\"lk_".$p_table_id."\" name=\"$p_name\" value=\"$p_old_value\"autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\" placeholder=\""._("Recherche")."\">
|
||||
<input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id."').value='';filter_table($('lk_".$p_table_id."'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
|
||||
</span>
|
||||
";
|
||||
$r.=' <span class="notice" id="info_'.$p_table_id.'"></span>';
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* filter the rows in a table and keep the colored row in alternance
|
||||
* @param dom_id $p_table_id table
|
||||
* @param string $p_col , column to search example 0,1,2
|
||||
* @param int $start_row row to always keep (header)
|
||||
* @return string HTML
|
||||
*/
|
||||
static function filter_table($p_table_id, $p_col, $start_row)
|
||||
{
|
||||
$r="
|
||||
<span>
|
||||
<input id=\"lk_".$p_table_id."\" autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\">
|
||||
<span class=\"icon\" ></span>
|
||||
|
||||
<input id=\"lk_".$p_table_id."\" autocomplete=\"off\" class=\"input_text\" name=\"filter\" onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" type=\"text\" placeholder=\""._("Recherche")."\">
|
||||
<input type=\"button\" class=\"smallbutton\" onclick=\"$('lk_".$p_table_id."').value='';filter_table($('lk_".$p_table_id."'), '$p_table_id','$p_col',$start_row );\" value=\"X\">
|
||||
</span>
|
||||
";
|
||||
|
|
@ -984,8 +1002,8 @@ class HtmlInput
|
|||
{
|
||||
$r="<span>";
|
||||
$r.='<span class=" icon"></span>';
|
||||
$r.=sprintf('<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" onkeyup="filter_list(this,\'%s\')">',
|
||||
$p_list_id,$p_list_id,$p_list_id);
|
||||
$r.=sprintf('<input id="search_%s" type="TEXT" class="input_text" name="filter_list%s" placeholder="%s" onkeyup="filter_list(this,\'%s\')">',
|
||||
$p_list_id,$p_list_id,_("Recherche"),$p_list_id);
|
||||
|
||||
$r.=sprintf('<input type="button" class="smallbutton" onclick="$(\'search_%s\').value=\'\';filter_list(\'search_%s\',\'%s\')" value="x">',$p_list_id,$p_list_id,$p_list_id);
|
||||
$r.='</span>';
|
||||
|
|
|
|||
|
|
@ -342,4 +342,18 @@ class Icon_Action
|
|||
$lock_cur);
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a icon ON is $p_value == 1 otherwise OFF
|
||||
* @param string $p_div id of element
|
||||
* @param string $p_javascript
|
||||
* @param string $p_style optionnal HTML code
|
||||
* @param integer 0 or 1 , 0 means OFF and 1 means ON
|
||||
* @return html string
|
||||
*/
|
||||
static function icon_onoff($p_id,$p_javascript,$p_style,$p_value)
|
||||
{
|
||||
if ( $p_value == 1 ) { return \Icon_Action::iconon($p_id, $p_javascript,$p_style);}
|
||||
if ( $p_value == 0 ) { return \Icon_Action::iconoff($p_id, $p_javascript,$p_style);}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3
include/sql/patch/upgrade141.BE.sql
Normal file
3
include/sql/patch/upgrade141.BE.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
begin;
|
||||
insert into version (val,v_description) values (142,'Bug dans PARM_POSTE');
|
||||
commit ;
|
||||
5
include/sql/patch/upgrade141.FR.sql
Normal file
5
include/sql/patch/upgrade141.FR.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
begin;
|
||||
update parm_poste set p_type='PAS' where p_value='40';
|
||||
update tmp_pcmn set pcm_type='PAS' where pcm_val like '40%';
|
||||
insert into version (val,v_description) values (142,'Bug dans PARM_POSTE');
|
||||
commit ;
|
||||
0
include/sql/patch/upgrade141.sql
Normal file
0
include/sql/patch/upgrade141.sql
Normal file
43
include/sql/patch/upgrade142.sql
Normal file
43
include/sql/patch/upgrade142.sql
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
begin;
|
||||
|
||||
CREATE OR REPLACE FUNCTION comptaproc.find_pcm_type(pp_value account_type)
|
||||
RETURNS text
|
||||
AS $function$
|
||||
declare
|
||||
str_type parm_poste.p_type%TYPE;
|
||||
str_value parm_poste.p_type%TYPE;
|
||||
nLength integer;
|
||||
begin
|
||||
str_value:=pp_value;
|
||||
nLength:=length(str_value::text);
|
||||
|
||||
while nLength > 0 loop
|
||||
select p_type into str_type from parm_poste where p_value=str_value;
|
||||
if FOUND then
|
||||
raise info 'Type of %s is %s',str_value,str_type;
|
||||
return str_type;
|
||||
end if;
|
||||
nLength:=nLength-1;
|
||||
str_value:=substring(str_value::text from 1 for nLength)::account_type;
|
||||
end loop;
|
||||
-- Si non trouvé dans PARM_POSTE, prend le type du premier parent trouvé
|
||||
--
|
||||
str_value := pp_value;
|
||||
nLength:=length(str_value::text);
|
||||
str_value:=substring(str_value::text from 1 for nLength)::account_type;
|
||||
while nLength > 0 loop
|
||||
select pcm_type into str_type from tmp_pcmn tp where pcm_val=str_value;
|
||||
if FOUND then
|
||||
raise info 'Type of %s is %s',str_value,str_type;
|
||||
return str_type;
|
||||
end if;
|
||||
nLength:=nLength-1;
|
||||
str_value:=substring(str_value::text from 1 for nLength)::account_type;
|
||||
end loop;
|
||||
-- si ni parent ou parm_poste alors return CON
|
||||
return 'CON';
|
||||
end;
|
||||
$function$
|
||||
LANGUAGE plpgsql;
|
||||
insert into version (val,v_description) values (143,'Corrige function find_pcm_type');
|
||||
commit ;
|
||||
|
|
@ -26,6 +26,7 @@
|
|||
* @brief
|
||||
*
|
||||
*/
|
||||
|
||||
?>
|
||||
<div style="margin-left: 30">
|
||||
<table>
|
||||
|
|
@ -56,7 +57,16 @@
|
|||
<?php echo _('Administrateur de noalyss')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $icadmin->input();?>
|
||||
<?php echo $icadmin->input();echo Icon_Action::infobulle(210)?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo _('Mot de passe administrateur de noalyss')?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $icpassword_admin->input();?>
|
||||
<?php echo Icon_Action::infobulle(209)?>
|
||||
</td>
|
||||
</tr>
|
||||
<TR>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
DOSSIER_TEST=rel70dossier25
|
||||
FILE_TEST=dossiertest191124-2109.bin
|
||||
FILE_TEST=dossiertest200318-1402.sql
|
||||
|
||||
dropdb $DOSSIER_TEST
|
||||
createdb $DOSSIER_TEST
|
||||
pg_restore -Fc --no-owner --no-privilege --verbose -d $DOSSIER_TEST db/$FILE_TEST
|
||||
psql -X $DOSSIER_TEST < db/$FILE_TEST
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue