Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
d804683b32
@ -58,9 +58,11 @@ class AccountancySystem
|
|||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingsystem";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingsystem";
|
||||||
$sql.= " (date_creation, fk_user_author, numero,intitule)";
|
$sql.= " (date_creation, fk_user_author, numero,intitule)";
|
||||||
$sql.= " VALUES (".$this->db->idate(mktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
$sql.= " VALUES (".$this->db->idate($now).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -816,7 +816,7 @@ if ($rowid)
|
|||||||
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($company->name).'">';
|
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($company->name).'">';
|
||||||
print "<table class=\"border\" width=\"100%\">\n";
|
print "<table class=\"border\" width=\"100%\">\n";
|
||||||
|
|
||||||
$today=mktime();
|
$today=dol_now();
|
||||||
$datefrom=0;
|
$datefrom=0;
|
||||||
$dateto=0;
|
$dateto=0;
|
||||||
$paymentdate=-1;
|
$paymentdate=-1;
|
||||||
@ -841,7 +841,7 @@ if ($rowid)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$datefrom=mktime();
|
$datefrom=dol_now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$form->select_date($datefrom,'','','','',"cotisation");
|
$form->select_date($datefrom,'','','','',"cotisation");
|
||||||
|
|||||||
@ -1250,6 +1250,7 @@ class Adherent extends CommonObject
|
|||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($this->statut == 1)
|
if ($this->statut == 1)
|
||||||
@ -1262,7 +1263,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql.= " statut = 1";
|
$sql.= " statut = 1";
|
||||||
$sql.= ", datevalid = ".$this->db->idate(mktime());
|
$sql.= ", datevalid = ".$this->db->idate($now);
|
||||||
$sql.= ", fk_user_valid=".$user->id;
|
$sql.= ", fk_user_valid=".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,9 @@ class Cotisation extends CommonObject
|
|||||||
function create($userid)
|
function create($userid)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($this->datef <= $this->dateh)
|
if ($this->datef <= $this->dateh)
|
||||||
{
|
{
|
||||||
@ -73,7 +76,7 @@ class Cotisation extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cotisation (fk_adherent, datec, dateadh, datef, cotisation, note)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cotisation (fk_adherent, datec, dateadh, datef, cotisation, note)";
|
||||||
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate(mktime())."',";
|
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate($now)."',";
|
||||||
$sql.= " '".$this->db->idate($this->dateh)."',";
|
$sql.= " '".$this->db->idate($this->dateh)."',";
|
||||||
$sql.= " '".$this->db->idate($this->datef)."',";
|
$sql.= " '".$this->db->idate($this->datef)."',";
|
||||||
$sql.= " ".$this->amount.",'".$this->db->escape($this->note)."')";
|
$sql.= " ".$this->amount.",'".$this->db->escape($this->note)."')";
|
||||||
|
|||||||
@ -37,6 +37,8 @@ if (! $user->rights->adherent->export) accessforbidden();
|
|||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
if ($sortorder == "") { $sortorder="ASC"; }
|
if ($sortorder == "") { $sortorder="ASC"; }
|
||||||
if ($sortfield == "") { $sortfield="d.login"; }
|
if ($sortfield == "") { $sortfield="d.login"; }
|
||||||
if (! isset($statut))
|
if (! isset($statut))
|
||||||
@ -56,7 +58,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
|
|||||||
$sql .= " WHERE d.statut = $statut ";
|
$sql .= " WHERE d.statut = $statut ";
|
||||||
if ($cotis==1)
|
if ($cotis==1)
|
||||||
{
|
{
|
||||||
$sql .= " AND datefin > '".$db->idate(mktime())."'";
|
$sql .= " AND datefin > '".$db->idate($now)."'";
|
||||||
}
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
//$sql.=$db->plimit($conf->liste_limit, $offset);
|
//$sql.=$db->plimit($conf->liste_limit, $offset);
|
||||||
|
|||||||
@ -337,6 +337,8 @@ if ($rowid > 0)
|
|||||||
|
|
||||||
$membertypestatic=new AdherentType($db);
|
$membertypestatic=new AdherentType($db);
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe, ";
|
$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe, ";
|
||||||
$sql.= " d.datefin,";
|
$sql.= " d.datefin,";
|
||||||
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
|
||||||
@ -376,11 +378,11 @@ if ($rowid > 0)
|
|||||||
}
|
}
|
||||||
if ($filter == 'uptodate')
|
if ($filter == 'uptodate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin >= ".$db->idate(mktime());
|
$sql.=" AND datefin >= ".$db->idate($now);
|
||||||
}
|
}
|
||||||
if ($filter == 'outofdate')
|
if ($filter == 'outofdate')
|
||||||
{
|
{
|
||||||
$sql.=" AND datefin < ".$db->idate(mktime());
|
$sql.=" AND datefin < ".$db->idate($now);
|
||||||
}
|
}
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
|
|||||||
@ -34,6 +34,8 @@ if (!$user->admin)
|
|||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -45,13 +47,34 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
$mailfrom = GETPOST('MAILING_EMAIL_FROM','alpha');
|
$mailfrom = GETPOST('MAILING_EMAIL_FROM','alpha');
|
||||||
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha');
|
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha');
|
||||||
$checkread = GETPOST('value','alpha');
|
$checkread = GETPOST('value','alpha');
|
||||||
|
$checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY','alpha');
|
||||||
|
|
||||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity);
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity);
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
//$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",$checkread,'chaine',0,'',$conf->entity);
|
if ($checkread=='on')
|
||||||
//if (! $res > 0) $error++;
|
{
|
||||||
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",1,'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
}
|
||||||
|
else if ($checkread=='off')
|
||||||
|
{
|
||||||
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",0,'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create temporary encryption key if nedded
|
||||||
|
if (($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1) && (empty($checkread_key)))
|
||||||
|
{
|
||||||
|
$chars = "abcdef(ghijklmnopqrstuvwxyz;!ABCDEFGH,IJKLMNOPQRSTUVWXYZ01_23456789";
|
||||||
|
mt_srand(10000000*(double)microtime());
|
||||||
|
for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < 30; $i++) {
|
||||||
|
$checkread_key .= $chars[mt_rand(0, $lc)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity);
|
||||||
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -104,24 +127,31 @@ print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf
|
|||||||
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
|
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
/*
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("ActivateCheckRead").'</td><td>';
|
print $langs->trans("ActivateCheckRead").'</td><td>';
|
||||||
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1)
|
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1)
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=0">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=off">';
|
||||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
$readonly='';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=1">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&value=on">';
|
||||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
$readonly='disabled="disabled"';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td>';
|
||||||
|
print $langs->trans("ActivateCheckReadKey").'</td><td>';
|
||||||
|
print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" '.$readonly.' value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||||
|
|||||||
@ -49,10 +49,12 @@ print '<table class="noborder" cellspacing="0" cellpadding="3" width="100%">';
|
|||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Total").'</td></tr>';
|
print '<td align="right">'.$langs->trans("Total").'</td></tr>';
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "SELECT sum(t.value) as value, MONTH(o.date_purchased) as mois";
|
$sql = "SELECT sum(t.value) as value, MONTH(o.date_purchased) as mois";
|
||||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t";
|
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||||
$sql .= " JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o ON o.orders_id = t.orders_id";
|
$sql .= " JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o ON o.orders_id = t.orders_id";
|
||||||
$sql .= " WHERE t.class = 'ot_subtotal' AND YEAR(o.date_purchased) = YEAR(".$dbosc->idate(mktime()).")";
|
$sql .= " WHERE t.class = 'ot_subtotal' AND YEAR(o.date_purchased) = YEAR(".$dbosc->idate($now).")";
|
||||||
$sql .= " GROUP BY mois ORDER BY mois";
|
$sql .= " GROUP BY mois ORDER BY mois";
|
||||||
|
|
||||||
$result=$dbosc->query($sql);
|
$result=$dbosc->query($sql);
|
||||||
|
|||||||
@ -73,11 +73,13 @@ class Promotion
|
|||||||
|
|
||||||
$newprice = $percent * $this->price_init;
|
$newprice = $percent * $this->price_init;
|
||||||
|
|
||||||
$date_exp = "2003-05-01";
|
$date_exp = "2003-05-01"; // TODO ????
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."specials ";
|
$sql = "INSERT INTO ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."specials ";
|
||||||
$sql .= " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status) ";
|
$sql .= " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status) ";
|
||||||
$sql .= " VALUES ($pid, $newprice, '".$this->db->idate(mktime())."', NULL, '".$this->db->idate(mktime()+3600*24*365)."', NULL, 1)";
|
$sql .= " VALUES ($pid, $newprice, '".$this->db->idate($now)."', NULL, '".$this->db->idate($now+3600*24*365)."', NULL, 1)";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,6 +46,7 @@ if ($user->societe_id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$max=5;
|
$max=5;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -58,7 +59,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'add_bookmark')
|
|||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$_GET["socid"].", ".$db->idate(mktime()).",".$user->id.");";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$_GET["socid"].", ".$db->idate($now).",".$user->id.");";
|
||||||
if (! $db->query($sql) )
|
if (! $db->query($sql) )
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@ -96,9 +96,11 @@ class Mailing extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing";
|
||||||
$sql .= " (date_creat, fk_user_creat, entity)";
|
$sql .= " (date_creat, fk_user_creat, entity)";
|
||||||
$sql .= " VALUES (".$this->db->idate(mktime()).", ".$user->id.", ".$conf->entity.")";
|
$sql .= " VALUES (".$this->db->idate($now).", ".$user->id.", ".$conf->entity.")";
|
||||||
|
|
||||||
if (! $this->titre)
|
if (! $this->titre)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -64,7 +64,7 @@ if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE)
|
|||||||
$substitutionarray,
|
$substitutionarray,
|
||||||
array(
|
array(
|
||||||
'__CHECK_READ__' => 'CheckMail',
|
'__CHECK_READ__' => 'CheckMail',
|
||||||
'__UNSUSCRIBE__' => 'Unsuscribe'
|
'__UNSUSCRIBE__' => 'Unsubscribe'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE)
|
|||||||
$substitutionarrayfortest,
|
$substitutionarrayfortest,
|
||||||
array(
|
array(
|
||||||
'__CHECK_READ__' => 'TESTCheckMail',
|
'__CHECK_READ__' => 'TESTCheckMail',
|
||||||
'__UNSUSCRIBE__' => 'TESTCheckMail'
|
'__UNSUSCRIBE__' => 'TESTUnsubscribe'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1468,11 +1468,12 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$this->statut = $statut;
|
$this->statut = $statut;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||||
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate($now).", fk_user_cloture=".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -1497,11 +1498,12 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$this->statut = $statut;
|
$this->statut = $statut;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||||
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate($now).", fk_user_cloture=".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
|
|||||||
@ -381,7 +381,8 @@ if ($resql)
|
|||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a> ';
|
print '</a> ';
|
||||||
|
|
||||||
if ($db->jdate($objp->do) <= mktime()) {
|
$now=dol_now();
|
||||||
|
if ($db->jdate($objp->do) <= $now) {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?action=del&rowid='.$objp->rowid.'&account='.$acct->id.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?action=del&rowid='.$objp->rowid.'&account='.$acct->id.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -88,6 +88,7 @@ class FactureRec extends Facture
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->titre=trim($this->titre);
|
$this->titre=trim($this->titre);
|
||||||
@ -125,7 +126,7 @@ class FactureRec extends Facture
|
|||||||
$sql.= "'".$this->titre."'";
|
$sql.= "'".$this->titre."'";
|
||||||
$sql.= ", '".$facsrc->socid."'";
|
$sql.= ", '".$facsrc->socid."'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", ".$this->db->idate(mktime());
|
$sql.= ", ".$this->db->idate($now);
|
||||||
$sql.= ", '".$facsrc->amount."'";
|
$sql.= ", '".$facsrc->amount."'";
|
||||||
$sql.= ", '".$facsrc->remise."'";
|
$sql.= ", '".$facsrc->remise."'";
|
||||||
$sql.= ", '".$this->db->escape($this->note)."'";
|
$sql.= ", '".$this->db->escape($this->note)."'";
|
||||||
|
|||||||
@ -2897,11 +2897,13 @@ class Facture extends CommonObject
|
|||||||
$row = $this->db->fetch_row($resql);
|
$row = $this->db->fetch_row($resql);
|
||||||
if ($row[0] == 0)
|
if ($row[0] == 0)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande';
|
||||||
$sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
|
$sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
|
||||||
$sql .= ' VALUES ('.$this->id;
|
$sql .= ' VALUES ('.$this->id;
|
||||||
$sql .= ",'".price2num($this->total_ttc)."'";
|
$sql .= ",'".price2num($this->total_ttc)."'";
|
||||||
$sql .= ",".$this->db->idate(mktime()).",".$user->id;
|
$sql .= ",".$this->db->idate($now).",".$user->id;
|
||||||
$sql .= ",'".$soc->bank_account->code_banque."'";
|
$sql .= ",'".$soc->bank_account->code_banque."'";
|
||||||
$sql .= ",'".$soc->bank_account->code_guichet."'";
|
$sql .= ",'".$soc->bank_account->code_guichet."'";
|
||||||
$sql .= ",'".$soc->bank_account->number."'";
|
$sql .= ",'".$soc->bank_account->number."'";
|
||||||
|
|||||||
@ -112,7 +112,8 @@ if ($action == "builddoc" && $user->rights->facture->lire)
|
|||||||
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));
|
||||||
if ($pagecount)
|
if ($pagecount)
|
||||||
{
|
{
|
||||||
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date(mktime(),'dayhourlog').'.pdf';
|
$now=dol_now();
|
||||||
|
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
||||||
$pdf->Output($file,'F');
|
$pdf->Output($file,'F');
|
||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|||||||
@ -57,12 +57,14 @@ if ($user->societe_id > 0)
|
|||||||
|
|
||||||
if (isset($_GET["action"]) && $_GET["action"] == 'add_bookmark')
|
if (isset($_GET["action"]) && $_GET["action"] == 'add_bookmark')
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socid." AND fk_user=".$user->id;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socid." AND fk_user=".$user->id;
|
||||||
if (! $db->query($sql) )
|
if (! $db->query($sql) )
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$socid.", ".$db->idate(mktime()).",".$user->id.");";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES (".$socid.", ".$db->idate($now).",".$user->id.");";
|
||||||
if (! $db->query($sql) )
|
if (! $db->query($sql) )
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@ -865,6 +865,8 @@ class BonPrelevement extends CommonObject
|
|||||||
*/
|
*/
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Traitements
|
* Traitements
|
||||||
*/
|
*/
|
||||||
@ -900,7 +902,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$sql.= ") VALUES (";
|
$sql.= ") VALUES (";
|
||||||
$sql.= "'".$ref."'";
|
$sql.= "'".$ref."'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", '".$this->db->idate(mktime())."'";
|
$sql.= ", '".$this->db->idate($now)."'";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
|
dol_syslog("Bon-Prelevement::Create sql=".$sql, LOG_DEBUG);
|
||||||
@ -960,7 +962,7 @@ class BonPrelevement extends CommonObject
|
|||||||
*/
|
*/
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande";
|
||||||
$sql.= " SET traite = 1";
|
$sql.= " SET traite = 1";
|
||||||
$sql.= ", date_traite = ".$this->db->idate(mktime());
|
$sql.= ", date_traite = ".$this->db->idate($now);
|
||||||
$sql.= ", fk_prelevement_bons = ".$prev_id;
|
$sql.= ", fk_prelevement_bons = ".$prev_id;
|
||||||
$sql.= " WHERE rowid = ".$fac[1];
|
$sql.= " WHERE rowid = ".$fac[1];
|
||||||
|
|
||||||
@ -1137,8 +1139,10 @@ class BonPrelevement extends CommonObject
|
|||||||
|
|
||||||
if ($this->DeleteNotification($user, $action) == 0)
|
if ($this->DeleteNotification($user, $action) == 0)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_user, fk_soc, fk_contact, fk_action)";
|
||||||
$sql .= " VALUES (".$db->idate(mktime()).",".$user.", 'NULL', 'NULL', '".$action."')";
|
$sql .= " VALUES (".$db->idate($now).",".$user.", 'NULL', 'NULL', '".$action."')";
|
||||||
|
|
||||||
dol_syslog("adnotiff: ".$sql);
|
dol_syslog("adnotiff: ".$sql);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
|
|||||||
@ -84,6 +84,7 @@ class RejetPrelevement
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
$this->bon_id = $bonid;
|
$this->bon_id = $bonid;
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
dol_syslog("RejetPrelevement::Create id $id");
|
dol_syslog("RejetPrelevement::Create id $id");
|
||||||
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
|
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
|
||||||
@ -104,7 +105,7 @@ class RejetPrelevement
|
|||||||
$sql.= ", '".$this->db->idate($date_rejet)."'";
|
$sql.= ", '".$this->db->idate($date_rejet)."'";
|
||||||
$sql.= ", ".$motif;
|
$sql.= ", ".$motif;
|
||||||
$sql.= ", ".$user->id;
|
$sql.= ", ".$user->id;
|
||||||
$sql.= ", ".$this->db->idate(mktime());
|
$sql.= ", ".$this->db->idate($now);
|
||||||
$sql.= ", ".$facturation;
|
$sql.= ", ".$facturation;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
|
|||||||
@ -216,9 +216,10 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
|||||||
print "<td>".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")."</td>";
|
print "<td>".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")."</td>";
|
||||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
$annee_decalage=$annee;
|
$annee_decalage=$annee;
|
||||||
if($mois>12) {$annee_decalage=$annee+1;}
|
if ($mois>12) {$annee_decalage=$annee+1;}
|
||||||
$casenow = dol_print_date(mktime(),"%Y-%m");
|
$casenow = dol_print_date($now,"%Y-%m");
|
||||||
$case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m");
|
$case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m");
|
||||||
$caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m");
|
$caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m");
|
||||||
|
|
||||||
|
|||||||
@ -244,7 +244,7 @@ class Contrat extends CommonObject
|
|||||||
// Close line not already closed
|
// Close line not already closed
|
||||||
if ($contratline->statut != 5)
|
if ($contratline->statut != 5)
|
||||||
{
|
{
|
||||||
$contratline->date_cloture=mktime();
|
$contratline->date_cloture=dol_now();
|
||||||
$contratline->fk_user_cloture=$user->id;
|
$contratline->fk_user_cloture=$user->id;
|
||||||
$contratline->statut='5';
|
$contratline->statut='5';
|
||||||
$result=$contratline->update($user);
|
$result=$contratline->update($user);
|
||||||
@ -619,11 +619,13 @@ class Contrat extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Insert contract
|
// Insert contract
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,";
|
||||||
$sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,";
|
$sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,";
|
||||||
$sql.= " ref)";
|
$sql.= " ref)";
|
||||||
$sql.= " VALUES (".$this->db->idate(mktime()).",".$this->socid.",".$user->id;
|
$sql.= " VALUES (".$this->db->idate($now).",".$this->socid.",".$user->id;
|
||||||
$sql.= ",".$this->db->idate($this->date_contrat);
|
$sql.= ",".$this->db->idate($this->date_contrat);
|
||||||
$sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL");
|
$sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL");
|
||||||
$sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL");
|
$sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL");
|
||||||
|
|||||||
@ -1195,7 +1195,7 @@ else
|
|||||||
$dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
|
$dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$now=mktime();
|
$now=dol_now();
|
||||||
if ($dateactend > $now) $dateactend=$now;
|
if ($dateactend > $now) $dateactend=$now;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
print '<tr '.$bc[$var].'><td colspan="2">';
|
||||||
|
|||||||
@ -217,10 +217,11 @@ class Notify
|
|||||||
|
|
||||||
if ($mailfile->sendfile())
|
if ($mailfile->sendfile())
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
$sendto = htmlentities($sendto);
|
$sendto = htmlentities($sendto);
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_contact, objet_type, objet_id, email)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_contact, objet_type, objet_id, email)";
|
||||||
$sql.= " VALUES (".$this->db->idate(mktime()).", ".$actiondefid.", ".$obj->cid.", '".$objet_type."', ".$objet_id.", '".$this->db->escape($obj->email)."')";
|
$sql.= " VALUES (".$this->db->idate($now).", ".$actiondefid.", ".$obj->cid.", '".$objet_type."', ".$objet_id.", '".$this->db->escape($obj->email)."')";
|
||||||
dol_syslog("Notify::send sql=".$sql);
|
dol_syslog("Notify::send sql=".$sql);
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -145,7 +145,7 @@ function displayBox($selectedDate,$month,$year)
|
|||||||
//print "$selectedDate,$month,$year";
|
//print "$selectedDate,$month,$year";
|
||||||
$thedate=dol_mktime(12,0,0,$month,1,$year);
|
$thedate=dol_mktime(12,0,0,$month,1,$year);
|
||||||
//print "thedate=$thedate";
|
//print "thedate=$thedate";
|
||||||
$today=mktime();
|
$today=dol_now();
|
||||||
$todayArray=dol_getdate($today);
|
$todayArray=dol_getdate($today);
|
||||||
if($selectedDate != "00000000")
|
if($selectedDate != "00000000")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2190,7 +2190,8 @@ function dol_print_error_email()
|
|||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print '<br><div class="error">'.$langs->trans("ErrorContactEMail",$conf->global->MAIN_INFO_SOCIETE_MAIL,'ERRORNEWPAYMENT'.dol_print_date(mktime(),'%Y%m%d')).'</div>';
|
$now=dol_now();
|
||||||
|
print '<br><div class="error">'.$langs->trans("ErrorContactEMail",$conf->global->MAIN_INFO_SOCIETE_MAIL,'ERRORNEWPAYMENT'.dol_print_date($now,'%Y%m%d')).'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -410,7 +410,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
else $valueforccc=$objsoc->code_client;
|
else $valueforccc=$objsoc->code_client;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if ($date == '') $date=mktime(); // We use local year and month of PHP server to search numbers
|
if ($date == '') $date=dol_now(); // We use local year and month of PHP server to search numbers
|
||||||
// but we should use local year and month of user
|
// but we should use local year and month of user
|
||||||
|
|
||||||
// Extract value for mask counter, mask raz and mask offset
|
// Extract value for mask counter, mask raz and mask offset
|
||||||
|
|||||||
@ -143,6 +143,8 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
*/
|
*/
|
||||||
function add_to_target($mailing_id, $cibles)
|
function add_to_target($mailing_id, $cibles)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Insert emailing targest from array into database
|
// Insert emailing targest from array into database
|
||||||
@ -162,7 +164,10 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||||||
$sql .= "'".$this->db->escape($cibles[$i]['other'])."',";
|
$sql .= "'".$this->db->escape($cibles[$i]['other'])."',";
|
||||||
$sql .= "'".$this->db->escape($cibles[$i]['source_url'])."',";
|
$sql .= "'".$this->db->escape($cibles[$i]['source_url'])."',";
|
||||||
$sql .= "'".$this->db->escape($cibles[$i]['source_id'])."',";
|
$sql .= "'".$this->db->escape($cibles[$i]['source_id'])."',";
|
||||||
$sql .= "'".$this->db->escape(md5($cibles[$i]['email'].';'.$cibles[$i]['name'].';'.$mailing_id))."',";
|
if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1)
|
||||||
|
{
|
||||||
|
$sql .= "'".$this->db->escape(md5($cibles[$i]['email'].';'.$cibles[$i]['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',";
|
||||||
|
}
|
||||||
$sql .= "'".$this->db->escape($cibles[$i]['source_type'])."')";
|
$sql .= "'".$this->db->escape($cibles[$i]['source_type'])."')";
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -322,9 +322,11 @@ class Fichinter extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
|
||||||
$sql.= " SET fk_statut = 1";
|
$sql.= " SET fk_statut = 1";
|
||||||
$sql.= ", date_valid = ".$this->db->idate(mktime());
|
$sql.= ", date_valid = ".$this->db->idate($now);
|
||||||
$sql.= ", fk_user_valid = ".$user->id;
|
$sql.= ", fk_user_valid = ".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
|||||||
@ -1097,7 +1097,8 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Date intervention
|
// Date intervention
|
||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
$timearray=dol_getdate(mktime());
|
$now=dol_now();
|
||||||
|
$timearray=dol_getdate($now);
|
||||||
if (!GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
|
if (!GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
|
||||||
else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'),GETPOST('disec','int'),GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
|
else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'),GETPOST('disec','int'),GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
|
||||||
$form->select_date($timewithnohour,'di',1,1,0,"addinter");
|
$form->select_date($timewithnohour,'di',1,1,0,"addinter");
|
||||||
|
|||||||
@ -142,9 +142,11 @@ class PaiementFourn extends Paiement
|
|||||||
|
|
||||||
if ($this->total <> 0) // On accepte les montants negatifs
|
if ($this->total <> 0) // On accepte les montants negatifs
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn (';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn (';
|
||||||
$sql.= 'datec, datep, amount, fk_paiement, num_paiement, note, fk_user_author, fk_bank)';
|
$sql.= 'datec, datep, amount, fk_paiement, num_paiement, note, fk_user_author, fk_bank)';
|
||||||
$sql.= ' VALUES ('.$this->db->idate(mktime()).',';
|
$sql.= ' VALUES ('.$this->db->idate($now).',';
|
||||||
$sql.= " ".$this->db->idate($this->datepaye).", '".$this->total."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.", 0)";
|
$sql.= " ".$this->db->idate($this->datepaye).", '".$this->total."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.", 0)";
|
||||||
|
|
||||||
dol_syslog("PaiementFourn::create sql=".$sql);
|
dol_syslog("PaiementFourn::create sql=".$sql);
|
||||||
|
|||||||
@ -77,6 +77,7 @@ CheckRead=Read Receipt
|
|||||||
YourMailUnsubcribeOK=The email <b>%s</b> is correctly unsubcribe from mailing list
|
YourMailUnsubcribeOK=The email <b>%s</b> is correctly unsubcribe from mailing list
|
||||||
MailtoEMail=Hyper link to email
|
MailtoEMail=Hyper link to email
|
||||||
ActivateCheckRead=Activate Read receipt and unsubcribe tag
|
ActivateCheckRead=Activate Read receipt and unsubcribe tag
|
||||||
|
ActivateCheckReadKey=Key use to encrypt URL use for Read Receipt and unsubcribe function
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
|
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
|
||||||
|
|||||||
@ -85,6 +85,10 @@ TaskIsNotAffectedToYou=Task not allocated to you
|
|||||||
ErrorTimeSpentIsEmpty=Time spent is empty
|
ErrorTimeSpentIsEmpty=Time spent is empty
|
||||||
ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (<b>%s</b> tasks at the moment) and all inputs of time spent.
|
ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (<b>%s</b> tasks at the moment) and all inputs of time spent.
|
||||||
IfNeedToUseOhterObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties.
|
IfNeedToUseOhterObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties.
|
||||||
|
CloneProject=Clone project (associated task will be duplicated too)
|
||||||
|
ConfirmCloneProject=Are you sure to clone this project ?
|
||||||
|
ProjectReportDate=Change task date according project start date
|
||||||
|
ErrorShiftTaskDate=Impossible to shift task date according to new project start date
|
||||||
##### Types de contacts #####
|
##### Types de contacts #####
|
||||||
TypeContact_project_internal_PROJECTLEADER=Project leader
|
TypeContact_project_internal_PROJECTLEADER=Project leader
|
||||||
TypeContact_project_external_PROJECTLEADER=Project leader
|
TypeContact_project_external_PROJECTLEADER=Project leader
|
||||||
|
|||||||
@ -77,6 +77,7 @@ CheckRead=Accusé de lecture
|
|||||||
YourMailUnsubcribeOK=L'adresse e-mail <b>%s</b> est bien désincrite de la liste.
|
YourMailUnsubcribeOK=L'adresse e-mail <b>%s</b> est bien désincrite de la liste.
|
||||||
MailtoEMail=Ecrire a e-mail (lien)
|
MailtoEMail=Ecrire a e-mail (lien)
|
||||||
ActivateCheckRead=Activer les tags d'accusé de lecture et de désincription
|
ActivateCheckRead=Activer les tags d'accusé de lecture et de désincription
|
||||||
|
ActivateCheckReadKey=Clef de sécurité utilisée pour l'encryption des URL utilisées dans les fonctions d'accusé de lecture et de désincription
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
MailingModuleDescContactCompanies=Contacts de tiers (prospects, clients, fournisseurs...)
|
MailingModuleDescContactCompanies=Contacts de tiers (prospects, clients, fournisseurs...)
|
||||||
|
|||||||
@ -85,6 +85,10 @@ TaskIsNotAffectedToYou=Tâche qui ne vous est pas affectée
|
|||||||
ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné
|
ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné
|
||||||
ThisWillAlsoRemoveTasks=Cette opération détruira également les tâches du projet (<b>%s</b> tâches actuellement) et le suivi des consommés.
|
ThisWillAlsoRemoveTasks=Cette opération détruira également les tâches du projet (<b>%s</b> tâches actuellement) et le suivi des consommés.
|
||||||
IfNeedToUseOhterObjectKeepEmpty=Si des objets (facture, commande, ...), appartenant à un autre tiers que celui choisi, doivent être liés au projet à créer, laisser vide afin de laisser le projet multi-tiers.
|
IfNeedToUseOhterObjectKeepEmpty=Si des objets (facture, commande, ...), appartenant à un autre tiers que celui choisi, doivent être liés au projet à créer, laisser vide afin de laisser le projet multi-tiers.
|
||||||
|
CloneProject=Cloner le projet (les taches associées sont dupliquées également)
|
||||||
|
ConfirmCloneProject=Êtes-vous sûr de vouloir cloner ce projet ?
|
||||||
|
ProjectReportDate=Reporter les dates des taches en fonction de la date de départ.
|
||||||
|
ErrorShiftTaskDate=Une erreur c'est produite dans le report des dates des taches.
|
||||||
##### Types de contacts #####
|
##### Types de contacts #####
|
||||||
TypeContact_project_internal_PROJECTLEADER=Chef de projet
|
TypeContact_project_internal_PROJECTLEADER=Chef de projet
|
||||||
TypeContact_project_external_PROJECTLEADER=Chef de projet
|
TypeContact_project_external_PROJECTLEADER=Chef de projet
|
||||||
|
|||||||
@ -346,6 +346,8 @@ class Livraison extends CommonObject
|
|||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/livraison/'.$modName.'.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/modules/livraison/'.$modName.'.php';
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Recuperation de la nouvelle reference
|
// Recuperation de la nouvelle reference
|
||||||
$objMod = new $modName($this->db);
|
$objMod = new $modName($this->db);
|
||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
@ -379,7 +381,7 @@ class Livraison extends CommonObject
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."livraison SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."livraison SET";
|
||||||
$sql.= " ref='".$this->db->escape($this->ref)."'";
|
$sql.= " ref='".$this->db->escape($this->ref)."'";
|
||||||
$sql.= ", fk_statut = 1";
|
$sql.= ", fk_statut = 1";
|
||||||
$sql.= ", date_valid = ".$this->db->idate(mktime());
|
$sql.= ", date_valid = ".$this->db->idate($now);
|
||||||
$sql.= ", fk_user_valid = ".$user->id;
|
$sql.= ", fk_user_valid = ".$user->id;
|
||||||
$sql.= " WHERE rowid = ".$this->id;
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
$sql.= " AND fk_statut = 0";
|
$sql.= " AND fk_statut = 0";
|
||||||
|
|||||||
@ -1898,10 +1898,12 @@ class Product extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// les fournisseurs
|
// les fournisseurs
|
||||||
/*$sql = "INSERT ".MAIN_DB_PREFIX."product_fournisseur ("
|
/*$sql = "INSERT ".MAIN_DB_PREFIX."product_fournisseur ("
|
||||||
. " datec, fk_product, fk_soc, ref_fourn, fk_user_author )"
|
. " datec, fk_product, fk_soc, ref_fourn, fk_user_author )"
|
||||||
. " SELECT '".$this->db->idate(mktime())."', ".$toId.", fk_soc, ref_fourn, fk_user_author"
|
. " SELECT '".$this->db->idate($now)."', ".$toId.", fk_soc, ref_fourn, fk_user_author"
|
||||||
. " FROM ".MAIN_DB_PREFIX."product_fournisseur"
|
. " FROM ".MAIN_DB_PREFIX."product_fournisseur"
|
||||||
. " WHERE fk_product = ".$fromId;
|
. " WHERE fk_product = ".$fromId;
|
||||||
|
|
||||||
@ -1914,7 +1916,7 @@ class Product extends CommonObject
|
|||||||
// les prix de fournisseurs.
|
// les prix de fournisseurs.
|
||||||
$sql = "INSERT ".MAIN_DB_PREFIX."product_fournisseur_price (";
|
$sql = "INSERT ".MAIN_DB_PREFIX."product_fournisseur_price (";
|
||||||
$sql.= " datec, fk_product, fk_soc, price, quantity, fk_user)";
|
$sql.= " datec, fk_product, fk_soc, price, quantity, fk_user)";
|
||||||
$sql.= " SELECT '".$this->db->idate(mktime())."', ".$toId. ", fk_soc, price, quantity, fk_user";
|
$sql.= " SELECT '".$this->db->idate($now)."', ".$toId. ", fk_soc, price, quantity, fk_user";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
|
||||||
$sql.= " WHERE fk_product = ".$fromId;
|
$sql.= " WHERE fk_product = ".$fromId;
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class Project extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $DB Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
@ -707,7 +707,7 @@ class Project extends CommonObject
|
|||||||
{
|
{
|
||||||
global $user, $langs, $conf;
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
$now = dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// Charge tableau des produits prodids
|
// Charge tableau des produits prodids
|
||||||
$prodids = array();
|
$prodids = array();
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class Task extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $DB Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
@ -305,6 +305,7 @@ class Task extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function delete($user, $notrigger=0)
|
function delete($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -955,7 +956,9 @@ class Task extends CommonObject
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$now = dol_mktime(0,0,0,idate('m',mktime()),idate('d',mktime()),idate('Y',mktime()));
|
$now=dol_now();
|
||||||
|
|
||||||
|
$datec = dol_mktime(0,0,0,idate('m',$now),idate('d',$now),idate('Y',$now));
|
||||||
|
|
||||||
$clone_task=new Task($this->db);
|
$clone_task=new Task($this->db);
|
||||||
|
|
||||||
@ -969,7 +972,7 @@ class Task extends CommonObject
|
|||||||
$clone_task->id = 0;
|
$clone_task->id = 0;
|
||||||
$clone_task->fk_project = $project_id;
|
$clone_task->fk_project = $project_id;
|
||||||
$clone_task->fk_task_parent = $parent_task_id;
|
$clone_task->fk_task_parent = $parent_task_id;
|
||||||
$clone_task->date_c = $now;
|
$clone_task->date_c = $datec;
|
||||||
|
|
||||||
//Manage Task Date
|
//Manage Task Date
|
||||||
if ($clone_change_dt)
|
if ($clone_change_dt)
|
||||||
|
|||||||
@ -246,6 +246,7 @@ if ($action == 'builddoc' && $user->rights->projet->creer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'confirm_validate' && GETPOST('confirm') == 'yes')
|
if ($action == 'confirm_validate' && GETPOST('confirm') == 'yes')
|
||||||
{
|
{
|
||||||
$project = new Project($db);
|
$project = new Project($db);
|
||||||
@ -315,6 +316,24 @@ if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confirm') == 'yes')
|
||||||
|
{
|
||||||
|
$idtoclone=$id;
|
||||||
|
$project = new Project($db);
|
||||||
|
$project->fetch($idtoclone);
|
||||||
|
$result=$project->createFromClone($idtoclone,true,true,true,true);
|
||||||
|
if ($result <= 0)
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$project->error.'</div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$id=$result;
|
||||||
|
$action='edit';
|
||||||
|
$comefromclone=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -459,6 +478,7 @@ else
|
|||||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$project->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1);
|
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$project->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1);
|
||||||
if ($ret == 'html') print '<br>';
|
if ($ret == 'html') print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone confirmation
|
// Clone confirmation
|
||||||
if ($action == 'clone')
|
if ($action == 'clone')
|
||||||
{
|
{
|
||||||
@ -486,9 +506,7 @@ else
|
|||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||||
$text=$form->select_company($project->societe->id,'socid','',1,1);
|
print $form->select_company($project->societe->id,'socid','',1,1);
|
||||||
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
|
|
||||||
print $form->textwithtooltip($text.' '.img_help(),$texthelp,1);
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
|
|||||||
@ -125,7 +125,6 @@ if (! empty($project_ref) && ! empty($withproject))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find upload dir after retreive is task if necessary
|
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
if ($object->fetch($id,$ref) > 0)
|
if ($object->fetch($id,$ref) > 0)
|
||||||
@ -141,7 +140,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -85,8 +85,10 @@ class Address
|
|||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_address (label, fk_soc, name, datec, fk_user_creat) ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_address (label, fk_soc, name, datec, fk_user_creat) ";
|
||||||
$sql .= " VALUES ('".$this->db->escape($this->label)."', '".$socid."', '".$this->db->escape($this->name)."', ".$this->db->idate(mktime()).", '".$user->id."')";
|
$sql .= " VALUES ('".$this->db->escape($this->label)."', '".$socid."', '".$this->db->escape($this->name)."', ".$this->db->idate($now).", '".$user->id."')";
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -1001,6 +1001,8 @@ class Societe extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
// Positionne remise courante
|
// Positionne remise courante
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
||||||
$sql.= " SET remise_client = '".$remise."'";
|
$sql.= " SET remise_client = '".$remise."'";
|
||||||
@ -1016,7 +1018,7 @@ class Societe extends CommonObject
|
|||||||
// Ecrit trace dans historique des remises
|
// Ecrit trace dans historique des remises
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise ";
|
||||||
$sql.= " (datec, fk_soc, remise_client, note, fk_user_author)";
|
$sql.= " (datec, fk_soc, remise_client, note, fk_user_author)";
|
||||||
$sql.= " VALUES (".$this->db->idate(mktime()).", ".$this->id.", '".$remise."',";
|
$sql.= " VALUES (".$this->db->idate($now).", ".$this->id.", '".$remise."',";
|
||||||
$sql.= " '".$this->db->escape($note)."',";
|
$sql.= " '".$this->db->escape($note)."',";
|
||||||
$sql.= " ".$user->id;
|
$sql.= " ".$user->id;
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user