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
e399fbae
Commit
e399fbae
authored
7 years ago
by
Peter Rotich
Browse files
Options
Downloads
Plain Diff
Merge remote branch 'adriane/issues/misc-fixes' into develop-next
parents
5ccefb82
d4bd8654
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 @
e399fbae
...
@@ -152,18 +152,8 @@ if ($_POST)
...
@@ -152,18 +152,8 @@ if ($_POST)
<tr
class=
"no_border"
id=
"ccRow"
>
<tr
class=
"no_border"
id=
"ccRow"
>
<td
width=
"160"
>
<?php
echo
__
(
'Cc'
);
?>
:
</td>
<td
width=
"160"
>
<?php
echo
__
(
'Cc'
);
?>
:
</td>
<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'
);
?>
"
>
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>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
</td>
</td>
...
@@ -171,18 +161,8 @@ if ($_POST)
...
@@ -171,18 +161,8 @@ if ($_POST)
<tr
class=
"no_border"
id=
"bccRow"
>
<tr
class=
"no_border"
id=
"bccRow"
>
<td
width=
"160"
>
<?php
echo
__
(
'Bcc'
);
?>
:
</td>
<td
width=
"160"
>
<?php
echo
__
(
'Bcc'
);
?>
:
</td>
<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'
);
?>
"
>
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>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
</td>
</td>
...
@@ -534,9 +514,33 @@ $(function() {
...
@@ -534,9 +514,33 @@ $(function() {
$
(
'
div#org-profile
'
).
fadeIn
();
$
(
'
div#org-profile
'
).
fadeIn
();
return
false
;
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
()
{
$
(
document
).
ready
(
function
()
{
$
(
'
#emailcollab
'
).
on
(
'
change
'
,
function
(){
$
(
'
#emailcollab
'
).
on
(
'
change
'
,
function
(){
...
...
This diff is collapsed.
Click to expand it.
include/staff/ticket-view.inc.php
+
72
−
80
View file @
e399fbae
...
@@ -789,20 +789,18 @@ if ($errors['err'] && isset($_POST['a'])) {
...
@@ -789,20 +789,18 @@ if ($errors['err'] && isset($_POST['a'])) {
<tr>
<tr>
<td
width=
"160"
><b>
<?php
echo
__
(
'Cc'
);
?>
:
</b></td>
<td
width=
"160"
><b>
<?php
echo
__
(
'Cc'
);
?>
:
</b></td>
<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'
);
?>
"
>
data-placeholder=
"
<?php
echo
__
(
'Select Contacts'
);
?>
"
>
<option
value=
""
></option>
<option
value=
"NEW"
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
<?php
<?php
$users
=
User
::
objects
();
foreach
(
$cc_cids
as
$u
)
{
foreach
(
$users
as
$u
)
{
if
(
$u
!=
$ticket
->
user_id
&&
!
in_array
(
$u
,
$bcc_cids
))
{
if
(
$u
->
id
!=
$ticket
->
user_id
&&
!
in_array
(
$u
->
getId
(),
$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>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'ccs'
];
?>
</span>
</td>
</td>
...
@@ -810,20 +808,18 @@ if ($errors['err'] && isset($_POST['a'])) {
...
@@ -810,20 +808,18 @@ if ($errors['err'] && isset($_POST['a'])) {
<tr>
<tr>
<td
width=
"160"
><b>
<?php
echo
__
(
'Bcc'
);
?>
:
</b></td>
<td
width=
"160"
><b>
<?php
echo
__
(
'Bcc'
);
?>
:
</b></td>
<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'
);
?>
"
>
data-placeholder=
"
<?php
echo
__
(
'Select Contacts'
);
?>
"
>
<option
value=
""
></option>
<option
value=
"NEW"
>
—
<?php
echo
__
(
'Add New'
);
?>
—
</option>
<?php
<?php
$users
=
User
::
objects
();
foreach
(
$bcc_cids
as
$u
)
{
foreach
(
$users
as
$u
)
{
if
(
$u
!=
$ticket
->
user_id
&&
!
in_array
(
$u
,
$cc_cids
))
{
if
(
$u
->
id
!=
$ticket
->
user_id
&&
!
in_array
(
$u
->
getId
(),
$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>
</select>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'bccs'
];
?>
</span>
<br/><span
class=
"error"
>
<?php
echo
$errors
[
'bccs'
];
?>
</span>
</td>
</td>
...
@@ -1193,76 +1189,72 @@ $(function() {
...
@@ -1193,76 +1189,72 @@ $(function() {
});
});
$
(
function
()
{
$
(
function
()
{
$
(
"
#cc_users
"
).
select2
({
width
:
'
350px
'
});
$
(
'
.collabSelections
'
).
on
(
"
select2:select
"
,
function
(
e
)
{
$
(
"
#bcc_users
"
).
select2
({
width
:
'
350px
'
});
var
el
=
$
(
this
);
});
var
tid
=
<?php
echo
$ticket
->
getThreadId
();
?>
;
var
target
=
e
.
currentTarget
.
id
;
$
(
function
()
{
var
addTo
=
(
target
==
'
cc_users
'
)
?
'
addcc
'
:
'
addbcc
'
;
$
(
'
#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
();
?>
;
if
(
el
.
val
().
includes
(
"
NEW
"
))
{
if
(
el
.
val
().
includes
(
"
NEW
"
))
{
$
(
"
li[title='— Add New —']
"
).
remove
();
$
(
"
li[title='— Add New —']
"
).
remove
();
var
url
=
'
ajax.php/thread/
'
+
tid
+
'
/add-collaborator
'
;
var
url
=
'
ajax.php/thread/
'
+
tid
+
'
/add-collaborator
'
;
$
.
userLookup
(
url
,
function
(
user
)
{
$
.
userLookup
(
url
,
function
(
user
)
{
e
.
preventDefault
();
e
.
preventDefault
();
if
(
$
(
'
.dialog#confirm-action
'
).
length
)
{
if
(
$
(
'
.dialog#confirm-action
'
).
length
)
{
$
(
'
.dialog#confirm-action #action
'
).
val
(
'
add
bcc
'
);
$
(
'
.dialog#confirm-action #action
'
).
val
(
add
To
);
$
(
'
#confirm-form
'
).
append
(
'
<input type=hidden name=user_id value=
'
+
user
.
id
+
'
/>
'
);
$
(
'
#confirm-form
'
).
append
(
'
<input type=hidden name=user_id value=
'
+
user
.
id
+
'
/>
'
);
$
(
'
#overlay
'
).
show
();
$
(
'
#overlay
'
).
show
();
}
}
});
});
var
arr
=
el
.
val
();
var
arr
=
el
.
val
();
var
removeStr
=
"
NEW
"
;
var
removeStr
=
"
NEW
"
;
arr
.
splice
(
$
.
inArray
(
removeStr
,
arr
),
1
);
arr
.
splice
(
$
.
inArray
(
removeStr
,
arr
),
1
);
$
(
this
).
val
(
arr
);
$
(
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?
"
));
var
confirmation
=
confirm
(
__
(
"
Are you sure you want to remove the collaborator from receiving this reply?
"
));
if
(
confirmation
==
false
)
{
if
(
confirmation
==
false
)
{
$
(
'
#bcc_users
'
).
on
(
"
select2:opening
"
,
function
(
e
)
{
$
(
target
).
on
(
"
select2:opening
"
,
function
(
e
)
{
return
false
;
});
return
false
;
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>
</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