2
0
forked from Wavyzz/dolibarr

New: Ajout option pour dsactiver les notifications

Qual: Factorisation de code sur onglet socit
This commit is contained in:
Laurent Destailleur
2006-04-08 22:47:51 +00:00
parent 0447504934
commit 150362780f
19 changed files with 302 additions and 686 deletions

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -37,6 +37,10 @@ if (!$user->admin)
accessforbidden();
/*
* Actions
*/
if ($_GET["action"] == 'set')
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."avoir_model_pdf (nom) VALUES ('".$_GET["value"]."')";
@@ -121,7 +125,7 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/*
* Module num<75>rotation
*/
print "<br>";
print_titre($langs->trans("DiscountsNumberingModules"));
print '<table class="noborder" width="100%">';
@@ -279,7 +283,7 @@ print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("Directory")."</td>\n <td>".$conf->avoir->dir_output."</td>\n</tr>\n";
print "</table>\n<br>";
print "</table>\n";
$db->close();

View File

@@ -69,7 +69,11 @@ if ($_GET['action'] == 'delete')
}
}
/*
* Affichage page
*/
$html=new Form($db);
print_titre($langs->trans('ComptaSetup'));
@@ -142,7 +146,7 @@ if ($result)
print '<input type="text" size="30" name="constvalue" value="'.stripslashes($obj->value).'">';
}
print '</td><td>';
print '<input type="submit" value="'.$langs->trans('Modify').'" name="button"> &nbsp; ';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"> &nbsp; ';
print "</td></tr>\n";
print '</form>';

View File

@@ -93,6 +93,8 @@ if ($_GET["action"] == 'delete')
*/
$dir = "../includes/modules/facture/";
$html=new Form($db);
llxHeader("","");
@@ -112,7 +114,7 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
/*
* Module num<75>rotation
*/
print "<br>";
print_titre($langs->trans("BillsNumberingModule"));
print '<table class="noborder" width="100%">';
@@ -342,7 +344,7 @@ print '<tr '.$bc[$var].'><td>';
echo "Forcer la d<>finition de la date des factures lors de la validation";
print '</td><td width="60" align="center">';
$forcedate=(defined("FAC_FORCE_DATE_VALIDATION") && FAC_FORCE_DATE_VALIDATION)?1:0;
$html=new Form($db);
print $html->selectyesno("forcedate",$forcedate,1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
@@ -352,8 +354,6 @@ print '</form>';
print '</table>';
print "<br>";
$db->close();
llxFooter('$Date$ - $Revision$');

View File

@@ -44,6 +44,7 @@ if ($_GET["action"] == 'setcodeclient')
if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON",$_GET["value"]))
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
@@ -56,6 +57,20 @@ if ($_GET["action"] == 'setcodecompta')
if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON",$_GET["value"]))
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dolibarr_print_error($db);
}
}
if ($_POST["action"] == 'setdisablenotifications')
{
if (dolibarr_set_const($db, "SOCIETE_DISABLE_NOTIFICATIONS",! $_POST["constvalue"]))
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
@@ -69,9 +84,11 @@ if ($_GET["action"] == 'setcodecompta')
*
*/
llxHeader();
$form=new Form($db);
llxHeader();
print_titre($langs->trans("CompanySetup"));
print "<br>";
@@ -193,6 +210,43 @@ if ($handle)
}
print "</table>\n";
print '<br>';
// Choix du module de gestion des codes compta
print_titre($langs->trans("OtherOptions"));
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print '<form action="'.$_SERVER["societe.php"].'" method="POST">';
print '<input type="hidden" name="action" value="setdisablenotifications">';
print '<input type="hidden" name="constname" value="SOCIETE_DISABLE_NOTIFICATIONS">';
$var=!$var;
print '<tr '.$bc[$var].' class="value">';
print '<td nowrap="nowrap">'.$langs->trans("UseNotifications")."</td>\n";
print '<td>';
$form->selectyesnonum('constvalue',! $conf->global->SOCIETE_DISABLE_NOTIFICATIONS);
print '</td>';
print '<td>'.$langs->trans("NotificationsDesc").'</td>';
print '<td align="right">';
print '<input class="button" type="submit" value="'.$langs->trans('Modify').'" name="button"> &nbsp; ';
print '</td>';
print "</tr>\n";
print '</form>';
print "</table>\n";
$db->close();

View File

