diff --git a/app/call_block/app_config.php b/app/call_block/app_config.php index 66240bd553..4d5af2cadc 100644 --- a/app/call_block/app_config.php +++ b/app/call_block/app_config.php @@ -99,6 +99,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary"; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_direction"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select the direction of the calls to block."; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "extension_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; @@ -113,11 +117,15 @@ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the name."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_block_country_code"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the country code."; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_number"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_caller_number"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the full phone number."; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the phone number."; $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "call_block_count"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "blocked_call_count"; diff --git a/app/call_block/app_defaults.php b/app/call_block/app_defaults.php index ad9a9495fb..56c8d4c733 100644 --- a/app/call_block/app_defaults.php +++ b/app/call_block/app_defaults.php @@ -30,8 +30,8 @@ if ($domains_processed == 1) { $database = new database; $database->execute("DROP VIEW view_call_block;", null); $sql = "CREATE VIEW view_call_block AS ( \n"; - $sql .= " select c.domain_uuid, call_block_uuid, c.extension_uuid, call_block_name, \n"; - $sql .= " call_block_number, extension, number_alias, call_block_count, call_block_app, call_block_data, date_added, call_block_enabled, call_block_description \n"; + $sql .= " select c.domain_uuid, call_block_uuid, c.call_block_direction, c.extension_uuid, c.call_block_name, c.call_block_country_code, \n"; + $sql .= " c.call_block_number, e.extension, e.number_alias, c.call_block_count, c.call_block_app, c.call_block_data, c.date_added, c.call_block_enabled, c.call_block_description \n"; $sql .= " from v_call_block as c \n"; $sql .= " left join v_extensions as e \n"; $sql .= " on c.extension_uuid = e.extension_uuid \n"; diff --git a/app/call_block/app_languages.php b/app/call_block/app_languages.php index 69c914bac4..eba6287e68 100644 --- a/app/call_block/app_languages.php +++ b/app/call_block/app_languages.php @@ -177,6 +177,27 @@ $text['label-provide-enabled']['ru-ru'] = "Пожалуйста, введите: $text['label-provide-enabled']['sv-se'] = "Ange: Aktiverad"; $text['label-provide-enabled']['uk-ua'] = "Включити/відключити"; +$text['label-country_code']['en-us'] = "Country Code"; +$text['label-country_code']['en-gb'] = "Country Code"; +$text['label-country_code']['ar-eg'] = ""; +$text['label-country_code']['de-at'] = ""; //copied from de-de +$text['label-country_code']['de-ch'] = ""; //copied from de-de +$text['label-country_code']['de-de'] = ""; +$text['label-country_code']['es-cl'] = ""; +$text['label-country_code']['es-mx'] = ""; //copied from es-cl +$text['label-country_code']['fr-ca'] = "Préfixe"; //copied from fr-fr +$text['label-country_code']['fr-fr'] = "Préfixe"; +$text['label-country_code']['he-il'] = ""; +$text['label-country_code']['it-it'] = ""; +$text['label-country_code']['nl-nl'] = "Voorloop"; +$text['label-country_code']['pl-pl'] = ""; +$text['label-country_code']['pt-br'] = "Prefixo"; //copied from pt-pt +$text['label-country_code']['pt-pt'] = ""; +$text['label-country_code']['ro-ro'] = ""; +$text['label-country_code']['ru-ru'] = ""; +$text['label-country_code']['sv-se'] = ""; +$text['label-country_code']['uk-ua'] = ""; + $text['label-number']['en-us'] = "Number"; $text['label-number']['en-gb'] = "Number"; $text['label-number']['ar-eg'] = "رقم"; @@ -265,6 +286,48 @@ $text['label-inbound']['ru-ru'] = "Входящий"; $text['label-inbound']['sv-se'] = "Inkommande"; $text['label-inbound']['uk-ua'] = "Вихідний"; +$text['label-outbound']['en-us'] = "Outbound"; +$text['label-outbound']['en-gb'] = "Outbound"; +$text['label-outbound']['ar-eg'] = ""; +$text['label-outbound']['de-at'] = "Ausgehend"; //copied from de-de +$text['label-outbound']['de-ch'] = "Ausgehend"; //copied from de-de +$text['label-outbound']['de-de'] = "Ausgehend"; +$text['label-outbound']['es-cl'] = "Salida"; +$text['label-outbound']['es-mx'] = "Salida"; //copied from es-cl +$text['label-outbound']['fr-ca'] = "Sortant"; //copied from fr-fr +$text['label-outbound']['fr-fr'] = "Sortant"; +$text['label-outbound']['he-il'] = ""; +$text['label-outbound']['it-it'] = "In Uscita"; +$text['label-outbound']['nl-nl'] = ""; +$text['label-outbound']['pl-pl'] = "Wychodzące"; +$text['label-outbound']['pt-br'] = "Saída"; //copied from pt-pt +$text['label-outbound']['pt-pt'] = "Saída"; +$text['label-outbound']['ro-ro'] = ""; +$text['label-outbound']['ru-ru'] = "Исходящие"; +$text['label-outbound']['sv-se'] = "Utgående"; +$text['label-outbound']['uk-ua'] = ""; + +$text['label-destination']['en-us'] = "Destination"; +$text['label-destination']['en-gb'] = "Destination"; +$text['label-destination']['ar-eg'] = ""; +$text['label-destination']['de-at'] = "Ziel"; //copied from de-de +$text['label-destination']['de-ch'] = "Ziel"; //copied from de-de +$text['label-destination']['de-de'] = "Ziel"; +$text['label-destination']['es-cl'] = "Destino"; +$text['label-destination']['es-mx'] = "Destino"; //copied from es-cl +$text['label-destination']['fr-ca'] = "Destination"; //copied from fr-fr +$text['label-destination']['fr-fr'] = "Destination"; +$text['label-destination']['he-il'] = ""; +$text['label-destination']['it-it'] = "Destinazione"; +$text['label-destination']['nl-nl'] = ""; +$text['label-destination']['pl-pl'] = "Numer docelowy"; +$text['label-destination']['pt-br'] = "Número de destino"; +$text['label-destination']['pt-pt'] = "Destino"; +$text['label-destination']['ro-ro'] = ""; +$text['label-destination']['ru-ru'] = "Назначение"; +$text['label-destination']['sv-se'] = "Destination"; +$text['label-destination']['uk-ua'] = "Номер"; + $text['label-edit-note']['en-us'] = "Block calls from a number. Edit the name and enable/disable below."; $text['label-edit-note']['en-gb'] = "Block calls from a number. Edit the name and enable/disable below."; $text['label-edit-note']['ar-eg'] = ""; @@ -419,27 +482,27 @@ $text['label-count']['ru-ru'] = "Количество"; $text['label-count']['sv-se'] = "Räkna"; $text['label-count']['uk-ua'] = "Кількість"; -$text['label-called-on']['en-us'] = "Called on"; -$text['label-called-on']['en-gb'] = "Called on"; -$text['label-called-on']['ar-eg'] = "تم الأتصال علي"; -$text['label-called-on']['de-at'] = "Anruf am"; //copied from de-de -$text['label-called-on']['de-ch'] = "Anruf am"; //copied from de-de -$text['label-called-on']['de-de'] = "Anruf am"; -$text['label-called-on']['el-gr'] = "Η κλήση πραγματοποιήθηκε"; -$text['label-called-on']['es-cl'] = "Llamó en"; -$text['label-called-on']['es-mx'] = "Llamó en"; //copied from es-cl -$text['label-called-on']['fr-ca'] = "Appelé le"; //copied from fr-fr -$text['label-called-on']['fr-fr'] = "Appelé le"; -$text['label-called-on']['he-il'] = "Opgeroepen op"; -$text['label-called-on']['it-it'] = "Chiamato il"; -$text['label-called-on']['nl-nl'] = "Aangeroepen op"; -$text['label-called-on']['pl-pl'] = "Zadzwoniono na"; -$text['label-called-on']['pt-br'] = "Chamada em "; -$text['label-called-on']['pt-pt'] = "Chamado em"; -$text['label-called-on']['ro-ro'] = "Sunat pe"; -$text['label-called-on']['ru-ru'] = "Направление"; -$text['label-called-on']['sv-se'] = "Ringdes på"; -$text['label-called-on']['uk-ua'] = "Дзвінок здійснено"; +$text['label-called']['en-us'] = "Called"; +$text['label-called']['en-gb'] = "Called"; +$text['label-called']['ar-eg'] = "تم الأتصال علي"; +$text['label-called']['de-at'] = "Anruf"; //copied from de-de +$text['label-called']['de-ch'] = "Anruf"; //copied from de-de +$text['label-called']['de-de'] = "Anruf"; +$text['label-called']['el-gr'] = "Η κλήση πραγματοποιήθηκε"; +$text['label-called']['es-cl'] = "Llamó"; +$text['label-called']['es-mx'] = "Llamó"; //copied from es-cl +$text['label-called']['fr-ca'] = "Appelé"; //copied from fr-fr +$text['label-called']['fr-fr'] = "Appelé"; +$text['label-called']['he-il'] = "Opgeroepen"; +$text['label-called']['it-it'] = "Chiamato"; +$text['label-called']['nl-nl'] = "Aangeroepen"; +$text['label-called']['pl-pl'] = "Zadzwoniono"; +$text['label-called']['pt-br'] = "Chamada"; +$text['label-called']['pt-pt'] = "Chamado"; +$text['label-called']['ro-ro'] = "Sunat"; +$text['label-called']['ru-ru'] = "Направление"; +$text['label-called']['sv-se'] = "Ringdes"; +$text['label-called']['uk-ua'] = "Дзвінок здійснено"; $text['label-busy']['en-us'] = "Busy"; $text['label-busy']['en-gb'] = "Busy"; @@ -573,6 +636,49 @@ $text['label-action']['ru-ru'] = "Действие"; $text['label-action']['sv-se'] = "Åtgärd"; $text['label-action']['uk-ua'] = "Дія"; +$text['label-direction']['en-us'] = "Direction"; +$text['label-direction']['en-gb'] = "Direction"; +$text['label-direction']['ar-eg'] = ""; +$text['label-direction']['de-at'] = "Richtung"; //copied from de-de +$text['label-direction']['de-ch'] = "Richtung"; //copied from de-de +$text['label-direction']['de-de'] = "Richtung"; +$text['label-direction']['es-cl'] = "Dirección"; +$text['label-direction']['es-mx'] = "Dirección"; //copied from es-cl +$text['label-direction']['fr-ca'] = "Direction"; //copied from fr-fr +$text['label-direction']['fr-fr'] = "Direction"; +$text['label-direction']['he-il'] = ""; +$text['label-direction']['it-it'] = "Direzione"; +$text['label-direction']['nl-nl'] = ""; +$text['label-direction']['pl-pl'] = "Kierunek"; +$text['label-direction']['pt-br'] = "Direção"; +$text['label-direction']['pt-pt'] = "Direcção"; +$text['label-direction']['ro-ro'] = ""; +$text['label-direction']['ru-ru'] = "Направление"; +$text['label-direction']['sv-se'] = "Riktning"; +$text['label-direction']['uk-ua'] = "Напрям"; + +$text['description-direction']['en-us'] = "Select the direction of the calls to block."; +$text['description-direction']['en-gb'] = "Select the direction of the calls to block."; +$text['description-direction']['ar-eg'] = "Select the direction of the calls to block."; +$text['description-direction']['de-at'] = "Select the direction of the calls to block."; +$text['description-direction']['de-ch'] = "Select the direction of the calls to block."; +$text['description-direction']['de-de'] = "Select the direction of the calls to block."; +$text['description-direction']['el-gr'] = "Select the direction of the calls to block."; +$text['description-direction']['es-cl'] = "Select the direction of the calls to block."; +$text['description-direction']['es-mx'] = "Select the direction of the calls to block."; +$text['description-direction']['fr-ca'] = "Select the direction of the calls to block."; +$text['description-direction']['fr-fr'] = "Select the direction of the calls to block."; +$text['description-direction']['he-il'] = "Select the direction of the calls to block."; +$text['description-direction']['it-it'] = "Select the direction of the calls to block."; +$text['description-direction']['nl-nl'] = "Select the direction of the calls to block."; +$text['description-direction']['pl-pl'] = "Select the direction of the calls to block."; +$text['description-direction']['pt-br'] = "Select the direction of the calls to block."; +$text['description-direction']['pt-pt'] = "Select the direction of the calls to block."; +$text['description-direction']['ro-ro'] = "Select the direction of the calls to block."; +$text['description-direction']['ru-ru'] = "Select the direction of the calls to block."; +$text['description-direction']['sv-se'] = "Select the direction of the calls to block."; +$text['description-direction']['uk-ua'] = "Select the direction of the calls to block."; + $text['description-call_block_name']['en-us'] = "Enter the Caller ID Name to block."; $text['description-call_block_name']['en-gb'] = "Enter the Caller ID Name to block."; $text['description-call_block_name']['ar-eg'] = ""; @@ -595,8 +701,29 @@ $text['description-call_block_name']['ru-ru'] = ""; $text['description-call_block_name']['sv-se'] = ""; $text['description-call_block_name']['uk-ua'] = ""; -$text['description-call_block_number']['en-us'] = "Enter the Caller ID Number to block."; -$text['description-call_block_number']['en-gb'] = "Enter the Caller ID Number to block."; +$text['description-country_code']['en-us'] = "Enter the Country Code prefix."; +$text['description-country_code']['en-gb'] = "Enter the Country Code prefix."; +$text['description-country_code']['ar-eg'] = ""; +$text['description-country_code']['de-at'] = ""; //copied from de-de +$text['description-country_code']['de-ch'] = ""; //copied from de-de +$text['description-country_code']['de-de'] = ""; +$text['description-country_code']['es-cl'] = ""; +$text['description-country_code']['es-mx'] = ""; //copied from es-cl +$text['description-country_code']['fr-ca'] = "Entrez le préfixe de destination."; //copied from fr-fr +$text['description-country_code']['fr-fr'] = "Entrez le préfixe de destination."; +$text['description-country_code']['he-il'] = ""; +$text['description-country_code']['it-it'] = ""; +$text['description-country_code']['nl-nl'] = "Voer de bestemming prefix in."; +$text['description-country_code']['pl-pl'] = ""; +$text['description-country_code']['pt-br'] = "Insira o prefixo do destino."; +$text['description-country_code']['pt-pt'] = ""; +$text['description-country_code']['ro-ro'] = ""; +$text['description-country_code']['ru-ru'] = ""; +$text['description-country_code']['sv-se'] = ""; +$text['description-country_code']['uk-ua'] = ""; + +$text['description-call_block_number']['en-us'] = "Enter the Country Code and Caller ID Number to block."; +$text['description-call_block_number']['en-gb'] = "Enter the Country Code and Caller ID Number to block."; $text['description-call_block_number']['ar-eg'] = ""; $text['description-call_block_number']['de-at'] = ""; $text['description-call_block_number']['de-ch'] = ""; @@ -617,8 +744,8 @@ $text['description-call_block_number']['ru-ru'] = ""; $text['description-call_block_number']['sv-se'] = ""; $text['description-call_block_number']['uk-ua'] = ""; -$text['description-extension']['en-us'] = "Select the extension to block."; -$text['description-extension']['en-gb'] = "Select the extension to block."; +$text['description-extension']['en-us'] = "Select the extension to be affected."; +$text['description-extension']['en-gb'] = "Select the extension to be affected."; $text['description-extension']['ar-eg'] = ""; $text['description-extension']['de-at'] = ""; $text['description-extension']['de-ch'] = ""; diff --git a/app/call_block/call_block.php b/app/call_block/call_block.php index bba27639d1..a4ab54e559 100644 --- a/app/call_block/call_block.php +++ b/app/call_block/call_block.php @@ -83,6 +83,7 @@ if (strlen($search) > 0) { $sql_search = " ("; $sql_search .= "lower(call_block_name) like :search "; + $sql_search .= "or call_block_country_code like :search "; $sql_search .= "or lower(call_block_number) like :search "; $sql_search .= "or lower(call_block_description) like :search "; $sql_search .= ") "; @@ -136,7 +137,7 @@ if (isset($sql_search)) { $sql .= "and ".$sql_search; } - $sql .= order_by($order_by, $order, 'call_block_number'); + $sql .= order_by($order_by, $order, ['call_block_country_code','call_block_number']); $sql .= limit_offset($rows_per_page, $offset); $database = new database; $result = $database->select($sql, $parameters, 'all'); @@ -202,8 +203,10 @@ echo " \n"; echo " \n"; } - echo th_order_by('extension', $text['label-extension'], $order_by, $order); + echo th_order_by('call_block_direction', $text['label-direction'], $order_by, $order, null, "style='width: 1%;' class='center'"); + echo th_order_by('extension', $text['label-extension'], $order_by, $order, null, "class='center'"); echo th_order_by('call_block_name', $text['label-name'], $order_by, $order); + echo th_order_by('call_block_country_code', $text['label-country_code'], $order_by, $order); echo th_order_by('call_block_number', $text['label-number'], $order_by, $order); echo th_order_by('call_block_count', $text['label-count'], $order_by, $order, '', "class='center hide-sm-dn'"); echo th_order_by('call_block_action', $text['label-action'], $order_by, $order); @@ -228,7 +231,13 @@ echo " \n"; echo " \n"; } - echo "
| \n"; + echo " ".$text['label-direction']."\n"; + echo " | \n"; + echo "\n";
+ echo " \n";
+ echo " \n"; + echo $text['description-direction']."\n"; + echo "\n"; + echo " | \n";
+ echo "
| \n"; @@ -356,6 +380,7 @@ echo " ".$text['label-number']."\n"; echo " | \n"; echo "\n";
+ echo " \n";
echo " \n";
echo " \n"; echo $text['description-call_block_number']."\n"; @@ -460,57 +485,49 @@ //get recent calls from the db (if not editing an existing call block record) if (!is_uuid($_REQUEST["id"])) { - if (permission_exists('call_block_all')) { - $sql = "select caller_id_number, caller_id_name, caller_id_number, start_epoch, direction, hangup_cause, duration, billsec, xml_cdr_uuid "; - $sql .= "from v_xml_cdr where true "; - $sql .= "and domain_uuid = :domain_uuid "; - $sql .= "and direction != 'outbound' "; - $sql .= "order by start_stamp desc "; - $sql .= limit_offset($_SESSION['call_block']['recent_call_limit']['text']); - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $result = $database->select($sql, $parameters); - unset($sql, $parameters); - } - + //without block all permission, limit to assigned extension(s) if (!permission_exists('call_block_all') && is_array($_SESSION['user']['extension'])) { foreach ($_SESSION['user']['extension'] as $assigned_extension) { $assigned_extensions[$assigned_extension['extension_uuid']] = $assigned_extension['user']; } - - $sql = "select caller_id_number, caller_id_name, caller_id_number, start_epoch, direction, hangup_cause, duration, billsec, xml_cdr_uuid "; - $sql .= "from v_xml_cdr "; - $sql .= "where domain_uuid = :domain_uuid "; - if (is_array($assigned_extensions) && sizeof($assigned_extensions) != 0) { - $x = 0; - foreach ($assigned_extensions as $assigned_extension_uuid => $assigned_extension) { - $sql_where_array[] = "extension_uuid = :extension_uuid_".$x; - //$sql_where_array[] = "caller_id_number = :caller_id_number_".$x; - //$sql_where_array[] = "destination_number = :destination_number_1_".$x; - //$sql_where_array[] = "destination_number = :destination_number_2_".$x; - $parameters['extension_uuid_'.$x] = $assigned_extension_uuid; - //$parameters['caller_id_number_'.$x] = $assigned_extension; - //$parameters['destination_number_1_'.$x] = $assigned_extension; - //$parameters['destination_number_2_'.$x] = '*99'.$assigned_extension; - $x++; - } - if (is_array($sql_where_array) && sizeof($sql_where_array) != 0) { - $sql .= "and (".implode(' or ', $sql_where_array).") "; - } - unset($sql_where_array); + if (is_array($assigned_extensions) && sizeof($assigned_extensions) != 0) { + $x = 0; + foreach ($assigned_extensions as $assigned_extension_uuid => $assigned_extension) { + $sql_where_array[] = "extension_uuid = :extension_uuid_".$x; + $parameters['extension_uuid_'.$x] = $assigned_extension_uuid; + $x++; } - $sql .= "order by start_stamp desc"; - $sql .= limit_offset($_SESSION['call_block']['recent_call_limit']['text']); - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $result = $database->select($sql, $parameters, 'all'); + if (is_array($sql_where_array) && sizeof($sql_where_array) != 0) { + $sql_where .= "and (".implode(' or ', $sql_where_array).") "; + } + unset($sql_where_array); + } } + //get recent calls + $sql = "select caller_id_name, caller_id_number, caller_destination, start_epoch, direction, hangup_cause, duration, billsec, xml_cdr_uuid "; + $sql .= "from v_xml_cdr where domain_uuid = :domain_uuid "; + $sql .= "and direction <> 'local' "; + $sql .= $sql_where; + $sql .= "order by start_stamp desc "; + $sql .= limit_offset($_SESSION['call_block']['recent_call_limit']['text']); + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $database = new database; + $result = $database->select($sql, $parameters); + unset($sql, $parameters); + echo " |
| \n"; + echo " \n"; + echo " | \n"; + echo "\n"; + echo " \n"; + echo " | \n"; + echo "
| \n"; echo " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".escape($label_application_name)." | \n"; + echo "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".escape($application_name_label)." | \n"; echo "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \n"; echo " \n"; @@ -337,32 +341,50 @@ echo " | \n"; } echo "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| \n"; - echo " \n"; - echo " \n"; - echo " \n"; + //application permission + if (!$view || ($view == 'assigned' && $checked) || ($view == 'unassigned' && !$checked)) { + echo " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " | \n"; + } + echo ""; + echo " ".escape($row['permission_name']); echo " | \n"; + if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { + echo "\n"; + echo " | \n"; + echo " \n"; + echo " | \n"; + } + echo ""; - echo " ".escape($row['permission_name']); - echo " | \n"; - if (permission_exists('group_permission_add') || permission_exists('group_permission_edit') || permission_exists('group_permission_delete')) { - echo "\n"; - echo " | \n"; - echo " \n"; - echo " | \n"; - } - echo "\n"; - //set the previous category + //set the previous application name $previous_application_name = $row['application_name']; $x++; + } unset($group_permissions); + + //hide application heading if no permissions displayed + if (is_array($displayed_permissions) && @sizeof($displayed_permissions) != 0) { + echo "\n"; + } + } echo "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||