phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5089 - in phpcompta/tags/rel650: html html/js include


From: phpcompta-dev
Subject: [Phpcompta-dev] r5089 - in phpcompta/tags/rel650: html html/js include
Date: Mon, 30 Jul 2012 21:36:56 +0200 (CEST)

Author: danydb
Date: 2012-07-30 21:36:55 +0200 (Mon, 30 Jul 2012)
New Revision: 5089

Added:
   phpcompta/tags/rel650/include/ajax_boxcard_search.php
Modified:
   phpcompta/tags/rel650/html/ajax_misc.php
   phpcompta/tags/rel650/html/js/card.js
   phpcompta/tags/rel650/html/js/infobulle.js
   phpcompta/tags/rel650/include/fiche.inc.php
Log:
0000695: ajout d'un bouton pour chercher une fiche

Modified: phpcompta/tags/rel650/html/ajax_misc.php
===================================================================
--- phpcompta/tags/rel650/html/ajax_misc.php    2012-07-30 19:28:46 UTC (rev 
5088)
+++ phpcompta/tags/rel650/html/ajax_misc.php    2012-07-30 19:36:55 UTC (rev 
5089)
@@ -501,6 +501,9 @@
        case 'add_menu':
                require_once 'ajax_add_menu.php';
                break;
+       case 'cardsearch':
+               require_once 'ajax_boxcard_search.php';
+               break;
        case 'add_plugin':
                $me_code = new IText('me_code');
                $me_file = new IText('me_file');

