-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugs fixed and code refactored, again.
- Loading branch information
Showing
14 changed files
with
180 additions
and
139 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php if ($pagenow == 'admin.php?page=support-hours'): ?> | ||
<h3><?php _e('Activities', $this->plugin_name); ?></h3> | ||
<?php endif; ?> | ||
<table class="worktable" width="100%"> | ||
<thead> | ||
<tr> | ||
<th width="20%"><?php _e('Date', $this->plugin_name); ?></th> | ||
<th width="50%"><?php _e('Description', $this->plugin_name); ?></th> | ||
<th width="30%"><?php _e('Time used', $this->plugin_name); ?></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php | ||
$i = 0; | ||
foreach ( array_reverse($workFields) as $field ) { ?> | ||
<tr> | ||
<td><?php if(!empty($field['used'])) echo $field['date'] ?></td> | ||
<td><?php if(!empty($field['used'])) echo $field['description'] ?></td> | ||
<td><?php if(!empty($field['used'])) echo $field['used'] ?></td> | ||
</tr> | ||
<?php | ||
$i++; | ||
if ($i >= 5){ | ||
break; | ||
} | ||
} | ||
?> | ||
</tbody> | ||
</table> | ||
<div class="total"> | ||
<span class="bold"><?php _e('Total', $this->plugin_name); ?></span> | ||
<span>: <?php echo AddTime($workFields); ?></span> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* Provide a admin area view for the plugin | ||
* Provide a admin widget for the plugin | ||
* | ||
* This file is used to markup the admin-facing aspects of the plugin. | ||
* | ||
* @link http://basedonline.nl | ||
* @since 1.0.0 | ||
* | ||
* @package Support_Hours | ||
* @subpackage Support_Hours/admin/partials | ||
* @subpackage Support_Hours/admin | ||
*/ | ||
// check if user is set or is empty. | ||
if(!empty($users) && !empty($bought_hours)): | ||
$user_ID = get_current_user_id(); | ||
|
||
// several includes to modulize the code. | ||
$user_ID = get_current_user_id(); | ||
$i = 0; | ||
global $pagenow; | ||
|
||
if(!empty($users) && (!empty($bought_hours) || $bought_hours == '00:00' ) && !empty($email)): | ||
|
||
include_once( 'partials/support-hours-admin-widget-clock.php' ); | ||
include_once( 'partials/support-hours-admin-widget-hourTable.php' ); | ||
|
||
if ( !empty($workFields[0]['date']) ) : | ||
include_once( 'partials/support-hours-admin-widget-workTable.php' ); | ||
endif; | ||
|
||
include_once( 'partials/support-hours-admin-widget-bottomMessage.php' ); | ||
elseif(empty($users)): | ||
// if $users is empty or users do not match. | ||
?> | ||
|
||
<p> | ||
<a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo admin_url( 'admin.php?page=support-hours-settings' ); ?>"> | ||
<?php _e( 'Configure plugin!', $this->plugin_name); ?> | ||
</a> | ||
</p> | ||
elseif(empty($users) || empty($email)): | ||
?> | ||
|
||
<?php | ||
else: | ||
// user is set but $bought_hours is empty. | ||
?> | ||
|
||
<h4> | ||
<?php _e( 'No support Hours bought', $this->plugin_name); ?>. | ||
</h4> | ||
<p> | ||
<?php _e( 'Contact me via', $this->plugin_name); ?> <a href="mailto:<?php echo $email;?>"><?php echo $email;?></a> | ||
</p> | ||
|
||
<?php endif; ?> | ||
<p> | ||
<a class="button button-primary button-hero load-customize hide-if-no-customize" href="<?php echo admin_url( 'admin.php?page=support-hours-settings' ); ?>"> | ||
<?php _e( 'Configure plugin!', $this->plugin_name); ?> | ||
</a> | ||
</p> | ||
|
||
<?php else: ?> | ||
|
||
<h4> | ||
<?php _e( 'No support Hours bought', $this->plugin_name); ?>. | ||
</h4> | ||
<p> | ||
<?php _e( 'Contact me via', $this->plugin_name); ?> <a href="mailto:<?php echo $email;?>"><?php echo $email;?></a> | ||
</p> | ||
|
||
<?php endif; ?> |
Binary file not shown.
Oops, something went wrong.