2
0
forked from Wavyzz/dolibarr

Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/modules/DolibarrModules.class.php
	htdocs/core/modules/modAgenda.class.php
	htdocs/core/modules/modFacture.class.php
	htdocs/langs/en_US/admin.lang
	htdocs/langs/en_US/main.lang
	htdocs/stripe/transaction.php
This commit is contained in:
Laurent Destailleur
2018-09-16 09:50:13 +02:00
11 changed files with 54 additions and 12 deletions

View File

@@ -4911,6 +4911,9 @@ abstract class CommonObject
}
}
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
switch ($attributeType)
{
case 'int':
@@ -4924,6 +4927,21 @@ abstract class CommonObject
$new_array_options[$key] = null;
}
break;
case 'double':
$value = price2num($value);
if (!is_numeric($value) && $value!='')
{
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1;
}
elseif ($value=='')
{
$new_array_options[$key] = null;
}
//dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG);
$new_array_options[$key] = $value;
break;
/*case 'select': // Not required, we chosed value='0' for undefined values
if ($value=='-1')
{
@@ -5118,6 +5136,9 @@ abstract class CommonObject
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$key];
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$key];
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
switch ($attributeType)
{
case 'int':
@@ -5131,6 +5152,21 @@ abstract class CommonObject
$this->array_options["options_".$key] = null;
}
break;
case 'double':
$value = price2num($value);
if (!is_numeric($value) && $value!='')
{
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1;
}
elseif ($value=='')
{
$this->array_options["options_".$key] = null;
}
//dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG);
$this->array_options["options_".$key] = $value;
break;
/*case 'select': // Not required, we chosed value='0' for undefined values
if ($value=='-1')
{

View File

@@ -4829,6 +4829,10 @@ class Form
$tmpthirdparty=new Societe($this->db);
$defaulttx=get_default_tva($societe_vendeuse, (is_object($societe_acheteuse)?$societe_acheteuse:$tmpthirdparty), $idprod);
$defaultnpr=get_default_npr($societe_vendeuse, (is_object($societe_acheteuse)?$societe_acheteuse:$tmpthirdparty), $idprod);
if (preg_match('/\((.*)\)/', $defaulttx, $reg)) {
$defaultcode=$reg[1];
$defaulttx=preg_replace('/\s*\(.*\)/','',$defaulttx);
}
if (empty($defaulttx)) $defaultnpr=0;
}

View File

@@ -1718,7 +1718,7 @@ function email_admin_prepare_head()
}
$head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php";
$head[$h][1] = $langs->trans("DictionaryEMailTemplates");
$head[$h][1] = $langs->trans("EMailTemplates");
$head[$h][2] = 'templates';
$h++;

View File

@@ -1329,11 +1329,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$comment = isset($this->cronjobs[$key]['comment'])?$this->cronjobs[$key]['comment']:'';
$frequency = isset($this->cronjobs[$key]['frequency'])?$this->cronjobs[$key]['frequency']:'';
$unitfrequency = isset($this->cronjobs[$key]['unitfrequency'])?$this->cronjobs[$key]['unitfrequency']:'';
$status = isset($this->cronjobs[$key]['status'])?$this->cronjobs[$key]['status']:'';
$priority = isset($this->cronjobs[$key]['priority'])?$this->cronjobs[$key]['priority']:'';
$test = isset($this->cronjobs[$key]['test'])?$this->cronjobs[$key]['test']:''; // Line must be visible
$datestart = isset($this->cronjobs[$key]['datestart'])?$this->cronjobs[$key]['datestart']:'';
$dateend = isset($this->cronjobs[$key]['dateend'])?$this->cronjobs[$key]['dateend']:'';
$status = isset($this->cronjobs[$key]['status'])?$this->cronjobs[$key]['status']:'';
$test = isset($this->cronjobs[$key]['test'])?$this->cronjobs[$key]['test']:''; // Line must be enabled or not (so visible or not)
// Search if cron entry already present
$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob";
@@ -1430,6 +1430,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob";
$sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND test = 1"; // We delete on lines that are not set with a complete test that is '$conf->module->enabled' so when module is disabled, the cron is also removed.
// For crons declared with a '$conf->module->enabled', there is no need to delete the line, so we don't loose setup if we reenable module.
dol_syslog(get_class($this)."::delete_cronjobs", LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@@ -115,7 +115,7 @@ class modAgenda extends DolibarrModules
//------------
$datestart=dol_now();
$this->cronjobs = array(
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1', 'datestart'=>$datestart),
0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'$conf->agenda->enabled', 'datestart'=>$datestart),
);
// Permissions

View File

@@ -118,7 +118,7 @@ class modFacture extends DolibarrModules
$arraydate=dol_getdate(dol_now());
$datestart=dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
$this->cronjobs = array(
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true, 'datestart'=>$datestart),
0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart),
);
// Permissions

View File

@@ -85,7 +85,7 @@ class modSyslog extends DolibarrModules
// Cronjobs
$this->cronjobs = array(
0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files. Warning, batch must be run with same account than your web server to avoid to get lof files with different owner than required by web server !', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true),
0=>array('label'=>'CompressSyslogs', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'compressSyslogs', 'parameters'=>'', 'comment'=>'Compress and archive log files. Warning: batch must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission "rws" on this directory so log files will always have the group and permissions of the web server Operating System group', 'frequency'=>1, 'unitfrequency'=> 3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>true),
);
}
}

View File

@@ -287,7 +287,7 @@ CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself)
SupplierAbsoluteDiscountAllUsers=Absolute vendor discounts (entered by all users)
SupplierAbsoluteDiscountMy=Absolute vendor discounts (entered by yourself)
DiscountNone=None
Supplier=Supplier
Supplier=Vendor
AddContact=Create contact
AddContactAddress=Create contact/address
EditContact=Edit contact

View File

@@ -867,7 +867,7 @@ TitleSetToDraft=Go back to draft
ConfirmSetToDraft=Are you sure you want to go back to Draft status?
ImportId=Import id
Events=Events
EMailTemplates=Emails templates
EMailTemplates=Email templates
FileNotShared=File not shared to external public
Project=Project
Projects=Projects

View File

@@ -178,7 +178,7 @@ if (! $rowid) {
print "</td>\n";*/
// Origine
//print "<TD>";
//print "<td>";
////if ($charge->metadata->dol_type=="order"){
// $object = new Commande($db);
// $object->fetch($charge->metadata->dol_id);
@@ -188,7 +188,7 @@ if (! $rowid) {
// $object->fetch($charge->metadata->dol_id);
// print "<A href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
//}
//print "</TD>\n";
//print "</td>\n";
// Date payment
print '<td align="center">' . dol_print_date($txn->created, '%d/%m/%Y %H:%M') . "</td>\n";
// Type

View File

@@ -219,8 +219,8 @@ foreach($search as $key => $val)
if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'fk_statut')?2:$mode_search));
}
if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
if ($search_fk_soc) $sql.= natural_search('fk_soc', $search_fk_soc);
if ($search_fk_project) $sql.= natural_search('fk_project', $search_fk_project);
if ($search_fk_soc) $sql.= natural_search('fk_soc', $search_fk_soc, 2);
if ($search_fk_project) $sql.= natural_search('fk_project', $search_fk_project, 2);
if (!$user->societe_id && ($mode == "my_assign" || (!$user->admin && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY))) {
$sql.= " AND t.fk_user_assign=".$user->id;
}