From c16c32ca48ed34887862dcb85e505d5275a485e1 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 13 Nov 2011 13:28:19 +0000 Subject: [PATCH] improve CSS Finish new security + clean table action --- html/admin_repo.php | 4 +- html/ajax_misc.php | 15 +- html/backup.php | 2 +- html/js/acc_ledger.js | 4 +- html/js/card.js | 1 + html/js/infobulle.js | 8 +- html/style-color.css | 124 +++++++------- html/style-light.css | 6 +- html/style.css | 55 +++--- html/user_login.php | 2 +- include/ac_common.php | 20 ++- include/ajax_get_receipt.php | 67 ++++++++ include/audit_log.php | 3 +- include/class_acc_ledger.php | 2 +- include/class_database.php | 10 +- include/class_dossier.php | 70 ++++++-- include/class_html_input.php | 31 ++-- include/class_user.php | 45 +++-- include/constant.security.php | 43 ----- include/dossier.inc.php | 21 +-- include/modele.inc.php | 1 + include/param_sec.inc.php | 196 ++++++++++++++-------- include/restore.inc.php | 3 +- include/template/module.php | 16 +- include/template/security_list_action.php | 63 +------ include/user.inc.php | 62 ++++--- include/user_detail.inc.php | 21 ++- sql/ajax-direct-form.sql | 26 +++ sql/object-6.0.sql | 69 ++++---- sql/upgrade.sql | 40 +++-- 30 files changed, 602 insertions(+), 428 deletions(-) create mode 100644 include/ajax_get_receipt.php create mode 100644 sql/ajax-direct-form.sql diff --git a/html/admin_repo.php b/html/admin_repo.php index 6d4d2738e..9e0ab89fb 100644 --- a/html/admin_repo.php +++ b/html/admin_repo.php @@ -19,7 +19,7 @@ */ // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr /*! \file - * \brief Administration of the repository : creation of user, folder, security, + * \brief Administration of the repository : creation of user, folder, security, * templates... Accessible only by the administrator */ require_once("user_common.php"); @@ -38,7 +38,7 @@ if ($User->admin != 1) html_page_stop(); return; } - +load_all_script(); echo '

Administration Globale

