Changeset 3667748
- Timestamp:
- 08/26/2026 08:03:13 PM (2 months ago)
- Location:
- lideracotiza/trunk
- Files:
-
- 2 added
- 11 edited
-
lideracotiza.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
src/Admin/AdminController.php (modified) (4 diffs)
-
src/Services/QuoteService.php (modified) (3 diffs)
-
src/Support/Text.php (added)
-
src/Team/TeamController.php (modified) (3 diffs)
-
src/Team/TeamService.php (modified) (3 diffs)
-
src/Workspace/WorkspaceController.php (modified) (3 diffs)
-
src/Workspace/WorkspaceModules.php (added)
-
templates/admin/clients.php (modified) (1 diff)
-
templates/workspace/clients.php (modified) (1 diff)
-
templates/workspace/shell.php (modified) (1 diff)
-
templates/workspace/team.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lideracotiza/trunk/lideracotiza.php
r3667667 r3667748 4 4 * Plugin URI: https://lideratecacademy.com/lideracotiza/ 5 5 * Description: Gestión simple y segura de clientes y cotizaciones para pequeñas empresas. 6 * Version: 0.6. 06 * Version: 0.6.1 7 7 * Requires at least: 6.6 8 8 * Requires PHP: 8.1 … … 21 21 } 22 22 23 define('LIDERACOTIZA_VERSION', '0.6. 0');23 define('LIDERACOTIZA_VERSION', '0.6.1'); 24 24 define('LIDERACOTIZA_FILE', __FILE__); 25 25 define('LIDERACOTIZA_DIR', plugin_dir_path(__FILE__)); -
lideracotiza/trunk/readme.txt
r3667667 r3667748 5 5 Tested up to: 7.0 6 6 Requires PHP: 8.1 7 Stable tag: 0.6. 07 Stable tag: 0.6.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 73 73 == Changelog == 74 74 75 = 0.6.1 = 76 * Removes the mandatory mbstring dependency from the workspace and Core input handling. 77 * Adds a safe text-length compatibility helper with a native PHP fallback. 78 * Keeps quotation detail pages available when a historical client record is missing. 79 * Preserves the existing workspace design, URLs, data model, permissions, and add-on module contract. 80 75 81 = 0.6.0 = 76 82 * Adds a capability-aware workspace module registry for commercial add-ons. -
lideracotiza/trunk/src/Admin/AdminController.php
r3660915 r3667748 68 68 $tax = isset($input['tax_rate']) && preg_match('/^\d{1,2}(?:\.\d{1,2})?$/', (string) $input['tax_rate']) ? (float) $input['tax_rate'] : 18.0; 69 69 $sanitized = [ 70 'company_name' => mb_substr(sanitize_text_field($input['company_name'] ?? ''), 0, 190),70 'company_name' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($input['company_name'] ?? ''), 0, 190), 71 71 'company_email' => sanitize_email($input['company_email'] ?? ''), 72 'company_phone' => mb_substr(sanitize_text_field($input['company_phone'] ?? ''), 0, 60),73 'company_document' => mb_substr(sanitize_text_field($input['company_document'] ?? ''), 0, 60),74 'company_address' => mb_substr(sanitize_textarea_field($input['company_address'] ?? ''), 0, 1000),72 'company_phone' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($input['company_phone'] ?? ''), 0, 60), 73 'company_document' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($input['company_document'] ?? ''), 0, 60), 74 'company_address' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_textarea_field($input['company_address'] ?? ''), 0, 1000), 75 75 'company_logo_id' => absint($input['company_logo_id'] ?? 0), 76 76 'company_logo_url' => '', 77 77 'currency' => preg_match('/^[A-Z]{3}$/', (string) ($input['currency'] ?? 'PEN')) ? (string) $input['currency'] : 'PEN', 78 'currency_symbol' => mb_substr(sanitize_text_field($input['currency_symbol'] ?? 'S/'), 0, 8),78 'currency_symbol' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($input['currency_symbol'] ?? 'S/'), 0, 8), 79 79 'tax_bps' => (int) round(min(max($tax, 0), 99.99) * 100), 80 'quote_prefix' => mb_substr(sanitize_text_field($input['quote_prefix'] ?? 'COT-'), 0, 20),80 'quote_prefix' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($input['quote_prefix'] ?? 'COT-'), 0, 20), 81 81 'default_valid_days' => min(max(absint($input['default_valid_days'] ?? 15), 1), 365), 82 82 ]; … … 137 137 } 138 138 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only search parameter. 139 $search = mb_substr(sanitize_text_field(wp_unslash($_GET['s'] ?? '')), 0, 120);139 $search = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_GET['s'] ?? '')), 0, 120); 140 140 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only filter parameter. 141 141 $status = sanitize_key(wp_unslash($_GET['status'] ?? '')); … … 158 158 $id = absint(wp_unslash($_POST['client_id'] ?? '0')); 159 159 try { 160 $name = mb_substr(sanitize_text_field(wp_unslash($_POST['name'] ?? '')), 0, 190);160 $name = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_POST['name'] ?? '')), 0, 190); 161 161 if ($name === '') { throw new \InvalidArgumentException(esc_html__('El nombre es obligatorio.', 'lideracotiza')); } 162 162 $data = [ 163 163 'name' => $name, 164 'company_name' => mb_substr(sanitize_text_field(wp_unslash($_POST['company_name'] ?? '')), 0, 190),165 'document_type' => mb_substr(sanitize_text_field(wp_unslash($_POST['document_type'] ?? '')), 0, 30),166 'document_number' => mb_substr(sanitize_text_field(wp_unslash($_POST['document_number'] ?? '')), 0, 60),164 'company_name' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_POST['company_name'] ?? '')), 0, 190), 165 'document_type' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_POST['document_type'] ?? '')), 0, 30), 166 'document_number' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_POST['document_number'] ?? '')), 0, 60), 167 167 'email' => sanitize_email(wp_unslash($_POST['email'] ?? '')), 168 'phone' => mb_substr(sanitize_text_field(wp_unslash($_POST['phone'] ?? '')), 0, 60),169 'address' => mb_substr(sanitize_textarea_field(wp_unslash($_POST['address'] ?? '')), 0, 1000),170 'notes' => mb_substr(sanitize_textarea_field(wp_unslash($_POST['notes'] ?? '')), 0, 3000),168 'phone' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_POST['phone'] ?? '')), 0, 60), 169 'address' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_textarea_field(wp_unslash($_POST['address'] ?? '')), 0, 1000), 170 'notes' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_textarea_field(wp_unslash($_POST['notes'] ?? '')), 0, 3000), 171 171 ]; 172 172 if ($id) { … … 277 277 } 278 278 if (! empty($args['lc_notice'])) { $workspaceArgs['lc_notice'] = sanitize_key((string) $args['lc_notice']); } 279 if (! empty($args['lc_error'])) { $workspaceArgs['lc_error'] = mb_substr(sanitize_text_field((string) $args['lc_error']), 0, 240); }279 if (! empty($args['lc_error'])) { $workspaceArgs['lc_error'] = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) $args['lc_error']), 0, 240); } 280 280 wp_safe_redirect(WorkspaceRouter::url($workspaceArgs)); 281 281 exit; -
lideracotiza/trunk/src/Services/QuoteService.php
r3660915 r3667748 129 129 } 130 130 $newStatus = $map[$action]; 131 $message = mb_substr(sanitize_textarea_field($message), 0, 1500);131 $message = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_textarea_field($message), 0, 1500); 132 132 $this->quotes->updateStatus($id, $newStatus); 133 133 $this->quotes->addEvent($id, $newStatus, 'public', 0, $message !== '' ? ['message' => $message] : []); … … 173 173 $items = []; 174 174 foreach ($descriptions as $i => $description) { 175 $description = mb_substr(sanitize_text_field(wp_unslash((string) $description)), 0, 500);175 $description = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash((string) $description)), 0, 500); 176 176 if ($description === '') { continue; } 177 177 $items[] = [ … … 194 194 'issue_date' => $issue, 195 195 'valid_until' => $valid, 196 'notes' => mb_substr(sanitize_textarea_field(wp_unslash((string) ($input['notes'] ?? ''))), 0, 5000),197 'terms' => mb_substr(sanitize_textarea_field(wp_unslash((string) ($input['terms'] ?? ''))), 0, 5000),196 'notes' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_textarea_field(wp_unslash((string) ($input['notes'] ?? ''))), 0, 5000), 197 'terms' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_textarea_field(wp_unslash((string) ($input['terms'] ?? ''))), 0, 5000), 198 198 ]; 199 199 } -
lideracotiza/trunk/src/Team/TeamController.php
r3660915 r3667748 37 37 $this->redirect(['lc_notice' => $sendInvitation ? 'team_invited' : 'team_created']); 38 38 } catch (\Throwable $e) { 39 $args = ['lc_error' => mb_substr(sanitize_text_field($e->getMessage()), 0, 240)];39 $args = ['lc_error' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($e->getMessage()), 0, 240)]; 40 40 if ($userId) { 41 41 $args['member_id'] = $userId; … … 55 55 $this->redirect(['lc_notice' => $active ? 'team_activated' : 'team_deactivated']); 56 56 } catch (\Throwable $e) { 57 $this->redirect(['lc_error' => mb_substr(sanitize_text_field($e->getMessage()), 0, 240)]);57 $this->redirect(['lc_error' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($e->getMessage()), 0, 240)]); 58 58 } 59 59 } … … 68 68 $this->redirect(['lc_notice' => 'team_invited']); 69 69 } catch (\Throwable $e) { 70 $this->redirect(['lc_error' => mb_substr(sanitize_text_field($e->getMessage()), 0, 240)]);70 $this->redirect(['lc_error' => \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field($e->getMessage()), 0, 240)]); 71 71 } 72 72 } -
lideracotiza/trunk/src/Team/TeamService.php
r3660915 r3667748 42 42 } 43 43 44 $firstName = mb_substr(sanitize_text_field((string) ($input['first_name'] ?? '')), 0, 80);45 $lastName = mb_substr(sanitize_text_field((string) ($input['last_name'] ?? '')), 0, 80);44 $firstName = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) ($input['first_name'] ?? '')), 0, 80); 45 $lastName = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) ($input['last_name'] ?? '')), 0, 80); 46 46 $displayName = trim($firstName . ' ' . $lastName); 47 47 if ($displayName === '') { 48 $displayName = mb_substr(sanitize_text_field((string) ($input['display_name'] ?? '')), 0, 120);48 $displayName = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) ($input['display_name'] ?? '')), 0, 120); 49 49 } 50 50 if ($displayName === '') { … … 91 91 } 92 92 93 $firstName = mb_substr(sanitize_text_field((string) ($input['first_name'] ?? '')), 0, 80);94 $lastName = mb_substr(sanitize_text_field((string) ($input['last_name'] ?? '')), 0, 80);93 $firstName = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) ($input['first_name'] ?? '')), 0, 80); 94 $lastName = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) ($input['last_name'] ?? '')), 0, 80); 95 95 $displayName = trim($firstName . ' ' . $lastName); 96 96 if ($displayName === '') { 97 $displayName = mb_substr(sanitize_text_field((string) ($input['display_name'] ?? $member->display_name)), 0, 120);97 $displayName = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field((string) ($input['display_name'] ?? $member->display_name)), 0, 120); 98 98 } 99 99 if ($displayName === '') { … … 178 178 $base = 'gestor'; 179 179 } 180 $base = mb_substr($base, 0, 48);180 $base = \LideraTec\LideraCotiza\Support\Text::limit($base, 0, 48); 181 181 $candidate = $base; 182 182 $suffix = 1; 183 183 while (username_exists($candidate)) { 184 $candidate = mb_substr($base, 0, 42) . '-' . $suffix;184 $candidate = \LideraTec\LideraCotiza\Support\Text::limit($base, 0, 42) . '-' . $suffix; 185 185 $suffix++; 186 186 if ($suffix > 9999) { -
lideracotiza/trunk/src/Workspace/WorkspaceController.php
r3667667 r3667748 90 90 } elseif ($view === 'quotes') { 91 91 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only search parameter. 92 $search = mb_substr(sanitize_text_field(wp_unslash($_GET['s'] ?? '')), 0, 120);92 $search = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_GET['s'] ?? '')), 0, 120); 93 93 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only filter parameter. 94 94 $status = sanitize_key(wp_unslash($_GET['status'] ?? '')); … … 113 113 } 114 114 $client = $this->clients->get((int) $quote['client_id']); 115 if (! is_array($client)) { 116 $client = array( 117 'name' => __('Cliente no disponible', 'lideracotiza'), 118 'company_name' => '', 119 ); 120 } 115 121 $events = $this->quotes->events($id); 116 122 $publicUrl = $this->service->publicUrl($quote); … … 122 128 $this->authorize(Capabilities::MANAGE_CLIENTS); 123 129 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only search parameter. 124 $search = mb_substr(sanitize_text_field(wp_unslash($_GET['s'] ?? '')), 0, 120);130 $search = \LideraTec\LideraCotiza\Support\Text::limit(sanitize_text_field(wp_unslash($_GET['s'] ?? '')), 0, 120); 125 131 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only client identifier used for navigation. 126 132 $id = absint(wp_unslash($_GET['client_id'] ?? '0')); -
lideracotiza/trunk/templates/admin/clients.php
r3660915 r3667748 2 2 <div class="wrap lc-wrap"><div class="lc-page-title"><div><span class="lc-kicker"><?php esc_html_e('Directorio comercial','lideracotiza'); ?></span><h1><?php esc_html_e('Clientes','lideracotiza'); ?></h1><p><?php esc_html_e('Mantén los datos necesarios para preparar y enviar propuestas.','lideracotiza'); ?></p></div></div><?php require LIDERACOTIZA_DIR.'templates/admin/partials/notices.php'; ?> 3 3 <div class="lc-layout"><section class="lc-panel"><div class="lc-panel-head"><div><span class="lc-kicker"><?php echo esc_html($editing?__('Edición','lideracotiza'):__('Nuevo registro','lideracotiza')); ?></span><h2><?php echo esc_html($editing?__('Editar cliente','lideracotiza'):__('Nuevo cliente','lideracotiza')); ?></h2></div></div><form class="lc-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post"><input type="hidden" name="action" value="lideracotiza_save_client"><input type="hidden" name="client_id" value="<?php echo esc_attr((string)($editing['id']??0)); ?>"><?php wp_nonce_field('lideracotiza_save_client'); ?><div class="lc-form-grid"><label><?php esc_html_e('Nombre *','lideracotiza'); ?><input required maxlength="190" name="name" value="<?php echo esc_attr($editing['name']??''); ?>"></label><label><?php esc_html_e('Empresa','lideracotiza'); ?><input maxlength="190" name="company_name" value="<?php echo esc_attr($editing['company_name']??''); ?>"></label><label><?php esc_html_e('Tipo documento','lideracotiza'); ?><input maxlength="30" name="document_type" value="<?php echo esc_attr($editing['document_type']??''); ?>" placeholder="RUC / DNI"></label><label><?php esc_html_e('N.º documento','lideracotiza'); ?><input maxlength="60" name="document_number" value="<?php echo esc_attr($editing['document_number']??''); ?>"></label><label><?php esc_html_e('Correo','lideracotiza'); ?><input type="email" maxlength="190" name="email" value="<?php echo esc_attr($editing['email']??''); ?>"></label><label><?php esc_html_e('Teléfono','lideracotiza'); ?><input maxlength="60" name="phone" value="<?php echo esc_attr($editing['phone']??''); ?>"></label><label class="lc-span-2"><?php esc_html_e('Dirección','lideracotiza'); ?><textarea name="address" rows="2"><?php echo esc_textarea($editing['address']??''); ?></textarea></label><label class="lc-span-2"><?php esc_html_e('Notas internas','lideracotiza'); ?><textarea name="notes" rows="3"><?php echo esc_textarea($editing['notes']??''); ?></textarea></label></div><div class="lc-actions"><button class="button button-primary" type="submit"><?php echo esc_html($editing?__('Guardar cambios','lideracotiza'):__('Guardar cliente','lideracotiza')); ?></button><?php if($editing): ?><a class="button" href="<?php echo esc_url(admin_url('admin.php?page=lideracotiza-clients')); ?>"><?php esc_html_e('Cancelar','lideracotiza'); ?></a><?php endif; ?></div></form></section> 4 <section class="lc-panel"><div class="lc-panel-head lc-panel-head-stack"><div><span class="lc-kicker"><?php esc_html_e('Listado','lideracotiza'); ?></span><h2><?php esc_html_e('Clientes registrados','lideracotiza'); ?></h2></div><form class="lc-filterbar" method="get"><input type="hidden" name="page" value="lideracotiza-clients"><input name="s" value="<?php echo esc_attr($search); ?>" placeholder="<?php esc_attr_e('Buscar cliente…','lideracotiza'); ?>"><button class="button"><?php esc_html_e('Buscar','lideracotiza'); ?></button></form></div><div class="lc-client-list"><?php if(!$clients): ?><div class="lc-empty"><?php esc_html_e('No hay clientes todavía.','lideracotiza'); ?></div><?php endif; ?><?php foreach($clients as $lideracotiza_client): ?><article class="lc-client-item"><div class="lc-client-avatar"><?php echo esc_html( mb_substr($lideracotiza_client['company_name']?:$lideracotiza_client['name'],0,1)); ?></div><div><strong><?php echo esc_html($lideracotiza_client['company_name']?:$lideracotiza_client['name']); ?></strong><?php if($lideracotiza_client['company_name']): ?><small><?php echo esc_html($lideracotiza_client['name']); ?></small><?php endif; ?><span><?php echo esc_html(trim($lideracotiza_client['email'].' · '.$lideracotiza_client['phone'],' ·')); ?></span></div><div><a href="<?php echo esc_url(admin_url('admin.php?page=lideracotiza-clients&client_id='.(int)$lideracotiza_client['id'])); ?>"><?php esc_html_e('Editar','lideracotiza'); ?></a><form class="lc-inline-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post"><input type="hidden" name="action" value="lideracotiza_delete_client"><input type="hidden" name="client_id" value="<?php echo esc_attr((string)$lideracotiza_client['id']); ?>"><?php wp_nonce_field('lideracotiza_delete_client_'.(int)$lideracotiza_client['id']); ?><button class="lc-text-button lc-danger" data-lc-confirm="<?php esc_attr_e('¿Eliminar este cliente?','lideracotiza'); ?>" type="submit"><?php esc_html_e('Eliminar','lideracotiza'); ?></button></form></div></article><?php endforeach; ?></div></section></div></div>4 <section class="lc-panel"><div class="lc-panel-head lc-panel-head-stack"><div><span class="lc-kicker"><?php esc_html_e('Listado','lideracotiza'); ?></span><h2><?php esc_html_e('Clientes registrados','lideracotiza'); ?></h2></div><form class="lc-filterbar" method="get"><input type="hidden" name="page" value="lideracotiza-clients"><input name="s" value="<?php echo esc_attr($search); ?>" placeholder="<?php esc_attr_e('Buscar cliente…','lideracotiza'); ?>"><button class="button"><?php esc_html_e('Buscar','lideracotiza'); ?></button></form></div><div class="lc-client-list"><?php if(!$clients): ?><div class="lc-empty"><?php esc_html_e('No hay clientes todavía.','lideracotiza'); ?></div><?php endif; ?><?php foreach($clients as $lideracotiza_client): ?><article class="lc-client-item"><div class="lc-client-avatar"><?php echo esc_html(\LideraTec\LideraCotiza\Support\Text::limit($lideracotiza_client['company_name']?:$lideracotiza_client['name'],0,1)); ?></div><div><strong><?php echo esc_html($lideracotiza_client['company_name']?:$lideracotiza_client['name']); ?></strong><?php if($lideracotiza_client['company_name']): ?><small><?php echo esc_html($lideracotiza_client['name']); ?></small><?php endif; ?><span><?php echo esc_html(trim($lideracotiza_client['email'].' · '.$lideracotiza_client['phone'],' ·')); ?></span></div><div><a href="<?php echo esc_url(admin_url('admin.php?page=lideracotiza-clients&client_id='.(int)$lideracotiza_client['id'])); ?>"><?php esc_html_e('Editar','lideracotiza'); ?></a><form class="lc-inline-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post"><input type="hidden" name="action" value="lideracotiza_delete_client"><input type="hidden" name="client_id" value="<?php echo esc_attr((string)$lideracotiza_client['id']); ?>"><?php wp_nonce_field('lideracotiza_delete_client_'.(int)$lideracotiza_client['id']); ?><button class="lc-text-button lc-danger" data-lc-confirm="<?php esc_attr_e('¿Eliminar este cliente?','lideracotiza'); ?>" type="submit"><?php esc_html_e('Eliminar','lideracotiza'); ?></button></form></div></article><?php endforeach; ?></div></section></div></div> -
lideracotiza/trunk/templates/workspace/clients.php
r3660915 r3667748 14 14 <section class="lcw-panel"> 15 15 <div class="lcw-panel-head lcw-panel-head-stack"><div><span class="lcw-eyebrow"><?php esc_html_e('Directorio', 'lideracotiza'); ?></span><h2><?php esc_html_e('Clientes', 'lideracotiza'); ?></h2></div><form class="lcw-search" method="get" action="<?php echo esc_url(WorkspaceRouter::url()); ?>"><input type="hidden" name="view" value="clients"><input name="s" value="<?php echo esc_attr($search); ?>" placeholder="<?php esc_attr_e('Buscar cliente…', 'lideracotiza'); ?>"><button class="lcw-button lcw-button-secondary" type="submit"><?php esc_html_e('Buscar', 'lideracotiza'); ?></button></form></div> 16 <?php if (! $clients): ?><div class="lcw-empty"><strong><?php esc_html_e('No hay clientes todavía', 'lideracotiza'); ?></strong></div><?php else: ?><div class="lcw-client-list"><?php foreach ($clients as $lideracotiza_row): ?><article class="lcw-client-card"><div class="lcw-avatar"><?php echo esc_html( mb_substr($lideracotiza_row['company_name'] ?: $lideracotiza_row['name'],0,1)); ?></div><div class="lcw-client-info"><strong><?php echo esc_html($lideracotiza_row['company_name'] ?: $lideracotiza_row['name']); ?></strong><?php if($lideracotiza_row['company_name']): ?><small><?php echo esc_html($lideracotiza_row['name']); ?></small><?php endif; ?><span><?php echo esc_html(trim($lideracotiza_row['email'].' · '.$lideracotiza_row['phone'],' ·')); ?></span></div><div class="lcw-client-actions"><a href="<?php echo esc_url(WorkspaceRouter::url(['view'=>'clients','client_id'=>(int)$lideracotiza_row['id']])); ?>"><?php esc_html_e('Editar', 'lideracotiza'); ?></a><form class="lcw-inline-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post"><input type="hidden" name="action" value="lideracotiza_delete_client"><input type="hidden" name="lc_context" value="workspace"><input type="hidden" name="client_id" value="<?php echo esc_attr((string)$lideracotiza_row['id']); ?>"><?php wp_nonce_field('lideracotiza_delete_client_'.(int)$lideracotiza_row['id']); ?><button class="lcw-text-button lcw-danger" data-lc-confirm="<?php esc_attr_e('¿Eliminar este cliente?', 'lideracotiza'); ?>" type="submit"><?php esc_html_e('Eliminar', 'lideracotiza'); ?></button></form></div></article><?php endforeach; ?></div><?php endif; ?>16 <?php if (! $clients): ?><div class="lcw-empty"><strong><?php esc_html_e('No hay clientes todavía', 'lideracotiza'); ?></strong></div><?php else: ?><div class="lcw-client-list"><?php foreach ($clients as $lideracotiza_row): ?><article class="lcw-client-card"><div class="lcw-avatar"><?php echo esc_html(\LideraTec\LideraCotiza\Support\Text::limit($lideracotiza_row['company_name'] ?: $lideracotiza_row['name'],0,1)); ?></div><div class="lcw-client-info"><strong><?php echo esc_html($lideracotiza_row['company_name'] ?: $lideracotiza_row['name']); ?></strong><?php if($lideracotiza_row['company_name']): ?><small><?php echo esc_html($lideracotiza_row['name']); ?></small><?php endif; ?><span><?php echo esc_html(trim($lideracotiza_row['email'].' · '.$lideracotiza_row['phone'],' ·')); ?></span></div><div class="lcw-client-actions"><a href="<?php echo esc_url(WorkspaceRouter::url(['view'=>'clients','client_id'=>(int)$lideracotiza_row['id']])); ?>"><?php esc_html_e('Editar', 'lideracotiza'); ?></a><form class="lcw-inline-form" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post"><input type="hidden" name="action" value="lideracotiza_delete_client"><input type="hidden" name="lc_context" value="workspace"><input type="hidden" name="client_id" value="<?php echo esc_attr((string)$lideracotiza_row['id']); ?>"><?php wp_nonce_field('lideracotiza_delete_client_'.(int)$lideracotiza_row['id']); ?><button class="lcw-text-button lcw-danger" data-lc-confirm="<?php esc_attr_e('¿Eliminar este cliente?', 'lideracotiza'); ?>" type="submit"><?php esc_html_e('Eliminar', 'lideracotiza'); ?></button></form></div></article><?php endforeach; ?></div><?php endif; ?> 17 17 </section> 18 18 </div> -
lideracotiza/trunk/templates/workspace/shell.php
r3667667 r3667748 67 67 <a class="lcw-button lcw-button-primary" href="<?php echo esc_url(WorkspaceRouter::url(['view'=>'quote','action'=>'new'])); ?>">+ <?php esc_html_e('Nueva cotización', 'lideracotiza'); ?></a> 68 68 <?php endif; ?> 69 <div class="lcw-user"><span><?php echo esc_html( mb_substr($currentUser->display_name ?: $currentUser->user_login, 0, 1)); ?></span><div><strong><?php echo esc_html($currentUser->display_name ?: $currentUser->user_login); ?></strong><small><?php echo esc_html(current_user_can(\LideraTec\LideraCotiza\Security\Capabilities::MANAGE_TEAM) ? __('Administración', 'lideracotiza') : __('Gestión comercial', 'lideracotiza')); ?></small></div></div>69 <div class="lcw-user"><span><?php echo esc_html(\LideraTec\LideraCotiza\Support\Text::limit($currentUser->display_name ?: $currentUser->user_login, 0, 1)); ?></span><div><strong><?php echo esc_html($currentUser->display_name ?: $currentUser->user_login); ?></strong><small><?php echo esc_html(current_user_can(\LideraTec\LideraCotiza\Security\Capabilities::MANAGE_TEAM) ? __('Administración', 'lideracotiza') : __('Gestión comercial', 'lideracotiza')); ?></small></div></div> 70 70 </div> 71 71 </header> -
lideracotiza/trunk/templates/workspace/team.php
r3660915 r3667748 58 58 <div class="lcw-team-list"> 59 59 <?php foreach ($members as $lideracotiza_member): 60 $lideracotiza_initial = mb_substr((string) ($lideracotiza_member['display_name'] ?: $lideracotiza_member['email']), 0, 1);60 $lideracotiza_initial = \LideraTec\LideraCotiza\Support\Text::limit((string) ($lideracotiza_member['display_name'] ?: $lideracotiza_member['email']), 0, 1); 61 61 $lideracotiza_active = ! empty($lideracotiza_member['active']); 62 62 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)