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