Skip to content

Commit

Permalink
Uniformise code
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 22, 2016
1 parent c0d6d6d commit 03c30c4
Show file tree
Hide file tree
Showing 13 changed files with 514 additions and 22 deletions.
2 changes: 1 addition & 1 deletion htdocs/compta/bank/ligne.php
Expand Up @@ -320,7 +320,7 @@
print '</a>';
}
else if ($links[$key]['type']=='sc') {
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$links[$key]['url_id'].'">';
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowSocialContribution'),'bill').' ';
print $langs->trans("SocialContribution").($links[$key]['label']?' - '.$links[$key]['label']:'');
print '</a>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/releve.php
Expand Up @@ -469,7 +469,7 @@
$newline=0;
}
elseif ($links[$key]['type']=='sc') {
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$links[$key]['url_id'].'">';
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowBill'),'bill').' ';
print $langs->trans("SocialContribution");
print '</a>';
Expand Down
6 changes: 3 additions & 3 deletions htdocs/compta/paiement_charge.php
Expand Up @@ -51,7 +51,7 @@

if ($_POST["cancel"])
{
$loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid;
$loc = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid;
header("Location: ".$loc);
exit;
}
Expand Down Expand Up @@ -130,7 +130,7 @@
if (! $error)
{
$db->commit();
$loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid;
$loc = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid;
header('Location: '.$loc);
exit;
}
Expand Down Expand Up @@ -185,7 +185,7 @@

print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("SocialContribution")."</td></tr>";

print '<tr><td>'.$langs->trans("Ref").'</td><td><a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Ref").'</td><td><a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Type")."</td><td>".$charge->type_libelle."</td></tr>\n";
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode,'day')."</td></tr>\n";
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$charge->lib."</td></tr>\n";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/payment_sc/card.php
Expand Up @@ -65,7 +65,7 @@
if ($result > 0)
{
$db->commit();
header("Location: ".DOL_URL_ROOT."/compta/charges/index.php?mode=sconly");
header("Location: ".DOL_URL_ROOT."/compta/sociales/payments.php?mode=sconly");
exit;
}
else
Expand Down
Expand Up @@ -18,7 +18,7 @@
*/

/**
* \file htdocs/compta/sociales/charges.php
* \file htdocs/compta/sociales/card.php
* \ingroup tax
* \brief Social contribution card page
*/
Expand Down Expand Up @@ -382,7 +382,7 @@

if ($action == 'edit')
{
print "<form name=\"charge\" action=\"charges.php?id=$object->id&amp;action=update\" method=\"post\">";
print "<form name=\"charge\" action=\"".$_SERVER["PHP_SELF"]."?id=$object->id&amp;action=update\" method=\"post\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}

Expand Down Expand Up @@ -585,13 +585,13 @@
// Reopen
if ($object->paye && $user->rights->tax->charges->creer)
{
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/charges.php",1). "?id=$object->id&amp;action=reopen\">".$langs->trans("ReOpen")."</a>";
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/card.php",1). "?id=$object->id&amp;action=reopen\">".$langs->trans("ReOpen")."</a>";
}

// Edit
if ($object->paye == 0 && $user->rights->tax->charges->creer)
{
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=edit\">".$langs->trans("Modify")."</a>";
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/card.php?id=$object->id&amp;action=edit\">".$langs->trans("Modify")."</a>";
}

// Emit payment
Expand All @@ -603,19 +603,19 @@
// Classify 'paid'
if ($object->paye == 0 && round($resteapayer) <=0 && $user->rights->tax->charges->creer)
{
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>";
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/card.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>";
}

// Clone
if ($user->rights->tax->charges->creer)
{
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/charges.php",1). "?id=$object->id&amp;action=clone\">".$langs->trans("ToClone")."</a>";
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/card.php",1). "?id=$object->id&amp;action=clone\">".$langs->trans("ToClone")."</a>";
}

// Delete
if ($user->rights->tax->charges->supprimer)
{
print "<a class=\"butActionDelete\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=delete\">".$langs->trans("Delete")."</a>";
print "<a class=\"butActionDelete\" href=\"".DOL_URL_ROOT."/compta/sociales/card.php?id=$object->id&amp;action=delete\">".$langs->trans("Delete")."</a>";
}

print "</div>";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/sociales/class/chargesociales.class.php
Expand Up @@ -449,7 +449,7 @@ function getNomUrl($withpicto=0,$maxlen=0)
if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowSocialContribution").': '.$this->ref;

$link = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$link = '<a href="'.DOL_URL_ROOT.'/compta/sociales/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';

if ($withpicto) $result.=($link.img_object($label, 'bill', 'class="classfortooltip"').$linkend.' ');
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/sociales/index.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
*
Expand Down Expand Up @@ -233,7 +233,7 @@
print '<td>'.dol_trunc($obj->libelle,42).'</td>';

// Type
print '<td>'.dol_trunc($obj->type_lib,16).'</td>';
print '<td>'.$obj->type_lib.'</td>';

// Date end period
print '<td align="center">';
Expand Down

0 comments on commit 03c30c4

Please sign in to comment.