diff --git a/dev/setup/apache/virtualhost b/dev/setup/apache/virtualhost
new file mode 100644
index 00000000000..c3a2dff3e43
--- /dev/null
+++ b/dev/setup/apache/virtualhost
@@ -0,0 +1,62 @@
+
+#php_admin_value sendmail_path "/usr/sbin/sendmail -t -i"
+#php_admin_value mail.force_extra_parameters "-f postmaster@mydomain.com"
+php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com"
+php_admin_value open_basedir /tmp/:/home/../htdocs
+
+ServerName myvirtualalias
+ServerAlias myvirtualalias
+
+UseCanonicalName On
+
+AddDefaultCharset UTF-8
+
+DocumentRoot "/home/.../htdocs"
+
+
+ AllowOverride None
+ Options -Indexes -MultiViews +FollowSymLinks -ExecCGI
+ Require all granted
+
+
+
+ Deny from all
+ RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml
+ AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml
+
+
+
+ErrorLog /var/log/apache2/myvirtualalias_error_log
+TransferLog /var/log/apache2/myvirtualalias_access_log
+
+# Compress returned resources of type php pages, text file export, css and javascript
+AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
+
+AddType text/javascript .jgz
+AddEncoding gzip .jgz
+ExpiresActive On
+ExpiresByType image/x-icon A2592000
+ExpiresByType image/gif A2592000
+ExpiresByType image/png A2592000
+ExpiresByType image/jpeg A2592000
+ExpiresByType text/css A2592000
+ExpiresByType text/javascript A2592000
+ExpiresByType application/x-javascript A2592000
+ExpiresByType application/javascript A2592000
+
+SSLEngine On
+
+# A self-signed (snakeoil) certificate can be created by installing
+# the ssl-cert package. See
+# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
+# If both key and certificate are stored in the same file, only the
+# SSLCertificateFile directive is needed.
+SSLCertificateFile /etc/letsencrypt/live/www.mydomain.com/cert.pem
+SSLCertificateKeyFile /etc/letsencrypt/live/www.mydomain.com/privkey.pem
+SSLCertificateChainFile /etc/letsencrypt/live/www.mydomain.com/chain.pem
+
+#RewriteEngine on
+#RewriteCond %{SERVER_PORT} ^80$
+#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
+
+
diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php
index 7a5816ad3e8..ca911af97b8 100644
--- a/htdocs/admin/system/web.php
+++ b/htdocs/admin/system/web.php
@@ -53,11 +53,19 @@ print '
';
- print $langs->trans("Website").': ';
+ print $langs->trans("WebSite").': ';
print '
';
// List of websites
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 8fd8de639c3..a66a4635281 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -1541,7 +1541,7 @@ class ActionComm extends CommonObject
// Delete also very old past events (we do not keep more than 1 month record in past)
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder WHERE dateremind < '".$this->jdate($now - (3600 * 24 * 32))."'";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder WHERE dateremind < '".$this->db->jdate($now - (3600 * 24 * 32))."'";
$this->db->query($sql);
return 0;
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 5a5ef5fa90c..cdfd3e526cd 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -224,6 +224,8 @@ if ($object->fetch($id) >= 0)
dol_fiche_end();
+ print 'fields as $key => $val)
{
- if (abs($val['visible']) != 1) continue; // Discard such field from form
+ // Discard if extrafield is a hidden field on form
+ if (abs($val['visible']) != 1) continue;
+
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
- if ($key == 'status') continue; // Status is alreadt in dol_banner
+ if ($key == 'status') continue; // Status is already in dol_banner
$value=$object->$key;
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index 15bfd51f83b..b57025e3dd6 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -42,7 +42,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][
{
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
{
- // Discard if extrafield is a hidden field
+ // Discard if extrafield is a hidden field on form
if (abs($extrafields->attributes[$object->table_element]['list'][$key]) != 1) continue;
// Load language if required
diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
index 520e02f1810..348aeb4dcc8 100644
--- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
+++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
@@ -48,13 +48,11 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
{
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
- dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
-
-
// Test if event/record is qualified
$listofqualifiedelement = array('payment', 'facture');
if (! in_array($object->element, $listofqualifiedelement)) return 1;
+ dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// Event/record is qualified
if ($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php
index 24cac301379..3ebf3f22d02 100644
--- a/htdocs/cron/class/cronjob.class.php
+++ b/htdocs/cron/class/cronjob.class.php
@@ -1121,7 +1121,7 @@ class Cronjob extends CommonObject
$error++;
}
}
- if ($execmethod == 2) // This method may create
+ if ($execmethod == 2) // With this method, there is no way to get the return code, only output
{
$ok=0;
$handle = fopen($outputfile, 'w+b');
@@ -1154,7 +1154,7 @@ class Cronjob extends CommonObject
dol_syslog(get_class($this)."::executeCLI output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG);
- return $reval;
+ return $retval;
}
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index bcc3a3acdfe..74ec5659e14 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -63,6 +63,10 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
-- For 7.0
+UPDATE llx_website SET entity = 1 WHERE entity IS NULL;
+-- VMYSQL4.3 ALTER TABLE llx_website MODIFY COLUMN entity integer NOT NULL DEFAULT 1;
+-- VPGSQL8.2 ALTER TABLE llx_website ALTER COLUMN entity SET NOT NULL;
+
ALTER TABLE llx_user ADD COLUMN birth date;
-- VMYSQL4.1 ALTER TABLE llx_holiday_users DROP PRIMARY KEY;
@@ -173,31 +177,7 @@ ALTER TABLE llx_menu MODIFY fk_mainmenu varchar(100);
ALTER TABLE llx_menu MODIFY fk_leftmenu varchar(100);
-CREATE TABLE llx_websiteaccount(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- login varchar(64) NOT NULL,
- pass_crypted varchar(128),
- pass_temp varchar(128), -- temporary password when asked for forget password
- fk_soc integer,
- fk_website integer,
- date_last_login datetime,
- date_previous_login datetime,
- date_creation datetime NOT NULL,
- tms timestamp NOT NULL,
- fk_user_creat integer NOT NULL,
- fk_user_modif integer,
- import_key varchar(14),
- status integer
-) ENGINE=innodb;
-
-
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_rowid (rowid);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_login (login);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_import_key (import_key);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_status (status);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_soc (fk_soc);
-
-create table llx_websiteaccount_extrafields
+CREATE TABLE llx_website_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
@@ -205,8 +185,54 @@ create table llx_websiteaccount_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
+ALTER TABLE llx_website_extrafields ADD INDEX idx_website_extrafields (fk_object);
+CREATE TABLE llx_website_account(
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ login varchar(64) NOT NULL,
+ pass_encoding varchar(24) NOT NULL,
+ pass_crypted varchar(128),
+ pass_temp varchar(128), -- temporary password when asked for forget password
+ fk_soc integer,
+ fk_website integer NOT NULL,
+ note_private text,
+ date_last_login datetime,
+ date_previous_login datetime,
+ date_creation datetime NOT NULL,
+ tms timestamp NOT NULL,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ import_key varchar(14),
+ status integer
+) ENGINE=innodb;
+
+
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_rowid (rowid);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_login (login);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_import_key (import_key);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_status (status);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_soc (fk_soc);
+
+ALTER TABLE llx_website_account ADD UNIQUE INDEX uk_website_account_login_website_soc(login, fk_website, fk_soc);
+
+ALTER TABLE llx_website_account ADD CONSTRAINT llx_website_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);
+
+CREATE TABLE llx_website_account_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_website_account_extrafields ADD INDEX idx_website_account_extrafields (fk_object);
+
+
+
+
+
+alter table llx_user add column pass_encoding varchar(24) NULL;
@@ -498,7 +524,7 @@ ALTER TABLE llx_resource ADD UNIQUE INDEX uk_resource_ref (ref, entity);
ALTER TABLE llx_product ADD COLUMN accountancy_code_sell_intra varchar(32) AFTER accountancy_code_sell;
ALTER TABLE llx_product ADD COLUMN accountancy_code_sell_export varchar(32) AFTER accountancy_code_sell_intra;
--- SPEC : use database type "double" to store monetary values
+-- SPEC : use database type 'double' to store monetary values
ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8);
ALTER TABLE llx_chargessociales MODIFY COLUMN amount double(24,8);
ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8);
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index 71ea5a559f5..27732169bd1 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -34,6 +34,7 @@ create table llx_user
fk_user_creat integer,
fk_user_modif integer,
login varchar(50) NOT NULL,
+ pass_encoding varchar(24);
pass varchar(128),
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password
diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website.sql
index 14afe19d0aa..6946b981c86 100644
--- a/htdocs/install/mysql/tables/llx_website.sql
+++ b/htdocs/install/mysql/tables/llx_website.sql
@@ -20,7 +20,7 @@
CREATE TABLE llx_website
(
rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
- entity integer DEFAULT 1,
+ entity integer NOT NULL DEFAULT 1,
ref varchar(128) NOT NULL,
description varchar(255),
status integer DEFAULT 1,
diff --git a/htdocs/install/mysql/tables/llx_websiteaccount.key.sql b/htdocs/install/mysql/tables/llx_website_account.key.sql
similarity index 54%
rename from htdocs/install/mysql/tables/llx_websiteaccount.key.sql
rename to htdocs/install/mysql/tables/llx_website_account.key.sql
index 463218b04cd..1302ec50d2c 100644
--- a/htdocs/install/mysql/tables/llx_websiteaccount.key.sql
+++ b/htdocs/install/mysql/tables/llx_website_account.key.sql
@@ -15,14 +15,14 @@
-- BEGIN MODULEBUILDER INDEXES
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_rowid (rowid);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_login (login);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_status (status);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_website (fk_website);
-ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_soc (fk_soc);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_rowid (rowid);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_login (login);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_status (status);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_website (fk_website);
+ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_soc (fk_soc);
-- END MODULEBUILDER INDEXES
-ALTER TABLE llx_websiteaccount ADD UNIQUE INDEX uk_websiteaccount_login_website_soc(login, fk_website, fk_soc);
+ALTER TABLE llx_website_account ADD UNIQUE INDEX uk_website_account_login_website_soc(login, fk_website, fk_soc);
---ALTER TABLE llx_websiteaccount ADD CONSTRAINT llx_websiteaccount_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid);
+ALTER TABLE llx_website_account ADD CONSTRAINT llx_website_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);
diff --git a/htdocs/install/mysql/tables/llx_websiteaccount.sql b/htdocs/install/mysql/tables/llx_website_account.sql
similarity index 87%
rename from htdocs/install/mysql/tables/llx_websiteaccount.sql
rename to htdocs/install/mysql/tables/llx_website_account.sql
index 838fc170595..373ba53f484 100644
--- a/htdocs/install/mysql/tables/llx_websiteaccount.sql
+++ b/htdocs/install/mysql/tables/llx_website_account.sql
@@ -14,15 +14,17 @@
-- along with this program. If not, see http://www.gnu.org/licenses/.
-CREATE TABLE llx_websiteaccount(
+CREATE TABLE llx_website_account(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
login varchar(64) NOT NULL,
+ pass_encoding varchar(24) NOT NULL,
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password
fk_soc integer,
- fk_website integer,
- date_last_login datetime,
+ fk_website integer NOT NULL,
+ note_private text,
+ date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_website_account_extrafields.key.sql b/htdocs/install/mysql/tables/llx_website_account_extrafields.key.sql
new file mode 100644
index 00000000000..9970f8bc680
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_website_account_extrafields.key.sql
@@ -0,0 +1,20 @@
+-- ===================================================================
+-- Copyright (C) 2017 Laurent Destailleur
+--
+-- 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 .
+--
+-- ===================================================================
+
+
+ALTER TABLE llx_website_account_extrafields ADD INDEX idx_website_account_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_website_account_extrafields.sql b/htdocs/install/mysql/tables/llx_website_account_extrafields.sql
new file mode 100644
index 00000000000..7bec7e958d9
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_website_account_extrafields.sql
@@ -0,0 +1,23 @@
+-- Copyright (C) 2017 Laurent Destailleur
+--
+-- 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 http://www.gnu.org/licenses/.
+
+CREATE TABLE llx_website_account_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_website_extrafields.key.sql b/htdocs/install/mysql/tables/llx_website_extrafields.key.sql
new file mode 100644
index 00000000000..1963744b701
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_website_extrafields.key.sql
@@ -0,0 +1,20 @@
+-- ===================================================================
+-- Copyright (C) 2017 Laurent Destailleur
+--
+-- 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 .
+--
+-- ===================================================================
+
+
+ALTER TABLE llx_website_extrafields ADD INDEX idx_website_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_websiteaccount_extrafields.sql b/htdocs/install/mysql/tables/llx_website_extrafields.sql
similarity index 89%
rename from htdocs/install/mysql/tables/llx_websiteaccount_extrafields.sql
rename to htdocs/install/mysql/tables/llx_website_extrafields.sql
index fd4d4e3653f..7ca3b94c713 100644
--- a/htdocs/install/mysql/tables/llx_websiteaccount_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_website_extrafields.sql
@@ -1,4 +1,4 @@
--- Copyright (C) 2016 Laurent Destailleur
+-- Copyright (C) 2017 Laurent Destailleur
--
-- 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
@@ -13,7 +13,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see http://www.gnu.org/licenses/.
-create table llx_websiteaccount_extrafields
+CREATE TABLE llx_website_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 979a601fa91..7f89918e90a 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -813,8 +813,9 @@ ModuleBuilder=Module Builder
SetMultiCurrencyCode=Set currency
BulkActions=Bulk actions
ClickToShowHelp=Click to show tooltip help
-Website=Web site
+WebSite=Web site
WebSites=Web sites
+WebSiteAccounts=Web site accounts
ExpenseReport=Expense report
ExpenseReports=Expense reports
HR=HR
@@ -823,7 +824,6 @@ AutomaticallyCalculated=Automatically calculated
TitleSetToDraft=Go back to draft
ConfirmSetToDraft=Are you sure you want to go back to Draft status ?
ImportId=Import id
-Websites=Web sites
Events=Events
EMailTemplates=Emails templates
FileNotShared=File not shared to exernal public
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index e8ef03d86fb..0d9d1cfbd85 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -214,6 +214,7 @@ StartUpload=Start upload
CancelUpload=Cancel upload
FileIsTooBig=Files is too big
PleaseBePatient=Please be patient...
+ResetPassword=Reset password
RequestToResetPasswordReceived=A request to change your Dolibarr password has been received
NewKeyIs=This is your new keys to login
NewKeyWillBe=Your new key to login to software will be
@@ -223,6 +224,7 @@ ForgetIfNothing=If you didn't request this change, just forget this email. Your
IfAmountHigherThan=If amount higher than %s
SourcesRepository=Repository for sources
Chart=Chart
+PassEncoding=Password encoding
##### Export #####
ExportsArea=Exports area
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index 567d152b281..4f656cfaac5 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -54,4 +54,5 @@ ExportSite=Export site
IDOfPage=Id of page
WebsiteAccount=Web site account
WebsiteAccounts=Web site accounts
-AddWebsiteAccount=Create web site account
\ No newline at end of file
+AddWebsiteAccount=Create web site account
+BackToListOfThirdParty=Back to list for Third Party
\ No newline at end of file
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index ab6a36b4d40..5716f88b4b1 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -488,12 +488,10 @@ while ($i < min($num, $limit))
if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked']))
{
- print '| ';
- if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser');
- elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
- elseif ($key == 'ref') print $object->getNomUrl(1, '', 0, '', 1);
- elseif ($key == 'status') print $object->getLibStatut(3);
- else print $obj->$key;
+ print ' | ';
+ print $object->showOutputField($val, $key, $obj->$key, '');
print ' | ';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
@@ -510,12 +508,12 @@ while ($i < min($num, $limit))
{
if (! empty($arrayfields["ef.".$key]['checked']))
{
- print 'getAlignFlag($key);
+ print ' | ';
$tmpkey='options_'.$key;
- print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
+ print $extrafields->showOutputField($key, $obj->$tmpkey, '');
print ' | ';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 305b6677482..5b203c71693 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -428,7 +428,7 @@ class Societe extends CommonObject
* @param User $user Object of user that ask creation
* @return int >= 0 if OK, < 0 if KO
*/
- function create($user)
+ function create(User $user)
{
global $langs,$conf,$mysoc;
@@ -725,7 +725,7 @@ class Societe extends CommonObject
/**
* Update parameters of third party
*
- * @param int $id id societe
+ * @param int $id Id of company (deprecated, use 0 here and call update on an object loaded by a fetch)
* @param User $user Utilisateur qui demande la mise a jour
* @param int $call_trigger 0=non, 1=oui
* @param int $allowmodcodeclient Inclut modif code client et code compta
@@ -739,6 +739,8 @@ class Societe extends CommonObject
global $langs,$conf,$hookmanager;
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+ if (empty($id)) $id = $this->id;
+
$error=0;
dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur);
@@ -766,7 +768,7 @@ class Societe extends CommonObject
$this->skype = trim($this->skype);
$this->url = $this->url?clean_url($this->url,0):'';
$this->note_private = trim($this->note_private);
- $this->note_public = trim($this->note_public);
+ $this->note_public = trim($this->note_public);
$this->idprof1 = trim($this->idprof1);
$this->idprof2 = trim($this->idprof2);
$this->idprof3 = trim($this->idprof3);
@@ -882,7 +884,7 @@ class Societe extends CommonObject
$sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null");
$sql .= ",note_private = ".(! empty($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null");
- $sql .= ",note_public = ".(! empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
+ $sql .= ",note_public = ".(! empty($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null");
$sql .= ",siren = '". $this->db->escape($this->idprof1) ."'";
$sql .= ",siret = '". $this->db->escape($this->idprof2) ."'";
@@ -1461,11 +1463,11 @@ class Societe extends CommonObject
// Fill $toute_categs array with an array of (type => array of ("Categorie" instance))
if ($this->client || $this->prospect)
{
- $toute_categs['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER);
+ $toute_categs['customer'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER);
}
if ($this->fournisseur)
{
- $toute_categs['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER);
+ $toute_categs['supplier'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER);
}
// Remove each "Categorie"
@@ -2085,7 +2087,7 @@ class Societe extends CommonObject
if ($this->email && $addthirdparty)
{
if (empty($this->name)) $this->name=$this->nom;
- $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">";
+ $contact_emails['thirdparty']=$langs->transnoentitiesnoconv("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">";
}
//var_dump($contact_emails)
return $contact_emails;
@@ -2106,7 +2108,7 @@ class Societe extends CommonObject
{
if (empty($this->name)) $this->name=$this->nom;
// TODO: Tester si tel non deja present dans tableau contact
- $contact_phone['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->phone.">";
+ $contact_phone['thirdparty']=$langs->transnoentitiesnoconv("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->phone.">";
}
return $contact_phone;
}
@@ -2116,7 +2118,7 @@ class Societe extends CommonObject
*
* @param string $mode 'email' or 'mobile'
* @param int $hidedisabled 1=Hide contact if disabled
- * @return array Array of contacts emails or mobile array(id=>'Name ')
+ * @return array Array of contacts emails or mobile. Example: array(id=>'Name ')
*/
function contact_property_array($mode='email', $hidedisabled=0)
{
@@ -2138,7 +2140,8 @@ class Societe extends CommonObject
$sepa="("; $sepb=")";
if ($mode == 'email')
{
- $sepa="<"; $sepb=">";
+ //$sepa="<"; $sepb=">";
+ $sepa="<"; $sepb=">";
}
$i = 0;
while ($i < $nump)
@@ -2153,8 +2156,8 @@ class Societe extends CommonObject
{
if (empty($property))
{
- if ($mode == 'email') $property=$langs->trans("NoEMail");
- else if ($mode == 'mobile') $property=$langs->trans("NoMobilePhone");
+ if ($mode == 'email') $property=$langs->transnoentitiesnoconv("NoEMail");
+ else if ($mode == 'mobile') $property=$langs->transnoentitiesnoconv("NoMobilePhone");
}
if (!empty($obj->poste))
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 2b6349e36ae..c268f56922c 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -255,7 +255,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $objectwebsiteaccount); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql=preg_replace('/, $/','', $sql);
-$sql.= " FROM ".MAIN_DB_PREFIX."websiteaccount as t";
+$sql.= " FROM ".MAIN_DB_PREFIX."website_account as t";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."websiteaccount_extrafields as ef on (t.rowid = ef.fk_object)";
if ($objectwebsiteaccount->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('websiteaccount').")";
else $sql.=" WHERE 1 = 1";
@@ -488,12 +488,11 @@ while ($i < min($num, $limit))
if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked']))
{
- print '';
- if (in_array($val['type'], array('date'))) print dol_print_date($db->jdate($obj->$key), 'day', 'tzuser');
- elseif (in_array($val['type'], array('datetime','timestamp'))) print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
- elseif ($key == 'ref' || $key == 'login') print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1);
- elseif ($key == 'status') print $objectwebsiteaccount->getLibStatut(3);
- else print $obj->$key;
+ print ' | ';
+ if ($key == 'login') print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1);
+ else print $objectwebsiteaccount->showOutputField($val, $key, $obj->$key, '');
print ' | ';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
@@ -510,12 +509,12 @@ while ($i < min($num, $limit))
{
if (! empty($arrayfields["ef.".$key]['checked']))
{
- print 'getAlignFlag($key);
+ print ' | ';
$tmpkey='options_'.$key;
- print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
+ print $extrafields->showOutputField($key, $obj->$tmpkey, '');
print ' | ';
if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure']))
diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php
index e99fc3fe31e..c63aee5b9b2 100644
--- a/htdocs/website/class/website.class.php
+++ b/htdocs/website/class/website.class.php
@@ -44,7 +44,11 @@ class Website extends CommonObject
*/
public $table_element = 'website';
/**
- * @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
+ * @var array Does websiteaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ */
+ public $ismultientitymanaged = 1;
+ /**
+ * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'globe';
diff --git a/htdocs/website/class/websiteaccount.class.php b/htdocs/website/class/websiteaccount.class.php
index f420c8abcf8..275b2491e49 100644
--- a/htdocs/website/class/websiteaccount.class.php
+++ b/htdocs/website/class/websiteaccount.class.php
@@ -42,7 +42,7 @@ class WebsiteAccount extends CommonObject
/**
* @var string Name of table without prefix where object is stored
*/
- public $table_element = 'websiteaccount';
+ public $table_element = 'website_account';
/**
* @var array Does websiteaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
@@ -77,14 +77,15 @@ class WebsiteAccount extends CommonObject
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Login',),
- 'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
- 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>30, 'notnull'=>-1,),
+ 'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>-2, 'enabled'=>1, 'position'=>30),
+ 'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1),
+ 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1),
'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>41, 'notnull'=>1, 'index'=>1),
'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,),
'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,),
//'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,),
- //'note_private' => array('type'=>'text', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>46, 'notnull'=>-1,),
+ 'note_private' => array('type'=>'text', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>46, 'notnull'=>-1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
@@ -94,9 +95,11 @@ class WebsiteAccount extends CommonObject
);
public $rowid;
public $login;
+ public $pass_encoding;
public $pass_crypted;
public $date_last_login;
public $date_previous_login;
+ public $note_private;
public $date_creation;
public $tms;
public $fk_user_creat;
@@ -114,11 +117,11 @@ class WebsiteAccount extends CommonObject
/**
* @var int Name of subtable line
*/
- //public $table_element_line = 'websiteaccountdet';
+ //public $table_element_line = 'website_accountdet';
/**
* @var int Field with ID of parent key if this field has a parent
*/
- //public $fk_element = 'fk_websiteaccount';
+ //public $fk_element = 'fk_website_account';
/**
* @var int Name of subtable class that manage subtable lines
*/
@@ -126,7 +129,7 @@ class WebsiteAccount extends CommonObject
/**
* @var array Array of child tables (child tables to delete before deleting a record)
*/
- //protected $childtables=array('websiteaccountdet');
+ //protected $childtables=array('website_accountdet');
/**
* @var WebsiteAccountLine[] Array of subtable lines
*/
@@ -316,12 +319,11 @@ class WebsiteAccount extends CommonObject
$linkstart.=$linkclose.'>';
$linkend='';
- if ($withpicto)
- {
- $result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
- if ($withpicto != 2) $result.=' ';
- }
- $result.= $linkstart . $this->ref . $linkend;
+ $result .= $linkstart;
+ if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
+ if ($withpicto != 2) $result.= $this->ref;
+ $result .= $linkend;
+
return $result;
}
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index 34a6f047874..15ffc7bed69 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -44,7 +44,7 @@ class WebsitePage extends CommonObject
*/
public $table_element = 'website_page';
/**
- * @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
+ * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'label';
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 2ecd13dbb71..1065a811047 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -1152,7 +1152,7 @@ if (count($object->records) > 0)
print '';
print '';
- print $langs->trans("Website").': ';
+ print $langs->trans("WebSite").': ';
print ' ';
// List of website
@@ -1306,10 +1306,10 @@ if (count($object->records) > 0)
if ($action == 'createfromclone') {
// Create an array for form
$formquestion = array(
- array('type' => 'text', 'name' => 'siteref', 'label'=> $langs->trans("Website") ,'value'=> 'copy_of_'.$object->ref),
+ array('type' => 'text', 'name' => 'siteref', 'label'=> $langs->trans("WebSite") ,'value'=> 'copy_of_'.$object->ref),
//array('type' => 'checkbox', 'name' => 'is_a_translation', 'label' => $langs->trans("SiteIsANewTranslation"), 'value' => 0),
//array('type' => 'other','name' => 'newlang','label' => $langs->trans("Language"), 'value' => $formadmin->select_language(GETPOST('newlang', 'az09')?GETPOST('newlang', 'az09'):$langs->defaultlang, 'newlang', 0, null, '', 0, 0, 'minwidth200')),
- //array('type' => 'other','name' => 'newwebsite','label' => $langs->trans("Website"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 0))
+ //array('type' => 'other','name' => 'newwebsite','label' => $langs->trans("WebSite"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 0))
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id='.$object->id, $langs->trans('CloneSite'), '', 'confirm_createfromclone', $formquestion, 0, 1, 200);
@@ -1326,7 +1326,7 @@ if (count($object->records) > 0)
array('type' => 'text', 'name' => 'pageurl', 'label'=> $langs->trans("WEBSITE_PAGENAME") ,'value'=> 'copy_of_'.$objectpage->pageurl),
array('type' => 'checkbox', 'name' => 'is_a_translation', 'label' => $langs->trans("PageIsANewTranslation"), 'value' => 0),
array('type' => 'other','name' => 'newlang','label' => $langs->trans("Language"), 'value' => $formadmin->select_language(GETPOST('newlang', 'az09')?GETPOST('newlang', 'az09'):$langs->defaultlang, 'newlang', 0, null, 1, 0, 0, 'minwidth200')),
- array('type' => 'other','name' => 'newwebsite','label' => $langs->trans("Website"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 0)),
+ array('type' => 'other','name' => 'newwebsite','label' => $langs->trans("WebSite"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 0)),
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?website='.$object->ref.'&pageid=' . $pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550);
diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php
index b294b25f3b2..95ae071d971 100644
--- a/htdocs/website/lib/websiteaccount.lib.php
+++ b/htdocs/website/lib/websiteaccount.lib.php
@@ -41,7 +41,7 @@ function websiteaccountPrepareHead($object)
$head[$h][2] = 'card';
$h++;
- if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
+ /*if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
{
$nbNote = 0;
if(!empty($object->fields['note_private'])) $nbNote++;
@@ -51,7 +51,7 @@ function websiteaccountPrepareHead($object)
if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
$head[$h][2] = 'note';
$h++;
- }
+ }*/
/*
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index a94e82597a0..9918b0b3022 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -219,6 +219,8 @@ if (($id || $ref) && $action == 'edit')
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
{
+ if ($object->fk_soc >0 && empty($socid)) $socid = $object->fk_soc;
+
$res = $object->fetch_optionals($object->id, $extralabels);
$head = websiteaccountPrepareHead($object);
@@ -259,7 +261,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
$linkback='';
- if ($socid) $linkback = '' . $langs->trans("BackToList") . '';
+ if ($socid) $linkback = '' . $langs->trans("BackToListOfThirdParty") . '';
if ($fk_website) $linkback = '' . $langs->trans("BackToList") . '';
$morehtmlref='';
@@ -306,8 +308,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
*/
$morehtmlref.=' ';
+ if ($socid > 0) $object->next_prev_filter = 'te.fk_soc = '.$socid;
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
print '';
|