noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
detail-action.php
Go to the documentation of this file.
00001 <?php
00002 //This file is part of NOALYSS and is under GPL 
00003 //see licence.txt
00004 ?><fieldset>
00005   <legend>
00006 <?php echo _('Informations générales')?>
00007   </legend>
00008   <div style="float:right">
00009     <?echo $retour;
00010     ?>
00011   </div>
00012 <h2 class="gest_name"><?php echo $sp->input();   ?></h2>
00013 <div style="float:left;width: 45%">
00014 
00015 
00016         <table >
00017                         <tr>
00018             <TD>
00019             <?php echo _('N° document')?>
00020             </TD>
00021             <TD style="font-weight: bolder;" >
00022               <?php echo $this->ag_id;?>
00023             </TD>
00024           </TR>
00025                          <tr>
00026             <TD>
00027             <?php echo _('Reference')?>
00028             </TD>
00029             <TD>
00030               <?php echo $str_ag_ref;
00031               ?>
00032             </TD>
00033           </TR>
00034 
00035             <TD>
00036    <?php echo _('Date')?>
00037             </TD>
00038             <TD>
00039               <?php echo $date->input();
00040               ?>
00041             </TD>
00042           </TR>
00043           <TR>
00044             <TD>
00045             <?php echo _('Heure')?>
00046             </TD>
00047             <TD>
00048               <?php echo $str_ag_hour;
00049               ?>
00050             </TD>
00051           </TR>
00052           <tr>
00053                 <TR>
00054             <TD>
00055             <?php echo _('Date limite')?>
00056             </TD>
00057             <TD>
00058               <?php echo $remind_date->input();
00059               ?>
00060             </TD>
00061           </TR>
00062 
00063         <tr>
00064           <TD>
00065             <?php echo _('Destinataire')?>
00066           </TD>
00067           <TD>
00068   <?php echo $w->search().$w->input();
00069             ?>
00070           </td>
00071           </Tr>
00072         <tr>
00073           <TD>
00074           <?php echo _('Contact')?>
00075           </TD>
00076           <TD>
00077   <?php echo $ag_contact->search().$ag_contact->input();
00078             ?>
00079           </td>
00080           </Tr>
00081         <tr>
00082           <TD colspan="2">
00083              <?php echo $spcontact->input(); ?>
00084           </td>
00085           </Tr>
00086         </table>
00087  <?php if ($p_view != 'READ') echo $str_add_button;?>
00088 
00089 </div>
00090 <div style="float:left;width:45%">
00091         <table>
00092 
00093           <tr>
00094             <TD>
00095             <?php echo _('Type')?>
00096             </TD>
00097             <TD>
00098               <?php echo $str_doc_type;
00099               ?>
00100             </TD>
00101           </tr>
00102 
00103           <tr>
00104             <TD>
00105             <?php echo _('Etat')?>
00106             </TD>
00107             <td>
00108               <?php echo $str_state;
00109               ?>
00110             <TD>
00111             </TD>
00112           </TR>
00113           <tr>
00114             <TD>
00115             <?php echo _('Priorité')?>
00116             </TD>
00117             <td>
00118               <?php echo $str_ag_priority;
00119               ?>
00120             <TD>
00121             </TD>
00122           </TR>
00123           <tr>
00124             <TD>
00125             <?php echo _('Destinataire')?>
00126             </TD>
00127             <td>
00128               <?php echo $str_ag_dest;?>
00129           </tr>
00130 <?php if ($this->ag_id > 0 ): ?>
00131           <tr>
00132             <TD>
00133                 Dossier / tags
00134             </TD>
00135             
00136             <td id="action_tag_td">
00137                 <?php
00138                    $this->tag_cell();
00139                 ?>
00140             </td>
00141           </TR>
00142 <?php endif; ?>          
00143         </table>
00144 
00145 </div>
00146 <div style="float:right;clear:both"></div>
00147         <div style="float:left;width:45%">
00148                 <h4 style="display:inline">Opérations concernées</h4>
00149                 <ol>
00150 
00151                 <?php
00152                 for ($o=0;$o<count($operation);$o++)
00153                 {
00154                         if ( $p_view != 'READ')
00155                                 {
00156                                         $rmOperation=sprintf("javascript:if ( confirm('"._('Voulez-vous effacer cette opération ')."')==true ) {remove_operation('%s','%s');}",
00157                                                         dossier::id(),
00158                                                         $operation[$o]['ago_id']);
00159                                         $js= '<a class="mtitle" style="color:orange" id="acop'.$operation[$o]['ago_id'].'" href="'.$rmOperation.'">'._("Effacer").'</a>';
00160                                         echo '<li id="op'.$operation[$o]['ago_id'].'">'.$operation[$o]['str_date']." ".HtmlInput::detail_op($operation[$o]['jr_id'],$operation[$o]['jr_internal'])." ".h($operation[$o]['jr_comment'])." "
00161                                                 .$js.'</li>';
00162                                 }
00163                                 else
00164                                 {
00165                                         echo '<li >'.$operation[$o]['str_date']." ".HtmlInput::detail_op($operation[$o]['jr_id'],$operation[$o]['jr_internal'])." ".h($operation[$o]['jr_comment'])." "
00166                                                 .'</li>';
00167                                 }
00168                 }
00169 
00170                 ?>
00171                 </ol>
00172                 <?php if ($p_view != 'READ')   echo '<span class="noprint">'.$iconcerned->input().'</span>';?>
00173         </div>
00174 
00175         <div style="float:left;width:45%">
00176                 <h4 style="display:inline"><?php echo _("Actions concernées")?></h4>
00177                 <ol>
00178 
00179                 <?php
00180                 $base=HtmlInput::request_to_string(array("gDossier","ac","sa","sb","sc","f_id"));
00181                 for ($o=0;$o<count($action);$o++)
00182                 {
00183                         if ( $p_view != 'READ')
00184                                 {
00185                         $rmAction=sprintf("javascript:if ( confirm('"._('Voulez-vous effacer cette action ')."')==true ) {remove_action('%s','%s','%s');}",
00186                                         dossier::id(),
00187                                         $action[$o]['ag_id'],$_REQUEST['ag_id']);
00188                         $showAction='<a class="line" href="'.$base."&ag_id=".$action[$o]['ag_id'].'">';
00189                         $js= '<a class="mtitle" style="color:orange" id="acact'.$action[$o]['ag_id'].'" href="'.$rmAction.'">'._("Effacer").'</a>';
00190                         echo '<li id="act'.$action[$o]['ag_id'].'">'.$showAction.$action[$o]['str_date']." ".$action[$o]['ag_ref']." ".
00191                                         h($action[$o]['sub_title']).'('.h($action[$o]['dt_value']).')</a>'." "
00192                                 .$js.'</li>';
00193                         } else {
00194                                 $showAction='<a class="line" href="'.$base."&ag_id=".$action[$o]['ag_id'].'">';
00195                                 echo '<li>'.$showAction.$action[$o]['str_date']." ".$action[$o]['ag_ref']." ".
00196                                         h($action[$o]['sub_title']).'('.h($action[$o]['dt_value']).')</a>'." "
00197                                 .'</li>';
00198                         }
00199                 }
00200 
00201                 ?>
00202                 </ol>
00203                 <?php if ( $p_view != 'READ') echo '<span class="noprint">'.$iaction->input().'</span>';?>
00204         </div>
00205 </fieldset>
00206 <div class="myfieldset">
00207   <h1 class="legend">
00208             <?php echo _('Description')?>
00209   </h1>
00210   <p>
00211 <script language="javascript">
00212    function enlarge(p_id_textarea){
00213    $(p_id_textarea).style.height=$(p_id_textarea).style.height+250+'px';
00214    $('bt_enlarge').style.display="none";
00215    $('bt_small').style.display="inline";
00216  }
00217 function small(p_id_textarea){
00218    $('bt_enlarge').style.display="inline";
00219    $('bt_small').style.display="none";
00220 
00221    }
00222 </script>
00223 <?php if  ($p_view != 'NEW') : ?>
00224 Document créé le <?php echo $this->ag_timestamp ?> par <?php echo $this->ag_owner?>
00225 <?php endif; ?>
00226    <h4 class="info"><?php echo _('Titre')?></h4>
00227     <p style="margin-left:100">
00228     <?php echo $title->input();
00229     ?>
00230 </p>
00231 <h4 class="info">   <?php echo _('Commentaire')?></h4>
00232     <div style="margin-left:100px">
00233    <?php
00234    $style_enl='style="display:inline"';$style_small='style="display:none"';
00235 
00236 for( $c=0;$c<count($acomment);$c++){
00237         if ( $p_view != 'READ')
00238         {
00239                 $rmComment=sprintf("javascript:if ( confirm('"._('Voulez-vous effacer ce commentaire')." ?')==true ) {remove_comment('%s','%s');}",
00240                                                 dossier::id(),
00241                                                 $acomment[$c]['agc_id']);
00242                                 $js= '<a class="mtitle" style="color:red" id="accom'.$acomment[$c]['agc_id'].'" href="'.$rmComment.'">Effacer</a>';
00243                 echo hb('n°'.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').$js.
00244                                 '<pre style="white-space: -moz-pre-wrap;white-space: pre-wrap;border:1px solid blue;width:80%;" id="com'.$acomment[$c]['agc_id'].'"> '.
00245                                 " ".h($acomment[$c]['agc_comment']).'</pre>'
00246                                 ;
00247         }
00248         else
00249         {
00250                 echo hb('n°'.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').
00251                                 '<pre style="white-space: -moz-pre-wrap;white-space: pre-wrap;border:1px solid blue;width:80%;" id="com'.$acomment[$c]['agc_id'].'"> '.
00252                                 " ".h($acomment[$c]['agc_comment']).'</pre>'
00253                                 ;
00254 
00255         }
00256 }
00257 echo '<span class="noprint">';
00258 echo $desc->input();
00259 echo '</span>';
00260 ?>
00261 <?php if ($p_view != "READ" ): ?>
00262 <p class="noprint">
00263 <input type="button" id="bt_enlarge" <?php echo $style_enl?> value="+" onclick="enlarge('ag_comment');return false;">
00264 <input type="button" id="bt_small"  <?php echo $style_small?> value="-" style="display:none" onclick="small('ag_comment');return false;">
00265 </p>
00266 <?php endif; ?>
00267   </div>
00268 </div>
00269 <?php if ( $p_view !='READ'  ) :?>
00270 <input type='button' class="button" class="noprint" value='Montrer articles' id="toggleButton" onclick='toggleShowDetail()'>
00271 <?php endif; ?>
00272 <?php
00273 /**
00274  * check if there card to show,
00275  */
00276 $show_row=0;
00277 for ($i=0;$i<count($aArticle);$i++) :
00278         if ( ($aCard[$i] != 0 && $p_view == 'READ') || $p_view != 'READ'){ $show_row=1;break;}
00279 endfor;
00280 ?>
00281 <?php
00282 /*
00283  * display detail if there card or if we are in UPDATE or NEW mode
00284  */
00285 if ($show_row !=0 ) :
00286 
00287         ?>
00288 <fieldset id="fldDetail" style='display:block'>
00289    <LEGEND> <?php echo _('Détail des articles')?>
00290 </LEGEND>
00291 <?php // hidden fields
00292 $show_row=0;
00293 for ($i=0;$i<count($aArticle);$i++) :
00294         echo $aArticle[$i]['ad_id'];
00295         echo $aArticle[$i]['hidden_tva'];
00296         echo $aArticle[$i]['hidden_htva'];
00297         if ( ($aCard[$i] != 0 && $p_view == 'READ') || $p_view != 'READ'){ $show_row=1;}
00298 endfor;
00299 ?>
00300     <div>
00301 <table style="width:100%" id="art" >
00302 <tr>
00303   <th><?php echo _('Fiche')?></th>
00304   <th><?php echo _('Description')?></th>
00305   <th><?php echo _('prix unitaire')?></th>
00306 <th><?php echo _('quantité')?></th>
00307 <th><?php echo _('Code TVA')?></th>
00308 <th><?php echo _('Montant TVA')?></th>
00309 <th><?php echo _('Montant TVAC')?></th>
00310 
00311 </tr>
00312 <?php for ($i=0;$i<count($aArticle);$i++): ?>
00313 <?php
00314 if ( ($aCard[$i] != 0 && $p_view == 'READ') || $p_view != 'READ'):
00315         $show_row++;
00316         ?>
00317 <TR>
00318 <TD><?php echo $aArticle[$i]['fid'] ?></TD>
00319 <TD><?php echo $aArticle[$i]['desc'] ?></TD>
00320 <TD class="num"><?php echo $aArticle[$i]['pu'] ?></TD>
00321 <TD class="num"><?php echo $aArticle[$i]['quant'] ?></TD>
00322 <TD class="num"><?php echo $aArticle[$i]['tvaid'] ?></TD>
00323 <TD class="num"><?php echo $aArticle[$i]['tva'] ?></TD>
00324 <TD class="num"><?php echo $aArticle[$i]['tvac'] ?></TD>
00325 </TR>
00326 <?php endif; ?>
00327 <?php endfor; ?>
00328 </table>
00329     </div>
00330 <script language="JavaScript">
00331 if ( $('e_march0') && $('e_march0').value =='') { toggleShowDetail();}
00332 function toggleShowDetail() {
00333         try {var detail=g('fldDetail');
00334         var but=g('toggleButton');
00335         if (detail.style.display=='block' ) { but.value="<?php echo _("Montrer les détails")?>";detail.style.display='none';}
00336         else { but.value="<?php echo _("Cacher les détails")?>";detail.style.display='block';} }
00337         catch (error)  {alert(error);}
00338         }
00339 
00340 </script>
00341 <?php if ( $show_row != 0 ): ?>
00342 <div style="float: right; text-align: right; padding-right: 5px; font-size: 1.2em; font-weight: bold; color: blue;">
00343   
00344     <div style="float: right; text-align: left; font-size: 1.2em; font-weight: bold; color: blue;" id="sum">
00345     <br><span style="text-align: right" id="htva">0.0</span>
00346      <br><span style="text-align: right"  id="tva">0.0</span>
00347     <br><span style="text-align: right" id="tvac">0.0</span>
00348  </div>
00349 
00350 <div style="float: right; text-align: right; padding-right: 5px; font-size: 1.2em; font-weight: bold; color: blue;">
00351     <br>Total HTVA
00352     <br>Total TVA
00353     <br>Total TVAC
00354  </div>
00355 
00356  <?php if ( ! $readonly ) :  ?>
00357     <div  style="position:float;float:right">
00358     <input name="act" id="act_bt" class="smallbutton" value="<?php echo _('Actualiser')?>" onclick="compute_all_ledger();" type="button">
00359      <input type="button" class="smallbutton" onclick="gestion_add_row()" value="<?php echo _("Ajouter une ligne")?>">
00360      </div>
00361      
00362 <?php endif; ?>         
00363 </div>
00364 <?php if ( $this->ag_id != 0 && ! $readonly) : ?>
00365      <div  style="position:float;float:left">
00366          <p>
00367          <?php
00368             $query=  http_build_query(array('gDossier'=>Dossier::id(),'ag_id'=>$this->ag_id,'create_invoice'=>1,'ac'=>$menu->get('code_invoice')));
00369             echo HtmlInput::button_anchor(_("Transformer en facture"),"do.php?".$query,"create_invoice", '  target="_blank" ',"button");
00370          ?>
00371          </p>
00372       </div>
00373      <?php endif; ?>
00374 <?php endif; ?>
00375 </fieldset>
00376 <?php endif; ?>
00377 
00378 <?php if ($p_view != 'READ' && $str_select_doc != '') : ?>
00379 <fieldset class="noprint" >
00380   <legend>
00381      <?php echo _('Document à générer')?>
00382   </legend>
00383   <?php echo $str_select_doc;
00384  echo $str_submit_generate;
00385   ?>
00386 </fieldset>
00387 <?php endif; ?>
00388 
00389 
00390 <fieldset>
00391   <legend>
00392      <?php echo _('Pièces attachées')?>
00393   </legend>
00394   <div class="print">
00395       <table>
00396   <?php
00397 for ($i=0;$i<sizeof($aAttachedFile);$i++) :
00398   ?>
00399 
00400       <tr>
00401           <td>
00402               <A class="print" style="display:inline" id="<?php echo "doc".$aAttachedFile[$i]['d_id'];?>" href="<?php echo $aAttachedFile[$i]['link']?>">
00403           <?php echo $aAttachedFile[$i]['d_filename'];?>         </a>
00404           </td>
00405           <td>
00406         <label> : </label>
00407         <span id="print_desc<?php echo $aAttachedFile[$i]['d_id'];?>"> <?php echo h($aAttachedFile[$i]['d_description'])?>
00408        <?php if ($p_view != 'READ') : ?> 
00409         <?php 
00410             $js=sprintf("javascript:show_description('%s')",$aAttachedFile[$i]['d_id']);
00411         ?>
00412         <a class="line"  id="<?php echo 'desc'.$aAttachedFile[$i]['d_id'];?>" onclick="<?php echo $js?>"><?php echo _("Modifier")?></a>    
00413         
00414         </span>
00415         </td>
00416         <td>
00417         <span class="noprint" id="input_desc<?php echo $aAttachedFile[$i]['d_id'];?>" style="display:none" >
00418               <input type="input" class="input_text" id="input_desc_txt<?php echo $aAttachedFile[$i]['d_id'];?>" value="<?php echo h($aAttachedFile[$i]['d_description'])?>">
00419               <?php 
00420               $js=sprintf("update_document('%s','%s')",dossier::id(),$aAttachedFile[$i]['d_id']);
00421               echo HtmlInput::button('save_desc'.$aAttachedFile[$i]['d_id'], _('Sauve'), 'onclick="'.$js.'"','smallbutton');
00422               ?>
00423         </span>
00424         <?php else: ?>
00425         </span>
00426         <?php endif;?>
00427 <?php $rmDoc=sprintf("javascript:if ( confirm('"._('Voulez-vous effacer le document')." %s')==true ) {remove_document('%s','%s');}",
00428         $aAttachedFile[$i]['d_filename'],
00429         dossier::id(),
00430         $aAttachedFile[$i]['d_id']);
00431     ?>
00432         </td>
00433         <td>
00434   <?php if ($p_view != 'READ') : ?>  <a class="line"  id="<?php echo "ac".$aAttachedFile[$i]['d_id'];?>" href="<?php echo $rmDoc;?>"><?php echo _("Effacer")?></a><?php endif;?>
00435         </td>
00436   </tr>
00437   <?php
00438 endfor;
00439   ?>
00440   </table>
00441   </div>
00442   <script language="javascript">
00443 function addFiles() {
00444 try {
00445         docAdded=document.getElementById('add_file');
00446         new_element=document.createElement('li');
00447         new_element.innerHTML='<input class="inp" type="file" value="" name="file_upload[]"/><br><label>Description</label><input type="input" class="input_text" name="input_desc[]" >';
00448         docAdded.appendChild(new_element);
00449 }
00450 catch(exception) { alert('<?php echo j(_('Je ne peux pas ajouter de fichier'))?>'); alert(exception.message);}
00451 }
00452 </script>
00453 <?php if ($p_view != 'READ') : ?>
00454   <div class="noprint">
00455      <h3 >Fichiers à ajouter: </h3>
00456     <ol id='add_file'  >
00457       <li>
00458         <?php echo $upload->input();
00459         ?>
00460         <label><?php echo _('Description')?></label>
00461         <input type="input" class="input_text" name="input_desc[]" >
00462       </li>
00463     </ol>
00464   <span   >
00465  <input type="button" class="smallbutton" onclick="addFiles();" value="<?php echo _("Ajouter un fichier")?>">
00466   </span>
00467   </div>
00468  <?php endif;?>
00469 </fieldset>
00470 </div>
00471 <script>compute_all_ledger()</script>
 All Data Structures Namespaces Files Functions Variables Enumerations