Modified: phpcompta/tags/rel650/html/js/card.js
===================================================================
--- phpcompta/tags/rel650/html/js/card.js       2012-07-30 19:28:46 UTC (rev 
5088)
+++ phpcompta/tags/rel650/html/js/card.js       2012-07-30 19:36:55 UTC (rev 
5089)
@@ -25,6 +25,35 @@
 
 var card_layer=1;
 /**
+ address@hidden search a card an display the result into a inner box
+ */
+function boxsearch_card(p_dossier)
+{
+       try
+       {
+       waiting_box();
+       removeDiv('boxsearch_card_div');
+       var 
queryString="gDossier="+p_dossier+"&op=cardsearch"+"&card="+$(card_search).value;
+       var action = new Ajax.Request(
+                                 "ajax_misc.php" ,
+                                 {
+                                     method:'get', parameters:queryString,
+                                     onFailure:ajax_misc_failure,
+                                     onSuccess:function(req){
+                                               remove_waiting_box();
+                                               var y=posY+15;
+                                               var 
div_style="left:10%;width:80%;"+";top:"+y;
+                                               
add_div({id:'boxsearch_card_div',cssclass:'inner_box',html:loading(),style:div_style,drag:true});
+                                               
$('boxsearch_card_div').innerHTML=req.responseText;
+                                     }
+                                 }
+                                 );
+       }catch( e)
+       {
+               alert(e.getMessage);
+       }
+}
+/**
  address@hidden show the ipopup with the form to search a card
  * the properties
  *  - jrn for the ledger

Modified: phpcompta/tags/rel650/html/js/infobulle.js
===================================================================
--- phpcompta/tags/rel650/html/js/infobulle.js  2012-07-30 19:28:46 UTC (rev 
5088)
+++ phpcompta/tags/rel650/html/js/infobulle.js  2012-07-30 19:36:55 UTC (rev 
5089)
@@ -45,6 +45,7 @@
 content[15]="Laissez à 0 pour ne rien changer";
 content[16]="Vous devez donner la date par opération";
 content[17]="Cliquez sur le titre d'une colonne pour trier";
+content[18]="Donner une partie du nom, prénom, de la description, du poste 
comptable, du n° de TVA ou quick code";
 
 function showBulle(p_ctl)
 {

Added: phpcompta/tags/rel650/include/ajax_boxcard_search.php
===================================================================
--- phpcompta/tags/rel650/include/ajax_boxcard_search.php                       
        (rev 0)
+++ phpcompta/tags/rel650/include/ajax_boxcard_search.php       2012-07-30 
19:36:55 UTC (rev 5089)
@@ -0,0 +1,104 @@
+<?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$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief show result card search
+ *
+ */
+$sql="
+       select 
vw.f_id,vw_name,vw_first_name,vw_description,fd_label,quick_code,pc.ad_value as 
poste,tva_num
+       from vw_fiche_attr as vw
+       join fiche_def as fd on (vw.fd_id=fd.fd_id)
+       left join (select f_id,ad_value from fiche_detail where ad_id=5) as pc 
on (pc.f_id=vw.f_id)
+       where
+       vw_name ~* $1
+       or vw_first_name ~* $1
+       or vw_description ~* $1
+       or tva_num ~* $1
+       or pc.ad_value like $1||'%'
+       order by 2
+";
+$array=$cn->get_array($sql,array($_GET['card']));
+echo HtmlInput::title_box("Résultat recherche", "boxsearch_card_div");
+$max=(count($array)>MAX_CARD_SEARCH)?MAX_CARD_SEARCH:count($array);
+?>
+<? if (count($array)>MAX_CARD_SEARCH ): ?>
+<h2 class="notice">Résultat limité à <?=MAX_CARD_SEARCH?>, nombre de fiches 
trouvées : <?=count($array)?> </h2>
+
+<? endif?>
+<table class="sortable">
+       <tr>
+               <th>
+                       Categorie
+               </th>
+               <th>
+                       Quick Code
+               </th>
+               <th>
+                       Nom
+               </th>
+               <th>
+                       Description
+               </th>
+               <th>
+                       Numéro TVA
+               </th>
+               <th>
+                       Poste comptable
+               </th>
+
+       </tr>
+<? if (count($array)==0) : ?>
+       <h2 class="notice"> Aucun résultat</h2>
+<?endif?>
+<? for ($i=0;$i<$max;$i++):?>
+       <tr>
+               <td>
+                       <?=h($array[$i]['fd_label'])?>
+               </td>
+               <td>
+                       <?=HtmlInput::card_detail($array[$i]['quick_code'])?>
+               </td>
+               <td>
+                       <?=h($array[$i]['vw_name'])?>&nbsp;
+                       <?=h($array[$i]['vw_first_name'])?>
+               </td>
+               <td>
+                       <?=h($array[$i]['vw_description'])?>
+
+               </td>
+               <td>
+                       <?=h($array[$i]['tva_num'])?>
+
+               </td>
+               <td>
+                       <?=h($array[$i]['poste'])?>
+
+               </td>
+       </tr>
+
+
+<? endfor; ?>
+</table>
+<?=HtmlInput::button_close("boxsearch_card_div")?>
\ No newline at end of file

Modified: phpcompta/tags/rel650/include/fiche.inc.php
===================================================================
--- phpcompta/tags/rel650/include/fiche.inc.php 2012-07-30 19:28:46 UTC (rev 
5088)
+++ phpcompta/tags/rel650/include/fiche.inc.php 2012-07-30 19:36:55 UTC (rev 
5089)
@@ -82,6 +82,16 @@
 require_once('template/impress_cat_card.php');
 echo HtmlInput::submit('cat_display', _('Recherche'));
 echo '</FORM>';
+$search_card=new IText('card_search');
+$search_card_js=sprintf('onclick="boxsearch_card(\'%d\')"',dossier::id());
+?>
+<div style="position:absolute;right:230px;top:110px">
+
+               Recherche de fiche <?=HtmlInput::infobulle(18)?> 
:<?=$search_card->input()?>
+               
<?=HtmlInput::button_anchor("Chercher","javascript:void(0)","",$search_card_js)?>
+</div>
+<?
+echo '</div>';
 $str = "if (g('histo').value==3 || g('histo').value== -1 ) {
      
g('trstart').style.display='none';g('trend').style.display='none';g('allcard').style.display='none';}
      else  
{g('trstart').style.display='';g('trend').style.display='';g('allcard').style.display='';}



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