Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Installation.exe
Binary file not shown.
163 changes: 163 additions & 0 deletions Installation.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Donwnload Image

try{
New-Item -Path C:\ -Name Scripts -ItemType directory
New-Item -Path C:\Scripts\ -Name Telefonie -ItemType directory

$wc = New-Object System.Net.WebClient
$wc.DownloadFile("https://github.com/julianbruegger/3cx-Notes/blob/main/Telefon_Notizen.exe?raw=true", "C:\Scripts\Telefonie\Telefon_Notizen.exe")
New-Item -Path C:\Scripts\Telefonie\ -Name bin -ItemType directory
#Start-BitsTransfer -Source https://github.com/julianbruegger/3cx-Notes/blob/main/bin/3cx_notes.png?raw=true -Destination C:\Scripts\Telefonie\bin\3cx_notes.png
$wc.DownloadFile("https://github.com/julianbruegger/3cx-Notes/blob/main/bin/3cx_notes.png?raw=true", "C:\Scripts\Telefonie\bin\3cx_notes.png")
$wc.DownloadFile("https://github.com/julianbruegger/3cx-Notes/blob/main/bin/favicon.ico?raw=true", "C:\Scripts\Telefonie\bin\favicon.ico")

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

$form = New-Object System.Windows.Forms.Form
$form.Text = 'Einrichtung 3cx-Notes'
$form.Size = New-Object System.Drawing.Size(300,200)
$form.StartPosition = 'CenterScreen'

$okButton = New-Object System.Windows.Forms.Button
$okButton.Location = New-Object System.Drawing.Point(75,120)
$okButton.Size = New-Object System.Drawing.Size(75,23)
$okButton.Text = 'OK'
$okButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
$form.AcceptButton = $okButton
$form.Controls.Add($okButton)

$cancelButton = New-Object System.Windows.Forms.Button
$cancelButton.Location = New-Object System.Drawing.Point(150,120)
$cancelButton.Size = New-Object System.Drawing.Size(75,23)
$cancelButton.Text = 'Cancel'
$cancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$form.CancelButton = $cancelButton
$form.Controls.Add($cancelButton)

$label = New-Object System.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(10,20)
$label.Size = New-Object System.Drawing.Size(280,20)
$label.Text = 'Bitte gebe dein Vorname in das Feld ein:'
$form.Controls.Add($label)

$textBox = New-Object System.Windows.Forms.TextBox
$textBox.Location = New-Object System.Drawing.Point(10,40)
$textBox.Size = New-Object System.Drawing.Size(260,20)
$form.Controls.Add($textBox)

$form.Topmost = $true

$form.Add_Shown({$textBox.Select()})
$result = $form.ShowDialog()

if ($result -eq [System.Windows.Forms.DialogResult]::OK)
{
$Vorname = $textBox.Text
}
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

$form = New-Object System.Windows.Forms.Form
$form.Text = 'Einrichtung 3cx-Notes'
$form.Size = New-Object System.Drawing.Size(300,200)
$form.StartPosition = 'CenterScreen'

$okButton = New-Object System.Windows.Forms.Button
$okButton.Location = New-Object System.Drawing.Point(75,120)
$okButton.Size = New-Object System.Drawing.Size(75,23)
$okButton.Text = 'OK'
$okButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
$form.AcceptButton = $okButton
$form.Controls.Add($okButton)

$cancelButton = New-Object System.Windows.Forms.Button
$cancelButton.Location = New-Object System.Drawing.Point(150,120)
$cancelButton.Size = New-Object System.Drawing.Size(75,23)
$cancelButton.Text = 'Cancel'
$cancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$form.CancelButton = $cancelButton
$form.Controls.Add($cancelButton)

$label = New-Object System.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(10,20)
$label.Size = New-Object System.Drawing.Size(280,20)
$label.Text = 'Bitte gebe dein Nachname in das Feld ein:'
$form.Controls.Add($label)

$textBox = New-Object System.Windows.Forms.TextBox
$textBox.Location = New-Object System.Drawing.Point(10,40)
$textBox.Size = New-Object System.Drawing.Size(260,20)
$form.Controls.Add($textBox)

$form.Topmost = $true

$form.Add_Shown({$textBox.Select()})
$result = $form.ShowDialog()

if ($result -eq [System.Windows.Forms.DialogResult]::OK)
{
$Nachname = $textBox.Text
}

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

$form = New-Object System.Windows.Forms.Form
$form.Text = 'Einrichtung 3cx-Notes'
$form.Size = New-Object System.Drawing.Size(300,200)
$form.StartPosition = 'CenterScreen'

$okButton = New-Object System.Windows.Forms.Button
$okButton.Location = New-Object System.Drawing.Point(75,120)
$okButton.Size = New-Object System.Drawing.Size(75,23)
$okButton.Text = 'OK'
$okButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
$form.AcceptButton = $okButton
$form.Controls.Add($okButton)

$cancelButton = New-Object System.Windows.Forms.Button
$cancelButton.Location = New-Object System.Drawing.Point(150,120)
$cancelButton.Size = New-Object System.Drawing.Size(75,23)
$cancelButton.Text = 'Cancel'
$cancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel
$form.CancelButton = $cancelButton
$form.Controls.Add($cancelButton)

$label = New-Object System.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(10,20)
$label.Size = New-Object System.Drawing.Size(280,20)
$label.Text = 'Bitte gebe deine E-Mail addresse in das Feld ein:'
$form.Controls.Add($label)

$textBox = New-Object System.Windows.Forms.TextBox
$textBox.Location = New-Object System.Drawing.Point(10,40)
$textBox.Size = New-Object System.Drawing.Size(260,20)
$form.Controls.Add($textBox)

$form.Topmost = $true

$form.Add_Shown({$textBox.Select()})
$result = $form.ShowDialog()

if ($result -eq [System.Windows.Forms.DialogResult]::OK)
{
$Mail = $textBox.Text
$x = $Vorname + " " +$Nachname +" <" +$Mail +">"
}

$check = 1

New-Item -Path C:\Scripts\Telefonie\ -Name config.txt -ItemType file -Value $x
}

