Fix bug for windows (PHP_SELF instead of SCRIPT_NAME)
This commit is contained in:
parent
f3b7b106e8
commit
20fc894bec
9 changed files with 41 additions and 31 deletions
|
|
@ -66,7 +66,7 @@ class Admin extends fiche{
|
|||
{
|
||||
$p_search=FormatString($p_search);
|
||||
$url=urlencode($_SERVER['REQUEST_URI']);
|
||||
$script=$_SERVER['SCRIPT_NAME'];
|
||||
$script=$_SERVER['PHP_SELF'];
|
||||
// Creation of the nav bar
|
||||
// Get the max numberRow
|
||||
$all_admin=$this->CountByDef($this->fiche_def_ref,$p_search);
|
||||
|
|
@ -110,9 +110,11 @@ class Admin extends fiche{
|
|||
" ".$admin->strAttribut(ATTR_DEF_PAYS).
|
||||
"</TD>";
|
||||
$r.="<td>";
|
||||
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=contact&qcode=%s&url=%s" title="Contact">C</A> - ',
|
||||
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=contact&qcode=%s&url=%s" title="Contact">Contact</A> - ',
|
||||
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE),$url);
|
||||
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&url=%s" title="Action">A</A> - ',
|
||||
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&url=%s" title="Action">Action</A> - ',
|
||||
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
|
||||
$r.=sprintf('<A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A> - ',
|
||||
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
|
||||
|
||||
$r.='</TD>';
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class contact extends fiche
|
|||
attr_value using (jft_id) where av_text='".$this->company."' and ad_id=".ATTR_DEF_COMPANY.") ";
|
||||
}
|
||||
$url=urlencode($_SERVER['REQUEST_URI']);
|
||||
$script=$_SERVER['SCRIPT_NAME'];
|
||||
$script=$_SERVER['PHP_SELF'];
|
||||
// Creation of the nav bar
|
||||
// Get the max numberRow
|
||||
$all_contact=$this->CountByDef($this->fiche_def_ref,$p_search,$extra_sql);
|
||||
|
|
@ -82,13 +82,14 @@ attr_value using (jft_id) where av_text='".$this->company."' and ad_id=".ATTR_DE
|
|||
$r=$bar;
|
||||
$r.='<table border="0">
|
||||
<TR style="background-color:lightgrey;">
|
||||
<th>Quick Code</th>
|
||||
<th>Nom</th>
|
||||
<th>Téléphone</th>
|
||||
<th>email</th>
|
||||
<th>Fax</th>
|
||||
<th colspan="2">Société</th>
|
||||
</TR>';
|
||||
$base=$_SERVER['SCRIPT_NAME'];
|
||||
$base=$_SERVER['PHP_SELF'];
|
||||
// Compute the url
|
||||
$url="";
|
||||
$and="?";
|
||||
|
|
@ -122,7 +123,9 @@ attr_value using (jft_id) where av_text='".$this->company."' and ad_id=".ATTR_DE
|
|||
);
|
||||
}
|
||||
$r.="<TR>";
|
||||
$r.='<TD><A HREF="'.$url."&sa=detail&f_id=".$contact->id."\">".$contact->strAttribut(ATTR_DEF_NAME)."</A></TD>";
|
||||
$r.='<TD><A HREF="'.$url."&sa=detail&f_id=".$contact->id."\">".$contact->strAttribut(ATTR_DEF_QUICKCODE).
|
||||
"</A></TD>";
|
||||
$r.="<TD>".$contact->strAttribut(ATTR_DEF_NAME)."</TD>";
|
||||
$r.="<TD>".$contact->strAttribut(ATTR_DEF_TEL)."</TD>";
|
||||
$r.="<TD>".$contact->strAttribut(ATTR_DEF_EMAIL)."</TD>".
|
||||
"<TD> ".$contact->strAttribut(ATTR_DEF_FAX)."</TD>".
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ where
|
|||
{
|
||||
$p_search=FormatString($p_search);
|
||||
$url=urlencode($_SERVER['REQUEST_URI']);
|
||||
$script=$_SERVER['SCRIPT_NAME'];
|
||||
$script=$_SERVER['PHP_SELF'];
|
||||
// Creation of the nav bar
|
||||
// Get the max numberRow
|
||||
$all_client=$this->CountByDef($this->fiche_def_ref,$p_search);
|
||||
|
|
@ -225,7 +225,7 @@ where
|
|||
<th>Nom</th>
|
||||
<th>Adresse</th>
|
||||
<th>Solde</th>
|
||||
<th colspan="3">Action </th>
|
||||
<th colspan="4">Action </th>
|
||||
</TR>';
|
||||
if ( sizeof ($step_client ) == 0 )
|
||||
return $r;
|
||||
|
|
@ -258,6 +258,8 @@ where
|
|||
|
||||
|
||||
$r.='<td><A HREF="commercial.php?p_action=facture&sa=list&p_periode=-1&qcode='.$client->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
|
||||
$r.=sprintf('<td><A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A></td>',
|
||||
$script,$client->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
|
||||
|
||||
$r.='</TD>';
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Supplier extends fiche{
|
|||
{
|
||||
$p_search=FormatString($p_search);
|
||||
$url=urlencode($_SERVER['REQUEST_URI']);
|
||||
$script=$_SERVER['SCRIPT_NAME'];
|
||||
$script=$_SERVER['PHP_SELF'];
|
||||
// Creation of the nav bar
|
||||
// Get the max numberRow
|
||||
$all_supplier=$this->CountByDef($this->fiche_def_ref,$p_search);
|
||||
|
|
@ -113,7 +113,7 @@ class Supplier extends fiche{
|
|||
<th>Nom</th>
|
||||
<th>Adresse</th>
|
||||
<th>Solde</th>
|
||||
<th colspan="3">Action </th>
|
||||
<th colspan="4">Action </th>
|
||||
</TR>';
|
||||
if ( sizeof ($step_supplier ) == 0 )
|
||||
return $r;
|
||||
|
|
@ -148,6 +148,9 @@ class Supplier extends fiche{
|
|||
|
||||
|
||||
$r.='<td><A HREF="commercial.php?p_action=depense&sa=list&p_periode=-1&qcode='.$supplier->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
|
||||
$r.=sprintf('<td><A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A></td>',
|
||||
$script,$supplier->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
|
||||
|
||||
|
||||
$r.='</TD>';
|
||||
|
||||
|
|
|
|||
|
|
@ -897,7 +897,7 @@ function jrn_navigation_bar($p_offset,$p_line,$p_size=0,$p_page=1)
|
|||
$step=$_SESSION['g_pagesize'];
|
||||
$offset=($e-1)*$step;
|
||||
|
||||
$r='<A class="mtitle" href="'.$_SERVER['SCRIPT_NAME']."?".$url."&offset=$offset&step=$step&page=$e&size=$step".'">';
|
||||
$r='<A class="mtitle" href="'.$_SERVER['PHP_SELF']."?".$url."&offset=$offset&step=$step&page=$e&size=$step".'">';
|
||||
$r.="Précédent";
|
||||
$r.="</A> ";
|
||||
}
|
||||
|
|
@ -916,7 +916,7 @@ function jrn_navigation_bar($p_offset,$p_line,$p_size=0,$p_page=1)
|
|||
if ( $e != $p_page ) {
|
||||
$step=$_SESSION['g_pagesize'];
|
||||
$offset=($e-1)*$step;
|
||||
$go=sprintf($_SERVER['SCRIPT_NAME']."?".$url."&offset=$offset&step=$step&page=$e&size=$step");
|
||||
$go=sprintf($_SERVER['PHP_SELF']."?".$url."&offset=$offset&step=$step&page=$e&size=$step");
|
||||
$r.=sprintf('<A class="mtitle" HREF="%s" CLASS="one">%d</A> ',$go,$e);
|
||||
} else {
|
||||
$r.="<b> $e </b>";
|
||||
|
|
@ -930,7 +930,7 @@ function jrn_navigation_bar($p_offset,$p_line,$p_size=0,$p_page=1)
|
|||
$step=$_SESSION['g_pagesize'];
|
||||
$offset=($e-1)*$step;
|
||||
|
||||
$r.=' <A class="mtitle" href="'.$_SERVER['SCRIPT_NAME']."?".$url."&offset=$offset&step=$step&page=$e&size=$step".'">';
|
||||
$r.=' <A class="mtitle" href="'.$_SERVER['PHP_SELF']."?".$url."&offset=$offset&step=$step&page=$e&size=$step".'">';
|
||||
$r.="Suivant";
|
||||
$r.="</A>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ echo_debug('user_form_ach.php',__LINE__,"Enter FormAchInput($p_cn,$p_jrn,$p_peri
|
|||
$r.=JS_SHOW_TVA;
|
||||
$r.=JS_TVA;
|
||||
// Compute href
|
||||
// $href=basename($_SERVER['SCRIPT_NAME']);
|
||||
$href=basename($_SERVER['SCRIPT_NAME']);
|
||||
// $href=basename($_SERVER['PHP_SELF']);
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
switch ($href)
|
||||
{
|
||||
// user_jrn.php
|
||||
|
|
@ -74,7 +74,7 @@ echo_debug('user_form_ach.php',__LINE__,"Enter FormAchInput($p_cn,$p_jrn,$p_peri
|
|||
$href="commercial.php?p_action=depense&p_jrn=$p_jrn";
|
||||
break;
|
||||
default:
|
||||
echo_error('user_form_ach.php',__LINE__,'Erreur invalid request uri');
|
||||
echo_error('user_form_ach.php',__LINE__,'Erreur invalid request uri '.$href);
|
||||
exit (-1);
|
||||
}
|
||||
|
||||
|
|
@ -574,8 +574,8 @@ function FormAchView ($p_cn,$p_jrn,$p_periode,$p_array,$p_submit,$p_number,$p_pi
|
|||
|
||||
$r.="</DIV>";
|
||||
// Compute href
|
||||
// $href=basename($_SERVER['SCRIPT_NAME']);
|
||||
$href=basename($_SERVER['SCRIPT_NAME']);
|
||||
// $href=basename($_SERVER['PHP_SELF']);
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
switch ($href)
|
||||
{
|
||||
// user_jrn.php
|
||||
|
|
|
|||
|
|
@ -154,8 +154,8 @@ function FormFin($p_cn,$p_jrn,$p_periode,$p_submit,$p_array=null,$pview_only=tru
|
|||
$r.=JS_CONCERNED_OP;
|
||||
}
|
||||
// Compute href
|
||||
// $href=basename($_SERVER['SCRIPT_NAME']);
|
||||
$href=basename($_SERVER['SCRIPT_NAME']);
|
||||
// $href=basename($_SERVER['PHP_SELF']);
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
switch ($href)
|
||||
{
|
||||
// user_jrn.php module "Comptable"
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ function FormVenInput($p_cn,$p_jrn,$p_periode,$p_array=null,$pview_only=true,$p_
|
|||
$r.=JS_SHOW_TVA;
|
||||
$r.=JS_TVA;
|
||||
// Compute href
|
||||
// $href=basename($_SERVER['SCRIPT_NAME']);
|
||||
$href=basename($_SERVER['SCRIPT_NAME']);
|
||||
// $href=basename($_SERVER['PHP_SELF']);
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
switch ($href)
|
||||
{
|
||||
// user_jrn.php
|
||||
|
|
@ -528,8 +528,8 @@ function FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='form'
|
|||
$r.="</DIV>";
|
||||
if ( $p_doc == 'form' ) {
|
||||
// Compute href
|
||||
// $href=basename($_SERVER['SCRIPT_NAME']);
|
||||
$href=basename($_SERVER['SCRIPT_NAME']);
|
||||
// $href=basename($_SERVER['PHP_SELF']);
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
switch ($href)
|
||||
{
|
||||
// user_jrn.php
|
||||
|
|
@ -558,9 +558,9 @@ function FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='form'
|
|||
|
||||
|
||||
// if we were in the management module, appl. propose to generate an invoice
|
||||
// if ( $_SERVER['SCRIPT_NAME'] == '/commercial.php')
|
||||
echo_debug('user_form_ven',__LINE__," _SERVER['SCRIPT_NAME'] ".$_SERVER['SCRIPT_NAME']);
|
||||
if ( $_SERVER['SCRIPT_NAME'] == '/commercial.php')
|
||||
// if ( $_SERVER['PHP_SELF'] == '/commercial.php')
|
||||
echo_debug('user_form_ven',__LINE__," _SERVER['PHP_SELF'] ".$_SERVER['PHP_SELF']);
|
||||
if ( $_SERVER['PHP_SELF'] == '/commercial.php')
|
||||
{
|
||||
// if a template exists propose to choose an invoice template
|
||||
if ( CountSql($p_cn,
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ function ShowMenuCompta($p_dossier,$p_high="")
|
|||
include_once("postgres.php");
|
||||
|
||||
// find our current menu
|
||||
$default=basename($_SERVER['SCRIPT_NAME']);
|
||||
$default=basename($_SERVER['PHP_SELF']);
|
||||
switch ($default) {
|
||||
case "user_jrn.php":
|
||||
$default.="?show";
|
||||
|
|
@ -205,7 +205,7 @@ function GetFirstJrnIdForJrnType($p_dossier,$p_type)
|
|||
* \param $p_jrn journal
|
||||
* \param $p_extra html code to add at the return (before the \</table\>)
|
||||
* \return string with table in HTML
|
||||
* \note we use the SCRIPT_NAME variable to build the href value but we need to add
|
||||
* \note we use the PHP_SELF variable to build the href value but we need to add
|
||||
* a parameter when the REQUEST_url is commercial.php
|
||||
*
|
||||
*
|
||||
|
|
@ -258,9 +258,9 @@ function ShowMenuJrnUser($p_dossier,$p_type,$p_jrn,$p_extra="")
|
|||
// Minimum Lecture
|
||||
echo_debug('user_menu.php',__LINE__,"p_jrn = $p_jrn ");
|
||||
if ( $l_line['jrn_def_id'] != $p_jrn ) {
|
||||
$href=basename($_SERVER["SCRIPT_NAME"]);
|
||||
$href=basename($_SERVER["PHP_SELF"]);
|
||||
$add="";
|
||||
// if the SCRIPT_NAME == commercial.php, we need to add the parameter
|
||||
// if the PHP_SELF == commercial.php, we need to add the parameter
|
||||
// p_action=facture
|
||||
if ( $href=="commercial.php" )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue