Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
d4bd8654
Commit
d4bd8654
authored
7 years ago
by
aydreeihn
Browse files
Options
Downloads
Patches
Plain Diff
cc/bcc fixes + improvements
parent
5aaa3ff4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/staff/ticket-open.inc.php
+29
-25
29 additions, 25 deletions
include/staff/ticket-open.inc.php
include/staff/ticket-view.inc.php
+72
-80
72 additions, 80 deletions
include/staff/ticket-view.inc.php
with
101 additions
and
105 deletions
include/staff/ticket-open.inc.php
+
29
−
25
View file @
d4bd8654
...
...
@@ -152,18 +152,8 @@ if ($_POST)
<tr
class=
"no_border"
id=
"ccRow"
>
<td
width=
"160"
>
<?php
echo
__
(
'Cc'
);
?>
:
</td>
<td>
<select
name=
"ccs[]"
id=
"cc_users_open"
multiple=
"multiple"
<select
class=
"collabSelections"
name=
"ccs[]"
id=
"cc_users_open"
multiple=
"multiple"
data-placeholder=
"
<?php
echo
__
(
'Select Contacts'
);
?>
"
>
<option
value=
""
></option>
<?php
$users
=
User
::
objects
();
foreach
(
$users
as
$u
)
{
if
(
$user
&&
$u
->
id
!=
$user
->
getId
())
{
?>
<option
value=
"
<?php
echo
$u
->
id
;
?>
"
>
<?php
echo
$u
->
getName
();
?>
</option>
<?php
}
}
?>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
</td>
...
...
@@ -171,18 +161,8 @@ if ($_POST)
<tr
class=
"no_border"
id=
"bccRow"
>
<td
width=
"160"
>
<?php
echo
__
(
'Bcc'
);
?>
:
</td>
<td>
<select
name=
"bccs[]"
id=
"bcc_users_open"
multiple=
"multiple"
<select
class=
"collabSelections"
name=
"bccs[]"
id=
"bcc_users_open"
multiple=
"multiple"
data-placeholder=
"
<?php
echo
__
(
'Select Contacts'
);
?>
"
>
<option
value=
""
></option>
<?php
$users
=
User
::
objects
();
foreach
(
$users
as
$u
)
{
if
(
$user
&&
$u
->
id
!=
$user
->
getId
())
{
?>
<option
value=
"
<?php
echo
$u
->
id
;
?>
"
>
<?php
echo
$u
->
getName
();
?>
</option>
<?php
}
}
?>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
</td>
...
...
@@ -534,9 +514,33 @@ $(function() {
$
(
'
div#org-profile
'
).
fadeIn
();
return
false
;
});
$
(
"
#cc_users_open
"
).
select2
({
width
:
'
300px
'
});
$
(
"
#bcc_users_open
"
).
select2
({
width
:
'
300px
'
});
});
$
(
'
.collabSelections
'
).
select2
({
width
:
'
350px
'
,
minimumInputLength
:
3
,
ajax
:
{
url
:
"
ajax.php/users/local
"
,
dataType
:
'
json
'
,
data
:
function
(
params
)
{
return
{
q
:
params
.
term
,
};
},
processResults
:
function
(
data
)
{
return
{
results
:
$
.
map
(
data
,
function
(
item
)
{
return
{
text
:
item
.
name
,
slug
:
item
.
slug
,
id
:
item
.
id
}
})
};
}
}
});
});
$
(
document
).
ready
(
function
()
{
$
(
'
#emailcollab
'
).
on
(
'
change
'
,
function
(){
...
...
This diff is collapsed.
Click to expand it.
include/staff/ticket-view.inc.php
+
72
−
80
View file @
d4bd8654
...
...
@@ -789,20 +789,18 @@ if ($errors['err'] && isset($_POST['a'])) {
<tr>
<td
width=
"160"
><b>
<?php
echo
__
(
'Cc'
);
?>
:
</b></td>
<td>
<select
name=
"ccs[]"
id=
"cc_users"
multiple=
"multiple"
<select
class=
"collabSelections"
name=
"ccs[]"
id=
"cc_users"
multiple=
"multiple"
data-placeholder=
"
<?php
echo
__
(
'Select Contacts'
);
?>
"
>
<option
value=
""
></option>
<option
value=
"NEW"
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
<?php
$users
=
User
::
objects
();
foreach
(
$users
as
$u
)
{
if
(
$u
->
id
!=
$ticket
->
user_id
&&
!
in_array
(
$u
->
getId
(),
$bcc_cids
))
{
foreach
(
$cc_cids
as
$u
)
{
if
(
$u
!=
$ticket
->
user_id
&&
!
in_array
(
$u
,
$bcc_cids
))
{
?>
<option
value=
"
<?php
echo
$u
;
?>
"
<?php
if
(
in_array
(
$u
,
$cc_cids
))
echo
'selected="selected"'
;
?>
>
<?php
echo
User
::
lookup
(
$u
);
?>
</option>
<?php
}
}
?>
?>
<option
value=
"
<?php
echo
$u
->
id
;
?>
"
<?php
if
(
in_array
(
$u
->
getId
(),
$cc_cids
))
echo
'selected="selected"'
;
?>
>
<?php
echo
$u
->
getName
();
?>
</option>
<?php
}
}
?>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
</td>
...
...
@@ -810,20 +808,18 @@ if ($errors['err'] && isset($_POST['a'])) {
<tr>
<td
width=
"160"
><b>
<?php
echo
__
(
'Bcc'
);
?>
:
</b></td>
<td>
<select
name=
"bccs[]"
id=
"bcc_users"
multiple=
"multiple"
<select
class=
"collabSelections"
name=
"bccs[]"
id=
"bcc_users"
multiple=
"multiple"
data-placeholder=
"
<?php
echo
__
(
'Select Contacts'
);
?>
"
>
<option
value=
""
></option>
<option
value=
"NEW"
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
<?php
$users
=
User
::
objects
();
foreach
(
$users
as
$u
)
{
if
(
$u
->
id
!=
$ticket
->
user_id
&&
!
in_array
(
$u
->
getId
(),
$cc_cids
))
{
foreach
(
$bcc_cids
as
$u
)
{
if
(
$u
!=
$ticket
->
user_id
&&
!
in_array
(
$u
,
$cc_cids
))
{
?>
<option
value=
"
<?php
echo
$u
;
?>
"
<?php
if
(
in_array
(
$u
,
$bcc_cids
))
echo
'selected="selected"'
;
?>
>
<?php
echo
User
::
lookup
(
$u
);
?>
</option>
<?php
}
}
?>
?>
<option
value=
"
<?php
echo
$u
->
id
;
?>
"
<?php
if
(
in_array
(
$u
->
getId
(),
$bcc_cids
))
echo
'selected="selected"'
;
?>
>
<?php
echo
$u
->
getName
();
?>
</option>
<?php
}
}
?>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'bccs'
];
?>
</span>
</td>
...
...
@@ -1193,76 +1189,72 @@ $(function() {
});
$
(
function
()
{
$
(
"
#cc_users
"
).
select2
({
width
:
'
350px
'
});
$
(
"
#bcc_users
"
).
select2
({
width
:
'
350px
'
});
});
$
(
function
()
{
$
(
'
#cc_users
'
).
on
(
"
select2:select
"
,
function
(
e
)
{
var
el
=
$
(
this
);
var
tid
=
<?php
echo
$ticket
->
getThreadId
();
?>
;
if
(
el
.
val
().
includes
(
"
NEW
"
))
{
$
(
"
li[title='— Add New —']
"
).
remove
();
var
url
=
'
ajax.php/thread/
'
+
tid
+
'
/add-collaborator
'
;
$
.
userLookup
(
url
,
function
(
user
)
{
e
.
preventDefault
();
if
(
$
(
'
.dialog#confirm-action
'
).
length
)
{
$
(
'
.dialog#confirm-action #action
'
).
val
(
'
addcc
'
);
$
(
'
#confirm-form
'
).
append
(
'
<input type=hidden name=user_id value=
'
+
user
.
id
+
'
/>
'
);
$
(
'
#overlay
'
).
show
();
}
});
var
arr
=
el
.
val
();
var
removeStr
=
"
NEW
"
;
arr
.
splice
(
$
.
inArray
(
removeStr
,
arr
),
1
);
$
(
this
).
val
(
arr
);
}
});
$
(
'
#bcc_users
'
).
on
(
"
select2:select
"
,
function
(
e
)
{
var
el
=
$
(
this
);
var
tid
=
<?php
echo
$ticket
->
getThreadId
();
?>
;
$
(
'
.collabSelections
'
).
on
(
"
select2:select
"
,
function
(
e
)
{
var
el
=
$
(
this
);
var
tid
=
<?php
echo
$ticket
->
getThreadId
();
?>
;
var
target
=
e
.
currentTarget
.
id
;
var
addTo
=
(
target
==
'
cc_users
'
)
?
'
addcc
'
:
'
addbcc
'
;
if
(
el
.
val
().
includes
(
"
NEW
"
))
{
$
(
"
li[title='— Add New —']
"
).
remove
();
var
url
=
'
ajax.php/thread/
'
+
tid
+
'
/add-collaborator
'
;
$
.
userLookup
(
url
,
function
(
user
)
{
e
.
preventDefault
();
if
(
$
(
'
.dialog#confirm-action
'
).
length
)
{
$
(
'
.dialog#confirm-action #action
'
).
val
(
'
add
bcc
'
);
$
(
'
#confirm-form
'
).
append
(
'
<input type=hidden name=user_id value=
'
+
user
.
id
+
'
/>
'
);
$
(
'
#overlay
'
).
show
();
}
});
if
(
el
.
val
().
includes
(
"
NEW
"
))
{
$
(
"
li[title='— Add New —']
"
).
remove
();
var
url
=
'
ajax.php/thread/
'
+
tid
+
'
/add-collaborator
'
;
$
.
userLookup
(
url
,
function
(
user
)
{
e
.
preventDefault
();
if
(
$
(
'
.dialog#confirm-action
'
).
length
)
{
$
(
'
.dialog#confirm-action #action
'
).
val
(
add
To
);
$
(
'
#confirm-form
'
).
append
(
'
<input type=hidden name=user_id value=
'
+
user
.
id
+
'
/>
'
);
$
(
'
#overlay
'
).
show
();
}
});
var
arr
=
el
.
val
();
var
removeStr
=
"
NEW
"
;
arr
.
splice
(
$
.
inArray
(
removeStr
,
arr
),
1
);
$
(
this
).
val
(
arr
);
}
});
$
(
'
#cc_users
'
).
on
(
"
select2:unselecting
"
,
function
(
e
)
{
var
confirmation
=
confirm
(
__
(
"
Are you sure you want to remove the collaborator from receiving this reply?
"
));
if
(
confirmation
==
false
)
{
$
(
'
#cc_users
'
).
on
(
"
select2:opening
"
,
function
(
e
)
{
return
false
;
});
return
false
;
}
}
});
$
(
'
#bcc_users
'
).
on
(
"
select2:unselecting
"
,
function
(
e
)
{
$
(
'
.collabSelections
'
).
on
(
"
select2:unselecting
"
,
function
(
e
)
{
var
el
=
$
(
this
);
var
target
=
'
#
'
+
e
.
currentTarget
.
id
;
var
confirmation
=
confirm
(
__
(
"
Are you sure you want to remove the collaborator from receiving this reply?
"
));
if
(
confirmation
==
false
)
{
$
(
'
#bcc_users
'
).
on
(
"
select2:opening
"
,
function
(
e
)
{
return
false
;
});
$
(
target
).
on
(
"
select2:opening
"
,
function
(
e
)
{
return
false
;
});
return
false
;
}
});
$
(
'
.collabSelections
'
).
select2
({
width
:
'
350px
'
,
minimumInputLength
:
3
,
ajax
:
{
url
:
"
ajax.php/users/local
"
,
dataType
:
'
json
'
,
data
:
function
(
params
)
{
if
(
!
params
)
{
params
.
term
=
'
test
'
;
}
return
{
q
:
params
.
term
,
};
},
processResults
:
function
(
data
)
{
data
[
0
]
=
{
name
:
"
\
u2014 Add New
\
u2014
"
,
id
:
"
NEW
"
};
return
{
results
:
$
.
map
(
data
,
function
(
item
)
{
return
{
text
:
item
.
name
,
slug
:
item
.
slug
,
id
:
item
.
id
}
})
};
}
}
});
});
</script>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment