phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r5382 - in phpcompta/trunk: html html/js include sql


From: phpcompta-dev
Subject: [Phpcompta-dev] r5382 - in phpcompta/trunk: html html/js include sql
Date: Sat, 14 Sep 2013 10:44:39 +0200 (CEST)

Author: danydb
Date: 2013-09-14 10:44:37 +0200 (Sat, 14 Sep 2013)
New Revision: 5382

Added:
   phpcompta/trunk/include/ajax_navigator.php
Removed:
   phpcompta/trunk/include/navigator.inc.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/pref.inc.php
   phpcompta/trunk/sql/upgrade.sql
Log:
Ajout du navigateur : amelioration, dans fenetre interieure

Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php  2013-09-13 22:56:44 UTC (rev 5381)
+++ phpcompta/trunk/html/ajax_misc.php  2013-09-14 08:44:37 UTC (rev 5382)
@@ -574,6 +574,9 @@
        case 'minrow':
                require_once 'ajax_min_row.php';
                break;
+        case 'navigator':
+                require_once 'ajax_navigator.php';
+                break;
        default:
                var_dump($_GET);
 }

Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js  2013-09-13 22:56:44 UTC (rev 5381)
+++ phpcompta/trunk/html/js/scripts.js  2013-09-14 08:44:37 UTC (rev 5382)
@@ -1795,4 +1795,41 @@
 function info_hide()
 {
                $('info_div').style.display="none";
+}
+/**
+ * Show the navigator in a internal window
+ * @returns {undefined}
+ */
+function ask_navigator() {
+    try {
+        waiting_box();
+        removeDiv('navi_div')
+       var p_dossier=$('gDossier').value;
+        var queryString="gDossier="+p_dossier+"&op=navigator";
+       var action = new Ajax.Request(
+                                 "ajax_misc.php" ,
+                                 {
+                                     method:'get', parameters:queryString,
+                                     onFailure:ajax_misc_failure,
+                                     onSuccess:function(req){
+                                               remove_waiting_box();
+                                                
add_div({id:'navi_div',style:'top:2em;left:2em;width:90%',cssclass:'inner_box'});
+                                               
$('navi_div').innerHTML=req.responseText;
+                                                try
+                                                {
+                                                    
req.responseText.evalScripts();
+                                                    
sorttable.makeSortable($("navi_tb"));
+                                                }
+                                                catch(e)
+                                                {
+                                                    alert("answer_box 
Impossible executer script de la reponse\n"+e.message);
+                                                }
+
+                                     }
+                                 }
+                                 );
+    } catch (e) {
+        info_message(e.getMessage);
+    }
+    
 }
\ No newline at end of file

Copied: phpcompta/trunk/include/ajax_navigator.php (from rev 5381, 
phpcompta/trunk/include/navigator.inc.php)
===================================================================
--- phpcompta/trunk/include/ajax_navigator.php                          (rev 0)
+++ phpcompta/trunk/include/ajax_navigator.php  2013-09-14 08:44:37 UTC (rev 
5382)
@@ -0,0 +1,92 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/* $Revision: 5380 $ */
+
+// Copyright Author Dany De Bontridder address@hidden
+if ( ! defined ('ALLOWED')) die('Appel direct ne sont pas permis');
+echo HtmlInput::title_box("Navigateur", "navi_div");
+$sql="
+    select code, 
me_code,me_description,coalesce(me_description_etendue,me_description) as 
me_description_etendue,v1menu,v2menu,v3menu,p_type_display
+    from 
+    v_menu_description
+    where user_name=$1
+    order by 2 ";
+
+$a_menu=$cn->get_array($sql,array($_SESSION['g_user']));
+
+?>
+<div class="content">
+    <p>
+        Vous permet d'accèder rapidement au menu qui vous intéresse, utiliser 
le filtre pour trouver plus rapidement
+    </p>
+    <p style='margin-left: 5%'>
+    Filtre : <?php
+    echo HtmlInput::filter_table("navi_tb", "1,2", '1');
+    ?>
+    </p>
+    <table id="navi_tb" class="sortable" style="width:90%;margin-left: 
5%;border-spacing:0em 0.50em;border-collapse: separate">
+        <tr>
+            <th class='sorttable_sorted'>
+                Code AD 
+                <?php echo HtmlInput::infobulle(34); ?>
+                <span 
id="sorttable_sortfwdind">&nbsp;&blacktriangledown;</span>
+            </th>
+            <th>
+                Chemin
+                <?php echo HtmlInput::infobulle(35); ?>
+            </th>
+            <th>
+                Description complète
+            </th>
+        </tr>
+<?php 
+$nMax=count($a_menu);
+$url="do.php?gDossier=".dossier::id();
+for ($i=0;$i<$nMax;$i++):
+?>
+        <tr>
+            <td>
+                <a class='mtitle' style='text-decoration: underline' 
href="<?php echo $url."&ac=".$a_menu[$i]['code']; ?>" target='_blank'>
+                <?php echo $a_menu[$i]['me_code'];               ?>
+                </a>
+            </td>
+            <td>
+                <a class='mtitle' style='text-decoration: underline' 
href="<?php echo $url."&ac=".$a_menu[$i]['code']; ?>">
+                <?php
+                $path=$a_menu[$i]['v3menu'];
+                $path.=$a_menu[$i]['v2menu'];
+                $path.=$a_menu[$i]['v1menu'];
+                echo $path;
+                ?>
+                </a>
+            </td>
+            <td>
+                <?php if ($a_menu[$i]['p_type_display'] == 'PL') echo 
'(Extension)';
+                echo $a_menu[$i]['me_description_etendue']; ?>
+            </td>
+        </tr>
+<?php endfor; ?>        
+    </table>
+
+    
+</div>
+<script charset="UTF8" lang="javascript">
+    $('lk_navi_tb').focus();
+</script>
\ No newline at end of file

Deleted: phpcompta/trunk/include/navigator.inc.php
===================================================================
--- phpcompta/trunk/include/navigator.inc.php   2013-09-13 22:56:44 UTC (rev 
5381)
+++ phpcompta/trunk/include/navigator.inc.php   2013-09-14 08:44:37 UTC (rev 
5382)
@@ -1,90 +0,0 @@
-<?php
-
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision: 5380 $ */
-
-// Copyright Author Dany De Bontridder address@hidden
-if ( ! defined ('ALLOWED')) die('Appel direct ne sont pas permis');
-
-$sql="
-    select code, 
me_code,me_description,coalesce(me_description_etendue,me_description) as 
me_description_etendue,v1menu,v2menu,v3menu,p_type_display
-    from 
-    v_menu_description
-    where user_name=$1
-    order by 2 ";
-
-$a_menu=$cn->get_array($sql,array($_SESSION['g_user']));
-
-?>
-<div class="content">
-    <h1>Navigateur</h1>
-    <p>
-        Vous permet d'accèder rapidement au menu qui vous intéresse, utiliser 
le filtre pour trouver plus rapidement
-    </p>
-    <p style='margin-left: 5%'>
-    Filtre : <?php
-    echo HtmlInput::filter_table("navi_tb", "1", '1');
-    ?>
-    </p>
-    <table id="navi_tb" class="sortable" style="width:90%;margin-left: 
5%;border-spacing:0em 1.25em;border-collapse: separate">
-        <tr>
-            <th class='sorttable_sorted'>
-                Code AD 
-                <?php echo HtmlInput::infobulle(34); ?>
-                <span 
id="sorttable_sortfwdind">&nbsp;&blacktriangledown;</span>
-            </th>
-            <th>
-                Chemin
-                <?php echo HtmlInput::infobulle(35); ?>
-            </th>
-            <th>
-                Description complète
-            </th>
-        </tr>
-<?php 
-$nMax=count($a_menu);
-$url="do.php?gDossier=".dossier::id();
-for ($i=0;$i<$nMax;$i++):
-?>
-        <tr>
-            <td>
-                <a class='mtitle' style='text-decoration: underline' 
href="<?php echo $url."&ac=".$a_menu[$i]['code']; ?>" target='_blank'>
-                <?php echo $a_menu[$i]['me_code'];               ?>
-                </a>
-            </td>
-            <td>
-                <a class='mtitle' style='text-decoration: underline' 
href="<?php echo $url."&ac=".$a_menu[$i]['code']; ?>">
-                <?php
-                $path=$a_menu[$i]['v3menu'];
-                $path.=$a_menu[$i]['v2menu'];
-                $path.=$a_menu[$i]['v1menu'];
-                echo $path;
-                ?>
-                </a>
-            </td>
-            <td>
-                <?php if ($a_menu[$i]['p_type_display'] == 'PL') echo 
'(Extension)';
-                echo $a_menu[$i]['me_description_etendue']; ?>
-            </td>
-        </tr>
-<?php endfor; ?>        
-    </table>
-
-    
-</div>

Modified: phpcompta/trunk/include/pref.inc.php
===================================================================
--- phpcompta/trunk/include/pref.inc.php        2013-09-13 22:56:44 UTC (rev 
5381)
+++ phpcompta/trunk/include/pref.inc.php        2013-09-14 08:44:37 UTC (rev 
5382)
@@ -208,14 +208,14 @@
        }
        echo '</select>';
        echo '</fieldset>';
