phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4849 - in phpcompta/trunk: html html/js include
Date: Wed, 30 May 2012 22:02:21 +0200 (CEST)

Author: danydb
Date: 2012-05-30 22:02:20 +0200 (Wed, 30 May 2012)
New Revision: 4849

Added:
   phpcompta/trunk/include/ajax_search_action.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/class_follow_up.php
Log:
Add link to other action

Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php  2012-05-28 01:13:57 UTC (rev 4848)
+++ phpcompta/trunk/html/ajax_misc.php  2012-05-30 20:02:20 UTC (rev 4849)
@@ -481,6 +481,9 @@
        case 'search_op':
                require_once 'search.inc.php';
                break;
+       case 'search_action':
+               require_once 'ajax_search_action.php';
+               break;
        case 'display_profile':
                require_once("ajax_get_profile.php");
                break;

Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js  2012-05-28 01:13:57 UTC (rev 4848)
+++ phpcompta/trunk/html/js/scripts.js  2012-05-30 20:02:20 UTC (rev 4849)
@@ -1379,3 +1379,39 @@
 
     g('form'+line).value='';
 }
+/**
+ * Search an action in an inner box
+ */
+function search_action(dossier,ctl_concern)
+{
+       var dossier=g('gDossier').value;
+       
+       var target="search_action_div";
+       removeDiv(target);
+       var str_style=fixed_position(77, 99);
+        str_style+=";width:80%";
+
+    var div={id:target, 
cssclass:'inner_box',style:str_style,html:loading(),drag:1};
+
+    add_div(div);
+       var target={gDossier:dossier,
+                               ctlc:ctl_concern,
+                               op:'search_action',
+                               ctl:target
+                               };
+
+    var qs=encodeJSON(target);
+
+    var action=new Ajax.Request ( 'ajax_misc.php',
+                                 {
+                                     method:'get',
+                                     parameters:qs,
+                                     onFailure:null,
+                                     onSuccess:function (req){
+                                                 remove_waiting_box();
+                                                 
$('search_action').innerHTML=req.responseText;
+                                                 
req.responseText.evalScripts();
+                                         }
+                                 }
+                               );
+}
\ No newline at end of file

Modified: phpcompta/trunk/include/action.common.inc.php
===================================================================
--- phpcompta/trunk/include/action.common.inc.php       2012-05-28 01:13:57 UTC 
(rev 4848)
+++ phpcompta/trunk/include/action.common.inc.php       2012-05-30 20:02:20 UTC 
(rev 4849)
@@ -169,7 +169,7 @@
     $act->remove();
     $sub_action="list";
     $cn->commit();
-    ShowActionList($cn,$base);
+    Follow_Up::ShowActionList($cn,$base);
     if ( isset( $act->ag_ref) )
       echo hb(_('Action ').$act->ag_ref._(' effacée'));
     exit();
@@ -179,7 +179,7 @@
 // Show a list of the action
 if ( $sub_action == "list" )
   {
-    ShowActionList($cn,$base);
+    Follow_Up::ShowActionList($cn,$base);
   }
 
//--------------------------------------------------------------------------------
 // Add an action
