';
print '';
}
diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php
new file mode 100644
index 00000000000..4c0f23a5af2
--- /dev/null
+++ b/htdocs/core/tpl/commonfields_view.tpl.php
@@ -0,0 +1,84 @@
+
+ *
+ * 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 .
+ *
+ * Need to have following variables defined:
+ * $object (invoice, order, ...)
+ * $action
+ * $conf
+ * $langs
+ */
+?>
+
+fields as $key => $val)
+{
+ if (abs($val['visible']) != 1) continue; // Discard such field from form
+ 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
+
+ $value=$object->$key;
+
+ print '
';
+
+ //if ($key == 'targetsrcfile3') break; // key used for break on second column
+}
+
+print '';
+print '';
+print '
';
+print '
';
+print '';
+print '
';
+
+$alreadyoutput = 1;
+foreach($object->fields as $key => $val)
+{
+ if ($alreadyoutput)
+ {
+ //if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
+ continue;
+ }
+
+ if (abs($val['visible']) != 1) continue; // Discard such field from form
+ 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
+
+ $value=$object->$key;
+
+ print '
';
+}
+
+?>
+
\ No newline at end of file
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index 973308b2e25..c4120552b80 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -111,7 +111,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][
print '';
print '';
- print $extrafields->showInputField($key, $value,'','','',0,$object->id);
+ print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id);
print '';
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index ccf52302e9a..4be167d3061 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -99,7 +99,6 @@ NbOfCompaniesContacts=Unique contacts/addresses
MailNoChangePossible=Recipients for validated emailing can't be changed
SearchAMailing=Search mailing
SendMailing=Send emailing
-SendMail=Send email
SentBy=Sent by
MailingNeedCommand=Sending an emailing can be performed from command line. Ask your server administrator to launch the following command to send the emailing to all recipients:
MailingNeedCommand2=You can however send them online by adding parameter MAILING_LIMIT_SENDBYWEB with value of max number of emails you want to send by session. For this, go on Home - Setup - Other.
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 09b9bb1793c..bb1bda2fba1 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -610,6 +610,7 @@ SendByMail=Send by EMail
MailSentBy=Email sent by
TextUsedInTheMessageBody=Email body
SendAcknowledgementByMail=Send confirmation email
+SendMail=Send email
EMail=E-mail
NoEMail=No email
Email=Email
diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang
index 5d1ec1a243d..a66e8b636cf 100644
--- a/htdocs/langs/en_US/modulebuilder.lang
+++ b/htdocs/langs/en_US/modulebuilder.lang
@@ -71,7 +71,7 @@ NoWidget=No widget
GoToApiExplorer=Go to API explorer
ListOfPermissionsDefined=List of defined permissions
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
-VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
+VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
IsAMeasureDesc=Can the value of field be cumulated to get a total into list ? (Examples: 1 or 0)
SearchAllDesc=Is the field used to make a search from the quick search tool ? (Examples: 1 or 0)
SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax.
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index 043fcb52472..eb1bab43905 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -51,5 +51,6 @@ OrEnterPageInfoManually=Or create empty page from scratch...
FetchAndCreate=Fetch and Create
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
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index efb467e37b7..d837e413c14 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -48,7 +48,7 @@ class MyObject extends CommonObject
*/
public $ismultientitymanaged = 0;
/**
- * @var string String with name of icon for myobject
+ * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'myobject@mymodule';
@@ -57,7 +57,7 @@ class MyObject extends CommonObject
* 'type' if the field format.
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
- * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
@@ -315,7 +315,7 @@ class MyObject extends CommonObject
if ($withpicto)
{
- $result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
+ $result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $linkstart . $this->ref . $linkend;
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 76c5fd7dc16..8f5583ceed3 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -320,52 +320,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
print '
'."\n";
- foreach($object->fields as $key => $val)
- {
- if (abs($val['visible']) != 1) continue; // Discard such field from form
- if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
-
- print '
';
diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php
index eebe072601b..8fb23d2b8a2 100644
--- a/htdocs/website/class/website.class.php
+++ b/htdocs/website/class/website.class.php
@@ -43,6 +43,10 @@ class Website extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'website';
+ /**
+ * @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
+ */
+ public $picto = 'globe';
/**
* @var int
@@ -648,21 +652,23 @@ class Website extends CommonObject
$result = '';
$companylink = '';
- $label = '' . $langs->trans("MyModule") . '';
+ $label = '' . $langs->trans("WebSite") . '';
$label.= '
';
- $label.= '' . $langs->trans('Ref') . ': ' . $this->ref;
+ $label.= '' . $langs->trans('Nom') . ': ' . $this->ref;
- $link = '';
+ $linkstart = '';
$linkend='';
+ $linkstart = $linkend = '';
+
if ($withpicto)
{
- $result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
+ $result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
- $result.= $link . $this->ref . $linkend;
+ $result.= $linkstart . $this->ref . $linkend;
return $result;
}
diff --git a/htdocs/website/class/websiteaccount.class.php b/htdocs/website/class/websiteaccount.class.php
index b96f511cac3..f420c8abcf8 100644
--- a/htdocs/website/class/websiteaccount.class.php
+++ b/htdocs/website/class/websiteaccount.class.php
@@ -43,23 +43,21 @@ class WebsiteAccount extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'websiteaccount';
-
/**
* @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 = 0;
-
/**
- * @var string String with name of icon for websiteaccount
+ * @var string String with name of icon for websiteaccount. Must be the part after the 'object_' into object_myobject.png
*/
- public $picto = 'object_globe';
+ public $picto = 'globe';
/**
* 'type' if the field format.
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed.
- * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
@@ -284,9 +282,12 @@ class WebsiteAccount extends CommonObject
$result = '';
$companylink = '';
+ $this->ref = $this->login;
+
$label = '' . $langs->trans("WebsiteAccount") . '';
$label.= ' ';
- $label.= '' . $langs->trans('Ref') . ': ' . $this->ref;
+ $label.= '' . $langs->trans('Login') . ': ' . $this->ref;
+ //$label.= '' . $langs->trans('WebSite') . ': ' . $this->ref;
$url = dol_buildpath('/website/websiteaccount_card.php',1).'?id='.$this->id;
@@ -317,7 +318,7 @@ class WebsiteAccount extends CommonObject
if ($withpicto)
{
- $result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
+ $result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
if ($withpicto != 2) $result.=' ';
}
$result.= $linkstart . $this->ref . $linkend;
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index 12f36f5daa7..34a6f047874 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -43,6 +43,10 @@ class WebsitePage extends CommonObject
* @var string Name of table without prefix where object is stored
*/
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
+ */
+ public $picto = 'label';
/**
*/
@@ -408,17 +412,19 @@ class WebsitePage extends CommonObject
$label.= '
';
$label.= '' . $langs->trans('Ref') . ': ' . $this->ref;
- $link = '';
+ $linkstart = '';
$linkend='';
+ $linkstart = $linkend = '';
+
if ($withpicto)
{
- $result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
- if ($withpicto != 2) $result.=' ';
+ $result.=($linkstart.img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?'':'class="classfortooltip"')).$linkend);
+ if ($withpicto != 2) $result.=' ';
}
- $result.= $link . $this->ref . $linkend;
+ $result.= $linkstart . $this->ref . $linkend;
return $result;
}
diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php
new file mode 100644
index 00000000000..b294b25f3b2
--- /dev/null
+++ b/htdocs/website/lib/websiteaccount.lib.php
@@ -0,0 +1,85 @@
+
+ *
+ * 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/website/lib/websiteaccount.lib.php
+ * \ingroup website
+ * \brief Library files with common functions for WebsiteAccount
+ */
+
+/**
+ * Prepare array of tabs for WebsiteAccount
+ *
+ * @param WebsiteAccount $object WebsiteAccount
+ * @return array Array of tabs
+ */
+function websiteaccountPrepareHead($object)
+{
+ global $db, $langs, $conf;
+
+ $langs->load("monmodule@monmodule");
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = dol_buildpath("/website/websiteaccount_card.php", 1).'?id='.$object->id;
+ $head[$h][1] = $langs->trans("Card");
+ $head[$h][2] = 'card';
+ $h++;
+
+ if (isset($object->fields['note_public']) || isset($object->fields['note_private']))
+ {
+ $nbNote = 0;
+ if(!empty($object->fields['note_private'])) $nbNote++;
+ if(!empty($object->fields['note_public'])) $nbNote++;
+ $head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id;
+ $head[$h][1] = $langs->trans('Notes');
+ if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.'';
+ $head[$h][2] = 'note';
+ $h++;
+ }
+
+ /*
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
+ $upload_dir = $conf->monmodule->dir_output . "/websiteaccount/" . dol_sanitizeFileName($object->ref);
+ $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
+ $nbLinks=Link::count($db, $object->element, $object->id);
+ $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id;
+ $head[$h][1] = $langs->trans('Documents');
+ if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).'';
+ $head[$h][2] = 'document';
+ $h++;
+
+ $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_agenda.php", 1).'?id='.$object->id;
+ $head[$h][1] = $langs->trans("Events");
+ $head[$h][2] = 'agenda';
+ $h++;
+ */
+
+ // Show more tabs from modules
+ // Entries must be declared in modules descriptor with line
+ //$this->tabs = array(
+ // 'entity:+tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
+ //); // to add new tab
+ //$this->tabs = array(
+ // 'entity:-tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__'
+ //); // to remove a tab
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website');
+
+ return $head;
+}
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index abdfd06e911..a94e82597a0 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -1,7 +1,6 @@
- * Copyright (C) ---Put here your own copyright and developer email---
- *
+*
* 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
@@ -53,8 +52,8 @@ if (! $res) die("Include of main fails");
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
-dol_include_once('/website/class/websiteaccount.class.php');
-//dol_include_once('/website/lib/websiteaccount.lib.php');
+include_once(DOL_DOCUMENT_ROOT.'/website/class/websiteaccount.class.php');
+include_once(DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php');
// Load traductions files requiredby by page
$langs->loadLangs(array("website","other"));
@@ -259,7 +258,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
- $linkback = '' . $langs->trans("BackToList") . '';
+ $linkback='';
+ if ($socid) $linkback = '' . $langs->trans("BackToList") . '';
+ if ($fk_website) $linkback = '' . $langs->trans("BackToList") . '';
$morehtmlref='
'."\n";
- foreach($object->fields as $key => $val)
- {
- if (abs($val['visible']) != 1) continue; // Discard such field from form
- if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
-
- print '