Refactor profile-edit, candidate-profile, proposed-candidates, and registration forms

- Added a new div container in profile-edit.php for better layout structure.
- Removed the back button from candidate-profile.php to streamline navigation.
- Updated proposed-candidates.php to open candidate links in a new tab for improved user experience.
- Modified registration forms to make the profile visibility checkbox optional, enhancing user flexibility.
This commit is contained in:
2025-06-12 00:35:15 +02:00
parent 6b7ad2a297
commit 43d74c60d5
10 changed files with 35 additions and 28 deletions

View File

@@ -5,17 +5,17 @@ class GlobelusFirms
public static function order_fvat_switch( $order_id ) public static function order_fvat_switch( $order_id )
{ {
global $mdb; global $mdb;
if ( $mdb -> get( 'globelus_orders', 'fvat', [ 'id' => $order_id ] ) ) if ( $mdb -> get( 'globelus_orders', 'fvat', [ 'id' => $order_id ] ) )
$mdb -> update( 'globelus_orders', [ 'fvat' => 0 ], [ 'id' => $order_id ] ); $mdb -> update( 'globelus_orders', [ 'fvat' => 0 ], [ 'id' => $order_id ] );
else else
$mdb -> update( 'globelus_orders', [ 'fvat' => 1 ], [ 'id' => $order_id ] ); $mdb -> update( 'globelus_orders', [ 'fvat' => 1 ], [ 'id' => $order_id ] );
} }
public static function firm_enabled( $user_id ) public static function firm_enabled( $user_id )
{ {
global $mdb, $settings; global $mdb, $settings;
$mdb -> update( 'globelus_users', [ 'status' => 1 ], [ 'id' => $user_id ] ); $mdb -> update( 'globelus_users', [ 'status' => 1 ], [ 'id' => $user_id ] );
$email = $mdb -> get( 'globelus_users', 'email', [ 'id' => $user_id ] ); $email = $mdb -> get( 'globelus_users', 'email', [ 'id' => $user_id ] );
@@ -32,60 +32,60 @@ class GlobelusFirms
$regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|https?://).)*)(['\"][^>]*>)-i"; $regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|https?://).)*)(['\"][^>]*>)-i";
$text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text ); $text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text );
$send = \S::send_email( $email, 'Potwierdzenie aktywacji konta w portalu GLOBELUS.PL', $text ); // $send = \S::send_email( $email, 'Potwierdzenie aktywacji konta w portalu GLOBELUS.PL', $text );
return true; return true;
} }
public static function firm_details( $user_id ) public static function firm_details( $user_id )
{ {
global $mdb; global $mdb;
$g_user = $mdb -> get( 'globelus_users', '*', [ 'id' => $user_id ] ); $g_user = $mdb -> get( 'globelus_users', '*', [ 'id' => $user_id ] );
$g_user_data = $mdb -> get( 'globelus_firms_data', '*', [ 'user_id' => $user_id ] ); $g_user_data = $mdb -> get( 'globelus_firms_data', '*', [ 'user_id' => $user_id ] );
$g_user_data['country'] = $mdb -> get( 'globelus_countries', 'name', [ 'id' => $g_user_data['country_id'] ] ); $g_user_data['country'] = $mdb -> get( 'globelus_countries', 'name', [ 'id' => $g_user_data['country_id'] ] );
if ( is_array( $g_user_data ) ) if ( is_array( $g_user_data ) )
{ {
unset( $g_user_data['id'] ); unset( $g_user_data['id'] );
$g_user = array_merge( $g_user, $g_user_data ); $g_user = array_merge( $g_user, $g_user_data );
} }
$g_user['categories'] = $mdb -> select( 'globelus_firms_categories', 'category_id', [ 'user_id' => $user_id ] ); $g_user['categories'] = $mdb -> select( 'globelus_firms_categories', 'category_id', [ 'user_id' => $user_id ] );
$g_user['candidates'] = $mdb -> select( 'globelus_firms_candidates', 'candidate_id', [ 'user_id' => $user_id ] ); $g_user['candidates'] = $mdb -> select( 'globelus_firms_candidates', 'candidate_id', [ 'user_id' => $user_id ] );
return $g_user; return $g_user;
} }
public static function firm_delete( $user_id ) public static function firm_delete( $user_id )
{ {
global $mdb, $settings; global $mdb, $settings;
$email = \front\factory\GlobelusUser::get_email( $user_id ); $email = \front\factory\GlobelusUser::get_email( $user_id );
$answers_cv = $mdb -> select( 'globelus_adverts_answers', 'cv', [ 'AND' => [ 'user_id' => $user_id, 'cv[!]' => null ] ] ); $answers_cv = $mdb -> select( 'globelus_adverts_answers', 'cv', [ 'AND' => [ 'user_id' => $user_id, 'cv[!]' => null ] ] );
if ( is_array( $answers_cv ) and count( $answers_cv ) ) foreach ( $answers_cv as $cv ) if ( is_array( $answers_cv ) and count( $answers_cv ) ) foreach ( $answers_cv as $cv )
{ {
if ( '../' . file_exists( $cv ) ) if ( '../' . file_exists( $cv ) )
unlink( '../' . $cv ); unlink( '../' . $cv );
} }
$mdb -> delete( 'globelus_adverts', [ 'user_id' => $user_id ] ); $mdb -> delete( 'globelus_adverts', [ 'user_id' => $user_id ] );
$mdb -> delete( 'globelus_adverts_answers', [ 'user_id' => $user_id ] ); $mdb -> delete( 'globelus_adverts_answers', [ 'user_id' => $user_id ] );
$cv_file = \front\factory\GlobelusCandidates::cv_url( $user_id ); $cv_file = \front\factory\GlobelusCandidates::cv_url( $user_id );
if ( file_exists( '../' . $cv_file ) ) if ( file_exists( '../' . $cv_file ) )
unlink( '../' . $cv_file ); unlink( '../' . $cv_file );
$avatar_img = \front\factory\GlobelusCandidates::avatar_url( $user_id ); $avatar_img = \front\factory\GlobelusCandidates::avatar_url( $user_id );
if ( file_exists( '../' . $avatar_img ) ) if ( file_exists( '../' . $avatar_img ) )
unlink( '../' . $avatar_img ); unlink( '../' . $avatar_img );
$logo_img = \front\factory\GlobelusFirms::logo_url( $user_id ); $logo_img = \front\factory\GlobelusFirms::logo_url( $user_id );
if ( file_exists( '../' . $avatar_img ) ) if ( file_exists( '../' . $avatar_img ) )
unlink( '../' . $avatar_img ); unlink( '../' . $avatar_img );
$mdb -> delete( 'globelus_users', [ 'id' => $user_id ] ); $mdb -> delete( 'globelus_users', [ 'id' => $user_id ] );
$text = $settings['newsletter_header']; $text = $settings['newsletter_header'];
$text .= \front\factory\Newsletter::get_template( '#globelus-usnieto-konto' ); $text .= \front\factory\Newsletter::get_template( '#globelus-usnieto-konto' );
$text .= $settings['newsletter_footer_1']; $text .= $settings['newsletter_footer_1'];
@@ -99,7 +99,7 @@ class GlobelusFirms
$text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text ); $text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text );
$send = \S::send_email( $email, 'Twoje konto w serwisie GLOBELUS.PL zostało usunięte!', $text ); $send = \S::send_email( $email, 'Twoje konto w serwisie GLOBELUS.PL zostało usunięte!', $text );
return true; return true;
} }
} }

