Complete B1→B2 workflow - Add Clear button and selected campaign display
Added to B1→B2 Tab: 1. Clear Workflow Data Button - 🗑️ Clear button (same as other tabs) - Clears session data for fresh start - Shows when tab is active and has data 2. Selected Campaign Display - Shows selected campaign name and ID - Displays campaign type (Global Masters) - Shows asset ID for reference 3. Status Update Section - Yellow warning box - Update Status: B1 → B2 button - Instructions for workflow 4. Fixed update_status_to_b2 Action - Accepts campaign_id from POST (debug button) - OR from selected_campaign_b1 (selected campaign) - Works from both locations Now B1→B2 Tab Has: ✅ Load B1 campaigns ✅ Debug load all Global campaigns ✅ Clear workflow data button ✅ Campaign selection ✅ Selected campaign display ✅ Update status B1 → B2 ✅ Matches A1→A2 functionality Test: Refresh app and try selecting a B1 campaign! 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9a32d28389
commit
47e319ab3f
1 changed files with 39 additions and 5 deletions
|
|
@ -978,12 +978,14 @@ if ($_POST && $testRunner) {
|
|||
break;
|
||||
|
||||
case 'update_status_to_b2':
|
||||
if (isset($results['selected_campaign_b1'])) {
|
||||
$campaignId = $_POST['campaign_id'] ?? null;
|
||||
if (!$campaignId && isset($results['selected_campaign_b1'])) {
|
||||
$campaignId = $results['selected_campaign_b1']['asset_id'];
|
||||
}
|
||||
|
||||
if ($campaignId) {
|
||||
$statusManager = createStatusManager($testRunner);
|
||||
$statusResult = $statusManager->updateCampaignStatus(
|
||||
$results['selected_campaign_b1']['asset_id'],
|
||||
'B2'
|
||||
);
|
||||
$statusResult = $statusManager->updateCampaignStatus($campaignId, 'B2');
|
||||
|
||||
if ($statusResult['success']) {
|
||||
$results['status_update_b2'] = $statusResult;
|
||||
|
|
@ -3202,6 +3204,38 @@ $envInfo = $configV3->getEnvironmentInfo();
|
|||
<button type="submit" class="btn btn-secondary">🔍 Debug: Load ALL Global Campaigns</button>
|
||||
</form>
|
||||
|
||||
<?php if (!empty($results) && $currentTab === 'global-masters'): ?>
|
||||
<form method="POST" style="display: inline-block;">
|
||||
<input type="hidden" name="tab" value="global-masters">
|
||||
<input type="hidden" name="clear_results" value="1">
|
||||
<button type="submit" class="btn btn-secondary">🗑️ Clear Workflow Data</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($results['selected_campaign_b1'])): ?>
|
||||
<div class="alert alert-info" style="margin-top: 30px;">
|
||||
<strong>Selected Campaign:</strong>
|
||||
<?= htmlspecialchars($results['selected_campaign_b1']['campaign_name']) ?>
|
||||
(<?= htmlspecialchars($results['selected_campaign_b1']['campaign_id'] ?? 'N/A') ?>)
|
||||
<br>
|
||||
<small><strong>Asset ID:</strong> <code><?= htmlspecialchars($results['selected_campaign_b1']['asset_id']) ?></code></small>
|
||||
<br>
|
||||
<small><strong>Type:</strong> Global Masters</small>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 30px; padding: 20px; background: #fff3cd; border-radius: 8px;">
|
||||
<h4>⚠️ Update Status to B2</h4>
|
||||
<p style="margin: 10px 0;">
|
||||
Once all Global Master assets are downloaded and sent to Agency, update the campaign status to B2
|
||||
</p>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="tab" value="global-masters">
|
||||
<input type="hidden" name="action" value="update_status_to_b2">
|
||||
<button type="submit" class="btn btn-success">Update Status: B1 → B2</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($results['b1_campaigns']) && !empty($results['b1_campaigns'])): ?>
|
||||
<h3 style="margin-top: 30px;">Found <?= count($results['b1_campaigns']) ?> Global Campaigns (B1)</h3>
|
||||
<div class="campaign-grid">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue