diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php
index 7ead3a9940e..fea9cff6020 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
accessforbidden();
// Filter
-$year = $_GET["year"];
+$year = GETPOST('year', 'int');
if ($year == 0) {
$year_current = strftime("%Y", time());
$year_start = $year_current;
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 8c6f7687263..ddcc6e50d5e 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1164,7 +1164,7 @@ else
print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').' ';
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE',$liste,$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE,0);
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 6880dbd0aa3..da0f1c73d12 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -49,8 +49,8 @@ class Categorie extends CommonObject
const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
- const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
- const TYPE_PROJECT = 6;
+ const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
+ const TYPE_PROJECT = 6;
/**
* @var array ID mapping from type string
@@ -131,17 +131,17 @@ class Categorie extends CommonObject
public $element='category';
public $table_element='categories';
- var $fk_parent;
- var $label;
- var $description;
+ public $fk_parent;
+ public $label;
+ public $description;
/**
* @var string Color
*/
- var $color;
+ public $color;
/**
* @var ???
*/
- var $socid;
+ public $socid;
/**
* @var int Category type
*
@@ -154,10 +154,10 @@ class Categorie extends CommonObject
* @see Categorie::TYPE_ACCOUNT
* @see Categorie::TYPE_PROJECT
*/
- var $type;
+ public $type;
- var $cats=array(); // Categories table in memory
- var $motherof=array();
+ public $cats = array(); // Categories table in memory
+ public $motherof = array();
/**
* Constructor
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index f43f3ecd046..7c34498e6b4 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -681,9 +681,9 @@ if ($action == 'create')
dol_fiche_head();
print '';
- print ''.$langs->trans("MailTitle").' ';
- print ''.$langs->trans("MailFrom").' ';
- print ''.$langs->trans("MailErrorsTo").' ';
+ print ''.$langs->trans("MailTitle").' ';
+ print ''.$langs->trans("MailFrom").' ';
+ print ''.$langs->trans("MailErrorsTo").' ';
// Other attributes
$parameters=array();
@@ -697,7 +697,7 @@ if ($action == 'create')
print ' ';
print '';
- print ''.$langs->trans("MailTopic").' ';
+ print ''.$langs->trans("MailTopic").' ';
print ''.$langs->trans("BackgroundColorByDefault").' ';
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
print ' ';
@@ -756,11 +756,12 @@ else
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
- // Note: MAILING_LIMIT_SENDBYWEB is always defined to something != 0
+ // MAILING_NO_USING_PHPMAIL may be defined or not
+ // MAILING_LIMIT_SENDBYWEB is always defined to something != 0, MAILING_LIMIT_SENDBYCLI may be defined ot not.
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
- // You ensure that every user is using its own SMTP server.
+ // You ensure that every user is using its own SMTP server when using the mass emailing module.
$linktoadminemailbefore='';
$linktoadminemailend=' ';
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
@@ -770,10 +771,13 @@ else
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
{
- // No limit was defined, so the feature is forbidden from GUI, we show just a message.
- setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
+
+ // The feature is forbidden from GUI, we show just message to use from command line.
+ setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
setEventMessages('', null, 'warnings');
- if ($conf->file->mailing_limit_sendbyweb != '-1')
+ if ($conf->file->mailing_limit_sendbyweb != '-1') // MAILING_LIMIT_SENDBYWEB was set to -1 in database, but it is allowed ot increase it.
{
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings'); // You can send online with constant...
}
@@ -781,8 +785,11 @@ else
}
else
{
- $text='';
- if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
+ if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
+
+ $text='';
+ if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
{
$text.=$langs->trans("MailingNeedCommand");
$text.=' ';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 0a4ff814ec8..74566100f89 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1015,6 +1015,18 @@ if (empty($reshook))
if (! $error) {
$db->begin();
+ if (empty($user->rights->margins->creer))
+ {
+ foreach ($object->lines as &$line)
+ {
+ if ($line->id == GETPOST('lineid'))
+ {
+ $fournprice = $line->fk_fournprice;
+ $buyingprice = $line->pa_ht;
+ break;
+ }
+ }
+ }
$result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, $_POST["units"], $pu_ht_devise);
if ($result >= 0) {
diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php
index 4ea377a4487..82269434638 100644
--- a/htdocs/comm/remise.php
+++ b/htdocs/comm/remise.php
@@ -116,7 +116,7 @@ if ($socid > 0)
print '
';
print '';
- // Remise
+ // Discount
print '';
print $langs->trans("CustomerRelativeDiscount").' '.price2num($object->remise_percent)."% ";
@@ -127,13 +127,13 @@ if ($socid > 0)
print '";
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index efd6af16f70..db11214803d 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -968,6 +968,19 @@ if (empty($reshook))
}
if (! $error) {
+
+ if (empty($user->rights->margins->creer))
+ {
+ foreach ($object->lines as &$line)
+ {
+ if ($line->id == GETPOST('lineid'))
+ {
+ $fournprice = $line->fk_fournprice;
+ $buyingprice = $line->pa_ht;
+ break;
+ }
+ }
+ }
$result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'),$pu_ht_devise);
if ($result >= 0) {
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index ddf30b290be..58b445c8ce7 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -58,9 +58,6 @@ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES
$object->fetch_thirdparty();
$object->info($object->id);
-$soc = new Societe($db);
-$soc->fetch($object->thirdparty->id);
-
$head = commande_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
@@ -68,13 +65,12 @@ dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
$linkback = '' . $langs->trans("BackToList") . ' ';
-
$morehtmlref='';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
-$morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
+$morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 9a4b58a26c6..4d53d8e8d50 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -71,11 +71,10 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
- $soc = new Societe($db);
- $soc->fetch($object->socid);
-
+ $object->fetch_thirdparty();
+
$head = commande_prepare_head($object);
-
+
dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');
// Order card
@@ -88,7 +87,7 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
- $morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
+ $morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index ce70e7ac938..47405d0e748 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -576,7 +576,7 @@ if ($resql)
print ' ';
print ' ';
print ' ';
- if (! empty($_REQUEST['bid'])) print ' ';
+ if (GETPOST('bid')) print ' ';
// Form to reconcile
if ($user->rights->banque->consolidate && $action == 'reconcile')
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index d2b3c167872..baf2f3e26b1 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -50,7 +50,7 @@ $cancel = GETPOST('cancel', 'alpha');
// Security check
if (isset($_GET["id"]) || isset($_GET["ref"]))
{
- $id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
+ $id = isset($_GET["id"])?GETPOST("id"):(isset($_GET["ref"])?GETPOST("ref"):'');
}
$fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
@@ -93,7 +93,7 @@ if ($action == 'add')
$object->iban = trim($_POST["iban"]);
$object->domiciliation = trim($_POST["domiciliation"]);
- $object->proprio = trim($_POST["proprio"]);
+ $object->proprio = trim($_POST["proprio"]);
$object->owner_address = trim($_POST["owner_address"]);
$account_number = GETPOST('account_number','alpha');
@@ -105,12 +105,12 @@ if ($action == 'add')
$object->currency_code = trim($_POST["account_currency_code"]);
- $object->state_id = $_POST["account_state_id"];
+ $object->state_id = $_POST["account_state_id"];
$object->country_id = $_POST["account_country_id"];
$object->min_allowed = GETPOST("account_min_allowed",'int');
$object->min_desired = GETPOST("account_min_desired",'int');
- $object->comment = trim($_POST["account_comment"]);
+ $object->comment = trim(GETPOST("account_comment"));
$object->fk_user_author = $user->id;
@@ -172,7 +172,7 @@ if ($action == 'update')
// Update account
$object = new Account($db);
- $object->fetch($_POST["id"]);
+ $object->fetch(GETPOST("id"));
$object->ref = dol_string_nospecial(trim($_POST["ref"]));
$object->label = trim($_POST["label"]);
@@ -190,7 +190,7 @@ if ($action == 'update')
$object->iban = trim($_POST["iban"]);
$object->domiciliation = trim($_POST["domiciliation"]);
- $object->proprio = trim($_POST["proprio"]);
+ $object->proprio = trim($_POST["proprio"]);
$object->owner_address = trim($_POST["owner_address"]);
$account_number = GETPOST('account_number', 'int');
@@ -204,7 +204,7 @@ if ($action == 'update')
$object->min_allowed = GETPOST("account_min_allowed",'int');
$object->min_desired = GETPOST("account_min_desired",'int');
- $object->comment = trim($_POST["account_comment"]);
+ $object->comment = trim(GETPOST("account_comment"));
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number))
{
@@ -251,7 +251,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user-
{
// Delete
$object = new Account($db);
- $object->fetch($_GET["id"]);
+ $object->fetch(GETPOST("id","int"));
$object->delete();
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
@@ -367,7 +367,7 @@ if ($action == 'create')
// Web
print '
'.$langs->trans("Web").' ';
- print ' ';
+ print ' ';
// Tags-Categories
if ($conf->categorie->enabled)
@@ -836,11 +836,11 @@ else
// Ref
print ''.$langs->trans("Ref").' ';
- print ' ref).'"> ';
+ print ' ref).'"> ';
// Label
print ''.$langs->trans("Label").' ';
- print ' label).'"> ';
+ print ' label).'"> ';
// Type
print ''.$langs->trans("AccountType").' ';
@@ -902,14 +902,14 @@ else
// Balance
print ''.$langs->trans("BalanceMinimalAllowed").' ';
- print ' min_allowed).'"> ';
+ print ' min_allowed).'"> ';
print ''.$langs->trans("BalanceMinimalDesired").' ';
- print ' min_desired).'"> ';
+ print ' min_desired).'"> ';
// Web
print ''.$langs->trans("Web").' ';
- print ' url).'">';
+ print ' url).'">';
print ' ';
// Tags-Categories
@@ -970,7 +970,7 @@ else
if (! empty($conf->accounting->enabled))
{
print ''.$langs->trans("AccountancyJournal").' ';
- print ' accountancy_journal).'"> ';
+ print ' accountancy_journal).'"> ';
}
print '
';
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 139f578c5d6..73dd2d4f199 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -833,7 +833,7 @@ class Account extends CommonObject
* @param string $ref Ref of bank account to get
* @return int <0 if KO, >0 if OK
*/
- function fetch($id,$ref='')
+ function fetch($id, $ref='')
{
global $conf;
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index bf69fe98a3b..31a4087815c 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -43,9 +43,9 @@ $fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
-$account=$_GET["account"];
+$account=GETPOST("account");
$mode='standard';
-if (isset($_GET["mode"]) && $_GET["mode"] == 'showalltime') $mode='showalltime';
+if (GETPOST("mode") == 'showalltime') $mode='showalltime';
$error=0;
@@ -63,18 +63,18 @@ $datetime = dol_now();
$year = dol_print_date($datetime, "%Y");
$month = dol_print_date($datetime, "%m");
$day = dol_print_date($datetime, "%d");
-if (! empty($_GET["year"])) $year=sprintf("%04d",$_GET["year"]);
-if (! empty($_GET["month"])) $month=sprintf("%02d",$_GET["month"]);
+if (GETPOST("year")) $year=sprintf("%04d",GETPOST("year"));
+if (GETPOST("month")) $month=sprintf("%02d",GETPOST("month"));
$object = new Account($db);
if ($_GET["account"] && ! preg_match('/,/',$_GET["account"])) // if for a particular account and not a list
{
- $result=$object->fetch($_GET["account"]);
+ $result=$object->fetch(GETPOST("account", "int"));
}
if ($_GET["ref"])
{
- $result=$object->fetch(0,$_GET["ref"]);
+ $result=$object->fetch(0, GETPOST("ref"));
$account=$object->id;
}
@@ -823,7 +823,7 @@ print ' ';
// Graphs
if ($mode == 'standard')
{
- $prevyear=$year;$nextyear=$year;
+ $prevyear=$year; $nextyear=$year;
$prevmonth=$month-1;$nextmonth=$month+1;
if ($prevmonth < 1) { $prevmonth=12; $prevyear--; }
if ($nextmonth > 12) { $nextmonth=1; $nextyear++; }
diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php
index db9d4e623ca..6a3052a938d 100644
--- a/htdocs/compta/clients.php
+++ b/htdocs/compta/clients.php
@@ -97,35 +97,36 @@ $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if (dol_strlen($stcomm))
{
- $sql.= " AND s.fk_stcomm=$stcomm";
+ $sql.= " AND s.fk_stcomm=".$stcomm;
}
if ($socname)
{
- $sql.= " AND s.nom LIKE '%".$db->escape($socname)."%'";
+ $sql.= natural_search("s.nom", $socname);
$sortfield = "s.nom";
$sortorder = "ASC";
}
if ($_GET["search_nom"])
{
- $sql.= " AND s.nom LIKE '%".$db->escape($_GET["search_nom"])."%'";
+ $sql.= natural_search("s.nom", GETPOST("search_nom"));
}
if ($_GET["search_compta"])
{
- $sql.= " AND s.code_compta LIKE '%".$db->escape($_GET["search_compta"])."%'";
+ $sql.= natural_search("s.code_compta", GETPOST("search_compta"));
}
if ($_GET["search_code_client"])
{
- $sql.= " AND s.code_client LIKE '%".$db->escape($_GET["search_code_client"])."%'";
+ $sql.= natural_search("s.code_client", GETPOST("search_code_client"));
}
if (dol_strlen($begin))
{
- $sql.= " AND s.nom LIKE '".$db->escape($begin)."'";
+ $sql.= natural_search("s.nom", $begin);
}
if ($socid)
{
$sql.= " AND s.rowid = ".$socid;
}
-$sql.= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
+$sql.= " ORDER BY $sortfield $sortorder ";
+$sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
$resql = $db->query($sql);
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 9708d8e6360..cd44122b981 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1688,6 +1688,19 @@ if (empty($reshook))
// Update line
if (! $error) {
+ if (empty($user->rights->margins->creer))
+ {
+ foreach ($object->lines as &$line)
+ {
+ if ($line->id == GETPOST('lineid'))
+ {
+ $fournprice = $line->fk_fournprice;
+ $buyingprice = $line->pa_ht;
+ break;
+ }
+ }
+ }
+
$result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, $qty, GETPOST('remise_percent'),
$date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $type,
GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('progress'),
diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php
index 8fbc028a589..1772b6861dd 100644
--- a/htdocs/compta/localtax/card.php
+++ b/htdocs/compta/localtax/card.php
@@ -66,12 +66,12 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
$datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
$datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
- $localtax->accountid=$_POST["accountid"];
- $localtax->paymenttype=$_POST["paiementtype"];
+ $localtax->accountid=GETPOST("accountid");
+ $localtax->paymenttype=GETPOST("paiementtype");
$localtax->datev=$datev;
$localtax->datep=$datep;
- $localtax->amount=$_POST["amount"];
- $localtax->label=$_POST["label"];
+ $localtax->amount=price2num(GETPOST("amount"));
+ $localtax->label=GETPOST("label");
$localtax->ltt=$lttype;
$ret=$localtax->addPayment($user);
@@ -178,10 +178,10 @@ if ($action == 'create')
print '';
// Label
- print ''.$langs->trans("Label").' transcountry(($lttype==2?"LT2Payment":"LT1Payment"),$mysoc->country_code)).'"> ';
+ print ''.$langs->trans("Label").' transcountry(($lttype==2?"LT2Payment":"LT1Payment"),$mysoc->country_code)).'"> ';
// Amount
- print ''.$langs->trans("Amount").' ';
+ print ''.$langs->trans("Amount").' ';
if (! empty($conf->banque->enabled))
{
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 82749f4949f..9980ea396de 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -251,9 +251,9 @@ if (empty($reshook))
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array with all payments dispatching
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
- $paiement->paiementid = dol_getIdFromCode($db,$_POST['paiementcode'],'c_paiement');
- $paiement->num_paiement = $_POST['num_paiement'];
- $paiement->note = $_POST['comment'];
+ $paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement');
+ $paiement->num_paiement = GETPOST('num_paiement');
+ $paiement->note = GETPOST('comment');
if (! $error)
{
@@ -513,7 +513,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Comments
print ''.$langs->trans('Comments').' ';
print '';
- print ' ';
+ print '';
print '
';
@@ -683,12 +683,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->use_javascript_ajax))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
print ' ';
- print ' ';
+ print ' ';
}
else
{
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
}
print "";
diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php
index 8f23036f6af..b8bcf030729 100644
--- a/htdocs/compta/paiement/rapport.php
+++ b/htdocs/compta/paiement/rapport.php
@@ -43,7 +43,7 @@ if ($user->societe_id > 0)
$dir = $conf->facture->dir_output.'/payments';
if (! $user->rights->societe->client->voir || $socid) $dir.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user
-$year = $_GET["year"];
+$year = GETPOST('year', 'int');
if (! $year) { $year=date("Y"); }
diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php
index 0ea48d9075c..b64d92d873f 100644
--- a/htdocs/compta/payment_sc/card.php
+++ b/htdocs/compta/payment_sc/card.php
@@ -37,7 +37,7 @@ $langs->load('banks');
$langs->load('companies');
// Security check
-$id=GETPOST("id");
+$id=GETPOST("id",'int');
$action=GETPOST("action");
$confirm=GETPOST('confirm');
if ($user->societe_id) $socid=$user->societe_id;
@@ -126,12 +126,12 @@ $form = new Form($db);
$h=0;
-$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$_GET["id"];
+$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id;
$head[$h][1] = $langs->trans("Card");
$hselected = $h;
$h++;
-/*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$_GET["id"];
+/*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id;
$head[$h][1] = $langs->trans("Info");
$h++;
*/
diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php
index a7921e53859..df83f5b9958 100644
--- a/htdocs/compta/salaries/card.php
+++ b/htdocs/compta/salaries/card.php
@@ -257,7 +257,7 @@ if ($action == 'create')
// Label
print '';
print fieldLabel('Label','label',1).' ';
- print ' trans("SalaryPayment")).'">';
+ print ' trans("SalaryPayment")).'">';
print ' ';
// Date start period
@@ -275,7 +275,7 @@ if ($action == 'create')
// Amount
print '';
print fieldLabel('Amount','amount',1).' ';
- print ' ';
+ print ' ';
print ' ';
// Bank
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index a32a67bb9fe..8d1aceeaa77 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -39,7 +39,7 @@ $userid=GETPOST('userid','int');
$socid = GETPOST('socid','int');
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
$modecompta = $conf->global->ACCOUNTING_MODE;
-if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
+if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha');
// Security check
if ($user->societe_id > 0) $socid = $user->societe_id;
diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php
index 99bb676a321..cb80f49e790 100644
--- a/htdocs/compta/tva/card.php
+++ b/htdocs/compta/tva/card.php
@@ -258,10 +258,10 @@ if ($action == 'create')
} else {
$label = $langs->trans("VATPayment");
}
- print ''.$langs->trans("Label").' ';
+ print ''.$langs->trans("Label").' ';
// Amount
- print ''.$langs->trans("Amount").' ';
+ print ''.$langs->trans("Amount").' ';
if (! empty($conf->banque->enabled))
{
diff --git a/htdocs/compta/tva/quadri.php b/htdocs/compta/tva/quadri.php
index 0e4a66146aa..73cc0bc96ba 100644
--- a/htdocs/compta/tva/quadri.php
+++ b/htdocs/compta/tva/quadri.php
@@ -29,7 +29,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
-$year=$_GET["year"];
+$year = GETPOST('year', 'int');
if ($year == 0 )
{
$year_current = strftime("%Y",time());
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
new file mode 100644
index 00000000000..3882d2ebca3
--- /dev/null
+++ b/htdocs/contact/agenda.php
@@ -0,0 +1,297 @@
+
+ * Copyright (C) 2004-2015 Laurent Destailleur
+ * Copyright (C) 2004 Benoit Mortier
+ * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2007 Franky Van Liedekerke
+ * Copyright (C) 2013 Florian Henry
+ * Copyright (C) 2013-2016 Alexandre Spangaro
+ * Copyright (C) 2014 Juanjo Menent
+ * Copyright (C) 2015 Jean-François Ferry
+ *
+ * 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 3 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, see .
+ */
+
+/**
+ * \file htdocs/contact/card.php
+ * \ingroup societe
+ * \brief Card of a contact
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
+require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
+require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+
+$langs->load("companies");
+$langs->load("users");
+$langs->load("other");
+$langs->load("commercial");
+
+$mesg=''; $error=0; $errors=array();
+
+$action = (GETPOST('action','alpha') ? GETPOST('action','alpha') : 'view');
+$confirm = GETPOST('confirm','alpha');
+$backtopage = GETPOST('backtopage','alpha');
+$id = GETPOST('id','int');
+$socid = GETPOST('socid','int');
+
+$object = new Contact($db);
+$extrafields = new ExtraFields($db);
+
+// fetch optionals attributes and labels
+$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
+
+// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
+$object->getCanvas($id);
+$objcanvas=null;
+$canvas = (! empty($object->canvas)?$object->canvas:GETPOST("canvas"));
+if (! empty($canvas))
+{
+ require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
+ $objcanvas = new Canvas($db, $action);
+ $objcanvas->getCanvas('contact', 'contactcard', $canvas);
+}
+
+if (GETPOST('actioncode','array'))
+{
+ $actioncode=GETPOST('actioncode','array',3);
+ if (! count($actioncode)) $actioncode='0';
+}
+else
+{
+ $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
+}
+$search_agenda_label=GETPOST('search_agenda_label');
+
+// Security check
+if ($user->societe_id) $socid=$user->societe_id;
+$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
+
+$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
+$sortfield = GETPOST("sortfield",'alpha');
+$sortorder = GETPOST("sortorder",'alpha');
+$page = GETPOST("page",'int');
+if ($page == -1) { $page = 0; }
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (! $sortfield) $sortfield='a.datep, a.id';
+if (! $sortorder) $sortorder='DESC';
+
+// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
+$hookmanager->initHooks(array('contactcard','globalcard'));
+
+
+/*
+ * Actions
+ */
+
+$parameters=array('id'=>$id, 'objcanvas'=>$objcanvas);
+$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
+if (empty($reshook))
+{
+ // Cancel
+ if (GETPOST("cancel") && ! empty($backtopage))
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
+
+ // Purge search criteria
+ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+ {
+ $actioncode='';
+ $search_agenda_label='';
+ }
+}
+
+
+/*
+ * View
+ */
+
+
+$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
+if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname;
+$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
+llxHeader('', $title, $help_url);
+
+$form = new Form($db);
+$formcompany = new FormCompany($db);
+
+$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
+
+if ($socid > 0)
+{
+ $objsoc = new Societe($db);
+ $objsoc->fetch($socid);
+}
+
+if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
+{
+ // -----------------------------------------
+ // When used with CANVAS
+ // -----------------------------------------
+ if (empty($object->error) && $id)
+ {
+ $object = new Contact($db);
+ $result=$object->fetch($id);
+ if ($result <= 0) dol_print_error('',$object->error);
+ }
+ $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
+ $objcanvas->display_canvas($action); // Show template
+}
+else
+{
+ // -----------------------------------------
+ // When used in standard mode
+ // -----------------------------------------
+
+ // Confirm deleting contact
+ if ($user->rights->societe->contact->supprimer)
+ {
+ if ($action == 'delete')
+ {
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
+ }
+ }
+
+ /*
+ * Onglets
+ */
+ $head=array();
+ if ($id > 0)
+ {
+ // Si edition contact deja existant
+ $object = new Contact($db);
+ $res=$object->fetch($id, $user);
+ if ($res < 0) { dol_print_error($db,$object->error); exit; }
+ $res=$object->fetch_optionals($object->id,$extralabels);
+
+ // Show tabs
+ $head = contact_prepare_head($object);
+
+ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
+ }
+
+ if (! empty($id) && $action != 'edit' && $action != 'create')
+ {
+ $objsoc = new Societe($db);
+
+ /*
+ * Fiche en mode visualisation
+ */
+
+ dol_htmloutput_errors($error,$errors);
+
+ dol_fiche_head($head, 'agenda', $title, 0, 'contact');
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref='';
+ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
+ {
+ $objsoc=new Societe($db);
+ $objsoc->fetch($object->socid);
+ // Thirdparty
+ $morehtmlref.=$langs->trans('ThirdParty') . ' : ';
+ if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
+ else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
+ }
+ $morehtmlref.='
';
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
+
+ print '';
+
+ print '
';
+
+ $object->info($id);
+ print dol_print_object_info($object, 1);
+
+ print '
';
+
+ print dol_fiche_end();
+
+
+ // Actions buttons
+
+ $objcon=$object;
+ $object->fetch_thirdparty();
+ $objthirdparty=$object->thirdparty;
+
+ $out='';
+ $permok=$user->rights->agenda->myactions->create;
+ if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
+ {
+ //$out.='trans("AddAnAction"),'filenew');
+ //$out.=" ";
+ }
+
+
+ print '';
+
+ if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
+ {
+ $param='&id='.$id;
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+
+
+ print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'','');
+
+ // List of all actions
+ $filters=array();
+ $filters['search_agenda_label']=$search_agenda_label;
+
+ show_actions_done($conf,$langs,$db,$objthirdparty,$object,0,$actioncode, '', $filters, $sortfield, $sortorder);
+ }
+ }
+}
+
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index e7896d9b9ac..e6429fdc6d7 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -477,10 +477,10 @@ else
*/
$object->canvas=$canvas;
- $object->state_id = $_POST["state_id"];
+ $object->state_id = GETPOST("state_id");
// We set country_id, country_code and label for the selected country
- $object->country_id=$_POST["country_id"]?$_POST["country_id"]:(empty($objsoc->country_id)?$mysoc->country_id:$objsoc->country_id);
+ $object->country_id=$_POST["country_id"]?GETPOST("country_id"):(empty($objsoc->country_id)?$mysoc->country_id:$objsoc->country_id);
if ($object->country_id)
{
$tmparray=getCountry($object->country_id,'all');
@@ -530,9 +530,9 @@ else
// Name
print ''.$langs->trans("Lastname").' / '.$langs->trans("Label").' ';
- print ' lastname).'" autofocus="autofocus"> ';
+ print ' lastname).'" autofocus="autofocus"> ';
print ''.$langs->trans("Firstname").' ';
- print ' firstname).'"> ';
+ print ' firstname).'"> ';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
@@ -559,7 +559,7 @@ else
print '';
print ''.$langs->trans("PostOrFunction").' ';
- print ' poste).'"> ';
+ print ' poste).'"> ';
$colspan=3;
if ($conf->use_javascript_ajax && $socid > 0) $colspan=2;
@@ -612,20 +612,20 @@ else
// Phone / Fax
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->phone; // Predefined with third party
print ''.$langs->trans("PhonePro").' ';
- print ' phone_pro).'"> ';
+ print ' phone_pro).'"> ';
print ''.$langs->trans("PhonePerso").' ';
- print ' phone_perso).'"> ';
+ print ' phone_perso).'"> ';
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party
print ''.$langs->trans("PhoneMobile").' ';
- print ' phone_mobile).'"> ';
+ print ' phone_mobile).'"> ';
print ''.$langs->trans("Fax").' ';
- print ' fax).'"> ';
+ print ' fax).'"> ';
// EMail
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party
print ''.$langs->trans("Email").' ';
- print ' email).'"> ';
+ print ' email).'"> ';
if (! empty($conf->mailing->enabled))
{
print ''.$langs->trans("No_Email").' ';
@@ -639,13 +639,13 @@ else
// Instant message and no email
print ''.$langs->trans("IM").' ';
- print ' jabberid).'"> ';
+ print ' jabberid).'"> ';
// Skype
if (! empty($conf->skype->enabled))
{
print ''.$langs->trans("Skype").' ';
- print ' skype).'"> ';
+ print ' skype).'"> ';
}
// Visibility
@@ -784,9 +784,13 @@ else
// Lastname
print ''.$langs->trans("Lastname").' / '.$langs->trans("Label").' ';
- print ' lastname).'" autofocus="autofocus"> ';
+ print ' lastname).'" autofocus="autofocus"> ';
+ print ' ';
+ print '';
+ // Firstname
print ''.$langs->trans("Firstname").' ';
- print ' firstname).'"> ';
+ print ' firstname).'"> ';
+ print '';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
@@ -800,57 +804,56 @@ else
// Civility
print ''.$langs->trans("UserTitle").' ';
- print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id);
+ print $formcompany->select_civility(isset($_POST["civility_id"])?GETPOST("civility_id"):$object->civility_id);
print ' ';
print ''.$langs->trans("PostOrFunction").' ';
- print ' poste).'"> ';
+ print ' poste).'"> ';
// Address
print ''.$langs->trans("Address").' ';
- print ' ';
-
- $rowspan=3;
- if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
-
- print '';
- if ($conf->use_javascript_ajax) print ''.$langs->trans('CopyAddressFromSoc').' ';
- print ' ';
+ print '';
+ print '';
+ print '';
+ print '
';
+ print ' ';
// Zip / Town
- print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
- print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' ';
- print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
+ print ' '.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
+ print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode"):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' ';
+ print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town"):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print ' ';
// Country
- print ''.$langs->trans("Country").' ';
- print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id');
+ print ' '.$langs->trans("Country").' ';
+ print $form->select_country(isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print ' ';
// State
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
- print ''.$langs->trans('State').' ';
- print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id');
+ print ' '.$langs->trans('State').' ';
+ print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'state_id');
print ' ';
}
// Phone
print ''.$langs->trans("PhonePro").' ';
- print ' phone_pro).'"> ';
+ print ' phone_pro).'"> ';
print ''.$langs->trans("PhonePerso").' ';
- print ' phone_perso).'"> ';
+ print ' phone_perso).'"> ';
print ''.$langs->trans("PhoneMobile").' ';
- print ' phone_mobile).'"> ';
+ print ' phone_mobile).'"> ';
print ''.$langs->trans("Fax").' ';
- print ' fax).'"> ';
+ print ' fax).'"> ';
// EMail
print ''.$langs->trans("EMail").' ';
- print ' email).'"> ';
+ print ' email).'"> ';
if (! empty($conf->mailing->enabled))
{
$langs->load("mails");
@@ -865,7 +868,7 @@ else
// Jabberid
print ''.$langs->trans("IM").' ';
- print ' jabberid).'"> ';
+ print ' jabberid).'"> ';
if (! empty($conf->mailing->enabled))
{
print ''.$langs->trans("No_Email").' ';
@@ -881,7 +884,7 @@ else
if (! empty($conf->skype->enabled))
{
print ''.$langs->trans("Skype").' ';
- print ' skype).'"> ';
+ print ' skype).'"> ';
}
// Visibility
@@ -1046,7 +1049,18 @@ else
$linkback = ''.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+ $morehtmlref='';
+ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
+ {
+ $objsoc->fetch($object->socid);
+ // Thirdparty
+ $morehtmlref.=$langs->trans('ThirdParty') . ' : ';
+ if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
+ else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
+ }
+ $morehtmlref.='
';
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '';
@@ -1055,24 +1069,6 @@ else
print '
';
print '
';
- // Company
- if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
- {
- print ''.$langs->trans("ThirdParty").' ';
- if ($object->socid > 0)
- {
- $objsoc->fetch($object->socid);
- print $objsoc->getNomUrl(1);
- }
- else
- {
- print $langs->trans("ContactNotLinkedToCompany");
- }
- print ' ';
- }
-
- print ' ';
-
// Civility
print ''.$langs->trans("UserTitle").' ';
print $object->getCivilityLabel();
@@ -1233,8 +1229,9 @@ else
}
print "";
- print " ";
+ //print " ";
+ /*
if (! empty($conf->agenda->enabled))
{
$objthirdparty=$objsoc;
@@ -1258,6 +1255,7 @@ else
print show_actions_done($conf,$langs,$db,$objsoc,$object,0,'','');
}
+ */
}
}
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 825c1e8dab5..8d003e14cf5 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -109,7 +109,19 @@ if ($object->id)
$linkback = ''.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+ $morehtmlref='';
+ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
+ {
+ $objsoc=new Societe($db);
+ $objsoc->fetch($object->socid);
+ // Thirdparty
+ $morehtmlref.=$langs->trans('ThirdParty') . ' : ';
+ if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
+ else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
+ }
+ $morehtmlref.='
';
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '';
@@ -117,6 +129,7 @@ if ($object->id)
print '
';
// Company
+ /*
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
if ($object->socid > 0)
@@ -133,7 +146,7 @@ if ($object->id)
print $langs->trans("ContactNotLinkedToCompany");
print '';
}
- }
+ }*/
// Civility
print ''.$langs->trans("UserTitle").' ';
diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php
index 17c718cfb42..eed044cdadf 100644
--- a/htdocs/contact/note.php
+++ b/htdocs/contact/note.php
@@ -74,25 +74,31 @@ if ($id > 0)
$head = contact_prepare_head($object);
dol_fiche_head($head, 'note', $title,0,'contact');
-
-
- print '