changing to context menu single edit/delete.
This commit is contained in:
parent
9b45b9dc72
commit
09693ef174
|
@ -180,8 +180,6 @@ class LibraryController extends Zend_Controller_Action
|
||||||
//playlist||timeline
|
//playlist||timeline
|
||||||
$screen = $this->_getParam('screen');
|
$screen = $this->_getParam('screen');
|
||||||
|
|
||||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
|
||||||
|
|
||||||
$menu = array();
|
$menu = array();
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
|
@ -8,6 +8,7 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$ajaxContext
|
$ajaxContext
|
||||||
->addActionContext('file-history-feed', 'json')
|
->addActionContext('file-history-feed', 'json')
|
||||||
->addActionContext('item-history-feed', 'json')
|
->addActionContext('item-history-feed', 'json')
|
||||||
|
->addActionContext('context-menu', 'json')
|
||||||
->addActionContext('edit-file-item', 'json')
|
->addActionContext('edit-file-item', 'json')
|
||||||
->addActionContext('create-list-item', 'json')
|
->addActionContext('create-list-item', 'json')
|
||||||
->addActionContext('edit-list-item', 'json')
|
->addActionContext('edit-list-item', 'json')
|
||||||
|
@ -67,7 +68,9 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'js/datatables/plugin/TableTools-2.1.5/css/TableTools.css?'.$CC_CONFIG['airtime_version']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'js/datatables/plugin/TableTools-2.1.5/css/TableTools.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/playouthistory.css?'.$CC_CONFIG['airtime_version']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/playouthistory.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery-ui-timepicker-addon.css?'.$CC_CONFIG['airtime_version']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery-ui-timepicker-addon.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
|
||||||
|
|
||||||
//set datatables columns for display of data.
|
//set datatables columns for display of data.
|
||||||
|
@ -80,6 +83,28 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$this->view->headScript()->appendScript($script);
|
$this->view->headScript()->appendScript($script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function contextMenuAction()
|
||||||
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
$id = $this->_getParam('id');
|
||||||
|
|
||||||
|
$menu = array();
|
||||||
|
|
||||||
|
$menu["edit"] = array(
|
||||||
|
"name"=> _("Edit"),
|
||||||
|
"icon" => "edit",
|
||||||
|
"url" => $baseUrl."playouthistory/edit-list-item/id/{$id}"
|
||||||
|
);
|
||||||
|
|
||||||
|
$menu["del"] = array(
|
||||||
|
"name"=> _("Delete"),
|
||||||
|
"icon" => "delete",
|
||||||
|
"url" => $baseUrl."playouthistory/delete-list-item/id/{$id}"
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->view->items = $menu;
|
||||||
|
}
|
||||||
|
|
||||||
public function fileHistoryFeedAction()
|
public function fileHistoryFeedAction()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@ -228,6 +253,7 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/template.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/template.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
|
||||||
$historyService = new Application_Service_HistoryService();
|
$historyService = new Application_Service_HistoryService();
|
||||||
$this->view->template_list = $historyService->getListItemTemplates();
|
$this->view->template_list = $historyService->getListItemTemplates();
|
||||||
|
@ -241,6 +267,7 @@ class PlayouthistoryController extends Zend_Controller_Action
|
||||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
|
@ -209,11 +209,11 @@ class Application_Service_HistoryService
|
||||||
$orderBys[] = "{$key}_filter.{$key} {$sortDir}";
|
$orderBys[] = "{$key}_filter.{$key} {$sortDir}";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Exception("Error: $key is not part of the template.");
|
//throw new Exception("Error: $key is not part of the template.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($numOrderColumns > 0) {
|
if (count($orderBys) > 0) {
|
||||||
|
|
||||||
$orders = join(", ", $orderBys);
|
$orders = join(", ", $orderBys);
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ class Application_Service_HistoryService
|
||||||
$mainSqlQuery.=
|
$mainSqlQuery.=
|
||||||
" OFFSET :offset LIMIT :limit";
|
" OFFSET :offset LIMIT :limit";
|
||||||
|
|
||||||
$paramMap["offset"] = $opts["iDisplayStart"];
|
$paramMap["offset"] = intval($opts["iDisplayStart"]);
|
||||||
$paramMap["limit"] = $displayLength;
|
$paramMap["limit"] = $displayLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,6 +282,9 @@ class Application_Service_HistoryService
|
||||||
$result[MDATA_KEY_DURATION] = $formatter->format();
|
$result[MDATA_KEY_DURATION] = $formatter->format();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//need to add a checkbox..
|
||||||
|
$result["checkbox"] = "";
|
||||||
|
|
||||||
//$unicodeChar = '\u2612';
|
//$unicodeChar = '\u2612';
|
||||||
//$result["new"] = json_decode('"'.$unicodeChar.'"');
|
//$result["new"] = json_decode('"'.$unicodeChar.'"');
|
||||||
//$result["new"] = "U+2612";
|
//$result["new"] = "U+2612";
|
||||||
|
@ -827,9 +830,9 @@ class Application_Service_HistoryService
|
||||||
public function getFieldTypes() {
|
public function getFieldTypes() {
|
||||||
|
|
||||||
$fields = array(
|
$fields = array(
|
||||||
TEMPLATE_DATE,
|
//TEMPLATE_DATE,
|
||||||
TEMPLATE_TIME,
|
//TEMPLATE_TIME,
|
||||||
TEMPLATE_DATETIME,
|
//TEMPLATE_DATETIME,
|
||||||
TEMPLATE_STRING,
|
TEMPLATE_STRING,
|
||||||
TEMPLATE_BOOLEAN,
|
TEMPLATE_BOOLEAN,
|
||||||
TEMPLATE_INT,
|
TEMPLATE_INT,
|
||||||
|
@ -1019,11 +1022,11 @@ class Application_Service_HistoryService
|
||||||
return $this->getTemplates(self::TEMPLATE_TYPE_FILE);
|
return $this->getTemplates(self::TEMPLATE_TYPE_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function datatablesColumns($template) {
|
private function datatablesColumns($fields) {
|
||||||
|
|
||||||
$columns = array();
|
$columns = array();
|
||||||
|
|
||||||
foreach ($template["fields"] as $index=>$field) {
|
foreach ($fields as $field) {
|
||||||
|
|
||||||
$label = $field["label"];
|
$label = $field["label"];
|
||||||
$key = $field["name"];
|
$key = $field["name"];
|
||||||
|
@ -1041,9 +1044,22 @@ class Application_Service_HistoryService
|
||||||
|
|
||||||
public function getDatatablesLogSheetColumns() {
|
public function getDatatablesLogSheetColumns() {
|
||||||
|
|
||||||
|
//need to prepend a checkbox column.
|
||||||
|
$checkbox = array(
|
||||||
|
"sTitle"=> "",
|
||||||
|
"mDataProp"=> "checkbox",
|
||||||
|
"sClass"=> "his_checkbox",
|
||||||
|
"bSortable"=> false
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$template = $this->getConfiguredItemTemplate();
|
$template = $this->getConfiguredItemTemplate();
|
||||||
return $this->datatablesColumns($template);
|
$fields = $template["fields"];
|
||||||
|
|
||||||
|
$columns = $this->datatablesColumns($fields);
|
||||||
|
array_unshift($columns, $checkbox);
|
||||||
|
|
||||||
|
return $columns;
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
|
@ -1054,7 +1070,7 @@ class Application_Service_HistoryService
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$template = $this->getConfiguredFileTemplate();
|
$template = $this->getConfiguredFileTemplate();
|
||||||
return $this->datatablesColumns($template);
|
return $this->datatablesColumns($template["fields"]);
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<div id="configure_item_template" class="ui-widget ui-widget-content block-shadow alpha-block padded">
|
<div id="configure_item_template" class="ui-widget ui-widget-content block-shadow alpha-block padded-strong">
|
||||||
<?php echo $this->render('playouthistory/template-contents.phtml'); ?>
|
<?php echo $this->render('playouthistory/template-contents.phtml'); ?>
|
||||||
</div>
|
</div>
|
|
@ -7,7 +7,6 @@
|
||||||
<li><a href="#his-tabs-2"><?php echo _("File Summary"); ?></a></li>
|
<li><a href="#his-tabs-2"><?php echo _("File Summary"); ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="his-tabs-1">
|
<div id="his-tabs-1">
|
||||||
<div id="his_create"><?php echo _("Create Entry"); ?></div>
|
|
||||||
<table id="history_table_list" cellpadding="0" cellspacing="0" class="datatable"></table>
|
<table id="history_table_list" cellpadding="0" cellspacing="0" class="datatable"></table>
|
||||||
</div>
|
</div>
|
||||||
<div id="his-tabs-2">
|
<div id="his-tabs-2">
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
<div>
|
<?php if ($this->template_type == Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?>
|
||||||
<?php if (!in_array($this->template_id, $this->configured)): ?>
|
<h4>Creating File Summary Template</h4>
|
||||||
<button id="template_set_default" data-template="<?php echo $this->template_id; ?>">Set Default Template</button>
|
<?php else: ?>
|
||||||
|
<h4>Creating Log Sheet Template</h4>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<button id="template_item_save" data-template="<?php echo $this->template_id; ?>">Save</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div><label>Name<input id="template_name" type="text" value="<?php echo $this->template_name; ?>"></label></div>
|
<div class="template_name_wrap">
|
||||||
|
<label>
|
||||||
|
Name
|
||||||
|
<input id="template_name" type="text" value="<?php echo $this->template_name; ?>">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php $i = 0; ?>
|
<?php $i = 0; ?>
|
||||||
|
|
||||||
|
@ -21,7 +25,9 @@
|
||||||
<span><?php echo $field["label"]?></span>
|
<span><?php echo $field["label"]?></span>
|
||||||
<span><?php echo $field["type"]?></span>
|
<span><?php echo $field["type"]?></span>
|
||||||
<?php if(!in_array($field["name"], $this->required_fields)): ?>
|
<?php if(!in_array($field["name"], $this->required_fields)): ?>
|
||||||
<span class="template_item_remove">Remove</span>
|
<span class="template_item_remove">
|
||||||
|
<i class="icon icon-trash"></i>
|
||||||
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php $i++; ?>
|
<?php $i++; ?>
|
||||||
|
@ -29,6 +35,8 @@
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>Add more elements:</p>
|
||||||
|
|
||||||
<ul class="template_file_md">
|
<ul class="template_file_md">
|
||||||
<?php foreach ($this->fileMD as $md): ?>
|
<?php foreach ($this->fileMD as $md): ?>
|
||||||
|
|
||||||
|
@ -37,21 +45,26 @@
|
||||||
data-type="<?php echo $md["type"]?>"
|
data-type="<?php echo $md["type"]?>"
|
||||||
data-label="<?php echo $md["label"]?>">
|
data-label="<?php echo $md["label"]?>">
|
||||||
<?php echo $md["label"] ?>
|
<?php echo $md["label"] ?>
|
||||||
|
<a class="field_add" href="#"><i class="icon icon-plus"></i></a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php if ($this->template_type !== Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?>
|
<?php if ($this->template_type !== Application_Service_HistoryService::TEMPLATE_TYPE_FILE): ?>
|
||||||
<div class="template_item_add">
|
<div class="template_item_add">
|
||||||
<div>Add New Field</div>
|
<input type="text" placeholder="Add New Field">
|
||||||
<div>
|
|
||||||
<input type="text">
|
|
||||||
<select>
|
<select>
|
||||||
<?php foreach ($this->fields as $field): ?>
|
<?php foreach ($this->fields as $field): ?>
|
||||||
<option value="<?php echo $field; ?>"><?php echo $field; ?></option>
|
<option value="<?php echo $field; ?>"><?php echo $field; ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
<button>Add</button>
|
<button class="btn"><i class="icon-white icon-plus"></i> Add</button>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<?php if (!in_array($this->template_id, $this->configured)): ?>
|
||||||
|
<button id="template_set_default" data-template="<?php echo $this->template_id; ?>" class="btn">Set Default Template</button>
|
||||||
|
<?php endif; ?>
|
||||||
|
<button id="template_item_save" data-template="<?php echo $this->template_id; ?>" class="btn">Save</button>
|
||||||
</div>
|
</div>
|
|
@ -1,7 +1,7 @@
|
||||||
<div id="history_template" class="ui-widget ui-widget-content block-shadow alpha-block padded">
|
<div id="history_template" class="ui-widget ui-widget-content block-shadow alpha-block padded-strong">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div>Edit Log Sheet Template</div>
|
<div><h4>Log Sheet Templates</h4></div>
|
||||||
<ul id="template_list">
|
<ul id="template_list">
|
||||||
<?php if (count($this->template_list) == 0): ?>
|
<?php if (count($this->template_list) == 0): ?>
|
||||||
<li>No Log Sheet Templates</li>
|
<li>No Log Sheet Templates</li>
|
||||||
|
@ -12,19 +12,30 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (in_array($id, $this->configured)): ?>
|
<?php if (in_array($id, $this->configured)): ?>
|
||||||
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
|
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
|
||||||
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
|
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
|
||||||
|
<?php echo $name; ?>
|
||||||
|
</a>
|
||||||
|
<i class="icon icon-ok"></i>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
|
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
|
||||||
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
|
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
|
||||||
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">Set Default</a>
|
<?php echo $name; ?>
|
||||||
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">Remove</a>
|
</a>
|
||||||
|
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">
|
||||||
|
<i class="icon icon-trash"></i>
|
||||||
|
</a>
|
||||||
|
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">
|
||||||
|
Set Default
|
||||||
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<button id="new_item_template" class="btn">New Log Sheet Template</button>
|
||||||
</div>
|
</div>
|
||||||
|
<br><br>
|
||||||
<div>
|
<div>
|
||||||
<div>Edit File Summary Template</div>
|
<div><h4>File Summary Templates</h4></div>
|
||||||
<ul id="template_file">
|
<ul id="template_file">
|
||||||
<?php if (count($this->template_file) == 0): ?>
|
<?php if (count($this->template_file) == 0): ?>
|
||||||
<li>No File Summary Templates</li>
|
<li>No File Summary Templates</li>
|
||||||
|
@ -32,17 +43,25 @@
|
||||||
<?php foreach ($this->template_file as $id=>$name): ?>
|
<?php foreach ($this->template_file as $id=>$name): ?>
|
||||||
<?php if (in_array($id, $this->configured)): ?>
|
<?php if (in_array($id, $this->configured)): ?>
|
||||||
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
|
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>" class="template_configured">
|
||||||
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
|
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
|
||||||
|
<?php echo $name; ?>
|
||||||
|
</a>
|
||||||
|
<i class="icon icon-ok"></i>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
|
<li data-template="<?php echo $id; ?>" data-name="<?php echo $name; ?>">
|
||||||
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>"><?php echo $name; ?></a>
|
<a class="template_name" href="<?php echo $this->baseUrl("Playouthistory/configure-template/id/{$id}"); ?>">
|
||||||
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">Set Default</a>
|
<?php echo $name; ?>
|
||||||
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">Remove</a>
|
</a>
|
||||||
|
<a class="template_remove" href="<?php echo $this->baseUrl("Playouthistory/delete-template/id/{$id}"); ?>">
|
||||||
|
<i class="icon icon-trash"></i>
|
||||||
|
</a>
|
||||||
|
<a class="template_default" href="<?php echo $this->baseUrl("Playouthistory/set-template-default/id/{$id}"); ?>">
|
||||||
|
Set Default
|
||||||
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
<button id="new_item_template" class="btn">New Log Sheet Template</button>
|
|
||||||
<button id="new_file_template" class="btn">New File Summary Template</button>
|
<button id="new_file_template" class="btn">New File Summary Template</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,120 @@
|
||||||
|
#history_template h4, #configure_item_template h4 { font-size: 14px; margin-top: 0px; }
|
||||||
|
|
||||||
|
#history_template ul, #configure_item_template ul { list-style: none; padding-left: 0px; }
|
||||||
|
|
||||||
|
#history_template li, #configure_item_template li {
|
||||||
|
clear: both;
|
||||||
|
background: #AAAAAA;
|
||||||
|
margin: 2px 0 4px 0;
|
||||||
|
padding: 4px 8px 4px 8px;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
border: 1px solid #9F9F9F;
|
||||||
|
min-height: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template li a, #configure_item_template li a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template li a:hover, #configure_item_template li a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template li .template_name {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template li.template_configured {
|
||||||
|
background: #9A9A9A;
|
||||||
|
border: 1px solid #858585;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template .template_remove, #history_template .template_default {
|
||||||
|
float: right;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template .template_default {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#history_template .icon-ok {
|
||||||
|
right: 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template li span {
|
||||||
|
cursor: move;
|
||||||
|
padding-left: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template li .template_item_remove, #configure_item_template li .field_add {
|
||||||
|
cursor: pointer;
|
||||||
|
float: right;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template li .template_item_remove:hover, #configure_item_template li .field_add:hover {
|
||||||
|
opacity:0.7;
|
||||||
|
filter:alpha(opacity=70);
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template #template_name {
|
||||||
|
min-width: 230px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template .template_name_wrap {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template label {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template .template_item_add {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template .template_item_add .btn {
|
||||||
|
padding: 2px 14px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#configure_item_template .template_item_list li {
|
||||||
|
background-image: url('../css/images/drag.png');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: 4px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bootstrap calendar
|
||||||
|
|
||||||
|
.bootstrap-datetimepicker-widget ul {
|
||||||
|
padding-left: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bootstrap-datetimepicker-widget td, .bootstrap-datetimepicker-widget th {
|
||||||
|
-webkit-border-radius: 2px !important;
|
||||||
|
-moz-border-radius: 2px !important;
|
||||||
|
border-radius: 2px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Edit History Record */
|
||||||
|
|
||||||
|
.ui-dialog form.ui-widget-content dd {
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-dialog form.ui-widget-content dt {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-dialog form.ui-widget-content dd input {
|
||||||
|
width: 190px;
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 225 B |
|
@ -32,7 +32,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
">" +
|
">" +
|
||||||
"<span><%= label %></span>" +
|
"<span><%= label %></span>" +
|
||||||
"<span><%= type %></span>" +
|
"<span><%= type %></span>" +
|
||||||
"<span class='template_item_remove'>Remove</span>" +
|
"<span class='template_item_remove'><i class='icon icon-trash'></i></span>" +
|
||||||
"</li>";
|
"</li>";
|
||||||
|
|
||||||
var template = (config.required) === true ? templateRequired : templateOptional;
|
var template = (config.required) === true ? templateRequired : templateOptional;
|
||||||
|
@ -65,9 +65,9 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
$templateList = $(".template_item_list");
|
$templateList = $(".template_item_list");
|
||||||
$fileMDList = $(".template_file_md");
|
$fileMDList = $(".template_file_md");
|
||||||
|
|
||||||
$fileMDList.on("dblclick", "li", function(){
|
$fileMDList.on("click", "i.icon-plus", function(){
|
||||||
|
|
||||||
var $li = $(this);
|
var $li = $(this).parents("li");
|
||||||
var config = {
|
var config = {
|
||||||
name: $li.data("name"),
|
name: $li.data("name"),
|
||||||
type: $li.data("type"),
|
type: $li.data("type"),
|
||||||
|
|
|
@ -93,6 +93,36 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createToolbarButtons ($el) {
|
||||||
|
var $menu = $("<div class='btn-toolbar' />");
|
||||||
|
|
||||||
|
$menu.append("<div class='btn-group'>" +
|
||||||
|
"<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" +
|
||||||
|
$.i18n._("Select")+" <span class='caret'></span>" +
|
||||||
|
"</button>" +
|
||||||
|
"<ul class='dropdown-menu'>" +
|
||||||
|
"<li id='sb-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
|
||||||
|
"<li id='sb-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
|
||||||
|
"<li id='sb-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
|
||||||
|
"</ul>" +
|
||||||
|
"</div>");
|
||||||
|
|
||||||
|
$menu.append("<div class='btn-group'>" +
|
||||||
|
"<button class='btn btn-small' id='his_create'>" +
|
||||||
|
"<i class='icon-white icon-plus'></i>" +
|
||||||
|
$.i18n._("Create Entry") +
|
||||||
|
"</button>" +
|
||||||
|
"</div>");
|
||||||
|
|
||||||
|
$menu.append("<div class='btn-group'>" +
|
||||||
|
"<button class='btn btn-small' id='his_trash'>" +
|
||||||
|
"<i class='icon-white icon-trash'></i>" +
|
||||||
|
"</button>" +
|
||||||
|
"</div>");
|
||||||
|
|
||||||
|
$el.append($menu);
|
||||||
|
}
|
||||||
|
|
||||||
function aggregateHistoryTable() {
|
function aggregateHistoryTable() {
|
||||||
var oTable,
|
var oTable,
|
||||||
$historyTableDiv = $historyContentDiv.find("#history_table_aggregate"),
|
$historyTableDiv = $historyContentDiv.find("#history_table_aggregate"),
|
||||||
|
@ -134,6 +164,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
function itemHistoryTable() {
|
function itemHistoryTable() {
|
||||||
var oTable,
|
var oTable,
|
||||||
$historyTableDiv = $historyContentDiv.find("#history_table_list"),
|
$historyTableDiv = $historyContentDiv.find("#history_table_list"),
|
||||||
|
$toolbar,
|
||||||
columns,
|
columns,
|
||||||
fnRowCallback,
|
fnRowCallback,
|
||||||
booleans = {},
|
booleans = {},
|
||||||
|
@ -158,8 +189,12 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
text,
|
text,
|
||||||
$nRow = $(nRow);
|
$nRow = $(nRow);
|
||||||
|
|
||||||
nRow.setAttribute('url-edit', editUrl);
|
// add checkbox
|
||||||
nRow.setAttribute('url-delete', deleteUrl);
|
$nRow.find('td.his_checkbox').html("<input type='checkbox' name='cb_"+aData.history_id+"'>");
|
||||||
|
|
||||||
|
nRow.setAttribute('his-id', aData.history_id);
|
||||||
|
//nRow.setAttribute('url-edit', editUrl);
|
||||||
|
//nRow.setAttribute('url-delete', deleteUrl);
|
||||||
|
|
||||||
for (b in booleans) {
|
for (b in booleans) {
|
||||||
|
|
||||||
|
@ -190,6 +225,9 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
});
|
});
|
||||||
oTable.fnSetFilteringDelay(350);
|
oTable.fnSetFilteringDelay(350);
|
||||||
|
|
||||||
|
$toolbar = $historyTableDiv.parents(".dataTables_wrapper").find(".fg-toolbar:first");
|
||||||
|
createToolbarButtons($toolbar);
|
||||||
|
|
||||||
return oTable;
|
return oTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,6 +351,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
$historyContentDiv.on("click", "#history_table_list tr", function(ev) {
|
$historyContentDiv.on("click", "#history_table_list tr", function(ev) {
|
||||||
openRow(oTableItem, this);
|
openRow(oTableItem, this);
|
||||||
});
|
});
|
||||||
|
@ -320,6 +359,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
$historyContentDiv.on("click", "#history_table_aggregate tr", function(ev) {
|
$historyContentDiv.on("click", "#history_table_aggregate tr", function(ev) {
|
||||||
openRow(oTableAgg, this);
|
openRow(oTableAgg, this);
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
$("#his_create").click(function(e) {
|
$("#his_create").click(function(e) {
|
||||||
var url = baseUrl+"playouthistory/edit-list-item/format/json" ;
|
var url = baseUrl+"playouthistory/edit-list-item/format/json" ;
|
||||||
|
@ -434,6 +474,72 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
|
|
||||||
$historyContentDiv.find("#his-tabs").tabs();
|
$historyContentDiv.find("#his-tabs").tabs();
|
||||||
|
|
||||||
|
// begin context menu initialization.
|
||||||
|
$.contextMenu({
|
||||||
|
selector: '#history_table_list td:not(.library_checkbox)',
|
||||||
|
trigger: "left",
|
||||||
|
ignoreRightClick: true,
|
||||||
|
|
||||||
|
build: function($el, e) {
|
||||||
|
var items,
|
||||||
|
callback,
|
||||||
|
$tr,
|
||||||
|
id;
|
||||||
|
|
||||||
|
$tr = $el.parents("tr");
|
||||||
|
id = $tr.get(0).getAttribute("his-id");
|
||||||
|
|
||||||
|
function processMenuItems(oItems) {
|
||||||
|
|
||||||
|
// define an edit callback.
|
||||||
|
if (oItems.edit !== undefined) {
|
||||||
|
|
||||||
|
callback = function() {
|
||||||
|
$.post(oItems.edit.url, {format: "json"}, function(json) {
|
||||||
|
|
||||||
|
makeHistoryDialog(json.dialog);
|
||||||
|
|
||||||
|
}, "json");
|
||||||
|
};
|
||||||
|
|
||||||
|
oItems.edit.callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
// define a delete callback.
|
||||||
|
if (oItems.del !== undefined) {
|
||||||
|
|
||||||
|
callback = function() {
|
||||||
|
var c = confirm("Delete this entry?");
|
||||||
|
|
||||||
|
if (c) {
|
||||||
|
$.post(oItems.del.url, {format: "json"}, function(json) {
|
||||||
|
oTableItem.fnDraw();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
oItems.del.callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
items = oItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
request = $.ajax({
|
||||||
|
url: baseUrl+"playouthistory/context-menu",
|
||||||
|
type: "GET",
|
||||||
|
data: {id : id, format: "json"},
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json){
|
||||||
|
processMenuItems(json.items);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
items: items
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return AIRTIME;
|
return AIRTIME;
|
||||||
|
|
Loading…
Reference in New Issue