Changed DB so a reply has a Hidden field, to make it only show up for admins. Also made it only possible to add mods/admins to the support groups!

This commit is contained in:
Quitta 2013-07-19 11:56:39 +02:00
parent e7f83761ec
commit 5608185e1d
8 changed files with 14 additions and 1 deletions

View file

@ -36,6 +36,7 @@ add_to_group_success = "The user has been added to the group!"
user_already_added = "The user is already part of the group!"
group_not_existing = "The group doesn't exist!"
user_not_existing = "The user doesn't seem to exist"
not_mod_or_admin = "You can only add Moderators or Admins!"
[sgroup_list]
group_success = "The group has been created!"

View file

@ -36,6 +36,7 @@ add_to_group_success = "ce user est ajoute sur la groupe!"
user_already_added = "cet user est deja membre de la groupe!"
group_not_existing = "cet Groupe n' existe pas!"
user_not_existing = "cet user n'existe pas"
not_mod_or_admin = "C'est possible d'ajoute seulement des mods et admins!"
[sgroup_list]
group_success = "le group est cree!"

View file

@ -9,7 +9,12 @@ function add_user_to_sgroup(){
$id = filter_var($_POST['target_id'],FILTER_SANITIZE_NUMBER_INT);
$user_id = WebUsers::getId($name);
if ($user_id != ""){
if (Ticket_User::constr_ExternId($user_id)->getPermission()>1){
$result['RESULT_OF_ADDING'] = Support_Group::addUserToSupportGroup($user_id, $id);
}else{
$result['RESULT_OF_ADDING'] = "NOT_MOD_OR_ADMIN";
}
}else{
$result['RESULT_OF_ADDING'] = "USER_NOT_EXISTING";
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View file

@ -186,6 +186,7 @@
`Author` INT UNSIGNED NOT NULL ,
`Content` INT UNSIGNED NOT NULL ,
`Timestamp` TIMESTAMP NULL ,
`Hidden` TINYINT(1) NULL DEFAULT 0 ,
PRIMARY KEY (`TReplyId`) ,
INDEX `fk_ticket_reply_ticket_idx` (`Ticket` ASC) ,
INDEX `fk_ticket_reply_ams_user_idx` (`Author` ASC) ,

View file

@ -145,6 +145,7 @@ CREATE TABLE IF NOT EXISTS `mydb`.`ticket_reply` (
`Author` INT UNSIGNED NOT NULL ,
`Content` INT UNSIGNED NOT NULL ,
`Timestamp` TIMESTAMP NULL ,
`Hidden` TINYINT(1) NULL DEFAULT 0 ,
PRIMARY KEY (`TReplyId`) ,
INDEX `fk_ticket_reply_ticket_idx` (`Ticket` ASC) ,
INDEX `fk_ticket_reply_ams_user_idx` (`Author` ASC) ,

View file

@ -86,6 +86,10 @@
<div class="alert alert-error">
{$user_not_existing}
</div>
{else if isset($RESULT_OF_ADDING) and $RESULT_OF_ADDING eq "NOT_MOD_OR_ADMIN"}
<div class="alert alert-error">
{$not_mod_or_admin}
</div>
{/if}
</form>