Cosmétique

1. Remplace le caractère x pour enlever des opérations par une constante
2. Ajoute les numéros de pièces dans le tableau de bord pour client, fournisseur et dernières opérations
3. Enlève les boutons "Ajout tag" et ajout concernés si  l'utilisateur n'a pas accès
This commit is contained in:
Dany De Bontridder 2015-06-04 23:01:46 +02:00
parent 49d75c2ad6
commit cfe31a1afe
9 changed files with 49 additions and 14 deletions

View file

@ -291,7 +291,7 @@ case 'file':
echo '<div class="op_detail_frame">';
$x='';
if ($access=='W' && $g_user->check_action (RMRECEIPT) == 1)
$x=sprintf('<a class="smallbutton" style="margin-left:12;margin-right:12" href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return confirm(\'Effacer le document ?\')">&#x2D5D;</a>',
$x=sprintf('<a class="smallbutton" style="margin-left:12;margin-right:12" href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return confirm(\'Effacer le document ?\')">'.SMALLX.'</a>',
$gDossier,$div,$jr_id);
$filename= $obj->det->jr_pj_name;
@ -333,7 +333,7 @@ case 'loadfile':
// check if the user can remove a document
if ($g_user->check_action (RMRECEIPT) == 1) {
$x=sprintf('<a class="mtitle" class="notice" style="margin-left:12;margin-right:12px" href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return confirm(\'Effacer le document ?\')">'."&#x2D5D;".'</a>',
$x=sprintf('<a class="mtitle" class="notice" style="margin-left:12;margin-right:12px" href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return confirm(\'Effacer le document ?\')">'.SMALLX.'</a>',
$gDossier,$div,$jr_id);
echo $x;
}

View file

@ -1067,6 +1067,12 @@ function ajax_xml_error($p_code,$p_string)
</data>
EOF;
}
/**
* @brief Display a box with the contains
* @param type $p_array Data to display
* @param type $p_title Title of the box
* @param type $p_div id of the box
*/
function display_dashboard_operation($p_array,$p_title,$p_div)
{
?>
@ -1078,6 +1084,7 @@ function display_dashboard_operation($p_array,$p_title,$p_div)
<table class="result">
<tr>
<th><?php echo _('Date')?></th>
<th><?php echo _('Pièce')?></th>
<th><?php echo _('Code Interne')?></th>
<th><?php echo _('Description')?></th>
<th>
@ -1095,6 +1102,9 @@ function display_dashboard_operation($p_array,$p_title,$p_div)
<td>
<?php echo HtmlInput::detail_op($p_array[$i]['jr_id'], $p_array[$i]['jr_internal']) ?>
</td>
<td>
<?php echo h($p_array[$i]['jr_pj_number'])?>
</td>
<td>
<?php echo h($p_array[$i]['jr_comment']) ?>
</td>

View file

@ -3783,7 +3783,17 @@ class Acc_Ledger extends jrn_def_sql
throw $e;
}
}
/**
* Get operation from the ledger type before, after or with the
* given date . The array is filtered by the ledgers granted to the
* user
* @global type $g_user
* @param $p_date Date (d.m.Y)
* @param $p_ledger_type VEN ACH
* @param type $sql_op < > or =
* @return array from jrn (jr_id, jr_internal, jr_date, jr_comment,jr_pj_number,jr_montant)
* @throws Exception
*/
function get_operation_date($p_date,$p_ledger_type,$sql_op)
{
global $g_user;
@ -3800,7 +3810,7 @@ class Acc_Ledger extends jrn_def_sql
}
$sql = "select jr_id, jr_internal, jr_date, jr_comment,jr_comment,jr_montant
$sql = "select jr_id, jr_internal, jr_date, jr_comment,jr_pj_number,jr_montant
from jrn
join jrn_def on (jrn_def_id=jr_def_id)
where

View file

@ -1528,6 +1528,7 @@ class Follow_Up
*/
function tag_cell()
{
global $g_user;
$a_tag=$this->tag_get();
$c=count($a_tag);
for ($e=0;$e<$c;$e++) {
@ -1535,13 +1536,17 @@ class Follow_Up
$a_tag[$e]['t_id']);
echo '<span style="border:1px solid black;margin-right:5px;">';
echo $a_tag[$e]['t_tag'];
echo HtmlInput::anchor( " &#x2D5D; ", "javascript:void(0)", $js_remove, ' class="smallbutton" style="padding:0px;display:inline" ');
if ($g_user->can_write_action($this->ag_id) == true )
{ HtmlInput::anchor( SMALLX, "javascript:void(0)", $js_remove, ' class="smallbutton" style="padding:0px;display:inline" ');}
echo '</span>';
echo '&nbsp;';
echo '&nbsp;';
}
$js=sprintf("onclick=\"action_tag_select('%s','%s')\"",dossier::id(),$this->ag_id);
echo HtmlInput::button('tag_bt', 'Ajout tag',$js, 'smallbutton');
if ($g_user->can_write_action($this->ag_id) == true )
{
echo HtmlInput::button('tag_bt', 'Ajout tag',$js, 'smallbutton');
}
}
static function action_tag_remove($cn,$p_array)
@ -1692,7 +1697,7 @@ class Follow_Up
$a_linked[$i]['f_id'],$this->ag_id);
echo '<span style="border:1px solid black;margin-right:5px;">';
echo $qc;
echo HtmlInput::anchor( " &#x2D5D; ", "javascript:void(0)", $js_remove, ' class="smallbutton" style="padding:0px;display:inline" ');
echo HtmlInput::anchor(SMALLX, "javascript:void(0)", $js_remove, ' class="smallbutton" style="padding:0px;display:inline" ');
echo '</span>';
echo '&nbsp;';
echo '&nbsp;';