@@ -226,205 +226,9 @@
     echo '<p><a class="mtitle" href="'.$url.'">'.hb('Action Sauvée  : 
'.$act->ag_ref).'</a></p>';
 
 
-    ShowActionList($cn,$base);
+    Follow_Up::ShowActionList($cn,$base);
     $url="?$base&sa=detail&ag_id=".$act->ag_id.'&'.dossier::get();
     echo '<p><a class="mtitle" href="'.$url.'">'.hb('Action Sauvée  : 
'.$act->ag_ref).'</a></p>';
   }
-//---------------------------------------------------------------------
-function ShowActionList($cn,$p_base)
-{
-  // show the search menu
-  ?>
-  <div id="search_action" class="op_detail_frame" 
style="position:absolute;display:none;margin-left:120px;width:70%;clear:both;z-index:2;height:auto;border:1px
 #000080 solid">
-        <? echo 
HtmlInput::anchor_hide('Fermer','$(\'search_action\').style.display=\'none\';');
 ?>
-    <h2 class="info">
-    <?=_('Recherche avancée')?>
-    </h2>
-    <form method="get" action="do.php" style="padding:10px">
-    <?php
-    echo dossier::hidden();
-  $a=(isset($_GET['query']))?$_GET['query']:"";
-  $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
+?>
 
-  $supl_hidden='';
-  if( isset($_REQUEST['sc']))
-    $supl_hidden.=HtmlInput::hidden('sc',$_REQUEST['sc']);
-  if( isset($_REQUEST['f_id']))
-    {
-      $supl_hidden.=HtmlInput::hidden('f_id',$_REQUEST['f_id']);
-      $f=new Fiche($cn,$_REQUEST['f_id']);
-      $supl_hidden.=HtmlInput::hidden('qcode_dest',$f->get_quick_code());
-    }
-  if( isset($_REQUEST['sb']))
-    $supl_hidden.=HtmlInput::hidden('sb',$_REQUEST['sb']);
-    $supl_hidden.=HtmlInput::hidden('ac',$_REQUEST['ac']);
-
-  $w=new ICard();
-  $w->name='qcode';
-  $w->value=$qcode;
-  $w->extra="all";
-  $w->typecard='all';
-  $w->jrn=0;
-  $w->table=0;
-  $list=$cn->make_list("select fd_id from fiche_def where frd_id in 
(4,8,9,14,15,16,25)");
-  $w->extra=$list;
-
-
-  /* type of documents */
-  $type_doc=new ISelect ('tdoc');
-  $aTDoc=$cn->make_array('select dt_id,dt_value from document_type order by 
dt_value');
-  $aTDoc[]=array('value'=>'-1','label'=>_('Tous les types'));
-  $type_doc->value=$aTDoc;
-  $type_doc->selected=(isset ($_GET['tdoc']))?$_GET['tdoc']:-1;
-
-       // date
-  $start=new IDate('date_start');
-  $start->value=(isset($_GET['date_start']))?$_GET['date_start']:"";
-  $end=new IDate('date_end');
-  $end->value=(isset($_GET['date_end']))?$_GET['date_end']:"";
-
-  $see_all=new ICheckBox('see_all');
-  $see_all->selected=(isset($_GET['see_all']))?true:false;
-  $my_action=new ICheckBox('all_action');
-  $my_action->selected=(isset($_GET['all_action']))?true:false;
-  // select profile
-   $aAg_dest=$cn->make_array("select  p_id as value, ".
-                                    "p_name as label ".
-                                    " from profile order by 2");
-$ag_dest=new ISelect();
-$ag_dest->name="ag_dest_query";
-$aAg_dest[]=array('value'=>0,'label'=>'Public');
-$ag_dest->value=$aAg_dest;
-$ag_dest->selected=(isset($_GET["ag_dest_query"]))?$_GET["ag_dest_query"]:0;
-$str_ag_dest=$ag_dest->input();
-
-  ?>
-               <table style="width:100%">
-                       <tr>
-                       <td style="width:180px;text-align:right"><? echo 
_('Destinataire') ?></td>
-                       <td ><?=$w->input().$w->search()?></td>
-                       <tr>
-                       <tr>
-                               <td style="text-align:right" 
><?=_("Profile")?></td>
-                               <td><?=$str_ag_dest?></td>
-                       </tr>
-                       <td style="text-align:right"><? printf (_('contenant le 
mot'))?></td>
-                       <td ><input class="input_text" style="width:100%" 
type="text" name="query" value="<?=$a?>"></td>
-                       </tr>
-                       <tr>
-                                       <td style="text-align:right"><?=_('Type 
de document')?></td>
-                                       <td><? echo $type_doc->input();?></td>
-                       </tr>
-                       <tr>
-                               <td style="text-align:right">
-                                       <? printf (_("Après le "))?>
-                               </td>
-                               <td >
-                                       <?=$start->input()?>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td style="text-align:right"><?=_('Avant 
le')?></td>
-                               <td>
-                                       <?=$end->input()?>
-                               </td>
-                               </tr>
-                       </tr>
-                       <tr>
-                       <td style="text-align:right">
-                               <?=_('inclure les actions fermées ')?>
-                       </td>
-                       <td>
-                               <?=$see_all->input()?>
-                       </td>
-                       </tr>
-                       <tr>
-                               <td style="text-align:right"><?=_('les actions  
affectées à d\'autres')?></td>
-                               <td><?=$my_action->input()?>
-                               </td>
-                       </tr>
-  </table>
-    <input type="submit" class="button" name="submit_query" 
value="<?=_('recherche')?>">
-       <input type="hidden" name="sa" value="list">
-
-       <?=$supl_hidden?>
-<?  echo 
HtmlInput::button_anchor(_('Fermer'),'javascript:void(0)','fsearch_form','onclick="$(\'search_action\').style.display=\'none\';"');
 ?>
-       </form>
-       </div>
-
-       <div class="content" >
-       <div>
-       <form  method="get" action="do.php">
-       <?php echo dossier::hidden();
-  ?>
-       <input type="submit" class="button" name="submit_query" 
value="<?=_("Ajout Action")?>">
-         <input type="hidden" name="ac" value="<?=$_REQUEST['ac']?>">
-         <input type="hidden" name="sa" value="add_action">
-         <?=$supl_hidden?>
-         <input id="bt_search" type="button" class="button" 
onclick="$('search_action').style.display='block'" value="<?=_('Recherche')?>">
-
-
-
-             </form>
-             </div>
-
-             <?php
-             // show the  action in
-             $act=new Follow_Up($cn);
-         /*! \brief
-          *  \note The field 'recherche' is   about a part of the title or a 
ref. number
-          */
-         $query="";
-
-         if ( isset($_REQUEST['query']) )
-           {
-             // if a query is request build the sql stmt
-             $query="and (ag_title ~* '".sql_string($_REQUEST['query'])."' ".
-               "or ag_ref ='".trim(sql_string($_REQUEST['query'])).
-               "' or ag_id in (select ag_id from action_gestion_comment where 
agc_comment ~* '".trim(sql_string($_REQUEST['query']))."')".
-               ")";
-           }
-
-         $str="";
-         if ( isset($_GET['qcode'] ))
-           {
-
-             // verify that qcode is not empty
-             if ( strlen(trim($_REQUEST['qcode'] )) != 0 )
-               {
-
-                 $fiche=new Fiche($cn);
-                 $fiche->get_by_qcode($_REQUEST['qcode']);
-                 // if quick code not found then nothing
-                 if ( $fiche->id == 0 )
-                   $str=' and false ';
-                 else
-                   $str=" and (f_id_dest= ".$fiche->id." ) ";
-               }
-           }
-         if (isset($_GET['tdoc']) && $_GET['tdoc'] != -1 )
-           {
-             $query .= ' and dt_id = '.Formatstring($_GET['tdoc']);
-           }
-         if ( ! $see_all->selected )      $query .= ' and ag_state in (2,3) ';
-         if ( ! $my_action->selected )     {
-                 $query .=" and (ag_owner='".$_SESSION['g_user']."' or ag_dest 
in (select p_id from profile_user where user_name='".$_SESSION['g_user']."') )";
-         }
-         if (isset ($_GET['date_start']) && isDate($_GET['date_start'])!= null 
) {
-                 $date_start=$_GET['date_start'];
-                 $query.=" and ag_timestamp >= 
to_date('$date_start','DD.MM.YYYY')";
-         }
-         if (isset ($_GET['date_end']) && isDate($_GET['date_end'])!= null ) {
-                 $date_end=$_GET['date_end'];
-                 $query.=" and ag_timestamp <= 
to_date('$date_end','DD.MM.YYYY')";
-         }
-         if ( isset($_GET['ag_dest_query']))
-         {
-                 if ( $_GET['ag_dest_query']==0)
-                       $query .= "and ag_dest is null ";
-                 else
-                       $query.= " and ag_dest = 
".sql_string($_GET['ag_dest_query']);
-         }
-         $r=$act->myList($p_base,"",$query.$str);
-         echo $r;
-}

Added: phpcompta/trunk/include/ajax_search_action.php
===================================================================
--- phpcompta/trunk/include/ajax_search_action.php                              
(rev 0)
+++ phpcompta/trunk/include/ajax_search_action.php      2012-05-30 20:02:20 UTC 
(rev 4849)
@@ -0,0 +1,32 @@
+<?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: 4215 $ */
+// Copyright Author Dany De Bontridder address@hidden
+/*! \file
+ * \brief Search module
+ */
+require_once('class_dossier.php');
+include_once("ac_common.php");
+require_once('class_action.php');
+$ac=$_REQUEST['ac'];
+$base='ac='.$ac;
+
+Action::ShowActionList($cn,"");
+
+?>


Property changes on: phpcompta/trunk/include/ajax_search_action.php
___________________________________________________________________
Name: svn:executable
   + *

Modified: phpcompta/trunk/include/class_follow_up.php
===================================================================
--- phpcompta/trunk/include/class_follow_up.php 2012-05-28 01:13:57 UTC (rev 
4848)
+++ phpcompta/trunk/include/class_follow_up.php 2012-05-30 20:02:20 UTC (rev 
4849)
@@ -1112,4 +1112,202 @@
                        $this->db->exec_sql("delete from 
action_gestion_operation where ago_id=$1",array($op[$i]));
                }
        }
+function ShowActionList($cn,$p_base)
+{
+  // show the search menu
+  ?>
+  <div id="search_action" class="op_detail_frame" 
style="position:absolute;display:none;margin-left:120px;width:70%;clear:both;z-index:2;height:auto;border:1px
 #000080 solid">
+        <? echo 
HtmlInput::anchor_hide('Fermer','$(\'search_action\').style.display=\'none\';');
 ?>
+    <h2 class="info">
+    <?=_('Recherche avancée')?>
+    </h2>
+    <form method="get" action="do.php" style="padding:10px">
+    <?php
+    echo dossier::hidden();
+  $a=(isset($_GET['query']))?$_GET['query']:"";
+  $qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
+
+  $supl_hidden='';
+  if( isset($_REQUEST['sc']))
+    $supl_hidden.=HtmlInput::hidden('sc',$_REQUEST['sc']);
+  if( isset($_REQUEST['f_id']))
+    {
+      $supl_hidden.=HtmlInput::hidden('f_id',$_REQUEST['f_id']);
+      $f=new Fiche($cn,$_REQUEST['f_id']);
+      $supl_hidden.=HtmlInput::hidden('qcode_dest',$f->get_quick_code());
+    }
+  if( isset($_REQUEST['sb']))
+    $supl_hidden.=HtmlInput::hidden('sb',$_REQUEST['sb']);
+    $supl_hidden.=HtmlInput::hidden('ac',$_REQUEST['ac']);
+
+  $w=new ICard();
+  $w->name='qcode';
+  $w->value=$qcode;
+  $w->extra="all";
+  $w->typecard='all';
+  $w->jrn=0;
+  $w->table=0;
+  $list=$cn->make_list("select fd_id from fiche_def where frd_id in 
(4,8,9,14,15,16,25)");
+  $w->extra=$list;
+
+
+  /* type of documents */
+  $type_doc=new ISelect ('tdoc');
+  $aTDoc=$cn->make_array('select dt_id,dt_value from document_type order by 
dt_value');
+  $aTDoc[]=array('value'=>'-1','label'=>_('Tous les types'));
+  $type_doc->value=$aTDoc;
+  $type_doc->selected=(isset ($_GET['tdoc']))?$_GET['tdoc']:-1;
+
+       // date
+  $start=new IDate('date_start');
+  $start->value=(isset($_GET['date_start']))?$_GET['date_start']:"";
+  $end=new IDate('date_end');
+  $end->value=(isset($_GET['date_end']))?$_GET['date_end']:"";
+
+  $see_all=new ICheckBox('see_all');
+  $see_all->selected=(isset($_GET['see_all']))?true:false;
+  $my_action=new ICheckBox('all_action');
+  $my_action->selected=(isset($_GET['all_action']))?true:false;
+  // select profile
+   $aAg_dest=$cn->make_array("select  p_id as value, ".
+                                    "p_name as label ".
+                                    " from profile order by 2");
+$ag_dest=new ISelect();
+$ag_dest->name="ag_dest_query";
+$aAg_dest[]=array('value'=>0,'label'=>'Public');
+$ag_dest->value=$aAg_dest;
+$ag_dest->selected=(isset($_GET["ag_dest_query"]))?$_GET["ag_dest_query"]:0;
+$str_ag_dest=$ag_dest->input();
+
+  ?>
+               <table style="width:100%">
+                       <tr>
+                       <td style="width:180px;text-align:right"><? echo 
_('Destinataire') ?></td>
+                       <td ><?=$w->input().$w->search()?></td>
+                       <tr>
+                       <tr>
+                               <td style="text-align:right" 
><?=_("Profile")?></td>
+                               <td><?=$str_ag_dest?></td>
+                       </tr>
+                       <td style="text-align:right"><? printf (_('contenant le 
mot'))?></td>
+                       <td ><input class="input_text" style="width:100%" 
type="text" name="query" value="<?=$a?>"></td>
+                       </tr>
+                       <tr>
+                                       <td style="text-align:right"><?=_('Type 
de document')?></td>
+                                       <td><? echo $type_doc->input();?></td>
+                       </tr>
+                       <tr>
+                               <td style="text-align:right">
+                                       <? printf (_("Après le "))?>
+                               </td>
+                               <td >
+                                       <?=$start->input()?>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td style="text-align:right"><?=_('Avant 
le')?></td>
+                               <td>
+                                       <?=$end->input()?>
+                               </td>
+                               </tr>
+                       </tr>
+                       <tr>
+                       <td style="text-align:right">
+                               <?=_('inclure les actions fermées ')?>
+                       </td>
+                       <td>
+                               <?=$see_all->input()?>
+                       </td>
+                       </tr>
+                       <tr>
+                               <td style="text-align:right"><?=_('les actions  
affectées à d\'autres')?></td>
+                               <td><?=$my_action->input()?>
+                               </td>
+                       </tr>
+  </table>
+    <input type="submit" class="button" name="submit_query" 
value="<?=_('recherche')?>">
+       <input type="hidden" name="sa" value="list">
+
+       <?=$supl_hidden?>
+<?  echo 
HtmlInput::button_anchor(_('Fermer'),'javascript:void(0)','fsearch_form','onclick="$(\'search_action\').style.display=\'none\';"');
 ?>
+       </form>
+       </div>
+
+       <div class="content" >
+       <div>
+       <form  method="get" action="do.php">
+       <?php echo dossier::hidden();
+  ?>
+       <input type="submit" class="button" name="submit_query" 
value="<?=_("Ajout Action")?>">
+         <input type="hidden" name="ac" value="<?=$_REQUEST['ac']?>">
+         <input type="hidden" name="sa" value="add_action">
+         <?=$supl_hidden?>
+         <input id="bt_search" type="button" class="button" 
onclick="$('search_action').style.display='block'" value="<?=_('Recherche')?>">
+
+
+
+             </form>
+             </div>
+
+             <?php
+             // show the  action in
+             $act=new Follow_Up($cn);
+         /*! \brief
+          *  \note The field 'recherche' is   about a part of the title or a 
ref. number
+          */
+         $query="";
+
+         if ( isset($_REQUEST['query']) )
+           {
+             // if a query is request build the sql stmt
+             $query="and (ag_title ~* '".sql_string($_REQUEST['query'])."' ".
+               "or ag_ref ='".trim(sql_string($_REQUEST['query'])).
+               "' or ag_id in (select ag_id from action_gestion_comment where 
agc_comment ~* '".trim(sql_string($_REQUEST['query']))."')".
+               ")";
+           }
+
+         $str="";
+         if ( isset($_GET['qcode'] ))
+           {
+
+             // verify that qcode is not empty
+             if ( strlen(trim($_REQUEST['qcode'] )) != 0 )
+               {
+
+                 $fiche=new Fiche($cn);
+                 $fiche->get_by_qcode($_REQUEST['qcode']);
+                 // if quick code not found then nothing
+                 if ( $fiche->id == 0 )
+                   $str=' and false ';
+                 else
+                   $str=" and (f_id_dest= ".$fiche->id." ) ";
+               }
+           }
+         if (isset($_GET['tdoc']) && $_GET['tdoc'] != -1 )
+           {
+             $query .= ' and dt_id = '.Formatstring($_GET['tdoc']);
+           }
+         if ( ! $see_all->selected )      $query .= ' and ag_state in (2,3) ';
+         if ( ! $my_action->selected )     {
+                 $query .=" and (ag_owner='".$_SESSION['g_user']."' or ag_dest 
in (select p_id from profile_user where user_name='".$_SESSION['g_user']."') )";
+         }
+         if (isset ($_GET['date_start']) && isDate($_GET['date_start'])!= null 
) {
+                 $date_start=$_GET['date_start'];
+                 $query.=" and ag_timestamp >= 
to_date('$date_start','DD.MM.YYYY')";
+         }
+         if (isset ($_GET['date_end']) && isDate($_GET['date_end'])!= null ) {
+                 $date_end=$_GET['date_end'];
+                 $query.=" and ag_timestamp <= 
to_date('$date_end','DD.MM.YYYY')";
+         }
+         if ( isset($_GET['ag_dest_query']))
+         {
+                 if ( $_GET['ag_dest_query']==0)
+                       $query .= "and ag_dest is null ";
+                 else
+                       $query.= " and ag_dest = 
".sql_string($_GET['ag_dest_query']);
+         }
+         $r=$act->myList($p_base,"",$query.$str);
+         echo $r;
 }
+
+}



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