Qual: Reduce number of methods. Mutualize update_note code.
This commit is contained in:
parent
20e9eb5f8f
commit
b496436fe3
@ -54,7 +54,7 @@ if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$res=$object->update_note($_POST["note"],$user);
|
||||
$res=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
|
||||
if ($res < 0)
|
||||
{
|
||||
setEventMessage($object->error, 'errors');
|
||||
|
||||
@ -146,7 +146,7 @@ if ($action == 'commentaire' && $user->rights->adherent->configurer)
|
||||
{
|
||||
$don = new Don($db);
|
||||
$don->fetch($rowid);
|
||||
$don->update_note($_POST["commentaire"]);
|
||||
$don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -477,7 +477,7 @@ class Categorie
|
||||
|
||||
|
||||
/**
|
||||
* Retourne les filles de la categorie
|
||||
* Return childs of a category
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -507,43 +507,6 @@ class Categorie
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return category description
|
||||
*
|
||||
* @param int $cate Category id
|
||||
* @return string Description
|
||||
* @deprecated function not used ?
|
||||
*/
|
||||
function get_desc($cate)
|
||||
{
|
||||
$sql = "SELECT description FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " WHERE rowid = ".$cate;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
$n = $this->db->fetch_array($res);
|
||||
|
||||
return($n[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* La categorie $fille est-elle une fille de cette categorie ?
|
||||
*
|
||||
* @param Category $child Object category
|
||||
* @return void
|
||||
* @deprecated function not used ?
|
||||
*/
|
||||
function is_fille($child)
|
||||
{
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " WHERE fk_parent = ".$this->id." AND rowid = ".$child->id;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
$n = $this->db->fetch_array($res);
|
||||
|
||||
return ($n[0] > 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load this->motherof that is array(id_son=>id_parent, ...)
|
||||
*
|
||||
|
||||
@ -234,13 +234,13 @@ else if ($action == 'set_ref_client' && $user->rights->propal->creer)
|
||||
|
||||
else if ($action == 'setnote_public' && $user->rights->propal->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->propal->creer)
|
||||
{
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -51,14 +51,14 @@ $object = new Propal($db);
|
||||
if ($action == 'setnote_public' && $user->rights->propale->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->propale->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -535,7 +535,7 @@ else if ($action == 'setremiseabsolue' && $user->rights->commande->creer)
|
||||
|
||||
else if ($action == 'setnote_public' && $user->rights->commande->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -58,14 +58,14 @@ if (! $object->fetch($id, $ref) > 0)
|
||||
if ($action == 'setnote_public' && $user->rights->commande->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->commande->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -235,13 +235,13 @@ else if ($action == 'setkm' && $user->rights->deplacement->creer)
|
||||
else if ($action == 'setnote_public' && $user->rights->deplacement->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db, $object->error);
|
||||
}
|
||||
else if ($action == 'setnote_private' && $user->rights->deplacement->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db, $object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -353,14 +353,14 @@ else if ($action == 'set_ref_client' && $user->rights->facture->creer)
|
||||
else if ($action == 'setnote_public' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -53,14 +53,14 @@ $object->fetch($id);
|
||||
if ($action == 'setnote_public' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -658,13 +658,13 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
|
||||
|
||||
else if ($action == 'setnote_public' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -50,13 +50,13 @@ $object->fetch($id,$ref);
|
||||
|
||||
if ($action == 'setnote_public' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_public')), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_public')), ENT_QUOTES),'_pubic');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->contrat->creer)
|
||||
{
|
||||
$result=$object->update_note_private(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_private')), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_private')), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -1400,44 +1400,13 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Update private note of element
|
||||
* Update note of element
|
||||
*
|
||||
* @param string $note_private New value for note
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param string $note New value for note
|
||||
* @param string $suffix '', '_public' or '_private'
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_note_private($note_private)
|
||||
{
|
||||
if (! $this->table_element)
|
||||
{
|
||||
dol_syslog(get_class($this)."::update_note_private was called on objet with property table_element not defined", LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET note_private = ".(!empty($note_private)?("'".$this->db->escape($note_private)."'"):"NULL");
|
||||
$sql.= " WHERE rowid =". $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update_note_private sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$this->note_private = $note_private;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog(get_class($this)."::update_note_private error=".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update private note of element
|
||||
*
|
||||
* @param string $note New value for note
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_note($note)
|
||||
function update_note($note,$suffix='')
|
||||
{
|
||||
if (! $this->table_element)
|
||||
{
|
||||
@ -1446,7 +1415,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET note = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL");
|
||||
$sql.= " SET note".$suffix." = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL");
|
||||
$sql.= " WHERE rowid =". $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update_note sql=".$sql, LOG_DEBUG);
|
||||
@ -1464,36 +1433,17 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Update public note of element
|
||||
*
|
||||
* @param string $note_public New value for note
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Update public note (kept for backward compatibility)
|
||||
*
|
||||
* @param string $note New value for note
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @deprecated
|
||||
*/
|
||||
function update_note_public($note_public)
|
||||
function update_note_public($note)
|
||||
{
|
||||
if (! $this->table_element)
|
||||
{
|
||||
dol_syslog(get_class($this)."::update_note_public was called on objet with property table_element not defined",LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET note_public = ".(!empty($note_public)?("'".$this->db->escape($note_public)."'"):"NULL");
|
||||
$sql.= " WHERE rowid =". $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update_note_public sql=".$sql);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$this->note_public = $note_public;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
return $this->update_note($note,'_public');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update total_ht, total_ttc and total_vat for an object (sum of lines)
|
||||
*
|
||||
|
||||
@ -61,14 +61,14 @@ $object->fetch($id);
|
||||
if ($action == 'setnote_public' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -380,7 +380,7 @@ else if ($action == 'setdescription' && $user->rights->ficheinter->creer)
|
||||
else if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
||||
|
||||
@ -48,13 +48,13 @@ $object->fetch($id,$ref);
|
||||
|
||||
if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -140,13 +140,13 @@ else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande->
|
||||
|
||||
else if ($action == 'setnote_public' && $user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ $object->fetch($id, $ref);
|
||||
|
||||
if ($action == 'setnote_public' && $user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
elseif ($action == 'setnote' && $user->rights->fournisseur->commande->creer)
|
||||
|
||||
@ -211,13 +211,13 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur
|
||||
elseif ($action == 'setnote_public' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
elseif ($action == 'setnote_private' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -51,12 +51,12 @@ $object->fetch($id,$ref);
|
||||
|
||||
if ($action == 'setnote_public' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
elseif ($action == 'setnote_private' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -1011,7 +1011,7 @@ class Project extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->db->begin();
|
||||
$res=$clone_project->update_note_public(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES));
|
||||
$res=$clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES),'_public');
|
||||
if ($res < 0)
|
||||
{
|
||||
$this->error.=$clone_project->error;
|
||||
|
||||
@ -1027,7 +1027,7 @@ class Task extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->db->begin();
|
||||
$res=$clone_task->update_note_public(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES));
|
||||
$res=$clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES),'_public');
|
||||
if ($res < 0)
|
||||
{
|
||||
$this->error.=$clone_task->error;
|
||||
|
||||
@ -56,7 +56,7 @@ $result = restrictedArea($user, 'projet', $id);
|
||||
if ($action == 'setnote_public' && $user->rights->projet->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ $permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
|
||||
|
||||
if ($action == 'setnote_public' && ! empty($permission))
|
||||
{
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
@ -55,14 +55,14 @@ if ($id > 0) $object->fetch($id);
|
||||
if ($action == 'setnote_public' && $user->rights->propale->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) setEventMessage($object->error,'errors');
|
||||
}
|
||||
|
||||
else if ($action == 'setnote_private' && $user->rights->propale->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->update_note_private(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) setEventMessage($object->error,'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -276,10 +276,6 @@ class CategorieTest extends PHPUnit_Framework_TestCase
|
||||
print __METHOD__." retarray size=".count($retarray)."\n";
|
||||
$this->assertTrue(is_array($retarray));
|
||||
|
||||
$retarray=$localobject->is_fille($localobject2);
|
||||
print __METHOD__." retarry size=".count($retarray)."\n";
|
||||
$this->assertFalse($retarray);
|
||||
|
||||
return $localobject->id;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user