phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r575 - in trunk/rapport_avance: . doc include include/te


From: phpcompta-dev
Subject: [Phpcompta-dev] r575 - in trunk/rapport_avance: . doc include include/template
Date: Tue, 12 Nov 2013 15:15:12 +0100 (CET)

Author: danydb
Date: 2013-11-12 15:15:12 +0100 (Tue, 12 Nov 2013)
New Revision: 575

Added:
   trunk/rapport_avance/include/ajax_listing_display_definition.php
   trunk/rapport_avance/include/template/rapav_listing_form_modify.php
Removed:
   trunk/rapport_avance/include/template/rapav_listing_form_add.php
Modified:
   trunk/rapport_avance/ajax.php
   trunk/rapport_avance/doc/listing-db.dia
   trunk/rapport_avance/doc/listing-entity.dia
   trunk/rapport_avance/doc/rapav-analyse.dia
   trunk/rapport_avance/include/class_rapav_listing.php
   trunk/rapport_avance/include/template/rapav_listing_to_list.php
   trunk/rapport_avance/rapav_javascript.js
Log:
Listing : definition

Modified: trunk/rapport_avance/ajax.php
===================================================================
--- trunk/rapport_avance/ajax.php       2013-11-11 16:30:23 UTC (rev 574)
+++ trunk/rapport_avance/ajax.php       2013-11-12 14:15:12 UTC (rev 575)
@@ -133,7 +133,14 @@
     case 'listing_remove_modele':
        include 'ajax_listing_remove_modele.php';
         exit();
-
-        break;
+    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Display the definition of a listing
+    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    case 'listing_display_definition':
+        include 'ajax_listing_display_definition.php';
+        exit();
+    default:
+        if ( DEBUG) var_dump($_GET);
+        die ("Aucune action demandée");
 }
 ?>

Modified: trunk/rapport_avance/doc/listing-db.dia
===================================================================
(Binary files differ)

Modified: trunk/rapport_avance/doc/listing-entity.dia
===================================================================
(Binary files differ)

Modified: trunk/rapport_avance/doc/rapav-analyse.dia
===================================================================
(Binary files differ)

Added: trunk/rapport_avance/include/ajax_listing_display_definition.php
===================================================================
--- trunk/rapport_avance/include/ajax_listing_display_definition.php            
                (rev 0)
+++ trunk/rapport_avance/include/ajax_listing_display_definition.php    
2013-11-12 14:15:12 UTC (rev 575)
@@ -0,0 +1,19 @@
+<?php
+
+require_once 'include/class_rapav_listing.php';
+$obj=new Rapav_Listing($id);
+ob_start();
+$obj->display();
+$obj->button_add_param();
+$response = ob_get_flush();
+ob_end_clean();
+$html = escape_xml($response);
+header('Content-type: text/xml; charset=UTF-8');
+echo <<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<data>
+<ctl></ctl>
+<code>$html</code>
+</data>
+EOF;
+?>        
\ No newline at end of file

Modified: trunk/rapport_avance/include/class_rapav_listing.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing.php        2013-11-11 
16:30:23 UTC (rev 574)
+++ trunk/rapport_avance/include/class_rapav_listing.php        2013-11-12 
14:15:12 UTC (rev 575)
@@ -50,6 +50,7 @@
         global $cn;
         $name = new IText('name');
         $description = new ITextArea('description');
+        $description->style=' style="margin:0px;width:100%" class="itextarea"';
         $file = new IFile('listing_mod');
         $fichedef = new ISelect('fiche_def');
         $fichedef->value = $cn->make_array('select fd_id,fd_label from 
fiche_def order by fd_label');
@@ -78,7 +79,7 @@
                 $file->value = $this->Data->l_filename . HtmlInput::anchor(' 
<span style="background-color:red">X </span>', "", ' onclick="' . $json . '"');
             }
         }
-        require 'template/rapav_listing_form_add.php';
+        require 'template/rapav_listing_form_modify.php';
     }
 
     /**
@@ -184,5 +185,15 @@
 
         }
     }
+    /**
+     * @brief display the parameter of a listing
+     * let add or remove detail
+     */
+    function display()
+    {
+        // Load all listing_parameter
 
+        // Display them avec an anchor to update / delete (javascript)
+    }
+
 }