View file

@ -904,7 +904,7 @@ class HtmlInput
$rmOperation=sprintf("javascript:if ( confirm('"._('Voulez-vous effacer cette relation ')."')==true ) {remove_operation('%s','%s');}",
dossier::id(),
$p_operation);
$js= '<a class="tinybutton" id="acop'.$p_operation.'" href="'.$rmOperation.'">'."&#x2D5D;".'</a>';
$js= '<a class="tinybutton" id="acop'.$p_operation.'" href="'.$rmOperation.'">'.SMALLX.'</a>';
return $js;
}
static function button_action_add_concerned_card($p_agid)

View file

@ -100,7 +100,7 @@ class Tag
echo h($this->data->t_tag);
echo HtmlInput::hidden($p_prefix.'tag[]', $this->data->t_id);
$js=sprintf("$('sp_".$p_prefix.$this->data->t_id."').remove();");
echo HtmlInput::anchor( " &#x2D5D; ", "javascript:void(0)", "onclick=\"$js\"", ' class="smallbutton " style="padding:0px;display:inline" ');
echo HtmlInput::anchor( SMALLX, "javascript:void(0)", "onclick=\"$js\"", ' class="smallbutton " style="padding:0px;display:inline" ');
echo '</span>';
}
/**

View file

@ -266,6 +266,10 @@ for($i=0;$i<count($last_ledger);$i++):
<td>
<?php echo $last_ledger[$i]['jrn_def_code']?>
</td>
<td>
<?php echo $last_ledger[$i]['jr_pj_number']?>
</td>
<td>
<?php echo h(mb_substr($last_ledger[$i]['jr_comment'],0,40,'UTF-8'))?>
</td>

View file

@ -49,7 +49,10 @@
<?php echo _('Contact')?>
</TD>
<TD>
<?php echo $ag_contact->search().$ag_contact->input();
<?php
if ($g_user->can_write_action($this->ag_id) == true ):
echo $ag_contact->search().$ag_contact->input();
endif;
?>
</td>
</Tr>
@ -66,7 +69,10 @@
<td id="concerned_card_td">
<?php
echo $this->display_linked();
echo HtmlInput::button_action_add_concerned_card( $this->ag_id)?>
if ($g_user->can_write_action($this->ag_id) == true ):
echo HtmlInput::button_action_add_concerned_card( $this->ag_id);
endif;
?>
</td>
<td>
@ -191,7 +197,7 @@
dossier::id(),
$action[$o]['ag_id'],$_REQUEST['ag_id']);
$showAction='<a class="line" href="'.$base."&ag_id=".$action[$o]['ag_id'].'">';
$js= '<a class="tinybutton" id="acact'.$action[$o]['ag_id'].'" href="'.$rmAction.'">&#x2D5D;</a>';
$js= '<a class="tinybutton" id="acact'.$action[$o]['ag_id'].'" href="'.$rmAction.'">'.SMALLX.'</a>';
echo '<li id="act'.$action[$o]['ag_id'].'">'.$showAction.$action[$o]['str_date']." ".$action[$o]['ag_ref']." ".
h($action[$o]['sub_title']).'('.h($action[$o]['dt_value']).')</a>'." "
.$js.'</li>';
@ -268,7 +274,7 @@ for( $c=0;$c<count($acomment);$c++){
$rmComment=sprintf("javascript:if ( confirm('"._('Voulez-vous effacer ce commentaire')." ?')==true ) {remove_comment('%s','%s');}",
dossier::id(),
$acomment[$c]['agc_id']);
$js= '<a class="tinybutton" id="accom'.$acomment[$c]['agc_id'].'" href="'.$rmComment.'">&#x2D5D;</a>';
$js= '<a class="tinybutton" id="accom'.$acomment[$c]['agc_id'].'" href="'.$rmComment.'">'.SMALLX.'</a>';
echo hb('n°'.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').$js.
'<pre style="white-space: -moz-pre-wrap;white-space: pre-wrap;border:1px solid blue;width:80%;" id="com'.$acomment[$c]['agc_id'].'"> '.
" ".h($acomment[$c]['agc_comment']).'</pre>'

View file

@ -166,7 +166,7 @@ if ($aRap != null ) {
$amount=$array_jr[0]['jr_montant'];
$str="modifyOperation(".$aRap[$e].",".$gDossier.")";
$rmReconciliation=new IButton('rmr');
$rmReconciliation->label='&#x2D5D;';
$rmReconciliation->label=SMALLX;
$rmReconciliation->class="tinybutton";
$rmReconciliation->javascript="if (confirm ('vous confirmez?') ) {";
$rmReconciliation->javascript.=sprintf('dropLink(\'%s\',\'%s\',\'%s\',\'%s\');deleteRowRec(\'%s\',this);}',