'; echo '
'; diff --git a/html/ajax_misc.php b/html/ajax_misc.php index 8d878825c..62e5d6cef 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -521,10 +521,13 @@ EOF; $new=false; require_once 'template/plugin_detail.php'; break; - case 'saldo': - require_once 'ajax_bank_saldo.php'; - break; - case 'up_predef': - require_once 'ajax_update_predef.php'; - break; + case 'saldo': + require_once 'ajax_bank_saldo.php'; + break; + case 'up_predef': + require_once 'ajax_update_predef.php'; + break; + case 'upd_receipt': + require_once 'ajax_get_receipt.php'; + break; } \ No newline at end of file diff --git a/html/backup.php b/html/backup.php index 82c2251f8..ae1ef737e 100644 --- a/html/backup.php +++ b/html/backup.php @@ -58,7 +58,7 @@ if ( isset ($_REQUEST['sa']) ) $cmd=escapeshellcmd (PG_DUMP); putenv("PGPASSWORD=".phpcompta_password); putenv("PGUSER=".phpcompta_user); - + putenv("PGHOST=".phpcompta_psql_host); if ( $_REQUEST['t'] == 'd' ) { $database=domaine."dossier".$_REQUEST['d']; diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js index 3b248004f..ab7ae1fa0 100644 --- a/html/js/acc_ledger.js +++ b/html/js/acc_ledger.js @@ -85,9 +85,9 @@ function update_pj() { var jrn=g("p_jrn").value; var dossier=g("gDossier").value; - var querystring='gDossier='+dossier+'&l='+jrn; + var querystring='gDossier='+dossier+'&l='+jrn+"&op=upd_receipt"; var action=new Ajax.Request( - "get_pj.php", + "ajax_misc.php", { method:'get', parameters:querystring, diff --git a/html/js/card.js b/html/js/card.js index 4a750f940..36ab0dc58 100644 --- a/html/js/card.js +++ b/html/js/card.js @@ -240,6 +240,7 @@ function errorFid(request,json) } function update_value(text,li) { + ajaxFid(ctl); } /** *@brief is called when something change in ICard diff --git a/html/js/infobulle.js b/html/js/infobulle.js index fb1842862..b9677c654 100644 --- a/html/js/infobulle.js +++ b/html/js/infobulle.js @@ -17,8 +17,8 @@ */ /*!\file * \brief create the infobulle, the internalization is not yet implemented - * \code - // Example + * \code + // Example echo JS_INFOBULLE; echo HtmlInput::infobulle(x); \endcode @@ -27,10 +27,10 @@ var posX=0,posy=0,offsetX=10,offsetY=10; document.onmousemove=getPosition; var content=new Array(); -content[0]="Donnez le quickcode ou tapez une partie du nom de la fiche puis cliquer sur rechercher, si la recherche ne donne rien, il vous sera proposé de créer une nouvelle fiche"; +content[0]="Donnez le quickcode ou tapez une partie du nom de la fiche, en appuyant sur le bouton, vous pourrez la chercher"; content[1]="(optionnel) La description est un commentaire libre qui sert à identifier cette opération"; content[2]="Selectionnez le journal où l'opération doit être sauvée"; -content[3]="Les périodes comptables servent comme un second contrôle pour la date de l'opération. Modifiez dans vos préférence pour avoir une autre période par défaut"; +content[3]="Les périodes comptables servent comme un second contrôle pour la date de l'opération. Modifiez dans vos préférence pour avoir une autre période par défaut. Pour ne plus avoir à changer la période aller dans COMPANY, et mettez \"Afficher la période comptable\" à non"; content[4]="(optionnel) L'échéance est la date limite de paiement"; content[5]="(optionnel)Le numéro d'extrait permet de retrouver plus facilement l'extrait de banque"; content[6]="Indiquez ici le prix hors tva si vous êtes affilié à la tva et que vous pouvez la déduire , sinon indiquez ici le total tva incluse et utilisez un taux tva de 0%"; diff --git a/html/style-color.css b/html/style-color.css index 96f10ccc0..3c6264c80 100644 --- a/html/style-color.css +++ b/html/style-color.css @@ -7,7 +7,7 @@ BODY { padding:0; margin:0; color:#0E7E0E; - + } .notice { color:red; @@ -18,7 +18,7 @@ BODY { table.result,table.document ,table.resultfooter{ color:blue; - border:1px solid blue ; + border:1px solid blue ; width:100%; border-spacing: 0px; border-collapse:collapse; @@ -29,7 +29,7 @@ table.resultfooter tfoot { } -table.result th, table.document th { +table.result th, table.document th { font-weight:bold; font-family:helvetica,arial,sans-serif; border-bottom:1px solid blue; @@ -109,7 +109,7 @@ h1.title { div.u_tmenu { margin-top:1px; - width:100%; + width:100%; background-color:#879ED4; @@ -122,7 +122,7 @@ div.u_subtmenu { } div.u_tmenu div.u_tool { - background-color:#879ED4; + background-color:#879ED4; float:left; } @@ -145,7 +145,7 @@ div.u_tool div.acces_direct{ div.u_subt2menu { background-color:lightgrey; - left:1%; + left:1%; } div.lmenu { @@ -177,39 +177,39 @@ div.recherche_form{ border-width:1px; } -div.redcontent{ +div.redcontent{ - float:left; + float:left; padding-top:7px; padding-left:8px; - font-size:9px; - font-family:helvetica,arial,sans-serif; + font-size:9px; + font-family:helvetica,arial,sans-serif; width:75%; } -div.content{ +div.content{ - float:left; + float:left; padding-top:7px; - width:100%; - font-family:helvetica,arial,sans-serif; + width:100%; + font-family:helvetica,arial,sans-serif; clear:both; } -div.content30{ +div.content30{ - float:left; + float:left; padding-top:7px; - width:35%; - font-family:helvetica,arial,sans-serif; + width:35%; + font-family:helvetica,arial,sans-serif; } div.no span{ position:static; - font-family:helvetica,arial,sans-serif; + font-family:helvetica,arial,sans-serif; font-weight:bold; - color:red; + color:red; } .error { @@ -217,7 +217,7 @@ div.no span{ margin-left:20%; text-align: center; - color:white; + color:white; background-color:red; font-weight: bolder; font-size:120%; @@ -227,7 +227,7 @@ table.mtitle { border:0; text-align:center } -td.mshort { +td.mshort { height:15px; width:60px; text-align:center; @@ -238,7 +238,7 @@ td.mshort { td.mtitle { text-align:center; width:95px; - height :30px; + height :30px; font-size:10px; background-color:#DDE6FF; } @@ -254,11 +254,11 @@ span.mtitle { font-size:10px; border-style:groove } -span.odd { +span.odd { background-color:#ECF3FF; display:block; } -span.even { +span.even { background-color:#DDE6FF; display:block; } @@ -266,7 +266,7 @@ span.even { tr.odd { background-color:#DDE6FF; font-size:10px; - border-size:0px; + border-size:0px; } tr { font-size:10px; @@ -328,7 +328,7 @@ tr.odd:hover td background-color: #a9d6e4; color:white; } -tr.even:hover td +tr.even:hover td { text-decoration:none; background-color: #a9d6e4; @@ -390,7 +390,7 @@ a.detail color: blue; } -a.detail:hover +a.detail:hover { font-size:9px; font-family:helvetica,arial,sans-serif; @@ -479,9 +479,9 @@ div.redcontent input.text { font-weight:normal; border-color:336699; border-style:solid; - background-color:orange; + background-color:orange; border-width:1px; - color:blue; + color:blue; } div.content input.text { font-family:helvetica,arial,sans-serif; @@ -490,7 +490,7 @@ div.content input.text { border-style:solid; border-width:1px; background-color:orange; - color:blue; + color:blue; } @@ -529,10 +529,10 @@ legend { font-size: 120% ; } -fieldset fieldset legend { +fieldset fieldset legend { font-size:110%; color:grey; -} +} select { border: 1px solid blue; margin:2px; @@ -548,7 +548,7 @@ select { background-color:yellow; top:0;left:0; visibility:hidden; - z-index:2; + z-index:20; width:25em; } @@ -589,8 +589,8 @@ div.popup_back{ height:100%; z-index:1; /*background-color:lightgrey;*/ - background-color: rgba(203, 203,203, 0.2); - display:none; + background-color: rgba(203, 203,203, 0.2); + display:none; } div.popup_border_title { @@ -609,7 +609,7 @@ div.popup_border_title { font-style: italic; font-weight: bolder; text-align:center; - /*border-bottom: 2px solid #201e87;*/ + /*border-bottom: 2px solid #201e87;*/ color: white; display:none; /*opacity:1; @@ -621,12 +621,12 @@ div.popup_border_notitle { top:20%; left:20%; width:60%; - height:80% ; + height:80% ; /*background:lightgrey;*/ z-index:10; /*border:dotted 1px black;*/ border: 3px outset #201e87; - background-color:lightblue; + background-color:lightblue; font-family: helvetica,arial,sans-serif; font-style: italic; font-weight: bolder; @@ -647,7 +647,7 @@ div.popup_content { width:100%; height:96%; overflow: auto; - background-color:#DFE7FF; + background-color:#DFE7FF; font-size:10px ; font-family: helvetica,arial,sans-serif; font-style: normal; @@ -823,7 +823,7 @@ a#anchorbutton { margin:1 2 1 2; -moz-border-radius:2 2; -} +} a#anchorbutton :hover { cursor:pointer; background-color:white; @@ -832,7 +832,7 @@ a#anchorbutton :hover { margin:1 2 1 2; } /* */ -div.add_todo_list { +div.add_todo_list { border:1px solid blue; display:none; background-color:#CFCDFF; @@ -857,7 +857,7 @@ h2.gest_name { } div.op_detail_frame { - background-color:#e4e7ed; + background-color:#e4e7ed; height:100%; width:100%; @@ -875,7 +875,7 @@ div.inner_box { left:10%; - border:1px solid darkblue; + border:1px solid darkblue; } div.op_detail_title { @@ -884,7 +884,7 @@ div.op_detail_title { } -div#div_jrn{ +div#div_jrn{ position:absolute; border:1px solid black; top:15%;left:100; @@ -894,7 +894,7 @@ div#div_jrn{ background-color:#EDF3FF; } -div#div_cat{ +div#div_cat{ position:absolute; border:1px solid black; top:15%;left:100; @@ -908,7 +908,7 @@ div.divinfo { color:red;text-align:right;display:block;width:30em;height:13;} div#search_form -{ +{ position:absolute; border:1px solid black; top:15%;left:100; @@ -918,7 +918,7 @@ div#search_form display:none; background-color:#e4e7ed; } -table.result td +table.result td { padding-left:5px; padding-right:5px; @@ -928,7 +928,7 @@ table.info_op margin-left: 30%; margin-right: 30%; width:20%; - + } table.info_op tr { @@ -939,13 +939,13 @@ width:5% h2#jrn_name { margin-right:30%; - + } tr.footer{ font-size:14; font-style: italic; font-weight: bold; - + } span.remain { font-weight: bold; @@ -955,22 +955,22 @@ div#jrn_name_div { float: right; margin-right:150; - - + + } #predef_form { margin-left:20%; width:60%; - + } #direct { display:inline; float:right; - - + + } -.direct +.direct { font-size:6px; border:groove 1px #00ff00; @@ -984,13 +984,13 @@ div#wait_box margin:0; overflow:hidden; z-index:10; - + position:absolute; left:30%; top:30%; -border:1px solid darkblue; +border:1px solid darkblue; } #wait_box h2 @@ -998,11 +998,11 @@ border:1px solid darkblue; color:black; text-align:center; } -div#div_jrnsearch_op{ - +div#div_jrnsearch_op{ + border:1px solid black; display:none; width:50em; background-color:#EDF3FF; - + } \ No newline at end of file diff --git a/html/style-light.css b/html/style-light.css index fed7b7925..008654e19 100644 --- a/html/style-light.css +++ b/html/style-light.css @@ -435,7 +435,7 @@ div.content a { font-family:helvetica,arial,sans-serif; text-decoration: none; display: block; - color: #0000ff; + color: blue; padding: 1px ; } @@ -565,6 +565,10 @@ background-color:white; visibility:hidden; z-index:2; width:25em; + padding-bottom: 10; + padding-top: 10; + padding-left: 10; + padding-right: 10; } diff --git a/html/style.css b/html/style.css index 5d2ccedec..a980c9907 100644 --- a/html/style.css +++ b/html/style.css @@ -35,9 +35,7 @@ table.result th { color:#25238F; text-align: left; - // background-color:#EDF3FF; - - font-style: italic; + font-style: italic; } @@ -566,11 +564,15 @@ background-color:white; position:absolute; border:1px solid black; background-color:yellow; + padding-bottom: 10; + padding-top: 10; + padding-left: 10; + padding-right: 10; + color:black; top:0;left:0; visibility:hidden; - z-index:2; width:25em; - + z-index:20; } span.action { @@ -790,7 +792,7 @@ color:black; cursor:inherit; } -.button, a.button,div.content a.button { +a#anchorbutton, .button, a.button,div.content a.button { font-size:10; color:white; font-weight: bold; @@ -804,13 +806,17 @@ cursor:inherit; border-style: outset ; border-color: blue ; border-width:0; - padding:2 4 2 4; + padding-bottom: 4; + padding-top: 4; + padding-right: 6; + padding-left: 6; + margin-top:3px; cursor:pointer; margin:1 2 1 2; -moz-border-radius:2 2; } -.button:hover,a.button:hover,div.content a.button:hover { +a#anchorbutton:hover, .button:hover,a.button:hover,div.content a.button:hover { cursor:pointer; background-color:white; border-style: inset ; @@ -836,33 +842,6 @@ margin:0; padding:0; text-align:center; } -a#anchorbutton { - font-size:10; - color:white; - font-weight: bold; - - text-decoration:none; - font-family: helvetica,sans-serif; - background-image: url("image/bg-submit3.gif"); - background-repeat: repeat-x; - background-position: left; - - border-style: outset ; - border-color: blue ; - border-width:1; - padding:2 4 2 4; - cursor:pointer; - margin:1 2 1 2; - -moz-border-radius:2 2; - -} -a#anchorbutton:hover { - cursor:pointer; - background-color:white; - border-style: inset ; - color:blue; - margin:1 2 1 2; - } /* */ div.add_todo_list { border:1px solid blue; @@ -1059,4 +1038,10 @@ font-size:110%; display:inline; color: #0000ff; background-color: rgb(93, 144, 205); +} +#close_div +{ + background-color:blue; + color:white; + text-decoration:none } \ No newline at end of file diff --git a/html/user_login.php b/html/user_login.php index 2ae0868b7..03f2830c0 100644 --- a/html/user_login.php +++ b/html/user_login.php @@ -119,7 +119,7 @@ $result.=''._('Deconnexion $result.=""; $result.=""; -echo '

'._('Bienvenue').$User->first_name.' '.$User->name.' '._("dans PhpCompta")."

"; +echo '

'._('Bienvenue ').$User->first_name.' '.$User->name.' '._("dans PhpCompta")."

"; echo '
'._('Choississez votre dossier'); echo ''.$result.''; echo '
'; diff --git a/include/ac_common.php b/include/ac_common.php index be8aa20d0..10fff24f5 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -803,12 +803,20 @@ function find_default_module() if (empty($default_module)) { - $default_module = $cn->get_array("select me_code - from profile_menu join profile_user using (p_id) - where - user_name=$1 and p_order=(select min(p_order) from profile_menu - where user_name=$2) limit 1", array($g_user->login, $g_user->login)); - return $default_module[0]['me_code']; + $default_module = $cn->get_array("select me_code + from profile_menu join profile_user using (p_id) + where + user_name=$1 and p_order=(select min(p_order) from profile_menu + where user_name=$2) limit 1", array($g_user->login, $g_user->login)); + /* + * if nothing found, there is no profile for this user => exit + */ + if ( empty ($default_module)) + { + echo_warning("Utilisateur n'a pas de profile"); + exit(); + } + return $default_module[0]['me_code']; } if (count($default_module) > 1) diff --git a/include/ajax_get_receipt.php b/include/ajax_get_receipt.php new file mode 100644 index 000000000..49c5c8b69 --- /dev/null +++ b/include/ajax_get_receipt.php @@ -0,0 +1,67 @@ +Check(); + +$Ledger=new Acc_Ledger($cn,$l); +$prop=$Ledger->get_propertie(); +$pj_seq=$Ledger->guess_pj(); +$string='{"pj":"'.$pj_seq.'"}'; + +header("Content-type: text/json; charset: utf8",true); +echo $string; + + +?> + diff --git a/include/audit_log.php b/include/audit_log.php index a405635c0..ec1cdf0fc 100644 --- a/include/audit_log.php +++ b/include/audit_log.php @@ -72,7 +72,8 @@ switch ( $r['ac_state'] ) case 'SUCCESS'; echo ''; break; - + default: + echo ''; } ?> diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index c1bfab1c0..b7e61ee20 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -2619,7 +2619,7 @@ class Acc_Ledger extends jrn_def_sql if ( $type=="" || $this->id==0) $type='ALL'; $r.='