diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php
index 0cadea37a6c..8c1e69fa20e 100644
--- a/htdocs/societe/notify/fiche.php
+++ b/htdocs/societe/notify/fiche.php
@@ -21,6 +21,13 @@
*
*/
+/**
+ \file htdocs/societe/notify/fiche.php
+ \ingroup societe
+ \brief Onglet notifications pour une societe
+ \version $Revision$
+*/
+
require("pre.inc.php");
$langs->load("companies");
@@ -36,8 +43,23 @@ if ($user->societe_id > 0)
$socid = $_GET["socid"];
+$sortorder=$_GET["sortorder"];
+$sortfield=$_GET["sortfield"];
+
+if ($sortorder == "") {
+ $sortorder="ASC";
+}
+if ($sortfield == "") {
+ $sortfield="nom";
+}
+
+
llxHeader();
+
+/*
+ * Action ajout notification
+ */
if ($_POST["action"] == 'add')
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
@@ -53,15 +75,18 @@ if ($_POST["action"] == 'add')
}
else
{
- print $sql;
+ dolibarr_print_error($db);
}
}
else
{
- print $db->error() ."$sql";;
+ dolibarr_print_error($db);
}
}
+/*
+ * Action suppression notification
+ */
if ($_GET["action"] == 'delete')
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
@@ -73,8 +98,9 @@ if ($_GET["action"] == 'delete')
//}
}
+
/*
- *
+ * Affichage notifications
*
*/
$soc = new Societe($db);
@@ -138,25 +164,14 @@ if ( $soc->fetch($soc->id) )
*/
print '
';
- print '| '.$langs->trans("Name").' | '.$soc->nom.' |
';
- print '| '.$langs->trans("Address").' | '.nl2br($soc->adresse).' |
';
- print '| '.$langs->trans("Zip").' / '.$langs->trans("Town").' | '.$soc->cp.' / '.$soc->ville.' |
';
+ print '| '.$langs->trans("Name").' | '.$soc->nom.' |
';
+ print '| '.$langs->trans("Address").' | '.nl2br($soc->adresse).' |
';
+ print '| '.$langs->trans("Zip").' / '.$langs->trans("Town").' | '.$soc->cp.' / '.$soc->ville.' |
';
print '
';
print "\n";
- /*
- *
- */
- if ($sortorder == "")
- {
- $sortorder="ASC";
- }
- if ($sortfield == "")
- {
- $sortfield="c.name";
- }
print '';
print '';
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name","","&socid=$socid",'',$sortfield);
@@ -178,8 +193,7 @@ if ( $soc->fetch($soc->id) )
print '
| '.$obj->firstname . " ".$obj->name.' | ';
print ''.$obj->titre.' | ';
- print'
- '.img_delete().'';
+ print' | '.img_delete().'';
$i++;
$var = !$var;
@@ -188,8 +202,9 @@ if ( $soc->fetch($soc->id) )
}
else
{
- print $db->error();
+ dolibarr_print_error($db);
}
+
/*
*
*/
@@ -210,7 +225,7 @@ if ( $soc->fetch($soc->id) )
}
else
{
- print $db->error;
+ dolibarr_print_error($db);
}
$html = new Form($db);
@@ -226,6 +241,7 @@ if ( $soc->fetch($soc->id) )
print ' |
';
}
+
/*
*
*/