';
print '';
print '';
print '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/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index 251540b004e..62200405c60 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -267,7 +267,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
-
+
-
+
-
+
trans('SendNewPasswordDesc'); ?>
-
+
trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
index 635a4649902..4eac937a476 100644
--- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
+++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
@@ -50,19 +50,27 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
- if($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
- || $action === 'BILL_SENTBYMAIL' || $action === 'DOC_DOWNLOAD' || $action === 'DOC_PREVIEW') {
+
+ // Test if event/record is qualified
+ $listofqualifiedelement = array('payment', 'facture');
+ if (! in_array($object->element, $listofqualifiedelement)) return 1;
+
+
+ // Event/record is qualified
+ if ($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
+ || $action === 'BILL_SENTBYMAIL' || $action === 'DOC_DOWNLOAD' || $action === 'DOC_PREVIEW'
+ || $action === 'BILL_SUPPLIER_PAYED')
+ {
$amounts= (double) $object->total_ttc;
}
- else if($action === 'PAYMENT_CUSTOMER_CREATE' || $action === 'PAYMENT_ADD_TO_BANK') {
+ else if($action === 'PAYMENT_CUSTOMER_CREATE' || $action === 'PAYMENT_ADD_TO_BANK' || $action === 'PAYMENT_SUPPLIER_CREATE')
+ {
$amounts = 0;
if(!empty($object->amounts)) {
foreach($object->amounts as $amount) {
$amounts+= price2num($amount);
}
}
-
-
}
else if(strpos($action,'PAYMENT')!==false) {
$amounts= (double) $object->amount;
@@ -71,6 +79,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
return 0; // not implemented action log
}
+
$b=new BlockedLog($this->db);
$b->action = $action;
$b->amounts= $amounts;
@@ -78,17 +87,15 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
$res = $b->create($user);
- if($res<0) {
+ if ($res<0)
+ {
setEventMessage($b->error,'errors');
-
return -1;
}
- else {
-
+ else
+ {
return 1;
}
-
-
}
}
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 0a683fea355..6bd44d7f385 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -37,7 +37,7 @@ class Don extends CommonObject
public $element='don'; // Id that identify managed objects
public $table_element='don'; // Name of table without prefix where object is stored
public $fk_element = 'fk_donation';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $picto = 'generic';
var $date;
diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
index aadf3fdba22..3f19e1d666f 100644
--- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
+++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
@@ -26,8 +26,6 @@
theme."/img/working2.gif".'\';'."\n";
-
$openeddir='/';
?>
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 7e9213a2c9a..1e76d1afd08 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -214,8 +214,8 @@ if (empty($reshook))
$objectsrc->fetch($object->origin_id);
$object->socid = $objectsrc->socid;
- $object->ref_customer = ''; // We don't use $objectsrc->ref_client, this is ref or order not shipment
- $object->model_pdf = GETPOST('model','alpha');
+ $object->ref_customer = GETPOST('ref_customer','alpha');
+ $object->model_pdf = GETPOST('model');
$object->date_delivery = $date_delivery; // Date delivery planed
$object->fk_delivery_address = $objectsrc->fk_delivery_address;
$object->shipping_method_id = GETPOST('shipping_method_id','int');
@@ -693,7 +693,7 @@ if ($action == 'create')
else if ($origin == 'propal') print $langs->trans('RefCustomerOrder');
else print $langs->trans('RefCustomer');
print ' | ';
- print $object->ref_client;
+ print '';
print ' | ';
print ' ';
@@ -779,7 +779,7 @@ if ($action == 'create')
// Other attributes
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
- $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
+ $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 32e11c871e9..995805116b6 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -47,7 +47,7 @@ class Expedition extends CommonObject
public $fk_element="fk_expedition";
public $table_element="expedition";
public $table_element_line="expeditiondet";
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'sending';
var $socid;
diff --git a/htdocs/expensereport/ajax/ajaxik.php b/htdocs/expensereport/ajax/ajaxik.php
index e1856f438b0..04baab6d7a0 100644
--- a/htdocs/expensereport/ajax/ajaxik.php
+++ b/htdocs/expensereport/ajax/ajaxik.php
@@ -64,12 +64,12 @@ else
else
{
$range = ExpenseReportIk::getRangeByUser($userauthor, $fk_c_exp_tax_cat);
-
+
if (empty($range)) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'range' => $range));
else
{
- $offset = price($range->offset, 0, $langs, 1, -1, -1, $conf->currency);
- echo json_encode(array('up' => $range->coef, 'offset' => $range->offset, 'title' => $langs->transnoentitiesnoconv('ExpenseRangeOffset', $offset), 'comment' => 'offset should be apply on addline or updateline'));
+ $ikoffset = price($range->ikoffset, 0, $langs, 1, -1, -1, $conf->currency);
+ echo json_encode(array('up' => $range->coef, 'ikoffset' => $range->ikoffset, 'title' => $langs->transnoentitiesnoconv('ExpenseRangeOffset', $offset), 'comment' => 'offset should be apply on addline or updateline'));
}
}
}
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 63e4a3d351b..fef6f4b530d 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -1833,13 +1833,13 @@ class ExpenseReport extends CommonObject
return false;
}
- if (!empty($conf->global->MAIN_EXPENSE_APPLY_ENTIRE_OFFSET)) $offset = $range->offset;
- else $offset = $range->offset / 12; // The amount of offset is a global value for the year
+ if (!empty($conf->global->MAIN_EXPENSE_APPLY_ENTIRE_OFFSET)) $ikoffset = $range->ikoffset;
+ else $ikoffset = $range->ikoffset / 12; // The amount of offset is a global value for the year
- // Test if offset has been applied for the current month
+ // Test if ikoffset has been applied for the current month
if (!$this->offsetAlreadyGiven())
{
- $new_up = $range->coef + ($offset / $this->line->qty);
+ $new_up = $range->coef + ($ikoffset / $this->line->qty);
$tmp = calcul_price_total($this->line->qty, $new_up, 0, $this->line->vatrate, 0, 0, 0, 'TTC', 0, $type, $seller);
$this->line->value_unit = $tmp[5];
@@ -1854,7 +1854,7 @@ class ExpenseReport extends CommonObject
}
/**
- * If the sql find any rows then the offset is already given (offset is applied at the first expense report line)
+ * If the sql find any rows then the ikoffset is already given (ikoffset is applied at the first expense report line)
*
* @return bool
*/
diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php
index 41170ce2fd4..da5c68da91b 100644
--- a/htdocs/expensereport/class/expensereport_ik.class.php
+++ b/htdocs/expensereport/class/expensereport_ik.class.php
@@ -21,7 +21,7 @@
* \ingroup expenseik
* \brief File of class to manage expense ik
*/
-
+
require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php';
/**
@@ -32,30 +32,30 @@ class ExpenseReportIk extends CoreObject
public $element='expenseik';
public $table_element='expensereport_ik';
public $fk_element='fk_expense_ik';
-
+
/**
* c_exp_tax_cat Id
* @var int
*/
public $fk_c_exp_tax_cat;
-
+
/**
* c_exp_tax_range id
* @var int
*/
public $fk_range;
-
+
/**
* Coef
* @var double
*/
public $coef;
-
+
/**
* Offset
* @var double
*/
- public $offset;
+ public $ikoffset;
/**
* Attribute object linked with database
@@ -66,7 +66,7 @@ class ExpenseReportIk extends CoreObject
,'fk_c_exp_tax_cat'=>array('type'=>'integer','index'=>true)
,'fk_range'=>array('type'=>'integer','index'=>true)
,'coef'=>array('type'=>'double')
- ,'offset'=>array('type'=>'double')
+ ,'ikoffset'=>array('type'=>'double')
);
/**
@@ -74,35 +74,35 @@ class ExpenseReportIk extends CoreObject
*
* @param DoliDB $db Database handler
*/
- public function __construct(DoliDB &$db)
+ public function __construct(DoliDB &$db)
{
global $conf;
parent::__construct($db);
parent::init();
-
+
$this->errors = array();
}
-
+
/**
* Return expense categories in array
- *
+ *
* @param int $mode 1=only active; 2=only inactive; other value return all
* @return array of category
*/
public static function getTaxCategories($mode=1)
{
global $db;
-
+
$categories = array();
-
+
$sql = 'SELECT rowid, label, entity, active';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat';
$sql.= ' WHERE entity IN (0,'. getEntity('').')';
if ($mode == 1) $sql.= ' AND active = 1';
elseif ($mode == 2) $sql.= 'AND active = 0';
-
+
dol_syslog(get_called_class().'::getTaxCategories sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
@@ -116,23 +116,23 @@ class ExpenseReportIk extends CoreObject
{
dol_print_error($db);
}
-
+
return $categories;
}
-
+
public static function getRangeByUser(User $userauthor, $fk_c_exp_tax_cat)
{
$default_range = (int) $userauthor->default_range; // if not defined, then 0
$ranges = self::getRangesByCategory($fk_c_exp_tax_cat);
-
+
// substract 1 because array start from 0
if (empty($ranges) || !isset($ranges[$default_range-1])) return false;
else return $ranges[$default_range-1];
}
-
+
/**
* Return an array of ranges for a category
- *
+ *
* @param int $fk_c_exp_tax_cat category id
* @param int $active active
* @return array
@@ -140,15 +140,15 @@ class ExpenseReportIk extends CoreObject
public static function getRangesByCategory($fk_c_exp_tax_cat, $active=1)
{
global $db;
-
+
$ranges = array();
-
+
$sql = 'SELECT r.rowid FROM '.MAIN_DB_PREFIX.'c_exp_tax_range r';
if ($active) $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_exp_tax_cat c ON (r.fk_c_exp_tax_cat = c.rowid)';
$sql.= ' WHERE r.fk_c_exp_tax_cat = '.$fk_c_exp_tax_cat;
if ($active) $sql.= ' AND r.active = 1 AND c.active = 1';
$sql.= ' ORDER BY r.range_ik';
-
+
dol_syslog(get_called_class().'::getRangesByCategory sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
@@ -160,7 +160,7 @@ class ExpenseReportIk extends CoreObject
{
$object = new ExpenseReportIk($db);
$object->fetch($obj->rowid);
-
+
$ranges[] = $object;
}
}
@@ -169,28 +169,28 @@ class ExpenseReportIk extends CoreObject
{
dol_print_error($db);
}
-
+
return $ranges;
}
-
+
/**
* Return an array of ranges grouped by category
- *
+ *
* @return array
*/
public static function getAllRanges()
{
global $db;
-
+
$ranges = array();
-
+
$sql = ' SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, c.label, i.rowid as fk_expense_ik, r.active as range_active, c.active as cat_active';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_exp_tax_range r';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'c_exp_tax_cat c ON (r.fk_c_exp_tax_cat = c.rowid)';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'expensereport_ik i ON (r.rowid = i.fk_range)';
$sql.= ' WHERE r.entity IN (0, '. getEntity('').')';
$sql.= ' ORDER BY r.fk_c_exp_tax_cat, r.range_ik';
-
+
dol_syslog(get_called_class().'::getAllRanges sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
@@ -200,7 +200,7 @@ class ExpenseReportIk extends CoreObject
$ik = new ExpenseReportIk($db);
if ($obj->fk_expense_ik > 0) $ik->fetch($obj->fk_expense_ik);
$obj->ik = $ik;
-
+
if (!isset($ranges[$obj->fk_c_exp_tax_cat])) $ranges[$obj->fk_c_exp_tax_cat] = array('label' => $obj->label, 'active' => $obj->cat_active, 'ranges' => array());
$ranges[$obj->fk_c_exp_tax_cat]['ranges'][] = $obj;
}
@@ -209,20 +209,20 @@ class ExpenseReportIk extends CoreObject
{
dol_print_error($db);
}
-
+
return $ranges;
}
-
+
/**
* Return the max number of range by a category
- *
+ *
* @param int $default_c_exp_tax_cat id
* @return int
*/
public static function getMaxRangeNumber($default_c_exp_tax_cat=0)
{
global $db,$conf;
-
+
$sql = 'SELECT MAX(counted) as nbRange FROM (';
$sql.= ' SELECT COUNT(*) as counted';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_exp_tax_range r';
@@ -230,7 +230,7 @@ class ExpenseReportIk extends CoreObject
if ($default_c_exp_tax_cat > 0) $sql .= ' AND r.fk_c_exp_tax_cat = '.$default_c_exp_tax_cat;
$sql.= ' GROUP BY r.fk_c_exp_tax_cat';
$sql .= ') as counts';
-
+
dol_syslog(get_called_class().'::getMaxRangeNumber sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
@@ -242,7 +242,7 @@ class ExpenseReportIk extends CoreObject
{
dol_print_error($db);
}
-
+
return 0;
}
}
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 5ece6d204dc..e3e29e83335 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -43,7 +43,7 @@ class CommandeFournisseur extends CommonOrder
public $table_element='commande_fournisseur';
public $table_element_line = 'commande_fournisseurdet';
public $fk_element = 'fk_commande';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='order';
/**
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 8bc3b2102f0..c0439ecf3ff 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -44,7 +44,7 @@ class FactureFournisseur extends CommonInvoice
public $table_element='facture_fourn';
public $table_element_line='facture_fourn_det';
public $fk_element='fk_facture_fourn';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='bill';
/**
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 3c301a3de90..17fd0235388 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2111,7 +2111,7 @@ elseif (! empty($object->id))
//$result = $object->getLinesArray();
- print ' ';
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 6c14cd6dc77..d837e413c14 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -43,30 +43,31 @@ class MyObject extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'myobject';
-
/**
* @var array Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
- protected $ismultientitymanaged = 0;
+ 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';
/**
- * '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)
- * '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_...).
- * 'position' is the sort order of field.
- * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
- * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
- * 'help' is a string visible as a tooltip on field
- * 'comment' is not used. You can store here any text of your choice.
+ * '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 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_...).
+ * 'position' is the sort order of field.
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'help' is a string visible as a tooltip on field
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
+ * 'default' is a default value for creation (can still be replaced by the global setup of default values)
+ * 'showoncombobox' if field must be shown into the label of combobox
*/
// BEGIN MODULEBUILDER PROPERTIES
@@ -74,21 +75,22 @@ class MyObject extends CommonObject
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields=array(
- 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
- 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
+ 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
+ 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
- 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200'),
- 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Amount'),
- 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>45),
- 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>46),
+ 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text'),
+ 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'),
+ 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>'LinkToThirparty'),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
- 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
- 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
+ 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
+ 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>-1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
);
public $rowid;
@@ -313,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/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index c73fcfb3e8e..7acac2eb5fe 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -56,10 +56,10 @@ class modMyModule extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','interface','other'
// It is used to group modules by family in module setup page
$this->family = "other";
- // Module position in the family
- $this->module_position = 500;
+ // Module position in the family on 2 digits ('01', '10', '20', ...)
+ $this->module_position = '90';
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
- //$this->familyinfo = array('myownfamily' => array('position' => '001', 'label' => $langs->trans("MyOwnFamily")));
+ //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
// Module label (no space allowed), used if translation string 'ModuleMyModuleName' not found (MyModue is name of module).
$this->name = preg_replace('/^mod/i','',get_class($this));
@@ -95,7 +95,7 @@ class modMyModule extends DolibarrModules
'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
'css' => array('/mymodule/css/mymodule.css.php'), // Set this to relative path of css file if module has its own css file
'js' => array('/mymodule/js/mymodule.js.php'), // Set this to relative path of js file if module must load a js on all pages
- 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
+ 'hooks' => array('data'=>array('hookcontext1','hookcontext2'), 'entity'=>'0') // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
);
// Data directories to create when module is enabled.
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 283a7082435..8f5583ceed3 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -99,7 +99,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
/*
- * ACTIONS
+ * Actions
*
* Put here all code to do according to value of "action" parameter
*/
@@ -133,7 +133,7 @@ if (empty($reshook))
/*
- * VIEW
+ * View
*
* Put here all code to build page
*/
@@ -172,40 +172,9 @@ if ($action == 'create')
dol_fiche_head(array(), '');
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 '';
- print '| ';
- print $langs->trans($val['label']);
- print ' | ';
- print '';
- $defaultcss='minwidth100';
- if ($val['type'] == 'text')
- {
- print '';
- }
- elseif (is_array($val['arrayofkeyval']))
- {
- print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
- }
- else
- {
- $cssforinput = empty($val['css'])?$defaultcss:$val['css'];
- print '';
- }
- print ' | ';
- print ' ';
- }
+ // Common attributes
+ include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
@@ -217,7 +186,7 @@ if ($action == 'create')
print '';
print '';
print ' ';
- print ''; // Cancel for create doe not post form
+ print ''; // Cancel for create does not post form if we don't know the backtopage
print ' ';
print '';
@@ -236,37 +205,9 @@ if (($id || $ref) && $action == 'edit')
dol_fiche_head();
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 '| '.$langs->trans($val['label']).' | ';
- print '';
- $defaultcss='minwidth100';
- if ($val['type'] == 'text')
- {
- print '';
- }
- elseif (is_array($val['arrayofkeyval']))
- {
- print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key);
- }
- else
- {
- $cssforinput = empty($val['css'])?$defaultcss:$val['css'];
- print '';
- }
- print ' | ';
- print ' ';
- }
+ // Common attributes
+ include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
@@ -379,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 '| '.$langs->trans($val['label']).' | ';
- print '';
- print dol_escape_htmltag($object->$key, 1, 1);
- print ' | ';
- 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 (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
-
- print '| '.$langs->trans($val['label']).' | ';
- print '';
- print dol_escape_htmltag($object->$key, 1, 1);
- print ' | ';
- print ' ';
- }
+ // Common attributes
+ include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
@@ -449,7 +346,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook))
{
// Send
- print ''."\n";
+ print ''."\n";
if ($user->rights->mymodule->write)
{
@@ -488,15 +385,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print '';
print ' '; // ancre
+
// Documents
- $comref = dol_sanitizeFileName($object->ref);
+ /*$comref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->mymodule->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
-
+ */
// Show links to link elements
$linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject'));
diff --git a/htdocs/modulebuilder/template/sql/llx_myobject.key.sql b/htdocs/modulebuilder/template/sql/llx_myobject.key.sql
index 2b728128605..ef96d309224 100644
--- a/htdocs/modulebuilder/template/sql/llx_myobject.key.sql
+++ b/htdocs/modulebuilder/template/sql/llx_myobject.key.sql
@@ -15,8 +15,10 @@
-- BEGIN MODULEBUILDER INDEXES
-ALTER TABLE llx_myobject ADD UNIQUE INDEX idx_fieldobject (fieldobject);
+ALTER TABLE llx_myobject ADD INDEX idx_fieldobject (fieldobject);
-- END MODULEBUILDER INDEXES
+--ALTER TABLE llx_myobject ADD UNIQUE INDEX uk_myobject_fieldxyz(fieldx, fieldy);
+
--ALTER TABLE llx_myobject ADD CONSTRAINT llx_myobject_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid);
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index e3838d92415..ecdd2f4fc3e 100644
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -93,7 +93,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
global $conf;
$ref=str_replace(' ','',$ref);
-
+
if ($type == 'free')
{
$out=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount='.($mode?' ':'').$amount.($mode?'':'').'&tag='.($mode?' ':'').$freetag.($mode?'':'');
@@ -535,7 +535,7 @@ function hash_call($methodName,$nvpStr)
// TODO problem with triggers
$API_version="56";
- if (! empty($conf->global->PAYPAL_API_SANDBOX))
+ if (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha')) // We can force sand box with param 'forcesandbox'
{
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
diff --git a/htdocs/paypal/lib/paypalfunctions.lib.php b/htdocs/paypal/lib/paypalfunctions.lib.php
index 64f0b638c7c..92b24ec60fb 100644
--- a/htdocs/paypal/lib/paypalfunctions.lib.php
+++ b/htdocs/paypal/lib/paypalfunctions.lib.php
@@ -48,7 +48,7 @@ $API_version="56";
' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
-if (! empty($conf->global->PAYPAL_API_SANDBOX))
+if (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha')) // We can force sand box with param 'forcesandbox'
{
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 311c05858a3..c39b6902edf 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -47,7 +47,7 @@ class Product extends CommonObject
public $table_element='product';
public $fk_element='fk_product';
protected $childtables=array('supplier_proposaldet', 'propaldet','commandedet','facturedet','contratdet','facture_fourn_det','commande_fournisseurdet'); // To test if we can delete object
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index 63790b7789c..9b48c5164d4 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -47,7 +47,7 @@ class Inventory extends CommonObject
/**
* @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
- protected $ismultientitymanaged = 1;
+ public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for inventory
*/
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index c18935ec845..f45fa51e24c 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -299,19 +299,19 @@ else
else $sql.= " AND p.fk_product_type <> 1";
}
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
- if ($search_label) $sql .= natural_search('p.label', $search_label);
+ if ($search_label) $sql .= natural_search('p.label', $search_label);
if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode);
if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell!=-1) $sql.= " AND p.tosell = ".$db->escape($search_tosell);
if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy!=-1) $sql.= " AND p.tobuy = ".$db->escape($search_tobuy);
if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
- if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
- if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
+ if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
+ if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL";
- if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
+ if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch);
- if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell);
- if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy);
+ if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell);
+ if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy);
// Add where from extra fields
if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) {
@@ -495,15 +495,17 @@ else
$moreforfilter.=' ';
}
- if ($moreforfilter)
+ $parameters=array();
+ $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
+ if (empty($reshook)) $moreforfilter.=$hookmanager->resPrint;
+ else $moreforfilter=$hookmanager->resPrint;
+
+ if ($moreforfilter)
{
- print ' ';
- print $moreforfilter;
- $parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- print ' ';
- }
+ print ' ';
+ print $moreforfilter;
+ print ' ';
+ }
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 4ade2a31f41..3977cc5ed27 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -37,7 +37,7 @@ class Project extends CommonObject
public $table_element = 'projet'; //!< Name of table without prefix where object is stored
public $table_element_line = 'projet_task';
public $fk_element = 'fk_projet';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'projectpub';
/**
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index cc4d4e27e64..435ef5fc538 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -669,6 +669,7 @@ while ($i < min($num,$limit))
$object->datee = $db->jdate($obj->date_end);
$object->statut = $obj->fk_statut;
$object->opp_status = $obj->fk_opp_status;
+ $object->title = $obj->title;
$userAccess = $object->restrictedProjectArea($user); // why this ?
if ($userAccess >= 0)
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index e7e593fb831..3e86972db1d 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -296,9 +296,10 @@ if ($action == 'dopayment')
//if ($currency == 'USD') $PAYPAL_API_DEVISE="USD";
if (! empty($currency)) $PAYPAL_API_DEVISE=$currency;
+ // Show var initialized by include fo paypal lib at begin of this file
dol_syslog("Submit Paypal form", LOG_DEBUG);
dol_syslog("PAYPAL_API_USER: $PAYPAL_API_USER", LOG_DEBUG);
- //dol_syslog("PAYPAL_API_PASSWORD: $PAYPAL_API_PASSWORD", LOG_DEBUG); // No password into log files
+ dol_syslog("PAYPAL_API_PASSWORD: ".preg_replace('/./', '*', $PAYPAL_API_PASSWORD), LOG_DEBUG); // No password into log files
dol_syslog("PAYPAL_API_SIGNATURE: $PAYPAL_API_SIGNATURE", LOG_DEBUG);
dol_syslog("PAYPAL_API_SANDBOX: $PAYPAL_API_SANDBOX", LOG_DEBUG);
dol_syslog("PAYPAL_API_OK: $PAYPAL_API_OK", LOG_DEBUG);
@@ -515,11 +516,11 @@ if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_r
// Show sandbox warning
-if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_API_SANDBOX))
+if (! empty($conf->paypal->enabled) && (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))) // We can force sand box with param 'forcesandbox'
{
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Paypal'),'','warning');
}
-if (! empty($conf->stripe->enabled) && empty($conf->global->STRIPE_LIVE))
+if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
{
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode','Stripe'),'','warning');
}
@@ -534,6 +535,7 @@ print ' '."\n"
print ' '."\n";
print ' '."\n";
print ' ';
+print ' ';
print "\n";
print ''."\n";
print ''."\n";
@@ -1389,6 +1391,7 @@ if (preg_match('/^dopayment/',$action))
print ' ';
print ' '."\n";
print ' '."\n";
+ print ' ';
print '
diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php
index 310f553269b..e7a73a64895 100644
--- a/htdocs/public/paypal/newpayment.php
+++ b/htdocs/public/paypal/newpayment.php
@@ -282,7 +282,7 @@ if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', '
exit;
}
-if (! empty($conf->global->PAYPAL_API_SANDBOX))
+if (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox','alpha'))
{
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode'),'','warning');
}
@@ -296,6 +296,7 @@ print ''."\n"
print ''."\n";
print ''."\n";
print '';
+print '';
print "\n";
print ''."\n";
print ''."\n";
diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php
index f74e7bd0295..03198ec8be6 100644
--- a/htdocs/public/stripe/newpayment.php
+++ b/htdocs/public/stripe/newpayment.php
@@ -346,7 +346,7 @@ if (! empty($SOURCE) && in_array($ref, array('member_ref', 'contractline_ref', '
exit;
}
-if (empty($conf->global->STRIPE_LIVE))
+if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))
{
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode'),'','warning');
}
@@ -360,6 +360,7 @@ print ''."\n"
print ''."\n";
print ''."\n";
print '';
+print '';
print "\n";
print ''."\n";
print ''."\n";
@@ -1118,6 +1119,7 @@ if (preg_match('/^dopayment/',$action))
print '';
print ''."\n";
print ''."\n";
+ print '';
print '
diff --git a/htdocs/public/websites/index.php b/htdocs/public/website/index.php
similarity index 100%
rename from htdocs/public/websites/index.php
rename to htdocs/public/website/index.php
diff --git a/htdocs/public/websites/styles.css.php b/htdocs/public/website/styles.css.php
similarity index 100%
rename from htdocs/public/websites/styles.css.php
rename to htdocs/public/website/styles.css.php
diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php
index 93af8509e32..349e19b0c26 100644
--- a/htdocs/societe/ajax/company.php
+++ b/htdocs/societe/ajax/company.php
@@ -28,7 +28,6 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
-if (empty($_GET['keysearch']) && ! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
require '../../main.inc.php';
@@ -74,7 +73,6 @@ else
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$langs->load("companies");
- $langs->load("main");
top_httphead();
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 5e02cb99eaf..30040ce144b 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1995,9 +1995,12 @@ else
print '';
// Supplier
- print '| '.$langs->trans('Supplier').' | ';
- print yn($object->fournisseur);
- print ' | ';
+ if (! empty($conf->fournisseur->enabled))
+ {
+ print '| '.$langs->trans('Supplier').' | ';
+ print yn($object->fournisseur);
+ print ' | ';
+ }
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php
index dd743984044..1dc0eeb334b 100644
--- a/htdocs/societe/class/api_thirdparties.class.php
+++ b/htdocs/societe/class/api_thirdparties.class.php
@@ -83,6 +83,13 @@ class Thirdparties extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
+ $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))";
+ $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
+ $absolute_discount = $this->company->getAvailableDiscounts('', $filterabsolutediscount);
+ $absolute_creditnote = $this->company->getAvailableDiscounts('', $filtercreditnote);
+ $this->company->absolute_discount = price2num($absolute_discount, 'MT');
+ $this->company->absolute_creditnote = price2num($absolute_creditnote, 'MT');
+
return $this->_cleanObjectDatas($this->company);
}
@@ -331,6 +338,152 @@ class Thirdparties extends DolibarrApi
return $this->company;
}
+
+ /**
+ * Get fixed amount discount of a thirdparty (all sources: deposit, credit note, commercial offers...)
+ *
+ * @param int $id ID of the thirdparty
+ * @param string $filter Filter exceptional discount. "none" will return every discount, "available" returns unapplied discounts, "used" returns applied discounts {@choice none,available,used}
+ * @param string $sortfield Sort field
+ * @param string $sortorder Sort order
+ *
+ * @url GET {id}/fixedamountdiscounts
+ *
+ * @return array List of fixed discount of thirdparty
+ *
+ * @throws 400
+ * @throws 401
+ * @throws 404
+ * @throws 503
+ */
+ function getFixedAmountDiscounts($id, $filter="none", $sortfield = "f.type", $sortorder = 'ASC')
+ {
+ $obj_ret = array();
+
+ if(! DolibarrApiAccess::$user->rights->societe->lire) {
+ throw new RestException(401);
+ }
+
+ if(empty($id)) {
+ throw new RestException(400, 'Thirdparty ID is mandatory');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('societe',$id)) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+
+ $result = $this->company->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Thirdparty not found');
+ }
+
+
+ $sql = "SELECT f.facnumber, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line";
+ $sql .= " FROM llx_societe_remise_except as re, llx_facture as f";
+ $sql .= " WHERE f.rowid = re.fk_facture_source AND re.fk_soc = ".$id;
+ if ($filter == "available") $sql .= " AND re.fk_facture IS NULL AND re.fk_facture_line IS NULL";
+ if ($filter == "used") $sql .= " AND (re.fk_facture IS NOT NULL OR re.fk_facture_line IS NOT NULL)";
+
+ $sql.= $this->db->order($sortfield, $sortorder);
+
+ $result = $this->db->query($sql);
+ if( ! $result ) {
+ throw new RestException(503, $this->db->lasterror());
+ } else {
+ $num = $this->db->num_rows($result);
+ while ( $obj = $this->db->fetch_object($result) ) {
+ $obj_ret[] = $obj;
+ }
+ }
+
+ return $obj_ret;
+ }
+
+
+
+ /**
+ * Return list of invoices qualified to be replaced by another invoice.
+ *
+ * @param int $id Id of thirdparty
+ *
+ * @url GET {id}/getinvoicesqualifiedforreplacement
+ *
+ * @return array
+ * @throws 400
+ * @throws 401
+ * @throws 404
+ * @throws 405
+ */
+ function getInvoicesQualifiedForReplacement($id) {
+
+ if(! DolibarrApiAccess::$user->rights->facture->lire) {
+ throw new RestException(401);
+ }
+ if(empty($id)) {
+ throw new RestException(400, 'Thirdparty ID is mandatory');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('societe',$id)) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+
+ /*$result = $this->thirdparty->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Thirdparty not found');
+ }*/
+
+ $invoice = new Facture($this->db);
+ $result = $invoice->list_replacable_invoices($id);
+ if( $result < 0) {
+ throw new RestException(405, $this->thirdparty->error);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return list of invoices qualified to be corrected by a credit note.
+ * Invoices matching the following rules are returned
+ * (validated + payment on process) or classified (payed completely or payed partialy) + not already replaced + not already a credit note
+ *
+ * @param int $id Id of thirdparty
+ *
+ * @url GET {id}/getinvoicesqualifiedforcreditnote
+ *
+ * @return array
+ * @throws 400
+ * @throws 401
+ * @throws 404
+ * @throws 405
+ */
+ function getInvoicesQualifiedForCreditNote($id) {
+
+ if(! DolibarrApiAccess::$user->rights->facture->lire) {
+ throw new RestException(401);
+ }
+ if(empty($id)) {
+ throw new RestException(400, 'Thirdparty ID is mandatory');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('societe',$id)) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+
+ /*$result = $this->thirdparty->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Thirdparty not found');
+ }*/
+
+ $invoice = new Facture($this->db);
+ $result = $invoice->list_qualified_avoir_invoices($id);
+ if( $result < 0) {
+ throw new RestException(405, $this->thirdparty->error);
+ }
+
+ return $result;
+ }
+
+
/**
* Clean sensible object datas
*
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 65b1e19c537..48f023076b2 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -43,15 +43,37 @@ class Societe extends CommonObject
public $element='societe';
public $table_element = 'societe';
public $fk_element='fk_soc';
+ public $fieldsforcombobox='nom,name_alias';
protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object
protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm");
-
/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int
*/
- protected $ismultientitymanaged = 1;
+ public $ismultientitymanaged = 1;
+
+
+ // BEGIN MODULEBUILDER PROPERTIES
+ /**
+ * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ */
+ public $fields=array(
+ 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
+ 'nom' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
+ 'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
+ 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
+ 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
+ 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
+ //'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
+ 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
+ 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
+ //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
+ 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
+ );
+
public $entity;
@@ -368,6 +390,10 @@ class Societe extends CommonObject
var $fk_multicurrency;
var $multicurrency_code;
+
+ // END MODULEBUILDER PROPERTIES
+
+
/**
* To contains a clone of this when we need to save old properties of object
* @var Societe
@@ -3665,8 +3691,9 @@ class Societe extends CommonObject
* Adds it to non existing supplied categories.
* Existing categories are left untouch.
*
- * @param int[]|int $categories Category or categories IDs
- * @param string $type Category type (customer or supplier)
+ * @param int[]|int $categories Category ID or array of Categories IDs
+ * @param string $type Category type ('customer' or 'supplier')
+ * @return int <0 if KO, >0 if OK
*/
public function setCategories($categories, $type)
{
@@ -3681,7 +3708,7 @@ class Societe extends CommonObject
$type_text = 'supplier';
} else {
dol_syslog(__METHOD__ . ': Type ' . $type . 'is an unknown company category type. Done nothing.', LOG_ERR);
- return;
+ return -1;
}
// Handle single category
@@ -3714,7 +3741,7 @@ class Societe extends CommonObject
}
}
- return;
+ return 1;
}
diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php
index 697ae315fb3..5733ffa9568 100644
--- a/htdocs/societe/notify/card.php
+++ b/htdocs/societe/notify/card.php
@@ -180,7 +180,7 @@ if ($result > 0)
print '';
}
- if ($object->fournisseur)
+ if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire))
{
print '| ';
print $langs->trans('SupplierCode').' | ';
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 16bbc0554d2..7a17e05c827 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -39,7 +39,7 @@ $langs->loadLangs(array("companies","website"));
$search_status=GETPOST('search_status');
// Security check
-$id = GETPOST('id','int');
+$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe', $socid, '&societe');
@@ -91,6 +91,7 @@ foreach($objectwebsiteaccount->fields as $key => $val)
// If $val['visible']==0, then we never show the field
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']);
}
+
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@@ -230,7 +231,7 @@ dol_fiche_end();
$morehtmlcenter = '';
if (! empty($conf->website->enabled)) {
if (! empty($user->rights->societe->lire)) {
- $morehtmlcenter .= 'id).'">' . $langs->trans("AddWebsiteAccount") . '';
+ $morehtmlcenter .= 'id).'">' . $langs->trans("AddWebsiteAccount") . '';
} else {
$morehtmlcenter .= '' . $langs->trans("AddAction") . '';
}
@@ -258,6 +259,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."websiteaccount 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->getIsmultientitymanaged() == 1) $sql.= " WHERE t.entity IN (".getEntity('websiteaccount').")";
else $sql.=" WHERE 1 = 1";
+$sql.=" AND fk_soc = ".$object->id;
foreach($search as $key => $val)
{
$mode_search=(($objectwebsiteaccount->isInt($objectwebsiteaccount->fields[$key]) || $objectwebsiteaccount->isFloat($objectwebsiteaccount->fields[$key]))?1:0);
@@ -489,7 +491,7 @@ while ($i < min($num, $limit))
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 $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1);
+ elseif ($key == 'ref' || $key == 'login') print $objectwebsiteaccount->getNomUrl(1, '', 0, '', 1);
elseif ($key == 'status') print $objectwebsiteaccount->getLibStatut(3);
else print $obj->$key;
print ' | ';
diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php
index 9aaed7cf0b9..9f5f0e4de96 100644
--- a/htdocs/stripe/config.php
+++ b/htdocs/stripe/config.php
@@ -33,19 +33,19 @@ global $conf;
//use \includes\stripe as stripe;
$stripe = array();
-if (empty($conf->global->STRIPE_LIVE))
+if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))
{
$stripe = array(
"secret_key" => $conf->global->STRIPE_TEST_SECRET_KEY,
"publishable_key" => $conf->global->STRIPE_TEST_PUBLISHABLE_KEY
);
}
-else
+else
{
$stripe = array(
"secret_key" => $conf->global->STRIPE_LIVE_SECRET_KEY,
"publishable_key" => $conf->global->STRIPE_LIVE_PUBLISHABLE_KEY
- );
+ );
}
require_once DOL_DOCUMENT_ROOT."/includes/stripe/lib/Stripe.php";
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index a1d45d2d0c1..80b28dae333 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -48,7 +48,7 @@ class SupplierProposal extends CommonObject
public $table_element='supplier_proposal';
public $table_element_line='supplier_proposaldet';
public $fk_element='fk_supplier_proposal';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='propal';
/**
diff --git a/htdocs/theme/eldy/img/working2.gif b/htdocs/theme/eldy/img/working2.gif
deleted file mode 100644
index bf0fc8f2167..00000000000
Binary files a/htdocs/theme/eldy/img/working2.gif and /dev/null differ
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index d7cd32fb352..8d3f4bcf0b9 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -661,6 +661,10 @@ div.myavailability {
padding-top: 4px;
padding-bottom: 4px;
}
+.paddingtopbottom {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
.checkallactions {
/* vertical-align: text-bottom;
margin-top: 6px; */
@@ -1590,7 +1594,7 @@ $mainmenuusedarray=array_unique(explode(',',$mainmenuused));
$generic=1;
// Put here list of menu entries when the div.mainmenu.menuentry was previously defined
-$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','websites');
+$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','website');
// Put here list of menu entries we are sure we don't want
$divnotrequired=array('multicurrency','salaries','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition');
foreach($mainmenuusedarray as $val)
@@ -1749,6 +1753,9 @@ table.login_table_securitycode tr td {
max-height: 90px;
}
+div.backgroundsemitransparent {
+ background:rgba(255,255,255,0.6);
+}
div.login_block {
position: absolute;
text-align: ;
@@ -3287,8 +3294,10 @@ table.valid {
z-index: 3000;
}
+div.ui-tooltip {
+ max-width: px !important;
+}
.mytooltip {
- width: px;
border-top: solid 1px #BBBBBB;
border-: solid 1px #BBBBBB;
border-: solid 1px #444444;
@@ -4178,6 +4187,9 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
+.select2-container--default .select2-selection--single .select2-selection__rendered {
+ color: unset;
+}
.select2-default {
color: #999 !important;
/*opacity: 0.2;*/
@@ -4314,9 +4326,6 @@ a span.select2-chosen
.select2-results {
max-height: 400px;
}
-.css-searchselectcombo ul.select2-results {
- max-height: none;
-}
.select2-container.select2-container-disabled .select2-choice, .select2-container-multi.select2-container-disabled .select2-choices {
background-color: #FFFFFF;
background-image: none;
diff --git a/htdocs/theme/md/img/working2.gif b/htdocs/theme/md/img/working2.gif
deleted file mode 100644
index bf0fc8f2167..00000000000
Binary files a/htdocs/theme/md/img/working2.gif and /dev/null differ
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index ffc6cc1a2c6..4f95a35b009 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -667,6 +667,10 @@ div.myavailability {
padding-top: 4px;
padding-bottom: 4px;
}
+.paddingtopbottom {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
.checkallactions {
/*vertical-align: text-bottom;
margin-top: 6px;*/
@@ -1114,6 +1118,10 @@ div.login_block {
top: auto;
z-index: 90;
}
+
+div.backgroundsemitransparent {
+ background:rgba(255,255,255,0.6);
+}
div.login_block {
/* position: initial !important;*/
display: none;
@@ -1626,7 +1634,7 @@ $mainmenuusedarray=array_unique(explode(',',$mainmenuused));
$generic=1;
// Put here list of menu entries when the div.mainmenu.menuentry was previously defined
-$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','websites');
+$divalreadydefined=array('home','companies','products','commercial','externalsite','accountancy','project','tools','members','agenda','ftp','holiday','hrm','bookmark','cashdesk','ecm','geoipmaxmind','gravatar','clicktodial','paypal','stripe','webservices','website');
// Put here list of menu entries we are sure we don't want
$divnotrequired=array('multicurrency','salaries','margin','opensurvey','paybox','expensereport','incoterm','prelevement','propal','workflow','notification','supplier_proposal','cron','product','productbatch','expedition');
foreach($mainmenuusedarray as $val)
@@ -3381,6 +3389,10 @@ table.valid {
z-index: 3000;
}
+div.ui-tooltip {
+ max-width: px !important;
+}
+
.mytooltip {
width: px;
border-top: solid 1px #BBBBBB;
@@ -4198,6 +4210,9 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
+.select2-container--default .select2-selection--single .select2-selection__rendered {
+ color: unset;
+}
.select2-container .select2-choice {
border-bottom: 1px solid #ccc;
}
@@ -4331,9 +4346,6 @@ a span.select2-chosen
.select2-results {
max-height: 400px;
}
-.css-searchselectcombo ul.select2-results {
- max-height: none;
-}
.select2-container.select2-container-disabled .select2-choice, .select2-container-multi.select2-container-disabled .select2-choices {
background-color: #FFFFFF;
background-image: none;
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 3a7894c050b..c0cf82c3899 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -40,7 +40,7 @@ class User extends CommonObject
{
public $element='user';
public $table_element='user';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $id=0;
public $ldap_sid;
@@ -163,7 +163,8 @@ class User extends CommonObject
}
/**
- * Load a user from database with its id or ref (login)
+ * Load a user from database with its id or ref (login).
+ * This function does not load permissions, only user properties. Use getrights() for this just after the fetch.
*
* @param int $id If defined, id to used for search
* @param string $login If defined, login to used for search
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index d0a82972325..7c326097669 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -36,7 +36,7 @@ class UserGroup extends CommonObject
{
public $element='usergroup';
public $table_element='usergroup';
- protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+ public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='group';
public $entity; // Entity of group
diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php
index eebe072601b..e99fc3fe31e 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
@@ -135,7 +139,7 @@ class Website extends CommonObject
$sql.= 'date_creation,';
$sql.= 'tms';
$sql .= ') VALUES (';
- $sql .= ' '.(! isset($this->entity)?'NULL':$this->entity).',';
+ $sql .= ' '.((empty($this->entity) && $this->entity != '0')?'NULL':$this->entity).',';
$sql .= ' '.(! isset($this->ref)?'NULL':"'".$this->db->escape($this->ref)."'").',';
$sql .= ' '.(! isset($this->description)?'NULL':"'".$this->db->escape($this->description)."'").',';
$sql .= ' '.(! isset($this->status)?'NULL':$this->status).',';
@@ -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 8ef6cbb3a02..f420c8abcf8 100644
--- a/htdocs/website/class/websiteaccount.class.php
+++ b/htdocs/website/class/websiteaccount.class.php
@@ -43,31 +43,31 @@ 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
*/
- protected $ismultientitymanaged = 0;
-
+ 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)
- * '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_...).
- * 'position' is the sort order of field.
- * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
- * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
- * 'help' is a string visible as a tooltip on field
- * 'comment' is not used. You can store here any text of your choice.
+ * '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 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_...).
+ * 'position' is the sort order of field.
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'help' is a string visible as a tooltip on field
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
+ * 'default' is a default value for creation (can still be replaced by the global setup of default values)
+ * 'showoncombobox' if field must be shown into the label of combobox
*/
// BEGIN MODULEBUILDER PROPERTIES
@@ -77,8 +77,10 @@ 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, 'searchall'=>1,),
+ '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,),
+ '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,),
@@ -88,8 +90,7 @@ class WebsiteAccount extends CommonObject
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1,),
- 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')),
- 'fk_soc' => array('type'=>'integer', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1,),
+ 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')),
);
public $rowid;
public $login;
@@ -107,6 +108,7 @@ class WebsiteAccount extends CommonObject
+
// If this object has a subtable with lines
/**
@@ -280,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;
@@ -313,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/index.php b/htdocs/website/index.php
index 243781e0e04..2ecd13dbb71 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -923,6 +923,10 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
setEventMessages($objectpage->error, $objectpage->errors, 'errors');
$action='createpagefromclone';
}
+ else
+ {
+ // TODO Switch on the new page ?
+ }
}
}
@@ -1321,11 +1325,11 @@ if (count($object->records) > 0)
$formquestion = array(
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, '', 0, 0, 'minwidth200')),
- array('type' => 'other','name' => 'newwebsite','label' => $langs->trans("Website"), 'value' => $formwebsite->selectWebsite($object->id, 'newwebsite', 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)),
);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?pageid=' . $pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 250);
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?website='.$object->ref.'&pageid=' . $pageid, $langs->trans('ClonePage'), '', 'confirm_createpagefromclone', $formquestion, 0, 1, 300, 550);
print $formconfirm;
}
@@ -1738,7 +1742,7 @@ if ($action == 'editmeta' || $action == 'create')
print ' | ';
print $langs->trans('Language');
print ' | ';
- print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG');
+ print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG', 0, null, '1');
print ' | ';
print ' ';
@@ -1974,6 +1978,7 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= ''."\n";
$tplcontent.= $objectpage->content."\n";
$tplcontent.= ''."\n";
+ $tplcontent.= ''."\n";
$tplcontent.= '
+ *
+ * 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 4fff1e385e2..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"));
@@ -65,7 +64,6 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
-$thirdpartyid = GETPOST('thirdpartyid', 'int');
// Initialize technical objects
$object=new WebsiteAccount($db);
@@ -100,9 +98,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
/*
- * ACTIONS
- *
- * Put here all code to do according to value of "action" parameter
+ * Actions
*/
$parameters=array();
@@ -132,9 +128,7 @@ if (empty($reshook))
/*
- * VIEW
- *
- * Put here all code to build page
+ * View
*/
$form=new Form($db);
@@ -167,46 +161,13 @@ if ($action == 'create')
print '';
print '';
print '';
- print '';
- dol_fiche_head(array(), '');
+ dol_fiche_head();
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 '';
- print '| ';
- print $langs->trans($val['label']);
- print ' | ';
- print '';
- $defaultcss='minwidth100';
- if ($val['type'] == 'text')
- {
- print '';
- }
- elseif (is_array($val['arrayofkeyval']))
- {
- print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
- }
- else
- {
- $cssforinput = empty($val['css'])?$defaultcss:$val['css'];
- print '';
- }
- print ' | ';
- print ' ';
- }
+ // Common attributes
+ include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
@@ -218,7 +179,7 @@ if ($action == 'create')
print '';
print '';
print ' ';
- print ''; // Cancel for create doe not post form
+ print ''; // Cancel for create does not post form if we don't know the backtopage
print ' ';
print '';
@@ -237,37 +198,9 @@ if (($id || $ref) && $action == 'edit')
dol_fiche_head();
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 '| '.$langs->trans($val['label']).' | ';
- print '';
- $defaultcss='minwidth100';
- if ($val['type'] == 'text')
- {
- print '';
- }
- elseif (is_array($val['arrayofkeyval']))
- {
- print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key);
- }
- else
- {
- $cssforinput = empty($val['css'])?$defaultcss:$val['css'];
- print '';
- }
- print ' | ';
- print ' ';
- }
+ // Common attributes
+ include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
@@ -325,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='';
/*
@@ -380,52 +315,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 '| '.$langs->trans($val['label']).' | ';
- print '';
- print dol_escape_htmltag($object->$key, 1, 1);
- print ' | ';
- 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 (in_array($key, array('rowid', 'ref', 'entity', 'note_public', 'note_private', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key', 'status'))) continue;
-
- print '| '.$langs->trans($val['label']).' | ';
- print '';
- print dol_escape_htmltag($object->$key, 1, 1);
- print ' | ';
- print ' ';
- }
+ // Common attributes
+ include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
@@ -450,7 +341,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook))
{
// Send
- print ''."\n";
+ print ''."\n";
if ($user->rights->website->write)
{
@@ -489,29 +380,32 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
print '';
print ' '; // ancre
+
// Documents
- $comref = dol_sanitizeFileName($object->ref);
+ /*$comref = dol_sanitizeFileName($object->ref);
$relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->website->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->website->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->website->create; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('website', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
-
+ */
// Show links to link elements
- $linktoelem = $form->showLinkToObjectBlock($object, null, array('websiteaccount'));
+ /*$linktoelem = $form->showLinkToObjectBlock($object, null, array('websiteaccount'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
-
+ */
print ' ';
$MAXEVENT = 10;
// List of actions on element
+ /*
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'websiteaccount', $socid, 1, '', $MAXEVENT);
+ */
print ' ';
}
| |