adding autocomplete from backend source to add shows.
This commit is contained in:
parent
3cd5444f49
commit
1e6f25f148
5 changed files with 28 additions and 11 deletions
|
@ -72,6 +72,7 @@
|
|||
<controllerFile controllerName="User">
|
||||
<actionMethod actionName="index"/>
|
||||
<actionMethod actionName="addUser"/>
|
||||
<actionMethod actionName="getHosts"/>
|
||||
</controllerFile>
|
||||
<controllerFile controllerName="SidePlaylist">
|
||||
<actionMethod actionName="index"/>
|
||||
|
@ -254,6 +255,9 @@
|
|||
<viewControllerScriptsDirectory forControllerName="Nowplaying">
|
||||
<viewScriptFile forActionName="getDataGridData"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="User">
|
||||
<viewScriptFile forActionName="getHosts"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
</viewScriptsDirectory>
|
||||
<viewHelpersDirectory/>
|
||||
<viewFiltersDirectory enabled="false"/>
|
||||
|
|
|
@ -30,7 +30,15 @@ class UserController extends Zend_Controller_Action
|
|||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function getHostsAction()
|
||||
{
|
||||
$this->view->hosts = User::getHosts();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -39,15 +39,14 @@ class User {
|
|||
|
||||
}
|
||||
|
||||
public static function getUsers($type=NULL) {
|
||||
public static function getUsers($type=NULL, $search=NULL) {
|
||||
global $CC_DBC;
|
||||
|
||||
$sql;
|
||||
|
||||
$sql_gen = "SELECT id, login, type FROM cc_subjs ";
|
||||
$sql_gen = "SELECT id, login FROM cc_subjs ";
|
||||
$sql = $sql_gen;
|
||||
|
||||
|
||||
if(!is_null($type)){
|
||||
|
||||
if(is_array($type)) {
|
||||
|
@ -62,6 +61,9 @@ class User {
|
|||
|
||||
$sql = $sql_gen ." WHERE ". $sql_type;
|
||||
}
|
||||
if(!is_null($search)) {
|
||||
$like = "login ILIKE '{$search}'";
|
||||
}
|
||||
|
||||
$sql = $sql . " ORDER BY login";
|
||||
|
||||
|
|
1
application/views/scripts/user/get-hosts.phtml
Normal file
1
application/views/scripts/user/get-hosts.phtml
Normal file
|
@ -0,0 +1 @@
|
|||
<br /><br /><center>View script for controller <b>User</b> and script/action name <b>getHosts</b></center>
|
|
@ -42,6 +42,12 @@ function autoSelect(event, ui) {
|
|||
event.preventDefault();
|
||||
}
|
||||
|
||||
function findHosts(request, callback) {
|
||||
var search = request.term;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function setAddShowEvents() {
|
||||
var start, end;
|
||||
|
||||
|
@ -53,14 +59,10 @@ function setAddShowEvents() {
|
|||
createDateInput(start, startDpSelect);
|
||||
createDateInput(end, endDpSelect);
|
||||
|
||||
//var auto = json.hosts.map(function(el) {
|
||||
// return {value: el.id, label: el.login};
|
||||
//});
|
||||
|
||||
//dialog.find("#add_show_hosts_autocomplete").autocomplete({
|
||||
// source: auto,
|
||||
// select: autoSelect
|
||||
//});
|
||||
$("#add_show_hosts_autocomplete").autocomplete({
|
||||
source: findHosts,
|
||||
select: autoSelect
|
||||
});
|
||||
|
||||
$("#schedule-show-style input").ColorPicker({
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue