Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7
This commit is contained in:
commit
36de50f60d
@ -149,7 +149,7 @@ if ($action == 'add')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$datep=dol_mktime($fulldayevent?'00':GETPOST("aphour"), $fulldayevent?'00':GETPOST("apmin"), 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
|
$datep=dol_mktime($fulldayevent?'00':GETPOST("aphour"), $fulldayevent?'00':GETPOST("apmin"), 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
|
||||||
|
|||||||
@ -554,7 +554,15 @@ if (! empty($id) && $action != 'edit')
|
|||||||
|
|
||||||
if ($user->rights->don->supprimer)
|
if ($user->rights->don->supprimer)
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
|
if ($don->statut == -1 || $don->statut == 0)
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="inline-block divButAction"><a class="butActionDelete butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -449,10 +449,11 @@ class Don extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function delete($rowid)
|
function delete($rowid)
|
||||||
{
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0 OR fk_statut = -1";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@ -628,6 +628,13 @@ class Contact extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Retreive all extrafield for contact
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
|
||||||
|
$extrafields=new ExtraFields($this->db);
|
||||||
|
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
|
||||||
|
$this->fetch_optionals($this->id,$extralabels);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -190,7 +190,7 @@ if ($resql)
|
|||||||
$texte.=' ('.$langs->trans("Stocks").')';
|
$texte.=' ('.$langs->trans("Stocks").')';
|
||||||
|
|
||||||
|
|
||||||
llxHeader("",$title,$helpurl,$texte);
|
llxHeader("",$texte,$helpurl);
|
||||||
|
|
||||||
if ($sref || $snom || $sall || GETPOST('search'))
|
if ($sref || $snom || $sall || GETPOST('search'))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -195,7 +195,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$action = ($action=='add'?'create':'edit');
|
||||||
|
}
|
||||||
|
|
||||||
if (GETPOST('deletephoto')) $object->logo = '';
|
if (GETPOST('deletephoto')) $object->logo = '';
|
||||||
else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user