fix language include, consolidate misc files, last alpha for now

This commit is contained in:
Josh North 2017-05-12 11:07:03 -04:00
parent 9397a0f169
commit 351b9c3eeb
11 changed files with 100 additions and 86 deletions

View File

@ -20,8 +20,8 @@ $yaptc_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Advanced
$yaptc_db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); // Advanced PDO handling
$_SESSION['yaptc_dir'] = $yaptc_dirpath; // Put absolute directory path in session
$_SESSION['yaptc_url'] = $yaptc_webpath; // Put absolute url path in session
$yaptc_inc = $yaptc_dirpath . 'includes/'; // Concatenate an includes directory path
$yaptc_incweb = $yaptc_webpath . 'includes/'; // Concatenate an includes url path
$yaptc_inc = $yaptc_dirpath . 'inc/'; // Concatenate an includes directory path
$yaptc_incweb = $yaptc_webpath . 'inc/'; // Concatenate an includes url path
$yaptc_lib = $yaptc_dirpath . 'lib/'; // Concatenate a lib directory path
$yaptc_libweb = $yaptc_webpath . 'lib/'; // Concatenate a lib url path
$yaptc_lang = $yaptc_dirpath . 'lang/' . $yaptc_language . 'lang.php'; // Concatenate a language url path

21
inc/LICENSE (bootstrap) Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2011-2016 Twitter, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

0
LICENSE (fpdf) → inc/LICENSE (fpdf) Executable file → Normal file
View File

0
LICENSE (phpass) → inc/LICENSE (phpass) Executable file → Normal file
View File

0
LICENSE → inc/LICENSE (yaptc) Executable file → Normal file
View File

View File

@ -1,84 +1,10 @@
<?php
// Languages
function lang($phrase){
static $lang = array(
'ACCOUNT_INFO_HEADER' => 'Account Information',
'ACCOUNT_INFO_DESC' => 'You may make changes to your user profile below. To change your password, enter a new password twice below and press save. Minimum password length is ',
'USER_LIST_HEADER' => 'User List',
'USER_LIST_DESC' => 'Delete or Punch users from the actions column. Eventually, password resets will also be enabled.',
'PUNCH_HISTORY_HEADER' => 'Punch History',
'PUNCH_HISTORY_DESC' => 'The following is your entire punch history, most recent first.',
'NO_PUNCHES' => 'You have no recorded punches',
'NOT_AUTHORIZED' => 'Not Authorized!',
'OUT' => 'Out',
'PAGE' => 'Page',
'IN' => 'In',
'ADD_USER' => 'Add User',
'ADD_USER_DESC' => 'All fields are required! Username and email must be unique. Minimum password length is ',
'HOURS' => 'Hours',
'FLAG' => 'Flag',
'NOTES' => 'Notes',
'HOME' => 'Home',
'LOGIN' => 'Login',
'LOGOUT' => 'Logout',
'ACCOUNT' => 'Account',
'META_DESC' => 'YAPTC Timecard system is a time recording application for small businesses.',
'USERS' => 'Manage Users',
'SAVE_PUNCH_WARNING' => 'Are you sure you want to save the edit to this user punch?',
'SAVE' => 'Save',
'DELETE' => 'Delete',
'NEW' => 'New',
'NAME' => 'Name',
'CONFIRM' => 'Confirm',
'PUNCH' => 'Punch',
'NOTES_PLACEHOLDER' => 'Enter notes if needed',
'USERNAME' => 'Username',
'DELETE_WARNING' => '********* WARNING! ********** Are you SURE you want to DELETE this user AND ALL ASSOCIATED PUNCHES!?!? There is NO UNDO!',
'ACTIONS' => 'Actions',
'CREATED' => 'Created',
'MIN_PASSWORD_LENGTH' => 'Minimum password length is ',
'USERTYPE' => 'User Type',
'EDIT_PROFILE' => 'Edit Profile',
'ILLEGAL_CHARACTERS' => 'Username contains illegal characters',
'PASSWORD_NOTMATCH' => 'Passwords do not match',
'EMAIL_NOTVALID' => 'Email address not valid',
'USERNAME_NOTEMPTY' => 'Username cannot be empty',
'PASSWORD_NOTEMPTY' => 'Password cannot be empty',
'USERNAME_USED' => 'Username already in use',
'EMAIL_USED' => 'Email already in use',
'PASSWORD_NOTCONFIRMED' => 'Password must be confirmed',
'PASSWORD' => 'Password',
'USER' => 'User',
'FIRSTNAME' => 'First Name',
'LASTNAME' => 'Last Name',
'EMAIL' => 'E-Mail',
'USER_INFORMATION' => 'User Information',
'PUNCH_EDITOR' => 'Punch Edit',
'EDIT_PUNCH_HEADER' => 'User Punches',
'EDIT_PUNCH_DESC' => 'Edit or delete existing punches for users if needed. WARNING - there is NO UNDO for these actions!!!',
'PLEASE_LOG_IN' => 'Please log in to use the timecard system',
'REPORTS' => 'Reports',
'SINCE' => 'since',
'PUNCH_STATUS' => 'Punch Status',
'SERVER_TIME' => 'Server Time',
'QUICK_PUNCH_PARAGRAPH' => 'Click below to immediately punch your time. You may enter notes for your administrator to review.',
'ADVANCED_PUNCH_PARAGRAPH' => 'Click the punch button to immediately punch your time. You may also make changes to the defaults. Note that changing the punch time will result in a flag on the punch for your administrator to review.',
'YOU_HAVE_BEEN_PUNCHED' => 'You have been punched',
'REPORTS_DESC' => 'The drop-down below can be used to select pre-configured reports. Other reports are currently being written.',
'QUICK_PUNCH' => 'Quick Punch',
'SOFTWARE_VERSION' => 'Software Version',
'ADVANCED_PUNCH' => 'Advanced Punch'
);
return $lang[$phrase];
}
// Current Time
$timenow = date('Y-m-d H:i:s');
// This Version
$yaptc_version = 'yaptc_v1.0-alpha';
$yaptc_version = 'yaptc_v1.0-alpha3';
// Timezone from config
date_default_timezone_set("$yaptc_timezone");

