-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oops I forgot to commit for a week type commit.
- Loading branch information
Ian
committed
Oct 7, 2024
1 parent
63d6d9d
commit 39e04a0
Showing
21 changed files
with
887 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
require_once __DIR__."/vendor/autoload.php"; | ||
require_once "root.php"; | ||
require_once "resources/require.php"; | ||
require_once "resources/check_auth.php"; | ||
|
||
header("Content-Type: application/json"); | ||
|
||
foreach ($_SESSION['user']['extension'] as $ext) { | ||
if ($ext['extension_uuid'] == $_GET['extension_uuid']) { | ||
$extension = $ext; | ||
break; | ||
} | ||
} | ||
|
||
|
||
if (!$extension) { | ||
http_response_code(400); | ||
echo json_encode(array("error" => "invalid or unauthorized extension")); | ||
die(); | ||
} | ||
$database = new database; | ||
|
||
$sql = "DELETE from webtexting_message_templates WHERE domain_uuid = :domain_uuid AND email_template_uuid = :template_uuid;"; | ||
$parameters['domain_uuid'] = $domain_uuid; | ||
$parameters['template_uuid'] = $_GET['template_uuid']; | ||
$deleted = $database->select($sql, $parameters, 'all'); | ||
if($deleted){ | ||
message::add("template deleted."); | ||
} else { | ||
message::add("error deleting template.", 'negative'); | ||
} | ||
echo(json_encode($templates)); | ||
return json_encode($templates); | ||
// unset($parameters); | ||
// //do an edit template | ||
// //$domain_uuid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script lang="ts"> | ||
import {emitter} from '../../lib/global'; | ||
export default{ | ||
name:"ForwardingPlaceholder", | ||
props:{ | ||
selectedConvo: Boolean, | ||
}, | ||
data(){ | ||
return{ | ||
emailForwardFormInputs:{ | ||
phoneNumber:'', | ||
emailAddress:'' | ||
} | ||
} | ||
}, | ||
methods: { | ||
submitEmailForwardingRegisterRequest(){ | ||
event.preventDefault(); | ||
const params = { | ||
email_address: this.$data.emailForwardFormInputs.emailAddress.trim(), | ||
own_number: this.$data.emailForwardFormInputs.phoneNumber.trim() | ||
} | ||
emitter.emit("register-email-forwarding",params); | ||
} | ||
}, | ||
} | ||
</script> | ||
<template> | ||
<div id="NO_MESSAGES" > | ||
<p v-if="!selectedConvo" class="center"> Forward new text messages to your Email</p> | ||
<div class="template-form "> | ||
<div class="mt-form-row"> | ||
<div class="category-template-uuid">Your phone number</div> | ||
<div class="area-for-text"> <textarea v-model="emailForwardFormInputs.phoneNumber"></textarea></div> | ||
|
||
</div> | ||
<div class="mt-form-row"> | ||
<div class="category-desc">Email Address to forward messages to.</div> | ||
<div class="area-for-text"> <textarea v-model="emailForwardFormInputs.emailAddress"></textarea></div> | ||
|
||
</div> | ||
<button class="submit" @click="submitEmailForwardingRegisterRequest">Submit</button> | ||
</div> | ||
</div> | ||
</template> | ||
<style scoped> | ||
#NO_MESSAGES { | ||
grid-column-start: 2; | ||
grid-column-end: 2; | ||
display: grid; | ||
grid-template-columns: auto; | ||
grid-template-rows: auto; | ||
} | ||
.center{ | ||
grid-column-start: 1; | ||
grid-row-start: 1; | ||
align-self: center; | ||
justify-self: center; | ||
} | ||
@media screen and (width <=700px) { | ||
#NO_MESSAGES{ | ||
display:none; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
frontend/components/TemplatePreview/TemplatePreview.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<script lang='ts'> | ||
//lets add a delete button and an edit button | ||
import {emitter} from '../../lib/global'; | ||
export type TemplatePreviewInterface = { | ||
link:{ | ||
type:String, | ||
optional: true | ||
}, | ||
template_uuid:{ | ||
type: String, | ||
optional: true | ||
}, | ||
body:{ | ||
type: String | ||
}, | ||
category:{ | ||
type: String | ||
}, | ||
subcategory:{ | ||
type: String | ||
}, | ||
language:{ | ||
type: String | ||
}, | ||
subject:{ | ||
type: String, | ||
}, | ||
templateType:{ | ||
type: String | ||
}, | ||
enabled:{ | ||
type: String | ||
}, | ||
description: { | ||
type: String | ||
}, | ||
} | ||
export default { | ||
name:'TemplatePreview', | ||
props:{ | ||
link:{ | ||
type:String, | ||
optional: true | ||
}, | ||
template_uuid:{ | ||
type: String, | ||
optional: true | ||
}, | ||
body:{ | ||
type: String | ||
}, | ||
category:{ | ||
type: String | ||
}, | ||
subcategory:{ | ||
type: String | ||
}, | ||
language:{ | ||
type: String | ||
}, | ||
subject:{ | ||
type: String, | ||
}, | ||
templateType:{ | ||
type: String | ||
}, | ||
enabled:{ | ||
type: String | ||
}, | ||
description: { | ||
type: String | ||
}, | ||
}, | ||
methods:{ | ||
menuLinkClickHandler(){ | ||
console.log(this.description) | ||
emitter.emit("template-change",this.props) | ||
}, | ||
deleteTemplateRequest(){ | ||
emitter.emit("delete-template-request",{template_uuid: this.template_uuid}) | ||
} | ||
}, | ||
mounted(){ | ||
console.log(this.link); | ||
}, | ||
//mounted click event emitter | ||
} | ||
</script> | ||
<template> | ||
<tr> | ||
<th scope='col' >{{this.category }}</th> | ||
<th scope='col' > | ||
{{this.description }} | ||
</th> | ||
<th scope="col"> | ||
<router-link :to="this.link" class="template-preview-link" v-bind="this.props" @click="menuLinkClickHandler"> | ||
Edit Template | ||
</router-link> | ||
</th> | ||
<td scope="col" class="align-middle text-center" > | ||
<div class="btn-danger p-2 rounded align-middle text-center" @click="deleteTemplateRequest"> | ||
<span>Delete</span> | ||
</div> | ||
</td> | ||
</tr> | ||
|
||
</template> | ||
|
||
<style scoped> | ||
</style> |
Oops, something went wrong.