@@ -30,14 +30,12 @@
*/
require_once("./pre.inc.php");
if (!$user->rights->societe->lire) accessforbidden();
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
$langs->load("companies");
$langs->load("orders");
@@ -46,6 +44,7 @@ $langs->load("contracts");
if ($conf->fichinter->enabled) $langs->load("interventions");
$user->getrights("commercial");
if (!$user->rights->societe->lire) accessforbidden();
$socidp = isset($_GET["socid"])?$_GET["socid"]:'';
if ($socidp == '') accessforbidden();
@@ -192,69 +191,10 @@ if ($socidp > 0)
/*
* Affichage onglets
*/
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Company");
$h++;
$head = societe_prepare_head($objsoc);
if ($objsoc->client==1)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Customer");;
$h++;
}
if ($objsoc->client==2)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->socid;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($objsoc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Info");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT."/bookmarks/fiche.php?action=add&amp;socid=".$objsoc->id."&amp;urlsource=".$_SERVER["PHP_SELF"]."?socid=".$objsoc->id;
$head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
$head[$h][2] = 'image';
$h++;
}
dolibarr_fiche_head($head, $hselected, $objsoc->nom);
dolibarr_fiche_head($head, 'customer', $objsoc->nom);
/*

View File

@@ -28,6 +28,7 @@
*/
require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/prospect.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
@@ -96,6 +97,13 @@ if ($socid > 0)
exit;
}
/*
* Affichage onglets
*/
$head = societe_prepare_head($societe);
dolibarr_fiche_head($head, 'prospect', $societe->nom);
/* TODO Finir verification PagesJaunes
* print '<form action="http://www.pagesjaunes.fr/pj.cgi" method="post" target="_blank">';
@@ -105,56 +113,7 @@ if ($socid > 0)
* print '</form>';
*/
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Company");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$societe->id;
$head[$h][1] = $langs->trans("Prospect");
$hselected=$h;
$h++;
if ($societe->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $societe->nom);
/*
*
*/
print "<table width=\"100%\">\n";
print '<tr><td valign="top" width="50%">';

View File

