integration menu dynamique

This commit is contained in:
Dany De Bontridder 2011-10-28 21:47:32 +00:00
parent 03e0464b93
commit 016bb6219e
7 changed files with 62 additions and 50 deletions

View file

@ -273,7 +273,7 @@ class Acc_Bilan
$form=fopen($this->b_file_form,'r');
if ( $form == false)
{
echo __FILE__.":".__LINE__.'Cannot Open'.$this->b_file_form;
echo 'Cannot Open';
exit();
}
return $form;
@ -285,7 +285,7 @@ class Acc_Bilan
$templ=fopen($this->b_file_template,'r');
if ( $templ == false)
{
echo __FILE__.":".__LINE__.'Cannot Open'.$this->b_file_template;
echo 'Cannot Open';
exit();
}
return $templ;
@ -296,7 +296,7 @@ class Acc_Bilan
* \param $p_handle the handle to the file
* \param
* \param
*
*
*
* \return
*/
@ -305,8 +305,10 @@ class Acc_Bilan
while (! feof ($p_handle))
{
$buffer=trim(fgets($p_handle));
if (strlen(trim($buffer))==0)
// $a=(CheckFormula($buffer) == true)?"$buffer ok<br>":'<font color="red">'.'Pas ok '.$buffer."</font><br>";
// echo $a;
// blank line are skipped
if (strlen(trim($buffer))==0)
continue;
// skip comment
if ( strpos($buffer,'#') === true )
@ -322,9 +324,9 @@ class Acc_Bilan
}// end read form line per line
}
/*!\brief generate the ods document
* \param the handle to the template file
* \return the xml
*@note
* \param the handle to the template file
* \return the xml
*@note
* Sur une seule ligne il y a plusieurs données, donc il y a plusieurs boucles, pour les autres documents
* cela devrait être fait aussi, actuellement ces documents, n'acceptent qu'une formule par ligne.
*@note
@ -350,13 +352,13 @@ class Acc_Bilan
ob_start();
/* unzip the document */
$zip = new Zip_Extended;
if ($zip->open($work_file) === TRUE)
if ($zip->open($work_file) === TRUE)
{
$zip->extractTo($dirname.DIRECTORY_SEPARATOR);
$zip->close();
} else
} else
{
echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
}
ob_end_clean();
@ -389,7 +391,7 @@ class Acc_Bilan
// the line contains the magic <<
$tmp="";
while (preg_match_all($regex,$line_rtf,$f2) > 0 )
{
// the f2 array contains all the magic << in the line
@ -604,13 +606,13 @@ class Acc_Bilan
case 'ods':
/* header("Pragma: public");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: must-revalidate");
header("Cache-Control: must-revalidate");
if ( $this->b_type == 'odt' )
header('Content-type: application/vnd.oasis.opendocument.text');
if ( $this->b_type == 'ods' )
header('Content-type: application/vnd.oasis.opendocument.spreadsheet');
header('Content-Disposition: attachment;filename="'.$this->b_name.'.odt"',FALSE);
header("Accept-Ranges: bytes");
header("Accept-Ranges: bytes");
*/
ob_start();
// save the file in a temp folder
@ -634,14 +636,14 @@ class Acc_Bilan
*/
ob_start();
$zip = new Zip_Extended;
if ($zip->open($work_file) === TRUE)
if ($zip->open($work_file) === TRUE)
{
$zip->extractTo($dirname.DIRECTORY_SEPARATOR);
$zip->close();
}
else
}
else
{
echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
}
// Remove the file we do not need anymore

View file

