Merge branch '3.4' of https://github.com/Dolibarr/dolibarr.git into 3.4
Conflicts: ChangeLog Change-Id: I90f7ee62c65ef449c8ca43857d9743d0d953cf4b
This commit is contained in:
commit
11efc20755
@ -1,6 +1,7 @@
|
||||
--------------------------------------------------------------
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||
Fix: field's problem into company's page (RIB)
|
||||
Fix: Document cerfa doesn't contained firstname & lastname from donator
|
||||
@ -13,7 +14,11 @@ Fix: [ bug #1145 ] Agenda button list type do not display
|
||||
Fix: [ bug #1148 ] Product consomation : supplier order bad status
|
||||
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
|
||||
Fix: [ bug #1174 ] Product translated description not good into PDF
|
||||
|
||||
Fix: [ bug #1163 ] SQL Error when searching for supplier orders
|
||||
Fix: [ bug #1162 ] Translaction for morning and afternoon
|
||||
Fix: [ bug #1161 ] Search on product label
|
||||
Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode.
|
||||
Fix: [ bug #1171 ] Documents lost in interventions after validating
|
||||
|
||||
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
||||
Fix: Display buying price on line edit when no supplier price is defined
|
||||
@ -44,7 +49,6 @@ Fix: there was no escaping on filter fields in supplier product list
|
||||
Fix: bugs on margin reports and better margin calculation on credit notes
|
||||
Qual: Add travis-ci integration
|
||||
|
||||
|
||||
***** ChangeLog for 3.4 compared to 3.3.* *****
|
||||
For users:
|
||||
- New: Can use ODS templates as document templates.
|
||||
|
||||
@ -59,6 +59,14 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
|
||||
|
||||
$SOURCE="$DIR/..";
|
||||
$DESTI="$SOURCE/build";
|
||||
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
||||
{
|
||||
print "Error: Missing environment variables.\n";
|
||||
print "You must define the environment variable DESTIBETARC and DESTISTABLE to point to the\ndirectories where you want to save the generated packages.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Detect OS type
|
||||
# --------------
|
||||
@ -66,7 +74,7 @@ if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='
|
||||
elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; }
|
||||
elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; }
|
||||
if (! $OS) {
|
||||
print "$PROG.$Extension was not able to detect your OS.\n";
|
||||
print "Error: Can't detect your OS.\n";
|
||||
print "Can't continue.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
@ -105,8 +113,8 @@ for (0..@ARGV-1) {
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
|
||||
|
||||
|
||||
print "Makepack version $VERSION\n";
|
||||
|
||||
@ -212,7 +212,7 @@ switch ($action)
|
||||
$resultcreate=$invoice->create($user,0,dol_stringtotime($obj_facturation->paiementLe()));
|
||||
if ($resultcreate > 0)
|
||||
{
|
||||
$resultvalid=$invoice->validate($user,$obj_facturation->numInvoice());
|
||||
$resultvalid=$invoice->validate($user, $obj_facturation->numInvoice(), (isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -51,7 +51,9 @@ if (isset($action) && ! empty($action))
|
||||
require DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php';
|
||||
|
||||
$ecmdirstatic = new EcmDirectory($db);
|
||||
$ecmdirtmp = new EcmDirectory($db);
|
||||
|
||||
// This part of code is same than into file index.php for action refreshmanual TODO Remove duplicate
|
||||
clearstatcache();
|
||||
|
||||
$diroutputslash=str_replace('\\', '/', $conf->$element->dir_output);
|
||||
@ -129,7 +131,6 @@ if (isset($action) && ! empty($action))
|
||||
|
||||
if ($fk_parent >= 0)
|
||||
{
|
||||
$ecmdirtmp=new EcmDirectory($db);
|
||||
$ecmdirtmp->ref = 'NOTUSEDYET';
|
||||
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
|
||||
$ecmdirtmp->description = '';
|
||||
@ -163,7 +164,21 @@ if (isset($action) && ! empty($action))
|
||||
}
|
||||
}
|
||||
|
||||
// Loop now on each sql tree to check if dir exists
|
||||
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
|
||||
{
|
||||
$dirtotest=$conf->$element->dir_output.'/'.$dirdesc['fullrelativename'];
|
||||
if (! dol_is_dir($dirtotest))
|
||||
{
|
||||
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
||||
$ecmdirtmp->id=$dirdesc['id'];
|
||||
$ecmdirtmp->delete($user,'databaseonly');
|
||||
//exit;
|
||||
}
|
||||
}
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
||||
dol_syslog("sql = ".$sql);
|
||||
$db->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ class EcmDirectory // extends CommonObject
|
||||
$dir=$conf->ecm->dir_output.'/'.$this->getRelativePath();
|
||||
$result=dol_mkdir($dir);
|
||||
if ($result < 0) { $error++; $this->error="ErrorFailedToCreateDir"; }
|
||||
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
@ -317,21 +317,23 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Delete object on database and on disk
|
||||
* Delete object on database and/or on disk
|
||||
*
|
||||
* @param User $user User that delete
|
||||
* @param int $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user)
|
||||
function delete($user, $mode='all')
|
||||
{
|
||||
global $conf, $langs;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$error=0;
|
||||
$result=0;
|
||||
|
||||
$relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3
|
||||
if ($mode != 'databaseonly') $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3
|
||||
|
||||
dol_syslog(get_class($this)."::delete remove directory ".$relativepath);
|
||||
dol_syslog(get_class($this)."::delete remove directory id=".$this->id." mode=".$mode.(($mode == 'databaseonly')?'':' relativepath='.$relativepath));
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -348,8 +350,11 @@ class EcmDirectory // extends CommonObject
|
||||
return -2;
|
||||
}
|
||||
|
||||
$file = $conf->ecm->dir_output . "/" . $relativepath;
|
||||
$result=@dol_delete_dir($file);
|
||||
if ($mode != 'databaseonly')
|
||||
{
|
||||
$file = $conf->ecm->dir_output . "/" . $relativepath;
|
||||
$result=@dol_delete_dir($file);
|
||||
}
|
||||
|
||||
if ($result || ! @is_dir(dol_osencode($file)))
|
||||
{
|
||||
|
||||
@ -201,7 +201,10 @@ if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
|
||||
// Refresh directory view
|
||||
if ($action == 'refreshmanual')
|
||||
{
|
||||
clearstatcache();
|
||||
$ecmdirtmp = new EcmDirectory($db);
|
||||
|
||||
// This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
|
||||
clearstatcache();
|
||||
|
||||
$diroutputslash=str_replace('\\','/',$conf->ecm->dir_output);
|
||||
$diroutputslash.='/';
|
||||
@ -264,7 +267,7 @@ if ($action == 'refreshmanual')
|
||||
//break; // We found parent, we can stop the while loop
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
dol_syslog("No");
|
||||
//print "No<br>\n";
|
||||
}
|
||||
@ -277,7 +280,6 @@ if ($action == 'refreshmanual')
|
||||
|
||||
if ($fk_parent >= 0)
|
||||
{
|
||||
$ecmdirtmp=new EcmDirectory($db);
|
||||
$ecmdirtmp->ref = 'NOTUSEDYET';
|
||||
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
|
||||
$ecmdirtmp->description = '';
|
||||
@ -311,6 +313,19 @@ if ($action == 'refreshmanual')
|
||||
}
|
||||
}
|
||||
|
||||
// Loop now on each sql tree to check if dir exists
|
||||
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
|
||||
{
|
||||
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
|
||||
if (! dol_is_dir($dirtotest))
|
||||
{
|
||||
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
||||
$ecmdirtmp->id=$dirdesc['id'];
|
||||
$ecmdirtmp->delete($user,'databaseonly');
|
||||
//exit;
|
||||
}
|
||||
}
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
||||
dol_syslog("sql = ".$sql);
|
||||
$db->query($sql);
|
||||
|
||||
@ -39,7 +39,15 @@ $(document).ready( function() {
|
||||
);
|
||||
|
||||
$('#refreshbutton').click( function() {
|
||||
ecmBuildDatabase();
|
||||
$.pleaseBePatient("<?php echo $langs->trans('PleaseBePatient'); ?>");
|
||||
$.getJSON( "<?php echo DOL_URL_ROOT . '/ecm/ajax/ecmdatabase.php'; ?>", {
|
||||
action: "build",
|
||||
element: "ecm"
|
||||
},
|
||||
function(response) {
|
||||
$.unblockUI();
|
||||
location.href="<?php echo $_SERVER['PHP_SELF']; ?>";
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -67,16 +75,5 @@ function loadandshowpreview(filedirname,section)
|
||||
});
|
||||
}
|
||||
|
||||
ecmBuildDatabase = function() {
|
||||
$.pleaseBePatient("<?php echo $langs->trans('PleaseBePatient'); ?>");
|
||||
$.getJSON( "<?php echo DOL_URL_ROOT . '/ecm/ajax/ecmdatabase.php'; ?>", {
|
||||
action: "build",
|
||||
element: "ecm"
|
||||
},
|
||||
function(response) {
|
||||
$.unblockUI();
|
||||
location.href="<?php echo $_SERVER['PHP_SELF']; ?>";
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<!-- END PHP TEMPLATE FOR JQUERY -->
|
||||
@ -368,6 +368,7 @@ class Fichinter extends CommonObject
|
||||
function setValid($user)
|
||||
{
|
||||
global $langs, $conf;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -390,7 +391,7 @@ class Fichinter extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
|
||||
$sql.= " SET fk_statut = 1";
|
||||
$sql.= ", ref = '".$num."'";
|
||||
$sql.= ", date_valid = ".$this->db->idate($now);
|
||||
$sql.= ", date_valid = '".$this->db->idate($now)."'";
|
||||
$sql.= ", fk_user_valid = ".$user->id;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@ -398,7 +399,52 @@ class Fichinter extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::setValid sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
if (! $resql)
|
||||
{
|
||||
dol_syslog(get_class($this)."::setValid Echec update - 10 - sql=".$sql, LOG_ERR);
|
||||
dol_print_error($this->db);
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->oldref = '';
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
// Rename of object directory ($this->ref = old ref, $num = new ref)
|
||||
// to not lose the linked files
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
$snum = dol_sanitizeFileName($num);
|
||||
$dirsource = $conf->ficheinter->dir_output.'/'.$oldref;
|
||||
$dirdest = $conf->ficheinter->dir_output.'/'.$snum;
|
||||
if (file_exists($dirsource))
|
||||
{
|
||||
dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest);
|
||||
|
||||
if (@rename($dirsource, $dirdest))
|
||||
{
|
||||
$this->oldref = $oldref;
|
||||
|
||||
dol_syslog("Rename ok");
|
||||
// Suppression ancien fichier PDF dans nouveau rep
|
||||
dol_delete_file($conf->ficheinter->dir_output.'/'.$snum.'/'.$oldref.'*.*');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set new ref and define current statut
|
||||
if (! $error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->statut=1;
|
||||
$this->brouillon=0;
|
||||
$this->date_validation=$now;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
@ -408,24 +454,16 @@ class Fichinter extends CommonObject
|
||||
$error++; $this->errors=$interface->errors;
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=join(',',$this->errors);
|
||||
dol_syslog(get_class($this)."::setValid ".$this->error,LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::setValid ".$this->error,LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -105,16 +105,17 @@ if ($sttc)
|
||||
}
|
||||
if ($sall)
|
||||
{
|
||||
$sql.= " AND (cf.ref LIKE '%".$db->escape($sall)."%' OR cf.note LIKE '%".$db->escape($sall)."%')";
|
||||
$sql.= " AND (cf.ref LIKE '%".$db->escape($sall)."%' OR cf.note_private LIKE '%".$db->escape($sall)."%' OR cf.note_public LIKE '%".$db->escape($sall)."%')";
|
||||
}
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
|
||||
if (GETPOST('statut'))
|
||||
{
|
||||
$sql .= " AND fk_statut =".GETPOST('statut');
|
||||
$sql .= " AND fk_statut =".GETPOST('statut','int');
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -256,6 +256,8 @@ Seconds=Seconds
|
||||
Today=Today
|
||||
Yesterday=Yesterday
|
||||
Tomorrow=Tomorrow
|
||||
Morning=Morning
|
||||
Afternoon=Afternoon
|
||||
Quadri=Quadri
|
||||
MonthOfDay=Month of the day
|
||||
HourShort=H
|
||||
|
||||
@ -252,6 +252,8 @@ Seconds=Secondes
|
||||
Today=Aujourd'hui
|
||||
Yesterday=Hier
|
||||
Tomorrow=Demain
|
||||
Morning=Matin
|
||||
Afternoon=Après-midi
|
||||
Quadri=Trimestre
|
||||
MonthOfDay=Mois du jour
|
||||
HourShort=H
|
||||
|
||||
@ -214,6 +214,7 @@ if ($month > 0) {
|
||||
$sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
|
||||
}
|
||||
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'";
|
||||
if ($sprod_fulldescr) $sql.= " AND (d.description LIKE '%".$sprod_fulldescr."%' OR p.label LIKE '%".$sprod_fulldescr."%')";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1, $offset);
|
||||
|
||||
@ -249,7 +250,7 @@ print $formother->select_month($month?$month:-1,'month',1);
|
||||
$formother->select_year($year?$year:-1,'year',1, 20, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.$sprod_fulldescr.'">';
|
||||
print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user