use mb_substr instead of substr + force to work internally in UTF8
This commit is contained in:
parent
4ca178f8e8
commit
1f2522a579
30 changed files with 50 additions and 40 deletions
|
|
@ -680,7 +680,6 @@ EXCLUDE_PATTERNS = a?.php \
|
|||
effects.js \
|
||||
prototype.js \
|
||||
scriptaculous.js \
|
||||
scripts.js \
|
||||
slider.js \
|
||||
sound.js \
|
||||
unittest.js.
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ require_once('class_user.php');
|
|||
require_once('class_extension.php');
|
||||
if ( !isset ($_REQUEST['gDossier'])) exit();
|
||||
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
$cn=new Database(dossier::id());
|
||||
$user=new User($cn);
|
||||
$user->check(true);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ require_once('function_javascript.php');
|
|||
require_once('ac_common.php');
|
||||
require_once ('class_user.php');
|
||||
require_once ('class_fiche_attr.php');
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
$var=array('gDossier','op','ctl');
|
||||
$cont=0;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ require_once('class_html_input.php');
|
|||
require_once('class_acc_account.php');
|
||||
require_once('class_exercice.php');
|
||||
$div=$_REQUEST['div'];
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
/**
|
||||
*if $_SESSION['g_user'] is not set : echo a warning
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ if ( ! isset ($_REQUEST['act'])|| ! isset ($_REQUEST['jr_id'])
|
|||
exit();
|
||||
}
|
||||
global $g_parameter;
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
|
||||
$action=$_REQUEST['act'];
|
||||
|
|
@ -264,7 +265,7 @@ case 'file':
|
|||
$filename= $obj->det->jr_pj_name;
|
||||
if ( strlen($obj->det->jr_pj_name) > 20 )
|
||||
{
|
||||
$filename=substr($obj->det->jr_pj_name,0,23);
|
||||
$filename=mb_substr($obj->det->jr_pj_name,0,23);
|
||||
}
|
||||
$h=sprintf('<a class="mtitle" href="show_pj.php?gDossier=%d&jrn=%d&jr_grpt_id=%d">%s</a>',
|
||||
$gDossier,$ledger,$obj->det->jr_grpt_id,h( $filename));
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ require_once('class_iradio.php');
|
|||
require_once('function_javascript.php');
|
||||
require_once('ac_common.php');
|
||||
require_once ('class_user.php');
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
$var = array('gDossier', 'op');
|
||||
$cont = 0;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ require_once('class_acc_ledger.php');
|
|||
require_once ('class_database.php');
|
||||
require_once('function_javascript.php');
|
||||
require_once('class_acc_account_ledger.php');
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
extract($_REQUEST);
|
||||
$var=array('gDossier','op','ctl');
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ require_once ('class_dossier.php');
|
|||
require_once ('class_todo_list.php');
|
||||
require_once ('class_database.php');
|
||||
require_once ('class_user.php');
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
$cn= Dossier::connect();
|
||||
$user=new User($cn);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ require_once('user_common.php');
|
|||
require_once('ac_common.php');
|
||||
require_once 'function_javascript.php';
|
||||
require_once 'constant.security.php';
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
// if gDossier is not set redirect to form to choose a folder
|
||||
if ( ! isset($_REQUEST['gDossier']))
|
||||
{
|
||||
|
|
@ -127,6 +129,7 @@ $module_selected = -1;
|
|||
|
||||
if (isset($_REQUEST['ac']))
|
||||
{
|
||||
$_REQUEST['ac']= strtoupper($_REQUEST['ac']);
|
||||
$all = explode('/', $_REQUEST['ac']);
|
||||
$module_selected = $all[0];
|
||||
$g_user->audit();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ require_once('class_database.php');
|
|||
require_once('class_user.php');
|
||||
$gDossier=dossier::id();
|
||||
$cn=new Database($gDossier);
|
||||
|
||||
mb_internal_encoding("UTF-8");
|
||||
$g_user=new User($cn);
|
||||
$g_user->Check();
|
||||
$action=$g_user->check_dossier($gDossier);
|
||||
|
|
|
|||
|
|
@ -829,7 +829,7 @@ function show_module($selected)
|
|||
}
|
||||
else
|
||||
{
|
||||
var_dump($file);
|
||||
// nothing : direct call to plugin
|
||||
}
|
||||
}
|
||||
if ( $file[0]['me_javascript'] != '')
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ function ShowActionList($cn,$p_base)
|
|||
{
|
||||
// show the search menu
|
||||
?>
|
||||
<div id="search_action" style="position:absolute;display:none;margin-left:120px;width:70%;clear:both;background-color: inherit;z-index:2;border:1px #000080 solid">
|
||||
<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')?>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
require_once('class_ipopup.php');
|
||||
global $g_user;
|
||||
$retour=HtmlInput::button_anchor(_('Retour liste'),'?ac='.$_REQUEST['ac'].'&my_action&'.dossier::get());
|
||||
$retour=HtmlInput::button_anchor(_('Retour liste'),'?ac='.$_REQUEST['ac'].'&my_action&'.dossier::get()."&".HtmlInput::get_to_string(array("qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_action")));
|
||||
//-----------------------------------------------------
|
||||
// Follow_Up
|
||||
//-----------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -290,8 +290,8 @@ if ( isset($_GET['view'] ) )
|
|||
foreach (array(3,2,1) as $ind)
|
||||
{
|
||||
if ( ! isset($_GET['lvl'.$ind]))continue;
|
||||
if (${'lvl'.$ind.'_old'} == '') ${'lvl'.$ind.'_old'}=substr($r['poste'],0,$ind);
|
||||
if ( ${'lvl'.$ind.'_old'} != substr($r['poste'],0,$ind))
|
||||
if (${'lvl'.$ind.'_old'} == '') ${'lvl'.$ind.'_old'}=mb_substr($r['poste'],0,$ind);
|
||||
if ( ${'lvl'.$ind.'_old'} != mb_substr($r['poste'],0,$ind))
|
||||
{
|
||||
|
||||
echo '<tr style="font-size:12px;font-height:bold">';
|
||||
|
|
@ -303,7 +303,7 @@ if ( isset($_GET['view'] ) )
|
|||
echo td(nbm(${'lvl'.$ind}['solde_cred']),'style="text-align:right"');
|
||||
|
||||
echo '</tr>';
|
||||
${'lvl'.$ind.'_old'}=substr($r['poste'],0,$ind);
|
||||
${'lvl'.$ind.'_old'}=mb_substr($r['poste'],0,$ind);
|
||||
foreach(array('sum_cred','sum_deb','solde_deb','solde_cred') as $a)
|
||||
{
|
||||
${'lvl'.$ind}[$a]=0;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ require_once('class_follow_up.php');
|
|||
$sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
|
||||
$ag_id=(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
|
||||
$p_action=$_REQUEST['ac'];
|
||||
$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id'];
|
||||
$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::get_to_string(array("qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_action"));
|
||||
$retour=HtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base);
|
||||
$fiche=new Fiche($cn,$_REQUEST['f_id']);
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class Acc_Account
|
|||
if ($count != 0)
|
||||
throw new Exception('Impossible de changer la valeur: poste déjà utilisé');
|
||||
}
|
||||
$this->pcm_lib=substr($this->pcm_lib,0,150);
|
||||
$this->pcm_lib=mb_substr($this->pcm_lib,0,150);
|
||||
$this->check();
|
||||
$sql="update tmp_pcmn set pcm_val=$1, pcm_lib=$2,pcm_val_parent=$3,pcm_type=$4 where pcm_val=$5";
|
||||
$Ret=$this->db->exec_sql($sql,array($this->pcm_val,
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class Acc_Balance
|
|||
$poste=new Acc_Account($cn,$r['j_poste']);
|
||||
|
||||
$a['poste']=$r['j_poste'];
|
||||
$a['label']=substr($poste->get_lib(),0,40);
|
||||
$a['label']=mb_substr($poste->get_lib(),0,40);
|
||||
$a['sum_deb']=round($r['sum_deb'],2);
|
||||
$a['sum_cred']=round($r['sum_cred'],2);
|
||||
$a['solde_deb']=round(( $a['sum_deb'] >= $a['sum_cred'] )? $a['sum_deb']- $a['sum_cred']:0,2);
|
||||
|
|
|
|||
|
|
@ -1078,7 +1078,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
{
|
||||
$p_array['TVAC']=$code['j_montant'];
|
||||
|
||||
$p_array['client']=($trunc==0)?$fiche->getName():substr($fiche->getName(),0,20);
|
||||
$p_array['client']=($trunc==0)?$fiche->getName():mb_substr($fiche->getName(),0,20);
|
||||
$p_array['reversed']=false;
|
||||
if ( $fiche_def_id == FICHE_TYPE_CLIENT && $code['j_debit']=='f')
|
||||
{
|
||||
|
|
@ -1103,7 +1103,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
{
|
||||
$p_array['TVAC']=$code['j_montant'];
|
||||
|
||||
$p_array['client']= ($trunc==0)?$fiche->getName():substr($fiche->getName(),0,20);
|
||||
$p_array['client']= ($trunc==0)?$fiche->getName():mb_substr($fiche->getName(),0,20);
|
||||
$p_array['reversed']=false;
|
||||
if ($p_jrn_type == 'ACH' && $code['j_debit']=='t')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -227,9 +227,9 @@ class Anc_Balance_Double extends Anc_Print
|
|||
{
|
||||
$row=$array[$i];
|
||||
$pdf->Cell(20,6,$row['a_po_name'],0,0,'L');
|
||||
$pdf->Cell(40,6,substr($row['a_po_description'],0,31),0,0,'L');
|
||||
$pdf->Cell(40,6,mb_substr($row['a_po_description'],0,31),0,0,'L');
|
||||
$pdf->Cell(20,6,$row['b_po_name'],0,0,'L');
|
||||
$pdf->Cell(40,6,substr($row['b_po_description'],0,31),0,0,'L');
|
||||
$pdf->Cell(40,6,mb_substr($row['b_po_description'],0,31),0,0,'L');
|
||||
$pdf->Cell(20,6,$row['a_d'],0,0,'R');
|
||||
$pdf->Cell(20,6,$row['a_c'],0,0,'R');
|
||||
$pdf->Cell(20,6,$row['a_solde'],0,0,'R');
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ class Follow_Up
|
|||
|
||||
/* get template */
|
||||
ob_start();
|
||||
require_once ('template/detail-action.php');
|
||||
require_once 'template/detail-action.php';
|
||||
$content=ob_get_contents();
|
||||
ob_end_clean();
|
||||
$r.=$content;
|
||||
|
|
@ -513,7 +513,7 @@ class Follow_Up
|
|||
}
|
||||
// New referecne
|
||||
ob_start();
|
||||
require_once ('template/action-reference.php');
|
||||
require_once 'template/action-reference.php';
|
||||
$content=ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
|
@ -746,7 +746,7 @@ class Follow_Up
|
|||
//show the sub_action
|
||||
foreach ($a_row as $row )
|
||||
{
|
||||
$href='<A class="document" HREF="do.php?'.$p_base.'&sa=detail&ag_id='.$row['ag_id'].'&'.$str_dossier.'&ac='.$_REQUEST['ac'].'">';
|
||||
$href='<A class="document" HREF="do.php?'.$p_base.'&sa=detail&ag_id='.$row['ag_id'].'&'.$str_dossier.'&ac='.$_REQUEST['ac']."&".HtmlInput::get_to_string(array("qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_action")).'">';
|
||||
$i++;
|
||||
$tr=($i%2==0)?'even':'odd';
|
||||
if ($row['ag_priority'] < 2) $tr='priority1';
|
||||
|
|
@ -755,7 +755,7 @@ class Follow_Up
|
|||
$date_remind= format_date($row['my_remind'], 'DD.MM.YYYY','YYYYMMDD');
|
||||
$date_today=date('Ymd');
|
||||
if ($date_remind !="" && $date_remind == $date_today) $st=' style="font-weight:bold;background:orange"';
|
||||
if ($date_remind !="" && $date_remind < $date_today) $st=' style="font-weight:bold;background:#FF1C42"';
|
||||
if ($date_remind !="" && $date_remind < $date_today) $st=' style="font-weight:bold;background:#FF0000"';
|
||||
$r.="<tr class=\"$tr\" $st>";
|
||||
$r.="<td>".$href.smaller_date($row['my_date']).'</a>'."</td>";
|
||||
$r.="<td>".$href.smaller_date($row['my_remind']).'</a>'."</td>";
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
|
||||
/*!\file
|
||||
* \brief Html Input
|
||||
* \brief Html Input
|
||||
*/
|
||||
require_once('class_html_input.php');
|
||||
class ISpan extends HtmlInput
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class Print_Ledger_Misc extends PDF
|
|||
$this->Cell(10,5,$row['date_fmt']);
|
||||
$this->Cell(20,5,$row['internal']);
|
||||
$type=$this->cn->get_value("select jrn_def_type from jrn_def where jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
|
||||
$other=substr($this->ledger->get_tiers($type,$a_jrn[$i]['id']),0,25);
|
||||
$other=mb_substr($this->ledger->get_tiers($type,$a_jrn[$i]['id']),0,25);
|
||||
$this->Cell(25,5,$other,0,0);
|
||||
$this->Cell(80,5,$row['comment'],0,0);
|
||||
$this->Cell(15,5,nbm($row['montant']),0,0,'R');
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class Print_Ledger_Simple extends PDF
|
|||
list($qc,$name)=$this->get_tiers($row['id'],$this->jrn_type);
|
||||
$this->Cell(40,5,"[".$qc."]".$name,0,0);
|
||||
|
||||
$this->Cell(65,5,substr($row['comment'],0,47),0,0);
|
||||
$this->Cell(65,5,mb_substr($row['comment'],0,47),0,0);
|
||||
|
||||
/* get other amount (without vat, total vat included, private, ND */
|
||||
$other=$this->ledger->get_other_amount($a_jrn[$i]['jr_grpt_id']);
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ class Todo_List
|
|||
}
|
||||
if ( strcmp ($p_idx, 'tl_title') == 0 )
|
||||
{
|
||||
$p_value=substr($p_value,0,120) ;
|
||||
$p_value=mb_substr($p_value,0,120) ;
|
||||
return true;
|
||||
}
|
||||
if ( strcmp ($p_idx, 'tl_desc') == 0 )
|
||||
{
|
||||
$p_value=substr($p_value,0,400) ;
|
||||
$p_value=mb_substr($p_value,0,400) ;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -128,7 +128,7 @@ class Todo_List
|
|||
{
|
||||
if ( $this->verify() != 0 ) return;
|
||||
if (trim($this->tl_title)=='')
|
||||
$this->tl_title=substr(trim($this->tl_desc),0,30);
|
||||
$this->tl_title=mb_substr(trim($this->tl_desc),0,30);
|
||||
|
||||
if (trim($this->tl_title)=='')
|
||||
{
|
||||
|
|
@ -137,7 +137,7 @@ class Todo_List
|
|||
}
|
||||
|
||||
/* limit the title to 35 char */
|
||||
$this->tl_title=substr(trim($this->tl_title),0,30);
|
||||
$this->tl_title=mb_substr(trim($this->tl_title),0,30);
|
||||
|
||||
$sql="insert into todo_list (tl_date,tl_title,tl_desc,use_login) ".
|
||||
" values (to_date($1,'DD.MM.YYYY'),$2,$3,$4) returning tl_id";
|
||||
|
|
@ -157,7 +157,7 @@ class Todo_List
|
|||
if ( $this->verify() != 0 ) return;
|
||||
|
||||
if (trim($this->tl_title)=='')
|
||||
$this->tl_title=substr(trim($this->tl_desc),0,40);
|
||||
$this->tl_title=mb_substr(trim($this->tl_desc),0,40);
|
||||
|
||||
if (trim($this->tl_desc)=='')
|
||||
{
|
||||
|
|
@ -166,7 +166,7 @@ class Todo_List
|
|||
}
|
||||
|
||||
/* limit the title to 35 char */
|
||||
$this->tl_title=substr(trim($this->tl_title),0,40);
|
||||
$this->tl_title=mb_substr(trim($this->tl_title),0,40);
|
||||
|
||||
$sql="update todo_list set tl_title=$1,tl_date=to_date($2,'DD.MM.YYYY'),tl_desc=$3 ".
|
||||
" where tl_id = $4";
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ $g_failed="<span style=\"font-size:18px;color:red\">✖</span>";
|
|||
$g_succeed="<span style=\"font-size:18px;color:green\">✓</span>";
|
||||
/*set to none for production */
|
||||
/* uncomment for production */
|
||||
$version_phpcompta=SVNINFO;
|
||||
define ("DEBUG",false);
|
||||
//$version_phpcompta=SVNINFO;
|
||||
//define ("DEBUG",false);
|
||||
|
||||
//$version_phpcompta=4800;
|
||||
//define ("DEBUG",true);
|
||||
$version_phpcompta=4800;
|
||||
define ("DEBUG",true);
|
||||
|
||||
define ("DBVERSION",102);
|
||||
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ if ( $sa == 'add' )
|
|||
for ($i=0;$i<$count;$i++)
|
||||
{
|
||||
$mod=Database::fetch_array($Res,$i);
|
||||
$template.='<OPTION VALUE="'.$mod['mod_id'].'"> '.h($mod['mod_name']." - ".substr($mod['mod_desc'],0,30));
|
||||
$template.='<OPTION VALUE="'.$mod['mod_id'].'"> '.h($mod['mod_name']." - ".mb_substr($mod['mod_desc'],0,30));
|
||||
}// for
|
||||
$template.="</SELECT>";
|
||||
}// if count = 0
|
||||
|
|
|
|||
|
|
@ -102,9 +102,9 @@ for ($e=0;$e<count($array);$e++)
|
|||
$pdf->Cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
|
||||
|
||||
$l++;
|
||||
$pdf->Cell($size[$l],6,substr($row['jrn_name'],0,14),0,0,$align[$l]);
|
||||
$pdf->Cell($size[$l],6,mb_substr($row['jrn_name'],0,14),0,0,$align[$l]);
|
||||
$l++;
|
||||
$pdf->Cell($size[$l],6,substr($row['description'],0,50).'('.$row['jr_internal'].')',0,0,$align[$l]);
|
||||
$pdf->Cell($size[$l],6,mb_substr($row['description'],0,50).'('.$row['jr_internal'].')',0,0,$align[$l]);
|
||||
|
||||
$l++;
|
||||
$pdf->Cell($size[$l],6,(($row['letter']!=-1)?$row['letter']:''),0,0,$align[$l]);
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ foreach ($a_poste as $poste)
|
|||
$pdf->Cell($width[$i], 6, $detail['jr_internal'], 0, 0, $lor[$i]);
|
||||
$i++;
|
||||
/* limit set to 20 for the substring */
|
||||
$pdf->Cell($width[$i], 6, substr($detail['description'],0,42), 0, 0, $lor[$i]);
|
||||
$pdf->Cell($width[$i], 6, mb_substr($detail['description'],0,42), 0, 0, $lor[$i]);
|
||||
$i++;
|
||||
$pdf->Cell($width[$i], 6, $detail['jr_pj_number'], 0, 0, $lor[$i]);
|
||||
$i++;
|
||||
|
|
|
|||
|
|
@ -114,9 +114,9 @@ foreach ($a_poste as $poste)
|
|||
else
|
||||
$pdf->Cell($size[$l],6,$row['jr_pj_number'],0,0,$align[$l]);
|
||||
$l++;
|
||||
$pdf->Cell($size[$l],6,substr($row['jrn_name'],0,14),0,0,$align[$l]);
|
||||
$pdf->Cell($size[$l],6,mb_substr($row['jrn_name'],0,14),0,0,$align[$l]);
|
||||
$l++;
|
||||
$pdf->Cell($size[$l],6, substr($row['description'],0,55),0,0,$align[$l]);
|
||||
$pdf->Cell($size[$l],6, mb_substr($row['description'],0,55),0,0,$align[$l]);
|
||||
$l++;
|
||||
$pdf->Cell($size[$l],6,(($row['letter']!=-1)?$row['letter']:''),0,0,$align[$l]);
|
||||
$l++;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if (isset($_POST['SAVE']))
|
|||
{
|
||||
if (substr_count($name, 'PRIV') != 0)
|
||||
{
|
||||
$db_id = substr($name, 4);
|
||||
$db_id = mb_substr($name, 4);
|
||||
$cn = new Database();
|
||||
$UserChange->set_folder_access($db_id, $elem);
|
||||
Dossier::synchro_admin($db_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue