Empeche la creation d'une grille sans nom
This commit is contained in:
parent
79620d68cd
commit
0a8e64d507
@ -55,6 +55,10 @@ class TelephonieTarifGrille {
|
|||||||
\brief Creation d'une nouvelle grille
|
\brief Creation d'une nouvelle grille
|
||||||
*/
|
*/
|
||||||
function CreateGrille($user, $name, $type, $copy=0)
|
function CreateGrille($user, $name, $type, $copy=0)
|
||||||
|
{
|
||||||
|
$result = 0;
|
||||||
|
|
||||||
|
if (strlen(trim($name)) > 0)
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_tarif_grille";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_tarif_grille";
|
||||||
$sql .= "(libelle, type_tarif)";
|
$sql .= "(libelle, type_tarif)";
|
||||||
@ -69,13 +73,18 @@ class TelephonieTarifGrille {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog($this->db->error());
|
dolibarr_syslog($this->db->error());
|
||||||
|
$result = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($copy > 0 && $type == 'vente')
|
if ($copy > 0 && $type == 'vente')
|
||||||
{
|
{
|
||||||
$this->CopieGrille($user,$copy);
|
$this->CopieGrille($user,$copy);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$result = -2;
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user