|
@@ 620-624 (lines=5) @@
|
| 617 |
|
|
| 618 |
|
$req = "select id from ".ABSENCES_TYPES_TBL." where name='".$babDB->db_escape_string($tname)."'"; |
| 619 |
|
$res = $babDB->db_query($req); |
| 620 |
|
if( $res && $babDB->db_num_rows($res) > 0 ) |
| 621 |
|
{ |
| 622 |
|
$babBody->msgerror = absences_translate("This vacation type already exists") ." !"; |
| 623 |
|
return false; |
| 624 |
|
} |
| 625 |
|
|
| 626 |
|
$req = "insert into ".ABSENCES_TYPES_TBL." ( name, description, quantity, maxdays, mindays, defaultdays, color, recover)"; |
| 627 |
|
$req .= " values ( |
|
@@ 654-658 (lines=5) @@
|
| 651 |
|
|
| 652 |
|
$req = "SELECT id from ".ABSENCES_TYPES_TBL." WHERE name='".$babDB->db_escape_string($tname)."' AND id!='".$babDB->db_escape_string($vtid)."'"; |
| 653 |
|
$res = $babDB->db_query($req); |
| 654 |
|
if( $res && $babDB->db_num_rows($res) > 0 ) |
| 655 |
|
{ |
| 656 |
|
$babBody->msgerror = absences_translate("This vacation type already exists") ." !"; |
| 657 |
|
return false; |
| 658 |
|
} |
| 659 |
|
|
| 660 |
|
$req = "UPDATE ".ABSENCES_TYPES_TBL." |
| 661 |
|
SET |
|
@@ 726-730 (lines=5) @@
|
| 723 |
|
|
| 724 |
|
$req = "select id from ".ABSENCES_COLLECTIONS_TBL." where name='".$babDB->db_escape_string($tname)."'"; |
| 725 |
|
$res = $babDB->db_query($req); |
| 726 |
|
if( $res && $babDB->db_num_rows($res) > 0 ) |
| 727 |
|
{ |
| 728 |
|
$babBody->msgerror = absences_translate("This collection already exists") ." !"; |
| 729 |
|
return false; |
| 730 |
|
} |
| 731 |
|
|
| 732 |
|
$req = "insert into ".ABSENCES_COLLECTIONS_TBL." ( name, description, id_cat )"; |
| 733 |
|
$req .= " values ('".$babDB->db_escape_string($tname)."', '" .$babDB->db_escape_string($description)."', '" .$babDB->db_escape_string($category). "')"; |
|
@@ 760-764 (lines=5) @@
|
| 757 |
|
|
| 758 |
|
$req = "select id from ".ABSENCES_COLLECTIONS_TBL." where name='".$babDB->db_escape_string($tname)."' and id!='".$babDB->db_escape_string($vcid)."'"; |
| 759 |
|
$res = $babDB->db_query($req); |
| 760 |
|
if( $res && $babDB->db_num_rows($res) > 0 ) |
| 761 |
|
{ |
| 762 |
|
$babBody->msgerror = absences_translate("This collection already exists") ." !"; |
| 763 |
|
return false; |
| 764 |
|
} |
| 765 |
|
|
| 766 |
|
$res = $babDB->db_query("update ".ABSENCES_COLLECTIONS_TBL." set name='".$babDB->db_escape_string($tname)."', description='".$babDB->db_escape_string($description)."', id_cat='".$babDB->db_escape_string($category)."' where id='".$babDB->db_escape_string($vcid)."'"); |
| 767 |
|
|