Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
b2d9f21253
@ -162,7 +162,7 @@ foreach($dirbarcode as $reldir)
|
||||
{
|
||||
$filebis=$reg[1];
|
||||
|
||||
// Chargement de la classe de codage
|
||||
// Loading encoding class
|
||||
require_once $newdir.$file;
|
||||
$classname = "mod".ucfirst($filebis);
|
||||
$module = new $classname($db);
|
||||
|
||||
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
|
||||
$classname = preg_replace('/\-.*$/','',$classname);
|
||||
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
|
||||
{
|
||||
// Chargement de la classe de numerotation
|
||||
// Charging the numbering class
|
||||
require_once $dir.$filebis;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
@ -130,7 +130,7 @@ foreach ($dirmodels as $reldir)
|
||||
$classname = preg_replace('/\-.*$/','',$classname);
|
||||
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
|
||||
{
|
||||
// Chargement de la classe de numerotation
|
||||
// Charging the numbering class
|
||||
require_once $dir.$filebis;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
@ -221,7 +221,7 @@ if (is_resource($handle))
|
||||
{
|
||||
if (preg_match('/(modGeneratePass[a-z]+)\.class\.php/i',$file,$reg))
|
||||
{
|
||||
// Chargement de la classe de numerotation
|
||||
// Charging the numbering class
|
||||
$classname = $reg[1];
|
||||
require_once $dir.'/'.$file;
|
||||
|
||||
|
||||
@ -101,12 +101,12 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($categorie->error, 'errors');
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($categorie->error, 'errors');
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
else
|
||||
{
|
||||
$action = 'add';
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ $cancel != $langs->trans("Cancel") &&
|
||||
else
|
||||
{
|
||||
$action = 'edit';
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,13 +137,13 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory'
|
||||
$result=$object->add_type($newobject,$elementtype);
|
||||
if ($result >= 0)
|
||||
{
|
||||
setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref));
|
||||
setEventMessages($langs->trans("WasAddedSuccessfully",$newobject->ref), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings');
|
||||
setEventMessages($langs->trans("ObjectAlreadyLinkedToCategory"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -62,7 +62,7 @@ if ($action == 'builddoc')
|
||||
$result=$cat->write_file(GETPOST('id','int'));
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($cat->error, 'errors');
|
||||
setEventMessages($cat->error, $cat->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ if (empty($reshook))
|
||||
{
|
||||
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
|
||||
{
|
||||
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
|
||||
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -129,7 +129,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
$action='';
|
||||
@ -141,14 +141,14 @@ if (empty($reshook))
|
||||
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
{
|
||||
// As security measure, we don't allow send from the GUI
|
||||
setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
|
||||
setEventMessage('<textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
|
||||
setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
setEventMessages('<textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', null, 'warnings');
|
||||
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings');
|
||||
$action='';
|
||||
}
|
||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||
{
|
||||
setEventMessage($langs->trans("NotEnoughPermissions"), 'warnings');
|
||||
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
@ -351,27 +351,27 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"));
|
||||
setEventMessages($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"), null, 'mesgs');
|
||||
}
|
||||
|
||||
// Loop finished, set global statut of mail
|
||||
if ($nbko > 0)
|
||||
{
|
||||
$statut=2; // Status 'sent partially' (because at least one error)
|
||||
if ($nbok > 0) setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
|
||||
else setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
|
||||
if ($nbok > 0) setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
|
||||
else setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($nbok >= $num)
|
||||
{
|
||||
$statut=3; // Send to everybody
|
||||
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
|
||||
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$statut=2; // Status 'sent partially' (because not send to everybody)
|
||||
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
|
||||
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
@ -443,11 +443,11 @@ if (empty($reshook))
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)));
|
||||
setEventMessages($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, 'errors');
|
||||
setEventMessages($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, null, 'errors');
|
||||
}
|
||||
|
||||
$action='';
|
||||
@ -488,7 +488,7 @@ if (empty($reshook))
|
||||
$mesgs[] = $object->error;
|
||||
}
|
||||
|
||||
setEventMessage($mesgs, 'errors');
|
||||
setEventMessages($mesg, $mesgs, 'errors');
|
||||
$action="create";
|
||||
}
|
||||
|
||||
@ -518,7 +518,7 @@ if (empty($reshook))
|
||||
$mesg = $object->error;
|
||||
}
|
||||
|
||||
setEventMessage($mesg, 'errors');
|
||||
setEventMessages($mesg, $mesgs, 'errors');
|
||||
$action="";
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ if (empty($reshook))
|
||||
$mesgs[] =$object->error;
|
||||
}
|
||||
|
||||
setEventMessage($mesgs, 'errors');
|
||||
setEventMessages($mesg, $mesgs, 'errors');
|
||||
$action="edit";
|
||||
}
|
||||
else
|
||||
@ -597,7 +597,7 @@ if (empty($reshook))
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$object->valid($user);
|
||||
setEventMessage($langs->trans("MailingSuccessfullyValidated"));
|
||||
setEventMessages($langs->trans("MailingSuccessfullyValidated"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
@ -628,7 +628,7 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -764,18 +764,18 @@ else
|
||||
// You ensure that every user is using its own SMTP server.
|
||||
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails.php">';
|
||||
$linktoadminemailend='</a>';
|
||||
setEventMessage($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), 'warnings');
|
||||
setEventMessage($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), 'warnings');
|
||||
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessage($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), 'warnings');
|
||||
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
|
||||
setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
{
|
||||
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
|
||||
setEventMessage('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
|
||||
setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
setEventMessages('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', null, 'warnings');
|
||||
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings');
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else
|
||||
|
||||
@ -80,7 +80,7 @@ if ($action == 'add')
|
||||
//print $dir."\n<br>";
|
||||
dol_syslog("Scan directory ".$dir." for modules");
|
||||
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$file = $dir."/".$module.".modules.php";
|
||||
$classname = "mailing_".$module;
|
||||
|
||||
@ -100,24 +100,24 @@ if ($action == 'add')
|
||||
}
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessage($langs->trans("XTargetsAdded",$result),'mesgs');
|
||||
setEventMessages($langs->trans("XTargetsAdded",$result), null, 'mesgs');
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
if ($result == 0)
|
||||
{
|
||||
setEventMessage($langs->trans("WarningNoEMailsAdded"),'warnings');
|
||||
setEventMessages($langs->trans("WarningNoEMailsAdded"), null, 'warnings');
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($langs->trans("Error").($obj->error?' '.$obj->error:''),'errors');
|
||||
setEventMessages($langs->trans("Error").($obj->error?' '.$obj->error:''), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('clearlist'))
|
||||
{
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$obj = new MailingTargets($db);
|
||||
$obj->clear_target($id);
|
||||
|
||||
@ -267,7 +267,7 @@ if ($object->fetch($id) >= 0)
|
||||
// Loop on each submodule
|
||||
foreach($modulenames as $modulename)
|
||||
{
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$file = $dir.$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once $file;
|
||||
|
||||
@ -83,7 +83,7 @@ if (is_resource($handle))
|
||||
$modulename=$reg[1];
|
||||
if ($modulename == 'example') continue;
|
||||
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$file = $dir."/".$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once $file;
|
||||
|
||||
@ -1546,7 +1546,7 @@ class Form
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' autofocus />';
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
if ($hidelabel == 3) {
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
@ -1663,7 +1663,7 @@ class Form
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'" autofocus>';
|
||||
$out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$out.='<option value="0" selected> </option>';
|
||||
|
||||
$i = 0;
|
||||
|
||||
@ -64,7 +64,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
|
||||
{
|
||||
$moduleid=$reg[1];
|
||||
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$file = $dir."/export_".$moduleid.".modules.php";
|
||||
$classname = "Export".ucfirst($moduleid);
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ class ModeleImports
|
||||
{
|
||||
$moduleid=$reg[1];
|
||||
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$file = $dir."/import_".$moduleid.".modules.php";
|
||||
$classname = "Import".ucfirst($moduleid);
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ class Export
|
||||
|
||||
if ($enabled)
|
||||
{
|
||||
// Chargement de la classe
|
||||
// Loading Class
|
||||
$file = $dir.$modulename.".class.php";
|
||||
$classname = $modulename;
|
||||
require_once $file;
|
||||
|
||||
@ -56,16 +56,16 @@ create table llx_overwrite_trans
|
||||
transvalue text
|
||||
)ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_payment_salary ADD COLUMN datec datetime after tms;
|
||||
ALTER TABLE llx_payment_salary ADD COLUMN datec datetime AFTER tms;
|
||||
ALTER TABLE llx_payment_salary CHANGE COLUMN fk_user_creat fk_user_author integer;
|
||||
|
||||
ALTER TABLE llx_adherent ADD COLUMN pass_crypted varchar(128) after pass;
|
||||
ALTER TABLE llx_adherent ADD COLUMN pass_crypted varchar(128) AFTER pass;
|
||||
|
||||
ALTER TABLE llx_paiement ADD COLUMN ref varchar(30) NOT NULL AFTER rowid;
|
||||
ALTER TABLE llx_paiement ADD COLUMN ref varchar(30) NOT NULL DEFAULT '' AFTER rowid;
|
||||
|
||||
ALTER TABLE llx_socpeople ADD COLUMN photo varchar(255) AFTER skype;
|
||||
|
||||
ALTER TABLE llx_user_param MODIFY COLUMN value text NOT NULL;
|
||||
ALTER TABLE llx_user_param MODIFY COLUMN value text NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE llx_expedition ADD COLUMN import_key varchar(14);
|
||||
ALTER TABLE llx_expedition ADD COLUMN extraparams varchar(255);
|
||||
@ -76,7 +76,7 @@ ALTER TABLE llx_prelevement_lignes MODIFY COLUMN code_banque varchar(128);
|
||||
ALTER TABLE llx_societe_rib MODIFY COLUMN code_banque varchar(128);
|
||||
|
||||
ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30);
|
||||
ALTER TABLE llx_commande ADD COLUMN fk_warehouse integer DEFAULT NULL after fk_shipping_method;
|
||||
ALTER TABLE llx_commande ADD COLUMN fk_warehouse integer DEFAULT NULL AFTER fk_shipping_method;
|
||||
|
||||
ALTER TABLE llx_ecm_directories MODIFY COLUMN fullpath varchar(750);
|
||||
ALTER TABLE llx_ecm_directories DROP INDEX idx_ecm_directories;
|
||||
@ -107,20 +107,20 @@ ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files (label, entity);
|
||||
--ALTER TABLE llx_ecm_files ADD UNIQUE INDEX uk_ecm_files_fullpath(fullpath);
|
||||
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy;
|
||||
ALTER TABLE llx_product ADD COLUMN onportal smallint DEFAULT 0 AFTER tobuy;
|
||||
|
||||
|
||||
ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1;
|
||||
ALTER TABLE llx_user ADD COLUMN employee smallint DEFAULT 1;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_function
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
pos tinyint DEFAULT 0 NOT NULL,
|
||||
pos smallint DEFAULT 0 NOT NULL,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50),
|
||||
c_level tinyint DEFAULT 0 NOT NULL,
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
c_level smallint DEFAULT 0 NOT NULL,
|
||||
active smallint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5, 'EXECBOARD', 'Executive board', 0, 1);
|
||||
@ -136,10 +136,10 @@ INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES
|
||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_department
|
||||
(
|
||||
rowid integer PRIMARY KEY,
|
||||
pos tinyint DEFAULT 0 NOT NULL,
|
||||
pos smallint DEFAULT 0 NOT NULL,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50),
|
||||
active tinyint DEFAULT 1 NOT NULL
|
||||
active smallint DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1);
|
||||
@ -178,7 +178,7 @@ CREATE TABLE IF NOT EXISTS llx_establishment (
|
||||
fk_user_mod integer NOT NULL,
|
||||
datec datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
status tinyint DEFAULT 1
|
||||
status smallint DEFAULT 1
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
@ -260,7 +260,7 @@ CREATE TABLE llx_product_pricerules
|
||||
var_percent FLOAT NOT NULL, -- Price variation over based price
|
||||
var_min_percent FLOAT NOT NULL -- Min price discount over general price
|
||||
);
|
||||
ALTER TABLE llx_product ADD COLUMN price_autogen TINYINT(1) DEFAULT 0;
|
||||
ALTER TABLE llx_product ADD COLUMN price_autogen smallint DEFAULT 0;
|
||||
ALTER TABLE llx_product_pricerules ADD CONSTRAINT unique_level UNIQUE (level);
|
||||
|
||||
|
||||
|
||||
@ -90,9 +90,6 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
|
||||
<?php echo $object->volume_units; ?>
|
||||
</td></tr>
|
||||
|
||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td>
|
||||
<td><?php echo $object->hidden; ?></td></tr>
|
||||
|
||||
<tr><td valign="top"><?php echo $langs->trans("NoteNotVisibleOnBill"); ?></td><td>
|
||||
<?php echo $object->textarea_note; ?>
|
||||
</td></tr>
|
||||
|
||||
@ -63,9 +63,6 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe
|
||||
<?php echo $object->duration_unit; ?>
|
||||
</td></tr>
|
||||
|
||||
<tr><td><?php echo $langs->trans("Hidden"); ?></td>
|
||||
<td><?php echo $object->hidden; ?></td></tr>
|
||||
|
||||
<tr><td valign="top"><?php echo $langs->trans("NoteNotVisibleOnBill"); ?></td><td>
|
||||
<?php echo $object->textarea_note; ?>
|
||||
</td></tr>
|
||||
|
||||
@ -249,7 +249,6 @@ if (empty($reshook))
|
||||
$object->volume = GETPOST('volume');
|
||||
$object->volume_units = GETPOST('volume_units');
|
||||
$object->finished = GETPOST('finished');
|
||||
$object->hidden = GETPOST('hidden')=='yes'?1:0;
|
||||
$object->fk_unit = GETPOST('units');
|
||||
$object->accountancy_code_sell = GETPOST('accountancy_code_sell');
|
||||
$object->accountancy_code_buy = GETPOST('accountancy_code_buy');
|
||||
@ -335,7 +334,6 @@ if (empty($reshook))
|
||||
$object->volume = GETPOST('volume');
|
||||
$object->volume_units = GETPOST('volume_units');
|
||||
$object->finished = GETPOST('finished');
|
||||
$object->hidden = GETPOST('hidden')=='yes'?1:0;
|
||||
|
||||
$units = GETPOST('units', 'int');
|
||||
|
||||
|
||||
@ -84,11 +84,13 @@ class Product extends CommonObject
|
||||
//! Base price ('TTC' for price including tax or 'HT' for net price)
|
||||
var $price_base_type;
|
||||
//! Arrays for multiprices
|
||||
var $multiprices=array();
|
||||
var $multiprices_ttc=array();
|
||||
var $multiprices_base_type=array();
|
||||
var $multiprices_tva_tx=array();
|
||||
var $multiprices_recuperableonly=array();
|
||||
public $multiprices=array();
|
||||
public $multiprices_ttc=array();
|
||||
public $multiprices_base_type=array();
|
||||
public $multiprices_min=array();
|
||||
public $multiprices_min_ttc=array();
|
||||
public $multiprices_tva_tx=array();
|
||||
public $multiprices_recuperableonly=array();
|
||||
//! Price by quantity arrays
|
||||
var $price_by_qty;
|
||||
var $prices_by_qty=array();
|
||||
@ -125,6 +127,12 @@ class Product extends CommonObject
|
||||
|
||||
var $customcode; // Customs code
|
||||
|
||||
/**
|
||||
* Product URL
|
||||
* @var string
|
||||
*/
|
||||
public $url;
|
||||
|
||||
//! Unites de mesure
|
||||
var $weight;
|
||||
var $weight_units;
|
||||
@ -717,6 +725,7 @@ class Product extends CommonObject
|
||||
$sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null");
|
||||
$sql.= ", fk_unit= " . (!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql.= ", price_autogen = " . (!$this->price_autogen ? 0 : 1);
|
||||
$sql.= ", fk_price_expression = ".($this->fk_price_expression != 0 ? $this->fk_price_expression : 'NULL');
|
||||
$sql.= " WHERE rowid = " . $id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
@ -1443,6 +1452,14 @@ class Product extends CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->multiprices[$level] = $price;
|
||||
$this->multiprices_ttc[$level] = $price_ttc;
|
||||
$this->multiprices_min[$level]= $price_min;
|
||||
$this->multiprices_min_ttc[$level]= $price_min_ttc;
|
||||
$this->multiprices_base_type[$level]= $newpricebase;
|
||||
$this->multiprices_tva_tx[$level]= $newvat;
|
||||
$this->multiprices_recuperableonly[$level]= $newnpr;
|
||||
|
||||
$this->price = $price;
|
||||
$this->price_ttc = $price_ttc;
|
||||
$this->price_min = $price_min;
|
||||
@ -1487,33 +1504,15 @@ class Product extends CommonObject
|
||||
*
|
||||
* @param int $expression_id Expression
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @deprecated Use Product::update instead
|
||||
*/
|
||||
function setPriceExpression($expression_id)
|
||||
{
|
||||
global $conf;
|
||||
global $user;
|
||||
|
||||
// Clean parameters
|
||||
$this->db->begin();
|
||||
$expression_id = $expression_id != 0 ? $expression_id : 'NULL';
|
||||
$this->fk_price_expression = $expression_id;
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product";
|
||||
$sql.= " SET fk_price_expression = ".$expression_id;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::setPriceExpression", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error()." sql=".$sql;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
return $this->update($this->id, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user