View File

@@ -382,7 +382,7 @@ class GlobelusUser
$regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|https?://).)*)(['\"][^>]*>)-i"; $regex = "-(<a[^>]+href\s*=\s*['\"])(((?!'|\"|https?://).)*)(['\"][^>]*>)-i";
$text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text ); $text = preg_replace( $regex, "$1" . $base . "://" . $_SERVER['SERVER_NAME'] . "$2$4", $text );
$send = \S::send_email( $email, $lang['potwierdzenie-aktywacji-konta-w-portalu'] . ' GLOBELUS.PL', $text ); // $send = \S::send_email( $email, $lang['potwierdzenie-aktywacji-konta-w-portalu'] . ' GLOBELUS.PL', $text );
} }
return true; return true;
} }

View File

@@ -306,8 +306,15 @@ ol {
&.btn-profile { &.btn-profile {
float: left; float: left;
@media (max-width: 767px) {
float: none;
width: 100%;
margin-bottom: 10px;
}
&.btn-success { &.btn-success {
padding: 15px; padding: 15px;
white-space: wrap;
} }
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -188,6 +188,7 @@
?> ?>
</div> </div>
</div> </div>
<div class="col-12">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="form-group row"> <div class="form-group row">

View File

@@ -231,6 +231,5 @@
<a href="<?= $this -> next_profile;?>" id="next-cv" class="btn btn-system"><?= $lang['nastepny-kandydat'];?></a> <a href="<?= $this -> next_profile;?>" id="next-cv" class="btn btn-system"><?= $lang['nastepny-kandydat'];?></a>
<? endif;?> <? endif;?>
</div> </div>
<a href="javascript:history.go(-1);" class="btn btn-dark btn-back"><?= $lang['wstecz'];?></a>
</div> </div>
<? \front\factory\GlobelusCandidates::profile_visits_increase( $this -> candidate['id'], $this -> g_user['id'] );?> <? \front\factory\GlobelusCandidates::profile_visits_increase( $this -> candidate['id'], $this -> g_user['id'] );?>

View File

@@ -29,7 +29,7 @@
<div class="row"> <div class="row">
<div class="col-12 col-sm-8"> <div class="col-12 col-sm-8">
<h2> <h2>
<a href="/proponowany-kandydat/<?= $candidate['id'];?>/<?= \S::seo( $candidate['surname'] . ' ' . $candidate['name'], true );?>/" title="Kandydat: <?= addslashes( $candidate['surname'] . ' ' . $candidate['name'] );?>"><?= $candidate['surname'] . ' ' . $candidate['name'];?></a> <a href="/proponowany-kandydat/<?= $candidate['id'];?>/<?= \S::seo( $candidate['surname'] . ' ' . $candidate['name'], true );?>/" title="Kandydat: <?= addslashes( $candidate['surname'] . ' ' . $candidate['name'] );?>" target="_blank"><?= $candidate['surname'] . ' ' . $candidate['name'];?></a>
</h2> </h2>
</div> </div>
<div class="col-12 col-sm-4 sex-and-birth"> <div class="col-12 col-sm-4 sex-and-birth">

View File

@@ -58,7 +58,7 @@ if ( !$accessToken )
</div> </div>
<div class="form-group row agremment-profile"> <div class="form-group row agremment-profile">
<div class="col-12 col-sm-8 offset-sm-4"> <div class="col-12 col-sm-8 offset-sm-4">
<input type="checkbox" required id="agremment-profile"> * <?= $lang['rejestracja-zgoda-na-wyswietlenie-profilu'];?> <input type="checkbox" id="agremment-profile"> <?= $lang['rejestracja-zgoda-na-wyswietlenie-profilu'];?>
</div> </div>
</div> </div>
<div class="form-group row agremment-marketing"> <div class="form-group row agremment-marketing">

View File

@@ -305,12 +305,12 @@
</div> </div>
<div class="form-group row agremment-profile"> <div class="form-group row agremment-profile">
<div class="col-12"> <div class="col-12">
<input type="checkbox" id="agremment-profile" name="agremment_profile" required > * <?= $lang['rejestracja-zgoda-na-wyswietlenie-profilu'];?> <input type="checkbox" id="agremment-profile" name="agremment_profile"> <?= $lang['rejestracja-zgoda-na-wyswietlenie-profilu'];?>
</div> </div>
</div> </div>
<div class="form-group row agremment-marketing"> <div class="form-group row agremment-marketing">
<div class="col-12"> <div class="col-12">
<input type="checkbox" id="agremment-marketing" name="agremment_marketing" > Wyrażam zgodę na kontakt mailowy i/lub telefoniczny ze strony globelus.pl <input type="checkbox" id="agremment-marketing" name="agremment_marketing"> Wyrażam zgodę na kontakt mailowy i/lub telefoniczny ze strony globelus.pl
</div> </div>
</div> </div>
<div class="row"> <div class="row">