Deleted: trunk/rapport_avance/include/template/rapav_listing_form_add.php
===================================================================
--- trunk/rapport_avance/include/template/rapav_listing_form_add.php    
2013-11-11 16:30:23 UTC (rev 574)
+++ trunk/rapport_avance/include/template/rapav_listing_form_add.php    
2013-11-12 14:15:12 UTC (rev 575)
@@ -1,42 +0,0 @@
-<table>
-    <tr>
-        <td>
-            Nom
-        </td>
-        <td>
-            <?php echo $name->input();?>
-        </td>
-        
-    </tr>
-    <tr>
-        <td>
-            Description
-        </td>
-        <td>
-            <?php echo $description->input();?>
-        </td>
-        
-    </tr>
-    <tr>
-        <td>
-            Catégorie de fiche
-        </td>
-        <td>
-            <?php echo $fichedef->input();?>
-        </td>
-        
-    </tr>
-    <tr>
-        <td>
-            Fichier
-        </td>
-        <td>
-            <?php echo $file->input();?>
-        </td>
-        
-    </tr>
-
-</table>
-<?php
-echo $str_remove;
-?>
\ No newline at end of file

Copied: trunk/rapport_avance/include/template/rapav_listing_form_modify.php 
(from rev 574, trunk/rapport_avance/include/template/rapav_listing_form_add.php)
===================================================================
--- trunk/rapport_avance/include/template/rapav_listing_form_modify.php         
                (rev 0)
+++ trunk/rapport_avance/include/template/rapav_listing_form_modify.php 
2013-11-12 14:15:12 UTC (rev 575)
@@ -0,0 +1,42 @@
+<table>
+    <tr>
+        <td>
+            Nom
+        </td>
+        <td>
+            <?php echo $name->input();?>
+        </td>
+        
+    </tr>
+    <tr>
+        <td>
+            Description
+        </td>
+        <td>
+            <?php echo $description->input();?>
+        </td>
+        
+    </tr>
+    <tr>
+        <td>
+            Catégorie de fiche
+        </td>
+        <td>
+            <?php echo $fichedef->input();?>
+        </td>
+        
+    </tr>
+    <tr>
+        <td>
+            Fichier
+        </td>
+        <td>
+            <?php echo $file->input();?>
+        </td>
+        
+    </tr>
+
+</table>
+<?php
+echo $str_remove;
+?>
\ No newline at end of file

Modified: trunk/rapport_avance/include/template/rapav_listing_to_list.php
===================================================================
--- trunk/rapport_avance/include/template/rapav_listing_to_list.php     
2013-11-11 16:30:23 UTC (rev 574)
+++ trunk/rapport_avance/include/template/rapav_listing_to_list.php     
2013-11-12 14:15:12 UTC (rev 575)
@@ -36,7 +36,18 @@
             <?php echo h($row['fd_label']); ?>
         </td>
         <td>
-            Action
+        <?php
+        $arg = array(
+            'gDossier' => Dossier::id(),
+            'ac' => $_REQUEST['ac'],
+            'pc' => $_REQUEST['plugin_code'],
+            'id' => $row['l_id'],
+            'cin' => 'listing_definition_id',
+            'cout' => 'listing_definition_div_id');
+        $json = 'listing_definition(' . str_replace('"', "'", 
json_encode($arg)) . ')';
+        echo HtmlInput::anchor(h($row['l_name']),'',' onclick="'.$json.'"'); 
+        ?>
+            
         </td>
     </tr>
     <?php

Modified: trunk/rapport_avance/rapav_javascript.js
===================================================================
--- trunk/rapport_avance/rapav_javascript.js    2013-11-11 16:30:23 UTC (rev 
574)
+++ trunk/rapport_avance/rapav_javascript.js    2013-11-12 14:15:12 UTC (rev 
575)
@@ -542,4 +542,44 @@
         alert(e.message);
 
     }
+}
+function listing_definition (json)
+{
+    console.log(json)
+    try {
+        var querystring = 'plugin_code=' + json.pc + '&ac=' + json.ac + 
'&gDossier=' + json.gDossier + '&act=listing_display_definition' + "&cin=" + 
json.cin + '&cout=' + json.cout+'&id='+json.id;
+        waiting_box();
+        var action = new Ajax.Request(
+                "ajax.php",
+                {
+                    method: 'get',
+                    parameters: querystring,
+                    onFailure: error_get_predef,
+                    onSuccess: function(req) {
+                        try {
+                            var answer = req.responseXML;
+                            var a = answer.getElementsByTagName('ctl');
+                            var html = answer.getElementsByTagName('code');
+                            if (a.length == 0) {
+                                var rec = req.responseText;
+                                throw 'cannot find ctl element';
+                            }
+                            remove_waiting_box();
+                            var code_html = getNodeText(html[0]); 
+                            code_html = unescape_xml(code_html);
+                             console.log(code_html);
+                           $(json.cout).innerHTML = code_html;
+                        } catch (e) {
+                            console.log(e);
+                            console.log(code_html);
+                        }
+                    }
+                }
+        );
+
+    } catch (e)
+    {
+        alert(e.message);
+
+    }
 }
\ No newline at end of file



---
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]