View File

@ -1,11 +1,74 @@
<?php return array(
// Set up language strings here
'NO_PUNCHES' => 'You have no recorded punches'
'QUICK_PUNCH' => 'Quick Punch'
<?php function lang($phrase){ static $lang = array(
//
// English Language File.
//
'ACCOUNT_INFO_HEADER' => 'Account Information',
'ACCOUNT_INFO_DESC' => 'You may make changes to your user profile below. To change your password, enter a new password twice below and press save. Minimum password length is ',
'USER_LIST_HEADER' => 'User List',
'USER_LIST_DESC' => 'Delete or Punch users from the actions column. Eventually, password resets will also be enabled.',
'PUNCH_HISTORY_HEADER' => 'Punch History',
'PUNCH_HISTORY_DESC' => 'The following is your entire punch history, most recent first.',
'NO_PUNCHES' => 'You have no recorded punches',
'NOT_AUTHORIZED' => 'Not Authorized!',
'OUT' => 'Out',
'PAGE' => 'Page',
'IN' => 'In',
'ADD_USER' => 'Add User',
'ADD_USER_DESC' => 'All fields are required! Username and email must be unique. Minimum password length is ',
'HOURS' => 'Hours',
'FLAG' => 'Flag',
'NOTES' => 'Notes',
'HOME' => 'Home',
'LOGIN' => 'Login',
'LOGOUT' => 'Logout',
'ACCOUNT' => 'Account',
'META_DESC' => 'YAPTC Timecard system is a time recording application for small businesses.',
'USERS' => 'Manage Users',
'SAVE_PUNCH_WARNING' => 'Are you sure you want to save the edit to this user punch?',
'SAVE' => 'Save',
'DELETE' => 'Delete',
'NEW' => 'New',
'NAME' => 'Name',
'CONFIRM' => 'Confirm',
'PUNCH' => 'Punch',
'NOTES_PLACEHOLDER' => 'Enter notes if needed',
'USERNAME' => 'Username',
'DELETE_WARNING' => '********* WARNING! ********** Are you SURE you want to DELETE this user AND ALL ASSOCIATED PUNCHES!?!? There is NO UNDO!',
'ACTIONS' => 'Actions',
'CREATED' => 'Created',
'MIN_PASSWORD_LENGTH' => 'Minimum password length is ',
'USERTYPE' => 'User Type',
'EDIT_PROFILE' => 'Edit Profile',
'ILLEGAL_CHARACTERS' => 'Username contains illegal characters',
'PASSWORD_NOTMATCH' => 'Passwords do not match',
'EMAIL_NOTVALID' => 'Email address not valid',
'USERNAME_NOTEMPTY' => 'Username cannot be empty',
'PASSWORD_NOTEMPTY' => 'Password cannot be empty',
'USERNAME_USED' => 'Username already in use',
'EMAIL_USED' => 'Email already in use',
'PASSWORD_NOTCONFIRMED' => 'Password must be confirmed',
'PASSWORD' => 'Password',
'USER' => 'User',
'FIRSTNAME' => 'First Name',
'LASTNAME' => 'Last Name',
'EMAIL' => 'E-Mail Address',
'USER_INFORMATION' => 'User Information',
'PUNCH_EDITOR' => 'Punch Edit',
'EDIT_PUNCH_HEADER' => 'Edit Punches',
'EDIT_PUNCH_DESC' => 'Edit or delete existing punches for users if needed. WARNING - there is NO UNDO for these actions!!!',
'PLEASE_LOG_IN' => 'Please Log In',
'REPORTS' => 'Reports',
'SINCE' => 'since',
'PUNCH_STATUS' => 'Punch Status',
'SERVER_TIME' => 'Server Time',
'QUICK_PUNCH_PARAGRAPH' => 'Click below to immediately punch your time. You may enter notes for your administrator to review.',
'ADVANCED_PUNCH_PARAGRAPH' => 'Click the punch button to immediately punch your time. You may also make changes to the defaults. Note that changing the punch time will result in a flag on the punch for your administrator to review.',
'YOU_HAVE_BEEN_PUNCHED' => 'You have been punched',
'REPORTS_DESC' => 'The drop-down below can be used to select pre-configured reports. Other reports are currently being written.',
'QUICK_PUNCH' => 'Quick Punch',
'SOFTWARE_VERSION' => 'Software Version',
'ADVANCED_PUNCH' => 'Advanced Punch'
// EOF
); ?>
// END OF STRINGS
); return $lang[$phrase]; } ?>

View File

@ -2,6 +2,7 @@
session_start();
require_once("config.inc.php");
require_once($yaptc_inc . "functions.inc.php");
require_once($yaptc_lang);
$yaptc_pagename = lang('LOGIN');
$yaptc_pageicon = '<i class="fa fa-sign-in"></i> ';
require_once($yaptc_inc . "header.inc.php");
@ -43,6 +44,9 @@ endif;
<input type="password" id="password" name="password" class="form-control" placeholder="<?php echo lang('PASSWORD'); ?>" required>
<button class="btn btn-lg btn-primary btn-block" type="submit" name="login"><?php echo lang('LOGIN'); ?></button>
</form>
<?php echo lang('LOGIN'); ?>
</div>
<!-- ********** END CONTENT ********** -->