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

Conflicts:
	htdocs/fourn/commande/index.php
	htdocs/takepos/takepos.php
This commit is contained in:
Laurent Destailleur 2020-03-23 15:38:10 +01:00
commit 01e60562b9
5 changed files with 86 additions and 79 deletions

View File

@ -2,7 +2,7 @@
#----------------------------------------------------------------------------
# \file build/makepack-dolibarr.pl
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
# \author (c)2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
# \author (c)2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
#
# This is list of constant you can set to have generated packages moved into a specific dir:
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
@ -430,12 +430,14 @@ if ($nboftargetok) {
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
print 'Run git push -f --tags'."\n";
$ret=`git push -f --tags`;
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
}
}
else
{
print 'Run git push --tags'."\n";
$ret=`git push --tags`;
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
}
chdir("$olddir");
}

View File

@ -992,7 +992,7 @@ else
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&amp;id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
}
if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer)
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer)
{
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING))
{

View File

@ -1318,6 +1318,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$sortfield_new = implode(',', $sortfield_new_list);
$sql = '';
if (!empty($conf->agenda->enabled))
{
// Recherche histo sur actioncomm
@ -1469,85 +1471,88 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
//TODO Add limit in nb of results
$sql .= $db->order($sortfield_new, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
if ($sql)
{
$i = 0;
$num = $db->num_rows($resql);
$sql .= $db->order($sortfield_new, $sortorder);
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$i = 0;
$num = $db->num_rows($resql);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($obj->type == 'action') {
$contactaction = new ActionComm($db);
$contactaction->id = $obj->id;
$result = $contactaction->fetchResources();
if ($result < 0) {
dol_print_error($db);
setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors');
}
if ($obj->type == 'action') {
$contactaction = new ActionComm($db);
$contactaction->id = $obj->id;
$result = $contactaction->fetchResources();
if ($result < 0) {
dol_print_error($db);
setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors');
}
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$tododone = '';
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo';
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$tododone = '';
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo';
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>$tododone,
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>$tododone,
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo,
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo,
'contact_id'=>$obj->fk_contact,
'socpeopleassigned' => $contactaction->socpeopleassigned,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'fk_element'=>$obj->fk_element,
'elementtype'=>$obj->elementtype,
// Type of event
'acode'=>$obj->acode,
'alabel'=>$obj->alabel,
'libelle'=>$obj->alabel, // deprecated
'apicto'=>$obj->apicto
);
} else {
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>'done',
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'acode'=>$obj->acode,
'contact_id'=>$obj->fk_contact,
'socpeopleassigned' => $contactaction->socpeopleassigned,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'fk_element'=>$obj->fk_element,
'elementtype'=>$obj->elementtype,
// Type of event
'acode'=>$obj->acode,
'alabel'=>$obj->alabel,
'libelle'=>$obj->alabel, // deprecated
'apicto'=>$obj->apicto
);
} else {
$histo[$numaction] = array(
'type'=>$obj->type,
'tododone'=>'done',
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'acode'=>$obj->acode,
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo
);
}
'userid'=>$obj->user_id,
'login'=>$obj->user_login,
'userfirstname'=>$obj->user_firstname,
'userlastname'=>$obj->user_lastname,
'userphoto'=>$obj->user_photo
);
}
$numaction++;
$i++;
}
}
else
{
dol_print_error($db);
$numaction++;
$i++;
}
}
else
{
dol_print_error($db);
}
}
if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email)))
@ -1782,9 +1787,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$out .= "</table>\n";
$out .= "</div>\n";
}
$out .= '</form>';
$out .= '</form>';
}
if ($noprint) return $out;
else print $out;

View File

@ -81,7 +81,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE cf.fk_soc = s.rowid";
$sql .= " AND cf.entity = ".$conf->entity;
$sql .= " AND cf.entity IN (".getEntity('supplier_order').")";
if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " GROUP BY cf.fk_statut";
@ -267,7 +267,7 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_T
}
else
{
$sql .= " WHERE (u.entity IN (".getEntity('user').")";
$sql .= " WHERE (u.entity IN (".getEntity('user')."))";
}
$sql .= " AND u.fk_soc IS NULL"; // An external user can not approved

View File

@ -5115,7 +5115,7 @@ function migrate_members_socialnetworks()
$obj->socialnetworks = '[]';
}
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'adherent SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX."adherent SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'";
$sqlupd.= ', skype=null';
$sqlupd.= ', twitter=null';
$sqlupd.= ', facebook=null';
@ -5209,7 +5209,7 @@ function migrate_contacts_socialnetworks()
$obj->socialnetworks = '[]';
}
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'socpeople SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX."socpeople SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'";
$sqlupd.= ', jabberid=null';
$sqlupd.= ', skype=null';
$sqlupd.= ', twitter=null';
@ -5300,7 +5300,7 @@ function migrate_thirdparties_socialnetworks()
$obj->socialnetworks = '[]';
}
$socialnetworks = array_merge($arraysocialnetworks, json_decode($obj->socialnetworks, true));
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX.'societe SET socialnetworks="'.$db->escape(json_encode($socialnetworks, true)).'"';
$sqlupd = 'UPDATE '.MAIN_DB_PREFIX."societe SET socialnetworks='".$db->escape(json_encode($socialnetworks, true))."'";
$sqlupd.= ', skype=null';
$sqlupd.= ', twitter=null';
$sqlupd.= ', facebook=null';