- *
- * 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/comm/contact.php
- * \ingroup commercial
- * \brief Liste des contacts
- */
-
-// Load Dolibarr environment
-require '../main.inc.php';
-
-/**
- * @var Conf $conf
- * @var DoliDB $db
- * @var HookManager $hookmanager
- * @var Translate $langs
- * @var User $user
- */
-
-// Load translation files required by the page
-$langs->load("companies");
-
-$sortfield = GETPOST('sortfield', 'aZ09comma');
-$sortorder = GETPOST('sortorder', 'aZ09comma');
-$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
-if (!$sortorder) {
- $sortorder = "ASC";
-}
-if (!$sortfield) {
- $sortfield = "p.lastname";
-}
-if ($page < 0) {
- $page = 0;
-}
-$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
-$offset = $limit * $page;
-
-$type = GETPOST('type', 'alpha');
-$search_lastname = GETPOST('search_nom') ? GETPOST('search_nom') : GETPOST('search_lastname'); // For backward compatibility
-$search_firstname = GETPOST('search_firstname') ? GETPOST('search_firstname') : GETPOST('search_firstname'); // For backward compatibility
-$search_company = GETPOST('search_societe') ? GETPOST('search_societe') : GETPOST('search_company'); // For backward compatibility
-$contactname = GETPOST('contactname');
-$begin = GETPOST('begin', 'alpha');
-
-// Security check
-$socid = GETPOSTINT('socid');
-if ($user->socid) {
- $action = '';
- $socid = $user->socid;
-}
-
-$hookmanager->initHooks(array('contactlist'));
-$result = restrictedArea($user, 'societe', $socid, '');
-
-
-/*
- * View
- */
-
-llxHeader('', $langs->trans("Contacts"));
-
-$urlfiche = null;
-
-$label = $langs->trans("Unknown"); // Ensure label is defined
-
-if ($type == "c" || $type == "p") {
- $label = $langs->trans("Customers");
- $urlfiche = "card.php";
-}
-if ($type == "f") {
- $label = $langs->trans("Suppliers");
- $urlfiche = "card.php";
-}
-
-/*
- * List mode
- */
-
-$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm,";
-$sql .= " p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone";
-$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
-$sql .= " ".MAIN_DB_PREFIX."socpeople as p";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
-$sql .= " WHERE s.fk_stcomm = st.id";
-$sql .= " AND p.entity IN (".getEntity('contact').")";
-if ($type == "c") {
- $sql .= " AND s.client IN (1, 3)";
-}
-if ($type == "p") {
- $sql .= " AND s.client IN (2, 3)";
-}
-if ($type == "f") {
- $sql .= " AND s.fournisseur = 1";
-}
-if (!empty($search_lastname)) {
- $sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
-}
-if (!empty($search_firstname)) {
- $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
-}
-if (!empty($search_company)) {
- $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
-}
-if (!empty($contactname)) { // access a partir du module de recherche
- $sql .= " AND (p.lastname LIKE '%".$db->escape($contactname)."%' OR p.firstname LIKE '%".$db->escape($contactname)."%') ";
- $sortfield = "p.lastname";
- $sortorder = "ASC";
-}
-// If the internal user must only see his customers, force searching by him
-$search_sale = 0;
-if (!$user->hasRight('societe', 'client', 'voir')) {
- $search_sale = $user->id;
-}
-// Search on sale representative
-if ($search_sale && $search_sale != '-1') {
- if ($search_sale == -2) {
- $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
- } elseif ($search_sale > 0) {
- $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
- }
-}
-// Search on socid
-if ($socid) {
- $sql .= " AND p.fk_soc = ".((int) $socid);
-}
-
-$sql .= $db->order($sortfield, $sortorder);
-$sql .= $db->plimit($limit + 1, $offset);
-
-$resql = $db->query($sql);
-if ($resql) {
- $num = $db->num_rows($resql);
-
- $param = "&type=".$type;
-
- $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
- print_barre_liste($title.($label ? " (".$label.")" : ""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num);
-
- print '';
-
- $db->free($resql);
-} else {
- dol_print_error($db);
-}
-
-// End of page
-llxFooter();
-$db->close();
diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php
index 7187c97a6a1..de74a12bb78 100644
--- a/htdocs/comm/mailing/advtargetemailing.php
+++ b/htdocs/comm/mailing/advtargetemailing.php
@@ -718,7 +718,7 @@ if ($object->fetch($id) >= 0) {
// Code Client
print '| '.$langs->trans('CustomerCode');
if (!empty($array_query['cust_code'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
$cust_code_str = (string) $array_query['cust_code'];
} else {
$cust_code_str = null;
@@ -730,7 +730,7 @@ if ($object->fetch($id) >= 0) {
// Address Client
print ' |
| '.$langs->trans('Address');
if (!empty($array_query['cust_adress'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | | '."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
@@ -739,7 +739,7 @@ if ($object->fetch($id) >= 0) {
// Zip Client
print ' |
| '.$langs->trans('Zip');
if (!empty($array_query['cust_zip'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | | '."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
@@ -748,7 +748,7 @@ if ($object->fetch($id) >= 0) {
// City Client
print ' |
| '.$langs->trans('Town');
if (!empty($array_query['cust_city'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | | '."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
@@ -757,7 +757,7 @@ if ($object->fetch($id) >= 0) {
// State Client
print ' |
| '.$langs->trans('State');
if (!empty($array_query['cust_state'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $formadvtargetemaling->multiselectState('cust_state', $array_query['cust_state']);
@@ -767,7 +767,7 @@ if ($object->fetch($id) >= 0) {
// Customer Country
print ' |
| '.$langs->trans("Country");
if (!empty($array_query['cust_country'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']);
@@ -777,7 +777,7 @@ if ($object->fetch($id) >= 0) {
// State Customer
print ' |
| '.$langs->trans('Status').' '.$langs->trans('ThirdParty');
if (!empty($array_query['cust_status'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
print $formadvtargetemaling->advMultiselectarray(
@@ -794,7 +794,7 @@ if ($object->fetch($id) >= 0) {
// Mother Company
print ' |
| '.$langs->trans("ParentCompany");
if (!empty($array_query['cust_mothercompany'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print '';
@@ -806,7 +806,7 @@ if ($object->fetch($id) >= 0) {
$selected = $array_query['cust_typecust'];
print ' |
| '.$langs->trans('ProspectCustomer').' '.$langs->trans('ThirdParty');
if (!empty($array_query['cust_typecust'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
$options_array = array(
@@ -822,7 +822,7 @@ if ($object->fetch($id) >= 0) {
// Prospection status
print ' |
| '.$langs->trans('ProspectLevel');
if (!empty($array_query['cust_prospect_status'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status');
@@ -832,7 +832,7 @@ if ($object->fetch($id) >= 0) {
// Prospection comm status
print ' |
| '.$langs->trans('StatusProsp');
if (!empty($array_query['cust_comm_status'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']);
@@ -842,7 +842,7 @@ if ($object->fetch($id) >= 0) {
// Customer Type
print ' |
| '.$langs->trans("ThirdPartyType");
if (!empty($array_query['cust_typeent'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, "(id:<>:0)"), $array_query['cust_typeent']);
@@ -852,7 +852,7 @@ if ($object->fetch($id) >= 0) {
// Staff number
print ' | '.$langs->trans("Staff");
if (!empty($array_query['cust_effectif_id'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, "(id:<>:0)"), $array_query['cust_effectif_id']);
@@ -862,7 +862,7 @@ if ($object->fetch($id) >= 0) {
// Sales manager
print ' |
| '.$langs->trans("SalesRepresentatives");
if (!empty($array_query['cust_saleman'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user);
@@ -873,7 +873,7 @@ if ($object->fetch($id) >= 0) {
if (getDolGlobalInt('MAIN_MULTILANGS')) {
print ' |
| '.$langs->trans("DefaultLang");
if (!empty($array_query['cust_language'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']);
@@ -904,7 +904,7 @@ if ($object->fetch($id) >= 0) {
}
print ' |
| '.$langs->trans($extrafieldinfo['label'][$key]);
if (!empty($array_query['options_'.$key]) || (is_array($array_query['options_'.$key]) && count($array_query['options_'.$key]) > 0)) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
if (($extrafieldinfo['type'][$key] == 'varchar') || ($extrafieldinfo['type'][$key] == 'text')) {
@@ -973,7 +973,7 @@ if ($object->fetch($id) >= 0) {
// State Contact
print ' |
| '.$langs->trans('Status').' '.$langs->trans('Contact');
if (!empty($array_query['contact_status'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
print $formadvtargetemaling->advMultiselectarray(
@@ -991,7 +991,7 @@ if ($object->fetch($id) >= 0) {
// Civility
print ' |
| '.$langs->trans("UserTitle");
if (!empty($array_query['contact_civility'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']);
@@ -1000,14 +1000,14 @@ if ($object->fetch($id) >= 0) {
// contact name
print ' |
| '.$langs->trans('Contact').' '.$langs->trans('Lastname');
if (!empty($array_query['contact_lastname'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | | '."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print ' |
'."\n";
print '| '.$langs->trans('Contact').' '.$langs->trans('Firstname');
if (!empty($array_query['contact_firstname'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | | '."\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
@@ -1016,7 +1016,7 @@ if ($object->fetch($id) >= 0) {
// Contact Country
print ' |
| '.$langs->trans('Contact').' '.$langs->trans("Country");
if (!empty($array_query['contact_country'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']);
@@ -1026,7 +1026,7 @@ if ($object->fetch($id) >= 0) {
// Never send mass mailing
print ' |
| '.$langs->trans('Contact').' '.$langs->trans("No_Email");
if (!empty($array_query['contact_no_email'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print $form->selectarray(
@@ -1044,7 +1044,7 @@ if ($object->fetch($id) >= 0) {
// Contact Date Create
print ' |
| '.$langs->trans('Contact').' '.$langs->trans("DateCreation");
if (!empty($array_query['contact_create_st_dt'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print '';
@@ -1059,7 +1059,7 @@ if ($object->fetch($id) >= 0) {
// Contact update Create
print ' | '.$langs->trans('Contact').' '.$langs->trans("DateLastModification");
if (!empty($array_query['contact_update_st_dt'])) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | '."\n";
print '';
@@ -1099,7 +1099,7 @@ if ($object->fetch($id) >= 0) {
foreach ($extrafieldinfo['label'] as $key => $val) {
print ' | '.$extrafieldinfo['label'][$key];
if ($array_query['options_'.$key.'_cnct'] != '' || (is_array($array_query['options_'.$key.'_cnct']) && count($array_query['options_'.$key.'_cnct']) > 0)) {
- print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
+ print img_picto($langs->trans('AdvTgtUse'), 'tick');
}
print ' | ';
if (($extrafieldinfo['type'][$key] == 'varchar') || ($extrafieldinfo['type'][$key] == 'text')) {
diff --git a/htdocs/theme/common/help.png b/htdocs/theme/common/help.png
index 58b0619317c..d769e271225 100644
Binary files a/htdocs/theme/common/help.png and b/htdocs/theme/common/help.png differ
diff --git a/htdocs/theme/common/warning.png b/htdocs/theme/common/warning.png
new file mode 100644
index 00000000000..6836acdd5a7
Binary files /dev/null and b/htdocs/theme/common/warning.png differ
diff --git a/htdocs/theme/eldy/img/search.png b/htdocs/theme/eldy/img/searchx.png
similarity index 100%
rename from htdocs/theme/eldy/img/search.png
rename to htdocs/theme/eldy/img/searchx.png
|
|
|