owner patch
This commit is contained in:
parent
0301a9bec8
commit
39861f1b86
|
@ -170,6 +170,11 @@ class asteriskExtensionNewUI extends baseModule {
|
|||
* @return htmlElement HTML meta data
|
||||
*/
|
||||
function display_html_attributes() {
|
||||
//Set default owner as logged in user if flag is set and no other owner is set
|
||||
if ( $this->isBooleanConfigOptionSet('asteriskExtension_UseCreatorAsOwner') && ! $this->isExtensionOwnerSet()){
|
||||
$this->setDefaultExtensionOwner();
|
||||
}
|
||||
|
||||
$return = new htmlTable();
|
||||
|
||||
$extName = '';
|
||||
|
@ -183,9 +188,7 @@ class asteriskExtensionNewUI extends baseModule {
|
|||
$this->render_extensions_by_priority($extName, $return);
|
||||
|
||||
// owners
|
||||
if (!$this->isBooleanConfigOptionSet('asteriskExtension_UseCreatorAsOwner')) {
|
||||
$this->render_exten_owners_set_controls($return);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
@ -477,6 +480,16 @@ class asteriskExtensionNewUI extends baseModule {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if even one owner is set and false otherwise
|
||||
*/
|
||||
function isExtensionOwnerSet(){
|
||||
if(sizeof($this->extensionOwners) > 0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write variables into object and do some regex checks
|
||||
*
|
||||
|
@ -531,11 +544,6 @@ class asteriskExtensionNewUI extends baseModule {
|
|||
$errors = array();
|
||||
if (isset($_POST['extension_rows']) && get_preg($_POST['extension_rows'], 'digit')) {
|
||||
|
||||
//handle situation where we mast add current loged user as extension owner
|
||||
if ($this->isBooleanConfigOptionSet('asteriskExtension_UseCreatorAsOwner')){
|
||||
$this->setDefaultExtensionOwner();
|
||||
}
|
||||
|
||||
$extensionPriorityCntr = 1;
|
||||
$this->extensionRows = array();
|
||||
for ($entryCounter = 0; $entryCounter < $_POST['extension_rows']; $entryCounter++) {
|
||||
|
|
Loading…
Reference in New Issue