@ -22,6 +22,8 @@ global $g_user;
if ( $g_user->check_action(PARSTR)!=0) $m->MY_STRICT=$p_strict;
if ( $g_user->check_action(PARTVA)!=0)$m->MY_TVA_USE=$p_tva_use;
$m->MY_PJ_SUGGEST=$p_pj;
$m->MY_ALPHANUM=$p_alphanum;
$m->Update();
}
@ -37,6 +39,9 @@ global $g_user;
array('value'=>'Y','label'=>_('Oui'))
);
$alpha_num_array[0]=array('value'=>'N','label'=>_('Non'));
$alpha_num_array[1]=array('value'=>'Y','label'=>_('Oui'));
$compta=new ISelect();
$compta->table=1;
$compta->selected=$my->MY_ANALYTIC;
@ -60,6 +65,11 @@ global $g_user;
$check_periode=new ISelect();
$check_periode->table=1;
$check_periode->selected=$my->MY_CHECK_PERIODE;
$alpha_num=new ISelect();
$alpha_num->table=1;
$alpha_num->value=$alpha_num_array;
$alpha_num->selected=$my->MY_ALPHANUM;
// other parameters
$all=new IText();
@ -93,6 +103,8 @@ global $g_user;
echo "<tr>".td(_("Suggérer le numéro de pièce justificative"),'style="text-align:right"').$pj_suggest->input("p_pj",$strict_array)."</tr>";
echo "<tr>".td(_("Suggérer la date"),'style="text-align:right"').$date_suggest->input("p_date_suggest",$strict_array)."</tr>";
echo '<tr>'.td(_('Afficher la période comptable pour éviter les erreurs de date'),'style="text-align:right"').$check_periode->input('p_check_periode',$strict_array).'</tr>';
echo '<tr>'.td(_('Utilisez des postes comptables alphanumérique'),'style="text-align:right"').$alpha_num->input('p_alphanum').'</tr>';
echo "</table>";
echo HtmlInput::submit("record_company",_("Sauve"));
echo "</form>";

View file

