summaryrefslogtreecommitdiff
path: root/edit_notes.php
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-24 15:35:09 +0100
committerlsces <lester@lsces.co.uk>2025-08-24 15:35:09 +0100
commitce4fa87baac56fe2478cfea56b539cba63887467 (patch)
tree6d5f6a74d4d80fcc11b12ce2fa86715e1bff9b88 /edit_notes.php
parent69b08377a8a2d3791b21d96720657d93beda2af0 (diff)
downloadcontact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.gz
contact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.bz2
contact-ce4fa87baac56fe2478cfea56b539cba63887467.zip
Just a crude merging of the PHP7 code base with the PHP8.4 version
Diffstat (limited to 'edit_notes.php')
-rwxr-xr-x[-rw-r--r--]edit_notes.php56
1 files changed, 28 insertions, 28 deletions
diff --git a/edit_notes.php b/edit_notes.php
index 42b92e3..72d0e15 100644..100755
--- a/edit_notes.php
+++ b/edit_notes.php
@@ -13,14 +13,14 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
-if( !empty( $gContent->mInfo ) ) {
+if (!empty( $gContent->mInfo )) {
$formInfo = $gContent->mInfo;
$formInfo['edit'] = !empty( $gContent->mInfo['data'] ) ? $gContent->mInfo['data'] : '';
}
@@ -32,33 +32,34 @@ require_once 'import/mimeDecode.php';
$file = '/srv/website/bitweaver/contact/data/Stockport';
echo 'Using file ' . $file . "<br>";
-$mbox = new Mail_Mbox($file);
+$mbox = new Mail_Mbox( $file );
$mbox->open();
-for ($n = 0; $n < $mbox->size(); $n++) {
- $message = $mbox->get($n);
+for ( $n = 0; $n < $mbox->size(); $n++ ) {
+ $message = $mbox->get( $n );
- preg_match('/Subject: (.*)$/m', $message, $matches);
- $subject = $matches[1];
- echo 'Mail #' . $n . ': ' . $subject . "<br>";
- $Decoder = new Mail_mimeDecode( $message );
- $params = array(
- 'include_bodies' => TRUE,
- 'decode_bodies' => TRUE,
- 'decode_headers' => TRUE
+ preg_match( '/Subject: (.*)$/m', $message, $matches );
+ $subject = $matches[1];
+ echo 'Mail #' . $n . ': ' . $subject . "<br>";
+ $Decoder = new Mail_mimeDecode( $message );
+ $params = array(
+ 'include_bodies' => true,
+ 'decode_bodies' => true,
+ 'decode_headers' => true,
);
- $Decoded = $Decoder->decode($params);
- if ( $Decoded->ctype_primary == "multipart" ) {
- vd($Decoded->parts[0]->ctype_primary);
- vd($Decoded->parts[0]->ctype_secondary);
- print($Decoded->parts[0]->body);
- } else {
- vd($Decoded->ctype_primary);
- vd($Decoded->ctype_secondary);
- print($Decoded->body);
+ $Decoded = $Decoder->decode( $params );
+ if ($Decoded->ctype_primary == "multipart") {
+ \Bitweaver\vd( $Decoded->parts[0]->ctype_primary );
+ \Bitweaver\vd( $Decoded->parts[0]->ctype_secondary );
+ print $Decoded->parts[0]->body;
}
- vd($Decoded->headers);
- print( $message );
+ else {
+ \Bitweaver\vd( $Decoded->ctype_primary );
+ \Bitweaver\vd( $Decoded->ctype_secondary );
+ print $Decoded->body;
+ }
+ \Bitweaver\vd( $Decoded->headers );
+ print $message;
}
$mbox->close();
@@ -69,11 +70,10 @@ if( empty( $formInfo ) ) {
}
$formInfo['contact_type_list'] = $gContent->getContactSourceList();
-$gBitSmarty->assignByRef( 'pageInfo', $formInfo );
+$gBitSmarty->assign( 'pageInfo', $formInfo );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'body').'TabSelect', 'tdefault' );
$gBitSmarty->assign('show_page_bar', 'y');
$gBitSystem->display( 'bitpackage:contact/edit.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
-?>