@@ -28,6 +28,7 @@
*/
require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
$user->getrights('propale');
@@ -83,63 +84,10 @@ if ($_socid > 0)
/*
* Affichage onglets
*/
$h = 0;
$head = societe_prepare_head($objsoc);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Company");
$h++;
dolibarr_fiche_head($head, 'relativediscount', $objsoc->nom);
if ($objsoc->client==1)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($objsoc->client==2)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->socid;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($objsoc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT."/comm/index.php?socidp=$objsoc->id&action=add_bookmark";
$head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
$head[$h][2] = 'image';
}
dolibarr_fiche_head($head, $hselected, $objsoc->nom);
/*
*

View File

@@ -28,6 +28,7 @@
*/
require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$user->getrights('propale');
$user->getrights('commande');
@@ -104,63 +105,9 @@ if ($_socid > 0)
/*
* Affichage onglets
*/
$h = 0;
$head = societe_prepare_head($objsoc);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Company");
$h++;
if ($objsoc->client==1)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($objsoc->client==2)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->socid;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($objsoc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT."/comm/index.php?socidp=$objsoc->id&action=add_bookmark";
$head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
$head[$h][2] = 'image';
}
dolibarr_fiche_head($head, $hselected, $objsoc->nom);
dolibarr_fiche_head($head, 'absolutediscount', $objsoc->nom);
/*
*

View File

@@ -28,6 +28,7 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
@@ -111,71 +112,11 @@ if ($socid > 0)
/*
* Affichage onglets
*/
$h = 0;
$head = societe_prepare_head($societe);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Company");
$h++;
dolibarr_fiche_head($head, 'compta', $societe->nom);
if ($societe->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($societe->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$societe->id;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($societe->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Info");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT."/index.php?socidp=$societe->id&action=add_bookmark";
$head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
$head[$h][2] = 'image';
}
dolibarr_fiche_head($head, $hselected, $societe->nom);
/*
*
*/
print "<table width=\"100%\">\n";
print '<tr><td valign="top" width="50%">';

View File

@@ -29,6 +29,7 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$langs->load("companies");
$langs->load('other');
@@ -108,61 +109,13 @@ if ($socid > 0)
$societe = new Societe($db);
if ($societe->fetch($socid))
{
$h = 0;
/*
* Affichage onglets
*/
$head = societe_prepare_head($societe);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Company");
$h++;
dolibarr_fiche_head($head, 'document', $societe->nom);
if ($societe->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($societe->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$societe->id;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($societe->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Documents");
$hselected = $h;
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $societe->nom);
// Construit liste des fichiers
clearstatcache();

View File

@@ -30,6 +30,7 @@
require('./pre.inc.php');
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$langs->load('suppliers');
$langs->load('products');
@@ -81,60 +82,9 @@ if ( $societe->fetch($socid) )
/*
* Affichage onglets
*/
$h = 0;
$head = societe_prepare_head($societe);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$socid;
$head[$h][1] = $langs->trans('Company');
$h++;
if ($societe->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$socid;
$head[$h][1] = $langs->trans('Customer');
$h++;
}
if ($societe->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$socid;
$head[$h][1] = $langs->trans('Prospect');
$h++;
}
if ($societe->fournisseur)
{
$hselected=$h;
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$socid;
$head[$h][1] = $langs->trans('Supplier');
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load('compta');
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$socid;
$head[$h][1] = $langs->trans('Accountancy');
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$societe->id;
$head[$h][1] = $langs->trans('Note');
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans('Documents');
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans('Notifications');
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $societe->nom);
dolibarr_fiche_head($head, 'supplier', $societe->nom);
print '<table width="100%">';

View File

@@ -342,11 +342,13 @@ RuleForGeneratedPasswords=Rule to generate suggested passwords
DoNotSuggest=Do not suggest any password
##### Company setup #####
CompanySetup=Companies module setup
CompanyCodeChecker=Module for checking third parties code (customer or supplier)
AccountCodeManager=Module for managing accountancy code (customer or supplier)
ModuleCompanyCodeAquarium=Return an accountancy code built by "401" followed by third party supplier code for a supplier accountancy code, and "411" followed by third party customer code for a customer accountancy code
ModuleCompanyCodePanicum=Return an accountancy code that is always same than the one typed. For test use
CompanyCodeChecker=Module for third parties code checking (customer or supplier)
AccountCodeManager=Module for accountancy code generation (customer or supplier)
ModuleCompanyCodeAquarium=Return an accountancy code built by "401" followed by third party supplier code for a supplier accountancy code, and "411" followed by third party customer code for a customer accountancy code.
ModuleCompanyCodePanicum=Return an empty accountancy code.
ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. Le code est compos<6F> du caract<63>re 'C' en premi<6D>re position suivi des 5 premiers caract<63>res du code tiers.
UseNotifications=Use notifications
NotificationsDesc=Notifications feature allows you to silently send automatic mail, for some Dolibarr events, to companies that are configured to
##### Webcal setup #####
WebCalSetup=Webcalendar link setup
WebCalSyncro=Add Dolibarr events to WebCalendar

View File

@@ -343,10 +343,12 @@ DoNotSuggest=Ne pas proposer
##### Company setup #####
CompanySetup=Configuration du module Soci<63>t<EFBFBD>s
CompanyCodeChecker=Module de contr<74>le des codes tiers (clients/fournisseurs)
AccountCodeManager=Module de gestion des codes compta (clients/fournisseurs)
ModuleCompanyCodeAquarium=Renvoie un code compta compos<6F> de 401 suivi du code tiers fournisseur pour le code compta fournisseur, et 411 suivi du code tiers client pour le code compta client
ModuleCompanyCodePanicum=Renvoie un code compta identique <20> celui saisi. Module d<>di<64> aux tests
AccountCodeManager=Module de g<EFBFBD>n<EFBFBD>ration des codes compta (clients/fournisseurs)
ModuleCompanyCodeAquarium=Renvoie un code compta compos<6F> de 401 suivi du code tiers fournisseur pour le code compta fournisseur, et 411 suivi du code tiers client pour le code compta client.
ModuleCompanyCodePanicum=Renvoie un code compta vide.
ModuleCompanyCodeDigitaria=Renvoie un code compta compos<6F> suivant le code tiers. Le code est compos<6F> du caract<63>re 'C' en premi<6D>re position suivi des 5 premiers caract<63>res du code tiers.
UseNotifications=Utiliser les notifications
NotificationsDesc=La fonction des notifications permet d'envoyer automatiquement un mail, pour certains <20>v<EFBFBD>nement Dolibarr, aux soci<63>t<EFBFBD>s configur<75>es pour.
##### Webcal setup #####
WebCalSetup=Configuration du lien vers le calendrier Webcalendar
WebCalSyncro=Int<6E>grer les <20>v<EFBFBD>nements Dolibarr dans WebCalendar

112
htdocs/lib/company.lib.php Normal file
View File

@@ -0,0 +1,112 @@
<?php
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
* $Source$
*/
/**
\file htdocs/lib/company.lib.php
\brief Ensemble de fonctions de base pour le module societe
\version $Revision$
Ensemble de fonctions de base de dolibarr sous forme d'include
*/
function societe_prepare_head($objsoc)
{
global $langs, $conf;
$h = 0;
$head = array();
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Company");
$head[$h][2] = 'company';
$h++;
if ($objsoc->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Customer");;
$head[$h][2] = 'customer';
$h++;
}
if ($objsoc->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$objsoc->id;
$head[$h][1] = $langs->trans("Prospect");
$head[$h][2] = 'prospect';
$h++;
}
if ($objsoc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Supplier");
$head[$h][2] = 'supplier';
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Accountancy");
$head[$h][2] = 'compta';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Documents");
$head[$h][2] = 'document';
$h++;
}
if (! $conf->global->SOCIETE_DISABLE_NOTIFICATIONS)
{
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Notifications");
$head[$h][2] = 'notify';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT."/bookmarks/fiche.php?action=add&amp;socid=".$objsoc->id."&amp;urlsource=".$_SERVER["PHP_SELF"]."?socid=".$objsoc->id;
$head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
$head[$h][2] = 'image';
$h++;
}
return $head;
}
?>

View File

@@ -223,7 +223,7 @@ function dolibarr_syslog($message, $level=LOG_ERR)
\param active 0=onglet non actif, 1=onglet actif
\param title Titre tabelau ("" par defaut)
*/
function dolibarr_fiche_head($links, $active=0, $title='')
function dolibarr_fiche_head($links, $active='0', $title='')
{
print '<div class="tabs">'."\n";
@@ -248,7 +248,9 @@ function dolibarr_fiche_head($links, $active=0, $title='')
}
else
{
if ($i == $active)
//print "x $i $active ".$links[$i][2]." z";
if ((is_numeric($active) && $i == $active)
|| (! is_numeric($active) && $active == $links[$i][2]))
{
print '<a id="active" class="tab" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
}

View File

@@ -31,6 +31,7 @@
*/
require("pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$user->getrights('societe');
$user->getrights('commercial');
@@ -628,60 +629,9 @@ else
exit;
}
$h=0;
$head = societe_prepare_head($soc);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Company");
$hselected=$h;
$h++;
if ($soc->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($soc->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$soc->id;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($soc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Supplier");;
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $soc->nom);
dolibarr_fiche_head($head, 'company', $soc->nom);
// Confirmation de la suppression de la facture

View File

@@ -27,7 +27,8 @@
*/
require("./pre.inc.php");
require_once (DOL_DOCUMENT_ROOT."/societe.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
$langs->load("companies");
$langs->load("other");
@@ -69,60 +70,13 @@ $soc->id = $socid;
$soc->fetch($socid);
$soc->info($socid);
$h=0;
/*
* Affichage onglets
*/
$head = societe_prepare_head($soc);
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Company");
$h++;
dolibarr_fiche_head($head, 'info', $soc->nom);
if ($soc->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($soc->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$soc->id;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($soc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Supplier");;
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Info");
$hselected=$h;
$h++;
dolibarr_fiche_head($head, $hselected, $soc->nom);
print '<table width="100%"><tr><td>';

View File

@@ -28,6 +28,7 @@
*/
require("pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$langs->load("companies");
@@ -97,11 +98,6 @@ if ($_GET["action"] == 'delete')
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
$db->query($sql);
// if ($db->query($sql))
// {
// TODO ajouter une s<>cu pour la suppression
//}
}
@@ -117,66 +113,13 @@ if ( $soc->fetch($soc->id) )
$html = new Form($db);
$langs->load("other");
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Company");
$h++;
if ($soc->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($soc->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$soc->id;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($soc->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Note");
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Notifications");
$hselected=$h;
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$soc->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $soc->nom);
/*
*
*
* Affichage onglets
*/
$head = societe_prepare_head($soc);
dolibarr_fiche_head($head, 'notify', $soc->nom);
print '<table class="border"width="100%">';
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td colspan="3">'.$soc->nom.'</td></tr>';

View File

@@ -29,6 +29,7 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
$langs->load("companies");
@@ -78,62 +79,12 @@ if ($socidp > 0)
$societe = new Societe($db, $socidp);
$societe->fetch($socidp);
/*
* Affichage onglets
*/
$head = societe_prepare_head($societe);
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Company");
$h++;
if ($societe->client==1)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Customer");
$h++;
}
if ($societe->client==2)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$societe->id;
$head[$h][1] = $langs->trans("Prospect");
$h++;
}
if ($societe->fournisseur)
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Supplier");
$h++;
}
if ($conf->compta->enabled || $conf->comptaexpert->enabled)
{
$langs->load("compta");
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Accountancy");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Note");
$hselected = $h;
$h++;
if ($user->societe_id == 0)
{
$head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Documents");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Notifications");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$societe->id;
$head[$h][1] = $langs->trans("Info");
$h++;
dolibarr_fiche_head($head, $hselected, $societe->nom);
dolibarr_fiche_head($head, 'note', $societe->nom);
print "<form method=\"post\" action=\"socnote.php\">";