|
|
|
|
@ -13,8 +13,11 @@
|
|
|
|
|
# GUÍA DE INSTALACIÓN (también en custom.css al inicio):
|
|
|
|
|
# 1. Import en vicidial_stylesheet.php (al inicio del CSS) para la mayoría de pantallas.
|
|
|
|
|
# 2. Link en admin_header.php (antes de </head>) para pantallas que usan admin_header.
|
|
|
|
|
# 3. Welcome y agent login usan el logo en vicidial/images y agc/images respectivamente.
|
|
|
|
|
# 4. La página de agente usa el logo en agc/images (mismo archivo que login por defecto).
|
|
|
|
|
# 3. Link en VERM/VERM_admin.php (tras VERM_stylesheet.php) para la interfaz VERM admin.
|
|
|
|
|
# 4. Link en VERM/VERM_wallboards.php (tras VERM_wallboard_stylesheet.php) para el wallboard.
|
|
|
|
|
# 5. Link en VERM/VERM_custom_report.php (tras VERM_stylesheet.php) para el formulario de custom report.
|
|
|
|
|
# 6. Welcome y agent login usan el logo en vicidial/images y agc/images respectivamente.
|
|
|
|
|
# 7. La página de agente usa el logo en agc/images (mismo archivo que login por defecto).
|
|
|
|
|
#
|
|
|
|
|
# LOGOS:
|
|
|
|
|
# - LogoHome.png → Solo Welcome y Admin (vicidial/images + .gif en raíz vicidial).
|
|
|
|
|
@ -42,6 +45,10 @@ CUSTOM_CSS_DEST="${AGC_DIR}/css/custom.css"
|
|
|
|
|
IMAGES_AGC="${AGC_DIR}/images"
|
|
|
|
|
VICIDIAL_STYLESHEET="${VICIDIAL_DIR}/vicidial_stylesheet.php"
|
|
|
|
|
ADMIN_HEADER="${VICIDIAL_DIR}/admin_header.php"
|
|
|
|
|
VERM_DIR="${HTDOCS}/VERM"
|
|
|
|
|
VERM_ADMIN_PHP="${VERM_DIR}/VERM_admin.php"
|
|
|
|
|
VERM_WALLBOARDS_PHP="${VERM_DIR}/VERM_wallboards.php"
|
|
|
|
|
VERM_CUSTOM_REPORT_PHP="${VERM_DIR}/VERM_custom_report.php"
|
|
|
|
|
VICIDIAL_PHP="${AGC_DIR}/vicidial.php"
|
|
|
|
|
TIMECLOCK_PHP="${AGC_DIR}/timeclock.php"
|
|
|
|
|
|
|
|
|
|
@ -128,6 +135,18 @@ installed_admin_header() {
|
|
|
|
|
[[ -f "$ADMIN_HEADER" ]] && grep -q "agc/css/custom.css" "$ADMIN_HEADER"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
installed_verm_ref() {
|
|
|
|
|
[[ -f "$VERM_ADMIN_PHP" ]] && grep -q "agc/css/custom.css" "$VERM_ADMIN_PHP"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
installed_verm_wallboard_ref() {
|
|
|
|
|
[[ -f "$VERM_WALLBOARDS_PHP" ]] && grep -q "agc/css/custom.css" "$VERM_WALLBOARDS_PHP"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
installed_verm_custom_report_ref() {
|
|
|
|
|
[[ -f "$VERM_CUSTOM_REPORT_PHP" ]] && grep -q "agc/css/custom.css" "$VERM_CUSTOM_REPORT_PHP"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# --- Copiar custom.css: hacer backup del destino si existe, luego copiar desde installer ---
|
|
|
|
|
copy_custom_css() {
|
|
|
|
|
if [[ ! -f "$CUSTOM_CSS_SOURCE" ]]; then
|
|
|
|
|
@ -187,6 +206,69 @@ install_admin_header_ref() {
|
|
|
|
|
info "Añadido <link> en admin_header.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install_verm_ref() {
|
|
|
|
|
if installed_verm_ref; then
|
|
|
|
|
info "VERM_admin.php: custom.css ya referenciado."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f "$VERM_ADMIN_PHP" ]]; then
|
|
|
|
|
warn "No existe: $VERM_ADMIN_PHP (se omite VERM)."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
save_pre_agc_backup "$VERM_ADMIN_PHP"
|
|
|
|
|
local line_num
|
|
|
|
|
line_num=$(grep -n 'href="VERM_stylesheet.php"' "$VERM_ADMIN_PHP" | head -1 | cut -d: -f1)
|
|
|
|
|
[[ -n "$line_num" ]] || { warn "No se encontró VERM_stylesheet.php en VERM_admin.php"; return 1; }
|
|
|
|
|
local insert_line='<link rel="stylesheet" type="text/css" href="../agc/css/custom.css">'
|
|
|
|
|
head -n "$line_num" "$VERM_ADMIN_PHP" > "${VERM_ADMIN_PHP}.tmp"
|
|
|
|
|
echo "$insert_line" >> "${VERM_ADMIN_PHP}.tmp"
|
|
|
|
|
tail -n +$((line_num + 1)) "$VERM_ADMIN_PHP" >> "${VERM_ADMIN_PHP}.tmp"
|
|
|
|
|
mv "${VERM_ADMIN_PHP}.tmp" "$VERM_ADMIN_PHP"
|
|
|
|
|
info "Añadido <link> custom.css en VERM_admin.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install_verm_wallboard_ref() {
|
|
|
|
|
if installed_verm_wallboard_ref; then
|
|
|
|
|
info "VERM_wallboards.php: custom.css ya referenciado."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f "$VERM_WALLBOARDS_PHP" ]]; then
|
|
|
|
|
warn "No existe: $VERM_WALLBOARDS_PHP (se omite wallboard)."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
save_pre_agc_backup "$VERM_WALLBOARDS_PHP"
|
|
|
|
|
local line_num
|
|
|
|
|
line_num=$(grep -n 'href="VERM_wallboard_stylesheet.php"' "$VERM_WALLBOARDS_PHP" | head -1 | cut -d: -f1)
|
|
|
|
|
[[ -n "$line_num" ]] || { warn "No se encontró VERM_wallboard_stylesheet.php en VERM_wallboards.php"; return 1; }
|
|
|
|
|
local insert_line='<link rel="stylesheet" type="text/css" href="../agc/css/custom.css">'
|
|
|
|
|
head -n "$line_num" "$VERM_WALLBOARDS_PHP" > "${VERM_WALLBOARDS_PHP}.tmp"
|
|
|
|
|
echo "$insert_line" >> "${VERM_WALLBOARDS_PHP}.tmp"
|
|
|
|
|
tail -n +$((line_num + 1)) "$VERM_WALLBOARDS_PHP" >> "${VERM_WALLBOARDS_PHP}.tmp"
|
|
|
|
|
mv "${VERM_WALLBOARDS_PHP}.tmp" "$VERM_WALLBOARDS_PHP"
|
|
|
|
|
info "Añadido <link> custom.css en VERM_wallboards.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install_verm_custom_report_ref() {
|
|
|
|
|
if installed_verm_custom_report_ref; then
|
|
|
|
|
info "VERM_custom_report.php: custom.css ya referenciado."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f "$VERM_CUSTOM_REPORT_PHP" ]]; then
|
|
|
|
|
warn "No existe: $VERM_CUSTOM_REPORT_PHP (se omite custom report)."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
save_pre_agc_backup "$VERM_CUSTOM_REPORT_PHP"
|
|
|
|
|
local line_num
|
|
|
|
|
line_num=$(grep -n 'href="VERM_stylesheet.php"' "$VERM_CUSTOM_REPORT_PHP" | head -1 | cut -d: -f1)
|
|
|
|
|
[[ -n "$line_num" ]] || { warn "No se encontró VERM_stylesheet.php en VERM_custom_report.php"; return 1; }
|
|
|
|
|
local insert_line='<link rel="stylesheet" type="text/css" href="../agc/css/custom.css">'
|
|
|
|
|
head -n "$line_num" "$VERM_CUSTOM_REPORT_PHP" > "${VERM_CUSTOM_REPORT_PHP}.tmp"
|
|
|
|
|
echo "$insert_line" >> "${VERM_CUSTOM_REPORT_PHP}.tmp"
|
|
|
|
|
tail -n +$((line_num + 1)) "$VERM_CUSTOM_REPORT_PHP" >> "${VERM_CUSTOM_REPORT_PHP}.tmp"
|
|
|
|
|
mv "${VERM_CUSTOM_REPORT_PHP}.tmp" "$VERM_CUSTOM_REPORT_PHP"
|
|
|
|
|
info "Añadido <link> custom.css en VERM_custom_report.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# --- Logo .gif en raíz vicidial (admin usa este cuando SSweb_logo=default_old) ---
|
|
|
|
|
install_logo_gif_vicidial_root() {
|
|
|
|
|
local logo_home="${INSTALADOR_DIR}/LogoHome.png"
|
|
|
|
|
@ -257,6 +339,54 @@ uninstall_admin_header_ref() {
|
|
|
|
|
info "Referencia eliminada en admin_header.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uninstall_verm_ref() {
|
|
|
|
|
if ! installed_verm_ref; then
|
|
|
|
|
info "VERM_admin.php: no había referencia a custom.css."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f "$VERM_ADMIN_PHP" ]]; then
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if restore_from_pre_agc_backup "$VERM_ADMIN_PHP"; then
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
warn "No hay backup .bak.pre_agc; quitando referencia con sed."
|
|
|
|
|
sed -i '/agc\/css\/custom\.css/d' "$VERM_ADMIN_PHP"
|
|
|
|
|
info "Referencia eliminada en VERM_admin.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uninstall_verm_wallboard_ref() {
|
|
|
|
|
if ! installed_verm_wallboard_ref; then
|
|
|
|
|
info "VERM_wallboards.php: no había referencia a custom.css."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f "$VERM_WALLBOARDS_PHP" ]]; then
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if restore_from_pre_agc_backup "$VERM_WALLBOARDS_PHP"; then
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
warn "No hay backup .bak.pre_agc; quitando referencia con sed."
|
|
|
|
|
sed -i '/agc\/css\/custom\.css/d' "$VERM_WALLBOARDS_PHP"
|
|
|
|
|
info "Referencia eliminada en VERM_wallboards.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uninstall_verm_custom_report_ref() {
|
|
|
|
|
if ! installed_verm_custom_report_ref; then
|
|
|
|
|
info "VERM_custom_report.php: no había referencia a custom.css."
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f "$VERM_CUSTOM_REPORT_PHP" ]]; then
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
if restore_from_pre_agc_backup "$VERM_CUSTOM_REPORT_PHP"; then
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
warn "No hay backup .bak.pre_agc; quitando referencia con sed."
|
|
|
|
|
sed -i '/agc\/css\/custom\.css/d' "$VERM_CUSTOM_REPORT_PHP"
|
|
|
|
|
info "Referencia eliminada en VERM_custom_report.php"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
restore_logos() {
|
|
|
|
|
restore_logo_file "$VICIDIAL_IMAGES" "$LOGO_WELCOME_NAME" || true
|
|
|
|
|
restore_logo_gif_vicidial_root || true
|
|
|
|
|
@ -381,6 +511,9 @@ do_install() {
|
|
|
|
|
install_logos
|
|
|
|
|
install_stylesheet_ref
|
|
|
|
|
install_admin_header_ref
|
|
|
|
|
install_verm_ref
|
|
|
|
|
install_verm_wallboard_ref
|
|
|
|
|
install_verm_custom_report_ref
|
|
|
|
|
install_placeholders
|
|
|
|
|
install_relogin_placeholders
|
|
|
|
|
install_campaign_placeholders
|
|
|
|
|
@ -394,6 +527,9 @@ do_uninstall() {
|
|
|
|
|
info "Raíz: $HTDOCS"
|
|
|
|
|
uninstall_stylesheet_ref
|
|
|
|
|
uninstall_admin_header_ref
|
|
|
|
|
uninstall_verm_ref
|
|
|
|
|
uninstall_verm_wallboard_ref
|
|
|
|
|
uninstall_verm_custom_report_ref
|
|
|
|
|
uninstall_placeholders
|
|
|
|
|
uninstall_timeclock_placeholders
|
|
|
|
|
restore_logos
|
|
|
|
|
@ -417,6 +553,15 @@ do_status() {
|
|
|
|
|
if [[ -f "$ADMIN_HEADER" ]]; then
|
|
|
|
|
installed_admin_header && info "admin_header.php: referenciado" || warn "admin_header.php: no referenciado"
|
|
|
|
|
fi
|
|
|
|
|
if [[ -f "$VERM_ADMIN_PHP" ]]; then
|
|
|
|
|
installed_verm_ref && info "VERM_admin.php: referenciado" || warn "VERM_admin.php: no referenciado"
|
|
|
|
|
fi
|
|
|
|
|
if [[ -f "$VERM_WALLBOARDS_PHP" ]]; then
|
|
|
|
|
installed_verm_wallboard_ref && info "VERM_wallboards.php: referenciado" || warn "VERM_wallboards.php: no referenciado"
|
|
|
|
|
fi
|
|
|
|
|
if [[ -f "$VERM_CUSTOM_REPORT_PHP" ]]; then
|
|
|
|
|
installed_verm_custom_report_ref && info "VERM_custom_report.php: referenciado" || warn "VERM_custom_report.php: no referenciado"
|
|
|
|
|
fi
|
|
|
|
|
if [[ -f "$VICIDIAL_PHP" ]]; then
|
|
|
|
|
has_placeholders && info "vicidial.php: placeholders Phone (size=10) presentes" || warn "vicidial.php: placeholders Phone no presentes"
|
|
|
|
|
has_relogin_placeholders && info "vicidial.php: placeholders Re-Login presentes" || warn "vicidial.php: placeholders Re-Login no presentes"
|
|
|
|
|
|