@ -25,6 +25,7 @@
*/
require_once ('class_acc_ledger_fin.php');
require_once('class_ipopup.php');
global $g_user;
$gDossier=dossier::id();
@ -76,7 +77,7 @@ if ( $def == 1 )
$def_ledger=$Ledger->get_first('fin');
$Ledger->id=$def_ledger['jrn_def_id'];
}
$jrn_priv=$User->get_ledger_access($Ledger->id);
$jrn_priv=$g_user->get_ledger_access($Ledger->id);
// Check privilege
if ( isset($_REQUEST['p_jrn']) && ( $jrn_priv == 'X'))
{
@ -187,7 +188,7 @@ if ( $def == 2)
/* by default we should the default period */
if ( ! isset($p_array['date_start']))
{
$period=$User->get_periode();
$period=$g_user->get_periode();
$per=new Periode($cn,$period);
list($date_start,$date_end)=$per->get_date_limit();
$p_array['date_start']=$date_start;
@ -246,7 +247,7 @@ if ( $def==3)
.th('différence',' style="text-align:right"'));
// Filter the saldo
// on the current year
$filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
$filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')";
// for highligting tje line
$idx=0;
bcscale(2);
@ -265,7 +266,7 @@ if ( $def==3)
$saldo_not_reconcilied=$array[$i]->get_bk_balance($filter_year." and (trim(jr_pj_number) ='' or jr_pj_number is null)" );
/* get saldo for reconcilied operation */
$saldo_reconcilied=$array[$i]->get_bk_balance($filter_year." and ( trim(jr_pj_number) != '' and jr_pj_number is not null)" );
if ( $idx%2 != 0 )
@ -314,7 +315,7 @@ if ($def==4)
}
else
$Ledger->id=$_REQUEST['p_jrn'];
$jrn_priv=$User->get_ledger_access($Ledger->id);
$jrn_priv=$g_user->get_ledger_access($Ledger->id);
if ( isset($_GET["p_jrn"]) && $jrn_priv=="X")
{
NoAccess();
@ -351,7 +352,7 @@ if ($def==4)
echo HtmlInput::get_to_hidden(array('gDossier','ledger_type','ac','sa'));
$wLedger=$Ledger->select_ledger('FIN',3);
if ($wLedger == null ) exit ('Pas de journal disponible');
$wLedger->javascript="onchange='this.form.submit()';";
echo $wLedger->input();
echo HtmlInput::submit('ref','Rafraîchir');
@ -410,7 +411,7 @@ if ($def==4)
echo '</table>';
$bk_card=new Fiche($cn);
$bk_card->id=$Ledger->get_bank();
$filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
$filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')";
/* get saldo for not reconcilied operations */
$saldo_not_reconcilied=$bk_card->get_solde_detail($filter_year." and j_grpt in (select jr_grpt_id from jrn where trim(jr_pj_number) ='' or jr_pj_number is null)" );

View file

@ -32,9 +32,7 @@ require_once('class_exercice.php');
// Show the jrn and date
//-----------------------------------------------------
require_once('class_database.php');
global $g_user;
//-----------------------------------------------------
// Form
//-----------------------------------------------------
@ -54,18 +52,17 @@ $ex=new Exercice($cn);
$wex=$ex->select('exercice',$exercice,' onchange="submit(this)"');
echo $wex->input();
echo dossier::hidden();
echo HtmlInput::get_to_hidden(array('p_action','type'));
echo HtmlInput::get_to_hidden(array('ac','type'));
echo '</form>';
echo '</fieldset>';
$filter_year=" where p_exercice='".FormatString($exercice)."'";
echo '<FORM METHOD="GET">';
echo HtmlInput::hidden('p_action','impress');
echo HtmlInput::hidden('type','bilan');
echo dossier::hidden();
echo $bilan->display_form ($filter_year);
echo HtmlInput::submit('verif',_('Verification comptabilite'));
echo HtmlInput::get_to_hidden(array('exercice'));
echo HtmlInput::get_to_hidden(array('ac','exercice'));
echo '</FORM>';

View file

@ -196,8 +196,8 @@ if ( isset ( $_POST["Ajout"] ) )
if ( isset ( $p_val) && isset ( $p_lib ) )
{
$p_val=$cn->get_value('select format_account($1)',array($p_val));
$p_parent=$cn->get_value('select format_account($1)',array($_POST["p_parent"]));
$p_val=trim($p_val);
$p_parent=$_POST["p_parent"];
if ( strlen ($p_val) != 0 && strlen ($p_lib) != 0 )
{
if (strlen ($p_val) == 1 )

View file

@ -25,8 +25,8 @@ require_once('class_fiche.php');
/*!
**************************************************
* \brief show the listing of all goods
*
* \brief show the listing of all goods
*
*
*\param $cn database connection
* \param $p_year exercice
@ -38,7 +38,7 @@ function ViewStock($p_cn,$p_year)
// build sql -- get the different merchandise sold or bought
// during the p_year
/* $sql=" select distinct sg_code
from stock_goods
from stock_goods
left outer join jrnx on (stock_goods.j_id=jrnx.j_id)
right outer join parm_periode on (parm_periode.p_id=jrnx.j_tech_per)
where
@ -75,7 +75,7 @@ function ViewStock($p_cn,$p_year)
// sg_code and link to details
$result.="<td>".'<a class="one"
HREF="?p_action=stock&action=detail&sg_code='.$r['sg_code'].'&year='.$p_year.
HREF="?ac='.$_REQUEST['ac'].'&action=detail&sg_code='.$r['sg_code'].'&year='.$p_year.
'&'.dossier::get().'">'.
$r['sg_code']."</A></td>";
@ -116,12 +116,12 @@ function ViewStock($p_cn,$p_year)
/*!
************************************************************
* \brief return an array of f_id and f_name
*
*
*
*
* \param $p_cn database connection
* \param _sg_code stock_goods.sg_code
* \return
* - array (f_id, f_label) or null if nothing is found
* - array (f_id, f_label) or null if nothing is found
*/
function getFicheNameCode ($p_cn,$p_sg_code)
{
@ -153,9 +153,9 @@ function getFicheNameCode ($p_cn,$p_sg_code)
}
/*!
**************************************************
* \brief View the details of a stock
*
*
* \brief View the details of a stock
*
*
*\param $p_cn database connection
* \param$p_sg_code
* \param $p_year
@ -315,9 +315,9 @@ function ViewDetailStock($p_cn,$p_sg_code,$p_year)
}
/*!
**************************************************
* \brief
*
* parm :
* \brief
*
* parm :
* -
* gen :
* -
@ -344,7 +344,7 @@ function ChangeStock($p_sg_code,$p_year)
}
/*!
* \brief return the quantity of a sg_code for the period
* \brief return the quantity of a sg_code for the period
*
* \return number or NULL
*/

View file

@ -22,11 +22,10 @@
/*!\file
* \brief this file is used for the follow up of the customer (mail, meeting...)
* - p_action = supplier
* - sb = detail
* - sb = detail
* - sc = sv
* - sd = this parameter is used here
* - $cn = database connection
* - $cn = database connection
*/
require_once('class_action.php');
$g_user->can_request(GECOUR);
@ -38,7 +37,8 @@ $g_user->can_request(GECOUR);
*/
$sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
$ag_id=(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
$base="ac=".$_REQUEST['ac']."&sc=sv&sb=detail&f_id=".$_REQUEST['f_id'];
$p_action=$_REQUEST['ac'];
$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id'];
$retour=HtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base);
$fiche=new Fiche($cn,$_REQUEST['f_id']);