Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
dc0558989b
@ -715,9 +715,9 @@ class Adherent extends CommonObject
|
||||
$this->error .= $this->db->lasterror();
|
||||
$errorflag=-1;
|
||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Remove cotisation
|
||||
if (! $error)
|
||||
{
|
||||
@ -732,9 +732,9 @@ class Adherent extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove linked user
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$ret=$this->setUserId(0);
|
||||
if ($ret < 0)
|
||||
@ -745,21 +745,22 @@ class Adherent extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Removed extrafields
|
||||
if (! $error)
|
||||
{
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->deleteExtraFields($this);
|
||||
if ($result < 0) {
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$errorflag=-4;
|
||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove adherent
|
||||
if (! $error)
|
||||
{
|
||||
@ -774,7 +775,7 @@ class Adherent extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
@ -784,9 +785,9 @@ class Adherent extends CommonObject
|
||||
if ($result < 0) {$error++; $this->errors=$interface->errors;}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
|
||||
@ -227,7 +227,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
}
|
||||
else if ($reshook < 0) $error++;
|
||||
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
@ -367,13 +367,17 @@ class ActionComm extends CommonObject
|
||||
$this->error=$this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Removed extrafields
|
||||
if (! $error) {
|
||||
$result=$this->deleteExtraFields($this);
|
||||
if ($result < 0) $error++;
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
@ -468,7 +472,7 @@ class ActionComm extends CommonObject
|
||||
dol_syslog(get_class($this)."::update sql=".$sql);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($this->db);
|
||||
@ -487,7 +491,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
}
|
||||
else if ($reshook < 0) $error++;
|
||||
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
|
||||
@ -385,12 +385,13 @@ else
|
||||
});
|
||||
|
||||
$("#copyaddressfromsoc").click(function() {
|
||||
$(\'textarea[name="address"]\').text("'.addslashes($objsoc->address).'");
|
||||
$(\'input[name="zipcode"]\').val("'.addslashes($objsoc->zip).'");
|
||||
$(\'input[name="town"]\').val("'.addslashes($objsoc->town).'");
|
||||
$(\'select[name="country_id"]\').val("'.addslashes($objsoc->country_id).'");
|
||||
$(\'select[name="state_id"]\').val("'.addslashes($objsoc->state_id).'");
|
||||
});
|
||||
$(\'textarea[name="address"]\').text("'.dol_escape_js($objsoc->address).'");
|
||||
$(\'input[name="zipcode"]\').val("'.dol_escape_js($objsoc->zip).'");
|
||||
$(\'input[name="town"]\').val("'.dol_escape_js($objsoc->town).'");
|
||||
$(\'select[name="country_id"]\').val("'.dol_escape_js($objsoc->country_id).'");
|
||||
$(\'select[name="state_id"]\').val("'.dol_escape_js($objsoc->state_id).'");
|
||||
$(\'input[name="email"]\').val("'.dol_escape_js($objsoc->email).'");
|
||||
});
|
||||
})'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
@ -482,16 +483,16 @@ else
|
||||
|
||||
// Phone / Fax
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->tel; // Predefined with third party
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
||||
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td><td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
||||
print '<td>'.$langs->trans("PhonePerso").'</td><td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
||||
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input name="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
||||
print '<td>'.$langs->trans("Fax").'</td><td><input name="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input name="phone_mobile" id="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
||||
print '<td>'.$langs->trans("Fax").'</td><td><input name="fax" id="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
||||
|
||||
// EMail
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party
|
||||
print '<tr><td>'.$langs->trans("Email").'</td><td><input name="email" type="text" size="50" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td>';
|
||||
print '<tr><td>'.$langs->trans("Email").'</td><td><input name="email" id="email" type="text" size="50" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td>';
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
print '<td>'.$langs->trans("No_Email").'</td><td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td>';
|
||||
|
||||
@ -2069,25 +2069,24 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* Delete all extra fields values for the current object.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function deleteExtraFields()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
dol_syslog(get_class($this)."::insertExtraFields delete sql=".$sql_del);
|
||||
$this->db->query($sql_del);
|
||||
|
||||
dol_syslog(get_class($this)."::deleteExtraFields delete sql=".$sql_del);
|
||||
$resql=$this->db->query($sql_del);
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::delete ".$this->error,LOG_ERR);
|
||||
dol_syslog(get_class($this)."::deleteExtraFields ".$this->error,LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -2256,7 +2255,7 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* Function that returns the total amount of discounts applied.
|
||||
*
|
||||
*
|
||||
* @return false|float False is returned if the discount couldn't be retrieved
|
||||
*/
|
||||
function getTotalDiscount()
|
||||
@ -2264,7 +2263,7 @@ abstract class CommonObject
|
||||
$sql = 'SELECT (SUM(`subprice`) - SUM(`total_ht`)) as `discount` FROM '.MAIN_DB_PREFIX.$this->table_element.'det WHERE `'.$this->fk_element.'` = '.$this->id;
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
|
||||
if ($query)
|
||||
{
|
||||
$result = $this->db->fetch_object($query);
|
||||
|
||||
@ -172,6 +172,7 @@ date_create datetime NOT NULL ,
|
||||
description varchar(255) NOT NULL ,
|
||||
date_debut date NOT NULL ,
|
||||
date_fin date NOT NULL ,
|
||||
halfday integer DEFAULT 0,
|
||||
statut integer NOT NULL DEFAULT '1',
|
||||
fk_validator integer NOT NULL ,
|
||||
date_valid datetime DEFAULT NULL ,
|
||||
@ -183,6 +184,8 @@ fk_user_cancel integer DEFAULT NULL,
|
||||
detail_refuse varchar(250) DEFAULT NULL
|
||||
)
|
||||
ENGINE=innodb;
|
||||
ALTER TABLE llx_holiday ADD COLUMN halfday integer DEFAULT 0 after date_fin;
|
||||
|
||||
|
||||
ALTER TABLE llx_holiday ADD INDEX idx_holiday_fk_user (fk_user);
|
||||
ALTER TABLE llx_holiday ADD INDEX idx_holiday_date_debut (date_debut);
|
||||
|
||||
@ -24,6 +24,7 @@ date_create DATETIME NOT NULL,
|
||||
description VARCHAR( 255 ) NOT NULL,
|
||||
date_debut DATE NOT NULL,
|
||||
date_fin DATE NOT NULL,
|
||||
halfday integer DEFAULT 0,
|
||||
statut integer NOT NULL DEFAULT '1',
|
||||
fk_validator integer NOT NULL,
|
||||
date_valid DATETIME DEFAULT NULL,
|
||||
|
||||
@ -70,7 +70,7 @@ Phone=Téléphone
|
||||
PhonePro=Tél pro.
|
||||
PhonePerso=Tél perso.
|
||||
PhoneMobile=Tél portable
|
||||
No_Email=Ne pas envoyer d'emailing de masse
|
||||
No_Email=Désactiver l'envoi d'emailing de masse
|
||||
Fax=Fax
|
||||
Zip=Code postal
|
||||
Town=Ville
|
||||
|
||||
@ -791,6 +791,8 @@ if (! function_exists("llxHeader"))
|
||||
*/
|
||||
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
|
||||
if (empty($conf->global->MAIN_HIDE_TOP_MENU))
|
||||
{
|
||||
|
||||
@ -629,8 +629,9 @@ class Product extends CommonObject
|
||||
// Removed extrafields
|
||||
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->deleteExtraFields($this);
|
||||
if ($result < 0) {
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this).'::delete error '.$this->error, LOG_ERR);
|
||||
}
|
||||
|
||||
@ -1018,7 +1018,7 @@ class Societe extends CommonObject
|
||||
{
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::Delete erreur -2 ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::delete erreur -2 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1040,10 +1040,11 @@ class Societe extends CommonObject
|
||||
// Removed extrafields
|
||||
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->deleteExtraFields($this);
|
||||
if ($result < 0) {
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -721,8 +721,9 @@ class User extends CommonObject
|
||||
// Remove extrafields
|
||||
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->deleteExtraFields($this);
|
||||
if ($result < 0) {
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user