'."\n";
-
- // Common attributes
- //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
- //unset($object->fields['fk_project']); // Hide field already shown in banner
- //unset($object->fields['fk_member']); // Hide field already shown in banner
- include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
-
- // End of subscription date
- $fadherent = new Adherent($db);
- $fadherent->fetch($object->fk_member);
- print '
'.$langs->trans("SubscriptionEndDate").'
';
- if ($fadherent->datefin) {
- print dol_print_date($fadherent->datefin, 'day');
- if ($fadherent->hasDelay()) {
- print " ".img_warning($langs->trans("Late"));
- }
- } else {
- if (!$adht->subscription) {
- print $langs->trans("SubscriptionNotRecorded");
- if ($fadherent->statut > 0) {
- print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
- }
- } else {
- print $langs->trans("SubscriptionNotReceived");
- if ($fadherent->statut > 0) {
- print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
- }
- }
- }
- print '
';
-
- // Other attributes. Fields from hook formObjectOptions and Extrafields.
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
-
- print '
'."\n";
}
+
+
+ //$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php';
+ $morehtmlright = '';
+
+ print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, '');
+
+ $memberid = $object->id;
+
+
+ // TODO Replace this card with the list of all partnerships.
+
+ $object = new Partnership($db);
+ $partnershipid = $object->fetch(0, "", $memberid);
+
+ if ($partnershipid > 0) {
+ print '
';
+ print '
';
+ print '';
+ print '
'."\n";
+
+ // Common attributes
+ //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
+ //unset($object->fields['fk_project']); // Hide field already shown in banner
+ //unset($object->fields['fk_member']); // Hide field already shown in banner
+ include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
+
+ // End of subscription date
+ $fadherent = new Adherent($db);
+ $fadherent->fetch($object->fk_member);
+ print '
'.$langs->trans("SubscriptionEndDate").'
';
+ if ($fadherent->datefin) {
+ print dol_print_date($fadherent->datefin, 'day');
+ if ($fadherent->hasDelay()) {
+ print " ".img_warning($langs->trans("Late"));
+ }
+ } else {
+ if (!$adht->subscription) {
+ print $langs->trans("SubscriptionNotRecorded");
+ if ($fadherent->statut > 0) {
+ print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
+ }
+ } else {
+ print $langs->trans("SubscriptionNotReceived");
+ if ($fadherent->statut > 0) {
+ print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
+ }
+ }
+ }
+ print '
';
+
+ print '
';
+ print '
';
+ }
}
// End of page
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index d03574d473b..b8bf1a5998a 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin'));
// Put here declaration of dictionaries properties
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
-$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 25, 0, 43, 0);
+$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 43, 0, 25, 0);
// Name of SQL tables of dictionaries
$tabname = array();
@@ -608,7 +608,7 @@ $tabcomplete = array(
'c_prospectcontactlevel'=>array('picto'=>'company'),
'c_stcommcontact'=>array('picto'=>'company'),
'c_product_nature'=>array('picto'=>'product'),
- 'c_productbatch_qcstatus'=>array('picto'=>'batch'),
+ 'c_productbatch_qcstatus'=>array('picto'=>'lot'),
);
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index 9fe0543c4cf..220c724ad89 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -96,7 +96,7 @@ class BOM extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
- 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
+ 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'),
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 0944918f815..1dd6712dba6 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6840,9 +6840,12 @@ class Form
$obj = $this->db->fetch_object($resql);
$label = '';
$tmparray = explode(',', $fieldstoshow);
+ $oldvalueforshowoncombobox = 0;
foreach ($tmparray as $key => $val) {
$val = preg_replace('/t\./', '', $val);
- $label .= (($label && $obj->$val) ? ' - ' : '').$obj->$val;
+ $label .= (($label && $obj->$val) ? ($oldvalueforshowoncombobox != $objecttmp->fields[$val]['showoncombobox'] ? ' - ' : ' ') : '');
+ $label .= $obj->$val;
+ $oldvalueforshowoncombobox = $objecttmp->fields[$val]['showoncombobox'];
}
if (empty($outputmode)) {
if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) {
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 99bcd2c3921..61332d8041b 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -963,9 +963,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
$contactstatic->fields = array(
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
- 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20),
- 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30),
- 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40),
+ 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20),
+ 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30),
+ 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40),
'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))),
);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 61a3869fe1a..b018b4d2fb0 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -9671,7 +9671,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
/**
* Function dolGetButtonAction
*
- * @param string $label label of button no html : use in alt attribute for accessibility $html is not empty
+ * @param string $label label of button without HTML : use in alt attribute for accessibility $html is not empty
* @param string $html optional : content with html
* @param string $actionType default, delete, danger
* @param string $url the url for link
@@ -9689,8 +9689,9 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
}
$attr = array(
- 'class' => $class
- ,'href' => empty($url) ? '' : $url
+ 'class' => $class,
+ 'href' => empty($url) ? '' : $url,
+ 'title' => $label
);
if (empty($html)) {
diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php
index 484f34c265c..fc274e0d624 100644
--- a/htdocs/core/lib/member.lib.php
+++ b/htdocs/core/lib/member.lib.php
@@ -63,6 +63,33 @@ function member_prepare_head(Adherent $object)
$h++;
}
+ $tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty';
+
+ if ($tabtoadd == 'member') {
+ if (!empty($user->rights->partnership->read)) {
+ $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
+ $head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id;
+ $head[$h][1] = $langs->trans("Partnership");
+ $head[$h][2] = 'partnership';
+ if ($nbPartnership > 0) {
+ $head[$h][1] .= ''.$nbPartnership.'';
+ }
+ $h++;
+ }
+ } else {
+ if (!empty($user->rights->partnership->read)) {
+ $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
+ $head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id;
+ $head[$h][1] = $langs->trans("Partnership");
+ $head[$h][2] = 'partnership';
+ if ($nbPartnership > 0) {
+ $head[$h][1] .= ''.$nbPartnership.'';
+ }
+ $h++;
+ }
+ }
+
+
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@@ -70,9 +97,6 @@ function member_prepare_head(Adherent $object)
complete_head_from_modules($conf, $langs, $object, $head, $h, 'member');
$nbNote = 0;
- if (!empty($object->note)) {
- $nbNote++;
- }
if (!empty($object->note_private)) {
$nbNote++;
}
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index d1c793c621c..880c63970f7 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1325,32 +1325,32 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
- // ($textwasmodified is replaced with $textwasmodifiedorcompleted and we add completion).
+ // ($textwasnotmodified is replaced with $textwasmodifiedorcompleted and we add completion).
// Set label
// If we want another language, and if label is same than default language (we did force it to a specific value), we can use translation.
//var_dump($outputlangs->defaultlang.' - '.$langs->defaultlang.' - '.$label.' - '.$prodser->label);exit;
- $textwasmodified = ($label == $prodser->label);
- if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) {
+ $textwasnotmodified = ($label == $prodser->label);
+ if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasnotmodified || $translatealsoifmodified)) {
$label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
}
// Set desc
// Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no
- $textwasmodified = false;
+ $textwasnotmodified = false;
if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
- $textwasmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false);
+ $textwasnotmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false);
} else {
- $textwasmodified = ($desc == $prodser->description);
+ $textwasnotmodified = ($desc == $prodser->description);
}
- if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasmodified || $translatealsoifmodified)) {
+ if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasnotmodified || $translatealsoifmodified)) {
$desc = $prodser->multilangs[$outputlangs->defaultlang]["description"];
}
// Set note
- $textwasmodified = ($note == $prodser->note);
- if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) {
- $note = $prodser->multilangs[$outputlangs->defaultlang]["note"];
+ $textwasnotmodified = ($note == $prodser->note_public);
+ if (!empty($prodser->multilangs[$outputlangs->defaultlang]["other"]) && ($textwasnotmodified || $translatealsoifmodified)) {
+ $note = $prodser->multilangs[$outputlangs->defaultlang]["other"];
}
}
} elseif ($object->element == 'facture' || $object->element == 'facturefourn') {
diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php
index d12cd610238..d7041eca754 100644
--- a/htdocs/core/modules/modPartnership.class.php
+++ b/htdocs/core/modules/modPartnership.class.php
@@ -180,10 +180,8 @@ class modPartnership extends DolibarrModules
$tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty';
if ($tabtoadd == 'member') {
- $this->tabs[] = array('data'=>'member:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/adherents/partnership.php?rowid=__ID__');
$fk_mainmenu = "members";
} else {
- $this->tabs[] = array('data'=>'thirdparty:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/societe/partnership.php?socid=__ID__');
$fk_mainmenu = "companies";
}
@@ -214,30 +212,27 @@ class modPartnership extends DolibarrModules
// 'user' to add a tab in user view
// Dictionaries
- $this->dictionaries = array();
- /* Example:
$this->dictionaries=array(
'langs'=>'partnership@partnership',
// List of tables we want to see into dictonnary editor
- 'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"),
+ 'tabname'=>array(MAIN_DB_PREFIX."c_partnership_type"),
// Label of tables
- 'tablib'=>array("Table1", "Table2", "Table3"),
+ 'tablib'=>array("PartnershipType"),
// Request to select fields
- 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'),
+ 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'c_partnership_type as f WHERE f.entity = '.$conf->entity),
// Sort order
- 'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"),
+ 'tabsqlsort'=>array("label ASC"),
// List of fields (result of select to show dictionary)
- 'tabfield'=>array("code,label", "code,label", "code,label"),
+ 'tabfield'=>array("code,label"),
// List of fields (list of fields to edit a record)
- 'tabfieldvalue'=>array("code,label", "code,label", "code,label"),
+ 'tabfieldvalue'=>array("code,label"),
// List of fields (list of fields for insert)
- 'tabfieldinsert'=>array("code,label", "code,label", "code,label"),
+ 'tabfieldinsert'=>array("code,label"),
// Name of columns with primary key (try to always name it 'rowid')
- 'tabrowid'=>array("rowid", "rowid", "rowid"),
+ 'tabrowid'=>array("rowid"),
// Condition to show each dictionary
- 'tabcond'=>array($conf->partnership->enabled, $conf->partnership->enabled, $conf->partnership->enabled)
+ 'tabcond'=>array($conf->partnership->enabled)
);
- */
// Boxes/Widgets
// Add here list of php file(s) stored in partnership/core/boxes that contains a class to show a widget.
@@ -258,7 +253,7 @@ class modPartnership extends DolibarrModules
$this->cronjobs = array(
0 => array('priority'=>60, 'label'=>'CancelPartnershipForExpiredMembers', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doCancelStatusOfMemberPartnership', 'parameters'=>'', 'comment'=>'Cancel status of partnership when subscription is expired + x days.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>1, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart),
- 1 => array('priority'=>61, 'label'=>'CheckDolibarrBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart),
+ 1 => array('priority'=>61, 'label'=>'PartnershipCheckBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart),
);
// Permissions provided by this module
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 80371b14889..4d829258b2b 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -1,7 +1,7 @@
- * Copyright (C) 2013-2019 Laurent Destailleur
+ * Copyright (C) 2013-2021 Laurent Destailleur
* Copyright (C) 2019 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,6 @@
* \brief Lists Jobs
*/
-
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index bb8649106b9..ae35f3eb892 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -110,8 +110,8 @@ class ConferenceOrBooth extends ActionComm
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1::eventorganization', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,),
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1,),
- 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
- 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
+ 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',),
+ 'datep2' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'3',),
'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
'fk_user_author' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 1c1c1ab37be..e2ac86f55bd 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -57,7 +57,7 @@ class Fichinter extends CommonObject
'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
- 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>1),
+ 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2),
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110),
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120),
diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php
index c63ab29a14a..c2fa520442b 100644
--- a/htdocs/hrm/class/establishment.class.php
+++ b/htdocs/hrm/class/establishment.class.php
@@ -133,7 +133,7 @@ class Establishment extends CommonObject
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>20),
- 'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>22),
+ 'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>2, 'position'=>22),
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>35),
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index 3fb671fa9b2..741d92a88a1 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -173,7 +173,9 @@ CREATE TABLE llx_workstation_workstation_usergroup(
fk_workstation integer
) ENGINE=innodb;
-CREATE TABLE llx_c_producbatch_qcstatus(
+DROP TABLE llx_c_producbatch_qcstatus; -- delete table with bad name
+
+CREATE TABLE llx_c_productbatch_qcstatus(
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity integer NOT NULL DEFAULT 1,
code varchar(16) NOT NULL,
@@ -450,6 +452,8 @@ CREATE TABLE llx_partnership(
model_pdf varchar(255)
) ENGINE=innodb;
+ALTER TABLE llx_partnership ADD COLUMN last_check_backlink datetime NULL;
+
ALTER TABLE llx_partnership ADD INDEX idx_partnership_rowid (rowid);
ALTER TABLE llx_partnership ADD INDEX idx_partnership_ref (ref);
ALTER TABLE llx_partnership ADD INDEX idx_partnership_fk_soc (fk_soc);
@@ -530,3 +534,13 @@ INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUE
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51);
+create table llx_c_partnership_type
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ entity integer DEFAULT 1 NOT NULL,
+ code varchar(32) NOT NULL,
+ label varchar(64) NOT NULL,
+ active tinyint DEFAULT 1 NOT NULL
+)ENGINE=innodb;
+
+
diff --git a/htdocs/install/mysql/tables/llx_c_partnership_type.sql b/htdocs/install/mysql/tables/llx_c_partnership_type.sql
new file mode 100644
index 00000000000..23d5a89e16c
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_c_partnership_type.sql
@@ -0,0 +1,35 @@
+-- ========================================================================
+-- Copyright (C) 2021 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 .
+--
+-- Defini les types de contact d'un element sert de reference pour
+-- la table llx_element_contact
+--
+-- element est le nom de la table utilisant le type de contact.
+-- i.e. contact, facture, projet, societe (sans le llx_ devant).
+-- Libelle est un texte decrivant le type de contact.
+-- active precise si cette valeur est 'active' ou 'archive'.
+--
+-- ========================================================================
+
+create table llx_c_partnership_type
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ entity integer DEFAULT 1 NOT NULL,
+ code varchar(32) NOT NULL,
+ label varchar(64) NOT NULL,
+ active tinyint DEFAULT 1 NOT NULL
+)ENGINE=innodb;
+
diff --git a/htdocs/langs/en_US/partnership.lang b/htdocs/langs/en_US/partnership.lang
index df9619533de..3a653e29967 100644
--- a/htdocs/langs/en_US/partnership.lang
+++ b/htdocs/langs/en_US/partnership.lang
@@ -20,6 +20,10 @@ ModulePartnershipName=Partnership management
PartnershipDescription=Module Partnership management
PartnershipDescriptionLong= Module Partnership management
+AddPartnership=Add partnership
+CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions
+PartnershipCheckBacklink=Partnership: Check referring backlink
+
#
# Menu
#
@@ -32,10 +36,12 @@ ListOfPartnerships=List of partnership
PartnershipSetup=Partnership setup
PartnershipAbout=About Partnership
PartnershipAboutPage=Partnership about page
-partnershipforthirdpartyormember=Partnership is for a 'thirdparty' or for a 'member'
+partnershipforthirdpartyormember=Partner status must be set on a 'thirdparty' or a 'member'
PARTNERSHIP_IS_MANAGED_FOR=Partnership managed for
PARTNERSHIP_BACKLINKS_TO_CHECK=Backlinks to check
-PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancel status of partnership when subscription is expired
+PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb of days before cancelling status of a partnership when a subscription has expired
+ReferingWebsiteCheck=Check of website referring
+ReferingWebsiteCheckDesc=You can enable a feature to check that your partners has added a backlink to your website domains on their own website.
#
# Object
@@ -48,9 +54,10 @@ DatePartnershipEnd=End date
ReasonDecline=Decline reason
ReasonDeclineOrCancel=Decline reason
PartnershipAlreadyExist=Partnership already exist
-ShowPartnership=Show partnership
+ManagePartnership=Manage partnership
BacklinkNotFoundOnPartnerWebsite=Backlink not found on partner website
ConfirmClosePartnershipAsk=Are you sure you want to cancel this partnership?
+PartnershipType=Partnership type
#
# Template Mail
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index e69c5bc333d..76c6bb691f5 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -101,9 +101,9 @@ class MyObject extends CommonObject
*/
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'),
- 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
- 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20),
- 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>1),
+ 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>10),
+ 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'),
+ 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2),
'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'),
'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'),
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 1f9da9c80ae..7111b59b582 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -489,7 +489,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) {
// Send
if (empty($user->socid)) {
- print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle');
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle');
}
// Back to draft
@@ -502,11 +502,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Validate
if ($object->status == $object::STATUS_DRAFT) {
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
- print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd);
} else {
$langs->load("errors");
- //print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0);
- print ''.$langs->trans("Validate").'';
+ print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0);
}
}
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index d48d4959fd1..115844c916d 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -103,7 +103,7 @@ class Mo extends CommonObject
'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall'),
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'picto'=>'product'),
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1),
- 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',),
+ 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2',),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400'),
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400'),
diff --git a/htdocs/partnership/admin/partnership_extrafields.php b/htdocs/partnership/admin/partnership_extrafields.php
index 7d819b3bbcb..f178bc893cd 100644
--- a/htdocs/partnership/admin/partnership_extrafields.php
+++ b/htdocs/partnership/admin/partnership_extrafields.php
@@ -98,7 +98,7 @@ llxHeader('', $title, $help_url);
$linkback = ''.$langs->trans("BackToModuleList").'';
-print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'object_partnership');
+print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'title_setup');
$head = partnershipAdminPrepareHead();
diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php
index d681274106c..7fa0ef62b5e 100644
--- a/htdocs/partnership/admin/setup.php
+++ b/htdocs/partnership/admin/setup.php
@@ -139,22 +139,22 @@ print '';
print '';
print '';
+print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
'."\n";
-
- // Common attributes
- //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
- //unset($object->fields['fk_project']); // Hide field already shown in banner
- //unset($object->fields['fk_soc']); // Hide field already shown in banner
- include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
-
- // Other attributes. Fields from hook formObjectOptions and Extrafields.
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
-
- print '
'."\n";
}
+
+
+ //$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php';
+ $morehtmlright = '';
+
+ print load_fiche_titre($langs->trans("PartnershipDedicatedToThisThirdParty", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, '');
+
+ $socid = $object->id;
+
+
+ // TODO Replace this card with the list of all partnerships.
+
+ $object = new Partnership($db);
+ $partnershipid = $object->fetch(0, '', 0, $socid);
+
+ if ($partnershipid > 0) {
+ print '
';
+ print '
';
+ print '';
+ print '
'."\n";
+
+ // Common attributes
+ //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
+ //unset($object->fields['fk_project']); // Hide field already shown in banner
+ //unset($object->fields['fk_member']); // Hide field already shown in banner
+ include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
+
+ print '