catch{

[System.Windows.Forms.MessageBox]::Show("Fehler $error","Error",0,16)

$check = 2
}

if ($check -eq 1){
[System.Windows.Forms.MessageBox]::Show("Installation erfolgreich","Erfolgreich",0,64)
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
![GitHub repo size](https://img.shields.io/github/repo-size/julianbruegger/3cx-Notes) ![Lines of code](https://img.shields.io/tokei/lines/github/julianbruegger/3cx-Notes) ![GitHub all releases](https://img.shields.io/github/downloads/julianbruegger/3cx-Notes/total) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/julianbruegger/3cx-Notes) [![GitHub stars](https://img.shields.io/github/stars/julianbruegger/3cx-Notes)](https://github.com/julianbruegger/3cx-Notes/stargazers)
# 3cx-Notes
Für die bei uns im Betrieb angewendete 3cx Telefonlösung habe ich eine Notizsoftware erstellt.

Diese ist einfach aufgebaut und ist kinderleicht zu bedienen. Basierend ist diese auf Powershell.
<img src="./bin/tool.png">

## Setup
## Installation
Um das Tool zu Installieren sollte einfach die akutellste `Installler.EXE` heruntergeladen werden.

[<img src="https://img.shields.io/badge/release-V2.0.0-brightgreen">](https://github.com/julianbruegger/3cx-Notes/releases/latest)



### Setup 3CX
<img src="./bin/3cx_main.png">
Im Hauptmenü werden die Einstellungen unten rechts geöffnet.
<img src="./bin/3cx_erweitert.png">
Expand Down
Binary file modified Telefon_Notizen.exe
Binary file not shown.
83 changes: 75 additions & 8 deletions Telefon_Notizen.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ TelefonnotizTool ICT-BZ

#>


param($number, $name, $else)

$rootpath = "C:\Scripts\Telefonie"



$name = $name+$else
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()

$Form = New-Object system.Windows.Forms.Form
$Form.ClientSize = New-Object System.Drawing.Point(400,400)
$Form.minimumSize = New-Object System.Drawing.Size(450,450)
$Form.maximumSize = New-Object System.Drawing.Size(450,450)
$Form.ClientSize = New-Object System.Drawing.Point(600,400)
$Form.minimumSize = New-Object System.Drawing.Size(650,450)
$Form.maximumSize = New-Object System.Drawing.Size(650,450)
$Form.text = "Telefon-Notiz Tool"
$Form.TopMost = $false
$FormImage = [system.drawing.image]::FromFile("C:\temp\Telefonie\bin\3cx_notes.png")
$FormImage = [system.drawing.image]::FromFile($rootpath+"\bin\3cx_notes.png")
$Form.BackgroundImage = $FormImage
$Form.BackgroundImageLayout = "Zoom"
$Form.icon = "C:\temp\Telefonie\bin\favicon.ico"
$Form.icon = $rootpath+"\bin\favicon.ico"


$numberbox = New-Object system.Windows.Forms.TextBox
Expand Down Expand Up @@ -147,7 +150,25 @@ $coppybutton.height = 30
$coppybutton.location = New-Object System.Drawing.Point(248,355)
$coppybutton.Font = New-Object System.Drawing.Font('Calibri',10)

$Form.controls.AddRange(@($numberbox,$Tel_Nr,$mailbox,$namebox,$TextBox1,$Label1,$Label2,$betrefflable,$infolable,$betreffbox,$moreinfobox,$company,$cancle,$coppybutton,$ComboBox1))

$ComboBox1 = New-Object system.Windows.Forms.ComboBox
$ComboBox1.text = "Empfänger"
$ComboBox1.width = 200
$ComboBox1.height = 20
@('david.tassi@ict-bz.ch','horst.lang@ict-bz.ch','julia.stadelmann@ict-bz.ch','urs.nussbaumer@ict-bz.ch','nino.antonucci@ict-bz.ch','roland.spengler@ict-bz.ch','kilian.buerli@ict-bz.ch','rainer.klatt@ict-bz.ch','julian.bruegger@ict-bz.ch','lucas.taham@ict-bz.ch','tamara.tita@ict-bz.ch') | Sort-Object | ForEach-Object {[void] $ComboBox1.Items.Add($_)}
$ComboBox1.location = New-Object System.Drawing.Point(410,118)
$ComboBox1.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)

$mailbtn = New-Object system.Windows.Forms.Button
$mailbtn.text = "Send Mail"
$mailbtn.width = 126
$mailbtn.height = 30
$mailbtn.location = New-Object System.Drawing.Point(414,355)
$mailbtn.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
$mailbtn.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#3be413")


$Form.controls.AddRange(@($numberbox,$Tel_Nr,$mailbox,$namebox,$TextBox1,$Label1,$Label2,$betrefflable,$infolable,$betreffbox,$moreinfobox,$company,$cancle,$coppybutton,$ComboBox1,$ComboBox1,$mailbtn))


$cancle.Add_Click({$form.Close()})
Expand All @@ -156,10 +177,56 @@ $coppybutton.Add_Click(
$text = "Telefon Nummer: "+$numberbox.Text +"`r`nE-Mail: "+$mailbox.Text+"`r`nName: "+$namebox.Text+"`r`nFirma: "+$TextBox1.Text+"`r`nBetreff: "+$betreffbox.Text+"`r`nWeitere Infos: "+$moreinfobox.Text

Set-Clipboard $text
#$form.Close()




$form.Close()

})



$mailbtn.Add_Click(

{
$Configpath = "C:\Scripts\Telefonie\config.txt"
$Mail = Get-Content $Configpath
$From = $Mail
$To = $ComboBox1.Text
$Date = Get-Date
$text = "Telefon Nummer: "+$numberbox.Text +"`r`nE-Mail: "+$mailbox.Text+"`r`nName: "+$namebox.Text+"`r`nFirma: "+$TextBox1.Text+"`r`nBetreff: "+$betreffbox.Text+"`r`nWeitere Infos: "+$moreinfobox.Text
Write-Host $text
$Subject = "Telefonnotiz - "+$env:UserName +" - " +$Date
$SMTPServer = "aspmx2.googlemail.com"

Write-Host $To

if($To -eq "Empfänger"){
[System.Windows.Forms.MessageBox]::Show("Keine Mail addresse","Error",0,16)
}
else{
try{
Send-MailMessage -From "$From" -to "$To" -Subject "$Subject" -Body "$text" -SmtpServer "$SMTPServer" -Encoding ([System.Text.Encoding]::UTF8) -DeliveryNotificationOption OnSuccess
Write-Host $Error
$check = 1
$form.Close()
}

catch{
[System.Windows.Forms.MessageBox]::Show("Mail konnte nicht versandt werden","Error",0,16)
$check = 2
}
if ($check -eq 1){
[System.Windows.Forms.MessageBox]::Show("Mail wurde an "+$To +" versendet.","Erfolgreich versendet",0,64)
$form.Close()
}

}

}
)

[void]$Form.ShowDialog()


Binary file removed bin/ICT-BZ_Logo_Druck_Elemente_CMYK.png
Binary file not shown.
Binary file modified bin/tool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.