190 lines
8.6 KiB
XML
190 lines
8.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
<xsl:output method="html" encoding="utf-8" indent="yes"/>
|
|
|
|
<xsl:param name="VERSION">1.0</xsl:param>
|
|
<xsl:param name="PAGE-TITLE">Copy User Subscriptions</xsl:param>
|
|
<xsl:param name="PAGE-NAME">copyUser</xsl:param>
|
|
|
|
<xsl:template match="/">
|
|
|
|
<script src="js/{$PAGE-NAME}.js?version={$VERSION}"/>
|
|
|
|
<div class="{$PAGE-NAME}">
|
|
|
|
<div class="card shadow-sm">
|
|
|
|
<!-- Header -->
|
|
<div class="card-header bg-primary text-white p-1 ps-3">
|
|
<i class="bi bi-person-check me-2"/>
|
|
<xsl:copy-of select="$PAGE-TITLE"/>
|
|
|
|
|
<xsl:value-of select="//users/record/user_name"/>
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<form action="" name="{$PAGE-NAME}" method="post" id="{$PAGE-NAME}">
|
|
|
|
<input type="hidden" name="action" value="Users.copyUser"/>
|
|
<input type="hidden" name="step" value="copy"/>
|
|
|
|
<!-- Hidden source user -->
|
|
<input type="hidden" name="source_user_serial" value="{//users/record/user_serial}"/>
|
|
|
|
<div class="alert alert-info py-2 small">
|
|
<i class="bi bi-info-circle me-2"/>
|
|
The subscriptions listed below will be copied to the selected receiving user.
|
|
</div>
|
|
|
|
<div class="row g-4">
|
|
|
|
<!-- Left Side: Subscriptions Being Copied -->
|
|
<div class="col-lg-8">
|
|
|
|
<div class="card h-100 border-primary">
|
|
|
|
<div class="card-header bg-light fw-bold">
|
|
<i class="bi bi-shield-lock me-2"/>
|
|
Subscriptions to Copy
|
|
</div>
|
|
|
|
<div class="card-body p-0">
|
|
|
|
<div class="">
|
|
<table class="table table-sm table-striped table-hover mb-0 align-middle subscriptions_error">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th style="width: 40px;">
|
|
<input type="checkbox" class="form-check-input" id="selectAllSubscriptions"/>
|
|
</th>
|
|
<th>Subscription</th>
|
|
<th>Start Date</th>
|
|
<th>End Date</th>
|
|
</tr>
|
|
</thead>
|
|
<!-- Left side table -->
|
|
<tbody>
|
|
<xsl:apply-templates select="//usersubscriptions/record"/>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div id="subscriptions_errors" class="d-none px-3 pt-3">
|
|
<div class="alert alert-danger py-2 small">
|
|
<i class="bi bi-info-circle me-2"/>
|
|
Select at least one subscription to copy.
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Right Side: Receiving User -->
|
|
<div class="col-lg-4">
|
|
|
|
<div class="card h-100 border-secondary">
|
|
|
|
<div class="card-header bg-light fw-bold">
|
|
<i class="bi bi-person-plus me-2"/>
|
|
Receiving User
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label fw-bold" for="receiving_user_serial">
|
|
Copy Subscriptions To
|
|
</label>
|
|
|
|
<!-- Receiving user dropdown -->
|
|
<select class="form-control form-control-sm search-dropdown" name="receiving_user_serial" id="receiving_user_serial" size="1" required="required">
|
|
<option value="">Choose...</option>
|
|
<xsl:apply-templates select="//allusers/record"/>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="text-muted small">
|
|
Select the user who should receive the copied Subscriptions.
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div class="buttons mt-3 mb-1">
|
|
<button type="button" class="btn btn-sm btn-primary me-2 btnCancel">
|
|
<i class="bi bi-box-arrow-left me-2"/>Cancel
|
|
</button>
|
|
|
|
<button type="button" class="btn btn-sm btn-primary me-2 btnSave">
|
|
<i class="bi bi-copy me-2"/>Copy Subscriptions
|
|
</button>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</xsl:template>
|
|
|
|
<!-- Subscriptions Rows -->
|
|
<xsl:template match="usersubscriptions/record">
|
|
<tr>
|
|
<td>
|
|
<input type="checkbox" class="form-check-input subscription-checkbox" name="subscriptions[]" value="{usersubscription_subscription}"/>
|
|
</td>
|
|
<td class="fw-semibold">
|
|
<xsl:value-of select="subscription_full_title"/>
|
|
</td>
|
|
<td>
|
|
<!--<xsl:value-of select="usersubscription_start_date_verbose"/>-->
|
|
<div class="input-group input-group-sm subscription_start_date">
|
|
<input type="text" class="form-control form-control-sm date-mask subscription-start-date" name="subscription_start_date[]"/>
|
|
<button class="btn btn-sm btn-outline-primary btnSubscriptionStartDateCalendar" type="button" data-bs-toggle="tooltip" data-bs-title="Calendar" data-bs-custom-class="custom-tooltip" tabindex="-1">
|
|
<i class="bi bi-calendar3"/>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<!--<xsl:value-of select="usersubscription_end_date_verbose"/>-->
|
|
<div class="input-group input-group-sm subscription_end_date">
|
|
<input type="text" class="form-control form-control-sm date-mask subscription-end-date" name="subscription_end_date[]"/>
|
|
<button class="btn btn-sm btn-outline-primary btnSubscriptionEndDateCalendar" type="button" data-bs-toggle="tooltip" data-bs-title="Calendar" data-bs-custom-class="custom-tooltip" tabindex="-1">
|
|
<i class="bi bi-calendar3"/>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</xsl:template>
|
|
|
|
<!-- All Users Dropdown -->
|
|
<xsl:template match="allusers/record">
|
|
|
|
<!-- prevent copying to the same user -->
|
|
<xsl:if test="user_serial != //users/record/user_serial">
|
|
<option value="{user_serial}" data-tokens="{user_name} {user_email} {user_id}">
|
|
<xsl:value-of select="user_name"/>
|
|
<xsl:text> - </xsl:text>
|
|
<xsl:value-of select="user_email"/>
|
|
</option>
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet> |