-added new users management screen
This commit is contained in:
parent
ee5e8f48ce
commit
3b4fa1cc1a
20 changed files with 606 additions and 226 deletions
|
@ -77,6 +77,8 @@
|
||||||
<actionMethod actionName="addUser"/>
|
<actionMethod actionName="addUser"/>
|
||||||
<actionMethod actionName="getHosts"/>
|
<actionMethod actionName="getHosts"/>
|
||||||
<actionMethod actionName="getUserDataTableInfo"/>
|
<actionMethod actionName="getUserDataTableInfo"/>
|
||||||
|
<actionMethod actionName="getUserData"/>
|
||||||
|
<actionMethod actionName="removeUser"/>
|
||||||
</controllerFile>
|
</controllerFile>
|
||||||
<controllerFile controllerName="SidePlaylist">
|
<controllerFile controllerName="SidePlaylist">
|
||||||
<actionMethod actionName="index"/>
|
<actionMethod actionName="index"/>
|
||||||
|
@ -295,6 +297,12 @@
|
||||||
<viewControllerScriptsDirectory forControllerName="User">
|
<viewControllerScriptsDirectory forControllerName="User">
|
||||||
<viewScriptFile forActionName="getUserDataTableInfo"/>
|
<viewScriptFile forActionName="getUserDataTableInfo"/>
|
||||||
</viewControllerScriptsDirectory>
|
</viewControllerScriptsDirectory>
|
||||||
|
<viewControllerScriptsDirectory forControllerName="User">
|
||||||
|
<viewScriptFile forActionName="getUserData"/>
|
||||||
|
</viewControllerScriptsDirectory>
|
||||||
|
<viewControllerScriptsDirectory forControllerName="User">
|
||||||
|
<viewScriptFile forActionName="removeUser"/>
|
||||||
|
</viewControllerScriptsDirectory>
|
||||||
</viewScriptsDirectory>
|
</viewScriptsDirectory>
|
||||||
<viewHelpersDirectory/>
|
<viewHelpersDirectory/>
|
||||||
<viewFiltersDirectory enabled="false"/>
|
<viewFiltersDirectory enabled="false"/>
|
||||||
|
|
|
@ -30,7 +30,8 @@ if (PEAR::isError($CC_DBC)) {
|
||||||
}
|
}
|
||||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
|
|
||||||
Zend_Session::start();
|
//Zend_Session::start();
|
||||||
|
Zend_Validate::setDefaultNamespaces("Zend");
|
||||||
|
|
||||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
// This file generated by Propel 1.5.2 convert-conf target
|
// This file generated by Propel 1.5.2 convert-conf target
|
||||||
// from XML runtime conf file /home/naomiaro/dev-campcaster/campcaster/build/runtime-conf.xml
|
// from XML runtime conf file /home/martin/workspace/airtime/build/runtime-conf.xml
|
||||||
$conf = array (
|
$conf = array (
|
||||||
'datasources' =>
|
'datasources' =>
|
||||||
array (
|
array (
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$end = $this->_getParam('end', null);
|
$end = $this->_getParam('end', null);
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
if($user->isAdmin())
|
if($user->isAdmin())
|
||||||
$editable = true;
|
$editable = true;
|
||||||
else
|
else
|
||||||
|
@ -111,7 +111,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type));
|
$show = new Show(new User($userInfo->id));
|
||||||
$overlap = $show->addShow($data);
|
$overlap = $show->addShow($data);
|
||||||
|
|
||||||
if(isset($overlap)) {
|
if(isset($overlap)) {
|
||||||
|
@ -137,7 +137,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$showInstanceId = $this->_getParam('showInstanceId');
|
$showInstanceId = $this->_getParam('showInstanceId');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
|
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
@ -155,7 +155,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$showInstanceId = $this->_getParam('showInstanceId');
|
$showInstanceId = $this->_getParam('showInstanceId');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
|
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
@ -171,7 +171,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$showInstanceId = $this->_getParam('id');
|
$showInstanceId = $this->_getParam('id');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
|
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
@ -185,7 +185,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$today_timestamp = date("Y-m-d H:i:s");
|
$today_timestamp = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
|
|
||||||
$show = new ShowInstance($id);
|
$show = new ShowInstance($id);
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
|
||||||
if($user->isHost($show->getShowId())) {
|
if($user->isHost($show->getShowId())) {
|
||||||
|
@ -242,7 +242,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
$showInstanceId = $this->_getParam('id');
|
$showInstanceId = $this->_getParam('id');
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
|
||||||
if($user->isHost($show->getShowId())) {
|
if($user->isHost($show->getShowId())) {
|
||||||
|
@ -273,7 +273,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$search = $this->_getParam('search', null);
|
$search = $this->_getParam('search', null);
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id);
|
||||||
$show = new ShowInstance($showInstanceId);
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
|
||||||
if($user->isHost($show->getShowId())) {
|
if($user->isHost($show->getShowId())) {
|
||||||
|
|
|
@ -6,9 +6,11 @@ class UserController extends Zend_Controller_Action
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||||
$ajaxContext->addActionContext('get-hosts', 'json')
|
$ajaxContext->addActionContext('get-hosts', 'json')
|
||||||
->addActionContext('get-user-data-table-info', 'json')
|
->addActionContext('get-user-data-table-info', 'json')
|
||||||
->initContext();
|
->addActionContext('get-user-data', 'json')
|
||||||
|
->addActionContext('remove-user', 'json')
|
||||||
|
->initContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
|
@ -17,37 +19,66 @@ class UserController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function addUserAction()
|
public function addUserAction()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/airtime/user/user.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/airtime/user/user.js','text/javascript');
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$form = new Application_Form_AddUser();
|
$form = new Application_Form_AddUser();
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
if ($form->isValid($request->getPost())) {
|
if ($form->isValid($request->getPost())) {
|
||||||
|
|
||||||
$formdata = $form->getValues();
|
$formdata = $form->getValues();
|
||||||
User::addUser($formdata);
|
if ($form->validateLogin($formdata)){
|
||||||
$form->reset();
|
$user = new User($formdata['user_id']);
|
||||||
}
|
$user->setFirstName($formdata['first_name']);
|
||||||
}
|
$user->setLastName($formdata['last_name']);
|
||||||
|
$user->setLogin($formdata['login']);
|
||||||
$this->view->form = $form;
|
if ($formdata['password'] != "xxxxxx")
|
||||||
|
$user->setPassword($formdata['password']);
|
||||||
|
$user->setType($formdata['type']);
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
$form->reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->view->form = $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHostsAction()
|
public function getHostsAction()
|
||||||
{
|
{
|
||||||
$search = $this->_getParam('term');
|
$search = $this->_getParam('term');
|
||||||
|
|
||||||
$this->view->hosts = User::getHosts($search);
|
$this->view->hosts = User::getHosts($search);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserDataTableInfoAction()
|
public function getUserDataTableInfoAction()
|
||||||
{
|
{
|
||||||
$post = $this->getRequest()->getPost();
|
$post = $this->getRequest()->getPost();
|
||||||
$users = User::getUsersDataTablesInfo($post);
|
$users = User::getUsersDataTablesInfo($post);
|
||||||
|
|
||||||
die(json_encode($users));
|
|
||||||
|
die(json_encode($users));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getUserDataAction()
|
||||||
|
{
|
||||||
|
$id = $this->_getParam('id');
|
||||||
|
$this->view->entries = User::GetUserData($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeUserAction()
|
||||||
|
{
|
||||||
|
// action body
|
||||||
|
$id = $this->_getParam('id');
|
||||||
|
$user = new User($id);
|
||||||
|
|
||||||
|
$this->view->entries = $user->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,3 +87,7 @@ class UserController extends Zend_Controller_Action
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,63 +5,78 @@ class Application_Form_AddUser extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
// Add login element
|
/*
|
||||||
$this->addElement('text', 'login', array(
|
$this->addElementPrefixPath('Application_Validate',
|
||||||
'label' => 'Username:',
|
'../application/validate',
|
||||||
'class' => 'input_text',
|
'validate');
|
||||||
'required' => true,
|
* */
|
||||||
'filters' => array('StringTrim'),
|
|
||||||
'validators' => array('NotEmpty')
|
$hidden = new Zend_Form_Element_Hidden('user_id');
|
||||||
));
|
$hidden->setAttrib('style', 'display: none;');
|
||||||
|
$this->addElement($hidden);
|
||||||
// Add password element
|
|
||||||
$this->addElement('text', 'password', array(
|
$login = new Zend_Form_Element_Text('login');
|
||||||
'label' => 'Password:',
|
$login->setLabel('Username:');
|
||||||
'class' => 'input_text',
|
$login->setAttrib('class', 'input_text');
|
||||||
'required' => true,
|
$login->setRequired(true);
|
||||||
'filters' => array('StringTrim'),
|
$login->addFilter('StringTrim');
|
||||||
'validators' => array('NotEmpty')
|
//$login->addValidator('UserNameValidate');
|
||||||
));
|
$this->addElement($login);
|
||||||
|
|
||||||
// Add first name element
|
$password = new Zend_Form_Element_Password('password');
|
||||||
$this->addElement('text', 'first_name', array(
|
$password->setLabel('Password:');
|
||||||
'label' => 'Firstname:',
|
$password->setAttrib('class', 'input_text');
|
||||||
'class' => 'input_text',
|
$password->setRequired(true);
|
||||||
'required' => true,
|
$password->addFilter('StringTrim');
|
||||||
'filters' => array('StringTrim'),
|
$password->addValidator('NotEmpty');
|
||||||
'validators' => array('NotEmpty')
|
$this->addElement($password);
|
||||||
));
|
|
||||||
|
$firstName = new Zend_Form_Element_Text('first_name');
|
||||||
// Add last name element
|
$firstName->setLabel('Firstname:');
|
||||||
$this->addElement('text', 'last_name', array(
|
$firstName->setAttrib('class', 'input_text');
|
||||||
'label' => 'Lastname:',
|
$firstName->setRequired(true);
|
||||||
'class' => 'input_text',
|
$firstName->addFilter('StringTrim');
|
||||||
'required' => true,
|
$firstName->addValidator('NotEmpty');
|
||||||
'filters' => array('StringTrim'),
|
$this->addElement($firstName);
|
||||||
'validators' => array('NotEmpty')
|
|
||||||
));
|
$lastName = new Zend_Form_Element_Text('last_name');
|
||||||
|
$lastName->setLabel('Lastname:');
|
||||||
//Add type select
|
$lastName->setAttrib('class', 'input_text');
|
||||||
$this->addElement('select', 'type', array(
|
$lastName->setRequired(true);
|
||||||
'required' => true,
|
$lastName->addFilter('StringTrim');
|
||||||
'class' => 'input_select',
|
$lastName->addValidator('NotEmpty');
|
||||||
'style' => 'width: 40%',
|
$this->addElement($lastName);
|
||||||
'multiOptions' => array(
|
|
||||||
|
$select = new Zend_Form_Element_Select('type');
|
||||||
|
$select->setAttrib('class', 'input_select');
|
||||||
|
$select->setAttrib('style', 'width: 40%');
|
||||||
|
$select->setMultiOptions(array(
|
||||||
"A" => "admin",
|
"A" => "admin",
|
||||||
"H" => "host",
|
"H" => "host",
|
||||||
"G" => "guest",
|
"G" => "guest",
|
||||||
),
|
));
|
||||||
));
|
$select->setRequired(true);
|
||||||
|
$this->addElement($select);
|
||||||
// Add the submit button
|
|
||||||
$this->addElement('submit', 'submit', array(
|
$submit = new Zend_Form_Element_Submit('submit');
|
||||||
'class' => 'ui-button ui-state-default right-floated',
|
$submit->setAttrib('class', 'ui-button ui-state-default right-floated');
|
||||||
'ignore' => true,
|
$submit->setIgnore(true);
|
||||||
'label' => 'Submit',
|
$submit->setLabel('submit');
|
||||||
));
|
$this->addElement($submit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function validateLogin($data){
|
||||||
|
|
||||||
|
if (strlen($data['user_id']) == 0){
|
||||||
|
$count = CcSubjsQuery::create()->filterByDbLogin($data['login'])->count();
|
||||||
|
|
||||||
|
if ($count != 0){
|
||||||
|
$this->getElement('login')->setErrors(array("login name is not unique."));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,41 +2,99 @@
|
||||||
|
|
||||||
class User {
|
class User {
|
||||||
|
|
||||||
private $_userRole;
|
private $_userInstance;
|
||||||
private $_userId;
|
|
||||||
|
|
||||||
public function __construct($userId, $userType='G')
|
public function __construct($userId)
|
||||||
{
|
{
|
||||||
$this->_userRole = $userType;
|
if (strlen($userId)==0){
|
||||||
$this->_userId = $userId;
|
$this->userInstance = $this->createUser();
|
||||||
|
} else {
|
||||||
|
$this->userInstance = CcSubjsQuery::create()->findPK($userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getType() {
|
|
||||||
return $this->userRole;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getId() {
|
public function getId() {
|
||||||
return $this->_userId;
|
return $this->_userInstance->getDbId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isHost($showId) {
|
public function isHost($showId) {
|
||||||
return CcShowHostsQuery::create()->filterByDbShow($showId)->filterByDbHost($this->_userId)->count() > 0;
|
$userId = $this->_userInstance->getDbId();
|
||||||
|
return CcShowHostsQuery::create()->filterByDbShow($showId)->filterByDbHost($_userId)->count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isAdmin() {
|
public function isAdmin() {
|
||||||
return $this->_userRole === 'A';
|
return $userInstance->getDbType() === 'A';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setLogin($login){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
$user->setDbLogin($login);
|
||||||
|
//$user->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPassword($password){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
$user->setDbPass(md5($password));
|
||||||
|
//$user->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFirstName($firstName){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
$user->setDbFirstName($firstName);
|
||||||
|
//$user->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setLastName($lastName){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
$user->setDbLastName($lastName);
|
||||||
|
//$user->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setType($type){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
$user->setDbType($type);
|
||||||
|
//$user->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLogin(){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
return $user->getDbLogin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPassword(){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
return $user->getDbPass();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFirstName(){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
return $user->getDbFirstName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLastName(){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
return $user->getDbLastName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getType(){
|
||||||
|
$user = $this->userInstance;
|
||||||
|
return $user->getDbType();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(){
|
||||||
|
$this->userInstance->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(){
|
||||||
|
if (!$this->userInstance->isDeleted())
|
||||||
|
$this->userInstance->delete();
|
||||||
|
}
|
||||||
|
|
||||||
public static function addUser($data) {
|
private function createUser() {
|
||||||
|
|
||||||
$user = new CcSubjs();
|
$user = new CcSubjs();
|
||||||
$user->setDbLogin($data['login']);
|
//$user->save();
|
||||||
$user->setDbPass(md5($data['password']));
|
|
||||||
$user->setDbFirstName($data['first_name']);
|
return $user;
|
||||||
$user->setDbLastName($data['last_name']);
|
|
||||||
$user->setDbType($data['type']);
|
|
||||||
$user->save();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getUsers($type, $search=NULL) {
|
public static function getUsers($type, $search=NULL) {
|
||||||
|
@ -76,6 +134,16 @@ class User {
|
||||||
|
|
||||||
$fromTable = "cc_subjs";
|
$fromTable = "cc_subjs";
|
||||||
return StoredFile::searchFiles($fromTable, $datatables_post);
|
return StoredFile::searchFiles($fromTable, $datatables_post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getUserData($id){
|
||||||
|
global $CC_DBC;
|
||||||
|
|
||||||
|
$sql = "SELECT login, first_name, last_name, type, id"
|
||||||
|
." FROM cc_subjs"
|
||||||
|
." WHERE id = $id";
|
||||||
|
|
||||||
|
return $CC_DBC->GetRow($sql);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,9 @@ class CcSubjsTableMap extends TableMap {
|
||||||
$this->addColumn('LAST_NAME', 'DbLastName', 'VARCHAR', true, 255, '');
|
$this->addColumn('LAST_NAME', 'DbLastName', 'VARCHAR', true, 255, '');
|
||||||
$this->addColumn('LASTLOGIN', 'DbLastlogin', 'TIMESTAMP', false, null, null);
|
$this->addColumn('LASTLOGIN', 'DbLastlogin', 'TIMESTAMP', false, null, null);
|
||||||
$this->addColumn('LASTFAIL', 'DbLastfail', 'TIMESTAMP', false, null, null);
|
$this->addColumn('LASTFAIL', 'DbLastfail', 'TIMESTAMP', false, null, null);
|
||||||
|
$this->addColumn('SKYPE_CONTACT', 'DbSkypeContact', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('JABBER_CONTACT', 'DbJabberContact', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('EMAIL', 'DbEmail', 'VARCHAR', false, 255, null);
|
||||||
// validators
|
// validators
|
||||||
} // initialize()
|
} // initialize()
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,24 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
protected $lastfail;
|
protected $lastfail;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the skype_contact field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $skype_contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the jabber_contact field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $jabber_contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the email field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array CcAccess[] Collection to store aggregation of CcAccess objects.
|
* @var array CcAccess[] Collection to store aggregation of CcAccess objects.
|
||||||
*/
|
*/
|
||||||
|
@ -277,6 +295,36 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [skype_contact] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbSkypeContact()
|
||||||
|
{
|
||||||
|
return $this->skype_contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [jabber_contact] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbJabberContact()
|
||||||
|
{
|
||||||
|
return $this->jabber_contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [email] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbEmail()
|
||||||
|
{
|
||||||
|
return $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [id] column.
|
* Set the value of [id] column.
|
||||||
*
|
*
|
||||||
|
@ -495,6 +543,66 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbLastfail()
|
} // setDbLastfail()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [skype_contact] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcSubjs The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbSkypeContact($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->skype_contact !== $v) {
|
||||||
|
$this->skype_contact = $v;
|
||||||
|
$this->modifiedColumns[] = CcSubjsPeer::SKYPE_CONTACT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbSkypeContact()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [jabber_contact] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcSubjs The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbJabberContact($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->jabber_contact !== $v) {
|
||||||
|
$this->jabber_contact = $v;
|
||||||
|
$this->modifiedColumns[] = CcSubjsPeer::JABBER_CONTACT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbJabberContact()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [email] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcSubjs The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbEmail($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->email !== $v) {
|
||||||
|
$this->email = $v;
|
||||||
|
$this->modifiedColumns[] = CcSubjsPeer::EMAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbEmail()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the columns in this object are only set to default values.
|
* Indicates whether the columns in this object are only set to default values.
|
||||||
*
|
*
|
||||||
|
@ -555,6 +663,9 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
$this->last_name = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
$this->last_name = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
||||||
$this->lastlogin = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
$this->lastlogin = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||||
$this->lastfail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
$this->lastfail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||||
|
$this->skype_contact = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
||||||
|
$this->jabber_contact = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
|
||||||
|
$this->email = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
@ -563,7 +674,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
$this->ensureConsistency();
|
$this->ensureConsistency();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $startcol + 8; // 8 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 11; // 11 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating CcSubjs object", $e);
|
throw new PropelException("Error populating CcSubjs object", $e);
|
||||||
|
@ -1012,6 +1123,15 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
case 7:
|
case 7:
|
||||||
return $this->getDbLastfail();
|
return $this->getDbLastfail();
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
return $this->getDbSkypeContact();
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
return $this->getDbJabberContact();
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
return $this->getDbEmail();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
break;
|
break;
|
||||||
|
@ -1043,6 +1163,9 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
$keys[5] => $this->getDbLastName(),
|
$keys[5] => $this->getDbLastName(),
|
||||||
$keys[6] => $this->getDbLastlogin(),
|
$keys[6] => $this->getDbLastlogin(),
|
||||||
$keys[7] => $this->getDbLastfail(),
|
$keys[7] => $this->getDbLastfail(),
|
||||||
|
$keys[8] => $this->getDbSkypeContact(),
|
||||||
|
$keys[9] => $this->getDbJabberContact(),
|
||||||
|
$keys[10] => $this->getDbEmail(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@ -1098,6 +1221,15 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
case 7:
|
case 7:
|
||||||
$this->setDbLastfail($value);
|
$this->setDbLastfail($value);
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
$this->setDbSkypeContact($value);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
$this->setDbJabberContact($value);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
$this->setDbEmail($value);
|
||||||
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1130,6 +1262,9 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
if (array_key_exists($keys[5], $arr)) $this->setDbLastName($arr[$keys[5]]);
|
if (array_key_exists($keys[5], $arr)) $this->setDbLastName($arr[$keys[5]]);
|
||||||
if (array_key_exists($keys[6], $arr)) $this->setDbLastlogin($arr[$keys[6]]);
|
if (array_key_exists($keys[6], $arr)) $this->setDbLastlogin($arr[$keys[6]]);
|
||||||
if (array_key_exists($keys[7], $arr)) $this->setDbLastfail($arr[$keys[7]]);
|
if (array_key_exists($keys[7], $arr)) $this->setDbLastfail($arr[$keys[7]]);
|
||||||
|
if (array_key_exists($keys[8], $arr)) $this->setDbSkypeContact($arr[$keys[8]]);
|
||||||
|
if (array_key_exists($keys[9], $arr)) $this->setDbJabberContact($arr[$keys[9]]);
|
||||||
|
if (array_key_exists($keys[10], $arr)) $this->setDbEmail($arr[$keys[10]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1149,6 +1284,9 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
if ($this->isColumnModified(CcSubjsPeer::LAST_NAME)) $criteria->add(CcSubjsPeer::LAST_NAME, $this->last_name);
|
if ($this->isColumnModified(CcSubjsPeer::LAST_NAME)) $criteria->add(CcSubjsPeer::LAST_NAME, $this->last_name);
|
||||||
if ($this->isColumnModified(CcSubjsPeer::LASTLOGIN)) $criteria->add(CcSubjsPeer::LASTLOGIN, $this->lastlogin);
|
if ($this->isColumnModified(CcSubjsPeer::LASTLOGIN)) $criteria->add(CcSubjsPeer::LASTLOGIN, $this->lastlogin);
|
||||||
if ($this->isColumnModified(CcSubjsPeer::LASTFAIL)) $criteria->add(CcSubjsPeer::LASTFAIL, $this->lastfail);
|
if ($this->isColumnModified(CcSubjsPeer::LASTFAIL)) $criteria->add(CcSubjsPeer::LASTFAIL, $this->lastfail);
|
||||||
|
if ($this->isColumnModified(CcSubjsPeer::SKYPE_CONTACT)) $criteria->add(CcSubjsPeer::SKYPE_CONTACT, $this->skype_contact);
|
||||||
|
if ($this->isColumnModified(CcSubjsPeer::JABBER_CONTACT)) $criteria->add(CcSubjsPeer::JABBER_CONTACT, $this->jabber_contact);
|
||||||
|
if ($this->isColumnModified(CcSubjsPeer::EMAIL)) $criteria->add(CcSubjsPeer::EMAIL, $this->email);
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
|
@ -1217,6 +1355,9 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
$copyObj->setDbLastName($this->last_name);
|
$copyObj->setDbLastName($this->last_name);
|
||||||
$copyObj->setDbLastlogin($this->lastlogin);
|
$copyObj->setDbLastlogin($this->lastlogin);
|
||||||
$copyObj->setDbLastfail($this->lastfail);
|
$copyObj->setDbLastfail($this->lastfail);
|
||||||
|
$copyObj->setDbSkypeContact($this->skype_contact);
|
||||||
|
$copyObj->setDbJabberContact($this->jabber_contact);
|
||||||
|
$copyObj->setDbEmail($this->email);
|
||||||
|
|
||||||
if ($deepCopy) {
|
if ($deepCopy) {
|
||||||
// important: temporarily setNew(false) because this affects the behavior of
|
// important: temporarily setNew(false) because this affects the behavior of
|
||||||
|
@ -2111,6 +2252,9 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
||||||
$this->last_name = null;
|
$this->last_name = null;
|
||||||
$this->lastlogin = null;
|
$this->lastlogin = null;
|
||||||
$this->lastfail = null;
|
$this->lastfail = null;
|
||||||
|
$this->skype_contact = null;
|
||||||
|
$this->jabber_contact = null;
|
||||||
|
$this->email = null;
|
||||||
$this->alreadyInSave = false;
|
$this->alreadyInSave = false;
|
||||||
$this->alreadyInValidation = false;
|
$this->alreadyInValidation = false;
|
||||||
$this->clearAllReferences();
|
$this->clearAllReferences();
|
||||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcSubjsPeer {
|
||||||
const TM_CLASS = 'CcSubjsTableMap';
|
const TM_CLASS = 'CcSubjsTableMap';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 8;
|
const NUM_COLUMNS = 11;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
@ -55,6 +55,15 @@ abstract class BaseCcSubjsPeer {
|
||||||
/** the column name for the LASTFAIL field */
|
/** the column name for the LASTFAIL field */
|
||||||
const LASTFAIL = 'cc_subjs.LASTFAIL';
|
const LASTFAIL = 'cc_subjs.LASTFAIL';
|
||||||
|
|
||||||
|
/** the column name for the SKYPE_CONTACT field */
|
||||||
|
const SKYPE_CONTACT = 'cc_subjs.SKYPE_CONTACT';
|
||||||
|
|
||||||
|
/** the column name for the JABBER_CONTACT field */
|
||||||
|
const JABBER_CONTACT = 'cc_subjs.JABBER_CONTACT';
|
||||||
|
|
||||||
|
/** the column name for the EMAIL field */
|
||||||
|
const EMAIL = 'cc_subjs.EMAIL';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An identiy map to hold any loaded instances of CcSubjs objects.
|
* An identiy map to hold any loaded instances of CcSubjs objects.
|
||||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||||
|
@ -71,12 +80,12 @@ abstract class BaseCcSubjsPeer {
|
||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbLogin', 'DbPass', 'DbType', 'DbFirstName', 'DbLastName', 'DbLastlogin', 'DbLastfail', ),
|
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbLogin', 'DbPass', 'DbType', 'DbFirstName', 'DbLastName', 'DbLastlogin', 'DbLastfail', 'DbSkypeContact', 'DbJabberContact', 'DbEmail', ),
|
||||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLogin', 'dbPass', 'dbType', 'dbFirstName', 'dbLastName', 'dbLastlogin', 'dbLastfail', ),
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLogin', 'dbPass', 'dbType', 'dbFirstName', 'dbLastName', 'dbLastlogin', 'dbLastfail', 'dbSkypeContact', 'dbJabberContact', 'dbEmail', ),
|
||||||
BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::FIRST_NAME, self::LAST_NAME, self::LASTLOGIN, self::LASTFAIL, ),
|
BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::FIRST_NAME, self::LAST_NAME, self::LASTLOGIN, self::LASTFAIL, self::SKYPE_CONTACT, self::JABBER_CONTACT, self::EMAIL, ),
|
||||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'FIRST_NAME', 'LAST_NAME', 'LASTLOGIN', 'LASTFAIL', ),
|
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'FIRST_NAME', 'LAST_NAME', 'LASTLOGIN', 'LASTFAIL', 'SKYPE_CONTACT', 'JABBER_CONTACT', 'EMAIL', ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'first_name', 'last_name', 'lastlogin', 'lastfail', ),
|
BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'first_name', 'last_name', 'lastlogin', 'lastfail', 'skype_contact', 'jabber_contact', 'email', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,12 +95,12 @@ abstract class BaseCcSubjsPeer {
|
||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbLogin' => 1, 'DbPass' => 2, 'DbType' => 3, 'DbFirstName' => 4, 'DbLastName' => 5, 'DbLastlogin' => 6, 'DbLastfail' => 7, ),
|
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbLogin' => 1, 'DbPass' => 2, 'DbType' => 3, 'DbFirstName' => 4, 'DbLastName' => 5, 'DbLastlogin' => 6, 'DbLastfail' => 7, 'DbSkypeContact' => 8, 'DbJabberContact' => 9, 'DbEmail' => 10, ),
|
||||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLogin' => 1, 'dbPass' => 2, 'dbType' => 3, 'dbFirstName' => 4, 'dbLastName' => 5, 'dbLastlogin' => 6, 'dbLastfail' => 7, ),
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLogin' => 1, 'dbPass' => 2, 'dbType' => 3, 'dbFirstName' => 4, 'dbLastName' => 5, 'dbLastlogin' => 6, 'dbLastfail' => 7, 'dbSkypeContact' => 8, 'dbJabberContact' => 9, 'dbEmail' => 10, ),
|
||||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::FIRST_NAME => 4, self::LAST_NAME => 5, self::LASTLOGIN => 6, self::LASTFAIL => 7, ),
|
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::FIRST_NAME => 4, self::LAST_NAME => 5, self::LASTLOGIN => 6, self::LASTFAIL => 7, self::SKYPE_CONTACT => 8, self::JABBER_CONTACT => 9, self::EMAIL => 10, ),
|
||||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'FIRST_NAME' => 4, 'LAST_NAME' => 5, 'LASTLOGIN' => 6, 'LASTFAIL' => 7, ),
|
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'FIRST_NAME' => 4, 'LAST_NAME' => 5, 'LASTLOGIN' => 6, 'LASTFAIL' => 7, 'SKYPE_CONTACT' => 8, 'JABBER_CONTACT' => 9, 'EMAIL' => 10, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'first_name' => 4, 'last_name' => 5, 'lastlogin' => 6, 'lastfail' => 7, ),
|
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'first_name' => 4, 'last_name' => 5, 'lastlogin' => 6, 'lastfail' => 7, 'skype_contact' => 8, 'jabber_contact' => 9, 'email' => 10, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,6 +180,9 @@ abstract class BaseCcSubjsPeer {
|
||||||
$criteria->addSelectColumn(CcSubjsPeer::LAST_NAME);
|
$criteria->addSelectColumn(CcSubjsPeer::LAST_NAME);
|
||||||
$criteria->addSelectColumn(CcSubjsPeer::LASTLOGIN);
|
$criteria->addSelectColumn(CcSubjsPeer::LASTLOGIN);
|
||||||
$criteria->addSelectColumn(CcSubjsPeer::LASTFAIL);
|
$criteria->addSelectColumn(CcSubjsPeer::LASTFAIL);
|
||||||
|
$criteria->addSelectColumn(CcSubjsPeer::SKYPE_CONTACT);
|
||||||
|
$criteria->addSelectColumn(CcSubjsPeer::JABBER_CONTACT);
|
||||||
|
$criteria->addSelectColumn(CcSubjsPeer::EMAIL);
|
||||||
} else {
|
} else {
|
||||||
$criteria->addSelectColumn($alias . '.ID');
|
$criteria->addSelectColumn($alias . '.ID');
|
||||||
$criteria->addSelectColumn($alias . '.LOGIN');
|
$criteria->addSelectColumn($alias . '.LOGIN');
|
||||||
|
@ -180,6 +192,9 @@ abstract class BaseCcSubjsPeer {
|
||||||
$criteria->addSelectColumn($alias . '.LAST_NAME');
|
$criteria->addSelectColumn($alias . '.LAST_NAME');
|
||||||
$criteria->addSelectColumn($alias . '.LASTLOGIN');
|
$criteria->addSelectColumn($alias . '.LASTLOGIN');
|
||||||
$criteria->addSelectColumn($alias . '.LASTFAIL');
|
$criteria->addSelectColumn($alias . '.LASTFAIL');
|
||||||
|
$criteria->addSelectColumn($alias . '.SKYPE_CONTACT');
|
||||||
|
$criteria->addSelectColumn($alias . '.JABBER_CONTACT');
|
||||||
|
$criteria->addSelectColumn($alias . '.EMAIL');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
* @method CcSubjsQuery orderByDbLastName($order = Criteria::ASC) Order by the last_name column
|
* @method CcSubjsQuery orderByDbLastName($order = Criteria::ASC) Order by the last_name column
|
||||||
* @method CcSubjsQuery orderByDbLastlogin($order = Criteria::ASC) Order by the lastlogin column
|
* @method CcSubjsQuery orderByDbLastlogin($order = Criteria::ASC) Order by the lastlogin column
|
||||||
* @method CcSubjsQuery orderByDbLastfail($order = Criteria::ASC) Order by the lastfail column
|
* @method CcSubjsQuery orderByDbLastfail($order = Criteria::ASC) Order by the lastfail column
|
||||||
|
* @method CcSubjsQuery orderByDbSkypeContact($order = Criteria::ASC) Order by the skype_contact column
|
||||||
|
* @method CcSubjsQuery orderByDbJabberContact($order = Criteria::ASC) Order by the jabber_contact column
|
||||||
|
* @method CcSubjsQuery orderByDbEmail($order = Criteria::ASC) Order by the email column
|
||||||
*
|
*
|
||||||
* @method CcSubjsQuery groupByDbId() Group by the id column
|
* @method CcSubjsQuery groupByDbId() Group by the id column
|
||||||
* @method CcSubjsQuery groupByDbLogin() Group by the login column
|
* @method CcSubjsQuery groupByDbLogin() Group by the login column
|
||||||
|
@ -23,6 +26,9 @@
|
||||||
* @method CcSubjsQuery groupByDbLastName() Group by the last_name column
|
* @method CcSubjsQuery groupByDbLastName() Group by the last_name column
|
||||||
* @method CcSubjsQuery groupByDbLastlogin() Group by the lastlogin column
|
* @method CcSubjsQuery groupByDbLastlogin() Group by the lastlogin column
|
||||||
* @method CcSubjsQuery groupByDbLastfail() Group by the lastfail column
|
* @method CcSubjsQuery groupByDbLastfail() Group by the lastfail column
|
||||||
|
* @method CcSubjsQuery groupByDbSkypeContact() Group by the skype_contact column
|
||||||
|
* @method CcSubjsQuery groupByDbJabberContact() Group by the jabber_contact column
|
||||||
|
* @method CcSubjsQuery groupByDbEmail() Group by the email column
|
||||||
*
|
*
|
||||||
* @method CcSubjsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
* @method CcSubjsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
* @method CcSubjsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
* @method CcSubjsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
@ -67,6 +73,9 @@
|
||||||
* @method CcSubjs findOneByDbLastName(string $last_name) Return the first CcSubjs filtered by the last_name column
|
* @method CcSubjs findOneByDbLastName(string $last_name) Return the first CcSubjs filtered by the last_name column
|
||||||
* @method CcSubjs findOneByDbLastlogin(string $lastlogin) Return the first CcSubjs filtered by the lastlogin column
|
* @method CcSubjs findOneByDbLastlogin(string $lastlogin) Return the first CcSubjs filtered by the lastlogin column
|
||||||
* @method CcSubjs findOneByDbLastfail(string $lastfail) Return the first CcSubjs filtered by the lastfail column
|
* @method CcSubjs findOneByDbLastfail(string $lastfail) Return the first CcSubjs filtered by the lastfail column
|
||||||
|
* @method CcSubjs findOneByDbSkypeContact(string $skype_contact) Return the first CcSubjs filtered by the skype_contact column
|
||||||
|
* @method CcSubjs findOneByDbJabberContact(string $jabber_contact) Return the first CcSubjs filtered by the jabber_contact column
|
||||||
|
* @method CcSubjs findOneByDbEmail(string $email) Return the first CcSubjs filtered by the email column
|
||||||
*
|
*
|
||||||
* @method array findByDbId(int $id) Return CcSubjs objects filtered by the id column
|
* @method array findByDbId(int $id) Return CcSubjs objects filtered by the id column
|
||||||
* @method array findByDbLogin(string $login) Return CcSubjs objects filtered by the login column
|
* @method array findByDbLogin(string $login) Return CcSubjs objects filtered by the login column
|
||||||
|
@ -76,6 +85,9 @@
|
||||||
* @method array findByDbLastName(string $last_name) Return CcSubjs objects filtered by the last_name column
|
* @method array findByDbLastName(string $last_name) Return CcSubjs objects filtered by the last_name column
|
||||||
* @method array findByDbLastlogin(string $lastlogin) Return CcSubjs objects filtered by the lastlogin column
|
* @method array findByDbLastlogin(string $lastlogin) Return CcSubjs objects filtered by the lastlogin column
|
||||||
* @method array findByDbLastfail(string $lastfail) Return CcSubjs objects filtered by the lastfail column
|
* @method array findByDbLastfail(string $lastfail) Return CcSubjs objects filtered by the lastfail column
|
||||||
|
* @method array findByDbSkypeContact(string $skype_contact) Return CcSubjs objects filtered by the skype_contact column
|
||||||
|
* @method array findByDbJabberContact(string $jabber_contact) Return CcSubjs objects filtered by the jabber_contact column
|
||||||
|
* @method array findByDbEmail(string $email) Return CcSubjs objects filtered by the email column
|
||||||
*
|
*
|
||||||
* @package propel.generator.airtime.om
|
* @package propel.generator.airtime.om
|
||||||
*/
|
*/
|
||||||
|
@ -374,6 +386,72 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
|
||||||
return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail, $comparison);
|
return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail, $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the skype_contact column
|
||||||
|
*
|
||||||
|
* @param string $dbSkypeContact The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcSubjsQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbSkypeContact($dbSkypeContact = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbSkypeContact)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbSkypeContact)) {
|
||||||
|
$dbSkypeContact = str_replace('*', '%', $dbSkypeContact);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcSubjsPeer::SKYPE_CONTACT, $dbSkypeContact, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the jabber_contact column
|
||||||
|
*
|
||||||
|
* @param string $dbJabberContact The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcSubjsQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbJabberContact($dbJabberContact = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbJabberContact)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbJabberContact)) {
|
||||||
|
$dbJabberContact = str_replace('*', '%', $dbJabberContact);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcSubjsPeer::JABBER_CONTACT, $dbJabberContact, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the email column
|
||||||
|
*
|
||||||
|
* @param string $dbEmail The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcSubjsQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbEmail($dbEmail = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbEmail)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbEmail)) {
|
||||||
|
$dbEmail = str_replace('*', '%', $dbEmail);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcSubjsPeer::EMAIL, $dbEmail, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the query by a related CcAccess object
|
* Filter the query by a related CcAccess object
|
||||||
*
|
*
|
||||||
|
|
26
application/validate/UserNameValidate.php
Normal file
26
application/validate/UserNameValidate.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Application_Validate_UserNameValidate extends Zend_Validate_Abstract
|
||||||
|
{
|
||||||
|
const LOGIN = 'login';
|
||||||
|
|
||||||
|
protected $_messageTemplates = array(
|
||||||
|
self::LOGIN => "'%value%' is already taken"
|
||||||
|
);
|
||||||
|
|
||||||
|
public function isValid($value)
|
||||||
|
{
|
||||||
|
$this->_setValue($value);
|
||||||
|
|
||||||
|
$count = CcSubjsQuery::create()->filterByDbLogin($value)->count();
|
||||||
|
|
||||||
|
if ($count != 0) {
|
||||||
|
$this->_error(self::LOGIN);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -1,26 +1,19 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
//echo $this->form;
|
|
||||||
?>
|
|
||||||
<div class=
|
<div class=
|
||||||
"ui-widget ui-widget-content block-shadow clearfix padded-strong user-management">
|
"ui-widget ui-widget-content block-shadow clearfix padded-strong user-management">
|
||||||
<h2>
|
<h2>
|
||||||
Manage users
|
Manage users
|
||||||
</h2>
|
</h2>
|
||||||
<div class="user-list-wrapper">
|
<div class="user-list-wrapper">
|
||||||
<div id="schedule_playlists_wrapper" class="dataTables_wrapper">
|
<div id="users_wrapper" class="dataTables_wrapper">
|
||||||
<div class=
|
|
||||||
"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
|
<div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
|
||||||
<div class="dataTables_filter" id="schedule_playlists_filter">
|
|
||||||
<input type="text" class="input_text auto-search">
|
|
||||||
</div>
|
|
||||||
<div class="button-holder">
|
<div class="button-holder">
|
||||||
<button type="button" id="search_add_group" name=
|
<button type="button" id="add_user_button" name=
|
||||||
"search_add_group" class=
|
"search_add_group" class="ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||||
"ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
|
||||||
<span class="ui-button-text">Add user</span></button>
|
<span class="ui-button-text">Add user</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table cellspacing="0" cellpadding="0" style="" id="users_datatable" class="datatable">
|
<table cellspacing="0" cellpadding="0" style="" id="users_datatable" class="datatable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -34,93 +27,9 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="user-data simple-formblock">
|
<div class="user-data simple-formblock" id="user_details">
|
||||||
<fieldset class="padded">
|
<fieldset class="padded">
|
||||||
<?php echo $this->form ?>
|
<?php echo $this->form ?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
|
||||||
<div class="user-data simple-formblock">
|
|
||||||
<form method="post" action="" enctype=
|
|
||||||
"application/x-www-form-urlencoded">
|
|
||||||
<fieldset class="padded">
|
|
||||||
<dl class="zend_form">
|
|
||||||
<dt id="first_name-label">
|
|
||||||
<label class="required" for="first_name">Firstname:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="first_name-element">
|
|
||||||
<input type="text" value="" id="first_name" name="first_name"
|
|
||||||
class="input_text">
|
|
||||||
</dd>
|
|
||||||
<dt id="last_name-label">
|
|
||||||
<label class="required" for="last_name">Lastname:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="last_name-element">
|
|
||||||
<input type="text" value="" id="last_name" name="last_name"
|
|
||||||
class="input_text">
|
|
||||||
</dd>
|
|
||||||
<dt id="login-label">
|
|
||||||
<label class="required" for="login">Username:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="login-element">
|
|
||||||
<input type="text" value="" id="login" name="login" class=
|
|
||||||
"input_text">
|
|
||||||
</dd>
|
|
||||||
<dt id="password-label">
|
|
||||||
<label class="required" for="password">Password:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="password-element">
|
|
||||||
<input type="text" value="" id="password" name="password"
|
|
||||||
class="input_text">
|
|
||||||
</dd>
|
|
||||||
<dt id="type-label">
|
|
||||||
<label class="required" for="type">Role:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="type-element">
|
|
||||||
<select id="type" name="type" class="input_select" style=
|
|
||||||
"width:40%;">
|
|
||||||
<option label="admin" value="A">
|
|
||||||
admin
|
|
||||||
</option>
|
|
||||||
<option label="host" value="H">
|
|
||||||
host
|
|
||||||
</option>
|
|
||||||
<option label="guest" value="G">
|
|
||||||
guest
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset class="padded">
|
|
||||||
<dl class="zend_form">
|
|
||||||
<dt id="skype-label">
|
|
||||||
<label class="required" for="skype_name">Skype:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="skype-element">
|
|
||||||
<input type="text" value="" id="skype_name" name="skype_name"
|
|
||||||
class="input_text">
|
|
||||||
</dd>
|
|
||||||
<dt id="jabber-label">
|
|
||||||
<label class="required" for="jabber_name">Jabber:</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="jabbert_name-element">
|
|
||||||
<input type="text" value="" id="jabber_name" name="jabber_name"
|
|
||||||
class="input_text">
|
|
||||||
</dd>
|
|
||||||
<dt id="email-label">
|
|
||||||
<label class="required" for="email">Email</label>
|
|
||||||
</dt>
|
|
||||||
<dd id="email-element">
|
|
||||||
<input type="text" value="" id="email" name="email" class=
|
|
||||||
"input_text">
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset class="padded">
|
|
||||||
<input type="submit" value="Save all" id="submit" name="submit"
|
|
||||||
class="ui-button ui-state-default right-floated">
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
</div>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
3
application/views/scripts/user/get-user-data.phtml
Normal file
3
application/views/scripts/user/get-user-data.phtml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
echo $this->entries;
|
||||||
|
?>
|
3
application/views/scripts/user/remove-user.phtml
Normal file
3
application/views/scripts/user/remove-user.phtml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
echo this->entries;
|
||||||
|
?>
|
|
@ -1,6 +1,6 @@
|
||||||
#Note: project.home is automatically generated by the propel-install script.
|
#Note: project.home is automatically generated by the propel-install script.
|
||||||
#Any manual changes to this value will be overwritten.
|
#Any manual changes to this value will be overwritten.
|
||||||
project.home = /home/naomiaro/dev-campcaster/campcaster
|
project.home = /home/martin/workspace/airtime
|
||||||
project.build = ${project.home}/build
|
project.build = ${project.home}/build
|
||||||
|
|
||||||
#Database driver
|
#Database driver
|
||||||
|
|
|
@ -264,6 +264,9 @@
|
||||||
<column name="last_name" phpName="DbLastName" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
<column name="last_name" phpName="DbLastName" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
||||||
<column name="lastlogin" phpName="DbLastlogin" type="TIMESTAMP" required="false"/>
|
<column name="lastlogin" phpName="DbLastlogin" type="TIMESTAMP" required="false"/>
|
||||||
<column name="lastfail" phpName="DbLastfail" type="TIMESTAMP" required="false"/>
|
<column name="lastfail" phpName="DbLastfail" type="TIMESTAMP" required="false"/>
|
||||||
|
<column name="skype_contact" phpName="DbSkypeContact" type="VARCHAR" required="false"/>
|
||||||
|
<column name="jabber_contact" phpName="DbJabberContact" type="VARCHAR" required="false"/>
|
||||||
|
<column name="email" phpName="DbEmail" type="VARCHAR" required="false"/>
|
||||||
<unique name="cc_subjs_id_idx">
|
<unique name="cc_subjs_id_idx">
|
||||||
<unique-column name="id"/>
|
<unique-column name="id"/>
|
||||||
</unique>
|
</unique>
|
||||||
|
|
|
@ -402,6 +402,9 @@ CREATE TABLE "cc_subjs"
|
||||||
"last_name" VARCHAR(255) default '' NOT NULL,
|
"last_name" VARCHAR(255) default '' NOT NULL,
|
||||||
"lastlogin" TIMESTAMP,
|
"lastlogin" TIMESTAMP,
|
||||||
"lastfail" TIMESTAMP,
|
"lastfail" TIMESTAMP,
|
||||||
|
"skype_contact" VARCHAR(255),
|
||||||
|
"jabber_contact" VARCHAR(255),
|
||||||
|
"email" VARCHAR(255),
|
||||||
PRIMARY KEY ("id"),
|
PRIMARY KEY ("id"),
|
||||||
CONSTRAINT "cc_subjs_id_idx" UNIQUE ("id"),
|
CONSTRAINT "cc_subjs_id_idx" UNIQUE ("id"),
|
||||||
CONSTRAINT "cc_subjs_login_idx" UNIQUE ("login")
|
CONSTRAINT "cc_subjs_login_idx" UNIQUE ("login")
|
||||||
|
|
|
@ -516,6 +516,25 @@ dl.inline-list dd {
|
||||||
padding: 0.2em 1em;
|
padding: 0.2em 1em;
|
||||||
margin-right:3px;
|
margin-right:3px;
|
||||||
}
|
}
|
||||||
|
.dataTables_filter input {
|
||||||
|
background: url("images/search_auto_bg.png") no-repeat scroll 0 0 #DDDDDD;
|
||||||
|
text-indent: 25px;
|
||||||
|
width: 60%;
|
||||||
|
border: 1px solid #5B5B5B;
|
||||||
|
height: 23px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.dataTables_length select {
|
||||||
|
background-color: #DDDDDD;
|
||||||
|
border: 1px solid #5B5B5B;
|
||||||
|
font-family: Arial,Helvetica,sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
height: 25px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px 2px 2px 0;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
/*----END Data Table----*/
|
/*----END Data Table----*/
|
||||||
|
|
||||||
|
@ -848,7 +867,6 @@ div.ui-datepicker {
|
||||||
margin-right:22px;
|
margin-right:22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#schedule_playlist_chosen li > div > div > span {
|
#schedule_playlist_chosen li > div > div > span {
|
||||||
float: right;
|
float: right;
|
||||||
margin-right:46px;
|
margin-right:46px;
|
||||||
|
@ -1088,7 +1106,7 @@ button, input {
|
||||||
font-size: 1.7em;
|
font-size: 1.7em;
|
||||||
padding-bottom: 16px;
|
padding-bottom: 16px;
|
||||||
}
|
}
|
||||||
.user-management .dataTables_filter .auto-search {
|
.user-management .dataTables_filter input {
|
||||||
width: 378px;
|
width: 378px;
|
||||||
}
|
}
|
||||||
.user-data.simple-formblock dd {
|
.user-data.simple-formblock dd {
|
||||||
|
@ -1119,4 +1137,6 @@ button, input {
|
||||||
background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png);
|
background-image:url(redmond/images/ui-icons_ff5d1a_256x240.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ui-datepicker-div { z-index: 10 !important }
|
#ui-datepicker-div { z-index: 10 !important }
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,42 @@
|
||||||
|
function populateForm(entries){
|
||||||
|
//$('#user_details').show();
|
||||||
|
|
||||||
|
$('.errors').remove();
|
||||||
|
|
||||||
|
$('#user_id').val(entries.id);
|
||||||
|
$('#login').val(entries.login);
|
||||||
|
$('#first_name').val(entries.first_name);
|
||||||
|
$('#last_name').val(entries.last_name);
|
||||||
|
$('#type').val(entries.type);
|
||||||
|
|
||||||
|
if (entries.id.length != 0){
|
||||||
|
$('#login').attr('readonly', 'readonly');
|
||||||
|
$('#password').val("xxxxxx");
|
||||||
|
} else {
|
||||||
|
$('#login').removeAttr('readonly');
|
||||||
|
$('#password').val("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rowClickCallback(row_id){
|
||||||
|
$.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
|
||||||
|
populateForm(data.entries);
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeUserCallback(row_id, nRow){
|
||||||
|
$.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
|
||||||
|
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
|
||||||
|
function rowCallback( nRow, aData, iDisplayIndex ){
|
||||||
|
$(nRow).click(function(){rowClickCallback(aData[0])});
|
||||||
|
$('td:eq(2)', nRow).append( '<span class="ui-icon ui-icon-closethick"></span>').children('span').click(function(e){e.stopPropagation(); removeUserCallback(aData[0], nRow)});
|
||||||
|
|
||||||
|
return nRow;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#users_datatable').dataTable( {
|
$('#users_datatable').dataTable( {
|
||||||
"bProcessing": true,
|
"bProcessing": true,
|
||||||
|
@ -12,15 +51,22 @@ $(document).ready(function() {
|
||||||
"success": fnCallback
|
"success": fnCallback
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
"fnRowCallback": rowCallback,
|
||||||
"aoColumns": [
|
"aoColumns": [
|
||||||
/* Id */ { "sName": "id", "bSearchable": false, "bVisible": false },
|
/* Id */ { "sName": "id", "bSearchable": false, "bVisible": false },
|
||||||
/* user name */ { "sName": "login" },
|
/* user name */ { "sName": "login" },
|
||||||
/* user type */ { "sName": "type", "bSearchable": false },
|
/* user type */ { "sName": "type", "bSearchable": false },
|
||||||
/* del button */ { "sName": "first_name", "bSearchable": false, "bSortable": false}
|
/* del button */ { "sName": "null as delete", "bSearchable": false, "bSortable": false}
|
||||||
],
|
],
|
||||||
"bJQueryUI": true,
|
"bJQueryUI": true,
|
||||||
"bAutoWidth": false,
|
"bAutoWidth": false,
|
||||||
"bLengthChange": false,
|
"bLengthChange": false
|
||||||
//"bFilter": false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//$('#user_details').hide();
|
||||||
|
|
||||||
|
var newUser = {login:"", first_name:"", last_name:"", type:"G", id:""};
|
||||||
|
|
||||||
|
$('#add_user_button').click(function(){populateForm(newUser)});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue