diff --git a/app/call_block/app_languages.php b/app/call_block/app_languages.php index bf329113ba..42845acfba 100644 --- a/app/call_block/app_languages.php +++ b/app/call_block/app_languages.php @@ -350,6 +350,31 @@ $text['label-busy']['de-at'] = "Besetzt"; $text['label-busy']['ar-eg'] = "مشغول"; $text['label-busy']['he'] = "תפוס"; +$text['label-hold']['en-us'] = "Hold"; +$text['label-hold']['es-cl'] = ""; +$text['label-hold']['pt-pt'] = ""; +$text['label-hold']['fr-fr'] = ""; +$text['label-hold']['nl-nl'] = ""; +$text['label-hold']['pt-br'] = ""; +$text['label-hold']['pl'] = ""; +$text['label-hold']['sv-se'] = ""; +$text['label-hold']['uk'] = ""; +$text['label-hold']['ro'] = ""; +$text['label-hold']['de-at'] = ""; +$text['label-hold']['ar-eg'] = ""; +$text['label-hold']['he'] = ""; + +$text['label-voicemail']['en-us'] = "Voicemail"; +$text['label-voicemail']['es-cl'] = "Correo de Voz"; +$text['label-voicemail']['pt-pt'] = "Correio de Voz"; +$text['label-voicemail']['fr-fr'] = "Messagerie Vocale"; +$text['label-voicemail']['pt-br'] = "Correio de voz"; +$text['label-voicemail']['pl'] = "Poczta głosowa"; +$text['label-voicemail']['sv-se'] = "Röstbrevlåda"; +$text['label-voicemail']['uk'] = "Голосова пошта"; +$text['label-voicemail']['de-at'] = "Mailbox"; +$text['label-voicemail']['he'] = "תא קולי"; + $text['label-add-note']['en-us'] = "Block calls from a number. Either select a number from the list above or enter the number, name and enable below."; $text['label-add-note']['es-cl'] = "Bloquea llamadas desde un número. Puede elegir un número de la lista de arriba o ingresar el nú, nombre y activarlo abajo."; $text['label-add-note']['pt-pt'] = "Bloquear chamadas a partir de um número. Seleccione um número a partir da lista indicada ou introduza um número, nome e active."; diff --git a/app/call_block/call_block_edit.php b/app/call_block/call_block_edit.php index 91e78e0efc..8cae586146 100644 --- a/app/call_block/call_block_edit.php +++ b/app/call_block/call_block_edit.php @@ -44,7 +44,7 @@ else { //define the call_block_get_extensions function function call_block_get_extensions($select_extension) { - global $db; + global $db, $text; //list voicemail $sql = "select extension, user_context, description from v_extensions "; @@ -55,12 +55,12 @@ else { $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); - echo "\n"; + echo "\n"; foreach ($result as &$row) { $extension = $row["extension"]; $context = $row["user_context"]; $description = $row["description"]; - if ($extension == $select_extension) $selected = "SELECTED"; + if ($extension == $select_extension) $selected = "selected='selected'"; echo " \n"; $selected = ""; } @@ -77,7 +77,7 @@ else { } //get http post variables and set them to php variables - if (count($_POST)>0) { + if (count($_POST) > 0) { $call_block_name = check_str($_POST["call_block_name"]); $call_block_number = check_str($_POST["call_block_number"]); $call_block_action = check_str($_POST["call_block_action"]); @@ -167,7 +167,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $result = $prep_statement->fetchAll(); $result_count = count($result); if ($result_count > 0) { - $call_block_number = $result[0]["call_block_number"]; + //set the domain_name $domain_name = $result[0]["domain_name"]; //clear the cache @@ -298,6 +298,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { else { echo " \n"; } + if ($action == "Hold") { + echo " \n"; + } + else { + echo " \n"; + } call_block_get_extensions($extension); echo " \n"; echo "
\n"; diff --git a/app/contacts/contact_address_edit.php b/app/contacts/contact_address_edit.php index c0b679289e..ef67242594 100644 --- a/app/contacts/contact_address_edit.php +++ b/app/contacts/contact_address_edit.php @@ -48,9 +48,10 @@ else { $action = "add"; } -if (strlen($_GET["contact_uuid"]) > 0) { - $contact_uuid = check_str($_GET["contact_uuid"]); -} +//get the contact uuid + if (strlen($_GET["contact_uuid"]) > 0) { + $contact_uuid = check_str($_GET["contact_uuid"]); + } //get http post variables and set them to php variables if (count($_POST)>0) { @@ -73,114 +74,125 @@ if (strlen($_GET["contact_uuid"]) > 0) { $address_label = ($address_label_custom != '') ? $address_label_custom : $address_label; } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_address_uuid = check_str($_POST["contact_address_uuid"]); - } + //set the uuid + if ($action == "update") { + $contact_address_uuid = check_str($_POST["contact_address_uuid"]); + } - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //add or update the database + if ($_POST["persistformvar"] != "true") { - //if primary, unmark other primary numbers - if ($address_primary) { - $sql = "update v_contact_addresses set address_primary = 0 "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); - } + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "add") { - $contact_address_uuid = uuid(); - $sql = "insert into v_contact_addresses "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_address_uuid, "; - $sql .= "address_type, "; - $sql .= "address_label, "; - $sql .= "address_street, "; - $sql .= "address_extended, "; - $sql .= "address_community, "; - $sql .= "address_locality, "; - $sql .= "address_region, "; - $sql .= "address_postal_code, "; - $sql .= "address_country, "; - $sql .= "address_latitude, "; - $sql .= "address_longitude, "; - $sql .= "address_primary, "; - $sql .= "address_description "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$contact_address_uuid."', "; - $sql .= "'".$address_type."', "; - $sql .= "'".$address_label."', "; - $sql .= "'".$address_street."', "; - $sql .= "'".$address_extended."', "; - $sql .= "'".$address_community."', "; - $sql .= "'".$address_locality."', "; - $sql .= "'".$address_region."', "; - $sql .= "'".$address_postal_code."', "; - $sql .= "'".$address_country."', "; - $sql .= "'".$address_latitude."', "; - $sql .= "'".$address_longitude."', "; - $sql .= (($address_primary) ? 1 : 0).", "; - $sql .= "'".$address_description."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //if primary, unmark other primary numbers + if ($address_primary) { + $sql = "update v_contact_addresses set address_primary = 0 "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + if ($action == "add") { + $contact_address_uuid = uuid(); + $sql = "insert into v_contact_addresses "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_address_uuid, "; + $sql .= "address_type, "; + $sql .= "address_label, "; + $sql .= "address_street, "; + $sql .= "address_extended, "; + $sql .= "address_community, "; + $sql .= "address_locality, "; + $sql .= "address_region, "; + $sql .= "address_postal_code, "; + $sql .= "address_country, "; + $sql .= "address_latitude, "; + $sql .= "address_longitude, "; + $sql .= "address_primary, "; + $sql .= "address_description "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$contact_address_uuid."', "; + $sql .= "'".$address_type."', "; + $sql .= "'".$address_label."', "; + $sql .= "'".$address_street."', "; + $sql .= "'".$address_extended."', "; + $sql .= "'".$address_community."', "; + $sql .= "'".$address_locality."', "; + $sql .= "'".$address_region."', "; + $sql .= "'".$address_postal_code."', "; + $sql .= "'".$address_country."', "; + $sql .= "'".$address_latitude."', "; + $sql .= "'".$address_longitude."', "; + $sql .= (($address_primary) ? 1 : 0).", "; + $sql .= "'".$address_description."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "update") { - $sql = "update v_contact_addresses set "; - $sql .= "contact_uuid = '".$contact_uuid."', "; - $sql .= "address_type = '".$address_type."', "; - $sql .= "address_label = '".$address_label."', "; - $sql .= "address_street = '".$address_street."', "; - $sql .= "address_extended = '".$address_extended."', "; - $sql .= "address_community = '".$address_community."', "; - $sql .= "address_locality = '".$address_locality."', "; - $sql .= "address_region = '".$address_region."', "; - $sql .= "address_postal_code = '".$address_postal_code."', "; - $sql .= "address_country = '".$address_country."', "; - $sql .= "address_latitude = '".$address_latitude."', "; - $sql .= "address_longitude = '".$address_longitude."', "; - $sql .= "address_primary = ".(($address_primary) ? 1 : 0).", "; - $sql .= "address_description = '".$address_description."' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_address_uuid = '".$contact_address_uuid."'"; - $db->exec(check_sql($sql)); - unset($sql); + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + if ($action == "update") { + $sql = "update v_contact_addresses set "; + $sql .= "contact_uuid = '".$contact_uuid."', "; + $sql .= "address_type = '".$address_type."', "; + $sql .= "address_label = '".$address_label."', "; + $sql .= "address_street = '".$address_street."', "; + $sql .= "address_extended = '".$address_extended."', "; + $sql .= "address_community = '".$address_community."', "; + $sql .= "address_locality = '".$address_locality."', "; + $sql .= "address_region = '".$address_region."', "; + $sql .= "address_postal_code = '".$address_postal_code."', "; + $sql .= "address_country = '".$address_country."', "; + $sql .= "address_latitude = '".$address_latitude."', "; + $sql .= "address_longitude = '".$address_longitude."', "; + $sql .= "address_primary = ".(($address_primary) ? 1 : 0).", "; + $sql .= "address_description = '".$address_description."' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_address_uuid = '".$contact_address_uuid."'"; + $db->exec(check_sql($sql)); + unset($sql); + + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 1021c2d4f8..ad313bc68d 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -79,171 +79,182 @@ else { $contact_note = check_str($_POST["contact_note"]); } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_uuid = check_str($_POST["contact_uuid"]); - } + //set the uuid + if ($action == "update") { + $contact_uuid = check_str($_POST["contact_uuid"]); + } - //check for all required data - //if (strlen($contact_type) == 0) { $msg .= $text['message-required'].$text['label-contact_type']."
\n"; } - //if (strlen($contact_organization) == 0) { $msg .= $text['message-required'].$text['label-contact_organization']."
\n"; } - //if (strlen($contact_name_prefix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_prefix']."
\n"; } - //if (strlen($contact_name_given) == 0) { $msg .= $text['message-required'].$text['label-contact_name_given']."
\n"; } - //if (strlen($contact_name_middle) == 0) { $msg .= $text['message-required'].$text['label-contact_name_middle']."
\n"; } - //if (strlen($contact_name_family) == 0) { $msg .= $text['message-required'].$text['label-contact_name_family']."
\n"; } - //if (strlen($contact_name_suffix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_suffix']."
\n"; } - //if (strlen($contact_nickname) == 0) { $msg .= $text['message-required'].$text['label-contact_nickname']."
\n"; } - //if (strlen($contact_title) == 0) { $msg .= $text['message-required'].$text['label-contact_title']."
\n"; } - //if (strlen($contact_role) == 0) { $msg .= $text['message-required'].$text['label-contact_role']."
\n"; } - //if (strlen($contact_time_zone) == 0) { $msg .= $text['message-required'].$text['label-contact_time_zone']."
\n"; } - //if (strlen($contact_note) == 0) { $msg .= $text['message-required'].$text['label-contact_note']."
\n"; } - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + //if (strlen($contact_type) == 0) { $msg .= $text['message-required'].$text['label-contact_type']."
\n"; } + //if (strlen($contact_organization) == 0) { $msg .= $text['message-required'].$text['label-contact_organization']."
\n"; } + //if (strlen($contact_name_prefix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_prefix']."
\n"; } + //if (strlen($contact_name_given) == 0) { $msg .= $text['message-required'].$text['label-contact_name_given']."
\n"; } + //if (strlen($contact_name_middle) == 0) { $msg .= $text['message-required'].$text['label-contact_name_middle']."
\n"; } + //if (strlen($contact_name_family) == 0) { $msg .= $text['message-required'].$text['label-contact_name_family']."
\n"; } + //if (strlen($contact_name_suffix) == 0) { $msg .= $text['message-required'].$text['label-contact_name_suffix']."
\n"; } + //if (strlen($contact_nickname) == 0) { $msg .= $text['message-required'].$text['label-contact_nickname']."
\n"; } + //if (strlen($contact_title) == 0) { $msg .= $text['message-required'].$text['label-contact_title']."
\n"; } + //if (strlen($contact_role) == 0) { $msg .= $text['message-required'].$text['label-contact_role']."
\n"; } + //if (strlen($contact_time_zone) == 0) { $msg .= $text['message-required'].$text['label-contact_time_zone']."
\n"; } + //if (strlen($contact_note) == 0) { $msg .= $text['message-required'].$text['label-contact_note']."
\n"; } + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //add or update the database + if ($_POST["persistformvar"] != "true") { - if ($action == "add") { - $contact_uuid = uuid(); - $sql = "insert into v_contacts "; - $sql .= "( "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_type, "; - $sql .= "contact_organization, "; - $sql .= "contact_name_prefix, "; - $sql .= "contact_name_given, "; - $sql .= "contact_name_middle, "; - $sql .= "contact_name_family, "; - $sql .= "contact_name_suffix, "; - $sql .= "contact_nickname, "; - $sql .= "contact_title, "; - $sql .= "contact_category, "; - $sql .= "contact_role, "; - $sql .= "contact_time_zone, "; - $sql .= "contact_note, "; - $sql .= "last_mod_date, "; - $sql .= "last_mod_user "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$contact_type."', "; - $sql .= "'".$contact_organization."', "; - $sql .= "'".$contact_name_prefix."', "; - $sql .= "'".$contact_name_given."', "; - $sql .= "'".$contact_name_middle."', "; - $sql .= "'".$contact_name_family."', "; - $sql .= "'".$contact_name_suffix."', "; - $sql .= "'".$contact_nickname."', "; - $sql .= "'".$contact_title."', "; - $sql .= "'".$contact_category."', "; - $sql .= "'".$contact_role."', "; - $sql .= "'".$contact_time_zone."', "; - $sql .= "'".$contact_note."', "; - $sql .= "now(), "; - $sql .= "'".$_SESSION['username']."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - $_SESSION["message"] = $text['message-add']; - $location = "contact_edit.php?id=".$contact_uuid; - } //if ($action == "add") + if ($action == "add") { + $contact_uuid = uuid(); + $sql = "insert into v_contacts "; + $sql .= "( "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_type, "; + $sql .= "contact_organization, "; + $sql .= "contact_name_prefix, "; + $sql .= "contact_name_given, "; + $sql .= "contact_name_middle, "; + $sql .= "contact_name_family, "; + $sql .= "contact_name_suffix, "; + $sql .= "contact_nickname, "; + $sql .= "contact_title, "; + $sql .= "contact_category, "; + $sql .= "contact_role, "; + $sql .= "contact_time_zone, "; + $sql .= "contact_note, "; + $sql .= "last_mod_date, "; + $sql .= "last_mod_user "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$contact_type."', "; + $sql .= "'".$contact_organization."', "; + $sql .= "'".$contact_name_prefix."', "; + $sql .= "'".$contact_name_given."', "; + $sql .= "'".$contact_name_middle."', "; + $sql .= "'".$contact_name_family."', "; + $sql .= "'".$contact_name_suffix."', "; + $sql .= "'".$contact_nickname."', "; + $sql .= "'".$contact_title."', "; + $sql .= "'".$contact_category."', "; + $sql .= "'".$contact_role."', "; + $sql .= "'".$contact_time_zone."', "; + $sql .= "'".$contact_note."', "; + $sql .= "now(), "; + $sql .= "'".$_SESSION['username']."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - //if contact is shared, remove contact group record containing user's uuid - if ($_POST['contact_shared'] == 'true') { - $sql = "delete from v_contact_groups "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $sql .= "and group_uuid = '".$_SESSION["user_uuid"]."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - unset($prep_statement, $sql); - $group_uuid = $_POST['group_uuid']; - } - //if private contact, delete any groups currently assigned, set group uuid to user's uuid - else { - $sql = "delete from v_contact_groups "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - unset($prep_statement, $sql); - $group_uuid = $_SESSION["user_uuid"]; - } + $_SESSION["message"] = $text['message-add']; + $location = "contact_edit.php?id=".$contact_uuid; + } //if ($action == "add") - //handle insertion of contact group (or private contact, if not shared) - if ($group_uuid != '') { - $sql = "insert into v_contact_groups "; - $sql .= "( "; - $sql .= "contact_group_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "group_uuid "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".uuid()."', "; - $sql .= "'".$domain_uuid."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$group_uuid."' "; - $sql .= ") "; - $db->exec(check_sql($sql)); - unset($sql); - } + //if contact is shared, remove contact group record containing user's uuid + if ($_POST['contact_shared'] == 'true') { + $sql = "delete from v_contact_groups "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $sql .= "and group_uuid = '".$_SESSION["user_uuid"]."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + unset($prep_statement, $sql); + $group_uuid = $_POST['group_uuid']; + } + //if private contact, delete any groups currently assigned, set group uuid to user's uuid + else { + $sql = "delete from v_contact_groups "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + unset($prep_statement, $sql); + $group_uuid = $_SESSION["user_uuid"]; + } - if ($action == "update") { - $sql = "update v_contacts set "; - $sql .= "contact_type = '".$contact_type."', "; - $sql .= "contact_organization = '".$contact_organization."', "; - $sql .= "contact_name_prefix = '".$contact_name_prefix."', "; - $sql .= "contact_name_given = '".$contact_name_given."', "; - $sql .= "contact_name_middle = '".$contact_name_middle."', "; - $sql .= "contact_name_family = '".$contact_name_family."', "; - $sql .= "contact_name_suffix = '".$contact_name_suffix."', "; - $sql .= "contact_nickname = '".$contact_nickname."', "; - $sql .= "contact_title = '".$contact_title."', "; - $sql .= "contact_category = '".$contact_category."', "; - $sql .= "contact_role = '".$contact_role."', "; - $sql .= "contact_time_zone = '".$contact_time_zone."', "; - $sql .= "contact_note = '".$contact_note."', "; - $sql .= "last_mod_date = now(), "; - $sql .= "last_mod_user = '".$_SESSION['username']."' "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); + //handle insertion of contact group (or private contact, if not shared) + if ($group_uuid != '') { + $sql = "insert into v_contact_groups "; + $sql .= "( "; + $sql .= "contact_group_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "group_uuid "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".uuid()."', "; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$group_uuid."' "; + $sql .= ") "; + $db->exec(check_sql($sql)); + unset($sql); + } - $_SESSION["message"] = $text['message-update']; - $location = "contact_edit.php?id=".$contact_uuid; - } //if ($action == "update") + if ($action == "update") { + $sql = "update v_contacts set "; + $sql .= "contact_type = '".$contact_type."', "; + $sql .= "contact_organization = '".$contact_organization."', "; + $sql .= "contact_name_prefix = '".$contact_name_prefix."', "; + $sql .= "contact_name_given = '".$contact_name_given."', "; + $sql .= "contact_name_middle = '".$contact_name_middle."', "; + $sql .= "contact_name_family = '".$contact_name_family."', "; + $sql .= "contact_name_suffix = '".$contact_name_suffix."', "; + $sql .= "contact_nickname = '".$contact_nickname."', "; + $sql .= "contact_title = '".$contact_title."', "; + $sql .= "contact_category = '".$contact_category."', "; + $sql .= "contact_role = '".$contact_role."', "; + $sql .= "contact_time_zone = '".$contact_time_zone."', "; + $sql .= "contact_note = '".$contact_note."', "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - //handle redirect - if ($_POST['submit'] == $text['button-add']) { - $group_uuid = $_POST['group_uuid']; - //insert - $location = "contact_edit.php?id=".$contact_uuid; - } + $_SESSION["message"] = $text['message-update']; + $location = "contact_edit.php?id=".$contact_uuid; + } //if ($action == "update") - header("Location: ".$location); - return; + //handle redirect + if ($_POST['submit'] == $text['button-add']) { + $group_uuid = $_POST['group_uuid']; + //insert + $location = "contact_edit.php?id=".$contact_uuid; + } - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + header("Location: ".$location); + return; + + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_email_edit.php b/app/contacts/contact_email_edit.php index f3c7e97665..5a4149e89b 100644 --- a/app/contacts/contact_email_edit.php +++ b/app/contacts/contact_email_edit.php @@ -64,87 +64,98 @@ if (strlen($_GET["contact_uuid"]) > 0) { $email_label = ($email_label_custom != '') ? $email_label_custom : $email_label; } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_email_uuid = check_str($_POST["contact_email_uuid"]); - } + //set the uuid + if ($action == "update") { + $contact_email_uuid = check_str($_POST["contact_email_uuid"]); + } - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //add or update the database + if ($_POST["persistformvar"] != "true") { - //if primary, unmark other primary numbers - if ($email_primary) { - $sql = "update v_contact_emails set email_primary = 0 "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); - } + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "add") { - $contact_email_uuid = uuid(); - $sql = "insert into v_contact_emails "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_email_uuid, "; - $sql .= "email_label, "; - $sql .= "email_address, "; - $sql .= "email_primary, "; - $sql .= "email_description "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$contact_email_uuid."', "; - $sql .= "'".$email_label."', "; - $sql .= "'".$email_address."', "; - $sql .= (($email_primary) ? 1 : 0).", "; - $sql .= "'".$email_description."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //if primary, unmark other primary numbers + if ($email_primary) { + $sql = "update v_contact_emails set email_primary = 0 "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + if ($action == "add") { + $contact_email_uuid = uuid(); + $sql = "insert into v_contact_emails "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_email_uuid, "; + $sql .= "email_label, "; + $sql .= "email_address, "; + $sql .= "email_primary, "; + $sql .= "email_description "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$contact_email_uuid."', "; + $sql .= "'".$email_label."', "; + $sql .= "'".$email_address."', "; + $sql .= (($email_primary) ? 1 : 0).", "; + $sql .= "'".$email_description."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "update") { - $sql = "update v_contact_emails set "; - $sql .= "contact_uuid = '".$contact_uuid."', "; - $sql .= "email_label = '".$email_label."', "; - $sql .= "email_address = '".$email_address."', "; - $sql .= "email_primary = ".(($email_primary) ? 1 : 0).", "; - $sql .= "email_description = '".$email_description."' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_email_uuid = '".$contact_email_uuid."'"; - $db->exec(check_sql($sql)); - unset($sql); + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + if ($action == "update") { + $sql = "update v_contact_emails set "; + $sql .= "contact_uuid = '".$contact_uuid."', "; + $sql .= "email_label = '".$email_label."', "; + $sql .= "email_address = '".$email_address."', "; + $sql .= "email_primary = ".(($email_primary) ? 1 : 0).", "; + $sql .= "email_description = '".$email_description."' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_email_uuid = '".$contact_email_uuid."'"; + $db->exec(check_sql($sql)); + unset($sql); + + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_extensions.php b/app/contacts/contact_extensions.php index 232a7aef5e..95148688ff 100644 --- a/app/contacts/contact_extensions.php +++ b/app/contacts/contact_extensions.php @@ -82,7 +82,7 @@ else { echo "".$text['label-description']."\n"; echo ""; if (permission_exists('extension_add')) { - echo "$v_link_label_add\n"; + echo "$v_link_label_add\n"; } echo "\n"; echo "\n"; @@ -92,7 +92,7 @@ else { echo "\n"; echo " "; if (permission_exists('extension_edit')) { - echo "".$row['extension'].""; + echo "".$row['extension'].""; } else { echo $row['extension']; @@ -102,10 +102,10 @@ else { echo " ".$row['description']." \n"; echo " "; if (permission_exists('extension_edit')) { - echo "$v_link_label_edit"; + echo "$v_link_label_edit"; } if (permission_exists('extension_delete')) { - echo "$v_link_label_delete"; + echo "$v_link_label_delete"; } echo " \n"; echo "\n"; @@ -116,4 +116,4 @@ else { echo ""; -?> +?> \ No newline at end of file diff --git a/app/contacts/contact_import.php b/app/contacts/contact_import.php index 0c25924cd4..66517dd769 100644 --- a/app/contacts/contact_import.php +++ b/app/contacts/contact_import.php @@ -299,7 +299,7 @@ else { $sql .= (($row['phone_type_text']) ? 1 : 0).", "; $sql .= "'".$row['phone_label']."', "; $sql .= "'".$row['phone_number']."', "; - $sql .= "'".$row['phone_description']."', "; + $sql .= "'".$row['phone_description']."' "; $sql .= ")"; $db->exec(check_sql($sql)); unset($sql); diff --git a/app/contacts/contact_note_edit.php b/app/contacts/contact_note_edit.php index 88129984ff..8c255dc37d 100644 --- a/app/contacts/contact_note_edit.php +++ b/app/contacts/contact_note_edit.php @@ -59,75 +59,87 @@ else { $last_mod_user = check_str($_POST["last_mod_user"]); } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - //get the primary id for the contact note - $msg = ''; - if ($action == "update") { - $contact_note_uuid = check_str($_POST["contact_note_uuid"]); - } + //get the primary id for the contact note + if ($action == "update") { + $contact_note_uuid = check_str($_POST["contact_note_uuid"]); + } - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { - if ($action == "add") { - $contact_note_uuid = uuid(); - $sql = "insert into v_contact_notes "; - $sql .= "("; - $sql .= "contact_note_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_note, "; - $sql .= "domain_uuid, "; - $sql .= "last_mod_date, "; - $sql .= "last_mod_user "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'$contact_note_uuid', "; - $sql .= "'$contact_uuid', "; - $sql .= "'$contact_note', "; - $sql .= "'$domain_uuid', "; - $sql .= "now(), "; - $sql .= "'".$_SESSION['username']."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //add or update the database + if ($_POST["persistformvar"] != "true") { + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + //add the note + if ($action == "add") { + $contact_note_uuid = uuid(); + $sql = "insert into v_contact_notes "; + $sql .= "("; + $sql .= "contact_note_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_note, "; + $sql .= "domain_uuid, "; + $sql .= "last_mod_date, "; + $sql .= "last_mod_user "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'$contact_note_uuid', "; + $sql .= "'$contact_uuid', "; + $sql .= "'$contact_note', "; + $sql .= "'$domain_uuid', "; + $sql .= "now(), "; + $sql .= "'".$_SESSION['username']."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "update") { - $sql = "update v_contact_notes set "; - $sql .= "contact_uuid = '$contact_uuid', "; - $sql .= "contact_note = '$contact_note', "; - $sql .= "last_mod_date = now(), "; - $sql .= "last_mod_user = '".$_SESSION['username']."' "; - $sql .= "where domain_uuid = '$domain_uuid' "; - $sql .= "and contact_note_uuid = '$contact_note_uuid'"; - $db->exec(check_sql($sql)); - unset($sql); + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + //update the note + if ($action == "update") { + $sql = "update v_contact_notes set "; + $sql .= "contact_uuid = '$contact_uuid', "; + $sql .= "contact_note = '$contact_note', "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and contact_note_uuid = '$contact_note_uuid'"; + $db->exec(check_sql($sql)); + unset($sql); + + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_phone_edit.php b/app/contacts/contact_phone_edit.php index 4c3c61c844..ce05e03975 100644 --- a/app/contacts/contact_phone_edit.php +++ b/app/contacts/contact_phone_edit.php @@ -72,102 +72,113 @@ if (strlen($_GET["contact_uuid"]) > 0) { $phone_label = ($phone_label_custom != '') ? $phone_label_custom : $phone_label; } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_phone_uuid = check_str($_POST["contact_phone_uuid"]); - } + //set thge uuid + if ($action == "update") { + $contact_phone_uuid = check_str($_POST["contact_phone_uuid"]); + } - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //add or update the database + if ($_POST["persistformvar"] != "true") { - //if primary, unmark other primary numbers - if ($phone_primary) { - $sql = "update v_contact_phones set phone_primary = 0 "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); - } + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "add") { - $contact_phone_uuid = uuid(); - $sql = "insert into v_contact_phones "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_phone_uuid, "; - $sql .= "phone_type_voice, "; - $sql .= "phone_type_fax, "; - $sql .= "phone_type_video, "; - $sql .= "phone_type_text, "; - $sql .= "phone_label, "; - $sql .= "phone_number, "; - $sql .= "phone_extension, "; - $sql .= "phone_primary, "; - $sql .= "phone_description "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$domain_uuid."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$contact_phone_uuid."', "; - $sql .= (($phone_type_voice) ? 1 : 'null').", "; - $sql .= (($phone_type_fax) ? 1 : 'null').", "; - $sql .= (($phone_type_video) ? 1 : 'null').", "; - $sql .= (($phone_type_text) ? 1 : 'null').", "; - $sql .= "'".$phone_label."', "; - $sql .= "'".$phone_number."', "; - $sql .= "'".$phone_extension."', "; - $sql .= (($phone_primary) ? 1 : 0).", "; - $sql .= "'".$phone_description."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //if primary, unmark other primary numbers + if ($phone_primary) { + $sql = "update v_contact_phones set phone_primary = 0 "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + if ($action == "add") { + $contact_phone_uuid = uuid(); + $sql = "insert into v_contact_phones "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_phone_uuid, "; + $sql .= "phone_type_voice, "; + $sql .= "phone_type_fax, "; + $sql .= "phone_type_video, "; + $sql .= "phone_type_text, "; + $sql .= "phone_label, "; + $sql .= "phone_number, "; + $sql .= "phone_extension, "; + $sql .= "phone_primary, "; + $sql .= "phone_description "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$contact_phone_uuid."', "; + $sql .= (($phone_type_voice) ? 1 : 'null').", "; + $sql .= (($phone_type_fax) ? 1 : 'null').", "; + $sql .= (($phone_type_video) ? 1 : 'null').", "; + $sql .= (($phone_type_text) ? 1 : 'null').", "; + $sql .= "'".$phone_label."', "; + $sql .= "'".$phone_number."', "; + $sql .= "'".$phone_extension."', "; + $sql .= (($phone_primary) ? 1 : 0).", "; + $sql .= "'".$phone_description."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "update") { - $sql = "update v_contact_phones set "; - $sql .= "contact_uuid = '$contact_uuid', "; - $sql .= "phone_type_voice = ".(($phone_type_voice) ? 1 : 'null').", "; - $sql .= "phone_type_fax = ".(($phone_type_fax) ? 1 : 'null').", "; - $sql .= "phone_type_video = ".(($phone_type_video) ? 1 : 'null').", "; - $sql .= "phone_type_text = ".(($phone_type_text) ? 1 : 'null').", "; - $sql .= "phone_label = '".$phone_label."', "; - $sql .= "phone_number = '".$phone_number."', "; - $sql .= "phone_extension = '".$phone_extension."', "; - $sql .= "phone_primary = ".(($phone_primary) ? 1 : 0).", "; - $sql .= "phone_description = '".$phone_description."' "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_phone_uuid = '".$contact_phone_uuid."'"; - $db->exec(check_sql($sql)); - unset($sql); + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + if ($action == "update") { + $sql = "update v_contact_phones set "; + $sql .= "contact_uuid = '$contact_uuid', "; + $sql .= "phone_type_voice = ".(($phone_type_voice) ? 1 : 'null').", "; + $sql .= "phone_type_fax = ".(($phone_type_fax) ? 1 : 'null').", "; + $sql .= "phone_type_video = ".(($phone_type_video) ? 1 : 'null').", "; + $sql .= "phone_type_text = ".(($phone_type_text) ? 1 : 'null').", "; + $sql .= "phone_label = '".$phone_label."', "; + $sql .= "phone_number = '".$phone_number."', "; + $sql .= "phone_extension = '".$phone_extension."', "; + $sql .= "phone_primary = ".(($phone_primary) ? 1 : 0).", "; + $sql .= "phone_description = '".$phone_description."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_phone_uuid = '".$contact_phone_uuid."'"; + $db->exec(check_sql($sql)); + unset($sql); + + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_relation_edit.php b/app/contacts/contact_relation_edit.php index c7154ab3a0..bd01d13a93 100644 --- a/app/contacts/contact_relation_edit.php +++ b/app/contacts/contact_relation_edit.php @@ -48,9 +48,10 @@ else { $action = "add"; } -if (strlen($_GET["contact_uuid"]) > 0) { - $contact_uuid = check_str($_GET["contact_uuid"]); -} +//get the contact uuid + if (strlen($_GET["contact_uuid"]) > 0) { + $contact_uuid = check_str($_GET["contact_uuid"]); + } //get http post variables and set them to php variables if (count($_POST)>0) { @@ -66,93 +67,104 @@ if (strlen($_GET["contact_uuid"]) > 0) { $relation_reciprocal_label = ($relation_reciprocal_label_custom != '') ? $relation_reciprocal_label_custom : $relation_reciprocal_label; } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_relation_uuid = check_str($_POST["contact_relation_uuid"]); - } - - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } - - //add or update the database - if ($_POST["persistformvar"] != "true") { - - if ($action == "add") { - $contact_relation_uuid = uuid(); - $sql = "insert into v_contact_relations "; - $sql .= "("; - $sql .= "contact_relation_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "relation_label, "; - $sql .= "relation_contact_uuid "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$contact_relation_uuid."', "; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$relation_label."', "; - $sql .= "'".$relation_contact_uuid."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - - if ($relation_reciprocal) { - $contact_relation_uuid = uuid(); - $sql = "insert into v_contact_relations "; - $sql .= "("; - $sql .= "contact_relation_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "relation_label, "; - $sql .= "relation_contact_uuid "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$contact_relation_uuid."', "; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$relation_contact_uuid."', "; - $sql .= "'".$relation_reciprocal_label."', "; - $sql .= "'".$contact_uuid."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //set the uuid + if ($action == "update") { + $contact_relation_uuid = check_str($_POST["contact_relation_uuid"]); } - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - if ($action == "update") { - $sql = "update v_contact_relations set "; - $sql .= "relation_label = '".$relation_label."', "; - $sql .= "relation_contact_uuid = '".$relation_contact_uuid."' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_relation_uuid = '".$contact_relation_uuid."'"; - $db->exec(check_sql($sql)); - unset($sql); + //add or update the database + if ($_POST["persistformvar"] != "true") { - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + + if ($action == "add") { + $contact_relation_uuid = uuid(); + $sql = "insert into v_contact_relations "; + $sql .= "("; + $sql .= "contact_relation_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "relation_label, "; + $sql .= "relation_contact_uuid "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$contact_relation_uuid."', "; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$relation_label."', "; + $sql .= "'".$relation_contact_uuid."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + + if ($relation_reciprocal) { + $contact_relation_uuid = uuid(); + $sql = "insert into v_contact_relations "; + $sql .= "("; + $sql .= "contact_relation_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "relation_label, "; + $sql .= "relation_contact_uuid "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$contact_relation_uuid."', "; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$relation_contact_uuid."', "; + $sql .= "'".$relation_reciprocal_label."', "; + $sql .= "'".$contact_uuid."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + } + + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") + + if ($action == "update") { + $sql = "update v_contact_relations set "; + $sql .= "relation_label = '".$relation_label."', "; + $sql .= "relation_contact_uuid = '".$relation_contact_uuid."' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_relation_uuid = '".$contact_relation_uuid."'"; + $db->exec(check_sql($sql)); + unset($sql); + + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_setting_edit.php b/app/contacts/contact_setting_edit.php index fd98a172d9..47bae1a29c 100644 --- a/app/contacts/contact_setting_edit.php +++ b/app/contacts/contact_setting_edit.php @@ -48,10 +48,13 @@ else { $action = "add"; } -if (strlen($_GET["contact_uuid"]) > 0) { - $contact_uuid = check_str($_GET["contact_uuid"]); -} -$domain_uuid = $_SESSION['domain_uuid']; +//get the contact uuid + if (strlen($_GET["contact_uuid"]) > 0) { + $contact_uuid = check_str($_GET["contact_uuid"]); + } + +//set the session domain uuid as a variable + $domain_uuid = $_SESSION['domain_uuid']; //get http post variables and set them to php variables if (count($_POST) > 0) { @@ -64,97 +67,110 @@ $domain_uuid = $_SESSION['domain_uuid']; $contact_setting_description = check_str($_POST["contact_setting_description"]); } -if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_setting_uuid = check_str($_POST["contact_setting_uuid"]); - } + //set the uuid + if ($action == "update") { + $contact_setting_uuid = check_str($_POST["contact_setting_uuid"]); + } - //check for all required data - //if (strlen($domain_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."
\n"; } - //if (strlen($domain_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."
\n"; } - //if (strlen($domain_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } - //if (strlen($domain_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."
\n"; } - //if (strlen($domain_setting_order) == 0) { $msg .= $text['message-required'].$text['label-order']."
\n"; } - //if (strlen($domain_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } - //if (strlen($domain_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } - - //add or update the database - if ($_POST["persistformvar"] != "true") { - $contact_setting_order = ($contact_setting_order != '') ? $contact_setting_order : 'null'; - - //add the domain - if ($action == "add" && permission_exists('domain_setting_add')) { - $sql = "insert into v_contact_settings "; - $sql .= "("; - $sql .= "contact_setting_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_setting_category, "; - $sql .= "contact_setting_subcategory, "; - $sql .= "contact_setting_name, "; - $sql .= "contact_setting_value, "; - $sql .= "contact_setting_order, "; - $sql .= "contact_setting_enabled, "; - $sql .= "contact_setting_description "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".uuid()."', "; - $sql .= "'$contact_uuid', "; - $sql .= "'$domain_uuid', "; - $sql .= "'$contact_setting_category', "; - $sql .= "'$contact_setting_subcategory', "; - $sql .= "'$contact_setting_name', "; - $sql .= "'$contact_setting_value', "; - $sql .= "$contact_setting_order, "; - $sql .= "'$contact_setting_enabled', "; - $sql .= "'$contact_setting_description' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - } //if ($action == "add") - - //update the domain - if ($action == "update") { - $sql = "update v_contact_settings set "; - $sql .= "contact_setting_category = '$contact_setting_category', "; - $sql .= "contact_setting_subcategory = '$contact_setting_subcategory', "; - $sql .= "contact_setting_name = '$contact_setting_name', "; - $sql .= "contact_setting_value = '$contact_setting_value', "; - $sql .= "contact_setting_order = $contact_setting_order, "; - $sql .= "contact_setting_enabled = '$contact_setting_enabled', "; - $sql .= "contact_setting_description = '$contact_setting_description' "; - $sql .= "where contact_uuid = '$contact_uuid' "; - $sql .= "and contact_setting_uuid = '$contact_setting_uuid'"; - $db->exec(check_sql($sql)); - unset($sql); - } //if ($action == "update") - - //redirect the browser - if ($action == "update") { - $_SESSION["message"] = $text['message-update']; - } - if ($action == "add") { - $_SESSION["message"] = $text['message-add']; - } - header("Location: contact_edit.php?id=".$contact_uuid); + //check for all required data + $msg = ''; + //if (strlen($domain_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."
\n"; } + //if (strlen($domain_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."
\n"; } + //if (strlen($domain_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."
\n"; } + //if (strlen($domain_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."
\n"; } + //if (strlen($domain_setting_order) == 0) { $msg .= $text['message-required'].$text['label-order']."
\n"; } + //if (strlen($domain_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."
\n"; } + //if (strlen($domain_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."
\n"; } + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; return; - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + } + + //add or update the database + if ($_POST["persistformvar"] != "true") { + + //set the order + $contact_setting_order = ($contact_setting_order != '') ? $contact_setting_order : 'null'; + + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + + //add the domain + if ($action == "add" && permission_exists('domain_setting_add')) { + $sql = "insert into v_contact_settings "; + $sql .= "("; + $sql .= "contact_setting_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_setting_category, "; + $sql .= "contact_setting_subcategory, "; + $sql .= "contact_setting_name, "; + $sql .= "contact_setting_value, "; + $sql .= "contact_setting_order, "; + $sql .= "contact_setting_enabled, "; + $sql .= "contact_setting_description "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".uuid()."', "; + $sql .= "'$contact_uuid', "; + $sql .= "'$domain_uuid', "; + $sql .= "'$contact_setting_category', "; + $sql .= "'$contact_setting_subcategory', "; + $sql .= "'$contact_setting_name', "; + $sql .= "'$contact_setting_value', "; + $sql .= "$contact_setting_order, "; + $sql .= "'$contact_setting_enabled', "; + $sql .= "'$contact_setting_description' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + } //if ($action == "add") + + //update the domain + if ($action == "update") { + $sql = "update v_contact_settings set "; + $sql .= "contact_setting_category = '$contact_setting_category', "; + $sql .= "contact_setting_subcategory = '$contact_setting_subcategory', "; + $sql .= "contact_setting_name = '$contact_setting_name', "; + $sql .= "contact_setting_value = '$contact_setting_value', "; + $sql .= "contact_setting_order = $contact_setting_order, "; + $sql .= "contact_setting_enabled = '$contact_setting_enabled', "; + $sql .= "contact_setting_description = '$contact_setting_description' "; + $sql .= "where contact_uuid = '$contact_uuid' "; + $sql .= "and contact_setting_uuid = '$contact_setting_uuid'"; + $db->exec(check_sql($sql)); + unset($sql); + } //if ($action == "update") + + //redirect the browser + if ($action == "update") { + $_SESSION["message"] = $text['message-update']; + } + if ($action == "add") { + $_SESSION["message"] = $text['message-add']; + } + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_time_edit.php b/app/contacts/contact_time_edit.php index 5055f73aec..4b86a57c0d 100644 --- a/app/contacts/contact_time_edit.php +++ b/app/contacts/contact_time_edit.php @@ -47,9 +47,10 @@ else { $action = "add"; } -if (strlen($_GET["contact_uuid"]) > 0) { - $contact_uuid = check_str($_GET["contact_uuid"]); -} +//get the contact uuid + if (strlen($_GET["contact_uuid"]) > 0) { + $contact_uuid = check_str($_GET["contact_uuid"]); + } //get http post variables and set them to php variables if (count($_POST)>0) { @@ -58,81 +59,91 @@ if (strlen($_GET["contact_uuid"]) > 0) { $time_description = check_str($_POST["time_description"]); } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_time_uuid = check_str($_POST["contact_time_uuid"]); - } + //set the uuid + if ($action == "update") { + $contact_time_uuid = check_str($_POST["contact_time_uuid"]); + } - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //add or update the database + if ($_POST["persistformvar"] != "true") { + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "add") { - $contact_time_uuid = uuid(); - $sql = "insert into v_contact_times "; - $sql .= "( "; - $sql .= "domain_uuid, "; - $sql .= "contact_time_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "user_uuid, "; - $sql .= "time_start, "; - $sql .= "time_stop, "; - $sql .= "time_description "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".$domain_uuid."', "; - $sql .= "'".$contact_time_uuid."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$_SESSION["user"]["user_uuid"]."', "; - $sql .= "'".$time_start."', "; - $sql .= "'".$time_stop."', "; - $sql .= "'".$time_description."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + if ($action == "add") { + $contact_time_uuid = uuid(); + $sql = "insert into v_contact_times "; + $sql .= "( "; + $sql .= "domain_uuid, "; + $sql .= "contact_time_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "user_uuid, "; + $sql .= "time_start, "; + $sql .= "time_stop, "; + $sql .= "time_description "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$contact_time_uuid."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$_SESSION["user"]["user_uuid"]."', "; + $sql .= "'".$time_start."', "; + $sql .= "'".$time_stop."', "; + $sql .= "'".$time_description."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") - if ($action == "update") { - $sql = "update v_contact_times "; - $sql .= "set "; - $sql .= "time_start = '".$time_start."', "; - $sql .= "time_stop = '".$time_stop."', "; - $sql .= "time_description = '".$time_description."' "; - $sql .= "where "; - $sql .= "contact_time_uuid = '".$contact_time_uuid."' "; - $sql .= "and domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $sql .= "and user_uuid = '".$_SESSION["user"]["user_uuid"]."' "; - $db->exec(check_sql($sql)); - unset($sql); + if ($action == "update") { + $sql = "update v_contact_times "; + $sql .= "set "; + $sql .= "time_start = '".$time_start."', "; + $sql .= "time_stop = '".$time_stop."', "; + $sql .= "time_description = '".$time_description."' "; + $sql .= "where "; + $sql .= "contact_time_uuid = '".$contact_time_uuid."' "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $sql .= "and user_uuid = '".$_SESSION["user"]["user_uuid"]."' "; + $db->exec(check_sql($sql)); + unset($sql); - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contact_url_edit.php b/app/contacts/contact_url_edit.php index ca0686c03a..30e39265e3 100644 --- a/app/contacts/contact_url_edit.php +++ b/app/contacts/contact_url_edit.php @@ -48,12 +48,13 @@ else { $action = "add"; } -if (strlen($_GET["contact_uuid"]) > 0) { - $contact_uuid = check_str($_GET["contact_uuid"]); -} +//get the contact uuid + if (strlen($_GET["contact_uuid"]) > 0) { + $contact_uuid = check_str($_GET["contact_uuid"]); + } //get http post variables and set them to php variables - if (count($_POST)>0) { + if (count($_POST) > 0) { $url_label = check_str($_POST["url_label"]); $url_label_custom = check_str($_POST["url_label_custom"]); $url_address = check_str($_POST["url_address"]); @@ -64,87 +65,98 @@ if (strlen($_GET["contact_uuid"]) > 0) { $url_label = ($url_label_custom != '') ? $url_label_custom : $url_label; } -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { +//process the form data + if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_url_uuid = check_str($_POST["contact_url_uuid"]); - } + //set the uuid + if ($action == "update") { + $contact_url_uuid = check_str($_POST["contact_url_uuid"]); + } - //check for all required data - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } + //check for all required data + $msg = ''; + if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { + require_once "resources/header.php"; + require_once "resources/persist_form_var.php"; + echo "
\n"; + echo "
\n"; + echo $msg."
"; + echo "
\n"; + persistformvar($_POST); + echo "
\n"; + require_once "resources/footer.php"; + return; + } - //add or update the database - if ($_POST["persistformvar"] != "true") { + //add or update the database + if ($_POST["persistformvar"] != "true") { - //if primary, unmark other primary numbers - if ($url_primary) { - $sql = "update v_contact_urls set url_primary = 0 "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); - } + //update last modified + $sql = "update v_contacts set "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "add") { - $contact_url_uuid = uuid(); - $sql = "insert into v_contact_urls "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_url_uuid, "; - $sql .= "url_label, "; - $sql .= "url_address, "; - $sql .= "url_primary, "; - $sql .= "url_description "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$contact_url_uuid."', "; - $sql .= "'".$url_label."', "; - $sql .= "'".$url_address."', "; - $sql .= (($url_primary) ? 1 : 0).", "; - $sql .= "'".$url_description."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + //if primary, unmark other primary numbers + if ($url_primary) { + $sql = "update v_contact_urls set url_primary = 0 "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } - $_SESSION["message"] = $text['message-add']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "add") + if ($action == "add") { + $contact_url_uuid = uuid(); + $sql = "insert into v_contact_urls "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_url_uuid, "; + $sql .= "url_label, "; + $sql .= "url_address, "; + $sql .= "url_primary, "; + $sql .= "url_description "; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$contact_url_uuid."', "; + $sql .= "'".$url_label."', "; + $sql .= "'".$url_address."', "; + $sql .= (($url_primary) ? 1 : 0).", "; + $sql .= "'".$url_description."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "update") { - $sql = "update v_contact_urls set "; - $sql .= "contact_uuid = '".$contact_uuid."', "; - $sql .= "url_label = '".$url_label."', "; - $sql .= "url_address = '".$url_address."', "; - $sql .= "url_primary = ".(($url_primary) ? 1 : 0).", "; - $sql .= "url_description = '".$url_description."' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_url_uuid = '".$contact_url_uuid."'"; - $db->exec(check_sql($sql)); - unset($sql); + $_SESSION["message"] = $text['message-add']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "add") - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) + if ($action == "update") { + $sql = "update v_contact_urls set "; + $sql .= "contact_uuid = '".$contact_uuid."', "; + $sql .= "url_label = '".$url_label."', "; + $sql .= "url_address = '".$url_address."', "; + $sql .= "url_primary = ".(($url_primary) ? 1 : 0).", "; + $sql .= "url_description = '".$url_description."' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_url_uuid = '".$contact_url_uuid."'"; + $db->exec(check_sql($sql)); + unset($sql); + + $_SESSION["message"] = $text['message-update']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } //if ($action == "update") + } //if ($_POST["persistformvar"] != "true") + } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { diff --git a/app/contacts/contacts.php b/app/contacts/contacts.php index 0bf9eb1e9c..82ebd227d9 100644 --- a/app/contacts/contacts.php +++ b/app/contacts/contacts.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2013 + Portions created by the Initial Developer are Copyright (C) 2008-2015 the Initial Developer. All Rights Reserved. Contributor(s): @@ -55,7 +55,8 @@ else { foreach ($_SESSION['groups'] as $group_data) { $user_group_uuids[] = $group_data['group_uuid']; } - //add user's uuid to group uuid list to include private (non-shared) contacts + +//add user's uuid to group uuid list to include private (non-shared) contacts $user_group_uuids[] = $_SESSION["user_uuid"]; //get contact sync sources @@ -177,7 +178,10 @@ else { $sql .= "order by ".$order_by." ".$order." "; } else { - $sql .= "order by contact_organization desc, contact_name_given asc, contact_name_family asc "; + $sql .= "order by last_mod_date desc "; + if ($db_type == "pgsql") { + $sql .= "nulls last "; + } } $sql .= "limit ".$rows_per_page." offset ".$offset." "; $prep_statement = $db->prepare(check_sql($sql)); diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index b22127f6cf..f2f446510a 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -214,15 +214,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $dialplan["dialplan_description"] = ($dialplan_description != '') ? $dialplan_description : $destination_description; $dialplan_detail_order = 10; - //add the public condition - $y = 0; - $dialplan["dialplan_details"][$y]["domain_uuid"] = $domain_uuid; - $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "condition"; - $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "context"; - $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "public"; - $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; - $y++; - //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; @@ -369,7 +360,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { if (!permission_exists('destination_domain')) { $sql .= "and domain_uuid = '".$domain_uuid."' "; } - echo $sql."

"; + //echo $sql."

"; $db->exec(check_sql($sql)); unset($sql); } diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 26bf7d747c..85885a9467 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -555,32 +555,35 @@ require_once "resources/require.php"; echo "\n"; echo "
\n"; echo $text['description-device_template']."\n"; diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index 9531b7d0cd..68ec9b3b1b 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -58,9 +58,7 @@ else { else { $action = "add"; } - -//get the app uuid - if (is_uuid($_REQUEST["app_uuid"])) { + if (strlen($_REQUEST["app_uuid"]) > 0) { $app_uuid = $_REQUEST["app_uuid"]; } diff --git a/app/dialplan/resources/switch/conf/dialplan/040_call_block.xml b/app/dialplan/resources/switch/conf/dialplan/040_call_block.xml index 2f76cf98b6..dfa876b8c8 100644 --- a/app/dialplan/resources/switch/conf/dialplan/040_call_block.xml +++ b/app/dialplan/resources/switch/conf/dialplan/040_call_block.xml @@ -1,7 +1,7 @@ - - + + \ No newline at end of file diff --git a/app/dialplan/resources/switch/conf/dialplan/240_page.xml b/app/dialplan/resources/switch/conf/dialplan/240_page.xml index 0c080a2213..6a48aa368f 100644 --- a/app/dialplan/resources/switch/conf/dialplan/240_page.xml +++ b/app/dialplan/resources/switch/conf/dialplan/240_page.xml @@ -4,8 +4,9 @@ - + + diff --git a/app/dialplan/resources/switch/conf/dialplan/250_page-extension.xml b/app/dialplan/resources/switch/conf/dialplan/250_page-extension.xml index ef0ee75364..f604b2632a 100644 --- a/app/dialplan/resources/switch/conf/dialplan/250_page-extension.xml +++ b/app/dialplan/resources/switch/conf/dialplan/250_page-extension.xml @@ -1,7 +1,7 @@ - + diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index 77b8100e8a..25dbfb37fd 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -184,33 +184,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $db->exec(check_sql($sql)); unset($sql); - //add condition public context - $dialplan_detail_uuid = uuid(); - $sql = "insert into v_dialplan_details "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "dialplan_uuid, "; - $sql .= "dialplan_detail_uuid, "; - $sql .= "dialplan_detail_tag, "; - $sql .= "dialplan_detail_type, "; - $sql .= "dialplan_detail_data, "; - $sql .= "dialplan_detail_group, "; - $sql .= "dialplan_detail_order "; - $sql .= ") "; - $sql .= "values "; - $sql .= "("; - $sql .= "'$domain_uuid', "; - $sql .= "'$dialplan_uuid', "; - $sql .= "'$dialplan_detail_uuid', "; - $sql .= "'condition', "; - $sql .= "'context', "; - $sql .= "'public', "; - $sql .= "'0', "; - $sql .= "'10' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - //add condition 1 $dialplan_detail_uuid = uuid(); $sql = "insert into v_dialplan_details "; diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 9d1739a0ea..b156b79358 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -1258,13 +1258,16 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $template_dir = $device->get_template_dir(); echo "\n"; + echo "
\n"; + echo $text['description-hostname']."\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " ".$text['label-enabled']."\n"; diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php index bc890546dc..f517fd5354 100644 --- a/app/gateways/gateways.php +++ b/app/gateways/gateways.php @@ -136,7 +136,7 @@ else { } $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $gateways = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset ($prep_statement, $sql); $rows_per_page = 150; @@ -159,6 +159,7 @@ else { echo "".$text['label-action']."\n"; echo "".$text['label-state']."\n"; } + echo th_order_by('hostname', $text['label-hostname'], $order_by, $order); echo th_order_by('enabled', $text['label-enabled'], $order_by, $order); echo th_order_by('description', $text['label-description'], $order_by, $order); echo ""; @@ -171,7 +172,7 @@ else { echo "\n"; if ($num_rows > 0) { - foreach($result as $row) { + foreach($gateways as $row) { $tr_link = (permission_exists('gateway_edit')) ? "href='gateway_edit.php?id=".$row['gateway_uuid']."'" : null; echo "\n"; echo " "; @@ -211,6 +212,7 @@ else { echo "  \n"; echo "  \n"; } + echo " ".$row["hostname"]."\n"; if ($row["enabled"] == "true") { echo " ".$text['label-true']."\n"; } @@ -230,11 +232,11 @@ else { } if ($c==0) { $c=1; } else { $c=0; } } //end foreach - unset($sql, $result, $row_count); + unset($sql, $gateways, $row_count); } //end if results echo "\n"; - echo "\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; diff --git a/app/provision/index.php b/app/provision/index.php index fa20304c10..73f2f73915 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -241,7 +241,7 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0); header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"'); header('HTTP/1.0 401 Unauthorized'); header("Content-Type: text/plain"); - echo 'Authorization Required'; + header("Content-Length: 0"); exit; } else { if ($_SERVER['PHP_AUTH_USER'] == $provision["http_auth_username"] && $_SERVER['PHP_AUTH_PW'] == $provision["http_auth_password"]) { @@ -252,7 +252,9 @@ openlog("fusion-provisioning", LOG_PID | LOG_PERROR, LOG_LOCAL0); header('WWW-Authenticate: Basic realm="'.$_SESSION['domain_name']." ".date('r').'"'); unset($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']); usleep(rand(1000000,3000000));//1-3 seconds. - echo 'Authorization Required'; + $content = 'Authorization Required'; + header("Content-Length: ".strval(strlen($content))); + echo $content; exit; } } diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index 237de12212..d2a4a6f562 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -465,7 +465,7 @@ include "root.php"; $sql .= "or device_profile_uuid = '".$device_profile_uuid."' "; } $sql .= ") "; - $sql .= "AND (device_key_vendor = '".$device_vendor."' or device_key_vendor is null) "; + $sql .= "AND (lower(device_key_vendor) = '".$device_vendor."' or device_key_vendor is null) "; $sql .= "ORDER BY device_key_category asc, device_key_id asc, device_uuid desc"; $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); diff --git a/app/time_conditions/app_languages.php b/app/time_conditions/app_languages.php index 402e6a4027..91dbe32ace 100644 --- a/app/time_conditions/app_languages.php +++ b/app/time_conditions/app_languages.php @@ -583,6 +583,28 @@ $text['label-alternate-destination']['uk'] = ""; $text['label-alternate-destination']['de-at'] = "Alternatives Ziel"; $text['label-alternate-destination']['he'] = ""; +$text['label-group']['en-us'] = "Group"; +$text['label-group']['es-cl'] = "Grupo"; +$text['label-group']['pt-pt'] = ""; +$text['label-group']['fr-fr'] = ""; +$text['label-group']['pt-br'] = ""; +$text['label-group']['pl'] = ""; +$text['label-group']['sv-se'] = ""; +$text['label-group']['uk'] = ""; +$text['label-group']['de-at'] = ""; +$text['label-group']['he'] = ""; + +$text['label-destination']['en-us'] = "Destination"; +$text['label-destination']['es-cl'] = "Destino"; +$text['label-destination']['pt-pt'] = "Destino"; +$text['label-destination']['fr-fr'] = "Destination"; +$text['label-destination']['pt-br'] = ""; +$text['label-destination']['pl'] = "Destynacja"; +$text['label-destination']['sv-se'] = "Destination"; +$text['label-destination']['uk'] = ""; +$text['label-destination']['de-at'] = "Ziel"; +$text['label-destination']['he'] = ""; + $text['header-time_conditions']['en-us'] = "Time Conditions"; $text['header-time_conditions']['es-cl'] = "Condiciones de Tiempo"; $text['header-time_conditions']['pt-pt'] = "Condições Temporais"; diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index 42d7b79a62..1be14bd414 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -248,7 +248,14 @@ require_once "resources/header.php"; $is_preset = (in_array($group_id, $_REQUEST['preset'])) ? true : false; //set group and order number - $dialplan_detail_group = $group_id; + + $dialplan_detail_group_user = check_str($_POST["group_$group_id"]); + if($dialplan_detail_group_user!='') { + $dialplan_detail_group = $dialplan_detail_group_user; + } else { + $dialplan_detail_group = $group_id; + } + $dialplan_detail_order = 0; foreach ($conditions as $cond_num => $cond_var) { @@ -836,7 +843,7 @@ function add_custom_condition($destination, $group_id, $dialplan_action = '') { echo " ".$text['label-settings']; echo "\n"; echo "
 \n"; - echo " \n"; + echo "
\n"; echo " \n"; echo " \n"; echo " \n"; @@ -846,11 +853,16 @@ function add_custom_condition($destination, $group_id, $dialplan_action = '') { echo " "; echo " "; echo " "; + echo " "; + echo " \n"; + echo " \n"; + echo " "; echo " "; - echo " "; + echo " \n"; echo " "; echo "
".$text['label-condition']."".$text['label-condition_value']."
".$text['label-destination']."".$text['label-group']."
"; + echo " "; //$destination = new destinations; echo $destination->select('dialplan', 'dialplan_action['.$group_id.']', $dialplan_action); echo "
"; echo "
"; @@ -1092,4 +1104,4 @@ echo "
"; //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/databases/app_defaults.php b/core/databases/app_defaults.php index dfd247334e..dbd68274fe 100644 --- a/core/databases/app_defaults.php +++ b/core/databases/app_defaults.php @@ -182,7 +182,25 @@ if ($domains_processed == 1) { } $tmp .= "\n"; } - + $tmp .= "--set defaults\n"; + $tmp .= " expire = {}\n"; + $tmp .= " expire[\"directory\"] = \"3600\";\n"; + $tmp .= " expire[\"dialplan\"] = \"3600\";\n"; + $tmp .= " expire[\"languages\"] = \"3600\";\n"; + $tmp .= " expire[\"sofia.conf\"] = \"3600\";\n"; + $tmp .= " expire[\"acl.conf\"] = \"3600\";\n"; + $tmp .= "\n"; + $tmp .= "--set xml_handler\n"; + $tmp .= " xml_handler = {}\n"; + $tmp .= " xml_handler[\"fs_path\"] = false;\n"; + $tmp .= "\n"; + $tmp .= "--set the debug options\n"; + $tmp .= " debug[\"params\"] = false;\n"; + $tmp .= " debug[\"sql\"] = false;\n"; + $tmp .= " debug[\"xml_request\"] = false;\n"; + $tmp .= " debug[\"xml_string\"] = false;\n"; + $tmp .= " debug[\"cache\"] = false;\n"; + $tmp .= "\n"; $tmp .= "--additional info\n"; $tmp .= " domain_count = ".count($_SESSION["domains"]).";\n"; $tmp .= correct_path(" temp_dir = [[".$_SESSION['server']['temp']['dir']."]];\n"); diff --git a/core/default_settings/app_defaults.php b/core/default_settings/app_defaults.php index 70ef5f0caf..a058969777 100644 --- a/core/default_settings/app_defaults.php +++ b/core/default_settings/app_defaults.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2010 + Portions created by the Initial Developer are Copyright (C) 2008-2015 the Initial Developer. All Rights Reserved. Contributor(s): @@ -30,12 +30,26 @@ if ($domains_processed == 1) { //define array of settings $x = 0; $array[$x]['default_setting_category'] = 'domain'; + $array[$x]['default_setting_subcategory'] = 'time_zone'; + $array[$x]['default_setting_name'] = 'name'; + $array[$x]['default_setting_value'] = ''; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = ''; + $x++; + $array[$x]['default_setting_category'] = 'domain'; $array[$x]['default_setting_subcategory'] = 'language'; $array[$x]['default_setting_name'] = 'code'; $array[$x]['default_setting_value'] = 'en-us'; $array[$x]['default_setting_enabled'] = 'true'; $array[$x]['default_setting_description'] = ''; $x++; + $array[$x]['default_setting_category'] = 'domain'; + $array[$x]['default_setting_subcategory'] = 'bridge'; + $array[$x]['default_setting_name'] = 'text'; + $array[$x]['default_setting_value'] = 'outbound'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'outbound,loopback,lcr'; + $x++; $array[$x]['default_setting_category'] = 'security'; $array[$x]['default_setting_subcategory'] = 'password_length'; $array[$x]['default_setting_name'] = 'var'; diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index c7d6b4b27f..c51a15a101 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -92,6 +92,38 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { // fix null $default_setting_order = ($default_setting_order != '') ? $default_setting_order : 'null'; + //update switch timezone variables + if ($default_setting_category == "domain" && $default_setting_subcategory == "time_zone" && $default_setting_name == "name" ) { + //get the action + $sql = "select * from v_vars "; + $sql .= "where var_name = 'timezone' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $var_action = "add"; + foreach ($result as $row) { + $var_action = "update"; + } + unset ($prep_statement); + + //update the timezone + if ($var_action == "update") { + $sql = "update v_vars "; + $sql .= "set var_value = '".$default_setting_value."' "; + $sql .= "where var_name = 'timezone' "; + } + else { + $sql = "insert into v_vars "; + $sql .= "(var_uuid, var_name, var_value, var_cat, var_enabled) "; + $sql .= "values ('".uuid()."', 'timezone', '$default_setting_value', 'Defaults', 'true'); "; + } + $db->query($sql); + unset($sql); + + //synchronize the configuration + save_var_xml(); + } + if ($action == "add" && permission_exists('default_setting_add')) { $sql = "insert into v_default_settings "; $sql .= "("; @@ -566,4 +598,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/core/domain_settings/domain_setting_edit.php b/core/domain_settings/domain_setting_edit.php index d3d07bbf39..d125093b49 100644 --- a/core/domain_settings/domain_setting_edit.php +++ b/core/domain_settings/domain_setting_edit.php @@ -47,9 +47,10 @@ else { $action = "add"; } -if (strlen($_GET["domain_uuid"]) > 0) { - $domain_uuid = check_str($_GET["domain_uuid"]); -} +//set the domain_uuid + if (strlen($_GET["domain_uuid"]) > 0) { + $domain_uuid = check_str($_GET["domain_uuid"]); + } //get http post variables and set them to php variables if (count($_POST) > 0) { @@ -92,7 +93,75 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //add or update the database if ($_POST["persistformvar"] != "true") { - $domain_setting_order = ($domain_setting_order != '') ? $domain_setting_order : 'null'; + // fix null + $domain_setting_order = ($domain_setting_order != '') ? $domain_setting_order : 'null'; + + //update switch timezone variables + if ($domain_setting_category == "domain" && $domain_setting_subcategory == "time_zone" && $domain_setting_name == "name" ) { + //get the dialplan_uuid + $sql = "select * from v_dialplans "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and app_uuid = '9f356fe7-8cf8-4c14-8fe2-6daf89304458' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + foreach ($result as $row) { + $dialplan_uuid = $row["dialplan_uuid"]; + } + unset ($prep_statement); + + //get the action + $sql = "select * from v_dialplan_details "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and dialplan_uuid = '".$dialplan_uuid."' "; + $sql .= "and dialplan_detail_tag = 'action' "; + $sql .= "and dialplan_detail_type = 'set' "; + $sql .= "and dialplan_detail_data like 'timezone=%' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $detail_action = "add"; + foreach ($result as $row) { + $dialplan_detail_uuid = $row["dialplan_detail_uuid"]; + $detail_action = "update"; + } + unset ($prep_statement); + + //update the timezone + if ($detail_action == "update") { + $sql = "update v_dialplan_details "; + $sql .= "set dialplan_detail_data = 'timezone=".$domain_setting_value."' "; + $sql .= "where dialplan_detail_uuid = '".$dialplan_detail_uuid."' "; + } + else { + $dialplan_detail_uuid = uuid(); + $dialplan_detail_group = 0; + $sql = "insert into v_dialplan_details "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "dialplan_detail_uuid, "; + $sql .= "dialplan_uuid, "; + $sql .= "dialplan_detail_tag, "; + $sql .= "dialplan_detail_type, "; + $sql .= "dialplan_detail_data, "; + $sql .= "dialplan_detail_inline, "; + $sql .= "dialplan_detail_group "; + $sql .= ") "; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$dialplan_detail_uuid."', "; + $sql .= "'".$dialplan_uuid."', "; + $sql .= "'action', "; + $sql .= "'set', "; + $sql .= "'timezone=".$domain_setting_value."', "; + $sql .= "'true', "; + $sql .= "'".$dialplan_detail_group."' "; + $sql .= "); "; + } + $db->query($sql); + unset($sql); + } //add the domain if ($action == "add" && permission_exists('domain_setting_add')) { diff --git a/resources/functions.php b/resources/functions.php index 8ae34eb285..c1bd498810 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -27,7 +27,7 @@ if (!function_exists('software_version')) { function software_version() { - return '4.0.0'; + return '4.0.1'; } } @@ -1326,4 +1326,4 @@ function number_pad($number,$n) { } } -?> \ No newline at end of file +?> diff --git a/resources/install/scripts/app/call_block/index.lua b/resources/install/scripts/app/call_block/index.lua index 8821a099ef..91c7056b40 100644 --- a/resources/install/scripts/app/call_block/index.lua +++ b/resources/install/scripts/app/call_block/index.lua @@ -112,6 +112,7 @@ This method causes the script to get its manadatory arguments directly from the --set the cache if (found_cid_num) then -- caller id exists if (found_enabled == "true") then + --set the cache cache = "found_cid_num=" .. found_cid_num .. "&found_uuid=" .. found_uuid .. "&found_enabled=" .. found_enabled .. "&found_action=" .. found_action .. "&found_count=" .. found_count; result = trim(api:execute("memcache", "set app:call_block:" .. params["domain_name"] .. ":" .. params["cid_num"] .. " '"..cache.."' "..expire["call_block"])); @@ -172,15 +173,16 @@ This method causes the script to get its manadatory arguments directly from the if (source == "database") then dbh:query("UPDATE v_call_block SET call_block_count = " .. found_count + 1 .. " WHERE call_block_uuid = '" .. found_uuid .. "'") end - session:setVariable("call_block", "block") + session:execute("set", "call_blocked=true"); logger("W", "NOTICE", "number " .. params["cid_num"] .. " blocked with " .. found_count .. " previous hits, domain_name: " .. params["domain_name"]) if (found_action == "Reject") then session:hangup("CALL_REJECTED") - end - if (found_action == "Busy") then + elseif (found_action == "Busy") then session:hangup("USER_BUSY") - end - if (details[0] =="Voicemail") then + elseif (found_action =="Hold") then + session:setAutoHangup(false) + session:execute("transfer", "*9664") + elseif (details[0] =="Voicemail") then session:setAutoHangup(false) session:execute("transfer", "*99" .. details[2] .. " XML " .. details[1]) end diff --git a/resources/install/scripts/app/conference_center/index.lua b/resources/install/scripts/app/conference_center/index.lua index 58d61f10fb..395db64a75 100644 --- a/resources/install/scripts/app/conference_center/index.lua +++ b/resources/install/scripts/app/conference_center/index.lua @@ -13,7 +13,7 @@ -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- --- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +-- THIS SOFTWARE IS PROVIDED AS ''IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, @@ -385,7 +385,7 @@ end --check if someone has already joined the conference - local_hostname = trim(api:execute("hostname", "")); + local_hostname = trim(api:execute("switchname", "")); freeswitch.consoleLog("notice", "[conference center] local_hostname is " .. local_hostname .. "\n"); sql = "SELECT hostname FROM channels WHERE application = 'conference' AND dest = '" .. destination_number .. "' AND cid_num <> '".. caller_id_number .."' LIMIT 1"; if (debug["sql"]) then diff --git a/resources/install/scripts/app/fax/resources/scripts/hangup_rx.lua b/resources/install/scripts/app/fax/resources/scripts/hangup_rx.lua index d70db541e9..81ac0ffd13 100644 --- a/resources/install/scripts/app/fax/resources/scripts/hangup_rx.lua +++ b/resources/install/scripts/app/fax/resources/scripts/hangup_rx.lua @@ -22,6 +22,9 @@ -- Contributor(s): -- Mark J. Crane +--set the debug options + debug["sql"] = false; + --create the api object api = freeswitch.API(); diff --git a/resources/install/scripts/app/ring_groups/index.lua b/resources/install/scripts/app/ring_groups/index.lua index 3a99d108af..553cb69ee1 100644 --- a/resources/install/scripts/app/ring_groups/index.lua +++ b/resources/install/scripts/app/ring_groups/index.lua @@ -12,7 +12,7 @@ -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- --- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +-- THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, @@ -38,6 +38,7 @@ local log = require "resources.functions.log".ring_group require "resources.functions.explode"; require "resources.functions.base64"; require "resources.functions.file_exists"; + require "resources.functions.explode"; --get the variables domain_name = session:getVariable("domain_name"); @@ -101,6 +102,7 @@ local log = require "resources.functions.log".ring_group status = dbh:query(sql, function(row) domain_uuid = row["domain_uuid"]; ring_group_name = row["ring_group_name"]; + ring_group_extension = row["ring_group_extension"]; ring_group_forward_enabled = row["ring_group_forward_enabled"]; ring_group_forward_destination = row["ring_group_forward_destination"]; ring_group_cid_name_prefix = row["ring_group_cid_name_prefix"]; @@ -152,6 +154,9 @@ local log = require "resources.functions.log".ring_group subject = subject:gsub("${caller_id_name}", caller_id_name); subject = subject:gsub("${caller_id_number}", caller_id_number); subject = subject:gsub("${ring_group_name}", ring_group_name); + subject = subject:gsub("${ring_group_extension}", ring_group_extension); + subject = subject:gsub("${sip_to_user}", ring_group_name); + subject = subject:gsub("${dialed_user}", ring_group_extension); subject = trim(subject); subject = '=?utf-8?B?'..base64.encode(subject)..'?='; @@ -162,6 +167,9 @@ local log = require "resources.functions.log".ring_group body = body:gsub("${caller_id_name}", caller_id_name); body = body:gsub("${caller_id_number}", caller_id_number); body = body:gsub("${ring_group_name}", ring_group_name); + body = body:gsub("${ring_group_extension}", ring_group_extension); + body = body:gsub("${sip_to_user}", ring_group_name); + body = body:gsub("${dialed_user}", ring_group_extension); body = body:gsub(" ", " "); body = body:gsub("%s+", ""); body = body:gsub(" ", " "); @@ -436,12 +444,23 @@ local log = require "resources.functions.log".ring_group cmd = "show channels like "..destination_number; reply = trim(api:executeString(cmd)); --freeswitch.consoleLog("notice", "[ring group] reply "..cmd.." " .. reply .. "\n"); + exploded_reply = {}; + exploded_reply = explode(",",reply); + if (reply == "0 total.") then dial_string = dial_string_to_user else - if (string.find(reply, domain_name)) then - --active call - else + idle_extension=true; + + if (exploded_reply ~= nil) then + for i,v in ipairs(exploded_reply) do + if(v==destination_number.."@"..domain_name) then + idle_extension=false; + end + end + end + + if(idle_extension) then dial_string = dial_string_to_user; end end @@ -619,36 +638,27 @@ local log = require "resources.functions.log".ring_group app_data = app_data:gsub("%]", "}"); end freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n"); + -- log.noticef("bridge begin: originate_disposition:%s answered:%s ready:%s bridged:%s", session:getVariable("originate_disposition"), session:answered() and "true" or "false", session:ready() and "true" or "false", session:bridged() and "true" or "false") session:execute("bridge", app_data); -- log.noticef("bridge done: originate_disposition:%s answered:%s ready:%s bridged:%s", session:getVariable("originate_disposition"), session:answered() and "true" or "false", session:ready() and "true" or "false", session:bridged() and "true" or "false") end --timeout destination if (app_data ~= nil) then - if ring_group_strategy == "enterprise" - and ( true - --- I see 2 errors here `failure` and `PICKED_OFF` - --- but they be more. I think check `answered` is enough. - -- or session:getVariable("originate_disposition") == "failure" - -- or session:getVariable("originate_disposition") == "PICKED_OFF" - ) - and session:answered() then - -- for enterprise calls when intercept we get "failure" but session answered - return - end - - if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT" + if session:ready() and ( + session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT" or session:getVariable("originate_disposition") == "NO_ANSWER" or session:getVariable("originate_disposition") == "NO_USER_RESPONSE" or session:getVariable("originate_disposition") == "USER_NOT_REGISTERED" or session:getVariable("originate_disposition") == "NORMAL_TEMPORARY_FAILURE" or session:getVariable("originate_disposition") == "NO_ROUTE_DESTINATION" or session:getVariable("originate_disposition") == "USER_BUSY" - or session:getVariable("originate_disposition") == "failure") then - --send missed call notification - missed(); - --execute the time out action - session:execute(ring_group_timeout_app, ring_group_timeout_data); + or session:getVariable("originate_disposition") == "failure" + ) then + --send missed call notification + missed(); + --execute the time out action + session:execute(ring_group_timeout_app, ring_group_timeout_data); end else if (ring_group_timeout_app ~= nil) then diff --git a/resources/install/scripts/app/voicemail/index.lua b/resources/install/scripts/app/voicemail/index.lua index 056127af3b..ee9e79e5cd 100644 --- a/resources/install/scripts/app/voicemail/index.lua +++ b/resources/install/scripts/app/voicemail/index.lua @@ -73,6 +73,7 @@ skip_instructions = session:getVariable("skip_instructions"); skip_greeting = session:getVariable("skip_greeting"); vm_message_ext = session:getVariable("vm_message_ext"); + vm_say_caller_id_number = session:getVariable("vm_say_caller_id_number"); vm_disk_quota = session:getVariable("vm-disk-quota"); if (not vm_disk_quota) then vm_disk_quota = session:getVariable("vm_disk_quota"); diff --git a/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua b/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua index cf4971e5e2..81b763f044 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/listen_to_recording.lua @@ -31,20 +31,34 @@ max_digits = 1; --flush dtmf digits from the input buffer session:flushDigits(); + --set the callback function + if (session:ready()) then + session:setVariable("playback_terminators", "#"); + session:setInputCallback("on_dtmf", ""); + end --set the display if (session:ready()) then reply = api:executeString("uuid_display "..session:get_uuid().." "..caller_id_number); end --say the message number if (session:ready()) then - if (string.len(dtmf_digits) == 0) then + if (string.len(dtmf_digits) == 0) then dtmf_digits = macro(session, "message_number", 1, 100, ''); end end --say the number if (session:ready()) then if (string.len(dtmf_digits) == 0) then - session:say(message_number, default_language, "NUMBER", "pronounced"); + session:say(message_number, default_language, "number", "pronounced"); + end + end + --say the caller id number + if (session:ready() and caller_id_number ~= nil) then + if (vm_say_caller_id_number ~= nil) then + if (vm_say_caller_id_number == "true") then + session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-message_from.wav"); + session:say(caller_id_number, default_language, "name_spelled", "iterated"); + end end end --say the message date @@ -53,10 +67,9 @@ if (current_time_zone ~= nil) then session:execute("set", "timezone="..current_time_zone..""); end - session:say(created_epoch, default_language, "CURRENT_DATE_TIME", "pronounced"); + session:say(created_epoch, default_language, "current_date_time", "pronounced"); end end - --get the recordings from the database if (storage_type == "base64") then sql = [[SELECT * FROM v_voicemail_messages diff --git a/resources/install/scripts/app/voicemail/resources/functions/send_email.lua b/resources/install/scripts/app/voicemail/resources/functions/send_email.lua index f00cb942a5..7009932369 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/send_email.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/send_email.lua @@ -131,6 +131,8 @@ body = body:gsub("${message_duration}", message_length_formatted); body = body:gsub("${account}", id); body = body:gsub("${domain_name}", domain_name); + body = body:gsub("${sip_to_user}", id); + body = body:gsub("${dialed_user}", id); if (voicemail_file == "attach") then body = body:gsub("${message}", text['label-attached'][default_language.."-"..default_dialect]); elseif (voicemail_file == "link") then diff --git a/resources/install/scripts/app/xml_handler/index.lua b/resources/install/scripts/app/xml_handler/index.lua index d3aabc7f0c..5bc9b52be7 100644 --- a/resources/install/scripts/app/xml_handler/index.lua +++ b/resources/install/scripts/app/xml_handler/index.lua @@ -23,22 +23,6 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ---set defaults - expire = {} - expire["directory"] = "3600"; - expire["dialplan"] = "3600"; - expire["languages"] = "3600"; - expire["sofia.conf"] = "3600"; - expire["acl.conf"] = "3600"; - load_balancing = false; - ---set the debug options - debug["params"] = false; - debug["sql"] = false; - debug["xml_request"] = false; - debug["xml_string"] = false; - debug["cache"] = false; - --general functions require "resources.functions.trim"; require "resources.functions.file_exists"; diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua index 6656f619f3..a05f14188c 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua @@ -1,6 +1,6 @@ -- xml_handler.lua -- Part of FusionPBX --- Copyright (C) 2013 Mark J Crane +-- Copyright (C) 2013 - 2015 Mark J Crane -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -116,9 +116,10 @@ sql = sql .. "and g.enabled = 'true' "; sql = sql .. "and (g.domain_uuid = d.domain_uuid or g.domain_uuid is null) "; else - sql = "select * from v_gateways "; - sql = sql .. "where enabled = 'true' and profile = '"..sip_profile_name.."' "; + sql = "select * from v_gateways as g "; + sql = sql .. "where g.enabled = 'true' and g.profile = '"..sip_profile_name.."' "; end + sql = sql .. "and (g.hostname = '" .. hostname.. "' or g.hostname is null or g.hostname = '') "; if (debug["sql"]) then freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n"); end diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua b/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua index cf50cd5de6..5e653be5f6 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua @@ -99,13 +99,13 @@ dialed_extension = params:getHeader("dialed_extension"); if (dialed_extension == nil) then --freeswitch.consoleLog("notice", "[xml_handler-directory.lua] dialed_extension is null\n"); - load_balancing = false; + xml_handler["fs_path"] = false; else --freeswitch.consoleLog("notice", "[xml_handler-directory.lua] dialed_extension is " .. dialed_extension .. "\n"); end --build the XML string from the database - if (source == "database") or (load_balancing) then + if (source == "database") or (xml_handler["fs_path"]) then --database connection if (continue) then --connect to the database @@ -138,7 +138,7 @@ --if load balancing is set to true then get the hostname if (continue) then - if (load_balancing) then + if (xml_handler["fs_path"]) then --get the domain_name from domains if (domain_name == nil) then @@ -181,9 +181,9 @@ --freeswitch.consoleLog("notice", "[xml_handler] sql: " .. sql .. "\n"); --freeswitch.consoleLog("notice", "[xml_handler-directory.lua] database_hostname is " .. database_hostname .. "\n"); - --hostname was not found set load_balancing to false to prevent a database_hostname concatenation error + --hostname was not found set xml_handler["fs_path"] to false to prevent a database_hostname concatenation error if (database_hostname == nil) then - load_balancing = false; + xml_handler["fs_path"] = false; end --close the database connection @@ -261,7 +261,7 @@ dial_string = "{sip_invite_domain=" .. domain_name .. ",presence_id=" .. user .. "@" .. domain_name .. "}${sofia_contact(" .. extension .. "@" .. domain_name .. ")}"; end --set the an alternative dial string if the hostnames don't match - if (load_balancing) then + if (xml_handler["fs_path"]) then if (local_hostname == database_hostname) then freeswitch.consoleLog("notice", "[xml_handler-directory.lua] local_host and database_host are the same\n"); else @@ -271,13 +271,13 @@ --freeswitch.consoleLog("notice", "[xml_handler-directory.lua] dial_string " .. dial_string .. "\n"); end else - --freeswitch.consoleLog("notice", "[xml_handler-directory.lua] seems balancing is false??" .. tostring(load_balancing) .. "\n"); + --freeswitch.consoleLog("notice", "[xml_handler-directory.lua] seems balancing is false??" .. tostring(xml_handler["fs_path"]) .. "\n"); end --show debug informationa - --if (load_balancing) then - -- freeswitch.consoleLog("notice", "[xml_handler] local_hostname: " .. local_hostname.. " database_hostname: " .. database_hostname .. " dial_string: " .. dial_string .. "\n"); - --end + if (xml_handler["fs_path"]) then + freeswitch.consoleLog("notice", "[xml_handler] local_hostname: " .. local_hostname.. " database_hostname: " .. database_hostname .. " dial_string: " .. dial_string .. "\n"); + end end end); end diff --git a/resources/install/scripts/call_flow_monitor.lua b/resources/install/scripts/call_flow_monitor.lua index 5be5ccf4bb..5db7d4f3d0 100644 --- a/resources/install/scripts/call_flow_monitor.lua +++ b/resources/install/scripts/call_flow_monitor.lua @@ -25,7 +25,7 @@ -- POSSIBILITY OF SUCH DAMAGE. --set the time between loops in seconds - sleep = 300; + sleep = 60; --set the debug level debug["log"] = false; diff --git a/resources/install/scripts/fax_retry.lua b/resources/install/scripts/fax_retry.lua index 652c4c4180..a6f2ce6fad 100644 --- a/resources/install/scripts/fax_retry.lua +++ b/resources/install/scripts/fax_retry.lua @@ -391,7 +391,7 @@ --email_cmd = "/bin/echo '"..email_message_fail.."' | /usr/bin/mail -s 'Fax to: "..number_dialed.." FAILED' -r "..from_address.." -a '"..fax_file.."' "..email_address; --to keep the originate command shorter these are things we always send. One place to adjust for all. - originate_same = "for_fax=1,absolute_codec_string='PCMU,PCMA',accountcode='"..accountcode.."',domain_uuid="..domain_uuid..",domain_name="..domain_name..",mailto_address='"..email_address.."',mailfrom_address='"..from_address.."',origination_caller_id_name='"..origination_caller_id_name.. "',origination_caller_id_number="..origination_caller_id_number..",fax_uri="..fax_uri..",fax_retry_limit="..fax_retry_limit..",fax_retry_sleep="..fax_retry_sleep..",fax_verbose=true,fax_file='"..fax_file.."'"; + originate_same = "for_fax=1,accountcode='"..accountcode.."',domain_uuid="..domain_uuid..",domain_name="..domain_name..",mailto_address='"..email_address.."',mailfrom_address='"..from_address.."',origination_caller_id_name='"..origination_caller_id_name.. "',origination_caller_id_number="..origination_caller_id_number..",fax_uri="..fax_uri..",fax_retry_limit="..fax_retry_limit..",fax_retry_sleep="..fax_retry_sleep..",fax_verbose=true,fax_file='"..fax_file.."'"; if (fax_retry_attempts < fax_retry_limit) then diff --git a/resources/templates/conf/sip_profiles/internal.xml.noload b/resources/templates/conf/sip_profiles/internal.xml.noload index 012c50e59a..787fde8f95 100644 --- a/resources/templates/conf/sip_profiles/internal.xml.noload +++ b/resources/templates/conf/sip_profiles/internal.xml.noload @@ -97,7 +97,7 @@ - + - + @@ -292,7 +292,7 @@ - +