+        
 
-
        echo HtmlInput::submit("val", _("Valider"));
        echo '</form>';
+        
 
 
 
-
        if (!$inside_dossier)
        {
            echo HtmlInput::button_anchor(_('Retour'), 'user_login.php?');

Modified: phpcompta/trunk/sql/upgrade.sql
===================================================================
--- phpcompta/trunk/sql/upgrade.sql     2013-09-13 22:56:44 UTC (rev 5381)
+++ phpcompta/trunk/sql/upgrade.sql     2013-09-14 08:44:37 UTC (rev 5382)
@@ -101,26 +101,28 @@
  * Vue montrant toutes les possibilités
  */
 CREATE OR REPLACE VIEW v_menu_description AS 
-with t_menu as ( SELECT mr.me_menu,pm.me_code, pm.me_code_dep, 
pm.p_type_display, pu.user_name, mr.me_file, mr.me_javascript, 
mr.me_description,mr.me_description_etendue
-   FROM profile_menu pm
-   JOIN profile_user pu ON pu.p_id = pm.p_id
+ WITH t_menu AS (
+         SELECT mr.me_menu, pm.me_code, pm.me_code_dep, pm.p_type_display, 
pu.user_name, mr.me_file, mr.me_javascript, mr.me_description, 
mr.me_description_etendue
+           FROM profile_menu pm
+      JOIN profile_user pu ON pu.p_id = pm.p_id
    JOIN profile p ON p.p_id = pm.p_id
-   JOIN menu_ref mr USING (me_code))
- select distinct coalesce(v3.me_code||'/','')||coalesce(v2.me_code,'')||
-case when v2.me_code is null then coalesce(v1.me_code,'')
-when v2.me_code is not null then
-coalesce('/'||v1.me_code,'')
-end as code
-, v1.me_code
-,v1.me_description,v1.me_description_etendue,v1.me_file,V1.USER_NAME,
-'> '||v1.me_menu as v1menu, 
-case when coalesce(v3.me_menu,'') <> '' then ' > '||v2.me_menu else v2.me_menu 
end as v2menu,
-v3.me_menu as v3menu,
-v3.p_type_display
- from t_menu as v1 
- left join t_menu as v2 on (v1.me_code_dep=v2.me_code) 
- left join t_menu as v3 on (v2.me_code_dep=v3.me_code) 
- where v1.p_type_display not in ('P') and (coalesce(v1.me_file,'') <>'' or 
coalesce(v1.me_javascript,'')<>'');
- 
+   JOIN menu_ref mr USING (me_code)
+        )
+ SELECT DISTINCT (COALESCE(v3.me_code || '/'::text, ''::text) || 
COALESCE(v2.me_code, ''::text)) || 
+        CASE
+            WHEN v2.me_code IS NULL THEN COALESCE(v1.me_code, ''::text)
+            WHEN v2.me_code IS NOT NULL THEN COALESCE('/'::text || v1.me_code, 
''::text)
+            ELSE NULL::text
+        END AS code, v1.me_code, v1.me_description, v1.me_description_etendue, 
v1.me_file, v1.user_name, '> '::text || v1.me_menu AS v1menu, 
+        CASE
+            WHEN COALESCE(v3.me_menu, ''::text) <> ''::text THEN ' > '::text 
|| v2.me_menu
+            ELSE v2.me_menu
+        END AS v2menu, v3.me_menu AS v3menu, v3.p_type_display
+   FROM t_menu v1
+   LEFT JOIN t_menu v2 ON v1.me_code_dep = v2.me_code
+   LEFT JOIN t_menu v3 ON v2.me_code_dep = v3.me_code
+  WHERE v1.p_type_display <> 'P'::text AND (COALESCE(v1.me_file, ''::text) <> 
''::text OR COALESCE(v1.me_javascript, ''::text) <> ''::text);
+
 COMMENT ON VIEW v_menu_description
   IS 'Description des menus';
+ 



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]