diff --git a/doc/developper/Doxyfile b/doc/developper/Doxyfile index bbe229171..766c242a6 100644 --- a/doc/developper/Doxyfile +++ b/doc/developper/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = noalyss # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = Version-7.2 +PROJECT_NUMBER = Version-8.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/html/ajax_misc.php b/html/ajax_misc.php index f0cd81541..1286976b5 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -552,7 +552,7 @@ EOF; echo '
'; echo '

'.$ajrn[0]['jrn_def_name'].'

'; if ( trim($ajrn[0]['jrn_def_description']) != "") { - echo '

'.$ajrn[0]['jrn_def_description'].'

'; + echo '

'.$ajrn[0]['jrn_def_description'].'

'; } echo '
'; } diff --git a/html/do.php b/html/do.php index 2b677236c..bd80cfb75 100644 --- a/html/do.php +++ b/html/do.php @@ -254,29 +254,20 @@ if (isset($_REQUEST['ac'])) pm_id_v3,pm_id_v2,pm_id_v1 from v_menu_profile where code= upper($1) and p_id=$2', array($AC,$user_profile)); - try { - if ( count($amenu_id) != 1 ) { - // if AC is a simple code and this menu can be accessed - // we should find the first menu which used it and change the - // request AC to it - $pm_id=$cn->get_array('select pm_id from profile_menu ' - . ' where lower(me_code)=lower($1) and p_id=$2', - array($AC,$user_profile)); - if ( count($pm_id) > 0 ) { - show_menu($pm_id[0]['pm_id']); - return; - } else { - throw new Exception(_('Erreur menu'),10); - } + if (count($amenu_id) == 0 ) { throw new Exception(_('Erreur menu'),10);} + if ( count($amenu_id)> 1) { + $tmp=$amenu_id[0]; + $amenu_id=[]; + $amenu_id[0]=$tmp; } $amenu_id=complete_default_menu($amenu_id,$user_profile); $AC=rebuild_access_code($amenu_id); put_global(array(array("key"=>"ac","value"=>$AC))); - $module_id=$cn->get_value('select + $module_id=$cn->get_value('select distinct case when pm_id_v3 = 0 then (case when pm_id_v2 = 0 then pm_id_v1 else pm_id_v2 end) else pm_id_v3 end from v_menu_profile diff --git a/html/fid_card.php b/html/fid_card.php index 23080cc93..91ec491af 100644 --- a/html/fid_card.php +++ b/html/fid_card.php @@ -106,7 +106,9 @@ else { if (isset($_REQUEST['type'])) { - if ($_REQUEST['type']=='gl' || $_REQUEST['type']=='') $filter_card=''; + if ($_REQUEST['type']=='gl' || $_REQUEST['type']=='') { + $filter_card=''; + } else { $get_cred='jrn_def_fiche_cred'; @@ -168,7 +170,7 @@ if ($sql != false && sizeof($sql) != 0 ) echo ''; if (count($sql) > 12) { - printf ('...'._('Résultat limité à 12').' ...'); + printf ('...'._('Résultat limité à %s').' ...',$limit); } } else diff --git a/html/image/logo8000.png b/html/image/logo8100.png similarity index 51% rename from html/image/logo8000.png rename to html/image/logo8100.png index ee5fc4bda..da1ccdf25 100644 Binary files a/html/image/logo8000.png and b/html/image/logo8100.png differ diff --git a/html/index.css b/html/index.css index 313560e97..0e0b06718 100644 --- a/html/index.css +++ b/html/index.css @@ -142,7 +142,7 @@ BODY { position:absolute; z-index:-1; height:auto; - width:10%; + width:125px; left:1%; top:30px; @@ -196,11 +196,12 @@ BODY { } #recover_link { position:absolute; - margin-top:397px; + /*! margin-top:397px; */ left:1px; background-color: white; bottom: initial; width: 20rem; + bottom: 30px; } } @media only screen and (min-width : 1100px) { @@ -228,9 +229,9 @@ BODY { width: 24rem; } #recover_link { - position:absolute; - top:397px; + position:fixed; left:539px; + bottom:2px; background-color: white; width:auto; @@ -274,9 +275,9 @@ BODY { width: 24rem; } #recover_link { - position:absolute; - top:55%; + position:fixed; left:55%; + bottom:20px; background-color: white; margin-top:0px; } diff --git a/html/index.php b/html/index.php index b6ce4ccb4..c8b8b65bd 100644 --- a/html/index.php +++ b/html/index.php @@ -191,7 +191,7 @@ if (isset ($_REQUEST['reconnect']) && isset ($_REQUEST['backurl'])) { } echo ' -NOALYSS +NOALYSS
'. '

Noalyss

'. $goto . diff --git a/html/install.php b/html/install.php index 7e4ff5d8f..a01059dae 100644 --- a/html/install.php +++ b/html/install.php @@ -83,7 +83,7 @@

- NOALYSS + NOALYSS

NOALYSS : comptabilité - accountancy

diff --git a/html/js/card.js b/html/js/card.js index 428c38426..d5e334e9d 100644 --- a/html/js/card.js +++ b/html/js/card.js @@ -596,7 +596,8 @@ function fill_ipopcard(obj) if ( nTop > 300 ) { nTop=170; } - var str_top=fixed_position(250,nTop) + var str_top="top:"+calcy(nTop)+"px"; + var str_style=str_top+";width:45em;height:auto;position:absolute"; var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':false}; diff --git a/html/js/infobulle.js b/html/js/infobulle.js index 48ae712ae..bc5aa59a9 100644 --- a/html/js/infobulle.js +++ b/html/js/infobulle.js @@ -65,3 +65,51 @@ function displayBulle(p_comment) { d.style.left=posX+offsetX+"px"; d.style.visibility="visible"; } + +/** + * + * @param p_name + * @see select_box.class.php + */ +function displaySelectBox(p_name) { + try { + if (! document.getElementById("select_box_content") ) { + + var newDiv=new Element("div"); + newDiv.id="select_box_content"; + document.body.appendChild(newDiv); + newDiv.addClassName("select_box"); + $("select_box_content").onmouseleave=function() { + try { + var newDiv=$("select_box_content"); + newDiv.setStyle({display:"none"}); + } catch(e) { + alert(e.message); + } + } + } else { + var newDiv=document.getElementById("select_box_content"); + } + newDiv.innerHTML=$("select_box"+p_name).innerHTML; + var viewport = document.viewport.getDimensions(); + var locPosY=posY; + if ( posY+offsetY+ newDiv.getHeight() > window.innerHeight -3) { + locPosY-=newDiv.getHeight()+20 + } + newDiv.style.top=locPosY+"px"; + + newDiv.style.left=document.getElementById(p_name+"_bt").offsetLeft+"px"; + newDiv.setStyle({display:"block",position:"absolute","z-index":999}); + + if ( $("search_"+p_name+"_list") ) { + var sTmp = newDiv.innerHTML; + var regex=new RegExp(p_name+"_list","g"); + sTmp = sTmp.replace(regex,p_name+"_t_list"); + newDiv.innerHTML=sTmp; + $("search_"+p_name+"_t_list").focus(); + } + } catch(e) { + alert(e.message); + } + +} diff --git a/html/js/managetable.js b/html/js/managetable.js index b6f2795de..da5b8605f 100644 --- a/html/js/managetable.js +++ b/html/js/managetable.js @@ -74,7 +74,7 @@ var ManageTable = function (p_table_name) { this.callback = "ajax.php"; //!< File to call this.control = "dtr"; // p_max_size) {alert_box(content[78]);return false;} + return true; +} + +/** + * Check that the receipt file is not too big + * @see ajax_ledger.php , ledger_detail_file + * @param int p_max_size maximum size + * @param p_info name of the waiting box + * @returns true if file size is less than the maximum + */ +function check_receipt_size(p_max_size,p_info) +{ + document.getElementById(p_info).style.display="inline"; + console.debug ("param p_max_file_size"+p_max_size); + var f=document.getElementById("receipt_id"); + if ( f && f.files[0] && f.files[0].size > parseFloat(p_max_size)) { + document.getElementById("receipt_info_id").innerHTML=content[78]; + document.getElementById(p_info).style.display="none"; + return false; + } + document.getElementById("receipt_info_id").innerHTML=""; + document.getElementById("form_file").submit(); + return true; +} +/** + * @brief toggle size of a div : fullsize or normal + * + */ +function full_size(p_div) { + div_dom=document.getElementById(p_div); + if ( ! div_dom ) return; + if ( div_dom.hasClassName('fullsize')) { + div_dom.removeClassName('fullsize');$('size_'+p_div).innerHTML=''; + } else { + div_dom.addClassName('fullsize');$('size_'+p_div).innerHTML=''; + } + +} \ No newline at end of file diff --git a/html/style-classic7.css b/html/style-classic7.css index f0a07af50..8daac5e18 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -40,13 +40,13 @@ input{ font-family: 'OpenSansRegular'; padding : 2px; margin:2px; - border:solid 1px #4b4b91; + border:1px solid #4b4b91; font-size:14px; color:#4b4b91; } input:focus { - border:solid 1px orange; + border:1px solid orange; margin:1px; background-color: lightyellow; } @@ -64,7 +64,7 @@ table.sortable, table.table_large, table.result ,table.resultfooter { border-spacing: 1px; /*border-collapse:collapse; */ - border:1px #5D90CD solid; + border:1px solid #5D90CD; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; @@ -238,7 +238,7 @@ table.document th{ } table.mtitle { - border:0; + border:0px; text-align:center; /*! border-spacing: 0; */ } @@ -246,7 +246,7 @@ td.mshort { height:15px; width:60px; text-align:center; - border: 1px solid; + border: 1px solid transparent; color:#5D90CD ; background-color:#DDE6FF; } @@ -264,6 +264,7 @@ td.mtitle { border-bottom-left-radius: 0px; border-collapse: collapse; + background-color: #366497; } @media only screen and (max-width:1250px) { td.mtitle { @@ -278,16 +279,15 @@ td.mtitle { } } td.mtitle a.mtitle { - color : white; + color : lightblue; display:block; font-size:1rem; font-family:OpenSansRegular; - /*! width:100%; */ padding:0px; margin:0px; - height:100%; + height:42px; padding:4px 0px 0px 0px; - + border-radius:6px; } @media only screen and (max-width:1280px) { td.mtitle a.mtitle { @@ -353,7 +353,8 @@ td.selectedcell{ } } .menu2 td.mtitle ,.menu2 td.selectedcell{ - border-radius: 0px; + /*! border-radius: 0px; */ + border-radius: 4px; } @media only screen and (max-width:955px) { @@ -367,7 +368,7 @@ a.mtitle { text-decoration:none; display:inline; color: #0000FF; - pointer:cursor; + cursor: pointer; background-color: transparent; } a.mtitle:hover { @@ -511,18 +512,18 @@ a.document:hover { } .input_text_ro { - border:solid 1px #0000FF; + border:1px solid #0000FF; background:#EDEDED; color:#0000FF; margin:1px; } .input_text { - border:solid text #4b4b91; + border:1px solid #4b4b91; margin:1px; border-radius: 2px; } .input_text:focus { - border:solid 1px orange; + border:1px solid orange; margin:1px; background-color: lightyellow; } @@ -684,7 +685,7 @@ div.content div.pc_calendar tr{ } div.pc_calendar td{ width:14%; - border:#879ED4 solid 1px; + border:1px solid #879ED4 ; } div.pc_calendar td.weekend { @@ -753,7 +754,7 @@ a#anchorbutton:hover, .button:hover,a.button:hover,div.content a.button:hover { } a#smallanchorbutton, .smallbutton, a.smallbutton,div.content a.smallbutton { color:#FFFFFF; - font-weight: bold; + font-weight: normal; text-decoration:none; font-family: arial,verdana,sans-serif,helvetica; /*! background-image: url("image/bg-submit2.gif"); */ @@ -804,7 +805,7 @@ a#smallanchorbutton, .smallbutton, a.smallbutton,div.content a.smallbutton .butt font-family: SansationLight; } td.tool { - border: solid 1px gray; + border: 1px solid gray; background-color: #FFFFFF; border-bottom-width: 2px; text-align:center; @@ -819,7 +820,7 @@ td.tool { } } td.toolselected { - border: solid 1px gray; + border: 1px solid gray; color: #FFFFFF; border-bottom-width: 2px; text-align:center; @@ -922,7 +923,7 @@ div.inner_box { /*! -webkit-box-shadow: 10px 10px 5px #888; */ box-shadow: 15px 15px 15px #888; font-size:14.4px; -font-size:0.90rem; +font-size:0.9rem; } div.inner_box { width: 85%; @@ -930,7 +931,7 @@ div.inner_box { @media only screen and (min-width: 1281px) { div.inner_box { width: 85%; - /*! border-radius: 9px; */ + border-radius: 9px; /*! padding: 5px; */ } } @@ -1219,7 +1220,7 @@ div.foldercontent { font-size:0.95rem; width: 95%; margin-left: 2.5%; - margin-top:7%; + margin-top:5rem; } h1.title { @@ -1230,17 +1231,25 @@ h1.title { } h2.title { - color:#FFFFFF; + color:white; text-align:center; padding-top: 9px; margin-top: 0px; padding-bottom: 2px; - background-color: #366497; - font-size: 1.05rem; + background-color: #5681B7; + font-size: 1.1rem; height: 35px; vertical-align: middle; + border-bottom: white; + border-bottom-style: groove; + border-bottom-width: 2px; + font-style: normal; + font-stretch: normal; + font-variant-caps: all-small-caps; + font-family: OpenSansRegular; + margin-bottom: 1px; } h3.title { color: #0000FF; @@ -1262,7 +1271,7 @@ div.myfieldset margin-top: 5px; margin-left:5px; margin-right: 5px; - border:#EDF3FF 2px groove; + border:2px groove #EDF3FF ; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -1288,7 +1297,7 @@ div.menu2 a.mtitle{ /*color: darkblue;*/ padding:5px 0px; margin:0px; - border-radius: 5px; + /*! border-radius: 5px; */ } div.menu2 a.mtitle:hover,div.menu a.mtitle:hover,td.mtitle a.mtitle:hover { /* color:#5681B7; @@ -1300,11 +1309,11 @@ div.menu2 a.mtitle:hover,div.menu a.mtitle:hover,td.mtitle a.mtitle:hover { } div.menu2 a.mtitle:hover { - border-radius: 0px 0px; + /*! border-radius: 0px 0px; */ /*! padding: 5px; */ } div.menu2 table { - border-collapse: collapse; + border-collapse: separate; /*! border-spacing:1px; */ } div.menu3 { @@ -1334,14 +1343,14 @@ div.menu3 { font-size : 1.2em; }*/ textarea.itextarea{ - border:solid #0000FF 1px; + border:1px solid #0000FF ; width:90%; margin-left:5%; height:120px; } textarea.itextarea:focus { - border:solid 1px orange; + border:1px solid orange; background-color: lightyellow; } div#notice { @@ -1532,7 +1541,8 @@ td.workday ol { input.inum { text-align:right; border:1px solid #0000FF; - margin:2px + margin:2px; + border-radius: 2px; } div.box { background-color:#e4e7ed; @@ -1977,8 +1987,8 @@ td.box { right: 0px; visibility: hidden; opacity: 0; - background: rgba(0,0,0,.3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#90000000,endColorstr=#900000000); + background-color: rgba(0,0,0,.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#90000000,endColorstr=#90000000); } .smoke-base.smoke-visible { @@ -2217,7 +2227,7 @@ div.content a.arrow { * Select box : list of actions */ .select_box { - border:solid 0.5px darkblue; + border:0.5px solid darkblue; background:white; width:455px; max-width:250px; @@ -2256,8 +2266,9 @@ div.menu2 td.mtitle, div.menu2 td.mtitle a{ border-style: solid; border-width: 0.1px; border-color:white; - height:35px; + height:40px; border-radius: 4px 4px 4px 4px; + /*! padding: 5px; */ } div.menu2 td.mtitle a{ border-width:0px; @@ -2282,7 +2293,7 @@ div.menu2 td.mtitle a{ */ div.bxbutton .icon { - color:white; + /*! color:white; */ text-decoration:none; margin-left: 6px; margin-right:6px; @@ -2292,6 +2303,8 @@ div.bxbutton .icon cursor: pointer; border:0px; height: 18px; + color: #f0d19a; + font-size: 87%; } div.bxbutton .icon:hover { @@ -2488,7 +2501,6 @@ p.info { /* Cell with tag */ span.tagcell { border-radius:3px; - border:1px solid darkblue; padding:3px;margin:1px; display: inline-block; } @@ -2655,3 +2667,23 @@ span.tagcell { padding: 0.25em 1em 0.25em 1em; font-family: bold; } +/** + * set a element full size + */ +.fullsize { + width:100% !important; + height: 100% !important; + overflow:auto !important; + top:0px !important; + position:fixed !important; + left:0px !important; +} + + /********************************************* + * If a input is incorrect + */ + .input-error { + border:1px dotted red !important; + color:darkred !important; + + } \ No newline at end of file diff --git a/html/test.php b/html/test.php index d8b890a74..bdd2ef980 100644 --- a/html/test.php +++ b/html/test.php @@ -38,12 +38,12 @@ require_once('lib/icon_action.class.php'); require_once ('lib/function_javascript.php'); require_once 'class/user.class.php'; require_once NOALYSS_INCLUDE.'/lib/http_input.class.php'; - +html_page_start(); global $http; $http=new HttpInput(); -load_all_script(); + $gDossier=$http->request('gDossier',"number", -1); if ($gDossier==-1) { @@ -64,7 +64,7 @@ if (!file_exists('authorized_debug')) exit(); } define('ALLOWED', 1); -html_page_start("Classic"); +load_all_script(); /******************************************************************************************************************/ /* Utilities /******************************************************************************************************************/ diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 4e568e55d..9c5a25e47 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -225,7 +225,8 @@ if ($sub_action == 'detail') if ($g_user->can_write_action($ag_id) == true) { - echo ''; + printf( '',MAX_FILE_SIZE); echo $supl_hidden; echo HtmlInput::hidden('ac', $http->request('ac')); echo dossier::hidden(); diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php index 3c0e86d57..809ac727e 100644 --- a/include/ajax/ajax_card.php +++ b/include/ajax/ajax_card.php @@ -110,14 +110,23 @@ switch($op2) case 'dc': $f=new Fiche($cn); /* add title + close */ - $html=HtmlInput::title_box(_("Détail fiche"), $ctl,"close","","y"); - + $qcode=$http->request("qcode","string",false); // if there is no qcode then try to find it thanks the card id - if ( ! isset ($qcode) ){ - $f->id=$http->get("f_id","number"); + if ( $qcode == false ){ + $f->id=$http->get("f_id","number","0"); + if ( $f->id==0) { + $html=HtmlInput::title_box(_("Fiche"), $ctl,"close","","y"); + $html.='

'._('Aucune fiche demandée').'

'; + break; + } $qcode=$f->get_quick_code(); + } else { + $f->get_by_qcode($qcode); + } - + $title=$f->getLabelCategory(); + $html=HtmlInput::title_box($title, $ctl,"close","","y"); + // after save , we can either show a card in readonly or update a row $safter_save=$http->request("after_save","string","1"); switch ($safter_save) @@ -134,22 +143,21 @@ case 'dc': break; } - if ( $qcode != '') + if ( $qcode != null) { - $f->get_by_qcode($qcode); - $can_modify=$g_user->check_action(FIC); - if ( isset($ro) ) - { - $can_modify=0; - } - if ( $can_modify==1) - $card=$f->Display(false,$ctl); - else - $card=$f->Display(true); - if ( $card == 'FNT' ) - { - $html.='

'._('Fiche non trouvée').'

'; - } + $can_modify=$g_user->check_action(FIC); + if ( isset($ro) ) + { + $can_modify=0; + } + if ( $can_modify==1) + $card=$f->Display(false,$ctl); + else + $card=$f->Display(true); + if ( $card == 'FNT' ) + { + $html.='

'._('Fiche non trouvée').'

'; + } else { @@ -192,11 +200,11 @@ case 'dc': case 'bc': if ( $g_user->check_action(FICADD)==1 || $g_user->check_action(FIC)==1) { - $r=HtmlInput::title_box(_("Nouvelle fiche"), $ctl); - /* get cat. name */ - $cat_name=$cn->get_value('select fd_label from fiche_def where fd_id=$1', + /* get cat. name */ + $cat_name=$cn->get_value('select fd_label from fiche_def where fd_id=$1', array($fd_id)); - $f=new Fiche($cn); + $r=HtmlInput::title_box($cat_name, $ctl); + $f=new Fiche($cn); $r.=''; $r.=dossier::hidden(); $r.=(isset($ref))?HtmlInput::hidden('ref',1):''; diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index 40cd7c486..d9ac3ec99 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -224,8 +224,7 @@ case 'file': $obj=$op->get_quant(); /* return an obj. ACH / FIN or VEN or null if nothing is found*/ $repo = new Database(); - $theme = $repo->get_value("select the_filestyle from theme where the_name=$1", array($_SESSION[SESSION_KEY.'g_theme'])); - html_min_page_start($theme); + html_min_page_start($_SESSION[SESSION_KEY.'g_theme']); // if there is a receipt document if ( $obj->det->jr_pj_name=='') @@ -238,7 +237,9 @@ case 'file': } if ( $access=='W') { - echo ''; + $check_receipt=sprintf("check_receipt_size('%s','file%s')", + MAX_FILE_SIZE,$div); + echo ''; $sp=new ISpan('file'.$div); $sp->style="display:none;background-color:red;color:white;font-size:12px"; @@ -248,8 +249,10 @@ case 'file': echo dossier::hidden(); echo HtmlInput::hidden('jr_id',$jr_id); echo HtmlInput::hidden('div',$div); + echo ''; + + echo '

'; - echo ''; echo '
'; } else @@ -285,17 +288,20 @@ case 'file': { // Not possible to remove the file thanks a modal dialog box, // because of the frameset - $x=sprintf(''."x".'', - $gDossier,$div,$jr_id); - + + $x=Icon_Action::trash(uniqid(), + sprintf("if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}", + $gDossier,$div,$jr_id)); + } $filename= $obj->det->jr_pj_name; - if ( strlen($obj->det->jr_pj_name) > 20 ) + if ( strlen($obj->det->jr_pj_name) > 60 ) { - $filename=mb_substr($obj->det->jr_pj_name,0,23); + $filename=mb_substr($obj->det->jr_pj_name,0,60); } echo HtmlInput::show_receipt_document($jr_id,h($filename)); echo $x; + echo '

'; echo ''; echo ''; exit(); @@ -314,29 +320,24 @@ case 'loadfile': // Show a link to the new file $op->get(); $obj=$op->get_quant(); /* return an obj. ACH / FIN or VEN or null if nothing is found*/ - - echo ""; - $repo=new Database(); - $theme=$repo->get_value("select the_filestyle from theme where the_name=$1",array($_SESSION[SESSION_KEY.'g_theme'])); - echo " "; - echo ""; + html_min_page_start($_SESSION[SESSION_KEY.'g_theme']); if ( ! isset($_REQUEST['ajax']) ) echo ""; else echo ""; - echo "

"._("Document")."

"; echo '
'; - + $x=""; // check if the user can remove a document if ($g_user->check_action (RMRECEIPT) == 1) { // Not possible to remove the file thanks a modal dialog box, // because of the frameset - $x=sprintf(''.SMALLX.'', - $gDossier,$div,$jr_id); - echo $x; + $x=Icon_Action::trash(uniqid(), + sprintf("if (confirm(content[47])) {document.location.href='ajax_misc.php?op=ledger&gDossier=%d&div=%s&jr_id=%s&act=rmf'}", + $gDossier,$div,$jr_id)); } $filename= $obj->det->jr_pj_name; echo HtmlInput::show_receipt_document($jr_id,h($filename)); + echo $x; echo '
'; - + echo ''; } exit(); ///////////////////////////////////////////////////////////////////////////// @@ -345,16 +346,14 @@ case 'loadfile': case 'rmf': if ( $access == 'W' && $g_user->check_action (RMRECEIPT) == 1) { - echo ""; $repo=new Database(); - $theme=$repo->get_value("select the_filestyle from theme where the_name=$1",array($_SESSION[SESSION_KEY.'g_theme'])); - echo " "; - echo ""; - echo "

"._("Document")."

"; + html_min_page_start($_SESSION[SESSION_KEY.'g_theme']); echo '
'; + $check_receipt=sprintf("check_receipt_size('%s','file%s')", + MAX_FILE_SIZE,$div); echo '
'; $sp=new ISpan('file'.$div); - $sp->style="display:none;width:155;height:15;background-color:red;color:white;font-size:10"; + $sp->style="display:none;width:155px;height:15px;background-color:red;color:white;font-size:10px"; $sp->value=_("Chargement"); echo $sp->input(); @@ -363,7 +362,8 @@ case 'rmf': echo HtmlInput::hidden('jr_id',$jr_id); echo HtmlInput::hidden('div',$div); - echo ''; + echo ''; + echo '

'; echo '
'; $ret=$cn->exec_sql("select jr_pj from jrn where jr_id=$1",array($jr_id)); if (Database::num_row($ret) != 0) diff --git a/include/ajax/ajax_search_filter.php b/include/ajax/ajax_search_filter.php index c27458f11..dbf010956 100644 --- a/include/ajax/ajax_search_filter.php +++ b/include/ajax/ajax_search_filter.php @@ -213,6 +213,7 @@ if ($op=="delete_search_operation") if ($op=='display_filter_tag') { $tag=$http->request("uf_tag"); + if ( trim($tag)=="") {return;} $div=$http->request("div"); $aTag=explode(',', $tag); if (is_array($aTag)) diff --git a/include/anc_great_ledger.inc.php b/include/anc_great_ledger.inc.php index cfec33656..da412775f 100644 --- a/include/anc_great_ledger.inc.php +++ b/include/anc_great_ledger.inc.php @@ -10,7 +10,7 @@ if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); echo '
'; global $http; require_once NOALYSS_INCLUDE.'/class/anc_grandlivre.class.php'; - +$cn=Dossier::connect(); $grandLivre=new Anc_Grandlivre($cn); $grandLivre->get_request(); @@ -35,18 +35,25 @@ if ($result != null) echo _('Tout sélectionner')." ".ICheckBox::toggle_checkbox('export_pdf_bt1','export_anc_receipt_pdf'); echo ''; $task_id=uniqid(); - echo $grandLivre->show_button(); - printf ('
', - $task_id, - _("Le traitement est en cours , merci de patienter sans recharger la page") - ); + echo $grandLivre->button_export_csv(); + printf ('', + $task_id, + _("Le traitement est en cours , merci de patienter sans recharger la page") + ); echo HtmlInput::hidden("task_id",$task_id); + $type_pdf=new Select_Box("type_pdf",_("Type export PDF")); + $type_pdf->add_value(_("Un seul PDF"),1); + $type_pdf->add_value(_("Un PDF par opération"),2); + $type_pdf->set_position("in-absolute"); + echo $type_pdf->input(); + echo $grandLivre->button_export_pdf(); echo $grandLivre->display_html(); - echo $grandLivre->button_export_pdf(); echo HtmlInput::get_to_hidden(array('ac','gDossier','sa')); + echo $grandLivre->button_export_pdf(); echo '
'; - echo $grandLivre->show_button(); + echo $grandLivre->button_export_csv(); ?> "; + include_once NOALYSS_INCLUDE.'/lib/message_javascript.php'; echo ' '; @@ -523,15 +525,23 @@ function ShowItem($p_array, $p_dir='V', $class="mtitle", $class_ref="mtitle", $d $title = ""; $set = "XX"; if (isset($href[2])) - $title = $href[2]; - if (isset($href[3])) - $set = $href[3]; + { + $title=$href[2]; + } + if (isset($href[3])) + { + $set=$href[3]; + } - if ($set == $default) - $ret.='' . $href[1] . ''; - else - $ret.='' . $href[1] . ''; - } + if ($set==$default) + { + $ret.=''.$href[1].''; + } + else + { + $ret.=''.$href[1].''; + } + } } //direction Horizontal else if ($p_dir == 'H') @@ -686,13 +696,17 @@ function sql_filter_per($p_cn, $p_from, $p_to, $p_form='p_id', $p_field='jr_tech throw new Exception("SFP2"._("Date invalide")); } } - if ($p_from == $p_to) - $periode = " $p_field = (select p_id from parm_periode " . - " where " . - " p_start = to_date('$p_from','DD.MM.YYYY')) "; + if ($p_from==$p_to) + { + $periode=" $p_field = (select p_id from parm_periode ". + " where ". + " p_start = to_date('$p_from','DD.MM.YYYY')) "; + } else - $periode = "$p_field in (select p_id from parm_periode " . - " where p_start >= to_date('$p_from','DD.MM.YYYY') and p_end <= to_date('$p_to','DD.MM.YYYY')) "; + { + $periode="$p_field in (select p_id from parm_periode ". + " where p_start >= to_date('$p_from','DD.MM.YYYY') and p_end <= to_date('$p_to','DD.MM.YYYY')) "; + } return $periode; } @@ -710,7 +724,9 @@ function alert($p_msg, $buffer=false) $r.= ''; if ($buffer) - return $r; + { + return $r; + } echo $r; } @@ -720,14 +736,23 @@ function alert($p_msg, $buffer=false) function set_language() { // desactivate local check - if ( defined("LOCALE") && LOCALE==0 ) return; - if ( ! isset ($_SESSION[SESSION_KEY.'g_lang'])) return; - + if (defined("LOCALE")&&LOCALE==0) + { + return; + } + if (!isset($_SESSION[SESSION_KEY.'g_lang'])) + { + return; + } + /* * If translation is not supported by current */ - if (! function_exists("bindtextdomain")) return; - + if (!function_exists("bindtextdomain")) + { + return; + } + $dir = ""; // set differently the language depending of the operating system if (what_os() == 1) @@ -1155,6 +1180,7 @@ function display_menu($p_menuid) } tracedebug("'menu", $file[0]['me_file'],__FUNCTION__.__LINE__."line"); tracedebug("'menu", $file[0]['me_parameter'],__FUNCTION__.__LINE__."parm "); + if ( DEBUG ) { echo $file[0]['me_file']," param : ",$file[0]['me_parameter'] ;} /* * Log the file we input to put in the folder test-noalyss for replaying it */ diff --git a/include/lib/data_sql.class.php b/include/lib/data_sql.class.php index ac5e6d94f..2fe0698b6 100644 --- a/include/lib/data_sql.class.php +++ b/include/lib/data_sql.class.php @@ -27,13 +27,13 @@ /** * @brief this an abstract class , all the SQL class, like noalyss_sql (table), - * Acc_Plan_SQL (based on a SQL not a table). + * Acc_Plan_SQL (based on a SQL not a table) or a view. * * You must create a class extending this one, in the constructor * these variables have to be defined * * - table = name of the view or empty - * - select = name of the select + * - sql = sql statement * - name = array of column name, match between logic and actual name * - type = array , match between column and type of data * - default = array of column with a default value diff --git a/include/lib/database_core.class.php b/include/lib/database_core.class.php index 2f7bc3246..d7d5cb65b 100644 --- a/include/lib/database_core.class.php +++ b/include/lib/database_core.class.php @@ -956,6 +956,24 @@ class DatabaseCore static function nb_column($p_ret) { return pg_num_fields($p_ret); } + /** + * FInd if a SQL Select has a SQL stmt to inject or damage Data + * When a SELECT SQL string is build, this string could contain a SQL attempt to damage data, + *so the statement DELETE TRUNCATE ... are forbidden. Throw an exception EXC_INVALID + * + */ + function search_sql_inject($p_sql) + { + $forbid_sql=array("update","delete","truncate","insert"); + // protect against SQL inject + foreach ($forbid_sql as $forbid_key) { + if (stripos($p_sql,$forbid_key) !== false) + { + throw new Exception(_("Possible SQL inject",EXC_INVALID)); + } + + } + } } diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index e43c0ff53..3ed7595fc 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -837,7 +837,7 @@ class HtmlInput * @return type */ static function title_box($p_name, $p_div, $p_mod="close", $p_js="", - $p_draggable="n") + $p_draggable="n",$p_enlarge='n') { $p_div=strip_tags($p_div); $r='
'; @@ -847,6 +847,9 @@ class HtmlInput { $r.=Icon_Action::draggable($p_div); } + if ( $p_enlarge=='y') { + $r.=Icon_Action::full_size($p_div); + } if ($p_mod=='close') { $r.=Icon_Action::close($p_div, $p_js); diff --git a/include/lib/icard.class.php b/include/lib/icard.class.php index f1dc2367f..e0c171d88 100644 --- a/include/lib/icard.class.php +++ b/include/lib/icard.class.php @@ -120,7 +120,45 @@ require_once NOALYSS_INCLUDE.'/lib/function_javascript.php'; class ICard extends HtmlInput { - + //!< $fct ,by default it is update_value called BEFORE the querystring is send + var $fct; + + //!< $dblclick action if double click + var $dblclick; + + //!< $callback , + var $callback; + + //!< $choice + var $choice; + + //!< $indicator, text displaid when searching + var $indicator; + + //!< $choice_create 1 , display a (+) button , default 1 + var $choice_create; + + //!< $autocomplete : 1 enable - 0 disable + var $autocomplete; + + //!< $style supplemental CSS + var $style=' '; + + //!< $accvis account_visible =1 otherwise 0, default 1 + var $accvis; + + //!< $limit Max of row show + var $limit; + + //!< $amount_from_type : accountancy , sell or purchase price + var $amount_from_type; + + //!< $typecard : type of card + var $typecard; + + //!< $autocomplete_file , ajax file used for autocompletion (see Ajax.Autocompleter) + private $autocomplete_file; + function __construct($name="", $value="", $p_id="") { parent::__construct($name, $value); @@ -137,6 +175,8 @@ class ICard extends HtmlInput $this->accvis=1; //!< account_visible =1 otherwise 0 $this->limit=12; //!< Max of row show $this->amount_from_type=''; //!< in the follow up ,when a card is selected you take Prix Vente or Prix Achat + $this->typecard='all'; + $this->autocomplete_file="fid_card.php"; } /** @@ -155,7 +195,8 @@ class ICard extends HtmlInput } - /**\brief set the javascript callback function + /** + * \brief set the javascript callback function * by default it is update_value called BEFORE the querystring is send * * \param $p_name callback function name @@ -256,12 +297,12 @@ class ICard extends HtmlInput $query=http_build_query([ 'gDossier'=>Dossier::id(),'e'=>$this->typecard,'limit'=>$this->limit]); - $javascript=sprintf('try { new Ajax.Autocompleter("%s","%s","fid_card.php?%s",'. + $javascript=sprintf('try { new Ajax.Autocompleter("%s","%s","%s?%s",'. '{paramName:"FID",minChars:1,indicator:%s, '. 'callback:%s, '. 'limit:%s,'. ' afterUpdateElement:%s});} catch (e){alert(e.message);};', - $this->id, $this->choice, $query, $this->indicator, + $this->id, $this->choice, $this->autocomplete_file,$query, $this->indicator, $this->callback, $this->limit, $this->fct); $javascript=create_script($javascript.$this->dblclick); diff --git a/include/lib/icon_action.class.php b/include/lib/icon_action.class.php index eef3a58a4..a1dab5910 100644 --- a/include/lib/icon_action.class.php +++ b/include/lib/icon_action.class.php @@ -368,26 +368,34 @@ class Icon_Action if ( $p_value == 0 ) { return \Icon_Action::iconoff($p_id, $p_javascript,$p_style);} } - static function checked ($p_id,$p_javascript="") { + static function checked ($p_id,$p_javascript="",$p_classrange="") { $lock_cur=""; - - $r=sprintf( '%s', + $r=sprintf( '%s', $p_id, $p_javascript, + $p_classrange, $lock_cur); return $r; } - static function unchecked ($p_id,$p_javascript="") { + static function unchecked ($p_id,$p_javascript="",$p_classrange="") { $lock_cur=""; - $r=sprintf( '%s', + $r=sprintf( '%s', $p_id, $p_javascript, + $p_classrange, $lock_cur); return $r; } - static function checkbox ($p_id,$p_javascript="",$p_value=0) { - if ( $p_value == 0 ) { return \Icon_Action::checked($p_id, $p_javascript); } - if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id, $p_javascript);} + static function checkbox ($p_id,$p_javascript="",$p_value=0,$p_classrange="") { + if ( $p_value == 0 ) { return \Icon_Action::checked($p_id, $p_javascript,$p_classrange); } + if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id, $p_javascript,$p_classrange);} + } + static function full_size($p_div) { + $js=sprintf("full_size('%s')",$p_div); + $icon=""; + $r=sprintf('%s', + $p_div,$js,$icon); + return $r; } } diff --git a/include/lib/idate.class.php b/include/lib/idate.class.php index 8eab4fdbc..7d9d8a322 100644 --- a/include/lib/idate.class.php +++ b/include/lib/idate.class.php @@ -132,7 +132,7 @@ class IDate extends HtmlInput return $this->display(); if ($this->id=="") $this->id=self::generate_id($this->name); $autofocus=($this->autofocus)?" autofocus ":""; - + $onchange='onchange="format_date(this)"'; $r=sprintf(' - ',$this->name,$this->id,$this->value,$this->placeholder,$this->title,$this->id + ',$this->name,$this->id,$this->value,$this->placeholder,$this->title, + $onchange, + $this->id ); // @see calendar-setup.js $r.=sprintf(' diff --git a/include/lib/select_box.class.php b/include/lib/select_box.class.php index 85b768b09..d3a0088f5 100644 --- a/include/lib/select_box.class.php +++ b/include/lib/select_box.class.php @@ -109,109 +109,14 @@ class Select_Box switch ($this->position) { case 'absolute': - // Show when click - $javascript=sprintf(' - $("%s_bt").onclick=function() { - try { - - - if (! document.getElementById("select_box%s") ) { - - var newDiv=new Element("div"); - newDiv.id="select_box%s"; - document.body.appendChild(newDiv); - newDiv.addClassName("select_box"); - $("select_box%s").onmouseleave=function() { - try { - var newDiv=$("select_box%s"); - newDiv.setStyle({display:"none"}); - } catch(e) { - alert(e.message); - } - } - } else { - var newDiv=document.getElementById("select_box%s"); - } - newDiv.innerHTML=$("select_box%s").innerHTML; - var pos=$("%s_bt").cumulativeOffset(); - var nTop=pos.top; - var viewport = document.viewport.getDimensions(); - if ( nTop> viewport.height-newDiv.getHeight()-20) { nTop-=newDiv.getHeight()-5} - - newDiv.setStyle({display:"block",position:"absolute",top:nTop+"px",left:pos.left+5+"px","z-index":999}); - - if ( $("search_%s") ) { $("search_%s").focus();} - } catch(e) { - alert(e.message); - } - } - ', $this->id, $this->id, $this->id,$this->id, $this->id, $this->id, $this->id, $this->id, $list_id, $list_id); - - break; case "normal": - - // Show when click - $javascript=sprintf('$("%s_bt").onclick=function() { - try { - var newDiv=$("select_box%s"); - var pos=$("%s_bt").cumulativeOffset(); - newDiv.setStyle({display:"block",position:"fixed",top:pos.top+25+"px",left:pos.left+5+"px"}); - - if ( $("search_%s") ) { $("search_%s").focus();} - - } catch(e) { - alert(e.message); - } - } - ', $this->id, $this->id, $this->id, $list_id, $list_id); - // Hide when out of the zone - $javascript.=sprintf('$("select_box%s").onmouseleave=function() { - try { - var newDiv=$("select_box%s"); - newDiv.setStyle({display:"none"}); - } catch(e) { - alert(e.message); - } - }', $this->id, $this->id); - break; case "in-absolute": // Show when click $javascript=sprintf(' $("%s_bt").onclick=function() { - try { - - - if (! document.getElementById("select_box_content") ) { - - var newDiv=new Element("div"); - newDiv.id="select_box_content"; - document.body.appendChild(newDiv); - newDiv.addClassName("select_box"); - $("select_box_content").onmouseleave=function() { - try { - var newDiv=$("select_box_content"); - newDiv.setStyle({display:"none"}); - } catch(e) { - alert(e.message); - } - } - } else { - var newDiv=document.getElementById("select_box_content"); - } - newDiv.innerHTML=$("select_box%s").innerHTML; - var pos=$("%s_bt").cumulativeOffset(); - var nTop=pos.top; - var viewport = document.viewport.getDimensions(); - if ( nTop> viewport.height-newDiv.getHeight()-20) { nTop-=newDiv.getHeight()-5} - - newDiv.setStyle({display:"block",position:"absolute",top:nTop+"px",left:pos.left+5+"px","z-index":999}); - - if ( $("search_%s") ) { $("search_%s").focus();} - } catch(e) { - alert(e.message); - } + displaySelectBox("%s"); } - ', $this->id, $this->id, $this->id, $list_id, $list_id); + ', $this->id, $this->id); break; @@ -228,12 +133,13 @@ class Select_Box // Show when click $javascript=$this->compute_position(); - - // display the button - printf('', $this->id, $this->value); - printf('', $this->id, $this->id, $this->default_value); - printf('
', $this->id, $this->style_box); + printf('', + $this->id, $this->value); + printf('', + $this->id, $this->id, $this->default_value); + printf('
', + $this->id, $this->style_box); // Show the filter if there is one, if ($this->filter!="") diff --git a/include/operation_ods_confirm.inc.php b/include/operation_ods_confirm.inc.php index e29348e5a..666d7059a 100644 --- a/include/operation_ods_confirm.inc.php +++ b/include/operation_ods_confirm.inc.php @@ -71,6 +71,7 @@ echo $ledger->confirm($_POST,false);

diff --git a/include/template/detail-action.php b/include/template/detail-action.php index b9ba1461c..9d59d6851 100644 --- a/include/template/detail-action.php +++ b/include/template/detail-action.php @@ -62,12 +62,25 @@ $uniq=uniqid("tab",TRUE); ?> +dt_id)):?> + + + + + + + input(); ?> - ag_id > 0 && Document_Option::is_enable_contact_multiple($this->dt_id)): ?> +ag_id > 0 && Document_Option::is_enable_contact_multiple($this->dt_id)): + ?> @@ -484,6 +497,11 @@ try { docAdded=document.getElementById('add_file'); new_element=document.createElement('li'); new_element.innerHTML=' '; + + new_element.innerHTML+='" onclick="document.getElementById(\'add_file\').removeChild(this.parentNode)" class="icon">'; + + + docAdded.appendChild(new_element); } catch(exception) { alert(''); alert(exception.message);} @@ -498,6 +516,10 @@ catch(exception) { alert(' ?> + diff --git a/include/template/ledger_detail_bottom.php b/include/template/ledger_detail_bottom.php index 3675ad2d1..fd22f8b40 100644 --- a/include/template/ledger_detail_bottom.php +++ b/include/template/ledger_detail_bottom.php @@ -14,7 +14,7 @@ require_once NOALYSS_INCLUDE."/lib/select_box.class.php"; $select_box=new \Select_Box("sb_".$jr_id, _("Autre action")); -$select_box->set_position("in-absolute"); +$select_box->set_position("normal"); $cn=Dossier::connect(); // Contains all the linked actions $a_followup = Follow_Up::get_all_operation($jr_id); diff --git a/include/template/letter_all.php b/include/template/letter_all.php index 32f4e867e..6f51bf237 100644 --- a/include/template/letter_all.php +++ b/include/template/letter_all.php @@ -10,7 +10,7 @@ global $g_failed; if ( count($this->content) == 0 ) : ?> -

+

diff --git a/include/template/letter_prop.php b/include/template/letter_prop.php index 558cff0f4..6489cee4d 100644 --- a/include/template/letter_prop.php +++ b/include/template/letter_prop.php @@ -8,7 +8,7 @@ require_once NOALYSS_INCLUDE.'/class/acc_reconciliation.class.php'; $gDossier=dossier::id(); if ( count($this->content) == 0 ) : ?> -

+

@@ -71,7 +71,7 @@ $url=$a_request[0].'/'.$a_request[1]; } $url.='/'.$amenu[$i]['me_code']; - if ($url == $access_code ) $class="selectedcell"; + if ($url == $access_code ) $class="mtitle selectedcell"; $url="do.php?gDossier=".Dossier::id()."&ac=".$url; } diff --git a/scenario/HtmlInput.test.php b/scenario/HtmlInput.test.php index 794771e23..0a0c1e02f 100644 --- a/scenario/HtmlInput.test.php +++ b/scenario/HtmlInput.test.php @@ -92,12 +92,15 @@ $http=new HttpInput(); for ($i = 0 ; $i < 10 ; $i ++) : echo '
  • '; $check[$i]=new InputCheckBox("check[]",1,"checkid".$i); + $check[$i]->classrange="improvechkbox"; echo $i, " - name = ",$check[$i]->value_container,",id = " , $check[$i]->id_icon,$check[$i]->input(); + echo '
  • '; endfor; ?> - + +

    Submit

             echo HtmlInput::submit("submit", _("Envoi"));
    @@ -125,6 +128,54 @@ $http=new HttpInput();
         ?>
         
     
    +

    + Fichier - IFile +

    +
    + +id="file_to_upload"; + echo "fichier ",$file->input(); + + echo HtmlInput::submit("file","Upload"); +?> +

    Vérifier le changement de taille fichier dans la console JS

    +
    + + +

    ICArd

    +

    Aucun param suppl.

    +input(); + echo $icard->search(); +?> +
    \ No newline at end of file diff --git a/scenario/icon_actionTest.php b/scenario/icon_actionTest.php index 35c33a98c..c9037a14d 100644 --- a/scenario/icon_actionTest.php +++ b/scenario/icon_actionTest.php @@ -83,4 +83,9 @@ include_once NOALYSS_INCLUDE."/lib/icon_action.class.php";

    Comment +

    +

    +

    + enlarge +

    \ No newline at end of file diff --git a/scenario/inplace_edit.test.php b/scenario/inplace_edit.test.php index aa5261aae..ff67b7d00 100644 --- a/scenario/inplace_edit.test.php +++ b/scenario/inplace_edit.test.php @@ -23,7 +23,7 @@ if (!defined('ALLOWED')) die('Appel direct ne sont pas permis'); //@description:Test the class Inplace_Edit , ajax and javascript - +$db=Dossier::connect(); require_once NOALYSS_INCLUDE . '/lib/itext.class.php'; require_once NOALYSS_INCLUDE . '/lib/inum.class.php'; @@ -44,13 +44,9 @@ if (!isset($_REQUEST["TestAjaxFile"])) { echo "TEXT #".$ajax_hello->input()."#"; $select = new ISelect ("ajax_select"); + $select->value=$db->make_array("select fd_id,fd_label from fiche_def order by 2"); $select->id=uniqid("sel"); - $select->value=[ - ["value"=>1,"label"=>"ONE"], - ["value"=>2,"label"=>"TWO"], - ["value"=>3,"label"=>"THREE"], - ]; - $select->selected="2"; + $select->selected="10001"; $ajax_select = new Inplace_Edit($select); $ajax_select->set_callback("ajax_test.php"); $ajax_select->add_json_param("TestAjaxFile", __FILE__) ; diff --git a/scenario/select-box-test.php b/scenario/select-box-test.php index d9dc0a916..a739d0213 100644 --- a/scenario/select-box-test.php +++ b/scenario/select-box-test.php @@ -3,16 +3,47 @@